Update wiring diagram maker: formboard router + frontend
Backend formboard router and frontend (canvas, formboard, connector library, app/api, index/css) updates. Ignore *.log.
This commit is contained in:
@@ -1188,6 +1188,28 @@ class DiagramCanvas {
|
||||
x: 4, y: device.height - 14, width: device.width - 8, align: "right",
|
||||
text: "cable", fontSize: 8, fontFamily: "monospace", fill: "#888888",
|
||||
}));
|
||||
} else if (device.device_type === "connector" && device.properties?.shape === "circular") {
|
||||
rect.visible(false);
|
||||
// Body radius is intentionally smaller than pin radius (0.471) so wire
|
||||
// endpoints sit outside the body and remain visible above it.
|
||||
const r = Math.min(device.width, device.height) * 0.386;
|
||||
const cx = device.width / 2, cy = device.height / 2;
|
||||
group.add(new Konva.Circle({
|
||||
name: "device-body",
|
||||
x: cx, y: cy, radius: r,
|
||||
fill: this._deviceFill("connector"), stroke: "#5a5a8a", strokeWidth: 2,
|
||||
}));
|
||||
// Key notch anchored to body top edge
|
||||
group.add(new Konva.Rect({
|
||||
x: cx - 5, y: cy - r - 3, width: 10, height: 7, cornerRadius: 2,
|
||||
fill: "#333355", stroke: "#5a5a8a", strokeWidth: 1, listening: false,
|
||||
}));
|
||||
group.add(new Konva.Text({
|
||||
name: "device-label",
|
||||
x: 4, y: cy - 6, width: device.width - 8,
|
||||
text: device.label, fontSize: Math.min(10, fontSize),
|
||||
fontFamily: "monospace", fill: "#dde0f5", align: "center",
|
||||
}));
|
||||
} else {
|
||||
if (device.reference) {
|
||||
group.add(new Konva.Text({ x: 6, y: 5, text: device.reference, fontSize: 10, fontFamily: "monospace", fill: "#99aaee", fontStyle: "bold" }));
|
||||
@@ -1263,6 +1285,12 @@ class DiagramCanvas {
|
||||
this.selectDevice(device.id);
|
||||
}
|
||||
});
|
||||
group.on("dblclick", (e) => {
|
||||
if (this.mode !== "select") return;
|
||||
e.cancelBubble = true;
|
||||
this.cb.onPinoutRequested?.(device);
|
||||
});
|
||||
|
||||
group.on("dragstart", () => {
|
||||
if (this.wireStart) { group.stopDrag(); return; }
|
||||
if (device.properties?.locked) { group.stopDrag(); return; }
|
||||
|
||||
Reference in New Issue
Block a user