heater_name/sensor_name/plant_name were three independent config keys, each picked via its own factory - in practice sim and real hardware are never actually mixed and matched, so this could (nonsensically) disagree, e.g. a real heater paired with a simulated sensor. Add PlantFactory (components/plant/plant_factory.py): plant_name alone now builds the whole rig together. "sim" gets HeaterSim/Pot (the modeled plant, as before)/TempSensorSim. Anything else gets HeaterHendi/PotReal/TempSensor_max31865 - PotReal is a new, deliberately unmodeled Pot for the real, physical kettle (components/plant/pot_real.py): the real temperature comes straight from the real sensor, not from a model, so it just accepts and ignores set_plant_params()/ set_ambient_temperature()/initial() and reports no temperature of its own, satisfying PotTask/SudTask's interface with nothing to actually simulate. heater_name/sensor_name are gone from config.json.templ; server/brewpi.py delegates to HeaterFactory/TempSensorFactory lazily from inside PlantFactory, same as before, so real hardware's spidev/pyserial deps still aren't needed just to import the module.
47 lines
664 B
Templ
47 lines
664 B
Templ
{
|
|
"ambient_temperature": 20,
|
|
"Controller" : {
|
|
"dt": 1,
|
|
"sim_warp_factor": 50.0,
|
|
"stirrer_name": "sim",
|
|
"plant_name": "sim",
|
|
"pid_type": "Smith"
|
|
},
|
|
"TempCtrl": {
|
|
"Hold": {
|
|
"kp": 0.4,
|
|
"ki": 0.0,
|
|
"kd": 0.0,
|
|
"kt": 0.0
|
|
},
|
|
"Heat": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Cool": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Thresholds": {
|
|
"HoldHeat": 1.0,
|
|
"HoldCool": 1.0,
|
|
"HeatHold": 1.0,
|
|
"HeatCool": 1.0,
|
|
"CoolHold": 1.0,
|
|
"CoolHeat": 1.0
|
|
}
|
|
},
|
|
"Heater": {
|
|
"port": "/dev/ttyUSB0",
|
|
"speed": "115200"
|
|
},
|
|
"Stirrer": {
|
|
"port": "/dev/ttyACM0",
|
|
"speed": "115200"
|
|
}
|
|
}
|