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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* autogenerated from "macros/Misc/EDGE_TRIGGER.sci" */
function EDGE_TRIGGER() {
EDGE_TRIGGER.prototype.define = function EDGE_TRIGGER() {
scs_m_1 = scicos_diagram();
scs_m_1.objs[1-1] = this.EDGETRIGGER["define"-1];
scs_m_1.objs[2-1] = IFTHEL_f("define");
scs_m_1.objs[3-1] = IN_f("define");
scs_m_1.objs[4-1] = CLKOUTV_f("define");
scs_m_1.objs[5-1] = scicos_link();
scs_m_1.objs[6-1] = scicos_link();
scs_m_1.objs[7-1] = scicos_link();
blk = scs_m_1.objs[1-1];
graphics = blk.graphics;
model = blk.model;
graphics.orig = [60,0];
graphics.sz = [60,40];
graphics.exprs = "0";
model.ipar = 0;
graphics.pin = 5;
graphics.pout = 6;
blk.graphics = graphics;
blk.model = model;
scs_m_1.objs[1-1] = blk;
blk = scs_m_1.objs[2-1];
graphics = blk.graphics;
model = blk.model;
graphics.orig = [160,0];
graphics.sz = [60,40];
graphics.exprs = [["0"],["0"]];
model.evtin = [];
model.nzcross = 0;
model.nmode = 0;
graphics.pin = 6;
graphics.peout = [[7],[0]];
blk.graphics = graphics;
blk.model = model;
scs_m_1.objs[2-1] = blk;
blk = scs_m_1.objs[3-1];
graphics = blk.graphics;
model = blk.model;
graphics.orig = [0,10];
graphics.sz = [20,20];
graphics.exprs = ["1"];
model.ipar = 1;
graphics.pout = 5;
blk.graphics = graphics;
blk.model = model;
scs_m_1.objs[3-1] = blk;
blk = scs_m_1.objs[4-1];
graphics = blk.graphics;
model = blk.model;
graphics.orig = [170,-60];
graphics.sz = [20,20];
graphics.exprs = ["1"];
model.ipar = 1;
graphics.pein = 7;
blk.graphics = graphics;
blk.model = model;
scs_m_1.objs[4-1] = blk;
lnk = scs_m_1.objs[5-1];
lnk.from = [3,1,0];
lnk.to = [1,1,1];
scs_m_1.objs[5-1] = lnk;
lnk = scs_m_1.objs[6-1];
lnk.from = [1,1,0];
lnk.to = [2,1,1];
scs_m_1.objs[6-1] = lnk;
lnk = scs_m_1.objs[7-1];
lnk.ct = [5,-1];
lnk.from = [2,1,0];
lnk.to = [4,1,1];
scs_m_1.objs[7-1] = lnk;
blk={};
lnk={};
model = scicos_model();
model.sim = "csuper";
model.in1 = 1;
model.evtout = 1;
model.rpar = scs_m_1;
gr_i = [];
x = standard_define([3,2],model,[],gr_i);
}
EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() {
}
EDGE_TRIGGER.prototype.get = function EDGE_TRIGGER() {
}
EDGE_TRIGGER.prototype.set = function EDGE_TRIGGER() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
o = arg1.model.rpar.objs[i-1];
if (typeof(o)=="Block"&&o.gui=="EDGETRIGGER") {
ppath = list(i);
break;
}
}
newpar = list();
y = 0;
for (path in ppath) {
np = size(path,"*");
spath = list();
for (k=1;k<=np;k+=1) {
spath[$+1-1] = "model";
spath[$+1-1] = "rpar";
spath[$+1-1] = "objs";
spath[$+1-1] = path[k-1];
}
xx = arg1[spath-1];
execstr("xxn="+xx.gui+"(\'set\',xx)");
if (diffobjs(this.xxn,xx)) {
model = xx.model;
model_n = this.xxn.model;
if (!is_modelica_block(xx)) {
modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label);
if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) {
needcompile = 1;
}
if (or(model.firing!=model_n.firing)) {
needcompile = 2;
}
if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) {
needcompile = 4;
}
if (model.sim=="input"||model.sim=="output") {
if (model.ipar!=model_n.ipar) {
needcompile = 4;
}
}
if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
needcompile = 4;
}
if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
needcompile = 4;
}
if (prod(size(model_n.sim))>1) {
if (model_n.sim[2-1]>1000) {
if (model.sim[1-1]!=model_n.sim[1-1]) {
needcompile = 4;
}
}
}
} else {
modified = or(model_n!=model);
eq = model.equations;
eqn = model_n.equations;
if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
needcompile = 4;
}
}
arg1[spath-1] = this.xxn;
newpar[size(newpar)+1-1] = path;
y = max(y,needcompile);
}
}
x = arg1;
typ = newpar;
}
}
|