Skip to content

Commit

Permalink
Merge pull request #217 from paulober/fix-202-var-name-errors
Browse files Browse the repository at this point in the history
Fix #202, naming error
  • Loading branch information
dzbaker committed Nov 14, 2022
2 parents 89d90e3 + 86914b7 commit 949be4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Subsystems/tlmGUI/GenericTelemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,26 @@ def display_telemetry_item(self, datagram, tlm_index, label_field, value_field):
except UnboundLocalError:
pass
tlm_field2 = datagram[item_start:item_start +
int(tlmItemSize[tlm_index])]
int(tlm_item_size[tlm_index])]
if tlm_field2:
tlm_field = unpack(tlm_field1, tlm_field2)
if tlm_item_display_type[tlm_index] == 'Dec':
value_field.setText(str(tlm_field[0]))
elif tlm_item_display_type[tlm_index] == 'Hex':
value_field.setText(hex(tlm_field[0]))
elif tlm_item_display_type[tlm_index] == 'Enm':
value_field.setText(tlmItemEnum[tlm_index][int(tlm_field[0])])
value_field.setText(tlm_item_enum[tlm_index][int(tlm_field[0])])
elif tlm_item_display_type[tlm_index] == 'Str':
value_field.setText(tlm_field[0].decode('utf-8', 'ignore'))
label_field.setText(tlmItemDesc[tlm_index])
label_field.setText(tlm_item_desc[tlm_index])
else:
print("ERROR: Can't unpack buffer of length", len(tlm_field2))

# Start the telemetry receiver (see GTTlmReceiver class)
def init_gt_tlm_receiver(self, subscr):
self.setWindowTitle(f"{page_title} for: {subscr}")
self.thread = GTTlmReceiver(subscr)
self.thread.gtSignalTlmDatagram.connect(self.process_pending_datagrams)
self.thread.gt_signal_tlm_datagram.connect(self.process_pending_datagrams)
self.thread.finished.connect(self.thread.deleteLater)
self.thread.start()

Expand Down Expand Up @@ -215,9 +215,9 @@ def usage():
#
# Read in the contents of the telemetry packet definition
#
tlm_item_is_valid, tlmItemDesc, \
tlm_item_start, tlmItemSize, \
tlm_item_display_type, tlmItemFormat = ([] for _ in range(6))
tlm_item_is_valid, tlm_item_desc, \
tlm_item_start, tlm_item_size, \
tlm_item_display_type, tlm_item_format = ([] for _ in range(6))

tlm_item_enum = [None] * 40

Expand Down

0 comments on commit 949be4b

Please sign in to comment.