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
77
78
79
80
|
/* autogenerated from "macros/Misc/fortran_block.sci" */
function fortran_block() {
fortran_block.prototype.define = function fortran_block() {
this.model = scicos_model();
this.model.sim = list(new ScilabString(" "),new ScilabDouble(1001));
this.model.in1 = new ScilabDouble(1);
this.model.out = new ScilabDouble(1);
this.model.evtin = [];
this.model.evtout = [];
this.model.state = [];
this.model.dstate = [];
this.model.rpar = [];
this.model.ipar = new ScilabDouble(0);
this.model.blocktype = new ScilabString("c");
this.model.firing = [];
this.model.dep_ut = [true,false];
this.funam = "forty";
label = list([[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([]));
gr_i = [];
this.x = standard_define([4,2],this.model,label,gr_i);
return new BasicBlock(this.x);
}
fortran_block.prototype.details = function fortran_block() {
return this.x;
}
fortran_block.prototype.get = function fortran_block() {
var options = {
i:["input ports sizes",this.i],
o:["output port sizes",this.o],
rpar:["System parameters vector",this.rpar],
funam:["function name",this.funam],
}
return options;
}
fortran_block.prototype.set = function fortran_block() {
this.i = parseFloat(arguments[0]["i"])
this.o = parseFloat(arguments[0]["o"])
this.rpar = inverse(arguments[0]["rpar"])
this.funam = arguments[0]["funam"]
this.lab = arguments[0]["lab"]
this.x = arg1;
this.model = arg1.model;
graphics = arg1.graphics;
label = graphics.exprs;
while (true) {
[ok,this.i,this.o,this.rpar,this.funam,this.lab] = scicos_getvalue("Set fortran_block parameters",["input ports sizes","output port sizes","System parameters vector","function name"],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]);
if (!ok) {
break;
}
if (this.funam==" ") {
break;
}
label[1-1] = this.lab;
this.rpar = this.rpar.slice();
this.i = int(this.i.slice());
ni = size(this.i,1);
this.o = int(this.o.slice());
no = size(this.o,1);
tt = label[2-1];
if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) {
tt = [];
}
[ok,tt] = FORTR(this.funam,tt,this.i,this.o);
if (!ok) {
break;
}
[model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]);
if (ok) {
this.model.sim[1] = new ScilabString(this.funam);
this.model.rpar = this.rpar;
label[2-1] = tt;
this.x.model = this.model;
graphics.exprs = label;
this.x.graphics = graphics;
break;
}
}
return new BasicBlock(this.x);
}
}
|