Remove ["value"] in pwm values

This commit is contained in:
atse 2024-10-14 09:53:05 +08:00
parent 7f1223b1b9
commit d092c6f9a8
3 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class AsyncioClient:
pwm_report = await self.get_pwm() pwm_report = await self.get_pwm()
for pwm_channel in pwm_report: for pwm_channel in pwm_report:
for limit in ["max_i_neg", "max_i_pos", "max_v"]: for limit in ["max_i_neg", "max_i_pos", "max_v"]:
if pwm_channel[limit]["value"] == 0.0: if pwm_channel[limit] == 0.0:
logging.warning( logging.warning(
"`{}` limit is set to zero on channel {}".format( "`{}` limit is set to zero on channel {}".format(
limit, pwm_channel["channel"] limit, pwm_channel["channel"]

View File

@ -208,13 +208,13 @@ class CtrlPanel(QObject):
).set_value_with_lock(pwm_params["polarity"]) ).set_value_with_lock(pwm_params["polarity"])
self.params[channel].child( self.params[channel].child(
"output", "limits", "max_v" "output", "limits", "max_v"
).set_value_with_lock(pwm_params["max_v"]["value"]) ).set_value_with_lock(pwm_params["max_v"])
self.params[channel].child( self.params[channel].child(
"output", "limits", "max_i_pos" "output", "limits", "max_i_pos"
).set_value_with_lock(pwm_params["max_i_pos"]["value"]) ).set_value_with_lock(pwm_params["max_i_pos"])
self.params[channel].child( self.params[channel].child(
"output", "limits", "max_i_neg" "output", "limits", "max_i_neg"
).set_value_with_lock(pwm_params["max_i_neg"]["value"]) ).set_value_with_lock(pwm_params["max_i_neg"])
@pyqtSlot(list) @pyqtSlot(list)
def update_postfilter(self, postfilter_data): def update_postfilter(self, postfilter_data):

View File

@ -17,7 +17,7 @@ class ZeroLimitsWarningView(QObject):
for pwm_params in pwm_data: for pwm_params in pwm_data:
channel = pwm_params["channel"] channel = pwm_params["channel"]
for limit in "max_i_pos", "max_i_neg", "max_v": for limit in "max_i_pos", "max_i_neg", "max_v":
if pwm_params[limit]["value"] == 0.0: if pwm_params[limit] == 0.0:
channels_zeroed_limits[channel].add(limit) channels_zeroed_limits[channel].add(limit)
channel_disabled = [False, False] channel_disabled = [False, False]