summaryrefslogtreecommitdiff
path: root/js/Linear/DOLLAR_m.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Linear/DOLLAR_m.js')
-rw-r--r--js/Linear/DOLLAR_m.js123
1 files changed, 62 insertions, 61 deletions
diff --git a/js/Linear/DOLLAR_m.js b/js/Linear/DOLLAR_m.js
index 8fa53e30..4cd2dfdf 100644
--- a/js/Linear/DOLLAR_m.js
+++ b/js/Linear/DOLLAR_m.js
@@ -14,77 +14,78 @@ function DOLLAR_m() {
model.blocktype = "d";
model.dep_ut = [false,false];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
DOLLAR_m.prototype.details = function DOLLAR_m() {
+ return this.x;
}
DOLLAR_m.prototype.get = function DOLLAR_m() {
}
DOLLAR_m.prototype.set = function DOLLAR_m() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (size(exprs,"*")<2) {
- exprs[2-1] = "0";
-}
+ exprs[2-1] = "0";
+ }
while (true) {
- [ok,a,inh,exprs] = scicos_getvalue("Set 1/z block parameters",[["initial condition"],["Inherit (no:0, yes:1)"]],list("mat",[-1,-2],"vec",-1),exprs);
- if (!ok) {
-break;
-}
- out = [size(a,1),size(a,2)];
- if (out==0) {
- out = [];
-}
- in1 = out;
- model.sim = list("dollar4_m",4);
- model.odstate = list(a);
- model.dstate = [];
- if ((this.type[a-1]==1)) {
- if (isreal(a)) {
- it = 1;
- ot = 1;
- if ((size(a,1)==1||size(a,2)==1)) {
- model.sim = list("dollar4",4);
- model.dstate = a.slice();
- model.odstate = list();
-}
- } else {
- it = 2;
- ot = 2;
-}
- } else if ((typeof(a)=="int32")) {
- it = 3;
- ot = 3;
- } else if ((typeof(a)=="int16")) {
- it = 4;
- ot = 4;
- } else if ((typeof(a)=="int8")) {
- it = 5;
- ot = 5;
- } else if ((typeof(a)=="uint32")) {
- it = 6;
- ot = 6;
- } else if ((typeof(a)=="uint16")) {
- it = 7;
- ot = 7;
- } else if ((typeof(a)=="uint8")) {
- it = 8;
- ot = 8;
- } else {
-message("type is not recognized");
- ok = false;
-}
- if (ok) {
- [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]);
-}
- if (ok) {
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,a,inh,exprs] = scicos_getvalue("Set 1/z block parameters",[["initial condition"],["Inherit (no:0, yes:1)"]],list("mat",[-1,-2],"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ out = [size(a,1),size(a,2)];
+ if (out==0) {
+ out = [];
+ }
+ in1 = out;
+ model.sim = list("dollar4_m",4);
+ model.odstate = list(a);
+ model.dstate = [];
+ if ((this.type[a-1]==1)) {
+ if (isreal(a)) {
+ it = 1;
+ ot = 1;
+ if ((size(a,1)==1||size(a,2)==1)) {
+ model.sim = list("dollar4",4);
+ model.dstate = a.slice();
+ model.odstate = list();
+ }
+ } else {
+ it = 2;
+ ot = 2;
+ }
+ } else if ((typeof(a)=="int32")) {
+ it = 3;
+ ot = 3;
+ } else if ((typeof(a)=="int16")) {
+ it = 4;
+ ot = 4;
+ } else if ((typeof(a)=="int8")) {
+ it = 5;
+ ot = 5;
+ } else if ((typeof(a)=="uint32")) {
+ it = 6;
+ ot = 6;
+ } else if ((typeof(a)=="uint16")) {
+ it = 7;
+ ot = 7;
+ } else if ((typeof(a)=="uint8")) {
+ it = 8;
+ ot = 8;
+ } else {
+ message("type is not recognized");
+ ok = false;
+ }
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]);
+ }
+ if (ok) {
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}