fix(schematic): Abgang-Label und Oertlichkeit als separate Zeilen

- Bezeichnung und Oertlichkeit werden jetzt getrennt dargestellt
  (Zeilenumbruch statt ' · ' Trennzeichen)
- Oertlichkeit 13px weiter links, kleiner (9px), kursiv, grau
- Linienlänge berechnet aus max(label, location, kabel) separat
- Max. Linienlänge 120 → 150px (mehr Platz für lange Bezeichnungen)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Eduard Wisch 2026-03-23 14:33:43 +01:00
parent 7f15645ecd
commit 01c786f02a

View file

@ -7869,10 +7869,10 @@
var pos = self.getTerminalPosition(eq, termId, terms); var pos = self.getTerminalPosition(eq, termId, terms);
if (!pos) return; if (!pos) return;
var labelText = conn.output_label || ''; var labelText = conn.output_label || '';
if (conn.output_location) labelText += ' · ' + conn.output_location; var locationText = conn.output_location || '';
var cableText = ((conn.medium_type || '') + ' ' + (conn.medium_spec || '')).trim(); var cableText = ((conn.medium_type || '') + ' ' + (conn.medium_spec || '')).trim();
var maxLen = Math.max(labelText.length, cableText.length); var maxLen = Math.max(labelText.length, locationText.length, cableText.length);
var lineLen = Math.min(120, Math.max(50, maxLen * 6 + 20)); var lineLen = Math.min(150, Math.max(50, maxLen * 6 + 20));
var goUp = pos.isTop; var goUp = pos.isTop;
self._outputAreas.push({ self._outputAreas.push({
x: pos.x - 25, x: pos.x - 25,
@ -7937,12 +7937,12 @@
} }
} }
// Calculate line length based on label text // Calculate line length based on label text (label and location are separate lines)
var labelText = conn.output_label || ''; var labelText = conn.output_label || '';
if (conn.output_location) labelText += ' · ' + conn.output_location; var locationText = conn.output_location || '';
var cableText = (conn.medium_type || '') + ' ' + (conn.medium_spec || ''); var cableText = (conn.medium_type || '') + ' ' + (conn.medium_spec || '');
var maxTextLen = Math.max(labelText.length, cableText.trim().length); var maxTextLen = Math.max(labelText.length, locationText.length, cableText.trim().length);
var lineLength = Math.min(120, Math.max(50, maxTextLen * 6 + 20)); var lineLength = Math.min(150, Math.max(50, maxTextLen * 6 + 20));
// Direction: top terminal = UP, bottom terminal = DOWN // Direction: top terminal = UP, bottom terminal = DOWN
var goingUp = sourcePos.isTop; var goingUp = sourcePos.isTop;
@ -7988,15 +7988,19 @@
// Labels - vertical text on both sides // Labels - vertical text on both sides
var labelY = (startY + endY) / 2; var labelY = (startY + endY) / 2;
// Left side: Bezeichnung (output_label) + Räumlichkeit // Left side: Bezeichnung (output_label) + Räumlichkeit (separate line)
if (conn.output_label) { if (conn.output_label) {
htmlFront += '<text x="' + (lineX - 10) + '" y="' + labelY + '" '; htmlFront += '<text x="' + (lineX - 10) + '" y="' + labelY + '" ';
htmlFront += 'text-anchor="middle" fill="#fff" font-size="11" font-weight="bold" '; htmlFront += 'text-anchor="middle" fill="#fff" font-size="11" font-weight="bold" ';
htmlFront += 'transform="rotate(-90 ' + (lineX - 10) + ' ' + labelY + ')">'; htmlFront += 'transform="rotate(-90 ' + (lineX - 10) + ' ' + labelY + ')">';
htmlFront += self.escapeHtml(conn.output_label); htmlFront += self.escapeHtml(conn.output_label);
if (conn.output_location) { htmlFront += '</text>';
htmlFront += '<tspan font-size="9" font-weight="normal" font-style="italic" fill="#999"> · ' + self.escapeHtml(conn.output_location) + '</tspan>'; }
} if (conn.output_location) {
htmlFront += '<text x="' + (lineX - 23) + '" y="' + labelY + '" ';
htmlFront += 'text-anchor="middle" fill="#aaa" font-size="9" font-style="italic" ';
htmlFront += 'transform="rotate(-90 ' + (lineX - 23) + ' ' + labelY + ')">';
htmlFront += self.escapeHtml(conn.output_location);
htmlFront += '</text>'; htmlFront += '</text>';
} }
@ -11406,10 +11410,10 @@
} }
var labelText = conn.output_label || ''; var labelText = conn.output_label || '';
if (conn.output_location) labelText += ' · ' + conn.output_location; var locationText = conn.output_location || '';
var cableText = (conn.medium_type || '') + ' ' + (conn.medium_spec || ''); var cableText = (conn.medium_type || '') + ' ' + (conn.medium_spec || '');
var maxTextLen = Math.max(labelText.length, cableText.trim().length); var maxTextLen = Math.max(labelText.length, locationText.length, cableText.trim().length);
var lineLength = Math.min(120, Math.max(50, maxTextLen * 6 + 20)); var lineLength = Math.min(150, Math.max(50, maxTextLen * 6 + 20));
var goingUp = sourcePos.isTop; var goingUp = sourcePos.isTop;
var endY = goingUp ? (sourcePos.y - lineLength) : (sourcePos.y + lineLength); var endY = goingUp ? (sourcePos.y - lineLength) : (sourcePos.y + lineLength);
pathData = 'M ' + lineX + ' ' + sourcePos.y + ' L ' + lineX + ' ' + endY; pathData = 'M ' + lineX + ' ' + sourcePos.y + ' L ' + lineX + ' ' + endY;