1 /************************************************************/
3 /* OslMain State transition model source file */
4 /* ZIPC Designer Version 1.2.0 */
5 /************************************************************/
6 #include "../ZST_include.h"
8 /* State management variable */
9 static uint8_t ZOSL_OslMainState[ZOSL_OSLMAINSTATENOMAX];
11 static void ZOSL_OslMains0StateEntry( void );
12 static void ZOSL_OslMains1StateEntry( void );
13 static void ZOSL_OslMains0e1( void );
14 static void ZOSL_OslMains0e2( void );
15 static void ZOSL_OslMains1e0( void );
16 static void ZOSL_OslRestOffs0e0( void );
17 static void ZOSL_OslRestOffs0e1( void );
18 static void ZOSL_OslRestOffs0e4( void );
19 static void ZOSL_OslRestOffs1e0( void );
20 static void ZOSL_OslRestOffs1e2( void );
21 static void ZOSL_OslRestOffs2e6( void );
22 static void ZOSL_OslRestOns0e0( void );
23 static void ZOSL_OslRestOns0e2( void );
24 static void ZOSL_OslRestOns1e1( void );
25 static void ZOSL_OslRestOns1e3( void );
26 static void ZOSL_OslMains0Event( void );
27 static void ZOSL_OslRestOffs0Event( void );
28 static void ZOSL_OslRestOffs1Event( void );
29 static void ZOSL_OslRestOffs2Event( void );
30 static void ZOSL_OslMains1Event( void );
31 static void ZOSL_OslRestOns0Event( void );
32 static void ZOSL_OslRestOns1Event( void );
34 /****************************************/
35 /* State start activity function */
37 /* State : restriction_mode_off( No 0 ) */
38 /****************************************/
39 static void ZOSL_OslMains0StateEntry( void )
41 switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
43 case ZOSL_OSLRESTOFFS0:
44 stm_osl_start_activity_none();
46 case ZOSL_OSLRESTOFFS1:
47 stm_osl_start_activity_pop_up();
49 case ZOSL_OSLRESTOFFS2:
50 stm_osl_start_activity_system_alert();
53 /*Not accessible to this else (default).*/
58 /****************************************/
59 /* State start activity function */
61 /* State : restriction_mode_on( No 1 )*/
62 /****************************************/
63 static void ZOSL_OslMains1StateEntry( void )
65 switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
67 case ZOSL_OSLRESTONS0:
68 stm_osl_start_activity_none();
70 case ZOSL_OSLRESTONS1:
71 stm_osl_start_activity_system_alert();
74 /*Not accessible to this else (default).*/
79 /****************************************/
82 /* State : restriction_mode_off( No 0 ) */
83 /* Event : stt_crr_layer_on_screen_pop( No 1 ) */
84 /****************************************/
85 static void ZOSL_OslMains0e1( void )
87 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
88 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
89 ZOSL_OslMains1StateEntry();
92 /****************************************/
95 /* State : restriction_mode_off( No 0 ) */
96 /* Event : stt_crr_layer_on_screen_sys( No 2 ) */
97 /****************************************/
98 static void ZOSL_OslMains0e2( void )
100 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS1;
101 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
102 ZOSL_OslMains1StateEntry();
105 /****************************************/
106 /* Action function */
108 /* State : restriction_mode_on( No 1 )*/
109 /* Event : stt_restriction_mode_off( No 0 ) */
110 /****************************************/
111 static void ZOSL_OslMains1e0( void )
113 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
114 ZOSL_OslMains0StateEntry();
117 /****************************************/
118 /* Action function */
119 /* STM : OslRestOff */
120 /* State : none( No 0 ) */
121 /* Event : ara_onscreen( No 0 ) */
122 /****************************************/
123 static void ZOSL_OslRestOffs0e0( void )
125 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS1;
126 stm_osl_start_activity_pop_up();
129 /****************************************/
130 /* Action function */
131 /* STM : OslRestOff */
132 /* State : none( No 0 ) */
133 /* Event : ara_onscreen( No 1 ) */
134 /****************************************/
135 static void ZOSL_OslRestOffs0e1( void )
137 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS2;
138 stm_osl_start_activity_system_alert();
141 /****************************************/
142 /* Action function */
143 /* STM : OslRestOff */
144 /* State : none( No 0 ) */
145 /* Event : stt_prv_layer_on_screen_none( No 4 ) */
146 /****************************************/
147 static void ZOSL_OslRestOffs0e4( void )
149 stm_osl_start_activity_none();
152 /****************************************/
153 /* Action function */
154 /* STM : OslRestOff */
155 /* State : popup( No 1 ) */
156 /* Event : ara_onscreen( No 0 ) */
157 /****************************************/
158 static void ZOSL_OslRestOffs1e0( void )
160 stm_osl_start_activity_pop_up();
163 /****************************************/
164 /* Action function */
165 /* STM : OslRestOff */
166 /* State : popup( No 1 ) */
167 /* Event : ctg_popup( No 2 ) */
168 /****************************************/
169 static void ZOSL_OslRestOffs1e2( void )
171 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
172 stm_osl_start_activity_none();
175 /****************************************/
176 /* Action function */
177 /* STM : OslRestOff */
178 /* State : system_alert( No 2 ) */
179 /* Event : stt_prv_layer_on_screen_sys_alt( No 6 ) */
180 /****************************************/
181 static void ZOSL_OslRestOffs2e6( void )
183 stm_osl_start_activity_system_alert();
186 /****************************************/
187 /* Action function */
188 /* STM : OslRestOn */
189 /* State : none( No 0 ) */
190 /* Event : ara_onscreen( No 0 ) */
191 /****************************************/
192 static void ZOSL_OslRestOns0e0( void )
194 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS1;
195 stm_osl_start_activity_system_alert();
198 /****************************************/
199 /* Action function */
200 /* STM : OslRestOn */
201 /* State : none( No 0 ) */
202 /* Event : stt_prv_layer_on_screen_none( No 2 ) */
203 /****************************************/
204 static void ZOSL_OslRestOns0e2( void )
206 stm_osl_start_activity_none();
209 /****************************************/
210 /* Action function */
211 /* STM : OslRestOn */
212 /* State : system_alert( No 1 ) */
213 /* Event : ctg_systemalert( No 1 ) */
214 /****************************************/
215 static void ZOSL_OslRestOns1e1( void )
217 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
218 stm_osl_start_activity_none();
221 /****************************************/
222 /* Action function */
223 /* STM : OslRestOn */
224 /* State : system_alert( No 1 ) */
225 /* Event : stt_prv_layer_on_screen_sys_alt( No 3 ) */
226 /****************************************/
227 static void ZOSL_OslRestOns1e3( void )
229 stm_osl_start_activity_system_alert();
232 /****************************************/
233 /* Event appraisal function */
235 /* State : restriction_mode_off( No 0 ) */
236 /****************************************/
237 static void ZOSL_OslMains0Event( void )
239 /*stt_restriction_mode_on*/
240 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
242 stm_rel_event_restriction_mode_on();
243 /*stt_crr_layer_on_screen_pop*/
244 if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
248 /*stt_crr_layer_on_screen_sys*/
249 else if( g_stm_crr_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
255 /*Else and default design have not done.*/
256 /*Please confirm the STM and design else and default.*/
261 /*Else and default design have not done.*/
262 /*Please confirm the STM and design else and default.*/
266 /****************************************/
267 /* Event appraisal function */
268 /* STM : OslRestOff */
269 /* State : none( No 0 ) */
270 /****************************************/
271 static void ZOSL_OslRestOffs0Event( void )
273 /*stt_restriction_mode_off*/
274 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
277 if( g_stm_event == StmEvtNoActivate )
280 if( g_stm_category == StmCtgNoPopUp )
283 if( g_stm_area == StmAreaNoOnScreen )
285 ZOSL_OslRestOffs0e0();
289 /*Else and default design have not done.*/
290 /*Please confirm the STM and design else and default.*/
294 else if( g_stm_category == StmCtgNoSystemAlert )
297 if( g_stm_area == StmAreaNoOnScreen )
299 ZOSL_OslRestOffs0e1();
303 /*Else and default design have not done.*/
304 /*Please confirm the STM and design else and default.*/
309 /*Else and default design have not done.*/
310 /*Please confirm the STM and design else and default.*/
314 else if( g_stm_event == StmEvtNoUndo )
316 /*stt_prv_layer_on_screen_none*/
317 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
319 ZOSL_OslRestOffs0e4();
321 /*stt_prv_layer_on_screen_pop_up*/
322 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
324 ZOSL_OslRestOffs0e0();
326 /*stt_prv_layer_on_screen_sys_alt*/
327 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
329 ZOSL_OslRestOffs0e1();
333 /*Else and default design have not done.*/
334 /*Please confirm the STM and design else and default.*/
339 /*Else and default design have not done.*/
340 /*Please confirm the STM and design else and default.*/
345 /*Else and default design have not done.*/
346 /*Please confirm the STM and design else and default.*/
350 /****************************************/
351 /* Event appraisal function */
352 /* STM : OslRestOff */
353 /* State : popup( No 1 ) */
354 /****************************************/
355 static void ZOSL_OslRestOffs1Event( void )
357 /*stt_restriction_mode_off*/
358 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
361 if( g_stm_event == StmEvtNoActivate )
364 if( g_stm_category == StmCtgNoPopUp )
367 if( g_stm_area == StmAreaNoOnScreen )
369 ZOSL_OslRestOffs1e0();
373 /*Else and default design have not done.*/
374 /*Please confirm the STM and design else and default.*/
378 else if( g_stm_category == StmCtgNoSystemAlert )
381 if( g_stm_area == StmAreaNoOnScreen )
383 ZOSL_OslRestOffs0e1();
387 /*Else and default design have not done.*/
388 /*Please confirm the STM and design else and default.*/
393 /*Else and default design have not done.*/
394 /*Please confirm the STM and design else and default.*/
398 else if( g_stm_event == StmEvtNoDeactivate )
401 if( g_stm_category == StmCtgNoPopUp )
403 ZOSL_OslRestOffs1e2();
407 /*Else and default design have not done.*/
408 /*Please confirm the STM and design else and default.*/
412 else if( g_stm_event == StmEvtNoUndo )
414 /*stt_prv_layer_on_screen_none*/
415 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
417 ZOSL_OslRestOffs1e2();
419 /*stt_prv_layer_on_screen_pop_up*/
420 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
422 ZOSL_OslRestOffs1e0();
424 /*stt_prv_layer_on_screen_sys_alt*/
425 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
427 ZOSL_OslRestOffs0e1();
431 /*Else and default design have not done.*/
432 /*Please confirm the STM and design else and default.*/
437 /*Else and default design have not done.*/
438 /*Please confirm the STM and design else and default.*/
443 /*Else and default design have not done.*/
444 /*Please confirm the STM and design else and default.*/
448 /****************************************/
449 /* Event appraisal function */
450 /* STM : OslRestOff */
451 /* State : system_alert( No 2 ) */
452 /****************************************/
453 static void ZOSL_OslRestOffs2Event( void )
455 /*stt_restriction_mode_off*/
456 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
459 if( g_stm_event == StmEvtNoDeactivate )
462 if( g_stm_category == StmCtgNoSystemAlert )
464 ZOSL_OslRestOffs1e2();
468 /*Else and default design have not done.*/
469 /*Please confirm the STM and design else and default.*/
473 else if( g_stm_event == StmEvtNoUndo )
475 /*stt_prv_layer_on_screen_none*/
476 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
478 ZOSL_OslRestOffs1e2();
480 /*stt_prv_layer_on_screen_pop_up*/
481 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoPopUp )
483 ZOSL_OslRestOffs0e0();
485 /*stt_prv_layer_on_screen_sys_alt*/
486 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
488 ZOSL_OslRestOffs2e6();
492 /*Else and default design have not done.*/
493 /*Please confirm the STM and design else and default.*/
498 /*Else and default design have not done.*/
499 /*Please confirm the STM and design else and default.*/
504 /*Else and default design have not done.*/
505 /*Please confirm the STM and design else and default.*/
509 /****************************************/
510 /* Event appraisal function */
512 /* State : restriction_mode_on( No 1 )*/
513 /****************************************/
514 static void ZOSL_OslMains1Event( void )
516 /*stt_restriction_mode_off*/
517 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOff )
519 stm_rel_event_restriction_mode_off();
524 /*Else and default design have not done.*/
525 /*Please confirm the STM and design else and default.*/
529 /****************************************/
530 /* Event appraisal function */
531 /* STM : OslRestOn */
532 /* State : none( No 0 ) */
533 /****************************************/
534 static void ZOSL_OslRestOns0Event( void )
536 /*stt_restriction_mode_on*/
537 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
540 if( g_stm_event == StmEvtNoActivate )
543 if( g_stm_category == StmCtgNoSystemAlert )
546 if( g_stm_area == StmAreaNoOnScreen )
548 ZOSL_OslRestOns0e0();
552 /*Else and default design have not done.*/
553 /*Please confirm the STM and design else and default.*/
558 /*Else and default design have not done.*/
559 /*Please confirm the STM and design else and default.*/
563 else if( g_stm_event == StmEvtNoUndo )
565 /*stt_prv_layer_on_screen_none*/
566 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
568 ZOSL_OslRestOns0e2();
570 /*stt_prv_layer_on_screen_sys_alt*/
571 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
573 ZOSL_OslRestOns0e0();
577 /*Else and default design have not done.*/
578 /*Please confirm the STM and design else and default.*/
583 /*Else and default design have not done.*/
584 /*Please confirm the STM and design else and default.*/
589 /*Else and default design have not done.*/
590 /*Please confirm the STM and design else and default.*/
594 /****************************************/
595 /* Event appraisal function */
596 /* STM : OslRestOn */
597 /* State : system_alert( No 1 ) */
598 /****************************************/
599 static void ZOSL_OslRestOns1Event( void )
601 /*stt_restriction_mode_on*/
602 if( g_stm_crr_state.car_element[StmCarElementNoRestrictionMode].state == StmRestrictionModeSttNoOn )
605 if( g_stm_event == StmEvtNoDeactivate )
608 if( g_stm_category == StmCtgNoSystemAlert )
610 ZOSL_OslRestOns1e1();
614 /*Else and default design have not done.*/
615 /*Please confirm the STM and design else and default.*/
619 else if( g_stm_event == StmEvtNoUndo )
621 /*stt_prv_layer_on_screen_none*/
622 if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoNone )
624 ZOSL_OslRestOns1e1();
626 /*stt_prv_layer_on_screen_sys_alt*/
627 else if( g_stm_prv_state.layer[StmLayerNoOnScreen].state == StmLayoutNoSysAlt )
629 ZOSL_OslRestOns1e3();
633 /*Else and default design have not done.*/
634 /*Please confirm the STM and design else and default.*/
639 /*Else and default design have not done.*/
640 /*Please confirm the STM and design else and default.*/
645 /*Else and default design have not done.*/
646 /*Please confirm the STM and design else and default.*/
650 /****************************************/
651 /* Event call function */
653 /****************************************/
654 void stm_osl_event_call( void )
657 switch( ZOSL_OslMainState[ZOSL_OSLMAIN] )
660 switch( ZOSL_OslMainState[ZOSL_OSLMAINS0F] )
662 case ZOSL_OSLRESTOFFS0:
663 ZOSL_OslRestOffs0Event();
665 case ZOSL_OSLRESTOFFS1:
666 ZOSL_OslRestOffs1Event();
668 case ZOSL_OSLRESTOFFS2:
669 ZOSL_OslRestOffs2Event();
672 /*Not accessible to this else (default).*/
675 ZOSL_OslMains0Event();
678 switch( ZOSL_OslMainState[ZOSL_OSLMAINS1F] )
680 case ZOSL_OSLRESTONS0:
681 ZOSL_OslRestOns0Event();
683 case ZOSL_OSLRESTONS1:
684 ZOSL_OslRestOns1Event();
687 /*Not accessible to this else (default).*/
690 ZOSL_OslMains1Event();
693 /*Not accessible to this else (default).*/
698 /****************************************/
699 /* Initial function */
701 /****************************************/
702 void stm_osl_initialize( void )
704 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINS0;
705 ZOSL_OslMainState[ZOSL_OSLMAINS0F] = ( uint8_t )ZOSL_OSLRESTOFFS0;
706 ZOSL_OslMainState[ZOSL_OSLMAINS1F] = ( uint8_t )ZOSL_OSLRESTONS0;
707 ZOSL_OslMains0StateEntry();
710 /****************************************/
711 /* Terminate function */
713 /****************************************/
714 void ZOSL_OslMainTerminate( void )
716 ZOSL_OslMainState[ZOSL_OSLMAIN] = ( uint8_t )ZOSL_OSLMAINTERMINATE;