Commit Graph
121 Commits
Author SHA1 Message Date
ArdaandClaude Opus 5 ad8396ef7b Zoom to Fit, with a toolbar icon beside the zoom controls
Fits the whole painted sheet in the visible canvas and scrolls it into view,
from the View menu, Ctrl/Cmd+9, or the four-corners button after the zoom
percentage. The ladder gains 25% and 33% at the bottom, so a wide sheet has
somewhere to fit into.

Fit is the one scale that is not on the ladder -- a sheet fits at whatever
scale it fits at -- so zoom_step now takes the first level above or below the
scale in force rather than the neighbour of the nearest rung.

The sheet is measured from item coordinates rather than canvas.bbox(), which
is inflated by the outline stroke: a stroke is the same two pixels at every
zoom, so a bbox divided back to 1:1 reports a slightly smaller sheet the
further in it is zoomed, and fitting an already fitted sheet crept from 288%
to 291% instead of standing still. Anything painted left of or above the
canvas origin is measured from the origin, since no amount of scrolling brings
it into view.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 23:14:46 +03:00
ArdaandClaude Opus 5 781138e3dc Wiresheet zoom, from the View menu, the toolbar and Ctrl+wheel
A ladder of scales from 50% to 300%, stepped by Zoom In / Zoom Out / Zoom 100%,
by the two buttons beside the navigation arrows, and by Ctrl and the wheel,
which holds the point under the pointer still. A menu or keyboard zoom holds
the middle of the view instead, so it closes in on what is already being
looked at.

Painting and routing stay at 1:1, because that is where every metric is tuned:
box header and row heights, wire stubs, lane gaps, standoffs, knob radii. Zoom
scales the finished picture, so a zoomed sheet keeps the proportions of a 1:1
one and the router reaches the same decisions at every scale. Text comes along
because the three box fonts are resized once the boxes have been measured with
them.

redraw_links replaces the direct draw_links calls a drag or a drop makes: the
router reads box positions off the canvas, so the boxes go back to 1:1 for the
routing pass and the result is scaled again. Canvas coordinates carry the zoom,
which is why the drag, release and drop handlers now snap against
meta_scale * zoom -- a box dragged the same distance across the screen lands on
the same meta step at 50%, 100% and 200%.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 23:03:35 +03:00
ArdaandClaude Opus 5 0166be3454 Tidy Layout on Control+W only
Cmd+W closes the window on macOS, so the Command half of the pair is left
alone; this is the one shortcut that is not bound on both modifiers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:41:03 +03:00
ArdaandClaude Opus 5 5f66ecef7b Tidy Layout on Ctrl/Cmd+W
Joins the Command/Control shortcut pairs, so the chord works the same on
either platform, and the View menu entry now shows it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 21:28:34 +03:00
ArdaandClaude Opus 5 4988483c64 Tidy Layout moves from the Edit menu to View
It re-flows what is on screen rather than editing the document, which is where
the rest of the sheet's presentation controls now live.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 21:26:52 +03:00
ArdaandClaude Opus 5 23a8bfbaa8 View menu: tree/palette toggle, and Back/Forward through opened sheets
Tree / Palette hides the left column so the wiresheet has the whole window.
ttk has no hide flag for a pane, so the column is dropped from the paned
window and re-inserted at the front, which is why the configured width is
re-applied afterwards.

Back and Forward walk the sheets opened this session, with two arrow buttons
in a new toolbar on the same commands. History entries hold the element whose
children are painted rather than a tree item id: rebuilding the tree hands out
fresh ids, while the elements themselves survive. Recording runs from the tree
selection handler, the one route every sheet opening takes, and is suppressed
while a walk drives that selection so it cannot rewrite its own trail. Opening
a different file retires the history; a delete or an undo drops only the
entries whose element has left the document, keeping the position on screen.

open_file builds the tree inline instead of going through
refresh_treeview_from_dom, so it never raised the tree-filled callback and the
history had no way to see a new file. It and reset_to_startup_state now fire
it, which also gets the tree column fitted on load rather than on the first
resize.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 21:25:03 +03:00
ArdaandClaude Opus 5 5424d84156 Left column: fixed width preference, auto scrollbars, pane floors
The tree and palette column took a share of every extra pixel the window
gained. It is now pinned to a width set in Preferences, defaulting to
230 px, so widening the window only ever feeds the wiresheet.

That fixed width brought two existing weaknesses into view:

- Long paths and type names had nowhere to go. Both lists now size their
  tree column to the widest visible row - ttk derives the horizontal
  scroll range from the column width, so a column left stretching can
  never scroll - and carry vertical and horizontal scrollbars that leave
  the grid when they have nothing to scroll.

- A short window squeezed the navigation tree away entirely. Both lists
  asked for ten rows, so the palette requested the most while the tree,
  carrying the larger weight, gave up its height first. The requested
  rows are now 6 and 5, a 300 px minimum window height keeps the
  shortfall shallow, and clamp_left_pane_split holds a dragged sash
  between the two floors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 21:06:21 +03:00
ArdaandClaude Opus 5 13c7c71096 testSax: an Add2 on /Fire fed from RetPres, for the knob legend
Adds control::Add2 under /Fire and links /AHU20_1/RetPres/RetSet.value to its
in1. That slot already had two links inside RetPres, so it now carries both an
unreachable same-sheet link and one leaving the sheet -- the only arrangement
that draws the half-and-half knob, and one no sheet in this file produced
before. It caught that marker rendering wrongly at its real 8px size.

RetPres is also tidied, which moved seven meta positions onto one row.

The diff covers the whole file because saving re-serializes it: the schema and
every other component and link are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 19:23:52 +03:00
ArdaandClaude Opus 5 e587a111dc Wiresheet: keep the half-and-half knob's white centre centred
Pushed into the wire-coloured half, the centre filled almost all of it: that
half is only KNOB_RADIUS wide and the centre is KNOB_CORE_RADIUS, so at the
real 8px knob size the wire colour was reduced to a sliver and the marker read
as plain grey. Centred, both halves keep enough colour to tell apart.

Found on a slot carrying two links on its own sheet plus one leaving it, which
is the only arrangement that produces this knob and did not occur in testSax
until now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 19:14:17 +03:00
ArdaandClaude Opus 5 e2cd13b9a0 Wiresheet: grid-snapped layout, visible wire routing, knob legend
Layout rules for tidy and for dragging:
- Boxes snap to whole meta steps live while dragged, not only on release.
- The left-most column and top row clear the canvas edge by at least 30px,
  and neighbours by at least 30px, each rounded up to the next step.
- Box widths round up to the grid so a right edge lands on a grid line.
- Column gaps widen only where wires need lanes, so most stay at exactly 30px.
- A sheet too wide for meta's 0..255 range is laid out at 2, then 3, then 4
  grid squares per step. The multiplier is derived from the sheet's contents,
  so painting and tidying agree on it without recording anything in the file.
  The grid size in Preferences is untouched.

Wire routing:
- No wire may pass under a component. A link with no clear route is shown as
  knobs on both slots instead of a line hidden behind a box.
- Vertical runs hug a box within 15px, never closer than 10px, and two runs
  sharing a gap stand 10px apart.
- Horizontal runs of different links stay 5px apart. Runs from one output pin
  may share, since a fan-out is one signal.
- Straight routes claim their rows first, as their segments are pinned to
  their slots and cannot move later.

Knobs:
- Wire colour with a small white centre when the far end is on this sheet,
  grey when it is on another, half and half when a slot carries both.
- Selectable and deletable like a wire, and raised above the boxes so a click
  reaches them.
- Selecting a same-sheet pair draws a red dashed line between the two knobs.

Also:
- get_box_bounds returns the rectangle actually drawn rather than canvas.bbox,
  which was inflated by the outline stroke and by selection.
- Preferences offers to round the box width to a multiple of the grid.
- The tidy coordinate-limit warning said to lower the grid size; raising it is
  what helps, since the reach is 255 * grid size.
- Tidy Layout moves from its own menu into Edit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 19:05:58 +03:00
Arda 03e62ba03c WIP: auto-sync from DESKTOP-GIDJ6NO 2026-08-24 23:14 2026-08-24 23:14:49 +03:00
Arda 85adf5373c WIP: auto-sync from AA-DELLDESKTOP 2026-08-21 15:56 2026-08-21 15:56:25 +03:00
ArdaandClaude Opus 5 b9a6428200 testSax: pin checksumYok's kits through the new kit manager
Saved back out of the editor, so the fixture now exercises what the kit dialog
writes: every kit that was declared bare carries the checksum of its latest
installed build, and ontrolModbusSlaveSmart is declared at 929218bf -- the file
used its ModbusSlaveSmart component without declaring the kit, which left five
component types unresolvable on load.

Its .bak copy goes with it; the file it backed up is two rewrites old.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 12:17:11 +03:00
ArdaandClaude Opus 5 01dadea610 Manage kits: reconcile the schema on save, and a dialog to repin builds
Placing a palette component no longer edits <schema> straight away. The kit is
noted as pending, its manifest is compiled so the box can be painted, and the
status bar says the kit will be declared on save. The <schema> block is then
reconciled when the file is written, in the one place that can report the whole
kit list the file will carry, with each kit's version and checksum.

What a kit's manifest depends on counts as used too, transitively, so placing a
component can bring in more than one entry: hvac pulls in types, ontrolPion
pulls in ontrolPlatform.

New Kits > Manage Kits... dialog lists every kit in three groups -- needed by
the app, declared but unused, and merely installed -- with the pinned build, the
newest installed build, and an Action dropdown of every build a kit ships.
The tick means the schema declares the kit: grey and fixed for kits the app
needs, unticked to remove, ticked to add at the newest build. "Upgrade all kits
to latest version" moves every declared kit; "Update kits" applies the ticks and
the Action column, additions and removals included.

Every schema change is applied as a batch, then verified: a missing manifest or
a component type that stops resolving reverts the whole block and reports why,
and a kit the app needs cannot be removed. Changes are one undo step, which
recompiles the slot registry in both directions since a repin can change a
component's slots.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 12:06:25 +03:00
Arda b286b208da Kit manager menu oncesi 2026-08-21 09:12:46 +03:00
ArdaandClaude Opus 4.6 47bfaf04e0 Grey out incompatible slots in the link dialog
Parse the readonly facet from kit manifests and use it to disable
slots that cannot participate in a link: read-only slots are greyed
on the target side only (they remain selectable as sources), action
and void slots are greyed on both sides, and type mismatches are
greyed when the other side has a selection. A status label previews
the link path at the bottom of the dialog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-20 21:58:17 +03:00
ArdaandClaude Opus 4.6 424caf777c Add link management: create, select, delete with undo/redo
Implement full link workflow between component slots on the wiresheet:
- Link Mark / Link From / Link To context menu items for creating links
- Link dialog with slot type validation and source/target swap button
- Selectable link wires (click to highlight in red) with right-click delete
- Undo/redo support for both add and delete link operations
- Component deletion already cascades to remove related links

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-20 16:34:17 +03:00
ArdaandClaude Opus 4.6 e43c5e17a4 Use absolute path for editor.properties to avoid PermissionError
The relative path failed when the working directory differed from
the script directory at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-20 13:13:49 +03:00
ArdaandClaude Opus 5 8f26dbfa7f Ignore Python bytecode
__pycache__/ was showing as untracked on every status.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:27:45 +03:00
ArdaandClaude Opus 5 c8026f00db Warn and reset instead of exiting when a kit manifest is missing
A kit with no manifest under the Sedona home folder called sys.exit(1),
tearing down the whole app over one unopenable file.

schema now raises MissingManifestError instead, collecting every
unresolved kit first so one dialog names them all rather than the user
fixing them one reopen at a time. describe_missing_manifests builds the
body, pointing at the configured Sedona home and at Preferences.

open_file catches it, reports it, and calls the new
reset_to_startup_state to return to the just-launched state: no file,
empty tree, empty sheet, cleared registries and undo stack. The generic
except now resets too, since a half-parsed file previously left
current_file_path and a stale root behind.

Placing a palette component hits the same loader, where a full reset
would be too destructive: it rolls back the <kit> entry it just added,
rebuilds the previous registry, and abandons only that placement.

schema no longer imports sys or tkinter, so it reports nothing itself
and stays testable without a display. base_window_title moves to
app_state so the reset can restore the title without duplicating it.

README: document the new behaviour, drop the fixed gap, and correct the
stale "no undo, no keyboard shortcuts for save" claim.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:25:01 +03:00
arda.aydin@ontrol.com.tr 9c283c7eea First Commit
Sedona sax editor AI yardimi ile yaziliyor
2026-08-13 17:59:08 +03:00