Skip to content

Commit

Permalink
node: fixed save/load of boolean params
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Mar 21, 2024
1 parent b9d6b1f commit a694622
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dronecan_gui_tool/widgets/node_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def param_as_string(self, value):
elif value_type == 'real_value':
return str(value.real_value)
elif value_type == 'boolean_value':
return str(value.boolean_value)
return 'True' if value.boolean_value else 'False'
elif value_type == 'string_value':
return value.string_value
else:
Expand Down Expand Up @@ -699,7 +699,7 @@ def save_param(self, name, old_value, str_value):
elif value_type == 'real_value':
v.real_value = float(str_value)
elif value_type == 'boolean_value':
v.boolean_value = bool(str_value)
v.boolean_value = str_value.lower() in ['true', '1', 't', 'y', 'yes']
elif value_type == 'string_value':
v.string_value = str_value
else:
Expand Down

0 comments on commit a694622

Please sign in to comment.