Inheritance: IPluginData
Exemple #1
0
        public override void TimerCallback(object state)
        {
            Debug.Print("pH Callback");
            AlkalinityData phData = new AlkalinityData();

            // get current pH Value
            phData.SetValue(CalculatePH());
            Debug.Print("pH = " + phData.GetValue().ToString("F"));

            //Timer Callbacks receive a Delegate in the state object
            InputDataAvailable ida = (InputDataAvailable)state;

            // call out to the delegate with expected value
            // TODO: Currently there is a glitch with SerialPort and
            // sometimes data doesn't come back from the Stamp.
            // Discard bad readings, and report any meaningful ones
            if (phData.GetValue() > 0.0F)
            {
                ida(phData);
            }
        }
        public override void TimerCallback(object state)
        {
            Debug.Print("pH Callback");
            AlkalinityData phData = new AlkalinityData();

            // get current pH Value
            phData.SetValue(CalculatePH());
            Debug.Print("pH = " + phData.GetValue().ToString("F"));

            //Timer Callbacks receive a Delegate in the state object
            InputDataAvailable ida = (InputDataAvailable)state;

            // call out to the delegate with expected value
            // TODO: Currently there is a glitch with SerialPort and
            // sometimes data doesn't come back from the Stamp.
            // Discard bad readings, and report any meaningful ones
            if (phData.GetValue() > 0.0F) ida(phData);
        }