Scripting and qet MCP: draw a cable across conductors

qet.addCable(folio, designation, type, coreColors, length, x1, y1, x2, y2)
does what the cable tool does after its dialog: a new cable whose trunk
is the line between the two points, every conductor the line crosses
taking the next core in order along the line, with the colour coreColors
lists at that place. One undo step, through AddCableCommand. An empty
designation takes the next free name. A conductor another cable already
holds is refused rather than taken away, since a script cannot be asked
the question the dialog asks. qet.cables() lists the project's cables.

The qet MCP server gains the add_cable op for qet_edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DaTweety
2026-10-17 16:57:21 +02:00
parent 8c5a16d50e
commit 04716b0731
4 changed files with 124 additions and 1 deletions
+7
View File
@@ -490,6 +490,13 @@ class QetScriptApi : public QObject
Q_INVOKABLE bool setTextRotation(int folioIndex, int textIndex, double angle);
Q_INVOKABLE bool deleteText(int folioIndex, int textIndex);
// -- cables --
Q_INVOKABLE QString addCable(int folioIndex, const QString &designation,
const QString &type, const QStringList &coreColors,
const QString &length,
double x1, double y1, double x2, double y2);
Q_INVOKABLE QStringList cables() const;
Q_INVOKABLE QStringList shapes(int folioIndex) const;
Q_INVOKABLE int shapeIndex(int folioIndex, const QString &uuid) const;
Q_INVOKABLE int addShape(int folioIndex, const QString &type,