/// <summary> /// Initializes a new instance of the <see cref="OCSimulator"/> class. /// Must be public for COM registration. /// </summary> public ObservingConditions() { try { TL = OCSimulator.TL; TL.LogMessage("ObservingConditions", "Starting initialisation"); clientNumber = OCSimulator.GetUniqueClientNumber(); TL.LogMessage(clientNumber, "ObservingConditions", "This instance's unique client number: " + clientNumber); TL.LogMessage(clientNumber, "ObservingConditions", "Completed initialisation"); } catch (Exception ex) { TL.LogMessageCrLf("ObservingConditions", ex.ToString()); } }
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 }
public string CommandString(string command, bool raw) { return(OCSimulator.CommandString(clientNumber, command, raw)); }
public bool CommandBool(string command, bool raw) { return(OCSimulator.CommandBool(clientNumber, command, raw)); }
public void CommandBlind(string command, bool raw) { OCSimulator.CommandBlind(clientNumber, command, raw); }
public string Action(string actionName, string actionParameters) { return(OCSimulator.Action(clientNumber, actionName, actionParameters)); }
/// <summary> /// Displays the Setup Dialogue form. /// If the user clicks the OK button to dismiss the form, then /// the new settings are saved, otherwise the old values are reloaded. /// THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED! /// </summary> public void SetupDialog() { OCSimulator.SetupDialog(clientNumber); }
public double TimeSinceLastUpdate(string PropertyName) { return(OCSimulator.TimeSinceLastUpdate(clientNumber, PropertyName)); }
public string SensorDescription(string PropertyName) { return(OCSimulator.SensorDescription(clientNumber, PropertyName)); }
public void Refresh() { OCSimulator.Refresh(clientNumber); }