diff options
Diffstat (limited to 'js/Misc')
-rw-r--r-- | js/Misc/BACKLASH.js | 10 | ||||
-rw-r--r-- | js/Misc/BOUNCE.js | 22 | ||||
-rw-r--r-- | js/Misc/BOUNCEXY.js | 20 | ||||
-rw-r--r-- | js/Misc/BPLATFORM.js | 18 | ||||
-rw-r--r-- | js/Misc/CBLOCK.js | 32 | ||||
-rw-r--r-- | js/Misc/CBLOCK4.js | 42 | ||||
-rw-r--r-- | js/Misc/CONSTRAINT2_c.js | 10 | ||||
-rw-r--r-- | js/Misc/CONSTRAINT_c.js | 6 | ||||
-rw-r--r-- | js/Misc/DEADBAND.js | 10 | ||||
-rw-r--r-- | js/Misc/DIFF_f.js | 8 | ||||
-rw-r--r-- | js/Misc/EDGETRIGGER.js | 6 | ||||
-rw-r--r-- | js/Misc/HYSTHERESIS.js | 14 | ||||
-rw-r--r-- | js/Misc/LOGICAL_OP.js | 12 | ||||
-rw-r--r-- | js/Misc/MBLOCK.js | 18 | ||||
-rw-r--r-- | js/Misc/MEMORY_f.js | 8 | ||||
-rw-r--r-- | js/Misc/PENDULUM_ANIM.js | 18 | ||||
-rw-r--r-- | js/Misc/RATELIMITER.js | 8 | ||||
-rw-r--r-- | js/Misc/RELATIONALOP.js | 10 | ||||
-rw-r--r-- | js/Misc/TEXT_f.js | 10 | ||||
-rw-r--r-- | js/Misc/c_block.js | 12 | ||||
-rw-r--r-- | js/Misc/fortran_block.js | 12 | ||||
-rw-r--r-- | js/Misc/generic_block.js | 30 | ||||
-rw-r--r-- | js/Misc/generic_block2.js | 34 | ||||
-rw-r--r-- | js/Misc/generic_block3.js | 42 | ||||
-rw-r--r-- | js/Misc/scifunc_block.js | 22 | ||||
-rw-r--r-- | js/Misc/scifunc_block_m.js | 22 |
26 files changed, 228 insertions, 228 deletions
diff --git a/js/Misc/BACKLASH.js b/js/Misc/BACKLASH.js index 2af53279..f7d1aeb8 100644 --- a/js/Misc/BACKLASH.js +++ b/js/Misc/BACKLASH.js @@ -26,14 +26,14 @@ function BACKLASH() { return options; } BACKLASH.prototype.set = function BACKLASH() { - this.ini = arguments[0]["ini"] - this.gap = arguments[0]["gap"] - this.zcr = arguments[0]["zcr"] - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; var rpar = this.model.rpar; while (true) { - [ok,this.ini,this.gap,this.zcr,this.exprs] = scicos_getvalue("Set backlash parameters",["initial output","gap","use zero-crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.ini = arguments[0]["ini"]; + this.gap = arguments[0]["gap"]; + this.zcr = arguments[0]["zcr"]; + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js index c2c9867f..eb7f94d9 100644 --- a/js/Misc/BOUNCE.js +++ b/js/Misc/BOUNCE.js @@ -56,23 +56,23 @@ function BOUNCE() { return options; } BOUNCE.prototype.set = function BOUNCE() { - this.rpar1 = parseFloat(arguments[0]["rpar1"]) - this.rpar2 = parseFloat(arguments[0]["rpar2"]) - this.walls = inverse(arguments[0]["walls"]) - this.xt = inverse(arguments[0]["xt"]) - this.xd = inverse(arguments[0]["xd"]) - this.y = inverse(arguments[0]["y"]) - this.yd = inverse(arguments[0]["yd"]) - this.g = parseFloat(arguments[0]["g"]) - this.C = parseFloat(arguments[0]["C"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; if (size(this.exprs,"*")<9) { this.exprs[8-1] = "9.81"; this.exprs[9-1] = "0"; } while (true) { - [ok,this.rpar1,this.rpar2,this.walls,this.xt,this.xd,this.y,this.yd,this.g,this.C,this.exprs] = scicos_getvalue(["Set Bounce Block"],["Mass","Radius","[xmin,xmax,ymin,ymax]","xpos","xdpos","ypos","ydpos","g (gravity)","C (aerodynamic coeff"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.rpar1 = parseFloat(arguments[0]["rpar1"]); + this.rpar2 = parseFloat(arguments[0]["rpar2"]); + this.walls = inverse(arguments[0]["walls"]); + this.xt = inverse(arguments[0]["xt"]); + this.xd = inverse(arguments[0]["xd"]); + this.y = inverse(arguments[0]["y"]); + this.yd = inverse(arguments[0]["yd"]); + this.g = parseFloat(arguments[0]["g"]); + this.C = parseFloat(arguments[0]["C"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/BOUNCEXY.js b/js/Misc/BOUNCEXY.js index 0eed5d47..9c4ba130 100644 --- a/js/Misc/BOUNCEXY.js +++ b/js/Misc/BOUNCEXY.js @@ -52,19 +52,19 @@ function BOUNCEXY() { return options; } BOUNCEXY.prototype.set = function BOUNCEXY() { - this.clrs = inverse(arguments[0]["clrs"]) - this.siz = inverse(arguments[0]["siz"]) - this.win = parseFloat(arguments[0]["win"]) - this.imode = parseFloat(arguments[0]["imode"]) - this.xmin = parseFloat(arguments[0]["xmin"]) - this.xmax = parseFloat(arguments[0]["xmax"]) - this.ymin = parseFloat(arguments[0]["ymin"]) - this.ymax = parseFloat(arguments[0]["ymax"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; var dstate = this.model.dstate; while (true) { - [ok,this.clrs,this.siz,this.win,this.imode,this.xmin,this.xmax,this.ymin,this.ymax,this.exprs] = scicos_getvalue("Set Scope parameters",["colors","radii","window number (-1 for automatic)","animation mode (0,1)","Xmin","Xmax","Ymin","Ymax"],list("vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.clrs = inverse(arguments[0]["clrs"]); + this.siz = inverse(arguments[0]["siz"]); + this.win = parseFloat(arguments[0]["win"]); + this.imode = parseFloat(arguments[0]["imode"]); + this.xmin = parseFloat(arguments[0]["xmin"]); + this.xmax = parseFloat(arguments[0]["xmax"]); + this.ymin = parseFloat(arguments[0]["ymin"]); + this.ymax = parseFloat(arguments[0]["ymax"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/BPLATFORM.js b/js/Misc/BPLATFORM.js index 49243956..c614d905 100644 --- a/js/Misc/BPLATFORM.js +++ b/js/Misc/BPLATFORM.js @@ -37,18 +37,18 @@ function BPLATFORM() { return options; } BPLATFORM.prototype.set = function BPLATFORM() { - this.plen = parseFloat(arguments[0]["plen"]) - this.csiz = parseFloat(arguments[0]["csiz"]) - this.phi = parseFloat(arguments[0]["phi"]) - this.xmin = parseFloat(arguments[0]["xmin"]) - this.xmax = parseFloat(arguments[0]["xmax"]) - this.ymin = parseFloat(arguments[0]["ymin"]) - this.ymax = parseFloat(arguments[0]["ymax"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; var dstate = this.model.dstate; while (true) { - [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,this.exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.plen = parseFloat(arguments[0]["plen"]); + this.csiz = parseFloat(arguments[0]["csiz"]); + this.phi = parseFloat(arguments[0]["phi"]); + this.xmin = parseFloat(arguments[0]["xmin"]); + this.xmax = parseFloat(arguments[0]["xmax"]); + this.ymin = parseFloat(arguments[0]["ymin"]); + this.ymax = parseFloat(arguments[0]["ymax"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js index 91a8a55a..358b939f 100644 --- a/js/Misc/CBLOCK.js +++ b/js/Misc/CBLOCK.js @@ -55,24 +55,24 @@ function CBLOCK() { return options; } CBLOCK.prototype.set = function CBLOCK() { - this.function_name = arguments[0]["function_name"] - this.impli = arguments[0]["impli"] - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.ng = parseFloat(arguments[0]["ng"]) - this.z = inverse(arguments[0]["z"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.ipar = inverse(arguments[0]["ipar"]) - this.auto0 = arguments[0]["auto0"] - this.depu = parseBoolean(arguments[0]["depu"]) - this.dept = parseBoolean(arguments[0]["dept"]) - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; while (true) { - [ok,this.function_name,this.impli,this.i,this.o,this.ci,this.co,this.xx,this.ng,this.z,this.rpar,this.ipar,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set C-Block2 block parameters",["simulation function","is block implicit? (y,n)","input ports sizes","output ports sizes","input event ports sizes","output events ports sizes","initial continuous state","number of zero crossing surfaces","initial discrete state","Real parameters vector","Integer parameters vector","initial firing vector (<0 for no firing)","direct feedthrough (y or n)","time dependence (y or n)"],list("str",1,"str",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label[1-1]); + var ok = true; + this.function_name = arguments[0]["function_name"]; + this.impli = arguments[0]["impli"]; + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.ng = parseFloat(arguments[0]["ng"]); + this.z = inverse(arguments[0]["z"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.ipar = inverse(arguments[0]["ipar"]); + this.auto0 = arguments[0]["auto0"]; + this.depu = parseBoolean(arguments[0]["depu"]); + this.dept = parseBoolean(arguments[0]["dept"]); + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js index 915c5299..0172f4e3 100644 --- a/js/Misc/CBLOCK4.js +++ b/js/Misc/CBLOCK4.js @@ -44,29 +44,29 @@ function CBLOCK4() { return options; } CBLOCK4.prototype.set = function CBLOCK4() { - this.function_name = arguments[0]["function_name"] - this.impli = arguments[0]["impli"] - this.in1 = arguments[0]["in1"] - this.it = arguments[0]["it"] - this.out = arguments[0]["out"] - this.ot = arguments[0]["ot"] - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.oz = arguments[0]["oz"] - this.rpar = inverse(arguments[0]["rpar"]) - this.ipar = parseFloat(arguments[0]["ipar"]) - this.opar = arguments[0]["opar"] - this.nmode = arguments[0]["nmode"] - this.nzcr = arguments[0]["nzcr"] - this.auto0 = arguments[0]["auto0"] - this.depu = parseBoolean(arguments[0]["depu"]) - this.dept = parseBoolean(arguments[0]["dept"]) - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; while (true) { - [ok,this.function_name,this.impli,this.in1,this.it,this.out,this.ot,this.ci,this.co,this.xx,this.z,this.oz,this.rpar,this.ipar,this.opar,this.nmode,this.nzcr,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set C-Block4 block parameters",["Simulation function","Is block implicit? (y,n)","Input ports sizes","Input ports type","Output port sizes","Output ports type","Input event ports sizes","Output events ports sizes","Initial continuous state","Initial discrete state","Initial object state","Real parameters vector","Integer parameters vector","Object parameters list","Number of modes","Number of zero crossings","Initial firing vector (<0 for no firing)","Direct feedthrough (y or n)","Time dependence (y or n)"],list("str",1,"str",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label[1-1]); + var ok = true; + this.function_name = arguments[0]["function_name"]; + this.impli = arguments[0]["impli"]; + this.in1 = arguments[0]["in1"]; + this.it = arguments[0]["it"]; + this.out = arguments[0]["out"]; + this.ot = arguments[0]["ot"]; + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.oz = arguments[0]["oz"]; + this.rpar = inverse(arguments[0]["rpar"]); + this.ipar = parseFloat(arguments[0]["ipar"]); + this.opar = arguments[0]["opar"]; + this.nmode = arguments[0]["nmode"]; + this.nzcr = arguments[0]["nzcr"]; + this.auto0 = arguments[0]["auto0"]; + this.depu = parseBoolean(arguments[0]["depu"]); + this.dept = parseBoolean(arguments[0]["dept"]); + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js index 07f4f1bc..6916d8da 100644 --- a/js/Misc/CONSTRAINT2_c.js +++ b/js/Misc/CONSTRAINT2_c.js @@ -29,14 +29,14 @@ function CONSTRAINT2_c() { return options; } CONSTRAINT2_c.prototype.set = function CONSTRAINT2_c() { - this.x0 = inverse(arguments[0]["x0"]) - this.xd0 = inverse(arguments[0]["xd0"]) - this.id = inverse(arguments[0]["id"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { var ask_again = false; - [ok,this.x0,this.xd0,this.id,this.exprs] = scicos_getvalue("Set Constraint block parameters",["Initial guess values of states x","Initial guess values of derivative x\'","Id(i)=1: if x\'(i) is present in the feedback, else Id(i)=0"],list("vec",-1,"vec",-1,"vec",-1),this.exprs); + var ok = true; + this.x0 = inverse(arguments[0]["x0"]); + this.xd0 = inverse(arguments[0]["xd0"]); + this.id = inverse(arguments[0]["id"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/CONSTRAINT_c.js b/js/Misc/CONSTRAINT_c.js index 0ea8c789..c372580e 100644 --- a/js/Misc/CONSTRAINT_c.js +++ b/js/Misc/CONSTRAINT_c.js @@ -24,11 +24,11 @@ function CONSTRAINT_c() { return options; } CONSTRAINT_c.prototype.set = function CONSTRAINT_c() { - this.x0 = inverse(arguments[0]["x0"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.x0,this.exprs] = scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),this.exprs); + var ok = true; + this.x0 = inverse(arguments[0]["x0"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js index 8bf9884b..d0edaae8 100644 --- a/js/Misc/DEADBAND.js +++ b/js/Misc/DEADBAND.js @@ -30,13 +30,13 @@ function DEADBAND() { return options; } DEADBAND.prototype.set = function DEADBAND() { - this.maxp = parseFloat(arguments[0]["maxp"]) - this.minp = parseFloat(arguments[0]["minp"]) - this.zeroc = arguments[0]["zeroc"] - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.maxp,this.minp,this.zeroc,this.exprs] = scicos_getvalue("Set Deadband parameters",["End of dead band","Start of dead band","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.maxp = parseFloat(arguments[0]["maxp"]); + this.minp = parseFloat(arguments[0]["minp"]); + this.zeroc = arguments[0]["zeroc"]; + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/DIFF_f.js b/js/Misc/DIFF_f.js index d6a523c2..1f777149 100644 --- a/js/Misc/DIFF_f.js +++ b/js/Misc/DIFF_f.js @@ -25,12 +25,12 @@ function DIFF_f() { return options; } DIFF_f.prototype.set = function DIFF_f() { - this.x0 = inverse(arguments[0]["x0"]) - this.xd0 = arguments[0]["xd0"] - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.x0,this.xd0,this.exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",1,"vec",1),this.exprs); + var ok = true; + this.x0 = inverse(arguments[0]["x0"]); + this.xd0 = arguments[0]["xd0"]; + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/EDGETRIGGER.js b/js/Misc/EDGETRIGGER.js index 04b3881a..172dbfb1 100644 --- a/js/Misc/EDGETRIGGER.js +++ b/js/Misc/EDGETRIGGER.js @@ -26,11 +26,11 @@ function EDGETRIGGER() { return options; } EDGETRIGGER.prototype.set = function EDGETRIGGER() { - this.edge = parseFloat(arguments[0]["edge"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.edge,this.exprs] = scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),this.exprs); + var ok = true; + this.edge = parseFloat(arguments[0]["edge"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js index f63ef6b7..4379ca68 100644 --- a/js/Misc/HYSTHERESIS.js +++ b/js/Misc/HYSTHERESIS.js @@ -33,15 +33,15 @@ function HYSTHERESIS() { return options; } HYSTHERESIS.prototype.set = function HYSTHERESIS() { - this.high_lim = arguments[0]["high_lim"] - this.low_lim = arguments[0]["low_lim"] - this.out_high = arguments[0]["out_high"] - this.out_low = arguments[0]["out_low"] - this.nzz = parseFloat(arguments[0]["nzz"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,this.exprs] = scicos_getvalue("Set parameters",["switch on at","switch off at","output when on","output when off","use zero crossing: yes (1), no (0)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.high_lim = arguments[0]["high_lim"]; + this.low_lim = arguments[0]["low_lim"]; + this.out_high = arguments[0]["out_high"]; + this.out_low = arguments[0]["out_low"]; + this.nzz = parseFloat(arguments[0]["nzz"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js index b0884b8d..6c13e6bd 100644 --- a/js/Misc/LOGICAL_OP.js +++ b/js/Misc/LOGICAL_OP.js @@ -29,17 +29,17 @@ function LOGICAL_OP() { return options; } LOGICAL_OP.prototype.set = function LOGICAL_OP() { - this.nin = parseFloat(arguments[0]["nin"]) - this.rule = parseFloat(arguments[0]["rule"]) - this.Datatype = arguments[0]["Datatype"] - this.tp = parseFloat(arguments[0]["tp"]) - this.exprs = inverse(arguments[0]["exprs"]) this.exprs = this.graphics.exprs; if (size(this.exprs,1)==2) { this.exprs = [[this.exprs],[sci2exp(1)],[sci2exp(0)]]; } while (true) { - [ok,this.nin,this.rule,this.Datatype,this.tp,this.exprs] = scicos_getvalue("Set parameters",["number of inputs","Operator: AND (0), OR (1), NAND (2), NOR (3), XOR (4), NOT (5)","Datatype (1=double 3=int32 ...)","Bitwise Rule(0=No 1=yes)"],list("vec",1,"vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.nin = parseFloat(arguments[0]["nin"]); + this.rule = parseFloat(arguments[0]["rule"]); + this.Datatype = arguments[0]["Datatype"]; + this.tp = parseFloat(arguments[0]["tp"]); + this.exprs = inverse(arguments[0]["exprs"]); if (!ok) { break; } diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index 44c8ca1c..456a536a 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -48,14 +48,6 @@ function MBLOCK() { return options; } MBLOCK.prototype.set = function MBLOCK() { - this.Tin = arguments[0]["Tin"] - this.Tintype = arguments[0]["Tintype"] - this.Tout = arguments[0]["Tout"] - this.Touttype = arguments[0]["Touttype"] - this.Tparam = arguments[0]["Tparam"] - this.pprop = inverse(arguments[0]["pprop"]) - this.Tfunam = arguments[0]["Tfunam"] - this.lab_1 = arguments[0]["lab_1"] this.exprs = this.graphics.exprs; if (this.type[this.exprs-1]==15) { var paramv = list(); @@ -69,7 +61,15 @@ function MBLOCK() { this.lab_1 = list(this.exprs.in,this.exprs.intype,this.exprs.out,this.exprs.outtype,this.exprs.param,this.exprs.pprop,this.exprs.nameF); var lab_2 = this.exprs.paramv; while (true) { - [ok,this.Tin,this.Tintype,this.Tout,this.Touttype,this.Tparam,this.pprop,this.Tfunam,this.lab_1] = scicos_getvalue("Set Modelica generic block parameters",["Input variables: ","Input variables types: ","Output variables: ","Output variables types:","Parameters in Modelica:","Parameters properties: ","Function name: "],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),this.lab_1); + var ok = true; + this.Tin = arguments[0]["Tin"]; + this.Tintype = arguments[0]["Tintype"]; + this.Tout = arguments[0]["Tout"]; + this.Touttype = arguments[0]["Touttype"]; + this.Tparam = arguments[0]["Tparam"]; + this.pprop = inverse(arguments[0]["pprop"]); + this.Tfunam = arguments[0]["Tfunam"]; + this.lab_1 = arguments[0]["lab_1"]; if (!ok) { break; } diff --git a/js/Misc/MEMORY_f.js b/js/Misc/MEMORY_f.js index f3687612..018d8f17 100644 --- a/js/Misc/MEMORY_f.js +++ b/js/Misc/MEMORY_f.js @@ -28,12 +28,12 @@ function MEMORY_f() { return options; } MEMORY_f.prototype.set = function MEMORY_f() { - this.a = arguments[0]["a"] - this.inh = parseFloat(arguments[0]["inh"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.a,this.inh,this.exprs] = scicos_getvalue("Set memory block parameters",["initial condition","Inherit (1: no, 0: yes)"],list("vec",-1,"vec",1),this.exprs); + var ok = true; + this.a = arguments[0]["a"]; + this.inh = parseFloat(arguments[0]["inh"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js index c38cbcb4..d2ebdc63 100644 --- a/js/Misc/PENDULUM_ANIM.js +++ b/js/Misc/PENDULUM_ANIM.js @@ -37,18 +37,18 @@ function PENDULUM_ANIM() { return options; } PENDULUM_ANIM.prototype.set = function PENDULUM_ANIM() { - this.plen = parseFloat(arguments[0]["plen"]) - this.csiz = parseFloat(arguments[0]["csiz"]) - this.phi = parseFloat(arguments[0]["phi"]) - this.xmin = parseFloat(arguments[0]["xmin"]) - this.xmax = parseFloat(arguments[0]["xmax"]) - this.ymin = parseFloat(arguments[0]["ymin"]) - this.ymax = parseFloat(arguments[0]["ymax"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; var dstate = this.model.dstate; while (true) { - [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,this.exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.plen = parseFloat(arguments[0]["plen"]); + this.csiz = parseFloat(arguments[0]["csiz"]); + this.phi = parseFloat(arguments[0]["phi"]); + this.xmin = parseFloat(arguments[0]["xmin"]); + this.xmax = parseFloat(arguments[0]["xmax"]); + this.ymin = parseFloat(arguments[0]["ymin"]); + this.ymax = parseFloat(arguments[0]["ymax"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/RATELIMITER.js b/js/Misc/RATELIMITER.js index 0e61e53a..6f8e1174 100644 --- a/js/Misc/RATELIMITER.js +++ b/js/Misc/RATELIMITER.js @@ -27,12 +27,12 @@ function RATELIMITER() { return options; } RATELIMITER.prototype.set = function RATELIMITER() { - this.maxp = parseFloat(arguments[0]["maxp"]) - this.minp = parseFloat(arguments[0]["minp"]) - this.exprs = arguments[0]["exprs"] this.exprs = this.graphics.exprs; while (true) { - [ok,this.maxp,this.minp,this.exprs] = scicos_getvalue("Set rate limiter parameters",["max slope","min slope"],list("vec",1,"vec",1),this.exprs); + var ok = true; + this.maxp = parseFloat(arguments[0]["maxp"]); + this.minp = parseFloat(arguments[0]["minp"]); + this.exprs = arguments[0]["exprs"]; if (!ok) { break; } diff --git a/js/Misc/RELATIONALOP.js b/js/Misc/RELATIONALOP.js index f9089a4a..16a72e3b 100644 --- a/js/Misc/RELATIONALOP.js +++ b/js/Misc/RELATIONALOP.js @@ -28,16 +28,16 @@ function RELATIONALOP() { return options; } RELATIONALOP.prototype.set = function RELATIONALOP() { - this.rule = parseFloat(arguments[0]["rule"]) - this.zcr = parseFloat(arguments[0]["zcr"]) - this.Datatype = arguments[0]["Datatype"] - this.exprs = inverse(arguments[0]["exprs"]) this.exprs = this.graphics.exprs; if (size(this.exprs,1)==2) { this.exprs = [[this.exprs],[sci2exp(1)]]; } while (true) { - [ok,this.rule,this.zcr,this.Datatype,this.exprs] = scicos_getvalue("Set parameters",["Operator: == (0), ~= (1), < (2), <= (3), > (4), >= (5)","Use zero crossing (no: 0), (yes: 1)","Datatype (1=double 3=int32 ...)"],list("vec",1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.rule = parseFloat(arguments[0]["rule"]); + this.zcr = parseFloat(arguments[0]["zcr"]); + this.Datatype = arguments[0]["Datatype"]; + this.exprs = inverse(arguments[0]["exprs"]); if (!ok) { break; } diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js index f459c135..3272f8ee 100644 --- a/js/Misc/TEXT_f.js +++ b/js/Misc/TEXT_f.js @@ -27,17 +27,17 @@ function TEXT_f() { return options; } TEXT_f.prototype.set = function TEXT_f() { - this.txt = arguments[0]["txt"] - this.font = parseFloat(arguments[0]["font"]) - this.siz = parseFloat(arguments[0]["siz"]) - this.exprs = inverse(arguments[0]["exprs"]) var orig = this.graphics.orig; this.exprs = this.graphics.exprs; if (size(this.exprs,"*")==1) { this.exprs = [[this.exprs],["3"],["1"]]; } while (true) { - [ok,this.txt,this.font,this.siz,this.exprs] = scicos_getvalue("Set Text block parameters",["Text","Font number","Font size"],list("str",-1,"vec",1,"vec",1),this.exprs); + var ok = true; + this.txt = arguments[0]["txt"]; + this.font = parseFloat(arguments[0]["font"]); + this.siz = parseFloat(arguments[0]["siz"]); + this.exprs = inverse(arguments[0]["exprs"]); if (!ok) { break; } diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js index 553a7e12..37872f1a 100644 --- a/js/Misc/c_block.js +++ b/js/Misc/c_block.js @@ -42,14 +42,14 @@ function c_block() { return options; } c_block.prototype.set = function c_block() { - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.funam = arguments[0]["funam"] - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; while (true) { - [ok,this.i,this.o,this.rpar,this.funam,this.lab] = scicos_getvalue("Set C_block parameters",["input ports sizes","output port sizes","System parameters vector","function name"],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]); + var ok = true; + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.funam = arguments[0]["funam"]; + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/fortran_block.js b/js/Misc/fortran_block.js index 7b7c2e6e..a4399fa0 100644 --- a/js/Misc/fortran_block.js +++ b/js/Misc/fortran_block.js @@ -33,14 +33,14 @@ function fortran_block() { return options; } fortran_block.prototype.set = function fortran_block() { - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.funam = arguments[0]["funam"] - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; while (true) { - [ok,this.i,this.o,this.rpar,this.funam,this.lab] = scicos_getvalue("Set fortran_block parameters",["input ports sizes","output port sizes","System parameters vector","function name"],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]); + var ok = true; + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.funam = arguments[0]["funam"]; + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js index c8ef0332..bbda2bd2 100644 --- a/js/Misc/generic_block.js +++ b/js/Misc/generic_block.js @@ -43,26 +43,26 @@ function generic_block() { return options; } generic_block.prototype.set = function generic_block() { - this.function_name = arguments[0]["function_name"] - this.funtyp = parseFloat(arguments[0]["funtyp"]) - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.ipar = parseFloat(arguments[0]["ipar"]) - this.auto0 = arguments[0]["auto0"] - this.depu = parseBoolean(arguments[0]["depu"]) - this.dept = parseBoolean(arguments[0]["dept"]) - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } while (true) { - [ok,this.function_name,this.funtyp,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.ipar,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set GENERIC block parameters",["simulation function","function type (0,1,2,..)","input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","Real parameters vector","Integer parameters vector","initial firing vector (<0 for no firing)","direct feedthrough (y or n)","time dependence (y or n)"],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label); + var ok = true; + this.function_name = arguments[0]["function_name"]; + this.funtyp = parseFloat(arguments[0]["funtyp"]); + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.ipar = parseFloat(arguments[0]["ipar"]); + this.auto0 = arguments[0]["auto0"]; + this.depu = parseBoolean(arguments[0]["depu"]); + this.dept = parseBoolean(arguments[0]["dept"]); + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js index ccd515b7..963e475f 100644 --- a/js/Misc/generic_block2.js +++ b/js/Misc/generic_block2.js @@ -45,28 +45,28 @@ function generic_block2() { return options; } generic_block2.prototype.set = function generic_block2() { - this.function_name = arguments[0]["function_name"] - this.funtyp = parseFloat(arguments[0]["funtyp"]) - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.ipar = parseFloat(arguments[0]["ipar"]) - this.nmode = arguments[0]["nmode"] - this.nzcr = arguments[0]["nzcr"] - this.auto0 = arguments[0]["auto0"] - this.depu = parseBoolean(arguments[0]["depu"]) - this.dept = parseBoolean(arguments[0]["dept"]) - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } while (true) { - [ok,this.function_name,this.funtyp,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.ipar,this.nmode,this.nzcr,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set GENERIC block parameters",["simulation function","function type (0,1,2,..)","input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","Real parameters vector","Integer parameters vector","number of modes","number of zero_crossings","initial firing vector (<0 for no firing)","direct feedthrough (y or n)","time dependence (y or n)"],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec","sum(%6)","str",1,"str",1),label); + var ok = true; + this.function_name = arguments[0]["function_name"]; + this.funtyp = parseFloat(arguments[0]["funtyp"]); + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.ipar = parseFloat(arguments[0]["ipar"]); + this.nmode = arguments[0]["nmode"]; + this.nzcr = arguments[0]["nzcr"]; + this.auto0 = arguments[0]["auto0"]; + this.depu = parseBoolean(arguments[0]["depu"]); + this.dept = parseBoolean(arguments[0]["dept"]); + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js index 63199c40..7312b2ec 100644 --- a/js/Misc/generic_block3.js +++ b/js/Misc/generic_block3.js @@ -45,32 +45,32 @@ function generic_block3() { return options; } generic_block3.prototype.set = function generic_block3() { - this.function_name = arguments[0]["function_name"] - this.funtyp = parseFloat(arguments[0]["funtyp"]) - this.in1 = arguments[0]["in1"] - this.it = arguments[0]["it"] - this.out = arguments[0]["out"] - this.ot = arguments[0]["ot"] - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.oz = arguments[0]["oz"] - this.rpar = inverse(arguments[0]["rpar"]) - this.ipar = parseFloat(arguments[0]["ipar"]) - this.opar = arguments[0]["opar"] - this.nmode = arguments[0]["nmode"] - this.nzcr = arguments[0]["nzcr"] - this.auto0 = arguments[0]["auto0"] - this.depu = parseBoolean(arguments[0]["depu"]) - this.dept = parseBoolean(arguments[0]["dept"]) - this.lab = arguments[0]["lab"] var label = this.graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } while (true) { - [ok,this.function_name,this.funtyp,this.in1,this.it,this.out,this.ot,this.ci,this.co,this.xx,this.z,this.oz,this.rpar,this.ipar,this.opar,this.nmode,this.nzcr,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set GENERIC block parameters",["Simulation function","Function type (0,1,2,..)","Input ports sizes","Input ports type","Output port sizes","Output ports type","Input event ports sizes","Output events ports sizes","Initial continuous state","Initial discrete state","Initial object state","Real parameters vector","Integer parameters vector","Object parameters list","Number of modes","Number of zero crossings","Initial firing vector (<0 for no firing)","Direct feedthrough (y or n)","Time dependence (y or n)"],list("str",1,"vec",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label); + var ok = true; + this.function_name = arguments[0]["function_name"]; + this.funtyp = parseFloat(arguments[0]["funtyp"]); + this.in1 = arguments[0]["in1"]; + this.it = arguments[0]["it"]; + this.out = arguments[0]["out"]; + this.ot = arguments[0]["ot"]; + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.oz = arguments[0]["oz"]; + this.rpar = inverse(arguments[0]["rpar"]); + this.ipar = parseFloat(arguments[0]["ipar"]); + this.opar = arguments[0]["opar"]; + this.nmode = arguments[0]["nmode"]; + this.nzcr = arguments[0]["nzcr"]; + this.auto0 = arguments[0]["auto0"]; + this.depu = parseBoolean(arguments[0]["depu"]); + this.dept = parseBoolean(arguments[0]["dept"]); + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js index f3d4ae44..04ae319a 100644 --- a/js/Misc/scifunc_block.js +++ b/js/Misc/scifunc_block.js @@ -47,23 +47,23 @@ function scifunc_block() { return options; } scifunc_block.prototype.set = function scifunc_block() { - this.i = parseFloat(arguments[0]["i"]) - this.o = parseFloat(arguments[0]["o"]) - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.auto0 = arguments[0]["auto0"] - this.deptime = arguments[0]["deptime"] - this.lab = arguments[0]["lab"] var needcompile = 0; this.exprs = this.graphics.exprs; if (size(this.exprs[1-1],"*")==8) { this.exprs[1-1][9-1] = "0"; } while (true) { - [ok,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.auto0,this.deptime,this.lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],["input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","System parameters vector","initial firing vector (<0 for no firing)","is block always active (0:no, 1:yes)"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%4)","vec",1),this.exprs[1-1]); + var ok = true; + this.i = parseFloat(arguments[0]["i"]); + this.o = parseFloat(arguments[0]["o"]); + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.auto0 = arguments[0]["auto0"]; + this.deptime = arguments[0]["deptime"]; + this.lab = arguments[0]["lab"]; if (!ok) { break; } diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index 1933c3b0..554d97ba 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -52,20 +52,20 @@ function scifunc_block_m() { return options; } scifunc_block_m.prototype.set = function scifunc_block_m() { - this.i = arguments[0]["i"] - this.o = arguments[0]["o"] - this.ci = parseFloat(arguments[0]["ci"]) - this.co = parseFloat(arguments[0]["co"]) - this.xx = inverse(arguments[0]["xx"]) - this.z = inverse(arguments[0]["z"]) - this.rpar = inverse(arguments[0]["rpar"]) - this.auto0 = arguments[0]["auto0"] - this.deptime = arguments[0]["deptime"] - this.lab = arguments[0]["lab"] var needcompile = 0; this.exprs = this.graphics.exprs; while (true) { - [ok,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.auto0,this.deptime,this.lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],["input ports sizes","output port sizes","input event ports sizes","output events ports sizes","initial continuous state","initial discrete state","System parameters vector","initial firing vector (<0 for no firing)","is block always active (0:no, 1:yes)"],list("mat",[-1,2],"mat",[-2,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),this.exprs[1-1]); + var ok = true; + this.i = arguments[0]["i"]; + this.o = arguments[0]["o"]; + this.ci = parseFloat(arguments[0]["ci"]); + this.co = parseFloat(arguments[0]["co"]); + this.xx = inverse(arguments[0]["xx"]); + this.z = inverse(arguments[0]["z"]); + this.rpar = inverse(arguments[0]["rpar"]); + this.auto0 = arguments[0]["auto0"]; + this.deptime = arguments[0]["deptime"]; + this.lab = arguments[0]["lab"]; if (!ok) { break; } |