diff --git a/src/simulator/src/data/load.js b/src/simulator/src/data/load.js index 1bc51e65..e4e8f4c8 100644 --- a/src/simulator/src/data/load.js +++ b/src/simulator/src/data/load.js @@ -56,7 +56,11 @@ function loadModule(data, scope) { data.labelDirection || oppositeDirection[fixDirection[obj.direction]] // Sets delay - obj.propagationDelay = data.propagationDelay || obj.propagationDelay + if (data.propagationDelay === 0) { + obj.propagationDelay = 0; + } else { + obj.propagationDelay = data.propagationDelay || obj.propagationDelay; + } obj.fixDirection() // Restore other values diff --git a/src/simulator/src/utils.ts b/src/simulator/src/utils.ts index c8293b7a..838bbbae 100644 --- a/src/simulator/src/utils.ts +++ b/src/simulator/src/utils.ts @@ -52,7 +52,7 @@ export function clockTick() { */ export function showError(error: string) { errorDetectedSet(true) - // if error ha been shown return + // if error has been shown return if (error === prevErrorMessage) return prevErrorMessage = error diff --git a/src/simulator/src/wire.js b/src/simulator/src/wire.js index 8a736236..dae85911 100644 --- a/src/simulator/src/wire.js +++ b/src/simulator/src/wire.js @@ -115,24 +115,24 @@ export default class Wire { if (this.type === 'horizontal') { if (this.node1.absY() !== this.y1) { // if(this.checkConnections()){this.delete();return;} - n = new Node(this.node1.absX(), this.y1, 2, this.scope.root) + n = new Node(this.node2.absX(), this.node1.absY(), 2, this.scope.root); this.converge(n) updated = true } else if (this.node2.absY() !== this.y2) { // if(this.checkConnections()){this.delete();return;} - n = new Node(this.node2.absX(), this.y2, 2, this.scope.root) + n = new Node(this.node1.absX(), this.node2.absY(), 2, this.scope.root); this.converge(n) updated = true } } else if (this.type === 'vertical') { if (this.node1.absX() !== this.x1) { // if(this.checkConnections()){this.delete();return;} - n = new Node(this.x1, this.node1.absY(), 2, this.scope.root) + n = new Node(this.node1.absX(), this.node2.absY(), 2, this.scope.root); this.converge(n) updated = true } else if (this.node2.absX() !== this.x2) { // if(this.checkConnections()){this.delete();return;} - n = new Node(this.x2, this.node2.absY(), 2, this.scope.root) + n = new Node(this.node2.absX(), this.node1.absY(), 2, this.scope.root); this.converge(n) updated = true }