Commit Graph
83 Commits
Author SHA1 Message Date
ArdaandClaude Opus 4.6 190ab79bdc Add TODO.md for task tracking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-22 12:54:42 +03:00
ArdaandClaude Opus 4.6 a60907e996 Update graphify config to Python 3.14 and set watch root to raw/
Bump version to 0.0.0.115.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-21 13:45:44 +03:00
Arda b74e4fa373 WIP: auto-sync from AA-LENOVOHOME 2026-09-20 22:16 2026-09-20 22:16:01 +03:00
ArdaandClaude Opus 4.6 42c93bdea7 Add architecture traces document covering 14 codebase flows
Deep architectural traces spanning kit management, schema registry,
file save/open pipelines, live device connection, DASP transport,
SOX protocol commands, and invoke/action slot flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-20 14:45:32 +03:00
ArdaandClaude Opus 4.6 abdafef7cb Use manifest defaults when adding components and refresh properties from device
- Populate prop elements with manifest default values when adding
  components in both offline and live mode
- Send config values from manifest in SOX add command for live devices
- Refresh button in properties panel now fetches fresh values from
  the connected device before re-reading the DOM
- Properties panel fetches device values on open in live mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-20 00:14:52 +03:00
ArdaandClaude Opus 4.6 2530bbd92c Implement live device add/delete component and app actions
Fix add component from palette in live mode: resolve <app> element
as comp_id 0, fix type_id lookup to use type_name_map, set type_name
on newly added SoxComponent, sync device values into DOM after add,
write meta position back to device, and subscribe new component to COV.

Fix delete component in live mode: clean up subscriptions for deleted
component and all its descendants.

Add tree root context menu with device app actions (save, hibernate,
quit, restart, reboot) in live mode. Device save clears dirty state.

Clean up connection lost handling to do a full disconnect.
Fix slot registry to copy base slots and renumber IDs correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 16:30:42 +03:00
ArdaandClaude Opus 4.6 9a483a0b0e Add descriptive hints to DASP connection errors
Authentication failures now show "check username and password", busy
devices say "device is busy", etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 14:19:24 +03:00
ArdaandClaude Opus 4.6 021361f836 Allow empty password in Connect and Discover dialogs
Some devices have no password configured, so only username is required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 14:17:15 +03:00
ArdaandClaude Opus 4.6 05d0ac8c03 Validate username and password in Connect dialog too
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 13:51:34 +03:00
ArdaandClaude Opus 4.6 dd236dd28a Validate username and password in discovery credentials dialog
Show an error if either field is empty before attempting to connect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 13:49:26 +03:00
ArdaandClaude Opus 4.6 55f76d60df Add Device > Discover menu with standalone discovery dialog
Discover dialog shows a device list with Port, Wait Time fields and a
Discover button. Selecting a device and clicking Connect (or double-
clicking) opens a credentials prompt for username/password, then
connects. The Connect dialog is reverted to its original simple form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 13:42:18 +03:00
ArdaandClaude Opus 4.6 ef5437ed36 Add DASP device discovery to the connect dialog
Send DISCOVER broadcast (type 0) to 255.255.255.255 and the Sedona
multicast address 239.255.18.76 to find devices on the network.
Responses are listed in a Treeview showing IP and platform ID.
Selecting a device fills the Host field; double-click connects.
Wait time is configurable (default 10s, range 1-60s).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 13:28:17 +03:00
ArdaandClaude Opus 4.6 f3692e4587 Fix DASP hostname resolution so localhost and hostnames work
The dispatch check compared the raw hostname string against the UDP
source IP, silently dropping responses when they differed (e.g.
"localhost" vs "127.0.0.1"). Resolve hostname to IP at session init.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 12:19:41 +03:00
Arda 96f3be841d WIP: auto-sync from AA-LENOVOHOME 2026-09-13 21:50 2026-09-13 21:50:42 +03:00
ArdaandClaude Opus 4.6 60c022828d Fix live-mode link navigation not selecting the target link
In live mode the DOM is rebuilt from the device when switching sheets,
creating new element objects. The pending link from the old tree could
not be found by identity in canvas_link_map. Re-resolve it by from/to
attributes after the rebuild so the selection matches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 22:15:48 +03:00
ArdaandClaude Opus 4.6 7dea3d744f Improve DASP trace: use S/R labels, add timestamp and full hex datagram
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 22:08:12 +03:00
ArdaandClaude Opus 4.6 483edc117e Update editor.properties with device defaults and trace setting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 21:52:52 +03:00
ArdaandClaude Opus 4.6 c59cd22153 Fix live-device slot ID resolution, add print and tighten wire routing
_slot_name_by_id() now resolves SOX link slot IDs against the
inheritance-flattened final_components_registry instead of the
per-type slot_registry whose local IDs were wrong for types with
intermediate parents (e.g. RegFloat→Register→Component). This
produced incorrect link endpoints, inflated linked-slot visibility,
and different box sizes between file and live modes.

Also: tighten routing constants for denser wiring, add wiresheet
PNG print/export (Ctrl+P), sort link routing jobs by gap distance,
remove debug route logging, and fix live tree-expand re-selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 21:51:22 +03:00
ArdaandClaude Opus 4.6 6cd030c7ea Fix live wiresheet config/runtime slot alignment and cap float display to 2 decimals
Slots with no flags (sensor, controlSignal, out_*) were not skipped
during config property reads, consuming bytes that the device never
sent and misaligning every subsequent config value (setpoint,
proportionalBand, etc.) into tiny denormalized floats like 2.36875e-41.

Changed the filter in _apply_props from "skip if runtime" to "skip if
not config" so only explicitly config-flagged slots are read from config
messages. Also switched iter("slot") to findall("slot") in the slot
registry builder to avoid picking up nested descendants.

Float display now defaults to 2 decimal places everywhere (wiresheet
and properties panel), honouring the precision facet when one exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 15:46:44 +03:00
ArdaandClaude Opus 4.6 48671585dd Ensure live float values always display with a decimal point
Adds _fmt_float() helper that formats 32-bit floats with :.6g precision
but appends .0 when the result has no decimal point, matching Niagara
and .sax file display conventions (e.g. 175.0 not 175, 0.0 not 0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 14:10:35 +03:00
ArdaandClaude Opus 4.6 ef80bf9a37 Format live float values to 6 significant digits matching 32-bit precision
Sox reads 32-bit floats that Python promotes to 64-bit doubles, producing
display artifacts like 22.011558532714844. Using :.6g format gives clean
values matching .sax file precision (22.0116, -19.9574, 175, 14).
Applied to both initial DOM build and COV update paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 14:03:04 +03:00
ArdaandClaude Opus 4.6 e33a6bc5d8 Guard file open and device connect against conflicting state
Opening a file while connected to a device prompts to disconnect first.
Connecting to a device while a file is open prompts to save unsaved
changes, then closes the file before showing the connect dialog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:58:55 +03:00
ArdaandClaude Opus 4.6 89aab50948 Fix live wiresheet links and DOM structure to match .sax format
- Build root children directly under <app> instead of wrapping them in
  a <comp name="app"> element. This matches the .sax DOM structure
  where <app> is the container, so component paths like /AHU/TmpCont/X
  match between link references and get_component_path.

- Fix _comp_path to produce /AHU/TmpCont/X format (skip root id 0,
  leading /) matching the .sax link path convention.

- Format float property values to 4 decimal places instead of full
  Python float precision (22.0116 vs 22.011558532714844).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:55:12 +03:00
ArdaandClaude Opus 4.6 4e38847f91 Fix live wiresheet: resolve type names and load schema gracefully
- Add type_name_map on SoxClient so components loaded after connect
  resolve proper names (e.g. control::And2) instead of kit::typeN.
  This lets the slot registry and final_components_registry match,
  so component boxes show their slots and property values.

- Load live schema gracefully: skip missing kit manifests instead of
  aborting, compile the kits we have, and warn about missing ones in
  the status bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:43:44 +03:00
ArdaandClaude Opus 4.6 4c90c1c241 Apply offline wiresheet rules to live mode: meta positions and links
Three fixes so live wiresheets render identically to offline .sax files:

1. Inherit sys::Component base slots (meta) into every type's slot
   registry so component x/y positions are read from the device.

2. Place <link> elements under a <links> container element instead of
   directly under <app>, matching the .sax structure that draw_links
   and build_linked_slot_index expect.

3. Deduplicate links (each link appears on both endpoints in Sox) so
   wires are not drawn twice.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:14:02 +03:00
ArdaandClaude Opus 4.6 599370f60c Put Device menu first in menu bar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:05:23 +03:00
ArdaandClaude Opus 4.6 a0e5ec1a31 Move Device menu after File in the menu bar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 13:04:15 +03:00
ArdaandClaude Opus 4.6 b4a504e57d Fix connect dialog: button order and cancel-during-connection cleanup
Swap Connect/Cancel button order so Connect is the default (leftmost).
Guard background thread against cancelled state so a cancelled connect
does not leave the app in live mode. Cancel during connection now
disconnects the session cleanly in a cleanup thread.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 09:41:21 +03:00
ArdaandClaude Opus 4.6 0674f32637 Pre-load root children on connect and add placeholders for uncached nodes
On connect, also loads root's immediate children so the first tree level
shows real names. For deeper levels, inserts placeholder <comp> elements
for uncached children so the Treeview shows + expand arrows for folders
that have children on the device.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 09:20:49 +03:00
ArdaandClaude Opus 4.6 d32285abe8 Fix tree expand in live mode: use focused item and run IO in background
_on_tree_open used tree.selection() which may differ from the opened
node; switched to tree.focus(). Network calls in _live_tree_expand now
run in a daemon thread so the UI stays responsive during lazy loading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 09:11:14 +03:00
ArdaandClaude Opus 4.6 67c403339c Fix live tree selection lost after wiresheet DOM rebuild
After open_wiresheet rebuilds the DOM and tree, re-find the target
element by its comp id (not the old tree item ID which no longer
exists) and re-select it with the restoring flag to prevent recursion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-12 00:24:10 +03:00
ArdaandClaude Opus 4.6 1fd6e72b8c Fix DASP close deadlock and kit checksum sign display
Use RLock instead of Lock for _close_lock so close() can call
_shutdown() without deadlocking — previously the session never
marked itself closed, causing infinite keepalive sends.

Mask kit checksums to unsigned 32-bit for hex display so negative
i4 values render as proper 8-digit hex (e.g. d3984c51 not -2c67b3af).

Tested against live device at 192.168.1.251 — full handshake,
schema read, and component tree load confirmed working.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 23:57:19 +03:00
ArdaandClaude Opus 4.6 643bcdc952 Add Trace DASP preference to print protocol transactions to terminal
New checkbox in Preferences (default off). When enabled, every DASP
send (>>>) and receive (<<<) prints message type, seq/ack numbers,
payload size, and remote address to stdout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 23:48:10 +03:00
ArdaandClaude Opus 4.6 4431f11d83 Fix crash on tree select when item no longer exists after DOM rebuild
Guard tree.get_children() with tree.exists() so a stale item ID from
a COV or lazy-load rebuild does not raise TclError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 23:43:22 +03:00
ArdaandClaude Opus 4.6 dafebcebda Live Editor: add DASP/Sox device connection with full CRUD and COV
Port the DASP transport and Sox protocol stack from sedonaOntrol Java
to Python, enabling live device editing alongside the existing offline
SAX editor. Lazy-loads components on navigation, caches them, and
subscribes to COV events for the active wiresheet.

New files: dasp.py, sox.py, device_session.py, connect_dialog.py,
live_hooks.py. Modified: app_state.py (live-mode state), main.py
(Device menu, COV polling, lazy tree expand), properties.py (Sox
write-through), sax_file.py (structural mutations route through
live_hooks), schema.py (find_manifest helper).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 23:31:36 +03:00
ArdaandClaude Opus 4.6 48dfd82832 Kit Manager: detect unsupported kits via platform database
Scan sedona/platforms/db/ to find which native kits are compiled for
the SAX's platform.  Kits with native code for other platforms, kits
providing a PlatformService for a different device, and their
transitive dependents are placed in a "Not supported" section with a
red-cross checkbox that cannot be toggled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 14:21:00 +03:00
ArdaandClaude Opus 4.6 f1cc15f70f Export XLS: add timestamp to default filename
The save dialog now suggests e.g. normal_kits_20260911_143200.xlsx
so successive exports never collide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 13:17:39 +03:00
ArdaandClaude Opus 4.6 d3d141cca8 Kit Manager: add Export as XLS button
Saves the kit table to an Excel file with section headers, check
marks, and all four data columns. Default filename is based on the
open SAX file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-11 13:06:30 +03:00
ArdaandClaude Opus 4.6 db8472371e Kit Manager: rename section to "Kits available on the computer"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 08:26:40 +03:00
Arda 3fde5bdcc1 Revert "Kit Manager: split available kits by dependency compatibility"
This reverts commit 61888396a5.
2026-09-09 08:25:18 +03:00
ArdaandClaude Opus 4.6 61888396a5 Kit Manager: split available kits by dependency compatibility
Renamed "Kits to be installed" to "Kits available on the computer"
for kits whose dependencies are all in the app. Kits with unmet
dependencies go into a greyed-out "Other kits on the computer" section
that cannot be selected or ticked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 08:20:09 +03:00
ArdaandClaude Opus 4.6 4591353453 Kit Manager: all columns fixed width with horizontal scrollbar
No columns stretch — sizes are set for the longest kit name
(ontrolModbusTcpSlaveSmart) and action text (Keep with no checksum).
A horizontal scrollbar appears when the pane is narrower than the
total column width.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 08:12:51 +03:00
ArdaandClaude Opus 4.6 943ec1a844 Kit Manager: fixed-width columns, only Kit name stretches
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-09 08:02:08 +03:00
ArdaandClaude Opus 4.6 703e2faa5c Fix missing checkbox image for unchecked required kit
The boxes dict was missing the (False, False) key — an unchecked kit
that is also required — which caused a KeyError when the Kit Manager
opened automatically for files with incomplete checksums.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 23:32:44 +03:00
ArdaandClaude Opus 4.6 78678e1e0c Auto-open Kit Manager when file has kits without checksums
When a SAX file is opened and any declared kit is missing a checksum,
the Kit Manager panel opens automatically and the palette stays empty
until the checksums are resolved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 22:57:47 +03:00
ArdaandClaude Opus 4.6 5045cfbe35 Palette: refresh kit list after opening a file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 22:11:35 +03:00
ArdaandClaude Opus 4.6 13b637a8b9 Palette: no misleading message when no file is open
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 22:03:03 +03:00
ArdaandClaude Opus 4.6 9944d93f74 Palette: show no kits until a file is open
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 21:59:28 +03:00
ArdaandClaude Opus 4.6 4e89d4c83f Palette: show only kits declared in the app's schema
The sidebar palette combo now lists kits from the open file's schema
rather than every kit installed in Sedona home, with their resolved
version labels. Falls back to all installed kits when no file is open.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 21:57:52 +03:00
ArdaandClaude Opus 4.6 edd1c20093 Update editor.properties: sedona.home path and left_pane_width
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-08 21:10:23 +03:00