0.4.1 Fixed propogation bug with IC's
This commit is contained in:
parent
131cf088db
commit
9a8736491b
@ -12,6 +12,10 @@ To be decided, but at this moment this code is open source and free to use for n
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 0.4.1
|
||||||
|
|
||||||
|
* Fixed a signal propogation bug with IC's
|
||||||
|
|
||||||
### 0.4.0
|
### 0.4.0
|
||||||
|
|
||||||
* You can now pan the work area, hold ctrl key while mouse dragging an empty area.
|
* You can now pan the work area, hold ctrl key while mouse dragging an empty area.
|
||||||
|
|||||||
@ -551,6 +551,8 @@ class ICInput extends Element {
|
|||||||
|
|
||||||
if (value === false) this.Input = false;
|
if (value === false) this.Input = false;
|
||||||
if (value !== false) this.Input = true;
|
if (value !== false) this.Input = true;
|
||||||
|
console.log(this.Designator + " setInput " + this.Input + " = " + value);
|
||||||
|
this.Inputs[0] = this.Input;
|
||||||
|
|
||||||
if (!this.Task.Enabled) {
|
if (!this.Task.Enabled) {
|
||||||
this.Task.LastCall = 0;
|
this.Task.LastCall = 0;
|
||||||
@ -630,7 +632,9 @@ class ICOutput extends Element {
|
|||||||
|
|
||||||
setInput(notused = 0,value) {
|
setInput(notused = 0,value) {
|
||||||
if (notused > 0) return;
|
if (notused > 0) return;
|
||||||
|
console.log(this.Designator + " setInput " + notused + " = " + value);
|
||||||
value = this._Container.isHigh(this,0);
|
value = this._Container.isHigh(this,0);
|
||||||
|
console.log("Actual " + value);
|
||||||
if (value === false) this.Input = false;
|
if (value === false) this.Input = false;
|
||||||
if (value !== false) this.Input = true;
|
if (value !== false) this.Input = true;
|
||||||
this.Inputs[0] = this.Input;
|
this.Inputs[0] = this.Input;
|
||||||
@ -648,6 +652,8 @@ class ICOutput extends Element {
|
|||||||
//console.log(this);
|
//console.log(this);
|
||||||
for (let a = 0; a < this.OutputConnections.length; a++) {
|
for (let a = 0; a < this.OutputConnections.length; a++) {
|
||||||
this.LogicEngine.RecursionCount = 0;
|
this.LogicEngine.RecursionCount = 0;
|
||||||
|
console.log(this.Designator + " clockTick: Set " + this.OutputConnections[a].Element.Designator + " I[" + this.OutputConnections[a].Input + "] = " + this.getOutput());
|
||||||
|
console.log(this._Container);
|
||||||
this.OutputConnections[a].Element.setInput(this.OutputConnections[a].Input, this.getOutput());
|
this.OutputConnections[a].Element.setInput(this.OutputConnections[a].Input, this.getOutput());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -769,9 +775,13 @@ class ICElement extends Element {
|
|||||||
setInput(Input, Value) {
|
setInput(Input, Value) {
|
||||||
if (this.InputConnections.length >= Input) {
|
if (this.InputConnections.length >= Input) {
|
||||||
// No need to worry about recursion as this goes to an input element which is buffered
|
// No need to worry about recursion as this goes to an input element which is buffered
|
||||||
|
//console.log(this.Designator + " setInput " + Input + " = " + Value);
|
||||||
|
Value = this._Container.isHigh(this,Input);
|
||||||
this.Inputs[Input] = (Value === false) ? false : true;
|
this.Inputs[Input] = (Value === false) ? false : true;
|
||||||
|
//console.log("Actual: " + this.Inputs[Input]);
|
||||||
//console.log("Calling " + this.InputConnections[Input].toElement.Designator);
|
//console.log("Calling " + this.InputConnections[Input].toElement.Designator);
|
||||||
this.InputConnections[Input].toElement.setInput(this.InputConnections[Input].Input,Value);
|
//console.log("Setting " + this.InputConnections[Input].toElement.Designator);
|
||||||
|
this.InputConnections[Input].toElement.setInput(0,Value);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -806,6 +816,7 @@ class ICElement extends Element {
|
|||||||
ctx.arc(x+10,firstY + (a*24),this.inputCircleRadius,0,2*Math.PI);
|
ctx.arc(x+10,firstY + (a*24),this.inputCircleRadius,0,2*Math.PI);
|
||||||
ctx.strokeStyle = borderColor;
|
ctx.strokeStyle = borderColor;
|
||||||
ctx.fillStyle = circleColorFalse;
|
ctx.fillStyle = circleColorFalse;
|
||||||
|
//console.log(this.Designator + ": I[" + a + "]: " + this.Inputs[a]);
|
||||||
if (this.Inputs[a]) ctx.fillStyle = circleColorTrue;
|
if (this.Inputs[a]) ctx.fillStyle = circleColorTrue;
|
||||||
if ((mouseDist <= (this.inputCircleRadius)) && this.LogicEngine.ActiveLink) ctx.fillStyle = circleColorHover;
|
if ((mouseDist <= (this.inputCircleRadius)) && this.LogicEngine.ActiveLink) ctx.fillStyle = circleColorHover;
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
MatCat BrowserLogic Simulator
|
MatCat BrowserLogic Simulator
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let Version = "0.4.0";
|
let Version = "0.4.1";
|
||||||
let spanVersion = document.getElementById("version");
|
let spanVersion = document.getElementById("version");
|
||||||
spanVersion.innerText = Version;
|
spanVersion.innerText = Version;
|
||||||
// get the canvas and get the engine object going
|
// get the canvas and get the engine object going
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user