Revert "Run the Pot simulation from server startup, not just once a Sud loads"
This reverts commit 63fa093a8a.
This commit is contained in:
+8
-8
@@ -75,15 +75,15 @@ if __name__ == '__main__':
|
||||
sensor_task = TempSensorTask(sensor, DT_TASK, dispatcher.msgio_get("Sensor"))
|
||||
taskmgr.add(sensor_task)
|
||||
|
||||
# Pot - seeded with the not-yet-loaded sud's own (now physically sane,
|
||||
# see Sud.EMPTY_SUD) plant params right away, same as ambient below, so
|
||||
# a simulated Pot already runs - manual heater power/Sud disabled or
|
||||
# not - instead of sitting inert until a real Sud loads (PotReal just
|
||||
# ignores this - see there). A real Sud's own doc still overrides
|
||||
# these the moment one is loaded (see tasks/sud.py's SudTask.
|
||||
# apply_plant_params()).
|
||||
# Pot - deliberately left without plant params (M/C/L/Td) here: a
|
||||
# Sud's own doc is the only source for those now (see tasks/sud.py's
|
||||
# SudTask.apply_plant_params(), called immediately on Load), so the
|
||||
# simulated Pot stays inert (Pot.is_configured() is False, PotTask
|
||||
# skips process() - see there) until one actually is loaded (PotReal
|
||||
# just ignores this - see there). Ambient is independent of any Sud
|
||||
# (a global setting, changeable live via the System channel - see
|
||||
# on_system_recv() below), so it's set right away regardless.
|
||||
pot.set_ambient_temperature(theta_amb)
|
||||
pot.set_plant_params(sud.derive_plant_params(sud.grain_mass, sud.water_mass))
|
||||
taskmgr.add(PotTask(pot, DT_TASK, dispatcher.msgio_get("Pot")))
|
||||
|
||||
heater.set_on_changed("power_eff", ChangedFloat(pot.set_power, prec=0).set)
|
||||
|
||||
Reference in New Issue
Block a user