示例#1
0
        /// <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());
            }
        }
示例#2
0
        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
        }
示例#3
0
 public string CommandString(string command, bool raw)
 {
     return(OCSimulator.CommandString(clientNumber, command, raw));
 }
示例#4
0
 public bool CommandBool(string command, bool raw)
 {
     return(OCSimulator.CommandBool(clientNumber, command, raw));
 }
示例#5
0
 public void CommandBlind(string command, bool raw)
 {
     OCSimulator.CommandBlind(clientNumber, command, raw);
 }
示例#6
0
 public string Action(string actionName, string actionParameters)
 {
     return(OCSimulator.Action(clientNumber, actionName, actionParameters));
 }
示例#7
0
 /// <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);
 }
示例#8
0
 public double TimeSinceLastUpdate(string PropertyName)
 {
     return(OCSimulator.TimeSinceLastUpdate(clientNumber, PropertyName));
 }
示例#9
0
 public string SensorDescription(string PropertyName)
 {
     return(OCSimulator.SensorDescription(clientNumber, PropertyName));
 }
示例#10
0
 public void Refresh()
 {
     OCSimulator.Refresh(clientNumber);
 }