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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/* autogenerated from "macros/Sinks/BARXY.sci" */
function BARXY() {
BARXY.prototype.define = function BARXY() {
this.model = scicos_model();
this.xmin = -15;
this.xmax = 15;
this.ymin = -15;
this.ymax = 15;
this.model.sim = list(new ScilabString(["BARXY_sim"]), new ScilabDouble([5]));
this.model.blocktype = new ScilabString(["d"]);
this.model.dep_ut = new ScilabBoolean([true,false]);
this.model.in = new ScilabDouble([-1],[-1]);
this.model.intyp = new ScilabDouble([1]);
this.model.out = new ScilabDouble([]);
this.model.evtin = new ScilabDouble([1]);
this.model.rpar = new ScilabDouble([this.xmin],[this.xmax],[this.ymin],[this.ymax]);
this.model.ipar = new ScilabDouble([1]);
this.x = new standard_define(new ScilabDouble([2,2]),this.model,new ScilabDouble([]),[]);
this.x.graphics.in_implicit = ["E","E"];
this.x.graphics.out_implicit = [];
this.x.graphics.exprs = [["-15"],["15"],["-15"],["15"],["1"]];
return new BasicBlock(this.x);
}
BARXY.prototype.details = function BARXY() {
return this.x;
}
BARXY.prototype.get = function BARXY() {
var options = {
xmin:["Xmin",this.xmin],
xmax:["Xmax",this.xmax],
ymin:["Ymin",this.ymin],
ymax:["Ymax",this.ymax],
thickness:["Segs Thickness",this.thickness],
}
return options;
}
BARXY.prototype.set = function BARXY() {
var exprs = this.graphics.exprs;
while (true) {
var ok = true;
this.xmin = parseFloat(arguments[0]["xmin"]);
this.xmax = parseFloat(arguments[0]["xmax"]);
this.ymin = parseFloat(arguments[0]["ymin"]);
this.ymax = parseFloat(arguments[0]["ymax"]);
this.thickness = arguments[0]["thickness"];
if (!ok) {
break;
}
var mess = [];
if (this.ymin>=this.ymax) {
var mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
var ok = false;
}
if (this.xmin>=this.xmax) {
var mess = [[mess],["Xmax must be greater than Xmin"],[" "]];
var ok = false;
}
if (this.thickness<=0) {
var mess = [[mess],["Thickness must be strictly positive."]];
var ok = false;
}
if (!ok) {
message(mess);
throw "user error";
} else {
this.model.rpar = new ScilabDouble([this.xmin],[this.xmax],[this.ymin],[this.ymax]);
this.model.ipar = new ScilabDouble([this.thickness]);
this.graphics.exprs = new ScilabDouble([exprs]);
this.x.graphics = this.graphics;
this.x.model = this.model;
break;
}
}
return new BasicBlock(this.x);
}
}
|