summaryrefslogtreecommitdiff
path: root/js/Linear/CLR.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Linear/CLR.js')
-rw-r--r--js/Linear/CLR.js73
1 files changed, 37 insertions, 36 deletions
diff --git a/js/Linear/CLR.js b/js/Linear/CLR.js
index d6768d96..0b3439e8 100644
--- a/js/Linear/CLR.js
+++ b/js/Linear/CLR.js
@@ -16,14 +16,15 @@ function CLR() {
model.blocktype = "c";
model.dep_ut = [false,true];
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
CLR.prototype.details = function CLR() {
+ return this.x;
}
CLR.prototype.get = function CLR() {
}
CLR.prototype.set = function CLR() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
@@ -35,39 +36,39 @@ function CLR() {
PREVAR_scicos_context = PREVAR_scicos_context;
PREVAR_scicos_context.s = %s;
while (true) {
- [ok,num,den,exprs] = scicos_getvalue("Set continuous SISO transfer parameters",[["Numerator (s)"],["Denominator (s)"]],list("pol",1,"pol",1),exprs);
- if (!ok) {
-break;
-}
- if (degree(num)>degree(den)) {
-message("Transfer function must be proper or strictly proper.");
- ok = false;
-}
- if (ok) {
- H = cont_frm(num,den);
- [A,B,C,D] = H.slice(2-1,5);
- graphics.exprs = exprs;
- [ns1,ns1] = size(A);
- rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]];
- if (norm(D,1)!=0) {
- mmm = [true,true];
- } else {
- mmm = [false,true];
-}
- if (or(model.dep_ut!=mmm)) {
- model.dep_ut = mmm;
-}
- if (ns1<=ns) {
- x0 = x0.slice(1-1,ns1);
- } else {
- x0[ns1-1][1-1] = 0;
-}
- model.state = x0;
- model.rpar = rpar;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,num,den,exprs] = scicos_getvalue("Set continuous SISO transfer parameters",[["Numerator (s)"],["Denominator (s)"]],list("pol",1,"pol",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (degree(num)>degree(den)) {
+ message("Transfer function must be proper or strictly proper.");
+ ok = false;
+ }
+ if (ok) {
+ H = cont_frm(num,den);
+ [A,B,C,D] = H.slice(2-1,5);
+ graphics.exprs = exprs;
+ [ns1,ns1] = size(A);
+ rpar = [[matrix(A,ns1*ns1,1)],[matrix(B,ns1,1)],[matrix(C,ns1,1)],[D]];
+ if (norm(D,1)!=0) {
+ mmm = [true,true];
+ } else {
+ mmm = [false,true];
+ }
+ if (or(model.dep_ut!=mmm)) {
+ model.dep_ut = mmm;
+ }
+ if (ns1<=ns) {
+ x0 = x0.slice(1-1,ns1);
+ } else {
+ x0[ns1-1][1-1] = 0;
+ }
+ model.state = x0;
+ model.rpar = rpar;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}