Add a "Pot reset to ambient temperature" button, sim-only
New btn_pot_reset next to the ambient entry, sends {"Pot": {"Reset":
true}}; tasks/pot.py's PotTask.recv() (previously a no-op) now resets
the plant to its current ambient temperature (Pot.initial()) on that
command.
The button only appears when the server reports its Pot is simulated
(new "PlantSim" field on the System channel, derived from
config.json's previously-unused Controller.plant_name) - resetting a
simulated plant's temperature is meaningless for a real one.
This commit is contained in:
+3
-1
@@ -20,7 +20,9 @@ class PotTask(ATask):
|
||||
asyncio.create_task(self.send({'Temp': value}))
|
||||
|
||||
async def recv(self, data):
|
||||
pass
|
||||
for pair in data.items():
|
||||
if 'Reset' in pair[0]:
|
||||
self.plant.initial(self.plant.theta_amb)
|
||||
|
||||
async def send(self, data):
|
||||
await self.msg_handler.send(data)
|
||||
|
||||
Reference in New Issue
Block a user