function TB_Input(x, y, scope = globalScope, dir = "RIGHT", identifier, testData) { CircuitElement.call(this, x, y, scope, dir, 1); // this.setDimensions(60,20); // this.xSize=10; // this.plotValues = []; // this.inp1 = new Node(0, 0, 0, this); // this.inp1 = new Node(100, 100, 0, this); this.setIdentifier (identifier|| "Test1"); this.testData=testData || {"inputs":[],"outputs":[],"n":0} this.clockInp = new Node(0,20, 0,this,1); this.outputs = [] this.running = false; this.iteration=0; this.setup(); } TB_Input.prototype = Object.create(CircuitElement.prototype); TB_Input.prototype.constructor = TB_Input; TB_Input.prototype.tooltipText = "Test Bench Input Selected"; TB_Input.prototype.centerElement = true; TB_Input.prototype.helplink = "https://docs.circuitverse.org/#/testbench"; TB_Input.prototype.dblclick=function(){ this.testData=JSON.parse(prompt("Enter TestBench Json")); this.setup(); } TB_Input.prototype.setDimensions=function() { this.leftDimensionX = 0; this.rightDimensionX = 120; this.upDimensionY = 0; this.downDimensionY = 40 + this.testData.inputs.length * 20; } TB_Input.prototype.setup=function(){ this.iteration = 0; this.running = false; this.nodeList.clean(this.clockInp); this.deleteNodes(); this.nodeList = [] this.nodeList.push(this.clockInp); this.testData = this.testData || { "inputs": [], "outputs": [], "n": 0 }; // this.clockInp = new Node(0,20, 0,this,1); this.setDimensions(); this.prevClockState = 0; this.outputs = []; for(var i = 0; i < this.testData.inputs.length; i++ ){ this.outputs.push(new Node(this.rightDimensionX, 30+i*20, 1, this, bitWidth = this.testData.inputs[i].bitWidth,label=this.testData.inputs[i].label)); } for(var i =0; i