summaryrefslogtreecommitdiff
path: root/js/Linear/PID.js
diff options
context:
space:
mode:
authorSunil Shetye2018-08-29 10:48:12 +0530
committerSunil Shetye2018-08-29 18:03:04 +0530
commit352623792d2b9400510599c487540b1e763a7d3c (patch)
tree7711522f3fcd42a9d5f22b9fa3328763452a6918 /js/Linear/PID.js
parent17a1beeeae647a6fbd0904a5d794ce7754df7eb2 (diff)
downloadsci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.gz
sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.bz2
sci2js-352623792d2b9400510599c487540b1e763a7d3c.zip
add the common code to get method also
type is a function get the popup title from the value set in the get method
Diffstat (limited to 'js/Linear/PID.js')
-rw-r--r--js/Linear/PID.js38
1 files changed, 36 insertions, 2 deletions
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;
}
}