summaryrefslogtreecommitdiff
path: root/js/Linear
diff options
context:
space:
mode:
Diffstat (limited to 'js/Linear')
-rw-r--r--js/Linear/BIGSOM_f.js5
-rw-r--r--js/Linear/CLINDUMMY_f.js3
-rw-r--r--js/Linear/CLR.js12
-rw-r--r--js/Linear/CLR_f.js12
-rw-r--r--js/Linear/CLSS.js8
-rw-r--r--js/Linear/CLSS_f.js8
-rw-r--r--js/Linear/DELAYV_f.js9
-rw-r--r--js/Linear/DELAY_f.js21
-rw-r--r--js/Linear/DERIV.js3
-rw-r--r--js/Linear/DIFF_c.js5
-rw-r--r--js/Linear/DLR.js9
-rw-r--r--js/Linear/DLR_f.js9
-rw-r--r--js/Linear/DLSS.js8
-rw-r--r--js/Linear/DLSS_f.js8
-rw-r--r--js/Linear/DOLLAR.js10
-rw-r--r--js/Linear/DOLLAR.pickle14
-rw-r--r--js/Linear/DOLLAR_f.js8
-rw-r--r--js/Linear/DOLLAR_m.js10
-rw-r--r--js/Linear/DOLLAR_m.pickle14
-rw-r--r--js/Linear/GAINBLK.js8
-rw-r--r--js/Linear/GAINBLK_f.js5
-rw-r--r--js/Linear/GAIN_f.js5
-rw-r--r--js/Linear/INTEGRAL.js5
-rw-r--r--js/Linear/INTEGRAL_f.js5
-rw-r--r--js/Linear/INTEGRAL_m.js5
-rw-r--r--js/Linear/PID.js38
-rw-r--r--js/Linear/REGISTER.js8
-rw-r--r--js/Linear/REGISTER_f.js5
-rw-r--r--js/Linear/SAMPHOLD.js3
-rw-r--r--js/Linear/SAMPHOLD_m.js6
-rw-r--r--js/Linear/SAMPLEHOLD_f.js3
-rw-r--r--js/Linear/SOM_f.js3
-rw-r--r--js/Linear/SUMMATION.js10
-rw-r--r--js/Linear/SUM_f.js3
-rw-r--r--js/Linear/TCLSS.js8
-rw-r--r--js/Linear/TCLSS_f.js8
-rw-r--r--js/Linear/TIME_DELAY.js6
-rw-r--r--js/Linear/VARIABLE_DELAY.js6
38 files changed, 226 insertions, 90 deletions
diff --git a/js/Linear/BIGSOM_f.js b/js/Linear/BIGSOM_f.js
index 8bb727b2..82858cb8 100644
--- a/js/Linear/BIGSOM_f.js
+++ b/js/Linear/BIGSOM_f.js
@@ -18,6 +18,8 @@ function BIGSOM_f() {
return this.x;
}
BIGSOM_f.prototype.get = function BIGSOM_f() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set sum block parameters";
var options = {
sgn:["Inputs ports signs/gain",this.sgn.toString().replace(/,/g," ")],
}
@@ -48,7 +50,6 @@ function BIGSOM_f() {
return new BigSom(this.x);
}
BIGSOM_f.prototype.get_popup_title = function BIGSOM_f() {
- var set_param_popup_title = "Set sum block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/CLINDUMMY_f.js b/js/Linear/CLINDUMMY_f.js
index 08889e05..73e4bd95 100644
--- a/js/Linear/CLINDUMMY_f.js
+++ b/js/Linear/CLINDUMMY_f.js
@@ -22,7 +22,6 @@ function CLINDUMMY_f() {
return new BasicBlock(this.x);
}
CLINDUMMY_f.prototype.get_popup_title = function CLINDUMMY_f() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/CLR.js b/js/Linear/CLR.js
index f44b534d..b39762ae 100644
--- a/js/Linear/CLR.js
+++ b/js/Linear/CLR.js
@@ -23,6 +23,15 @@ function CLR() {
return this.x;
}
CLR.prototype.get = function CLR() {
+ var exprs = this.graphics.exprs;
+ var x0 = this.model.state;
+ var rpar = this.model.rpar;
+ var ns = prod(size(x0));
+ var nin = 1;
+ var nout = 1;
+ var PREVAR_scicos_context = PREVAR_scicos_context;
+ PREVAR_scicos_context.s = %s;
+ this.set_param_popup_title = "Set continuous SISO transfer parameters";
var options = {
num:["Numerator (s)",this.num],
den:["Denominator (s)",this.den],
@@ -86,7 +95,6 @@ function CLR() {
return new BasicBlock(this.x);
}
CLR.prototype.get_popup_title = function CLR() {
- var set_param_popup_title = "Set continuous SISO transfer parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/CLR_f.js b/js/Linear/CLR_f.js
index 45ad9962..d08a56e2 100644
--- a/js/Linear/CLR_f.js
+++ b/js/Linear/CLR_f.js
@@ -23,6 +23,15 @@ function CLR_f() {
return this.x;
}
CLR_f.prototype.get = function CLR_f() {
+ var exprs = this.graphics.exprs;
+ var x0 = this.model.state;
+ var rpar = this.model.rpar;
+ var ns = prod(size(x0));
+ var nin = 1;
+ var nout = 1;
+ var PREVAR_scicos_context = PREVAR_scicos_context;
+ PREVAR_scicos_context.s = %s;
+ this.set_param_popup_title = "Set continuous SISO transfer parameters";
var options = {
num:["Numerator (s)",this.num],
den:["Denominator (s)",this.den],
@@ -86,7 +95,6 @@ function CLR_f() {
return new BasicBlock(this.x);
}
CLR_f.prototype.get_popup_title = function CLR_f() {
- var set_param_popup_title = "Set continuous SISO transfer parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/CLSS.js b/js/Linear/CLSS.js
index 1e4f58fb..5f732c5d 100644
--- a/js/Linear/CLSS.js
+++ b/js/Linear/CLSS.js
@@ -25,6 +25,11 @@ function CLSS() {
return this.x;
}
CLSS.prototype.get = function CLSS() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set continuous linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -105,7 +110,6 @@ function CLSS() {
return new BasicBlock(this.x);
}
CLSS.prototype.get_popup_title = function CLSS() {
- 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/Linear/CLSS_f.js b/js/Linear/CLSS_f.js
index 045f2abe..98eb5131 100644
--- a/js/Linear/CLSS_f.js
+++ b/js/Linear/CLSS_f.js
@@ -25,6 +25,11 @@ function CLSS_f() {
return this.x;
}
CLSS_f.prototype.get = function CLSS_f() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set continuous linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -95,7 +100,6 @@ function CLSS_f() {
return new BasicBlock(this.x);
}
CLSS_f.prototype.get_popup_title = function CLSS_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/Linear/DELAYV_f.js b/js/Linear/DELAYV_f.js
index b6cfe6fd..027adbd7 100644
--- a/js/Linear/DELAYV_f.js
+++ b/js/Linear/DELAYV_f.js
@@ -25,6 +25,12 @@ function DELAYV_f() {
return this.x;
}
DELAYV_f.prototype.get = function DELAYV_f() {
+ var exprs = this.graphics.exprs;
+ this.nin = this.model.in[1-1];
+ var z0 = this.model.dstate;
+ this.zz0 = z0.slice(1-1,$-1);
+ var told = z0[$-1];
+ this.set_param_popup_title = "Set delay parameters";
var options = {
nin:["Number of inputs",this.nin],
zz0:["Register initial condition",this.zz0],
@@ -75,7 +81,6 @@ function DELAYV_f() {
return new BasicBlock(this.x);
}
DELAYV_f.prototype.get_popup_title = function DELAYV_f() {
- var set_param_popup_title = "Set delay parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DELAY_f.js b/js/Linear/DELAY_f.js
index 579b7823..49bed7b4 100644
--- a/js/Linear/DELAY_f.js
+++ b/js/Linear/DELAY_f.js
@@ -69,6 +69,24 @@ function DELAY_f() {
return this.x;
}
DELAY_f.prototype.get = function DELAY_f() {
+ var ppath = list(0,0);
+ if (typeof(o)=="Block"&&o.gui=="REGISTER_f") {
+ ppath[1-1] = i;
+ }
+ if (typeof(o)=="Block"&&o.gui=="EVTDLY_f") {
+ ppath[2-1] = i;
+ }
+ if (and(ppath!=list(0,0))) {
+ break;
+ }
+ }
+ var newpar = list();
+ var register = this.x.model.rpar.objs[ppath[1-1]-1];
+ var evtdly = this.x.model.rpar.objs[ppath[2-1]-1];
+ var register_exprs = register.graphics.exprs;
+ var evtdly_exprs = evtdly.graphics.exprs;
+ var exprs = [[evtdly_exprs[1-1]],[register_exprs]];
+ this.set_param_popup_title = "This block implements as a discretized delay";
var options = {
dt:["Discretization time step",this.dt],
z0:["Register initial state",this.z0],
@@ -135,7 +153,6 @@ function DELAY_f() {
return new BasicBlock(this.x);
}
DELAY_f.prototype.get_popup_title = function DELAY_f() {
- var set_param_popup_title = "This block implements as a discretized delay";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DERIV.js b/js/Linear/DERIV.js
index 136a70f5..7180b6b2 100644
--- a/js/Linear/DERIV.js
+++ b/js/Linear/DERIV.js
@@ -22,7 +22,6 @@ function DERIV() {
return new BasicBlock(this.x);
}
DERIV.prototype.get_popup_title = function DERIV() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/DIFF_c.js b/js/Linear/DIFF_c.js
index f6ee6fec..118ba2cb 100644
--- a/js/Linear/DIFF_c.js
+++ b/js/Linear/DIFF_c.js
@@ -18,6 +18,8 @@ function DIFF_c() {
return this.x;
}
DIFF_c.prototype.get = function DIFF_c() {
+ 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],
@@ -62,7 +64,6 @@ function DIFF_c() {
return new BasicBlock(this.x);
}
DIFF_c.prototype.get_popup_title = function DIFF_c() {
- 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/Linear/DLR.js b/js/Linear/DLR.js
index d80c13a2..04ada0c5 100644
--- a/js/Linear/DLR.js
+++ b/js/Linear/DLR.js
@@ -24,6 +24,12 @@ function DLR() {
return this.x;
}
DLR.prototype.get = function DLR() {
+ var exprs = this.graphics.exprs;
+ var x0 = this.model.dstate;
+ var ns = prod(size(x0));
+ var PREVAR_scicos_context = PREVAR_scicos_context;
+ PREVAR_scicos_context.z = %z;
+ this.set_param_popup_title = "Set discrete SISO transfer parameters";
var options = {
num:["Numerator (z)",this.num],
den:["Denominator (z)",this.den],
@@ -85,7 +91,6 @@ function DLR() {
return new BasicBlock(this.x);
}
DLR.prototype.get_popup_title = function DLR() {
- var set_param_popup_title = "Set discrete SISO transfer parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DLR_f.js b/js/Linear/DLR_f.js
index 85c3d176..cc0b8b26 100644
--- a/js/Linear/DLR_f.js
+++ b/js/Linear/DLR_f.js
@@ -24,6 +24,12 @@ function DLR_f() {
return this.x;
}
DLR_f.prototype.get = function DLR_f() {
+ var exprs = this.graphics.exprs;
+ var x0 = this.model.dstate;
+ var ns = prod(size(x0));
+ var PREVAR_scicos_context = PREVAR_scicos_context;
+ PREVAR_scicos_context.z = %z;
+ this.set_param_popup_title = "Set discrete SISO transfer parameters";
var options = {
num:["Numerator (z)",this.num],
den:["Denominator (z)",this.den],
@@ -85,7 +91,6 @@ function DLR_f() {
return new BasicBlock(this.x);
}
DLR_f.prototype.get_popup_title = function DLR_f() {
- var set_param_popup_title = "Set discrete SISO transfer parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DLSS.js b/js/Linear/DLSS.js
index 6348c0e3..e3b84916 100644
--- a/js/Linear/DLSS.js
+++ b/js/Linear/DLSS.js
@@ -24,6 +24,11 @@ function DLSS() {
return this.x;
}
DLSS.prototype.get = function DLSS() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set discrete linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -104,7 +109,6 @@ function DLSS() {
return new BasicBlock(this.x);
}
DLSS.prototype.get_popup_title = function DLSS() {
- var set_param_popup_title = "Set discrete linear system parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DLSS_f.js b/js/Linear/DLSS_f.js
index b5fc3ebd..e85a06ef 100644
--- a/js/Linear/DLSS_f.js
+++ b/js/Linear/DLSS_f.js
@@ -24,6 +24,11 @@ function DLSS_f() {
return this.x;
}
DLSS_f.prototype.get = function DLSS_f() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set discrete linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -94,7 +99,6 @@ function DLSS_f() {
return new BasicBlock(this.x);
}
DLSS_f.prototype.get_popup_title = function DLSS_f() {
- var set_param_popup_title = "Set discrete linear system parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DOLLAR.js b/js/Linear/DOLLAR.js
index 28705a98..af263c92 100644
--- a/js/Linear/DOLLAR.js
+++ b/js/Linear/DOLLAR.js
@@ -21,6 +21,11 @@ function DOLLAR() {
return this.x;
}
DOLLAR.prototype.get = function DOLLAR() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")<2) {
+ exprs[2-1] = "0";
+ }
+ this.set_param_popup_title = "Set 1/z block parameters";
var options = {
a:["initial condition",this.a],
inh:["Inherit (no:0, yes:1)",this.inh],
@@ -48,7 +53,7 @@ function DOLLAR() {
this.model.sim = list(new ScilabString(["dollar4_m"]), new ScilabDouble([4]));
this.model.odstate = list(new ScilabDouble([this.a]));
this.model.dstate = new ScilabDouble([]);
- if (this.type[(this.a)==1-1]) {
+ if (type((this.a)==1)) {
if (isreal(this.a)) {
var it = 1;
var ot = 1;
@@ -100,7 +105,6 @@ function DOLLAR() {
return new BasicBlock(this.x);
}
DOLLAR.prototype.get_popup_title = function DOLLAR() {
- var set_param_popup_title = "Set 1/z block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DOLLAR.pickle b/js/Linear/DOLLAR.pickle
index f41de5a7..f6e20a69 100644
--- a/js/Linear/DOLLAR.pickle
+++ b/js/Linear/DOLLAR.pickle
@@ -4,18 +4,16 @@ p0
((lp1
S'a'
p2
-aS'inh'
+aS'x'
p3
-aS'graphics'
+aS'model'
p4
-aS'x'
+aS'inh'
p5
-aS'model'
+aS'graphics'
p6
-aS'type'
-p7
-atp8
-Rp9
+atp7
+Rp8
.(dp0
S'model.odstate'
p1
diff --git a/js/Linear/DOLLAR_f.js b/js/Linear/DOLLAR_f.js
index 069b7a75..04d5cf15 100644
--- a/js/Linear/DOLLAR_f.js
+++ b/js/Linear/DOLLAR_f.js
@@ -21,6 +21,11 @@ function DOLLAR_f() {
return this.x;
}
DOLLAR_f.prototype.get = function DOLLAR_f() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")<2) {
+ exprs[2-1] = "0";
+ }
+ this.set_param_popup_title = "Set 1/z block parameters";
var options = {
a:["initial condition",this.a],
inh:["Inherit (no:0, yes:1)",this.inh],
@@ -64,7 +69,6 @@ function DOLLAR_f() {
return new BasicBlock(this.x);
}
DOLLAR_f.prototype.get_popup_title = function DOLLAR_f() {
- var set_param_popup_title = "Set 1/z block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DOLLAR_m.js b/js/Linear/DOLLAR_m.js
index 43baf0c2..8108e69a 100644
--- a/js/Linear/DOLLAR_m.js
+++ b/js/Linear/DOLLAR_m.js
@@ -21,6 +21,11 @@ function DOLLAR_m() {
return this.x;
}
DOLLAR_m.prototype.get = function DOLLAR_m() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")<2) {
+ exprs[2-1] = "0";
+ }
+ this.set_param_popup_title = "Set 1/z block parameters";
var options = {
a:["initial condition",this.a],
inh:["Inherit (no:0, yes:1)",this.inh],
@@ -48,7 +53,7 @@ function DOLLAR_m() {
this.model.sim = list(new ScilabString(["dollar4_m"]), new ScilabDouble([4]));
this.model.odstate = list(new ScilabDouble([this.a]));
this.model.dstate = new ScilabDouble([]);
- if ((this.type[this.a-1]==1)) {
+ if ((type(this.a)==1)) {
if (isreal(this.a)) {
var it = 1;
var ot = 1;
@@ -100,7 +105,6 @@ function DOLLAR_m() {
return new BasicBlock(this.x);
}
DOLLAR_m.prototype.get_popup_title = function DOLLAR_m() {
- var set_param_popup_title = "Set 1/z block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/DOLLAR_m.pickle b/js/Linear/DOLLAR_m.pickle
index f41de5a7..f6e20a69 100644
--- a/js/Linear/DOLLAR_m.pickle
+++ b/js/Linear/DOLLAR_m.pickle
@@ -4,18 +4,16 @@ p0
((lp1
S'a'
p2
-aS'inh'
+aS'x'
p3
-aS'graphics'
+aS'model'
p4
-aS'x'
+aS'inh'
p5
-aS'model'
+aS'graphics'
p6
-aS'type'
-p7
-atp8
-Rp9
+atp7
+Rp8
.(dp0
S'model.odstate'
p1
diff --git a/js/Linear/GAINBLK.js b/js/Linear/GAINBLK.js
index 89c30062..0c75a5a7 100644
--- a/js/Linear/GAINBLK.js
+++ b/js/Linear/GAINBLK.js
@@ -24,6 +24,11 @@ function GAINBLK() {
return this.x;
}
GAINBLK.prototype.get = function GAINBLK() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==1) {
+ var exprs = [[exprs],[sci2exp(0)]];
+ }
+ this.set_param_popup_title = "Set gain block parameters";
var options = {
gain:["Gain",this.gain],
over:["Do On Overflow(0=Nothing 1=Saturate 2=Error)",this.over],
@@ -167,7 +172,6 @@ function GAINBLK() {
return new BasicBlock(this.x);
}
GAINBLK.prototype.get_popup_title = function GAINBLK() {
- var set_param_popup_title = "Set gain block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/GAINBLK_f.js b/js/Linear/GAINBLK_f.js
index eddc903e..b3b22d63 100644
--- a/js/Linear/GAINBLK_f.js
+++ b/js/Linear/GAINBLK_f.js
@@ -20,6 +20,8 @@ function GAINBLK_f() {
return this.x;
}
GAINBLK_f.prototype.get = function GAINBLK_f() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set gain block parameters";
var options = {
gain:["Gain",this.gain],
}
@@ -57,7 +59,6 @@ function GAINBLK_f() {
return new BasicBlock(this.x);
}
GAINBLK_f.prototype.get_popup_title = function GAINBLK_f() {
- var set_param_popup_title = "Set gain block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js
index 9098ce8c..a141ab47 100644
--- a/js/Linear/GAIN_f.js
+++ b/js/Linear/GAIN_f.js
@@ -20,6 +20,8 @@ function GAIN_f() {
return this.x;
}
GAIN_f.prototype.get = function GAIN_f() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set gain block parameters";
var options = {
gain:["Gain",this.gain],
}
@@ -57,7 +59,6 @@ function GAIN_f() {
return new BasicBlock(this.x);
}
GAIN_f.prototype.get_popup_title = function GAIN_f() {
- var set_param_popup_title = "Set gain block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/INTEGRAL.js b/js/Linear/INTEGRAL.js
index 7ffd63a9..372bee07 100644
--- a/js/Linear/INTEGRAL.js
+++ b/js/Linear/INTEGRAL.js
@@ -22,6 +22,8 @@ function INTEGRAL() {
return this.x;
}
INTEGRAL.prototype.get = function INTEGRAL() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set Integral block parameters";
var options = {
x0:["Initial Condition",this.x0],
reinit:["With re-intialization (1:yes, 0:no)",this.reinit],
@@ -98,7 +100,6 @@ function INTEGRAL() {
return new BasicBlock(this.x);
}
INTEGRAL.prototype.get_popup_title = function INTEGRAL() {
- var set_param_popup_title = "Set Integral block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/INTEGRAL_f.js b/js/Linear/INTEGRAL_f.js
index d1ee8a31..c7e7854b 100644
--- a/js/Linear/INTEGRAL_f.js
+++ b/js/Linear/INTEGRAL_f.js
@@ -18,6 +18,8 @@ function INTEGRAL_f() {
return this.x;
}
INTEGRAL_f.prototype.get = function INTEGRAL_f() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set continuous linear system parameters";
var options = {
x0:["Initial state",this.x0],
}
@@ -42,7 +44,6 @@ function INTEGRAL_f() {
return new BasicBlock(this.x);
}
INTEGRAL_f.prototype.get_popup_title = function INTEGRAL_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/Linear/INTEGRAL_m.js b/js/Linear/INTEGRAL_m.js
index c53e466f..b0efc448 100644
--- a/js/Linear/INTEGRAL_m.js
+++ b/js/Linear/INTEGRAL_m.js
@@ -23,6 +23,8 @@ function INTEGRAL_m() {
return this.x;
}
INTEGRAL_m.prototype.get = function INTEGRAL_m() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set Integral block parameters";
var options = {
x0:["Initial Condition",this.x0],
reinit:["With re-intialization (1:yes, 0:no)",this.reinit],
@@ -145,7 +147,6 @@ function INTEGRAL_m() {
return new BasicBlock(this.x);
}
INTEGRAL_m.prototype.get_popup_title = function INTEGRAL_m() {
- var set_param_popup_title = "Set Integral block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/PID.js b/js/Linear/PID.js
index 8c346451..3eccc084 100644
--- a/js/Linear/PID.js
+++ b/js/Linear/PID.js
@@ -43,6 +43,41 @@ function PID() {
return this.x;
}
PID.prototype.get = function PID() {
+ var ppath = list(0,0,0);
+ if (typeof(o)=="Link") {
+ if (from.gui=="GAINBLK") {
+ switch (to.gui) {
+ case "SUMMATION":
+ ppath[1-1] = o.from[1-1];
+ case "INTEGRAL_m":
+ ppath[2-1] = o.from[1-1];
+ case "DERIV":
+ ppath[3-1] = o.from[1-1];
+ }
+ } else if (to.gui=="GAINBLK") {
+ switch (from.gui) {
+ case "SUMMATION":
+ ppath[1-1] = o.to[1-1];
+ case "INTEGRAL_m":
+ ppath[2-1] = o.to[1-1];
+ case "DERIV":
+ ppath[3-1] = o.to[1-1];
+ }
+ }
+ if (and(ppath!=list(0,0,0))) {
+ break;
+ }
+ }
+ }
+ var newpar = list();
+ exprs[1-1] = xx1.graphics.exprs[1-1];
+ var p_old = xx1.model.rpar;
+ exprs[2-1] = xx2.graphics.exprs[1-1];
+ var i_old = xx2.model.rpar;
+ exprs[3-1] = xx3.graphics.exprs[1-1];
+ var d_old = xx3.model.rpar;
+ var y = 0;
+ this.set_param_popup_title = "Set PID parameters";
var options = {
p:["Proportional",this.p],
i:["Integral",this.i],
@@ -116,7 +151,6 @@ function PID() {
return new BasicBlock(this.x);
}
PID.prototype.get_popup_title = function PID() {
- var set_param_popup_title = "Set PID parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/REGISTER.js b/js/Linear/REGISTER.js
index c99b2f8b..86c391b7 100644
--- a/js/Linear/REGISTER.js
+++ b/js/Linear/REGISTER.js
@@ -19,6 +19,11 @@ function REGISTER() {
return this.x;
}
REGISTER.prototype.get = function REGISTER() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,1)==1) {
+ var exprs = [[exprs],[sci2exp(1)]];
+ }
+ this.set_param_popup_title = "Set delay parameters";
var options = {
z0:["Register initial condition",this.z0],
it:["Datatype (1=double 3=int32 ...)",this.it],
@@ -92,7 +97,6 @@ function REGISTER() {
return new BasicBlock(this.x);
}
REGISTER.prototype.get_popup_title = function REGISTER() {
- var set_param_popup_title = "Set delay parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/REGISTER_f.js b/js/Linear/REGISTER_f.js
index 786806ab..3e660cc3 100644
--- a/js/Linear/REGISTER_f.js
+++ b/js/Linear/REGISTER_f.js
@@ -19,6 +19,8 @@ function REGISTER_f() {
return this.x;
}
REGISTER_f.prototype.get = function REGISTER_f() {
+ var exprs = this.graphics.exprs;
+ this.set_param_popup_title = "Set delay parameters";
var options = {
z0:["Register initial condition",this.z0],
}
@@ -49,7 +51,6 @@ function REGISTER_f() {
return new BasicBlock(this.x);
}
REGISTER_f.prototype.get_popup_title = function REGISTER_f() {
- var set_param_popup_title = "Set delay parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/SAMPHOLD.js b/js/Linear/SAMPHOLD.js
index 8e0477b8..76c5b115 100644
--- a/js/Linear/SAMPHOLD.js
+++ b/js/Linear/SAMPHOLD.js
@@ -24,7 +24,6 @@ function SAMPHOLD() {
return new BasicBlock(this.x);
}
SAMPHOLD.prototype.get_popup_title = function SAMPHOLD() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/SAMPHOLD_m.js b/js/Linear/SAMPHOLD_m.js
index f9ed7a43..5626fe8c 100644
--- a/js/Linear/SAMPHOLD_m.js
+++ b/js/Linear/SAMPHOLD_m.js
@@ -21,6 +21,9 @@ function SAMPHOLD_m() {
return this.x;
}
SAMPHOLD_m.prototype.get = function SAMPHOLD_m() {
+ this.x.model.firing = [];
+ var label = this.graphics.exprs;
+ this.set_param_popup_title = "Set parameters Block";
var options = {
it:["Datatype(1=real double 2=Complex 3=int32 ...)",this.it],
}
@@ -56,7 +59,6 @@ function SAMPHOLD_m() {
return new BasicBlock(this.x);
}
SAMPHOLD_m.prototype.get_popup_title = function SAMPHOLD_m() {
- var set_param_popup_title = "Set parameters Block";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/SAMPLEHOLD_f.js b/js/Linear/SAMPLEHOLD_f.js
index 9df1c5c1..aa828d29 100644
--- a/js/Linear/SAMPLEHOLD_f.js
+++ b/js/Linear/SAMPLEHOLD_f.js
@@ -24,7 +24,6 @@ function SAMPLEHOLD_f() {
return new BasicBlock(this.x);
}
SAMPLEHOLD_f.prototype.get_popup_title = function SAMPLEHOLD_f() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/SOM_f.js b/js/Linear/SOM_f.js
index 4fd3c9b5..f2f1902f 100644
--- a/js/Linear/SOM_f.js
+++ b/js/Linear/SOM_f.js
@@ -40,7 +40,6 @@ function SOM_f() {
return new BasicBlock(this.x);
}
SOM_f.prototype.get_popup_title = function SOM_f() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/SUMMATION.js b/js/Linear/SUMMATION.js
index 37d5b7eb..665519fc 100644
--- a/js/Linear/SUMMATION.js
+++ b/js/Linear/SUMMATION.js
@@ -20,6 +20,13 @@ function SUMMATION() {
return this.x;
}
SUMMATION.prototype.get = function SUMMATION() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,1)==1) {
+ var exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]];
+ } else if (size(exprs,1)==2) {
+ var exprs = [[exprs],[sci2exp(0)]];
+ }
+ this.set_param_popup_title = "Set sum block parameters";
var options = {
Datatype:["Datatype (1=real double 2=complex 3=int32 ...)",this.Datatype],
sgn:["Number of inputs or sign vector (of +1, -1)",this.sgn.toString().replace(/,/g," ")],
@@ -152,7 +159,6 @@ function SUMMATION() {
return new Summation(this.x);
}
SUMMATION.prototype.get_popup_title = function SUMMATION() {
- var set_param_popup_title = "Set sum block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/SUM_f.js b/js/Linear/SUM_f.js
index 96d28c42..679e71cc 100644
--- a/js/Linear/SUM_f.js
+++ b/js/Linear/SUM_f.js
@@ -22,7 +22,6 @@ function SUM_f() {
return new RoundBlock(this.x);
}
SUM_f.prototype.get_popup_title = function SUM_f() {
- var set_param_popup_title = "Set parameters";
- return set_param_popup_title;
+ return;
}
}
diff --git a/js/Linear/TCLSS.js b/js/Linear/TCLSS.js
index c73804d1..63c2ab86 100644
--- a/js/Linear/TCLSS.js
+++ b/js/Linear/TCLSS.js
@@ -27,6 +27,11 @@ function TCLSS() {
return this.x;
}
TCLSS.prototype.get = function TCLSS() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set continuous linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -102,7 +107,6 @@ function TCLSS() {
return new BasicBlock(this.x);
}
TCLSS.prototype.get_popup_title = function TCLSS() {
- 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/Linear/TCLSS_f.js b/js/Linear/TCLSS_f.js
index 34171ae1..35a50172 100644
--- a/js/Linear/TCLSS_f.js
+++ b/js/Linear/TCLSS_f.js
@@ -27,6 +27,11 @@ function TCLSS_f() {
return this.x;
}
TCLSS_f.prototype.get = function TCLSS_f() {
+ var exprs = this.graphics.exprs;
+ if (size(exprs,"*")==7) {
+ var exprs = exprs[[1:4,7]-1];
+ }
+ this.set_param_popup_title = "Set continuous linear system parameters";
var options = {
A:["A matrix",this.A],
B:["B matrix",this.B],
@@ -102,7 +107,6 @@ function TCLSS_f() {
return new BasicBlock(this.x);
}
TCLSS_f.prototype.get_popup_title = function TCLSS_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/Linear/TIME_DELAY.js b/js/Linear/TIME_DELAY.js
index 42396604..8a9510ac 100644
--- a/js/Linear/TIME_DELAY.js
+++ b/js/Linear/TIME_DELAY.js
@@ -22,6 +22,9 @@ function TIME_DELAY() {
return this.x;
}
TIME_DELAY.prototype.get = function TIME_DELAY() {
+ var exprs = this.graphics.exprs;
+ var nin = this.model.in[1-1];
+ this.set_param_popup_title = "Set delay parameters";
var options = {
T:["Delay",this.T],
init:["initial input",this.init],
@@ -70,7 +73,6 @@ function TIME_DELAY() {
return new BasicBlock(this.x);
}
TIME_DELAY.prototype.get_popup_title = function TIME_DELAY() {
- var set_param_popup_title = "Set delay parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}
diff --git a/js/Linear/VARIABLE_DELAY.js b/js/Linear/VARIABLE_DELAY.js
index c76c8a29..f5af9a08 100644
--- a/js/Linear/VARIABLE_DELAY.js
+++ b/js/Linear/VARIABLE_DELAY.js
@@ -22,6 +22,9 @@ function VARIABLE_DELAY() {
return this.x;
}
VARIABLE_DELAY.prototype.get = function VARIABLE_DELAY() {
+ var exprs = this.graphics.exprs;
+ var nin = this.model.in[1-1];
+ this.set_param_popup_title = "Set delay parameters";
var options = {
T:["Max delay",this.T],
init:["initial input",this.init],
@@ -69,7 +72,6 @@ function VARIABLE_DELAY() {
return new BasicBlock(this.x);
}
VARIABLE_DELAY.prototype.get_popup_title = function VARIABLE_DELAY() {
- var set_param_popup_title = "Set delay parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}