Exemplo n.º 1
0
        private void StopCalibration(bool finished)
        {
            stepSizeUpDown.Enabled  = true;
            updateAvgUpDown.Enabled = true;
            waitUpDown.Enabled      = true;

            button1.Text      = "Calibrate...";
            calibrationActive = false;


            if (finished)
            {
                calibration.Identifier         = new Identifier(control.Identifier, "calibration_curve");
                control.Calibrated             = calibration;
                control.MaxRPM                 = curMax;
                useCalibrationCheckBox.Enabled = true;
                calibration.SaveValuesToSettings();
                calibrationProgressBar.Value = totalSteps;

                data.Points.Clear();
                foreach (PointF p in control.Calibrated)
                {
                    data.Points.Add(new DataPoint(p.X, p.Y));
                }
                plot.InvalidatePlot(true);
            }
            else
            {
                calibrationProgressBar.Value = 0;
            }
        }
Exemplo n.º 2
0
        public void SaveToSettings()
        {
            curve.SaveValuesToSettings();

            settings.SetValue(new Identifier(identifier, "valueString").ToString(), value.Input);
            settings.SetValue(new Identifier(identifier, "enabled").ToString(), enabled + "");
            settings.SetValue(new Identifier(identifier, "controlled").ToString(), controlled.Identifier.ToString());
            settings.SetValue(new Identifier(identifier, "name").ToString(), name);
            settings.SetValue(new Identifier(identifier, "hysteresis").ToString(), hysteresis);
            settings.SetValue(new Identifier(identifier, "inputSource").ToString(), (int)source);
            settings.SetValue(new Identifier(identifier, "sourceSensor").ToString(), sourceSensor.Identifier.ToString());
            settings.SetValue(new Identifier(identifier, "tryRestart").ToString(), tryRestart);
        }