diff options
Diffstat (limited to 'js/Misc')
42 files changed, 164 insertions, 114 deletions
diff --git a/js/Misc/AUTOMAT.js b/js/Misc/AUTOMAT.js index 2603b806..77e8c8ef 100644 --- a/js/Misc/AUTOMAT.js +++ b/js/Misc/AUTOMAT.js @@ -138,7 +138,6 @@ function AUTOMAT() { return new BasicBlock(this.x); } AUTOMAT.prototype.get_popup_title = function AUTOMAT() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/BACKLASH.js b/js/Misc/BACKLASH.js index e641e87b..9dfbb549 100644 --- a/js/Misc/BACKLASH.js +++ b/js/Misc/BACKLASH.js @@ -18,6 +18,9 @@ function BACKLASH() { return this.x; } BACKLASH.prototype.get = function BACKLASH() { + var exprs = this.graphics.exprs; + var rpar = this.model.rpar; + this.set_param_popup_title = "Set backlash parameters"; var options = { ini:["initial output",this.ini], gap:["gap",this.gap], @@ -55,7 +58,6 @@ function BACKLASH() { return new BasicBlock(this.x); } BACKLASH.prototype.get_popup_title = function BACKLASH() { - var set_param_popup_title = "Set backlash parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js index f9680e27..b9ff94bb 100644 --- a/js/Misc/BOUNCE.js +++ b/js/Misc/BOUNCE.js @@ -42,6 +42,12 @@ function BOUNCE() { return this.x; } BOUNCE.prototype.get = function BOUNCE() { + var exprs = this.graphics.exprs; + if (size(exprs,"*")<9) { + exprs[8-1] = "9.81"; + exprs[9-1] = "0"; + } + this.set_param_popup_title = "Set Bounce Block"; var options = { rpar1:["Mass",this.rpar1], rpar2:["Radius",this.rpar2], @@ -132,7 +138,6 @@ function BOUNCE() { return new BasicBlock(this.x); } BOUNCE.prototype.get_popup_title = function BOUNCE() { - var set_param_popup_title = "Set Bounce Block"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/BOUNCEXY.js b/js/Misc/BOUNCEXY.js index e20fc199..1c2436a5 100644 --- a/js/Misc/BOUNCEXY.js +++ b/js/Misc/BOUNCEXY.js @@ -39,6 +39,9 @@ function BOUNCEXY() { return this.x; } BOUNCEXY.prototype.get = function BOUNCEXY() { + var exprs = this.graphics.exprs; + var dstate = this.model.dstate; + this.set_param_popup_title = "Set Scope parameters"; var options = { clrs:["colors",this.clrs.toString().replace(/,/g," ")], siz:["radii",this.siz.toString().replace(/,/g," ")], @@ -112,7 +115,6 @@ function BOUNCEXY() { return new BasicBlock(this.x); } BOUNCEXY.prototype.get_popup_title = function BOUNCEXY() { - var set_param_popup_title = "Set Scope parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/BPLATFORM.js b/js/Misc/BPLATFORM.js index 5bbde5da..ce5defd9 100644 --- a/js/Misc/BPLATFORM.js +++ b/js/Misc/BPLATFORM.js @@ -25,6 +25,9 @@ function BPLATFORM() { return this.x; } BPLATFORM.prototype.get = function BPLATFORM() { + var exprs = this.graphics.exprs; + var dstate = this.model.dstate; + this.set_param_popup_title = "Set Scope parameters"; var options = { plen:["pendulum length",this.plen], csiz:["cart size (square side)",this.csiz], @@ -80,7 +83,6 @@ function BPLATFORM() { return new BasicBlock(this.x); } BPLATFORM.prototype.get_popup_title = function BPLATFORM() { - var set_param_popup_title = "Set Scope parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js index c2a1781c..b5c5e41a 100644 --- a/js/Misc/CBLOCK.js +++ b/js/Misc/CBLOCK.js @@ -36,6 +36,8 @@ function CBLOCK() { return this.x; } CBLOCK.prototype.get = function CBLOCK() { + var label = this.graphics.exprs; + this.set_param_popup_title = "Set C-Block2 block parameters"; var options = { function_name:["simulation function",this.function_name], impli:["is block implicit? (y,n)",this.impli], @@ -165,7 +167,6 @@ function CBLOCK() { return new BasicBlock(this.x); } CBLOCK.prototype.get_popup_title = function CBLOCK() { - var set_param_popup_title = "Set C-Block2 block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js index 0bb6a6ea..89762f05 100644 --- a/js/Misc/CBLOCK4.js +++ b/js/Misc/CBLOCK4.js @@ -20,6 +20,8 @@ function CBLOCK4() { return this.x; } CBLOCK4.prototype.get = function CBLOCK4() { + var label = this.graphics.exprs; + this.set_param_popup_title = "Set C-Block4 block parameters"; var options = { function_name:["Simulation function",this.function_name], impli:["Is block implicit? (y,n)",this.impli], @@ -157,7 +159,6 @@ function CBLOCK4() { return new BasicBlock(this.x); } CBLOCK4.prototype.get_popup_title = function CBLOCK4() { - var set_param_popup_title = "Set C-Block4 block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js index fadef54f..07f81384 100644 --- a/js/Misc/CONSTRAINT2_c.js +++ b/js/Misc/CONSTRAINT2_c.js @@ -21,6 +21,8 @@ function CONSTRAINT2_c() { return this.x; } CONSTRAINT2_c.prototype.get = function CONSTRAINT2_c() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set Constraint block parameters"; var options = { x0:["Initial guess values of states x",this.x0], xd0:["Initial guess values of derivative x\'",this.xd0], @@ -81,7 +83,6 @@ function CONSTRAINT2_c() { return new BasicBlock(this.x); } CONSTRAINT2_c.prototype.get_popup_title = function CONSTRAINT2_c() { - var set_param_popup_title = "Set Constraint block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/CONSTRAINT_c.js b/js/Misc/CONSTRAINT_c.js index c7f9f041..cb70864b 100644 --- a/js/Misc/CONSTRAINT_c.js +++ b/js/Misc/CONSTRAINT_c.js @@ -19,6 +19,8 @@ function CONSTRAINT_c() { return this.x; } CONSTRAINT_c.prototype.get = function CONSTRAINT_c() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set solver block parameters"; var options = { x0:["Initial guess values",this.x0.toString().replace(/,/g," ")], } @@ -58,7 +60,6 @@ function CONSTRAINT_c() { return new BasicBlock(this.x); } CONSTRAINT_c.prototype.get_popup_title = function CONSTRAINT_c() { - var set_param_popup_title = "Set solver block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js index f5e17f05..581e8621 100644 --- a/js/Misc/DEADBAND.js +++ b/js/Misc/DEADBAND.js @@ -22,6 +22,8 @@ function DEADBAND() { return this.x; } DEADBAND.prototype.get = function DEADBAND() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set Deadband parameters"; var options = { maxp:["End of dead band",this.maxp], minp:["Start of dead band",this.minp], @@ -62,7 +64,6 @@ function DEADBAND() { return new BasicBlock(this.x); } DEADBAND.prototype.get_popup_title = function DEADBAND() { - var set_param_popup_title = "Set Deadband parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js index c9816c9b..353cb3cf 100644 --- a/js/Misc/DEBUG.js +++ b/js/Misc/DEBUG.js @@ -50,7 +50,6 @@ function DEBUG() { return new BasicBlock(this.x); } DEBUG.prototype.get_popup_title = function DEBUG() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/DEBUG_SCICOS.js b/js/Misc/DEBUG_SCICOS.js index 384a6ac7..4f647f25 100644 --- a/js/Misc/DEBUG_SCICOS.js +++ b/js/Misc/DEBUG_SCICOS.js @@ -17,7 +17,6 @@ function DEBUG_SCICOS() { return new BasicBlock(this.x); } DEBUG_SCICOS.prototype.get_popup_title = function DEBUG_SCICOS() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/DIFF_f.js b/js/Misc/DIFF_f.js index 8e33144a..be998d72 100644 --- a/js/Misc/DIFF_f.js +++ b/js/Misc/DIFF_f.js @@ -18,6 +18,8 @@ function DIFF_f() { return this.x; } DIFF_f.prototype.get = function DIFF_f() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set continuous linear system parameters"; var options = { x0:["Initial state",this.x0.toString().replace(/,/g," ")], xd0:["Initial Derivative",this.xd0], @@ -44,7 +46,6 @@ function DIFF_f() { return new BasicBlock(this.x); } DIFF_f.prototype.get_popup_title = function DIFF_f() { - var set_param_popup_title = "Set continuous linear system parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/DSUPER.js b/js/Misc/DSUPER.js index 3e740768..5314d979 100644 --- a/js/Misc/DSUPER.js +++ b/js/Misc/DSUPER.js @@ -51,7 +51,6 @@ function DSUPER() { return new BasicBlock(this.x); } DSUPER.prototype.get_popup_title = function DSUPER() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/EDGETRIGGER.js b/js/Misc/EDGETRIGGER.js index 58123010..52cb2fe1 100644 --- a/js/Misc/EDGETRIGGER.js +++ b/js/Misc/EDGETRIGGER.js @@ -20,6 +20,8 @@ function EDGETRIGGER() { return this.x; } EDGETRIGGER.prototype.get = function EDGETRIGGER() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set edge trigger block parameters"; var options = { edge:["rising (1), falling (-1), both (0)",this.edge], } @@ -43,7 +45,6 @@ function EDGETRIGGER() { return new BasicBlock(this.x); } EDGETRIGGER.prototype.get_popup_title = function EDGETRIGGER() { - var set_param_popup_title = "Set edge trigger block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/EDGE_TRIGGER.js b/js/Misc/EDGE_TRIGGER.js index 5f7b9040..8bc4c23d 100644 --- a/js/Misc/EDGE_TRIGGER.js +++ b/js/Misc/EDGE_TRIGGER.js @@ -153,7 +153,6 @@ function EDGE_TRIGGER() { return new BasicBlock(this.x); } EDGE_TRIGGER.prototype.get_popup_title = function EDGE_TRIGGER() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/ENDBLK.js b/js/Misc/ENDBLK.js index d28f61a1..25bae3f2 100644 --- a/js/Misc/ENDBLK.js +++ b/js/Misc/ENDBLK.js @@ -81,7 +81,6 @@ function ENDBLK() { return new BasicBlock(this.x); } ENDBLK.prototype.get_popup_title = function ENDBLK() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/Extract_Activation.js b/js/Misc/Extract_Activation.js index 5a5d062e..aadd3cf8 100644 --- a/js/Misc/Extract_Activation.js +++ b/js/Misc/Extract_Activation.js @@ -96,7 +96,6 @@ function Extract_Activation() { return new BasicBlock(this.x); } Extract_Activation.prototype.get_popup_title = function Extract_Activation() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js index a1654a92..0d077460 100644 --- a/js/Misc/HYSTHERESIS.js +++ b/js/Misc/HYSTHERESIS.js @@ -23,6 +23,8 @@ function HYSTHERESIS() { return this.x; } HYSTHERESIS.prototype.get = function HYSTHERESIS() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set parameters"; var options = { high_lim:["switch on at",this.high_lim], low_lim:["switch off at",this.low_lim], @@ -63,7 +65,6 @@ function HYSTHERESIS() { return new BasicBlock(this.x); } HYSTHERESIS.prototype.get_popup_title = function HYSTHERESIS() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/IMPSPLIT_f.js b/js/Misc/IMPSPLIT_f.js index 119f14d6..de6c6964 100644 --- a/js/Misc/IMPSPLIT_f.js +++ b/js/Misc/IMPSPLIT_f.js @@ -25,7 +25,6 @@ function IMPSPLIT_f() { return new BasicBlock(this.x); } IMPSPLIT_f.prototype.get_popup_title = function IMPSPLIT_f() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js index 6abdac9d..8937a967 100644 --- a/js/Misc/LOGICAL_OP.js +++ b/js/Misc/LOGICAL_OP.js @@ -20,6 +20,11 @@ function LOGICAL_OP() { return this.x; } LOGICAL_OP.prototype.get = function LOGICAL_OP() { + var exprs = this.graphics.exprs; + if (size(exprs,1)==2) { + var exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]]; + } + this.set_param_popup_title = "Set parameters"; var options = { nin:["number of inputs",this.nin], rule:["Operator: AND (0), OR (1), NAND (2), NOR (3), XOR (4), NOT (5)",this.rule], @@ -133,7 +138,6 @@ function LOGICAL_OP() { return new BasicBlock(this.x); } LOGICAL_OP.prototype.get_popup_title = function LOGICAL_OP() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index 590d570e..8794da27 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -36,6 +36,19 @@ function MBLOCK() { return this.x; } MBLOCK.prototype.get = function MBLOCK() { + var exprs = this.graphics.exprs; + if (type(exprs)==15) { + var paramv = list(); + this.pprop = []; + for (i=1;i<=size(this.model.rpar,"*");i+=1) { + paramv[$+1-1] = string(this.model.rpar[i-1]); + this.pprop[$+1-1] = 0; + } + var exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]); + } + var lab_1 = list(exprs.in,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF); + var lab_2 = exprs.paramv; + this.set_param_popup_title = "Set Modelica generic block parameters"; var options = { Tin:["Input variables: ",this.Tin], Tintype:["Input variables types: ",this.Tintype], @@ -49,7 +62,7 @@ function MBLOCK() { } MBLOCK.prototype.set = function MBLOCK() { var exprs = this.graphics.exprs; - if (this.type[exprs-1]==15) { + if (type(exprs)==15) { var paramv = list(); this.pprop = []; for (i=1;i<=size(this.model.rpar,"*");i+=1) { @@ -272,7 +285,7 @@ function MBLOCK() { exprs.param = lab_1[5-1]; exprs.paramv = list(); if (Tparam_sz!=0) { - if (this.type[lab_2-1]==15) { + if (type(lab_2)==15) { for (i=1;i<=lstsize(lab_2);i+=1) { exprs.paramv[i-1] = lab_2[i-1]; } @@ -297,7 +310,6 @@ function MBLOCK() { return new BasicBlock(this.x); } MBLOCK.prototype.get_popup_title = function MBLOCK() { - var set_param_popup_title = "Set Modelica generic block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/MBLOCK.pickle b/js/Misc/MBLOCK.pickle index 6f7bc938..67edbc3c 100644 --- a/js/Misc/MBLOCK.pickle +++ b/js/Misc/MBLOCK.pickle @@ -28,14 +28,12 @@ aS'model' p13 aS'out' p14 -aS'type' -p15 aS'Tintype' -p16 +p15 aS'Tfunam' -p17 -atp18 -Rp19 +p16 +atp17 +Rp18 .(dp0 S'rhs_txt' p1 diff --git a/js/Misc/MEMORY_f.js b/js/Misc/MEMORY_f.js index 6b0e385a..d4b2d559 100644 --- a/js/Misc/MEMORY_f.js +++ b/js/Misc/MEMORY_f.js @@ -21,6 +21,8 @@ function MEMORY_f() { return this.x; } MEMORY_f.prototype.get = function MEMORY_f() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set memory block parameters"; var options = { a:["initial condition",this.a], inh:["Inherit (1: no, 0: yes)",this.inh], @@ -65,7 +67,6 @@ function MEMORY_f() { return new BasicBlock(this.x); } MEMORY_f.prototype.get_popup_title = function MEMORY_f() { - var set_param_popup_title = "Set memory block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 7afd3924..fc44e9c0 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -40,7 +40,7 @@ function MPBLOCK() { } MPBLOCK.prototype.set = function MPBLOCK() { var exprs = this.graphics.exprs; - if (this.type[exprs-1]==15) { + if (type(exprs)==15) { var paramv = list(); var pprop = []; for (i=1;i<=size(this.model.rpar,"*");i+=1) { @@ -254,7 +254,7 @@ function MPBLOCK() { exprs.param = lab_1[5-1]; exprs.paramv = list(); if (Tparam_sz!=0) { - if (this.type[lab_2-1]==15) { + if (type(lab_2)==15) { for (i=1;i<=lstsize(lab_2);i+=1) { exprs.paramv[i-1] = lab_2[i-1]; } @@ -279,7 +279,6 @@ function MPBLOCK() { return new BasicBlock(this.x); } MPBLOCK.prototype.get_popup_title = function MPBLOCK() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/MPBLOCK.pickle b/js/Misc/MPBLOCK.pickle index 7e28fde3..e422d105 100644 --- a/js/Misc/MPBLOCK.pickle +++ b/js/Misc/MPBLOCK.pickle @@ -16,12 +16,10 @@ aS'x' p7 aS'model' p8 -aS'type' -p9 aS'out' -p10 -atp11 -Rp12 +p9 +atp10 +Rp11 .(dp0 S'rhs_txt' p1 diff --git a/js/Misc/PAL_f.js b/js/Misc/PAL_f.js index 768538a7..b9677ebb 100644 --- a/js/Misc/PAL_f.js +++ b/js/Misc/PAL_f.js @@ -32,7 +32,6 @@ function PAL_f() { return new BasicBlock(this.x); } PAL_f.prototype.get_popup_title = function PAL_f() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js index ca950fd6..69b40f0c 100644 --- a/js/Misc/PENDULUM_ANIM.js +++ b/js/Misc/PENDULUM_ANIM.js @@ -25,6 +25,9 @@ function PENDULUM_ANIM() { return this.x; } PENDULUM_ANIM.prototype.get = function PENDULUM_ANIM() { + var exprs = this.graphics.exprs; + var dstate = this.model.dstate; + this.set_param_popup_title = "Set Scope parameters"; var options = { plen:["pendulum length",this.plen], csiz:["cart size (square side)",this.csiz], @@ -80,7 +83,6 @@ function PENDULUM_ANIM() { return new BasicBlock(this.x); } PENDULUM_ANIM.prototype.get_popup_title = function PENDULUM_ANIM() { - var set_param_popup_title = "Set Scope parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/RATELIMITER.js b/js/Misc/RATELIMITER.js index 3bf627b2..6a5674df 100644 --- a/js/Misc/RATELIMITER.js +++ b/js/Misc/RATELIMITER.js @@ -20,6 +20,8 @@ function RATELIMITER() { return this.x; } RATELIMITER.prototype.get = function RATELIMITER() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set rate limiter parameters"; var options = { maxp:["max slope",this.maxp], minp:["min slope",this.minp], @@ -51,7 +53,6 @@ function RATELIMITER() { return new BasicBlock(this.x); } RATELIMITER.prototype.get_popup_title = function RATELIMITER() { - var set_param_popup_title = "Set rate limiter parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/RELATIONALOP.js b/js/Misc/RELATIONALOP.js index ee0d868c..5809668a 100644 --- a/js/Misc/RELATIONALOP.js +++ b/js/Misc/RELATIONALOP.js @@ -20,6 +20,11 @@ function RELATIONALOP() { return this.x; } RELATIONALOP.prototype.get = function RELATIONALOP() { + var exprs = this.graphics.exprs; + if (size(exprs,1)==2) { + var exprs = [[exprs],[sci2exp(1)]]; + } + this.set_param_popup_title = "Set parameters"; var options = { rule:["Operator: == (0), ~= (1), < (2), <= (3), > (4), >= (5)",this.rule], zcr:["Use zero crossing (no: 0), (yes: 1)",this.zcr], @@ -106,7 +111,6 @@ function RELATIONALOP() { return new BasicBlock(this.x); } RELATIONALOP.prototype.get_popup_title = function RELATIONALOP() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/SPLIT_f.js b/js/Misc/SPLIT_f.js index 4bd6cd0f..0877647e 100644 --- a/js/Misc/SPLIT_f.js +++ b/js/Misc/SPLIT_f.js @@ -20,7 +20,6 @@ function SPLIT_f() { return new BasicBlock(this.x); } SPLIT_f.prototype.get_popup_title = function SPLIT_f() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/SUPER_f.js b/js/Misc/SUPER_f.js index 6e590b1b..22a1b30a 100644 --- a/js/Misc/SUPER_f.js +++ b/js/Misc/SUPER_f.js @@ -32,7 +32,6 @@ function SUPER_f() { return new SuperBlock(this.x); } SUPER_f.prototype.get_popup_title = function SUPER_f() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js index 79ebade1..a190b625 100644 --- a/js/Misc/TEXT_f.js +++ b/js/Misc/TEXT_f.js @@ -19,6 +19,12 @@ function TEXT_f() { return this.x; } TEXT_f.prototype.get = function TEXT_f() { + var orig = this.graphics.orig; + var exprs = this.graphics.exprs; + if (size(exprs,"*")==1) { + var exprs = [[exprs],["3"],["1"]]; + } + this.set_param_popup_title = "Set Text block parameters"; var options = { txt:["Text",this.txt], font:["Font number",this.font], @@ -76,7 +82,6 @@ function TEXT_f() { return new TextBlock(this.x); } TEXT_f.prototype.get_popup_title = function TEXT_f() { - var set_param_popup_title = "Set Text block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js index ed485eb8..a5d4aaff 100644 --- a/js/Misc/c_block.js +++ b/js/Misc/c_block.js @@ -33,6 +33,8 @@ function c_block() { return this.x; } c_block.prototype.get = function c_block() { + var label = this.graphics.exprs; + this.set_param_popup_title = "Set C_block parameters"; var options = { i:["input ports sizes",this.i], o:["output port sizes",this.o], @@ -89,7 +91,6 @@ function c_block() { return new BasicBlock(this.x); } c_block.prototype.get_popup_title = function c_block() { - var set_param_popup_title = "Set C_block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/fortran_block.js b/js/Misc/fortran_block.js index 450fa119..ab10b0fc 100644 --- a/js/Misc/fortran_block.js +++ b/js/Misc/fortran_block.js @@ -24,6 +24,8 @@ function fortran_block() { return this.x; } fortran_block.prototype.get = function fortran_block() { + var label = this.graphics.exprs; + this.set_param_popup_title = "Set fortran_block parameters"; var options = { i:["input ports sizes",this.i], o:["output port sizes",this.o], @@ -80,7 +82,6 @@ function fortran_block() { return new BasicBlock(this.x); } fortran_block.prototype.get_popup_title = function fortran_block() { - var set_param_popup_title = "Set fortran_block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/func_block.js b/js/Misc/func_block.js index a8e7a333..29394b60 100644 --- a/js/Misc/func_block.js +++ b/js/Misc/func_block.js @@ -34,7 +34,6 @@ function func_block() { return new BasicBlock(this.x); } func_block.prototype.get_popup_title = function func_block() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js index 64844ad9..c154ad17 100644 --- a/js/Misc/generic_block.js +++ b/js/Misc/generic_block.js @@ -25,6 +25,11 @@ function generic_block() { return this.x; } generic_block.prototype.get = function generic_block() { + var label = this.graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; + } + this.set_param_popup_title = "Set GENERIC block parameters"; var options = { function_name:["simulation function",this.function_name], funtyp:["function type (0,1,2,..)",this.funtyp], @@ -127,7 +132,6 @@ function generic_block() { return new BasicBlock(this.x); } generic_block.prototype.get_popup_title = function generic_block() { - var set_param_popup_title = "Set GENERIC block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js index 1980938a..73fc7e31 100644 --- a/js/Misc/generic_block2.js +++ b/js/Misc/generic_block2.js @@ -25,6 +25,11 @@ function generic_block2() { return this.x; } generic_block2.prototype.get = function generic_block2() { + var label = this.graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; + } + this.set_param_popup_title = "Set GENERIC block parameters"; var options = { function_name:["simulation function",this.function_name], funtyp:["function type (0,1,2,..)",this.funtyp], @@ -133,7 +138,6 @@ function generic_block2() { return new BasicBlock(this.x); } generic_block2.prototype.get_popup_title = function generic_block2() { - var set_param_popup_title = "Set GENERIC block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js index eb6b4f25..f4a397c5 100644 --- a/js/Misc/generic_block3.js +++ b/js/Misc/generic_block3.js @@ -21,6 +21,11 @@ function generic_block3() { return this.x; } generic_block3.prototype.get = function generic_block3() { + var label = this.graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; + } + this.set_param_popup_title = "Set GENERIC block parameters"; var options = { function_name:["Simulation function",this.function_name], funtyp:["Function type (0,1,2,..)",this.funtyp], @@ -95,12 +100,12 @@ function generic_block3() { var ok = false; } } - if (this.type[this.opar-1]!=15) { + if (type(this.opar)!=15) { message("object parameter must be a list"); throw "user error"; var ok = false; } - if (this.type[this.oz-1]!=15) { + if (type(this.oz)!=15) { message("discrete object state must be a list"); throw "user error"; var ok = false; @@ -147,7 +152,6 @@ function generic_block3() { return new BasicBlock(this.x); } generic_block3.prototype.get_popup_title = function generic_block3() { - var set_param_popup_title = "Set GENERIC block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/generic_block3.pickle b/js/Misc/generic_block3.pickle index 994993fa..a0d8591e 100644 --- a/js/Misc/generic_block3.pickle +++ b/js/Misc/generic_block3.pickle @@ -16,40 +16,38 @@ aS'funtyp' p7 aS'out' p8 -aS'type' -p9 aS'function_name' -p10 +p9 aS'in1' -p11 +p10 aS'graphics' -p12 +p11 aS'nmode' -p13 +p12 aS'z' -p14 +p13 aS'xx' -p15 +p14 aS'nzcr' -p16 +p15 aS'depu' -p17 +p16 aS'dept' -p18 +p17 aS'opar' -p19 +p18 aS'oz' -p20 +p19 aS'ipar' -p21 +p20 aS'x' -p22 +p21 aS'model' -p23 +p22 aS'ot' -p24 -atp25 -Rp26 +p23 +atp24 +Rp25 .(dp0 S'model.odstate' p1 diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js index ea851ed6..eda2f6f8 100644 --- a/js/Misc/scifunc_block.js +++ b/js/Misc/scifunc_block.js @@ -33,6 +33,12 @@ function scifunc_block() { return this.x; } scifunc_block.prototype.get = function scifunc_block() { + var needcompile = 0; + var exprs = this.graphics.exprs; + if (size(exprs[1-1],"*")==8) { + exprs[1-1][9-1] = "0"; + } + this.set_param_popup_title = "Set scifunc_block parameters"; var options = { i:["input ports sizes",this.i], o:["output port sizes",this.o], @@ -118,7 +124,6 @@ function scifunc_block() { return new BasicBlock(this.x); } scifunc_block.prototype.get_popup_title = function scifunc_block() { - var set_param_popup_title = "Set scifunc_block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index 97b050f3..e2027a0f 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -38,6 +38,9 @@ function scifunc_block_m() { return this.x; } scifunc_block_m.prototype.get = function scifunc_block_m() { + var needcompile = 0; + var exprs = this.graphics.exprs; + this.set_param_popup_title = "Set scifunc_block parameters"; var options = { i:["input ports sizes",this.i], o:["output port sizes",this.o], @@ -120,7 +123,6 @@ function scifunc_block_m() { return new BasicBlock(this.x); } scifunc_block_m.prototype.get_popup_title = function scifunc_block_m() { - var set_param_popup_title = "Set scifunc_block parameters"; - return set_param_popup_title; + return this.set_param_popup_title; } } |