From 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Thu, 12 Jul 2018 23:16:08 +0530 Subject: add more global variables --- js/Threshold/ZCROSS_f.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'js/Threshold/ZCROSS_f.js') diff --git a/js/Threshold/ZCROSS_f.js b/js/Threshold/ZCROSS_f.js index e96ef207..288e89e9 100644 --- a/js/Threshold/ZCROSS_f.js +++ b/js/Threshold/ZCROSS_f.js @@ -12,9 +12,9 @@ function ZCROSS_f() { this.model.blocktype = new ScilabString(["z"]); this.model.firing = new ScilabDouble([-1]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = strcat(sci2exp(this.in1)); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ZCROSS_f\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = strcat(sci2exp(this.in1)); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ZCROSS_f\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } ZCROSS_f.prototype.details = function ZCROSS_f() { @@ -27,12 +27,13 @@ function ZCROSS_f() { } ZCROSS_f.prototype.set = function ZCROSS_f() { this.in1 = parseFloat(arguments[0]["in1"]) + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.in1,exprs] = scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),exprs); + [ok,this.in1,this.exprs] = scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),this.exprs); if (!ok) { break; } @@ -45,7 +46,7 @@ function ZCROSS_f() { var kk = kk+2^(this.in1+jj-1); } this.model.rpar = new ScilabDouble([-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.model.in1 = new ScilabDouble([this.in1]); this.model.nzcross = new ScilabDouble([this.in1]); this.model.firing = new ScilabDouble([-1]); -- cgit