Skip to content

Commit

Permalink
add param string item support
Browse files Browse the repository at this point in the history
  • Loading branch information
Huibean committed Sep 20, 2024
1 parent c6706de commit 39a3b8a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dronecan_gui_tool/widgets/node_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def render_union(u):
return value
if isinstance(value, float):
return round_float(value)
if isinstance(value, dronecan.transport.ArrayValue):
str_value = ''
for i in range(len(value)):
str_value += chr(value[i])
return str_value
if 'uavcan.protocol.param.Empty' in str(value):
return ''
return value
Expand Down Expand Up @@ -391,6 +396,14 @@ def __init__(self, parent, node, target_node_id, param_struct, update_callback):
if value_type == 'boolean_value':
self._value_widget = QCheckBox(self)
self._value_widget.setChecked(bool(value))

if value_type == 'string_value':
if isinstance(value, dronecan.transport.ArrayValue):
str_value = ''
for i in range(len(value)):
str_value += chr(value[i])
self._value_widget = QLineEdit(self)
self._value_widget.setText(str_value)

if self._value_widget is None:
self._value_widget = QLineEdit(self)
Expand Down

0 comments on commit 39a3b8a

Please sign in to comment.