fix(schematic): Junction-Pfad korrekt berechnen
Bei Terminal→Leitung Verbindungen wird jetzt der Pfad aus den bereits gezeichneten Punkten + Ziel-Terminal erstellt, statt das Auto-Routing zu verwenden das wilde Umwege macht. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
677caffcf4
commit
276abe3f06
2 changed files with 57 additions and 5 deletions
|
|
@ -7784,10 +7784,30 @@
|
|||
var sourceEqId = self.wireDrawSourceEq;
|
||||
var sourceTermId = self.wireDrawSourceTerm;
|
||||
var targetEqId = conn.fk_target;
|
||||
var targetTermId = conn.target_terminal || 'input';
|
||||
var targetTermId = conn.target_terminal_id || 'input';
|
||||
|
||||
// Build path: source terminal → existing points → target terminal
|
||||
var pathPoints = self.wireDrawPoints.slice(); // Copy existing points
|
||||
|
||||
// Add target terminal position
|
||||
var targetEq = self.equipment.find(function(eq) { return eq.id == targetEqId; });
|
||||
if (targetEq) {
|
||||
var terminals = self.getTerminals(targetEq);
|
||||
var targetPos = self.getTerminalPosition(targetEq, targetTermId, terminals);
|
||||
if (targetPos) {
|
||||
pathPoints.push({x: targetPos.x, y: targetPos.y});
|
||||
}
|
||||
}
|
||||
|
||||
// Build path string
|
||||
var pathData = '';
|
||||
for (var i = 0; i < pathPoints.length; i++) {
|
||||
pathData += (i === 0 ? 'M' : 'L') + ' ' + pathPoints[i].x + ' ' + pathPoints[i].y + ' ';
|
||||
}
|
||||
|
||||
// Store connection values to inherit
|
||||
self._inheritFromConnection = conn;
|
||||
self._pendingPathData = pathData.trim() || null;
|
||||
|
||||
// Clear source terminal but keep draw mode active
|
||||
self.cleanupWireDrawState(true);
|
||||
|
|
@ -7829,9 +7849,25 @@
|
|||
var sourceEqId = self.wireDrawSourceEq;
|
||||
var sourceTermId = self.wireDrawSourceTerm;
|
||||
var targetEqId = conn.fk_source;
|
||||
var targetTermId = conn.source_terminal || 'output';
|
||||
var targetTermId = conn.source_terminal_id || 'output';
|
||||
|
||||
// Build path with existing points
|
||||
var pathPoints = self.wireDrawPoints.slice();
|
||||
var targetEq = self.equipment.find(function(eq) { return eq.id == targetEqId; });
|
||||
if (targetEq) {
|
||||
var terminals = self.getTerminals(targetEq);
|
||||
var targetPos = self.getTerminalPosition(targetEq, targetTermId, terminals);
|
||||
if (targetPos) {
|
||||
pathPoints.push({x: targetPos.x, y: targetPos.y});
|
||||
}
|
||||
}
|
||||
var pathData = '';
|
||||
for (var i = 0; i < pathPoints.length; i++) {
|
||||
pathData += (i === 0 ? 'M' : 'L') + ' ' + pathPoints[i].x + ' ' + pathPoints[i].y + ' ';
|
||||
}
|
||||
|
||||
self._inheritFromConnection = conn;
|
||||
self._pendingPathData = pathData.trim() || null;
|
||||
self.cleanupWireDrawState(true);
|
||||
self.showConnectionLabelDialog(sourceEqId, sourceTermId, targetEqId, targetTermId);
|
||||
return;
|
||||
|
|
@ -7868,9 +7904,25 @@
|
|||
var sourceEqId = self.wireDrawSourceEq;
|
||||
var sourceTermId = self.wireDrawSourceTerm;
|
||||
var targetEqId = conn.fk_target;
|
||||
var targetTermId = conn.target_terminal || 'input';
|
||||
var targetTermId = conn.target_terminal_id || 'input';
|
||||
|
||||
// Build path with existing points
|
||||
var pathPoints = self.wireDrawPoints.slice();
|
||||
var targetEq = self.equipment.find(function(eq) { return eq.id == targetEqId; });
|
||||
if (targetEq) {
|
||||
var terminals = self.getTerminals(targetEq);
|
||||
var targetPos = self.getTerminalPosition(targetEq, targetTermId, terminals);
|
||||
if (targetPos) {
|
||||
pathPoints.push({x: targetPos.x, y: targetPos.y});
|
||||
}
|
||||
}
|
||||
var pathData = '';
|
||||
for (var i = 0; i < pathPoints.length; i++) {
|
||||
pathData += (i === 0 ? 'M' : 'L') + ' ' + pathPoints[i].x + ' ' + pathPoints[i].y + ' ';
|
||||
}
|
||||
|
||||
self._inheritFromConnection = conn;
|
||||
self._pendingPathData = pathData.trim() || null;
|
||||
self.cleanupWireDrawState(true);
|
||||
self.showConnectionLabelDialog(sourceEqId, sourceTermId, targetEqId, targetTermId);
|
||||
return;
|
||||
|
|
|
|||
4
sw.js
4
sw.js
|
|
@ -3,8 +3,8 @@
|
|||
* Offline-First für Schaltschrank-Dokumentation
|
||||
*/
|
||||
|
||||
const CACHE_NAME = 'kundenkarte-pwa-v9.1';
|
||||
const OFFLINE_CACHE = 'kundenkarte-offline-v9.1';
|
||||
const CACHE_NAME = 'kundenkarte-pwa-v9.2';
|
||||
const OFFLINE_CACHE = 'kundenkarte-offline-v9.2';
|
||||
|
||||
// Statische Assets die immer gecached werden (ohne Query-String)
|
||||
const STATIC_ASSETS = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue