From 352623792d2b9400510599c487540b1e763a7d3c Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Wed, 29 Aug 2018 10:48:12 +0530 Subject: add the common code to get method also type is a function get the popup title from the value set in the get method --- js/Linear/DOLLAR.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/Linear/DOLLAR.js') 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; } } -- cgit