private void btnEnable_Click(object sender, EventArgs e) { Button btnEnable = (Button)sender; // Get the control values into variables in the Sensors array foreach (string property in OCSimulator.SimulatedProperties) { OverrideView over = (OverrideView)Controls.Find("overrideView" + property, false)[0]; over.SaveUI(property); } // Provide an overridden dew point calculation OCSimulator.Sensors[OCSimulator.PROPERTY_DEWPOINT].OverrideValue = OCSimulator.util.Humidity2DewPoint(OCSimulator.Humidity(0), OCSimulator.Temperature(0)); OCSimulator.MinimiseOnStart = chkMinimise.Checked; // Write the Sensors array values to the Profile OCSimulator.WriteProfile(); DeactivateEnableButton(); // Deactivate the enable button }
private void frmMain_Load(object sender, EventArgs e) { // Minimise or bring the window into view as required if (OCSimulator.MinimiseOnStart) { this.WindowState = FormWindowState.Minimized; } else { this.WindowState = FormWindowState.Normal; } chkMinimise.Checked = OCSimulator.MinimiseOnStart; foreach (string property in OCSimulator.SimulatedProperties) { OverrideView over = (OverrideView)Controls.Find("overrideView" + property, false)[0]; over.InitUI(property); } DeactivateEnableButton(); // Deactivate the enable button }