Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_StopwatchChart / StopwatchChart.lus @ eb639349

History | View | Annotate | Download (28.9 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9

    
10
node Chart_ChartJunction314__To__Chart_ChartJunction315_1_Condition_Action(cent_1:int;
11
	sec_1:int)
12

    
13
returns (cent:int;
14
	sec:int);
15

    
16

    
17
var 	cent_2:int;
18
	sec_2:int;
19

    
20

    
21
let
22

    
23

    
24

    
25
	cent_2 
26
	= 0;
27
	
28

    
29
	sec_2 
30
	=  sec_1 +1;
31
	
32

    
33
	(cent, sec) 
34
	= (cent_2, sec_2);
35
	
36

    
37
tel
38

    
39

    
40

    
41

    
42

    
43

    
44

    
45

    
46

    
47

    
48

    
49

    
50

    
51
node Chart_Run__To__Chart_ChartJunction314_1_Condition_Action(cent_1:int)
52

    
53
returns (cent:int);
54

    
55

    
56
var 	cent_2:int;
57

    
58

    
59
let
60

    
61

    
62

    
63
	cent_2 
64
	=  cent_1 +1;
65
	
66

    
67
	(cent) 
68
	= (cent_2);
69
	
70

    
71
tel
72

    
73

    
74

    
75

    
76

    
77

    
78

    
79
node Stop_Reset__To__Chart_ChartJunction300_1_Condition_Action(cent_1:int;
80
	sec_1:int;
81
	min_1:int;
82
	disp_cent_1:int;
83
	disp_sec_1:int;
84
	disp_min_1:int)
85

    
86
returns (cent:int;
87
	sec:int;
88
	min:int;
89
	disp_cent:int;
90
	disp_sec:int;
91
	disp_min:int);
92

    
93

    
94
var 	cent_2:int;
95
	sec_2:int;
96
	min_2:int;
97
	disp_cent_2:int;
98
	disp_sec_2:int;
99
	disp_min_2:int;
100

    
101

    
102
let
103

    
104

    
105

    
106
	cent_2 
107
	= 0;
108
	
109

    
110
	sec_2 
111
	= 0;
112
	
113

    
114
	min_2 
115
	= 0;
116
	
117

    
118
	disp_cent_2 
119
	= 0;
120
	
121

    
122
	disp_sec_2 
123
	= 0;
124
	
125

    
126
	disp_min_2 
127
	= 0;
128
	
129

    
130
	(cent, sec, min, disp_cent, disp_sec, disp_min) 
131
	= (cent_2, sec_2, min_2, disp_cent_2, disp_sec_2, disp_min_2);
132
	
133

    
134
tel
135

    
136

    
137

    
138

    
139

    
140

    
141

    
142
node Chart_ChartJunction315__To__Chart_ChartJunction316_1_Condition_Action(sec_1:int;
143
	min_1:int)
144

    
145
returns (sec:int;
146
	min:int);
147

    
148

    
149
var 	sec_2:int;
150
	min_2:int;
151

    
152

    
153
let
154

    
155

    
156

    
157
	sec_2 
158
	= 0;
159
	
160

    
161
	min_2 
162
	=  min_1 +1;
163
	
164

    
165
	(sec, min) 
166
	= (sec_2, min_2);
167
	
168

    
169
tel
170

    
171

    
172

    
173

    
174

    
175

    
176

    
177
-- Entry action for state :Run_Lap
178
node Run_Lap_en(idChart_Run_1:int;
179
	isInner:bool)
180

    
181
returns (idChart_Run:int);
182

    
183

    
184
var 	idChart_Run_2:int;
185

    
186

    
187
let
188

    
189

    
190

    
191
	-- set state as active 
192
	idChart_Run_2 
193
	= 306;
194
	
195

    
196
	(idChart_Run) 
197
	= (idChart_Run_2);
198
	
199

    
200
tel
201

    
202

    
203

    
204

    
205

    
206
-- Exit action for state :Run_Lap
207
node Run_Lap_ex(idChart_Run_1:int;
208
	isInner:bool)
209

    
210
returns (idChart_Run:int);
211

    
212

    
213
var 	idChart_Run_2:int;
214

    
215

    
216
let
217

    
218

    
219

    
220
	-- set state as inactive 
221
	idChart_Run_2
222
	 = if (not isInner) then 0 else idChart_Run_1;
223

    
224

    
225
	(idChart_Run) 
226
	= (idChart_Run_1);
227
	
228

    
229
tel
230

    
231

    
232

    
233

    
234

    
235

    
236
-- Entry action for state :Run_Running
237
node Run_Running_en(idChart_Run_1:int;
238
	x_1:int;
239
	isInner:bool)
240

    
241
returns (idChart_Run:int;
242
	x:int);
243

    
244

    
245
var 	idChart_Run_2:int;
246
	x_2:int;
247

    
248

    
249
let
250

    
251

    
252

    
253
	-- set state as active 
254
	idChart_Run_2 
255
	= 305;
256
	
257

    
258
	x_2 
259
	= if (not isInner) then  x_1  + 1
260
	 else x_1;
261
	
262

    
263
	(idChart_Run, x) 
264
	= (idChart_Run_2, x_2);
265
	
266

    
267
tel
268

    
269

    
270

    
271

    
272

    
273
--During action for state :Run_Running
274
node Run_Running_du(cent_1:int;
275
	disp_cent_1:int;
276
	sec_1:int;
277
	disp_sec_1:int;
278
	min_1:int;
279
	disp_min_1:int)
280

    
281
returns (cent:int;
282
	disp_cent:int;
283
	sec:int;
284
	disp_sec:int;
285
	min:int;
286
	disp_min:int);
287

    
288

    
289
var 	disp_cent_2:int;
290
	disp_sec_2:int;
291
	disp_min_2:int;
292

    
293

    
294
let
295

    
296

    
297

    
298
	disp_cent_2 
299
	=  cent_1 ;
300
	
301

    
302
	disp_sec_2 
303
	=  sec_1 ;
304
	
305

    
306
	disp_min_2 
307
	=  min_1 ;
308
	
309

    
310
	(cent, disp_cent, sec, disp_sec, min, disp_min) 
311
	= (cent_1, disp_cent_2, sec_1, disp_sec_2, min_1, disp_min_2);
312
	
313

    
314
tel
315

    
316

    
317

    
318

    
319

    
320
-- Exit action for state :Run_Running
321
node Run_Running_ex(x_1:int;
322
	idChart_Run_1:int;
323
	isInner:bool)
324

    
325
returns (x:int;
326
	idChart_Run:int);
327

    
328

    
329
var 	x_2:int;
330
	idChart_Run_2:int;
331

    
332

    
333
let
334

    
335

    
336

    
337
	x_2 
338
	= if (not isInner) then  x_1  - 1
339
	 else x_1;
340
	
341

    
342
	-- set state as inactive 
343
	idChart_Run_2
344
	 = if (not isInner) then 0 else idChart_Run_1;
345

    
346

    
347
	(x, idChart_Run) 
348
	= (x_2, idChart_Run_1);
349
	
350

    
351
tel
352

    
353

    
354

    
355

    
356

    
357

    
358
-- Entry action for state :Chart_Run
359
node Chart_Run_en(idChart_Run_1:int;
360
	idChart_Chart_1:int;
361
	x_1:int;
362
	isInner:bool)
363

    
364
returns (idChart_Run:int;
365
	idChart_Chart:int;
366
	x:int);
367

    
368

    
369
var 	idChart_Run_2, idChart_Run_3, idChart_Run_4:int;
370
	idChart_Chart_2, idChart_Chart_3:int;
371
	x_2, x_3:int;
372

    
373

    
374
let
375

    
376

    
377

    
378
	-- set state as active 
379
	idChart_Chart_2 
380
	= 304;
381
	
382

    
383
	
384
	(idChart_Run_2, x_2) 
385
	= 
386
	if ( idChart_Run_1 = 305) then
387
	Run_Running_en(idChart_Run_1, x_1, false)
388
	 else (idChart_Run_1, x_1);
389

    
390
	
391

    
392
	(idChart_Run_3) 
393
	= 
394
	if ( idChart_Run_1 = 306) then
395
	Run_Lap_en(idChart_Run_1, false)
396
	 else (idChart_Run_1);
397

    
398
	
399

    
400
	(idChart_Run_4, idChart_Chart_3, x_3) 
401
	= 
402
		 if ( idChart_Run_1 = 305) then 
403
		(idChart_Run_2, idChart_Chart_2, x_2)
404
		 else
405
		 if ( idChart_Run_1 = 306) then 
406
		(idChart_Run_3, idChart_Chart_2, x_1)
407
		 else (idChart_Run_1, idChart_Chart_2, x_1);
408

    
409

    
410
	(idChart_Run, idChart_Chart, x) 
411
	= (idChart_Run_4, idChart_Chart_3, x_3);
412
	
413

    
414
tel
415

    
416

    
417

    
418

    
419

    
420
-- Exit action for state :Chart_Run
421
node Chart_Run_ex(x_1:int;
422
	idChart_Run_1:int;
423
	idChart_Chart_1:int;
424
	isInner:bool)
425

    
426
returns (x:int;
427
	idChart_Run:int;
428
	idChart_Chart:int);
429

    
430

    
431
var 	x_2, x_3:int;
432
	idChart_Run_2, idChart_Run_3, idChart_Run_4, idChart_Run_5:int;
433
	idChart_Chart_2:int;
434

    
435

    
436
let
437

    
438

    
439

    
440
	
441
	(x_2, idChart_Run_2) 
442
	= 
443
	if ( idChart_Run_1 = 305) then
444
	Run_Running_ex(x_1, idChart_Run_1, false)
445
	 else (x_1, idChart_Run_1);
446

    
447
	
448

    
449
	(idChart_Run_3) 
450
	= 
451
	if ( idChart_Run_1 = 306) then
452
	Run_Lap_ex(idChart_Run_1, false)
453
	 else (idChart_Run_1);
454

    
455
	
456

    
457
	(x_3, idChart_Run_4) 
458
	= 
459
		 if ( idChart_Run_1 = 305) then 
460
		(x_2, idChart_Run_2)
461
		 else
462
		 if ( idChart_Run_1 = 306) then 
463
		(x_1, idChart_Run_3)
464
		 else (x_1, idChart_Run_1);
465

    
466

    
467
	-- set state as inactive 
468
	idChart_Chart_2
469
	 = if (not isInner) then 0 else idChart_Chart_1;
470

    
471
	idChart_Run_5 
472
	= 0;
473
	
474

    
475
	(x, idChart_Run, idChart_Chart) 
476
	= (x_3, idChart_Run_5, idChart_Chart_1);
477
	
478

    
479
tel
480

    
481

    
482

    
483

    
484

    
485
--During action for state :Chart_Run
486
node Chart_Run_du(TIC:bool;
487
	cent_1:int;
488
	sec_1:int;
489
	min_1:int)
490

    
491
returns (cent:int;
492
	sec:int;
493
	min:int);
494

    
495

    
496

    
497

    
498
let
499

    
500

    
501

    
502
		 automaton chart_run_INNER
503

    
504
	state POINTChart_Run_INNER:
505
	unless true and TIC restart CHART_RUN__TO__CHART_CHARTJUNCTION314_1
506

    
507
	let
508

    
509
		(cent, sec, min) 
510
	= (cent_1, sec_1, min_1);
511
	
512

    
513
	tel
514

    
515

    
516

    
517
	state CHART_RUN__TO__CHART_CHARTJUNCTION314_1:
518

    
519
	 var 	cent_2, cent_3, cent_4, cent_5, cent_6:int;
520
	sec_2, sec_3, sec_4:int;
521
	min_2:int;
522
	let
523

    
524
		
525

    
526

    
527

    
528
-- transition trace :
529
	--Chart_Run__To__Junction314_1, Junction314__To__Junction315_1, Junction315__To__Junction316_1
530
		-- condition Action : cent=cent+1;
531
		
532
		(cent_2) 
533
	= Chart_Run__To__Chart_ChartJunction314_1_Condition_Action(cent_1);
534
		
535

    
536
		-- condition Action : cent=0;sec=sec+1;
537
		
538
		(cent_3, sec_2) 
539
	= 
540
		 if ((  cent_2 =100 )) then 
541
		Chart_ChartJunction314__To__Chart_ChartJunction315_1_Condition_Action(cent_2, sec_1)
542
		 else (cent_2, sec_1);
543
		
544

    
545
		-- condition Action : sec=0;min=min+1;
546
		
547
		(sec_3, min_2) 
548
	= 
549
		 if ((  cent_2 =100 ) and (  sec_2 =60 )) then 
550
		Chart_ChartJunction315__To__Chart_ChartJunction316_1_Condition_Action(sec_2, min_1)
551
		 else (sec_2, min_1);
552
		
553

    
554

    
555
-- transition trace :
556
	--Chart_Run__To__Junction314_1, Junction314__To__Junction315_1, Junction315__To__Junction316_2
557
		-- condition Action : cent=cent+1;
558
		
559
		(cent_4) 
560
	= Chart_Run__To__Chart_ChartJunction314_1_Condition_Action(cent_1);
561
		
562

    
563
		-- condition Action : cent=0;sec=sec+1;
564
		
565
		(cent_5, sec_4) 
566
	= 
567
		 if ((  cent_4 =100 )) then 
568
		Chart_ChartJunction314__To__Chart_ChartJunction315_1_Condition_Action(cent_4, sec_1)
569
		 else (cent_4, sec_1);
570
		
571

    
572

    
573
-- transition trace :
574
	--Chart_Run__To__Junction314_1, Junction314__To__Junction316_2
575
		-- condition Action : cent=cent+1;
576
		
577
		(cent_6) 
578
	= Chart_Run__To__Chart_ChartJunction314_1_Condition_Action(cent_1);
579
		
580

    
581
	(cent, sec, min) 
582
	= 
583
		 if ((  cent_2 =100 ) and (  sec_2 =60 )) then 
584
		(cent_3, sec_3, min_2)
585
		 else
586
		 if ((  cent_4 =100 )) then 
587
		(cent_5, sec_4, min_1)
588
		 else
589
		 if ((  cent_4 =100 )) then 
590
		(cent_5, sec_4, min_1)
591
		 else (cent_6, sec_1, min_1);
592

    
593

    
594
	tel
595

    
596
	until true restart POINTChart_Run_INNER
597

    
598

    
599

    
600
tel
601

    
602

    
603

    
604

    
605

    
606

    
607
-- Entry action for state :Stop_Lap_stop
608
node Stop_Lap_stop_en(idChart_Stop_1:int;
609
	isInner:bool)
610

    
611
returns (idChart_Stop:int);
612

    
613

    
614
var 	idChart_Stop_2:int;
615

    
616

    
617
let
618

    
619

    
620

    
621
	-- set state as active 
622
	idChart_Stop_2 
623
	= 301;
624
	
625

    
626
	(idChart_Stop) 
627
	= (idChart_Stop_2);
628
	
629

    
630
tel
631

    
632

    
633

    
634

    
635

    
636
-- Exit action for state :Stop_Lap_stop
637
node Stop_Lap_stop_ex(idChart_Stop_1:int;
638
	isInner:bool)
639

    
640
returns (idChart_Stop:int);
641

    
642

    
643
var 	idChart_Stop_2:int;
644

    
645

    
646
let
647

    
648

    
649

    
650
	-- set state as inactive 
651
	idChart_Stop_2
652
	 = if (not isInner) then 0 else idChart_Stop_1;
653

    
654

    
655
	(idChart_Stop) 
656
	= (idChart_Stop_1);
657
	
658

    
659
tel
660

    
661

    
662

    
663

    
664

    
665

    
666
-- Entry action for state :Stop_Reset
667
node Stop_Reset_en(idStop_Reset_1:int;
668
	idChart_Stop_1:int;
669
	isInner:bool)
670

    
671
returns (idStop_Reset:int;
672
	idChart_Stop:int);
673

    
674

    
675
var 	idStop_Reset_2:int;
676
	idChart_Stop_2:int;
677

    
678

    
679
let
680

    
681

    
682

    
683
	-- set state as active 
684
	idChart_Stop_2 
685
	= 298;
686
	
687

    
688
	-- case of state without states but contains transitions 
689
	idStop_Reset_2 
690
	= -1;
691
	
692

    
693
	(idStop_Reset, idChart_Stop) 
694
	= (idStop_Reset_2, idChart_Stop_2);
695
	
696

    
697
tel
698

    
699

    
700

    
701

    
702

    
703
-- Exit action for state :Stop_Reset
704
node Stop_Reset_ex(idChart_Stop_1:int;
705
	isInner:bool)
706

    
707
returns (idChart_Stop:int);
708

    
709

    
710
var 	idChart_Stop_2:int;
711

    
712

    
713
let
714

    
715

    
716

    
717
	-- set state as inactive 
718
	idChart_Stop_2
719
	 = if (not isInner) then 0 else idChart_Stop_1;
720

    
721

    
722
	(idChart_Stop) 
723
	= (idChart_Stop_1);
724
	
725

    
726
tel
727

    
728

    
729

    
730

    
731

    
732
--During action for state :Stop_Reset
733
node Stop_Reset_du(LAP:bool;
734
	cent_1:int;
735
	disp_cent_1:int;
736
	disp_min_1:int;
737
	disp_sec_1:int;
738
	min_1:int;
739
	sec_1:int)
740

    
741
returns (cent:int;
742
	sec:int;
743
	min:int;
744
	disp_cent:int;
745
	disp_sec:int;
746
	disp_min:int);
747

    
748

    
749

    
750

    
751
let
752

    
753

    
754

    
755
		 automaton stop_reset_INNER
756

    
757
	state POINTStop_Reset_INNER:
758
	unless true and LAP restart STOP_RESET__TO__CHART_CHARTJUNCTION300_1
759

    
760
	let
761

    
762
		(cent, sec, min, disp_cent, disp_sec, disp_min) 
763
	= (cent_1, sec_1, min_1, disp_cent_1, disp_sec_1, disp_min_1);
764
	
765

    
766
	tel
767

    
768

    
769

    
770
	state STOP_RESET__TO__CHART_CHARTJUNCTION300_1:
771

    
772
	 var 	cent_2:int;
773
	sec_2:int;
774
	min_2:int;
775
	disp_cent_2:int;
776
	disp_sec_2:int;
777
	disp_min_2:int;
778
	let
779

    
780
		-- transition trace :
781
	--Stop_Reset__To__Junction300_1
782
		-- condition Action : cent=0;sec=0;min=0;disp_cent=0;disp_sec=0;disp_min=0;
783
		
784
		(cent_2, sec_2, min_2, disp_cent_2, disp_sec_2, disp_min_2) 
785
	= Stop_Reset__To__Chart_ChartJunction300_1_Condition_Action(cent_1, sec_1, min_1, disp_cent_1, disp_sec_1, disp_min_1);
786
		
787

    
788
	(cent, sec, min, disp_cent, disp_sec, disp_min) 
789
	=  (cent_2, sec_2, min_2, disp_cent_2, disp_sec_2, disp_min_2);
790

    
791

    
792
	tel
793

    
794
	until true restart POINTStop_Reset_INNER
795

    
796

    
797

    
798
tel
799

    
800

    
801

    
802

    
803

    
804

    
805
-- Entry action for state :Chart_Stop
806
node Chart_Stop_en(idChart_Stop_1:int;
807
	idChart_Chart_1:int;
808
	idStop_Reset_1:int;
809
	isInner:bool)
810

    
811
returns (idChart_Stop:int;
812
	idChart_Chart:int;
813
	idStop_Reset:int);
814

    
815

    
816
var 	idChart_Stop_2, idChart_Stop_3, idChart_Stop_4, idChart_Stop_5, idChart_Stop_6:int;
817
	idChart_Chart_2, idChart_Chart_3, idChart_Chart_4:int;
818
	idStop_Reset_2, idStop_Reset_3, idStop_Reset_4, idStop_Reset_5:int;
819

    
820

    
821
let
822

    
823

    
824

    
825
	-- set state as active 
826
	idChart_Chart_2 
827
	= 297;
828
	
829

    
830
	
831
-- transition trace :
832
	--POINT__To__Stop_Reset_1
833
		(idStop_Reset_2, idChart_Stop_2) 
834
	= Stop_Reset_en(idStop_Reset_1, idChart_Stop_1, false);
835
		
836

    
837
	(idChart_Stop_3, idChart_Chart_3, idStop_Reset_3) 
838
	= 
839

    
840
	if ( idChart_Stop_1 = 0) then
841

    
842
	 (idChart_Stop_2, idChart_Chart_2, idStop_Reset_2)
843

    
844
	 else(idChart_Stop_1, idChart_Chart_2, idStop_Reset_1);
845

    
846
	
847

    
848
	(idStop_Reset_4, idChart_Stop_4) 
849
	= 
850
	if ( idChart_Stop_1 = 298) then
851
	Stop_Reset_en(idStop_Reset_1, idChart_Stop_1, false)
852
	 else (idStop_Reset_1, idChart_Stop_1);
853

    
854
	
855

    
856
	(idChart_Stop_5) 
857
	= 
858
	if ( idChart_Stop_1 = 301) then
859
	Stop_Lap_stop_en(idChart_Stop_1, false)
860
	 else (idChart_Stop_1);
861

    
862
	
863

    
864
	(idChart_Stop_6, idChart_Chart_4, idStop_Reset_5) 
865
	= 
866
		 if ( idChart_Stop_1 = 0) then 
867
		(idChart_Stop_3, idChart_Chart_3, idStop_Reset_3)
868
		 else
869
		 if ( idChart_Stop_1 = 298) then 
870
		(idChart_Stop_4, idChart_Chart_3, idStop_Reset_4)
871
		 else
872
		 if ( idChart_Stop_1 = 301) then 
873
		(idChart_Stop_5, idChart_Chart_3, idStop_Reset_1)
874
		 else (idChart_Stop_1, idChart_Chart_2, idStop_Reset_1);
875

    
876

    
877
	(idChart_Stop, idChart_Chart, idStop_Reset) 
878
	= (idChart_Stop_6, idChart_Chart_4, idStop_Reset_5);
879
	
880

    
881
tel
882

    
883

    
884

    
885

    
886

    
887
-- Exit action for state :Chart_Stop
888
node Chart_Stop_ex(idChart_Stop_1:int;
889
	idChart_Chart_1:int;
890
	isInner:bool)
891

    
892
returns (idChart_Stop:int;
893
	idChart_Chart:int);
894

    
895

    
896
var 	idChart_Stop_2, idChart_Stop_3, idChart_Stop_4, idChart_Stop_5:int;
897
	idChart_Chart_2:int;
898

    
899

    
900
let
901

    
902

    
903

    
904
	
905
	(idChart_Stop_2) 
906
	= 
907
	if ( idChart_Stop_1 = 298) then
908
	Stop_Reset_ex(idChart_Stop_1, false)
909
	 else (idChart_Stop_1);
910

    
911
	
912

    
913
	(idChart_Stop_3) 
914
	= 
915
	if ( idChart_Stop_1 = 301) then
916
	Stop_Lap_stop_ex(idChart_Stop_1, false)
917
	 else (idChart_Stop_1);
918

    
919
	
920

    
921
	(idChart_Stop_4) 
922
	= 
923
		 if ( idChart_Stop_1 = 298) then 
924
		(idChart_Stop_2)
925
		 else
926
		 if ( idChart_Stop_1 = 301) then 
927
		(idChart_Stop_3)
928
		 else (idChart_Stop_1);
929

    
930

    
931
	-- set state as inactive 
932
	idChart_Chart_2
933
	 = if (not isInner) then 0 else idChart_Chart_1;
934

    
935
	idChart_Stop_5 
936
	= 0;
937
	
938

    
939
	(idChart_Stop, idChart_Chart) 
940
	= (idChart_Stop_5, idChart_Chart_1);
941
	
942

    
943
tel
944

    
945

    
946
--***************************************************State :Chart_Run Automaton***************************************************
947

    
948
node Chart_Run_node(idChart_Run_1:int;
949
	START:bool;
950
	idChart_Chart_1:int;
951
	x_1:int;
952
	idChart_Stop_1:int;
953
	idStop_Reset_1:int;
954
	LAP:bool;
955
	cent_1:int;
956
	disp_cent_1:int;
957
	disp_min_1:int;
958
	disp_sec_1:int;
959
	min_1:int;
960
	sec_1:int)
961

    
962
returns (idChart_Run:int;
963
	idChart_Chart:int;
964
	x:int;
965
	idChart_Stop:int;
966
	idStop_Reset:int;
967
	cent:int;
968
	disp_cent:int;
969
	disp_min:int;
970
	disp_sec:int;
971
	min:int;
972
	sec:int);
973

    
974

    
975
let
976

    
977
	 automaton chart_run
978

    
979
	state POINTChart_Run:
980
	unless (idChart_Run_1=305) and START restart RUN_RUNNING__TO__STOP_RESET_1
981

    
982

    
983

    
984
	unless (idChart_Run_1=305) and LAP restart RUN_RUNNING__TO__RUN_LAP_2
985

    
986

    
987

    
988
	unless (idChart_Run_1=306) and LAP restart RUN_LAP__TO__RUN_RUNNING_1
989

    
990

    
991

    
992
	unless (idChart_Run_1=306) and START restart RUN_LAP__TO__STOP_LAP_STOP_2
993

    
994

    
995

    
996
	unless (idChart_Run_1=305) restart RUN_RUNNING_IDL
997

    
998
	unless (idChart_Run_1=306) restart RUN_LAP_IDL
999

    
1000
	let
1001

    
1002
		(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, min, sec) 
1003
	= (idChart_Run_1, idChart_Chart_1, x_1, idChart_Stop_1, idStop_Reset_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1004
	
1005

    
1006
	tel
1007

    
1008

    
1009

    
1010
	state RUN_RUNNING__TO__STOP_RESET_1:
1011

    
1012
	 var 	idChart_Run_2:int;
1013
	idChart_Chart_2, idChart_Chart_3:int;
1014
	x_2:int;
1015
	idChart_Stop_2, idChart_Stop_3:int;
1016
	idStop_Reset_2:int;
1017
	let
1018

    
1019
		-- transition trace :
1020
	--Run_Running__To__Stop_Reset_1
1021
		(x_2, idChart_Run_2, idChart_Chart_2) 
1022
	= Chart_Run_ex(x_1, idChart_Run_1, idChart_Chart_1, false);
1023
		
1024

    
1025
		idChart_Stop_2 
1026
	= 298;
1027
	
1028
		(idChart_Stop_3, idChart_Chart_3, idStop_Reset_2) 
1029
	= Chart_Stop_en(idChart_Stop_2, idChart_Chart_2, idStop_Reset_1, false);
1030
		
1031

    
1032
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset) 
1033
	=  (idChart_Run_2, idChart_Chart_3, x_2, idChart_Stop_3, idStop_Reset_2);
1034

    
1035
	--add unused variables
1036
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1037
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1038
	
1039

    
1040
	tel
1041

    
1042
	until true restart POINTChart_Run
1043

    
1044

    
1045

    
1046
	state RUN_RUNNING__TO__RUN_LAP_2:
1047

    
1048
	 var 	idChart_Run_2, idChart_Run_3:int;
1049
	x_2:int;
1050
	let
1051

    
1052
		-- transition trace :
1053
	--Run_Running__To__Run_Lap_2
1054
		(x_2, idChart_Run_2) 
1055
	= Run_Running_ex(x_1, idChart_Run_1, false);
1056
		
1057

    
1058
		(idChart_Run_3) 
1059
	= Run_Lap_en(idChart_Run_2, false);
1060
		
1061

    
1062
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset) 
1063
	=  (idChart_Run_3, idChart_Chart_1, x_2, idChart_Stop_1, idStop_Reset_1);
1064

    
1065
	--add unused variables
1066
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1067
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1068
	
1069

    
1070
	tel
1071

    
1072
	until true restart POINTChart_Run
1073

    
1074

    
1075

    
1076
	state RUN_LAP__TO__RUN_RUNNING_1:
1077

    
1078
	 var 	idChart_Run_2, idChart_Run_3:int;
1079
	x_2:int;
1080
	let
1081

    
1082
		-- transition trace :
1083
	--Run_Lap__To__Run_Running_1
1084
		(idChart_Run_2) 
1085
	= Run_Lap_ex(idChart_Run_1, false);
1086
		
1087

    
1088
		(idChart_Run_3, x_2) 
1089
	= Run_Running_en(idChart_Run_2, x_1, false);
1090
		
1091

    
1092
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset) 
1093
	=  (idChart_Run_3, idChart_Chart_1, x_2, idChart_Stop_1, idStop_Reset_1);
1094

    
1095
	--add unused variables
1096
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1097
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1098
	
1099

    
1100
	tel
1101

    
1102
	until true restart POINTChart_Run
1103

    
1104

    
1105

    
1106
	state RUN_LAP__TO__STOP_LAP_STOP_2:
1107

    
1108
	 var 	idChart_Run_2:int;
1109
	idChart_Chart_2, idChart_Chart_3:int;
1110
	x_2:int;
1111
	idChart_Stop_2, idChart_Stop_3:int;
1112
	idStop_Reset_2:int;
1113
	let
1114

    
1115
		-- transition trace :
1116
	--Run_Lap__To__Stop_Lap_stop_2
1117
		(x_2, idChart_Run_2, idChart_Chart_2) 
1118
	= Chart_Run_ex(x_1, idChart_Run_1, idChart_Chart_1, false);
1119
		
1120

    
1121
		idChart_Stop_2 
1122
	= 301;
1123
	
1124
		(idChart_Stop_3, idChart_Chart_3, idStop_Reset_2) 
1125
	= Chart_Stop_en(idChart_Stop_2, idChart_Chart_2, idStop_Reset_1, false);
1126
		
1127

    
1128
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset) 
1129
	=  (idChart_Run_2, idChart_Chart_3, x_2, idChart_Stop_3, idStop_Reset_2);
1130

    
1131
	--add unused variables
1132
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1133
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1134
	
1135

    
1136
	tel
1137

    
1138
	until true restart POINTChart_Run
1139

    
1140

    
1141

    
1142
	state RUN_RUNNING_IDL:
1143

    
1144
	 var 	cent_2:int;
1145
	disp_cent_2:int;
1146
	disp_min_2:int;
1147
	disp_sec_2:int;
1148
	min_2:int;
1149
	sec_2:int;
1150
	let
1151

    
1152
		
1153
	(cent_2, disp_cent_2, sec_2, disp_sec_2, min_2, disp_min_2) 
1154
	= Run_Running_du(cent_1, disp_cent_1, sec_1, disp_sec_1, min_1, disp_min_1);
1155

    
1156
		
1157

    
1158

    
1159
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, min, sec) 
1160
	= (idChart_Run_1, idChart_Chart_1, x_1, idChart_Stop_1, idStop_Reset_1, cent_2, disp_cent_2, disp_min_2, disp_sec_2, min_2, sec_2);
1161
	
1162

    
1163
	tel
1164

    
1165
	until true restart POINTChart_Run
1166

    
1167

    
1168

    
1169
	state RUN_LAP_IDL:
1170

    
1171
	 	let
1172

    
1173
		
1174

    
1175
	(idChart_Run, idChart_Chart, x, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, min, sec) 
1176
	= (idChart_Run_1, idChart_Chart_1, x_1, idChart_Stop_1, idStop_Reset_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1177
	
1178

    
1179
	tel
1180

    
1181
	until true restart POINTChart_Run
1182

    
1183

    
1184

    
1185
tel
1186

    
1187

    
1188
--***************************************************State :Stop_Reset Automaton***************************************************
1189

    
1190
node Stop_Reset_node(idStop_Reset_1:int)
1191

    
1192
returns (idStop_Reset:int);
1193

    
1194

    
1195
let
1196

    
1197
	 automaton stop_reset
1198

    
1199
	state POINTStop_Reset:
1200
	let
1201

    
1202
		(idStop_Reset) 
1203
	= (idStop_Reset_1);
1204
	
1205

    
1206
	tel
1207

    
1208

    
1209

    
1210
tel
1211

    
1212

    
1213
--***************************************************State :Chart_Stop Automaton***************************************************
1214

    
1215
node Chart_Stop_node(idChart_Stop_1:int;
1216
	idStop_Reset_1:int;
1217
	START:bool;
1218
	idChart_Chart_1:int;
1219
	idChart_Run_1:int;
1220
	x_1:int;
1221
	LAP:bool;
1222
	cent_1:int;
1223
	disp_cent_1:int;
1224
	disp_min_1:int;
1225
	disp_sec_1:int;
1226
	min_1:int;
1227
	sec_1:int)
1228

    
1229
returns (idChart_Stop:int;
1230
	idStop_Reset:int;
1231
	idChart_Chart:int;
1232
	idChart_Run:int;
1233
	x:int;
1234
	cent:int;
1235
	disp_cent:int;
1236
	disp_min:int;
1237
	disp_sec:int;
1238
	min:int;
1239
	sec:int);
1240

    
1241

    
1242
let
1243

    
1244
	 automaton chart_stop
1245

    
1246
	state POINTChart_Stop:
1247
	unless (idChart_Stop_1=0) restart POINT__TO__STOP_RESET_1
1248

    
1249

    
1250

    
1251
	unless (idChart_Stop_1=298) and START restart STOP_RESET__TO__RUN_RUNNING_1
1252

    
1253

    
1254

    
1255
	unless (idChart_Stop_1=301) and LAP restart STOP_LAP_STOP__TO__STOP_RESET_1
1256

    
1257

    
1258

    
1259
	unless (idChart_Stop_1=301) and START restart STOP_LAP_STOP__TO__RUN_LAP_2
1260

    
1261

    
1262

    
1263
	unless (idChart_Stop_1=298) restart STOP_RESET_IDL
1264

    
1265
	unless (idChart_Stop_1=301) restart STOP_LAP_STOP_IDL
1266

    
1267
	let
1268

    
1269
		(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x, cent, disp_cent, disp_min, disp_sec, min, sec) 
1270
	= (idChart_Stop_1, idStop_Reset_1, idChart_Chart_1, idChart_Run_1, x_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1271
	
1272

    
1273
	tel
1274

    
1275

    
1276

    
1277
	state POINT__TO__STOP_RESET_1:
1278

    
1279
	 var 	idChart_Stop_2:int;
1280
	idStop_Reset_2:int;
1281
	let
1282

    
1283
		-- transition trace :
1284
	--POINT__To__Stop_Reset_1
1285
		(idStop_Reset_2, idChart_Stop_2) 
1286
	= Stop_Reset_en(idStop_Reset_1, idChart_Stop_1, false);
1287
		
1288

    
1289
	(idChart_Stop, idStop_Reset) 
1290
	=  (idChart_Stop_2, idStop_Reset_2);
1291

    
1292
	--add unused variables
1293
	(cent, disp_cent, disp_min, disp_sec, idChart_Chart, idChart_Run, min, sec, x) 
1294
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, idChart_Chart_1, idChart_Run_1, min_1, sec_1, x_1);
1295
	
1296

    
1297
	tel
1298

    
1299
	until true restart POINTChart_Stop
1300

    
1301

    
1302

    
1303
	state STOP_RESET__TO__RUN_RUNNING_1:
1304

    
1305
	 var 	idChart_Stop_2:int;
1306
	idChart_Chart_2, idChart_Chart_3:int;
1307
	idChart_Run_2, idChart_Run_3:int;
1308
	x_2:int;
1309
	let
1310

    
1311
		-- transition trace :
1312
	--Stop_Reset__To__Run_Running_1
1313
		(idChart_Stop_2, idChart_Chart_2) 
1314
	= Chart_Stop_ex(idChart_Stop_1, idChart_Chart_1, false);
1315
		
1316

    
1317
		idChart_Run_2 
1318
	= 305;
1319
	
1320
		(idChart_Run_3, idChart_Chart_3, x_2) 
1321
	= Chart_Run_en(idChart_Run_2, idChart_Chart_2, x_1, false);
1322
		
1323

    
1324
	(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x) 
1325
	=  (idChart_Stop_2, idStop_Reset_1, idChart_Chart_3, idChart_Run_3, x_2);
1326

    
1327
	--add unused variables
1328
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1329
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1330
	
1331

    
1332
	tel
1333

    
1334
	until true restart POINTChart_Stop
1335

    
1336

    
1337

    
1338
	state STOP_LAP_STOP__TO__STOP_RESET_1:
1339

    
1340
	 var 	idChart_Stop_2, idChart_Stop_3:int;
1341
	idStop_Reset_2:int;
1342
	let
1343

    
1344
		-- transition trace :
1345
	--Stop_Lap_stop__To__Stop_Reset_1
1346
		(idChart_Stop_2) 
1347
	= Stop_Lap_stop_ex(idChart_Stop_1, false);
1348
		
1349

    
1350
		(idStop_Reset_2, idChart_Stop_3) 
1351
	= Stop_Reset_en(idStop_Reset_1, idChart_Stop_2, false);
1352
		
1353

    
1354
	(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x) 
1355
	=  (idChart_Stop_3, idStop_Reset_2, idChart_Chart_1, idChart_Run_1, x_1);
1356

    
1357
	--add unused variables
1358
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1359
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1360
	
1361

    
1362
	tel
1363

    
1364
	until true restart POINTChart_Stop
1365

    
1366

    
1367

    
1368
	state STOP_LAP_STOP__TO__RUN_LAP_2:
1369

    
1370
	 var 	idChart_Stop_2:int;
1371
	idChart_Chart_2, idChart_Chart_3:int;
1372
	idChart_Run_2, idChart_Run_3:int;
1373
	x_2:int;
1374
	let
1375

    
1376
		-- transition trace :
1377
	--Stop_Lap_stop__To__Run_Lap_2
1378
		(idChart_Stop_2, idChart_Chart_2) 
1379
	= Chart_Stop_ex(idChart_Stop_1, idChart_Chart_1, false);
1380
		
1381

    
1382
		idChart_Run_2 
1383
	= 306;
1384
	
1385
		(idChart_Run_3, idChart_Chart_3, x_2) 
1386
	= Chart_Run_en(idChart_Run_2, idChart_Chart_2, x_1, false);
1387
		
1388

    
1389
	(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x) 
1390
	=  (idChart_Stop_2, idStop_Reset_1, idChart_Chart_3, idChart_Run_3, x_2);
1391

    
1392
	--add unused variables
1393
	(cent, disp_cent, disp_min, disp_sec, min, sec) 
1394
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1395
	
1396

    
1397
	tel
1398

    
1399
	until true restart POINTChart_Stop
1400

    
1401

    
1402

    
1403
	state STOP_RESET_IDL:
1404

    
1405
	 var 	idStop_Reset_2:int;
1406
	cent_2:int;
1407
	disp_cent_2:int;
1408
	disp_min_2:int;
1409
	disp_sec_2:int;
1410
	min_2:int;
1411
	sec_2:int;
1412
	let
1413

    
1414
		
1415
	(cent_2, sec_2, min_2, disp_cent_2, disp_sec_2, disp_min_2) 
1416
	= Stop_Reset_du(LAP, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1417

    
1418
		
1419

    
1420
	(idStop_Reset_2) 
1421
	= Stop_Reset_node(idStop_Reset_1);
1422

    
1423
		
1424

    
1425

    
1426
	(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x, cent, disp_cent, disp_min, disp_sec, min, sec) 
1427
	= (idChart_Stop_1, idStop_Reset_2, idChart_Chart_1, idChart_Run_1, x_1, cent_2, disp_cent_2, disp_min_2, disp_sec_2, min_2, sec_2);
1428
	
1429

    
1430
	tel
1431

    
1432
	until true restart POINTChart_Stop
1433

    
1434

    
1435

    
1436
	state STOP_LAP_STOP_IDL:
1437

    
1438
	 	let
1439

    
1440
		
1441

    
1442
	(idChart_Stop, idStop_Reset, idChart_Chart, idChart_Run, x, cent, disp_cent, disp_min, disp_sec, min, sec) 
1443
	= (idChart_Stop_1, idStop_Reset_1, idChart_Chart_1, idChart_Run_1, x_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1444
	
1445

    
1446
	tel
1447

    
1448
	until true restart POINTChart_Stop
1449

    
1450

    
1451

    
1452
tel
1453

    
1454

    
1455
--***************************************************State :Chart_Chart Automaton***************************************************
1456

    
1457
node Chart_Chart_node(idChart_Chart_1:int;
1458
	idChart_Stop_1:int;
1459
	idStop_Reset_1:int;
1460
	LAP:bool;
1461
	START:bool;
1462
	cent_1:int;
1463
	disp_cent_1:int;
1464
	disp_min_1:int;
1465
	disp_sec_1:int;
1466
	idChart_Run_1:int;
1467
	min_1:int;
1468
	sec_1:int;
1469
	x_1:int;
1470
	TIC:bool)
1471

    
1472
returns (idChart_Chart:int;
1473
	idChart_Stop:int;
1474
	idStop_Reset:int;
1475
	cent:int;
1476
	disp_cent:int;
1477
	disp_min:int;
1478
	disp_sec:int;
1479
	idChart_Run:int;
1480
	min:int;
1481
	sec:int;
1482
	x:int);
1483

    
1484

    
1485
let
1486

    
1487
	 automaton chart_chart
1488

    
1489
	state POINTChart_Chart:
1490
	unless (idChart_Chart_1=0) restart POINT__TO__CHART_STOP_1
1491

    
1492

    
1493

    
1494
	unless (idChart_Chart_1=297) restart CHART_STOP_IDL
1495

    
1496
	unless (idChart_Chart_1=304) restart CHART_RUN_IDL
1497

    
1498
	let
1499

    
1500
		(idChart_Chart, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, idChart_Run, min, sec, x) 
1501
	= (idChart_Chart_1, idChart_Stop_1, idStop_Reset_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, idChart_Run_1, min_1, sec_1, x_1);
1502
	
1503

    
1504
	tel
1505

    
1506

    
1507

    
1508
	state POINT__TO__CHART_STOP_1:
1509

    
1510
	 var 	idChart_Chart_2:int;
1511
	idChart_Stop_2:int;
1512
	idStop_Reset_2:int;
1513
	let
1514

    
1515
		-- transition trace :
1516
	--POINT__To__Chart_Stop_1
1517
		(idChart_Stop_2, idChart_Chart_2, idStop_Reset_2) 
1518
	= Chart_Stop_en(idChart_Stop_1, idChart_Chart_1, idStop_Reset_1, false);
1519
		
1520

    
1521
	(idChart_Chart, idChart_Stop, idStop_Reset) 
1522
	=  (idChart_Chart_2, idChart_Stop_2, idStop_Reset_2);
1523

    
1524
	--add unused variables
1525
	(cent, disp_cent, disp_min, disp_sec, idChart_Run, min, sec, x) 
1526
	= (cent_1, disp_cent_1, disp_min_1, disp_sec_1, idChart_Run_1, min_1, sec_1, x_1);
1527
	
1528

    
1529
	tel
1530

    
1531
	until true restart POINTChart_Chart
1532

    
1533

    
1534

    
1535
	state CHART_STOP_IDL:
1536

    
1537
	 var 	idChart_Chart_2:int;
1538
	idChart_Stop_2:int;
1539
	idStop_Reset_2:int;
1540
	cent_2:int;
1541
	disp_cent_2:int;
1542
	disp_min_2:int;
1543
	disp_sec_2:int;
1544
	idChart_Run_2:int;
1545
	min_2:int;
1546
	sec_2:int;
1547
	x_2:int;
1548
	let
1549

    
1550
		
1551
	(idChart_Stop_2, idStop_Reset_2, idChart_Chart_2, idChart_Run_2, x_2, cent_2, disp_cent_2, disp_min_2, disp_sec_2, min_2, sec_2) 
1552
	= Chart_Stop_node(idChart_Stop_1, idStop_Reset_1, START, idChart_Chart_1, idChart_Run_1, x_1, LAP, cent_1, disp_cent_1, disp_min_1, disp_sec_1, min_1, sec_1);
1553

    
1554
		
1555

    
1556

    
1557
	(idChart_Chart, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, idChart_Run, min, sec, x) 
1558
	= (idChart_Chart_2, idChart_Stop_2, idStop_Reset_2, cent_2, disp_cent_2, disp_min_2, disp_sec_2, idChart_Run_2, min_2, sec_2, x_2);
1559
	
1560

    
1561
	tel
1562

    
1563
	until true restart POINTChart_Chart
1564

    
1565

    
1566

    
1567
	state CHART_RUN_IDL:
1568

    
1569
	 var 	idChart_Chart_2:int;
1570
	idChart_Stop_2:int;
1571
	idStop_Reset_2:int;
1572
	cent_2, cent_3:int;
1573
	disp_cent_2:int;
1574
	disp_min_2:int;
1575
	disp_sec_2:int;
1576
	idChart_Run_2:int;
1577
	min_2, min_3:int;
1578
	sec_2, sec_3:int;
1579
	x_2:int;
1580
	let
1581

    
1582
		
1583
	(cent_2, sec_2, min_2) 
1584
	= Chart_Run_du(TIC, cent_1, sec_1, min_1);
1585

    
1586
		
1587

    
1588
	(idChart_Run_2, idChart_Chart_2, x_2, idChart_Stop_2, idStop_Reset_2, cent_3, disp_cent_2, disp_min_2, disp_sec_2, min_3, sec_3) 
1589
	= Chart_Run_node(idChart_Run_1, START, idChart_Chart_1, x_1, idChart_Stop_1, idStop_Reset_1, LAP, cent_2, disp_cent_1, disp_min_1, disp_sec_1, min_2, sec_2);
1590

    
1591
		
1592

    
1593

    
1594
	(idChart_Chart, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, idChart_Run, min, sec, x) 
1595
	= (idChart_Chart_2, idChart_Stop_2, idStop_Reset_2, cent_3, disp_cent_2, disp_min_2, disp_sec_2, idChart_Run_2, min_3, sec_3, x_2);
1596
	
1597

    
1598
	tel
1599

    
1600
	until true restart POINTChart_Chart
1601

    
1602

    
1603

    
1604
tel
1605

    
1606

    
1607
--***************************************************State :Chart_Chart Automaton***************************************************
1608

    
1609
node StopwatchChart_Chart(TIC:bool;
1610
	LAP:bool;
1611
	START:bool)
1612

    
1613
returns (disp_min:int;
1614
	disp_sec:int;
1615
	disp_cent:int;
1616
	x:int);
1617

    
1618

    
1619
var disp_min_1: int;
1620

    
1621
	disp_sec_1: int;
1622

    
1623
	disp_cent_1: int;
1624

    
1625
	x_1: int;
1626

    
1627
	cent, cent_1: int;
1628

    
1629
	min, min_1: int;
1630

    
1631
	sec, sec_1: int;
1632

    
1633
	idChart_Chart, idChart_Chart_1: int;
1634

    
1635
	idChart_Run, idChart_Run_1: int;
1636

    
1637
	idStop_Reset, idStop_Reset_1: int;
1638

    
1639
	idChart_Stop, idChart_Stop_1: int;
1640

    
1641
		idChart_Chart_2, idChart_Chart_3:int;
1642
	idChart_Stop_2, idChart_Stop_3:int;
1643
	idStop_Reset_2, idStop_Reset_3:int;
1644
	cent_2, cent_3:int;
1645
	disp_cent_2, disp_cent_3:int;
1646
	disp_min_2, disp_min_3:int;
1647
	disp_sec_2, disp_sec_3:int;
1648
	idChart_Run_2, idChart_Run_3:int;
1649
	min_2, min_3:int;
1650
	sec_2, sec_3:int;
1651
	x_2, x_3:int;
1652
let
1653

    
1654
	disp_min_1 = 0 -> pre disp_min;
1655

    
1656
	disp_sec_1 = 0 -> pre disp_sec;
1657

    
1658
	disp_cent_1 = 0 -> pre disp_cent;
1659

    
1660
	x_1 = 0 -> pre x;
1661

    
1662
	cent_1 = 0 -> pre cent;
1663

    
1664
	min_1 = 0 -> pre min;
1665

    
1666
	sec_1 = 0 -> pre sec;
1667

    
1668
	idChart_Chart_1 = 0 -> pre idChart_Chart;
1669

    
1670
	idChart_Run_1 = 0 -> pre idChart_Run;
1671

    
1672
	idStop_Reset_1 = 0 -> pre idStop_Reset;
1673

    
1674
	idChart_Stop_1 = 0 -> pre idChart_Stop;
1675

    
1676
	
1677

    
1678

    
1679

    
1680
	(idChart_Chart_2, idChart_Stop_2, idStop_Reset_2, cent_2, disp_cent_2, disp_min_2, disp_sec_2, idChart_Run_2, min_2, sec_2, x_2)
1681
	 = 
1682

    
1683
	 if TIC then Chart_Chart_node(idChart_Chart_1, idChart_Stop_1, idStop_Reset_1, false, false, cent_1, disp_cent_1, disp_min_1, disp_sec_1, idChart_Run_1, min_1, sec_1, x_1, TIC)
1684

    
1685
	 else (idChart_Chart_1, idChart_Stop_1, idStop_Reset_1, cent_1, disp_cent_1, disp_min_1, disp_sec_1, idChart_Run_1, min_1, sec_1, x_1);
1686

    
1687
	
1688

    
1689

    
1690

    
1691
	(idChart_Chart_3, idChart_Stop_3, idStop_Reset_3, cent_3, disp_cent_3, disp_min_3, disp_sec_3, idChart_Run_3, min_3, sec_3, x_3)
1692
	 = 
1693

    
1694
	 if LAP then Chart_Chart_node(idChart_Chart_2, idChart_Stop_2, idStop_Reset_2, LAP, false, cent_2, disp_cent_2, disp_min_2, disp_sec_2, idChart_Run_2, min_2, sec_2, x_2, false)
1695

    
1696
	 else (idChart_Chart_2, idChart_Stop_2, idStop_Reset_2, cent_2, disp_cent_2, disp_min_2, disp_sec_2, idChart_Run_2, min_2, sec_2, x_2);
1697

    
1698
	
1699

    
1700

    
1701

    
1702
	(idChart_Chart, idChart_Stop, idStop_Reset, cent, disp_cent, disp_min, disp_sec, idChart_Run, min, sec, x)
1703
	 = 
1704

    
1705
	 if START then Chart_Chart_node(idChart_Chart_3, idChart_Stop_3, idStop_Reset_3, false, START, cent_3, disp_cent_3, disp_min_3, disp_sec_3, idChart_Run_3, min_3, sec_3, x_3, false)
1706

    
1707
	 else (idChart_Chart_3, idChart_Stop_3, idStop_Reset_3, cent_3, disp_cent_3, disp_min_3, disp_sec_3, idChart_Run_3, min_3, sec_3, x_3);
1708

    
1709
	
1710

    
1711

    
1712
--unused outputs
1713
	
1714

    
1715
tel
1716

    
1717

    
1718

    
1719
node StopwatchChart (TIC_1_1 : real; LAP_1_1 : real; START_1_1 : real)
1720
returns (disp_min_1_1 : int;
1721
	disp_sec_2_1 : int;
1722
	disp_cent_3_1 : int;
1723
	x_4_1 : int); 
1724
var
1725
	Chart_1_1 : int; Chart_2_1 : int; Chart_3_1 : int; Chart_4_1 : int;
1726
	Mux_1_1 : real; Mux_1_2 : real; Mux_1_3 : real;
1727
	i_virtual_local : real;
1728
	ChartMux_1_1_event: bool;
1729
	ChartMux_1_2_event: bool;
1730
	ChartMux_1_3_event: bool;
1731
let 
1732
	ChartMux_1_1_event = false -> ((pre(Mux_1_1) > 0.0 and Mux_1_1 <= 0.0) or (pre(Mux_1_1) <= 0.0 and Mux_1_1 > 0.0));
1733
	ChartMux_1_2_event = false -> ((pre(Mux_1_2) > 0.0 and Mux_1_2 <= 0.0) or (pre(Mux_1_2) <= 0.0 and Mux_1_2 > 0.0));
1734
	ChartMux_1_3_event = false -> ((pre(Mux_1_3) > 0.0 and Mux_1_3 <= 0.0) or (pre(Mux_1_3) <= 0.0 and Mux_1_3 > 0.0));
1735
	(Chart_1_1, Chart_2_1, Chart_3_1, Chart_4_1) =  StopwatchChart_Chart(ChartMux_1_1_event, ChartMux_1_2_event, ChartMux_1_3_event);
1736
	Mux_1_1 = TIC_1_1 ;
1737
	Mux_1_2 = LAP_1_1 ;
1738
	Mux_1_3 = START_1_1 ;
1739
	disp_min_1_1 = Chart_1_1;
1740
	disp_sec_2_1 = Chart_2_1;
1741
	disp_cent_3_1 = Chart_3_1;
1742
	x_4_1 = Chart_4_1;
1743
	i_virtual_local= 0.0 -> 1.0;
1744
tel
1745