|
|
|
|
@ -25,6 +25,16 @@ def _bool_value(item, field_name):
|
|
|
|
|
return bool(item.get(field_name, False))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _int_text_value(item, field_name):
|
|
|
|
|
value = item.get(field_name, "")
|
|
|
|
|
if value is None:
|
|
|
|
|
return ""
|
|
|
|
|
try:
|
|
|
|
|
return str(int(value)).strip()
|
|
|
|
|
except Exception:
|
|
|
|
|
return str(value).strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _conductor_uuids(item):
|
|
|
|
|
values = item.get("conductor_uuids", [])
|
|
|
|
|
if not isinstance(values, list):
|
|
|
|
|
@ -92,6 +102,7 @@ def _normalize_wire_entry(item, index, device_labels=None):
|
|
|
|
|
"group_uuid": _string_value(item, "group_uuid"),
|
|
|
|
|
"wire_mark": wire_mark,
|
|
|
|
|
"wire_mark_is_manual": _bool_value(item, "wire_mark_is_manual"),
|
|
|
|
|
"wire_style_id": _int_text_value(item, "wire_style_id"),
|
|
|
|
|
"start_element_uuid": start_element_uuid,
|
|
|
|
|
"start_terminal_uuid": start_terminal_uuid,
|
|
|
|
|
"start_instance_id": _string_value(item, "start_instance_id"),
|
|
|
|
|
@ -179,6 +190,7 @@ def _ensure_string_property(obj, prop_name, value, description="QET wire task pr
|
|
|
|
|
def _set_task_extra_properties(task, entry):
|
|
|
|
|
_ensure_string_property(task, "QetStartElementUuid", entry["start_element_uuid"])
|
|
|
|
|
_ensure_string_property(task, "QetEndElementUuid", entry["end_element_uuid"])
|
|
|
|
|
_ensure_string_property(task, "QetWireStyleId", entry["wire_style_id"])
|
|
|
|
|
_ensure_string_property(task, "QetStartTerminalDisplay", entry["start_terminal_display"])
|
|
|
|
|
_ensure_string_property(task, "QetEndTerminalDisplay", entry["end_terminal_display"])
|
|
|
|
|
_ensure_string_property(task, "QetStartDeviceLabel", entry["start_device_label"])
|
|
|
|
|
|