Skip to content

Commit a3ce85f

Browse files
Use override values of temp and humidity for dew point if active
1 parent 1c54f9f commit a3ce85f

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

ObservingConditionsSimulator/OCSimulator.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ public static double CloudCover()
520520

521521
public static double DewPoint()
522522
{
523-
double dewPoint = GetSensorValue(PROPERTY_DEWPOINT); ;
523+
double dewPoint = GetSensorValue(PROPERTY_DEWPOINT);
524524
LogMessage("DewPoint", dewPoint.ToString());
525525
return dewPoint;
526526
}
@@ -758,7 +758,21 @@ private static void RefreshTimer_Elapsed(object sender, System.Timers.ElapsedEve
758758
if ((Property == PROPERTY_HUMIDITY) || (Property == PROPERTY_TEMPERATURE))
759759
{
760760
Sensors[PROPERTY_DEWPOINT].TimeOfLastUpdate = mostRecentUpdateTime;
761-
Sensors[PROPERTY_DEWPOINT].SimCurrentValue = Humidity2DewPoint(Sensors[PROPERTY_HUMIDITY].SimCurrentValue, Sensors[PROPERTY_TEMPERATURE].SimCurrentValue); // Set the new simulator dewpoint value
761+
var _humidity = Sensors[PROPERTY_HUMIDITY].SimCurrentValue;
762+
var _temperature = Sensors[PROPERTY_TEMPERATURE].SimCurrentValue;
763+
764+
//Use the Override value if it is in use
765+
if (Sensors[PROPERTY_HUMIDITY].Override)
766+
{
767+
_humidity = Sensors[PROPERTY_HUMIDITY].OverrideValue;
768+
}
769+
770+
if (Sensors[PROPERTY_TEMPERATURE].Override)
771+
{
772+
_temperature = Sensors[PROPERTY_TEMPERATURE].OverrideValue;
773+
}
774+
775+
Sensors[PROPERTY_DEWPOINT].SimCurrentValue = Humidity2DewPoint(_humidity, _temperature); // Set the new simulator dewpoint value
762776
}
763777
}
764778
}

0 commit comments

Comments
 (0)