summaryrefslogtreecommitdiff
path: root/js/Branching/M_SWITCH.js
diff options
context:
space:
mode:
authorSunil Shetye2018-07-11 13:05:13 +0530
committerSunil Shetye2018-07-11 15:21:08 +0530
commit079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch)
tree785ed59b5b238203a9e91f3e323da59d1083d86e /js/Branching/M_SWITCH.js
parent0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff)
downloadsci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz
sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2
sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip
fix assignment to list
Diffstat (limited to 'js/Branching/M_SWITCH.js')
-rw-r--r--js/Branching/M_SWITCH.js33
1 files changed, 18 insertions, 15 deletions
diff --git a/js/Branching/M_SWITCH.js b/js/Branching/M_SWITCH.js
index 093f2f54..30bbaee4 100644
--- a/js/Branching/M_SWITCH.js
+++ b/js/Branching/M_SWITCH.js
@@ -1,8 +1,8 @@
/* autogenerated from "macros/Branching/M_SWITCH.sci" */
function M_SWITCH() {
M_SWITCH.prototype.define = function M_SWITCH() {
- in1 = [[1],[-1],[-1]];
- ipar = [[1],[3]];
+ var in1 = [[1],[-1],[-1]];
+ var ipar = [[1],[3]];
this.nin = 2;
this.model = scicos_model();
this.model.sim = list(new ScilabString(["mswitch"]), new ScilabDouble([4]));
@@ -11,8 +11,8 @@ function M_SWITCH() {
this.model.ipar = new ScilabDouble(ipar);
this.model.blocktype = new ScilabString(["c"]);
this.model.dep_ut = [true,false];
- exprs = [[string(this.nin)],[string(ipar)]];
- gr_i = [];
+ var exprs = [[string(this.nin)],[string(ipar)]];
+ var gr_i = [];
this.x = standard_define([2.5,2],this.model,exprs,gr_i);
return new BasicBlock(this.x);
}
@@ -32,8 +32,8 @@ function M_SWITCH() {
this.base = parseFloat(arguments[0]["base"])
this.rule = arguments[0]["rule"]
this.x = arg1;
- graphics = arg1.graphics;
- exprs = graphics.exprs;
+ var graphics = arg1.graphics;
+ var exprs = graphics.exprs;
this.model = arg1.model;
while (true) {
[ok,this.nin,this.base,this.rule,exprs] = scicos_getvalue("Set parameters",["number of inputs","zero base indexing (0), otherwise 1","rounding rule: int (0), round (1), ceil (2), floor (3)"],list("vec",1,"vec",1,"vec",1),exprs);
@@ -50,17 +50,20 @@ function M_SWITCH() {
message("incorrect rounding rule");
} else {
if (this.nin==1) {
- in1 = [[1,1],[-1,1]];
- out = [1,1];
+ var in1 = [[1,1],[-1,1]];
+ var out = [1,1];
} else {
- in1 = [[1],[-ones(this.nin,1)]];
- in2 = [[1],[-2*ones(this.nin,1)]];
- in1 = [in1,in2];
- out = [-1,-2];
+ var in1 = [[1],[-ones(this.nin,1)]];
+ var in2 = [[1],[-2*ones(this.nin,1)]];
+ var in1 = [in1,in2];
+ var out = [-1,-2];
}
- it = [[-1],[-2*ones(this.nin,1)]];
- ot = -2;
- [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]);
+ var it = [[-1],[-2*ones(this.nin,1)]];
+ var ot = -2;
+ var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[])
+ this.model = tmpvar0[0]
+ var graphics = tmpvar0[1]
+ var ok = tmpvar0[2];
if (ok) {
graphics.exprs = exprs;
this.model.ipar = new ScilabDouble([this.base],[this.rule]);