コード例 #1
0
        public void ReadProfile(IProfile driverProfile)
        {
            OCSimulator.LogMessage("Sensor.ReadProfile", "Starting to read profile values");

            SimFromValue = Convert.ToDouble(driverProfile.GetValue(SensorName + OCSimulator.SIMFROMVALUE_PROFILENAME, OCSimulator.SimulatorDefaultFromValues[SensorName].ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " SimFromValue: " + SimFromValue);

            SimToValue = Convert.ToDouble(driverProfile.GetValue(SensorName + OCSimulator.SIMTOVALUE_PROFILENAME, OCSimulator.SimulatorDefaultToValues[SensorName].ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " SimToValue: " + SimToValue);

            IsImplemented = Convert.ToBoolean(driverProfile.GetValue(SensorName + OCSimulator.IS_IMPLEMENTED_PROFILENAME, OCSimulator.IS_IMPLEMENTED_DEFAULT), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " Is Implemented: " + IsImplemented.ToString());

            ShowNotReady = Convert.ToBoolean(driverProfile.GetValue(SensorName + OCSimulator.SHOW_NOT_READY_PROFILENAME, OCSimulator.SHOW_NOT_READY_DEFAULT), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " ShowNotReady: " + ShowNotReady.ToString());

            NotReadyDelay = Convert.ToDouble(driverProfile.GetValue(SensorName + OCSimulator.NOT_READY_DELAY_PROFILENAME, OCSimulator.NOT_READY_DELAY_DEFAULT), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " NotReadyDelay: " + NotReadyDelay.ToString());

            ValueCycleTime = Convert.ToDouble(driverProfile.GetValue(SensorName + OCSimulator.VALUE_CYCLE_TIME_PROFILE_NAME, OCSimulator.VALUE_CYCLE_TIME_DEFAULT), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " Value CycleTime: " + ValueCycleTime.ToString());

            Override = Convert.ToBoolean(driverProfile.GetValue(SensorName + OCSimulator.OVERRIDE_PROFILENAME, OCSimulator.OVERRIDE_DEFAULT), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " Override: " + Override.ToString());

            OverrideValue = Convert.ToDouble(driverProfile.GetValue(SensorName + OCSimulator.OVERRIDE_VALUE_PROFILENAME, OCSimulator.SimulatorDefaultFromValues[SensorName].ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture);
            OCSimulator.LogMessage("Sensor.ReadProfile" + " OverrideValue: " + OverrideValue.ToString());

            OCSimulator.LogMessage("Sensor.ReadProfile", "Completed reading profile values");
        }
コード例 #2
0
        public void WriteProfile(Profile driverProfile)
        {
            OCSimulator.TL.LogMessage("Sensor.WriteProfile", "Starting to write profile values");

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " SimFromValue: " + SimFromValue);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.SIMFROMVALUE_PROFILENAME, SimFromValue.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " SimToValue: " + SimToValue);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.SIMTOVALUE_PROFILENAME, SimToValue.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " Is Implemented: " + IsImplemented);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.IS_IMPLEMENTED_PROFILENAME, IsImplemented.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " ShowNotReady: " + ShowNotReady);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.SHOW_NOT_READY_PROFILENAME, ShowNotReady.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " NotReadyDelay: " + NotReadyDelay);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.NOT_READY_DELAY_PROFILENAME, NotReadyDelay.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " Value Cycle Time: " + ValueCycleTime);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.VALUE_CYCLE_TIME_PROFILE_NAME, ValueCycleTime.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " Override: " + Override);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.OVERRIDE_PROFILENAME, Override.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " OverrideValue: " + OverrideValue);
            driverProfile.WriteValue(OCSimulator.DRIVER_PROGID, OCSimulator.OVERRIDE_VALUE_PROFILENAME, OverrideValue.ToString(CultureInfo.InvariantCulture), SensorName);

            OCSimulator.TL.LogMessage("Sensor.WriteProfile", SensorName + " Completed writing profile values");
        }