From 84d0a498411a5198e5430a4a97e076d9a150854a Mon Sep 17 00:00:00 2001 From: ispyisail Date: Mon, 28 Sep 2026 23:16:10 +1300 Subject: [PATCH] Groups: editing one member (#1110) and rotating a group (#1111), pending; wires in older projects have no lasting uuid yet (#1105, #1107 pending); scripting and MCP by wire uuid (#1106, #1108 pending) --- grouping_items.md | 68 +++++++++++++++++++++++++++++++++++++++------ mcp_server.md | 5 ++++ project_database.md | 24 ++++++++++++++-- scripting.md | 31 +++++++++++++++++++++ 4 files changed, 118 insertions(+), 10 deletions(-) diff --git a/grouping_items.md b/grouping_items.md index 4eeb422..6533091 100644 --- a/grouping_items.md +++ b/grouping_items.md @@ -57,7 +57,58 @@ selected. another group) and choose **Grouper**: the result is one group holding all of them. There are no groups inside groups. -## 3. Ungrouping +## 3. Coming next: editing one member, and rotating a group + +Two things [discussion #1070](https://github.com/qelectrotech/qelectrotech-source-mirror/discussions/1070) +proposed that the first version did not do. Each is its own pull request; +they can arrive in either order. + +### Editing one member on its own + +> **Status: pending.** This section describes +> [PR #1110](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1110), +> not yet merged. Nothing here works until that lands — check the PR +> before trying any of this against your own build. This section will drop +> this notice once it does. + +1. Click any member: the whole group is selected, as before. +2. Click the **same or another member of that group again**, without + dragging: now only that member is selected. +3. Edit it on its own — move it, change its properties, delete it. The rest + of the group stays where it is and stays grouped. + +Clicking a member of that group once more selects the whole group again. +Clicking on a symbol's own text (its label, for example) counts as clicking +the symbol. + +What stays the same: + +| You do | What happens | +|---|---| +| Drag a member of a selected group | the whole group moves — a drag never picks one member out | +| **Ctrl**+click a member | exactly as before (the whole group leaves or joins the selection) | +| Click a member of a group that is not selected | the whole group is selected | + +### Rotating a group as one piece + +> **Status: pending.** This section describes +> [PR #1111](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1111), +> not yet merged. Nothing here works until that lands — check the PR +> before trying any of this against your own build. This section will drop +> this notice once it does. + +With a whole group selected (and nothing else), **Space**, **Pivoter** +(*rotate*) turns the group 90° round its centre, keeping its layout — +exactly what **Shift+Space**, **Pivoter le groupe** (*rotate as group*), does. +Until this lands, Space turns each member where it stands and pulls the group +apart; use Shift+Space. + +Any other selection rotates as before: several items that are not one group, +a group together with other items, or a single member picked out of its +group (see above), which turns where it stands. Wires between the group's +symbols do not count as "other items" — they follow their symbols. + +## 4. Ungrouping Select a group, or any member of it, and choose **Édition ▸ Dégrouper** (*Edit ▸ Ungroup*), also in the right-click menu and command search. Every @@ -70,7 +121,7 @@ Neither command has a default shortcut (**Ctrl+G** is already *go to element*). You can assign one under **Configurer QElectroTech ▸ Raccourcis** (*Settings ▸ Shortcuts*), in the *Éditeur de schémas* group. -## 4. In the project file +## 5. In the project file Each grouped item carries one extra attribute, `group`, holding the group's id; members of the same group share the id. Nothing else in the file @@ -86,16 +137,17 @@ the element, shape, free-text and picture tables), so a query or script can find which items belong together. See **[The project database](project_database)**. -## 5. Not included yet +## 6. Not included yet Planned in [discussion #1070](https://github.com/qelectrotech/qelectrotech-source-mirror/discussions/1070), not built: -- **Editing one member without ungrouping.** For now, ungroup, edit, and - group again. -- **Space rotating a group as a unit.** Today Space turns each member in - place; use **Shift+Space** (*Pivoter le groupe*) to turn the group as a - whole. +- **Editing one member without ungrouping** and **Space rotating a group as + a unit** — both in review, see [section 3](#3-coming-next-editing-one-member-and-rotating-a-group). + Until they land: ungroup, edit, and group again; and use **Shift+Space** + (*Pivoter le groupe*) to turn a group as a whole. +- **Align and distribute treating a group as one item** (see + [Aligning items](aligning_items)): today they move each member on its own. - **Nested groups.** - **Locked items.** A locked member is not treated specially: it stays where it is while the rest of its group moves. diff --git a/mcp_server.md b/mcp_server.md index 1b81bbf..3439b1b 100644 --- a/mcp_server.md +++ b/mcp_server.md @@ -280,6 +280,11 @@ Across the shipped examples: 3190 conductors, not one with a cable value. is what the application does, since a wire number describes a potential. Name a terminal carrying exactly one conductor; a terminal several conductors meet at names none of them and is refused. + *Pending, [PR #1108](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1108):* + `set_conductor`, `move_conductor_segment` and `delete_conductor` will also + take `"conductor": "{uuid}"` (as `qet_conductors` reports it) in place of + `element` + `terminal`, which works where two conductors meet at a + terminal, as long as one of the conductor's two terminals carries only it. - **`link_elements` takes a folio for each end**, because a master and its slave are normally on different folios. Whether a pair may be linked is decided by QElectroTech's own `isLinkable()`, so a script cannot make a diff --git a/project_database.md b/project_database.md index 85c57b2..aecb459 100644 --- a/project_database.md +++ b/project_database.md @@ -142,8 +142,28 @@ add an `ORDER BY`. ## 4. Identity, and why terminals are hard -Rows need stable keys. Elements, diagrams and conductors have real UUIDs, so -they are fine. Since September 2026 so do shapes, free texts and pictures on a +Rows need stable keys. Elements and diagrams have real UUIDs, so they are +fine. So do conductors drawn or saved by a recent QElectroTech — but a +conductor loaded from a file that has no `uuid` on it (every wire in an older +project) gets a **new random uuid each time the project opens**, and it is +never saved. Its `conductor` row is keyed by a uuid that will be different +next session. + +> **Status: pending.** The next two points describe +> [PR #1105](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1105) +> and [PR #1107](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1107), +> not yet merged. Until they land, the paragraph above is how it works. +> +> - A symbol saved without a uuid gets one worked out from its type, its +> position on the folio and its rotation — the same every time the file +> opens, and saved from then on (#1105). +> - A wire saved without a uuid gets one worked out from **what it connects** +> — the symbol and terminal at each end — never from its place in the file +> or its folio's number, so inserting or moving a folio does not change it. +> It is saved from then on, so reconnecting the wire later keeps it (#1107). +> A worked-out uuid is never one the file already carries. + +Since September 2026 shapes, free texts and pictures on a folio, and the parts drawn inside a symbol: each carries a `uuid` attribute in the saved file. An item from a file saved before then gets one worked out from its folio, its kind and its order in the file, so opening the same file twice diff --git a/scripting.md b/scripting.md index 681d340..77e51e1 100644 --- a/scripting.md +++ b/scripting.md @@ -143,6 +143,37 @@ attribute. `deleteElement()` refuses to remove an element with a non-deletable terminal (a linked master/slave, for instance) — same rule the Delete key follows. +### Find a wire by its uuid + +> **Status: pending.** This section describes +> [PR #1106](https://github.com/qelectrotech/qelectrotech-source-mirror/pull/1106), +> not yet merged. Nothing here works until that lands — check the PR +> before trying any of this against your own build. This section will drop +> this notice once it does. + +The conductor calls name a wire by one of its ends — an element uuid and a +terminal index — which cannot tell apart two wires meeting at one terminal. +A wire's uuid names it for good: + +```js +qet.conductorUuids(folioIndex) // -> ["{…}", "{…}", …], same order as qet.conductors() +qet.conductorEnds(folioIndex, uuid) // -> ["{element uuid} terminal 0", "{element uuid} terminal 2"] + // or [] if the folio has no such wire +``` + +Each end comes back in the form `qet.conductors()` prints and the conductor +calls take, so a script can go from a uuid to a call: + +```js +var ends = qet.conductorEnds(0, uuid); +var e = ends[0].split(" terminal "); +qet.setConductorProperty(0, e[0], parseInt(e[1], 10), "num", "W12"); +``` + +Wires in a project saved by an older QElectroTech have no saved uuid yet, so +theirs are different each time the project opens until that changes (see +[the project database](project_database), section 4). + ### Navigate and message ```js