summaryrefslogtreecommitdiff
path: root/js/Linear/DOLLAR.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/DOLLAR.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/DOLLAR.js')
-rw-r--r--js/Linear/DOLLAR.js10
1 files changed, 7 insertions, 3 deletions
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;
}
}