Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC: Make RC GUI fit according to max received value #1502

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MAVProxy/modules/lib/wxrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,23 @@ def update_gauges(self, msg):
for i, gauge in enumerate(self.rc_gauges):
if msg.get_type() == 'RC_CHANNELS' and self.panelType == PanelType.RC_IN:
value = getattr(msg, 'chan{0}_raw'.format(i+1), 0)
if value > gauge.GetRange():
gauge.SetRange(value + 50)
gauge.SetValue(value)
gauge.Refresh()
elif (msg.get_type() == 'SERVO_OUTPUT_RAW' and self.panelType == PanelType.SERVO_OUT and
getattr(msg, 'port', 0) == 0) and i < 16:
value = getattr(msg, 'servo{0}_raw'.format(i+1), 0)
if value > gauge.GetRange():
gauge.SetRange(value + 50)
gauge.SetValue(value)
gauge.Refresh()
elif (msg.get_type() == 'SERVO_OUTPUT_RAW' and self.panelType == PanelType.SERVO_OUT and
getattr(msg, 'port', 0) == 1) and i >= 17:
# 2nd bank of servos (17-32), if used
value = getattr(msg, 'servo{0}_raw'.format(i+1-16), 0)
if value > gauge.GetRange():
gauge.SetRange(value + 50)
gauge.SetValue(value)
gauge.Refresh()
return 0
Expand Down