1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/* autogenerated from "macros/Sources/Modulo_Count.sci" */
function Modulo_Count() {
Modulo_Count.prototype.define = function Modulo_Count() {
this.ini_c = 0;
this.base = 3;
this.model = scicos_model();
this.model.sim = list(new ScilabString(["modulo_count"]), new ScilabDouble([4]));
this.model.evtin = new ScilabDouble([1]);
this.model.out = new ScilabDouble([1]);
this.model.dstate = new ScilabDouble([this.ini_c]);
this.model.ipar = new ScilabDouble([this.base]);
this.model.blocktype = new ScilabString(["c"]);
this.model.dep_ut = new ScilabBoolean([false,false]);
this.exprs = [[string(this.ini_c)],[string(this.base)]];
this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Modulo_Count\",sz(1),sz(2));"]);
this.x = new standard_define(new ScilabDouble([3,2]),this.model,new ScilabDouble(this.exprs),this.gr_i);
return new BasicBlock(this.x);
}
Modulo_Count.prototype.details = function Modulo_Count() {
return this.x;
}
Modulo_Count.prototype.get = function Modulo_Count() {
var options = {
ini_c:["Initial State (zero or positive number)",this.ini_c],
base:["Upper Limit (positive number)",this.base],
}
return options;
}
Modulo_Count.prototype.set = function Modulo_Count() {
this.exprs = this.graphics.exprs;
while (true) {
var ok = true;
this.ini_c = parseFloat(arguments[0]["ini_c"]);
this.base = parseFloat(arguments[0]["base"]);
this.ini_c = int(this.ini_c);
this.base = int(this.base);
if (!ok) {
break;
}
if (this.ini_c<0) {
block_parameter_error(msprintf("Wrong value for \'Initial State\' parameter: %d.",this.ini_c),"Null or positive integer expected.");
} else if (this.base<=0) {
block_parameter_error(msprintf("Wrong values for \'Upper Limit\' parameter: %d.",this.base),"Strictly positive integer expected.");
} else {
this.graphics.exprs = new ScilabDouble([this.exprs]);
this.model.ipar = new ScilabDouble([this.base]);
this.model.dstate = new ScilabDouble([this.ini_c]);
this.x.graphics = this.graphics;
this.x.model = this.model;
break;
}
}
return new BasicBlock(this.x);
}
}
|