Xcos MVC: remove the "Deleted" adapter
[scilab.git] / scilab / modules / scicos_blocks / macros / Sources / GEN_SQR.sci
1 //  Scicos
2 //
3 //  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 //
19 // See the file ../license.txt
20 //
21
22 function [x,y,typ]=GEN_SQR(job,arg1,arg2)
23     //Generated from SuperBlock on 8-Feb-2008
24     x=[];
25     y=[];
26     typ=[];
27     select job
28     case "set" then
29         y=needcompile
30         arg1.model.ipar=1;
31         typ=list()
32         graphics=arg1.graphics;
33         exprs=graphics.exprs
34         Btitre=..
35         "Set GEN_SQR parameters"
36         Exprs0=..
37         ["Amin";"Amax";"rule";"F"]
38         Bitems=..
39         ["Minimum Value";
40         "Maximum Value";
41         "Initial Value( 1= Minimum Value 2= Maximum Value)";
42         "Period (sec)"]
43         Ss=..
44         list("mat",[-1,-1],"mat",[-1,-1],"pol",-1,"pol",-1)
45         scicos_context=struct()
46         x=arg1
47         ok=%f
48         while ~ok do
49             [ok,scicos_context.Amin,scicos_context.Amax,scicos_context.rule,scicos_context.F,exprs]=scicos_getvalue(Btitre,Bitems,Ss,exprs)
50             if ~ok then
51                 return;
52             end
53             %scicos_context=scicos_context;
54             sblock=x.model.rpar
55             [%scicos_context,ierr]=script2var(sblock.props.context,%scicos_context)
56             if ierr==0 then
57                 [sblock,%w,needcompile2,ok]=do_eval(sblock,list())
58                 if ok then
59                     y=max(2,needcompile,needcompile2)
60                     x.graphics.exprs=exprs
61                     x.model.rpar=sblock
62                     break
63                 end
64             else
65                 message(lasterror())
66                 ok=%f
67             end
68         end
69     case "define" then
70         scs_m_1=scicos_diagram(..
71         version="scicos4.2",..
72         props=scicos_params(..
73         wpar=[-176.97473,421.18646,173.61587,524.41503,827,480,0,15,827,480,755,614,1.4],..
74         Title="SuperBlock",..
75         tol=[0.0001,0.000001,1.000D-10,100001,0,0],..
76         tf=100000,..
77         context=["if typeof(Amin)<>typeof(Amax) then error(''Minimum value and Maximum value must have the same type'');end";
78         "if and(rule<>[1;2]) then error(''Initial Value must be 1 (for Min) or 2 (for Max)'');end";
79         "if Amin>Amax then error(''Maximum value must be greater than the Minimum Value'');end";
80         "P=%pi/F";
81         ""],..
82         void1=[],..
83         options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(%t,33),[8,1],[1,5],..
84         list([5,1],[4,1]),[0.8,0.8,0.8]),..
85         void2=[],..
86         void3=[],..
87         doc=list()))
88         scs_m_1.objs(1)=scicos_block(..
89         gui="Counter",..
90         graphics=scicos_graphics(..
91         orig=[18.229901,339.5057],..
92         sz=[60,40],..
93         flip=%t,..
94         theta=0,..
95         exprs=["1";"2";"rule"],..
96         pin=[],..
97         pout=8,..
98         pein=16,..
99         peout=[],..
100         gr_i=[],..
101         id="",..
102         in_implicit=[],..
103         out_implicit="E"),..
104         model=scicos_model(..
105         sim=list("counter",4),..
106         in=[],..
107         in2=[],..
108         intyp=1,..
109         out=1,..
110         out2=1,..
111         outtyp=1,..
112         evtin=1,..
113         evtout=[],..
114         state=[],..
115         dstate=0,..
116         odstate=list(),..
117         rpar=[],..
118         ipar=[1;2;1],..
119         opar=list(),..
120         blocktype="c",..
121         firing=[],..
122         dep_ut=[%f,%f],..
123         label="",..
124         nzcross=0,..
125         nmode=0,..
126         equations=list()),..
127         doc=list())
128         scs_m_1.objs(2)=scicos_block(..
129         gui="CONST_m",..
130         graphics=scicos_graphics(..
131         orig=[38.096074,293.82198],..
132         sz=[40,40],..
133         flip=%t,..
134         theta=0,..
135         exprs="Amin",..
136         pin=[],..
137         pout=5,..
138         pein=[],..
139         peout=[],..
140         gr_i=[],..
141         id="",..
142         in_implicit=[],..
143         out_implicit="E"),..
144         model=scicos_model(..
145         sim=list("cstblk4_m",4),..
146         in=[],..
147         in2=[],..
148         intyp=1,..
149         out=1,..
150         out2=1,..
151         outtyp=1,..
152         evtin=[],..
153         evtout=[],..
154         state=[],..
155         dstate=[],..
156         odstate=list(),..
157         rpar=[],..
158         ipar=[],..
159         opar=list(-1),..
160         blocktype="d",..
161         firing=[],..
162         dep_ut=[%f,%f],..
163         label="",..
164         nzcross=0,..
165         nmode=0,..
166         equations=list()),..
167         doc=list())
168         scs_m_1.objs(3)=scicos_block(..
169         gui="CONST_m",..
170         graphics=scicos_graphics(..
171         orig=[37.378886,245.02389],..
172         sz=[40,40],..
173         flip=%t,..
174         theta=0,..
175         exprs="Amax",..
176         pin=[],..
177         pout=6,..
178         pein=[],..
179         peout=[],..
180         gr_i=[],..
181         id="",..
182         in_implicit=[],..
183         out_implicit="E"),..
184         model=scicos_model(..
185         sim=list("cstblk4_m",4),..
186         in=[],..
187         in2=[],..
188         intyp=1,..
189         out=1,..
190         out2=1,..
191         outtyp=1,..
192         evtin=[],..
193         evtout=[],..
194         state=[],..
195         dstate=[],..
196         odstate=list(),..
197         rpar=[],..
198         ipar=[],..
199         opar=list(1),..
200         blocktype="d",..
201         firing=[],..
202         dep_ut=[%f,%f],..
203         label="",..
204         nzcross=0,..
205         nmode=0,..
206         equations=list()),..
207         doc=list())
208         scs_m_1.objs(4)=scicos_block(..
209         gui="SELECT_m",..
210         graphics=scicos_graphics(..
211         orig=[116.26954,269.42294],..
212         sz=[40,40],..
213         flip=%t,..
214         theta=0,..
215         exprs=["-1";"2";"1"],..
216         pin=[5;6],..
217         pout=14,..
218         pein=[9;10],..
219         peout=[],..
220         gr_i=[],..
221         id="",..
222         in_implicit=["E";"E"],..
223         out_implicit="E"),..
224         model=scicos_model(..
225         sim=list("selector_m",4),..
226         in=[-1;-1],..
227         in2=[-2;-2],..
228         intyp=[-1;-1],..
229         out=-1,..
230         out2=-2,..
231         outtyp=-1,..
232         evtin=[1;1],..
233         evtout=[],..
234         state=[],..
235         dstate=1,..
236         odstate=list(),..
237         rpar=[],..
238         ipar=[],..
239         opar=list(),..
240         blocktype="c",..
241         firing=[],..
242         dep_ut=[%t,%f],..
243         label="",..
244         nzcross=0,..
245         nmode=0,..
246         equations=list()),..
247         doc=list())
248         scs_m_1.objs(5)=scicos_link(..
249         xx=[86.667502;107.69811;107.69811],..
250         yy=[313.82198;313.82198;296.0896],..
251         id="drawlink",..
252         thick=[0,0],..
253         ct=[1,1],..
254         from=[2,1,0],..
255         to=[4,1,1])
256         scs_m_1.objs(6)=scicos_link(..
257         xx=[85.950315;107.69811;107.69811],..
258         yy=[265.02389;265.02389;282.75627],..
259         id="drawlink",..
260         thick=[0,0],..
261         ct=[1,1],..
262         from=[3,1,0],..
263         to=[4,2,1])
264         scs_m_1.objs(7)=scicos_block(..
265         gui="ESELECT_f",..
266         graphics=scicos_graphics(..
267         orig=[106.9461,339.7496],..
268         sz=[60,40],..
269         flip=%t,..
270         theta=0,..
271         exprs=["2";"0";"0"],..
272         pin=8,..
273         pout=[],..
274         pein=[],..
275         peout=[9;10],..
276         gr_i=[],..
277         id="",..
278         in_implicit="E",..
279         out_implicit=[]),..
280         model=scicos_model(..
281         sim=list("eselect",-2),..
282         in=1,..
283         in2=1,..
284         intyp=-1,..
285         out=[],..
286         out2=[],..
287         outtyp=1,..
288         evtin=[],..
289         evtout=[1;1],..
290         state=[],..
291         dstate=[],..
292         odstate=list(),..
293         rpar=[],..
294         ipar=[],..
295         opar=list(),..
296         blocktype="l",..
297         firing=[-1;-1],..
298         dep_ut=[%t,%f],..
299         label="",..
300         nzcross=0,..
301         nmode=0,..
302         equations=list()),..
303         doc=list())
304         scs_m_1.objs(8)=scicos_link(..
305         xx=[86.80133;98.374671],..
306         yy=[359.5057;359.7496],..
307         id="drawlink",..
308         thick=[0,0],..
309         ct=[1,1],..
310         from=[1,1,0],..
311         to=[7,1,1])
312         scs_m_1.objs(9)=scicos_link(..
313         xx=[126.9461;129.60287],..
314         yy=[334.03532;315.13722],..
315         id="drawlink",..
316         thick=[0,0],..
317         ct=[5,-1],..
318         from=[7,1,0],..
319         to=[4,1,1])
320         scs_m_1.objs(10)=scicos_link(..
321         xx=[146.9461;142.93621],..
322         yy=[334.03532;315.13722],..
323         id="drawlink",..
324         thick=[0,0],..
325         ct=[5,-1],..
326         from=[7,2,0],..
327         to=[4,2,1])
328         scs_m_1.objs(11)=mlist("Deleted")
329         scs_m_1.objs(12)=mlist("Deleted")
330         scs_m_1.objs(13)=scicos_block(..
331         gui="OUT_f",..
332         graphics=scicos_graphics(..
333         orig=[184.40238,278.75198],..
334         sz=[20,20],..
335         flip=%t,..
336         theta=0,..
337         exprs="1",..
338         pin=14,..
339         pout=[],..
340         pein=[],..
341         peout=[],..
342         gr_i=[],..
343         id="",..
344         in_implicit="E",..
345         out_implicit=[]),..
346         model=scicos_model(..
347         sim="output",..
348         in=-1,..
349         in2=-2,..
350         intyp=-1,..
351         out=[],..
352         out2=[],..
353         outtyp=1,..
354         evtin=[],..
355         evtout=[],..
356         state=[],..
357         dstate=[],..
358         odstate=list(),..
359         rpar=[],..
360         ipar=1,..
361         opar=list(),..
362         blocktype="c",..
363         firing=[],..
364         dep_ut=[%f,%f],..
365         label="",..
366         nzcross=0,..
367         nmode=0,..
368         equations=list()),..
369         doc=list())
370         scs_m_1.objs(14)=scicos_link(..
371         xx=[164.84097;184.40238],..
372         yy=[289.42294;288.75198],..
373         id="drawlink",..
374         thick=[0,0],..
375         ct=[1,1],..
376         from=[4,1,0],..
377         to=[13,1,1])
378         scs_m_1.objs(15)=scicos_block(..
379         gui="SampleCLK",..
380         graphics=scicos_graphics(..
381         orig=[18.313686,403.57431],..
382         sz=[60,40],..
383         flip=%t,..
384         theta=0,..
385         exprs=["F/2";"0"],..
386         pin=[],..
387         pout=[],..
388         pein=[],..
389         peout=16,..
390         gr_i=[],..
391         id="",..
392         in_implicit=[],..
393         out_implicit=[]),..
394         model=scicos_model(..
395         sim="sampleclk",..
396         in=[],..
397         in2=[],..
398         intyp=1,..
399         out=[],..
400         out2=[],..
401         outtyp=1,..
402         evtin=[],..
403         evtout=1,..
404         state=[],..
405         dstate=[],..
406         odstate=list(),..
407         rpar=[1/2;0],..
408         ipar=[],..
409         opar=list(),..
410         blocktype="d",..
411         firing=-1,..
412         dep_ut=[%f,%f],..
413         label="",..
414         nzcross=0,..
415         nmode=0,..
416         equations=list()),..
417         doc=list())
418         scs_m_1.objs(16)=scicos_link(..
419         xx=[48.313686;48.229901],..
420         yy=[403.57431;385.21998],..
421         id="drawlink",..
422         thick=[0,0],..
423         ct=[5,-1],..
424         from=[15,1,0],..
425         to=[1,1,1])
426         model=scicos_model()
427         model.sim="csuper"
428         model.in=[]
429         model.in2=[]
430         model.intyp=1
431         model.out=-1
432         model.out2=-2
433         model.outtyp=-1
434         model.evtin=[]
435         model.evtout=[]
436         model.state=[]
437         model.dstate=[]
438         model.odstate=list()
439         model.rpar=scs_m_1
440         model.ipar=1
441         model.opar=list()
442         model.blocktype="h"
443         model.firing=[]
444         model.dep_ut=[%f,%f]
445         model.label=""
446         model.nzcross=0
447         model.nmode=0
448         model.equations=list()
449         Amin=-1
450         Amax=1
451         rule=1
452         F=1
453         exprs=[..
454         sci2exp(Amin)
455         sci2exp(Amax)
456         sci2exp(rule)
457         sci2exp(F)
458         ]
459         gr_i=[]
460         x=standard_define([3,2],model,exprs,gr_i)
461     end
462 endfunction
463
464