Esempio n. 1
0
        protected bool OnUpdateTimer()
        {
            if ((calState != CalibrationState.ZeroActual) && (calState != CalibrationState.FullScaleActual) && (!forced))
            {
                valTb.text = GetCalibrationValue().ToString("F2");
                valTb.QueueDraw();
            }

            return(true);
        }
Esempio n. 2
0
        protected void NextStep()
        {
            string step, action;
            bool   done = tests[testIdx].GetNextStep(out step, out action);

            stepLabel.text   = step;
            actionLabel.text = action;

            if (!string.Equals(action, "NOP", StringComparison.InvariantCultureIgnoreCase))
            {
                if (action.StartsWith("Timer", StringComparison.InvariantCultureIgnoreCase))
                {
                    try {
                        int start = action.IndexOf('(');
                        actionOption                = Convert.ToInt32(action.Substring(start + 1, action.Length - 2 - start)) * 5;
                        currentTime                 = actionOption;
                        stepButton.text             = "Start Timer";
                        timerProgress.Visible       = true;
                        timerProgress.progress      = 100.0f;
                        timerProgress.progressColor = "pri";
                        timerLabel.Visible          = true;
                        timerLabel.text             = string.Format("{0:D} secs", currentTime / 5);
                        skipBtn.Visible             = true;
                    } catch {
                        Restart();
                        MessageBox.Show("Invalid procedure command");
                    }
                }
                else if (action.StartsWith("Record", StringComparison.InvariantCultureIgnoreCase))
                {
                    try {
                        int start = action.IndexOf('(');
                        actionOption = Convert.ToInt32(action.Substring(start + 1, action.Length - 2 - start));
                        if ((actionOption != 1) && (actionOption != 2))
                        {
                            Restart();
                            MessageBox.Show("Invalid procedure command");
                        }
                        else
                        {
                            stepButton.text = "Enter titration level";
                        }
                    } catch {
                        Restart();
                        MessageBox.Show("Invalid procedure command");
                    }
                }
            }

            if (done)
            {
                stepButton.text        = "Done";
                stepButton.buttonColor = "compl";
                string result = String.Format("{0:f2} {1}", tests[testIdx].CalculateResults(), tests[testIdx].unit);
                stepLabel.text = result;
                Logger.Add("Tested {0}, result is {1}", tests[testIdx].name, result);
            }

            stepLabel.QueueDraw();
            actionLabel.QueueDraw();
            stepButton.QueueDraw();
        }
Esempio n. 3
0
 protected void OnProgressChanging(object sender, ProgressChangeEventArgs args)
 {
     requestedTextBox.text = string.Format("{0:N2}", args.currentProgress * 100.0f);
     requestedTextBox.QueueDraw();
 }