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
|
/* autogenerated from "macros/Misc/HYSTHERESIS.sci" */
function HYSTHERESIS() {
HYSTHERESIS.prototype.define = function HYSTHERESIS() {
in1 = 1;
ipar = [0];
this.nzz = 2;
rpar = [[1],[0],[1],[0]];
model = scicos_model();
model.sim = list("hystheresis",4);
model.in1 = in1;
model.out = 1;
model.rpar = rpar;
model.nzcross = this.nzz;
model.nmode = 1;
model.blocktype = "c";
model.dep_ut = [true,false];
exprs = [[string(rpar)],[string(sign(this.nzz))]];
gr_i = [];
this.x = standard_define([2,2],model,exprs,gr_i);
return new BasicBlock(this.x);
}
HYSTHERESIS.prototype.details = function HYSTHERESIS() {
return this.x;
}
HYSTHERESIS.prototype.get = function HYSTHERESIS() {
}
HYSTHERESIS.prototype.set = function HYSTHERESIS() {
this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
[ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,exprs] = scicos_getvalue("Set parameters",[["switch on at"],["switch off at"],["output when on"],["output when off"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
if (!ok) {
break;
}
if (this.low_lim>this.high_lim) {
message("switch on value must be larger than switch off value");
} else {
graphics.exprs = exprs;
model.rpar = transpose([this.high_lim,this.low_lim,this.out_high,this.out_low]);
if (this.nzz>0) {
this.nzz = 2;
}
model.nzcross = this.nzz;
this.x.graphics = graphics;
this.x.model = model;
break;
}
}
return new BasicBlock(this.x);
}
}
|