feat: include full config and plant param changes in Sud run log

Each log_*.json now carries a "Config" key (the full server config) and
a "PlantParams" list of {t, params} entries — one per step transition —
so offline analysis tools have the PID gains and plant model that were
active at every point of the run without having to cross-reference a
separate config file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 22:59:55 +02:00
co-authored by Claude Sonnet 4.6
parent bb5af3c0ed
commit 4de6efcf82
3 changed files with 33 additions and 3 deletions
+8
View File
@@ -111,8 +111,14 @@ class SudTask(ATask):
# when the current step has temperature=None (inherits from a prior step).
self._paused_temp_soll = None
self._on_end = None
self._on_plant_params = None
msg_handler.set_recv_handler(self.recv)
def set_on_plant_params(self, callback):
"""Register a callback invoked whenever apply_plant_params() fires,
so external observers (e.g. SudLogTask) can record each change."""
self._on_plant_params = callback
def apply_plant_params(self, grain_mass, water_mass):
"""Keeps the real plant's and the controller's internal model's
plant params in sync with this Sud's own doc - L/Td come straight
@@ -129,6 +135,8 @@ class SudTask(ATask):
params = self.sud.derive_plant_params(grain_mass, water_mass)
self.pot.set_plant_params(params)
self.tc.set_model_plant_params(params)
if self._on_plant_params:
self._on_plant_params(self.sud.elapsed, params)
def apply_stirrer(self, phase):
stirrer_cfg = phase.get('stirrer', {})