diff options
author | Sunil Shetye | 2018-07-11 13:05:13 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-11 15:21:08 +0530 |
commit | 079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch) | |
tree | 785ed59b5b238203a9e91f3e323da59d1083d86e /js/Misc/CONSTRAINT2_c.js | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/Misc/CONSTRAINT2_c.js')
-rw-r--r-- | js/Misc/CONSTRAINT2_c.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js index b21ab44f..012099d4 100644 --- a/js/Misc/CONSTRAINT2_c.js +++ b/js/Misc/CONSTRAINT2_c.js @@ -12,8 +12,8 @@ function CONSTRAINT2_c() { this.model.ipar = this.id; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); - gr_i = []; + var exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -33,33 +33,33 @@ function CONSTRAINT2_c() { this.xd0 = inverse(arguments[0]["xd0"]) this.id = inverse(arguments[0]["id"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { - ask_again = false; + var ask_again = false; [ok,this.x0,this.xd0,this.id,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),exprs); if (!ok) { break; } this.x0 = this.x0.slice(); - N = size(this.x0,"*"); + var N = size(this.x0,"*"); this.xd0 = this.xd0.slice(); - Nxd = size(this.xd0,"*"); + var Nxd = size(this.xd0,"*"); this.id = this.id.slice(); - Nid = size(this.id,"*"); + var Nid = size(this.id,"*"); if ((N!=Nxd)||(N!=Nid)) { message("incompatible sizes, states, their derivatives, and ID should be the same size "); - ask_again = true; + var ask_again = true; } if ((N<=0&&!ask_again)) { x_message("number of states (constraints) must be > 0 "); - ask_again = true; + var ask_again = true; } if ((!ask_again)) { for (i=1;i<=N;i+=1) { if (!((this.id[i-1]==0)||(this.id[i-1]==1))) { - ask_again = true; + var ask_again = true; x_message([["Id(i) must be either"],["0 when x\'(i) is not present in the feedback"],["1: when x\'(i) is present in the feedback"]]); break; } |