diff --git a/app_state.py b/app_state.py index 945c528..2f9aa77 100644 --- a/app_state.py +++ b/app_state.py @@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it. import configparser import os -VERSION = "0.0.0.085" +VERSION = "0.0.0.086" PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties") DEFAULT_GRID_SIZE = 10 DEFAULT_ADD_TIMESTAMP = True diff --git a/device_session.py b/device_session.py index 47db2f9..ff218dc 100644 --- a/device_session.py +++ b/device_session.py @@ -237,7 +237,15 @@ class DeviceSession: app_elem = ET.SubElement(sax_root, "app") if root_comp is not None: - self._build_comp_element(app_elem, root_comp) + # Build children of root directly under , matching .sax format + # where IS the root container (not a ) + for child_id in root_comp.children: + child_comp = self.sox_client.cache_get(child_id) + if child_comp is not None: + self._build_comp_element(app_elem, child_comp) + else: + ET.SubElement(app_elem, "comp", + name="...", id=str(child_id), type="") return sax_root @@ -259,8 +267,12 @@ class DeviceSession: name = slot["name"] if name in sox_comp.values: val = sox_comp.values[name] + if isinstance(val, float): + val_str = f"{val:.4f}".rstrip("0").rstrip(".") + else: + val_str = str(val) ET.SubElement(comp_elem, "prop", - name=name, val=str(val)) + name=name, val=val_str) for child_id in sox_comp.children: child_comp = self.sox_client.cache_get(child_id) @@ -330,7 +342,7 @@ class DeviceSession: if not parts: return None parts.reverse() - return "/".join(parts) + return "/" + "/".join(parts) # ── Update DOM from COV ─────────────────────────────────────