Add set_model_power no-op stub to TempControllerBase
The Normal controller had no set_model_power(), causing callers to guard with hasattr() instead of relying on a stable interface. Adding a no-op stub to the base class means all controllers have the method; TempControllerSmith overrides it to actually update its internal model. Remove the now-redundant hasattr guards at both call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tqxrk8uj4M3w3d3eXm3xK8
This commit is contained in:
@@ -89,6 +89,9 @@ class TempControllerBase(APid):
|
||||
def post_pid(self):
|
||||
pass
|
||||
|
||||
def set_model_power(self, power):
|
||||
pass
|
||||
|
||||
def set_theta_ist(self, value):
|
||||
self.theta_ist_set = value
|
||||
if self.is_startup:
|
||||
|
||||
@@ -181,8 +181,7 @@ class SudForecastEstimator:
|
||||
tc.process()
|
||||
power = actuate(tc.get_power())
|
||||
pot.set_power(power)
|
||||
if hasattr(tc, 'set_model_power'):
|
||||
tc.set_model_power(power)
|
||||
tc.set_model_power(power)
|
||||
|
||||
if sud.state == SudState.RAMPING:
|
||||
if tc.is_holding():
|
||||
|
||||
Reference in New Issue
Block a user