digitalwatch.rs 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976
  1. #![allow(non_camel_case_types)]
  2. #![allow(non_snake_case)]
  3. #![allow(unused_labels)]
  4. #![allow(unused_variables)]
  5. #![allow(dead_code)]
  6. #![allow(unused_parens)]
  7. #![allow(unused_macros)]
  8. #![allow(non_upper_case_globals)]
  9. #![allow(unused_mut)]
  10. #![allow(unused_imports)]
  11. #[cfg(target_arch = "wasm32")]
  12. use wasm_bindgen::prelude::*;
  13. use std::ops::Deref;
  14. use std::ops::DerefMut;
  15. use sccd::action_lang;
  16. use sccd::inherit_struct;
  17. use sccd::call_closure;
  18. use sccd::statechart;
  19. use sccd::statechart::EventLifeline;
  20. type Timers<TimerId> = [TimerId; 11];
  21. // Input Events
  22. #[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
  23. #[derive(Copy, Clone, Debug)]
  24. pub enum InEvent {
  25. E_bottomLeftPressed,
  26. E_bottomLeftReleased,
  27. E_bottomRightPressed,
  28. E_bottomRightReleased,
  29. E_topLeftPressed,
  30. E_topLeftReleased,
  31. E_topRightPressed,
  32. E_topRightReleased,
  33. E_alarmStart,
  34. A0,
  35. A1,
  36. A2,
  37. A3,
  38. A4,
  39. A5,
  40. A6,
  41. A7,
  42. A8,
  43. A9,
  44. A10,
  45. }
  46. // Internal Events
  47. struct Event_int_refresh_chrono {
  48. // TODO: internal event parameters
  49. }
  50. struct Event_int_refresh_time {
  51. // TODO: internal event parameters
  52. }
  53. struct Event_alarm_edit {
  54. // TODO: internal event parameters
  55. }
  56. struct Event_time_edit {
  57. // TODO: internal event parameters
  58. }
  59. struct Event_edit_done {
  60. // TODO: internal event parameters
  61. }
  62. #[derive(Default)]
  63. struct Internal {
  64. e_int_refresh_chrono: Option<Event_int_refresh_chrono>,
  65. e_int_refresh_time: Option<Event_int_refresh_time>,
  66. e_alarm_edit: Option<Event_alarm_edit>,
  67. e_time_edit: Option<Event_time_edit>,
  68. e_edit_done: Option<Event_edit_done>,
  69. }
  70. type InternalLifeline = statechart::NextRoundLifeline<Internal>;
  71. // Output Events
  72. #[cfg_attr(target_arch = "wasm32", wasm_bindgen)]
  73. #[derive(Copy, Clone, Debug, PartialEq, Eq)]
  74. pub enum OutEvent {
  75. E_setAlarm,
  76. E_setIndiglo,
  77. E_unsetIndiglo,
  78. E_increaseChronoByOne,
  79. E_resetChrono,
  80. E_refreshTimeDisplay,
  81. E_refreshAlarmDisplay,
  82. E_startSelection,
  83. E_stopSelection,
  84. E_selectNext,
  85. E_increaseSelection,
  86. E_refreshChronoDisplay,
  87. E_increaseTimeByOne,
  88. E_checkTime,
  89. }
  90. // Transition arenas (bitmap type)
  91. type Arenas = u16;
  92. const ARENA_NONE: Arenas = 0;
  93. const ARENA_P_Alarm: Arenas = 0b111;
  94. const ARENA_P_Alarm_On: Arenas = 0b110;
  95. const ARENA_P_Alarm_On_Blinking: Arenas = 0b100;
  96. const ARENA_P_Indiglo: Arenas = 0b1000;
  97. const ARENA_P_ChronoWrapper: Arenas = 0b110000;
  98. const ARENA_P_ChronoWrapper_Chrono: Arenas = 0b100000;
  99. const ARENA_P_Display: Arenas = 0b11000000;
  100. const ARENA_P_Display_EditingTime: Arenas = 0b10000000;
  101. const ARENA_P_Time: Arenas = 0b100000000;
  102. const ARENA_UNSTABLE: Arenas = 0b1000000000; // indicates any transition fired with an unstable target
  103. impl<Sched: statechart::Scheduler> Default for Statechart<Sched> {
  104. fn default() -> Self {
  105. // Initialize data model
  106. let scope = action_lang::Empty{};
  107. Self {
  108. configuration: Default::default(),
  109. timers: Default::default(),
  110. data: scope,
  111. }
  112. }
  113. }
  114. type DataModel = action_lang::Empty;
  115. pub struct Statechart<Sched: statechart::Scheduler> {
  116. configuration: Root,
  117. timers: Timers<Sched::TimerId>,
  118. data: DataModel,
  119. }
  120. fn fair_step<Sched: statechart::Scheduler<InEvent=InEvent>>(sc: &mut Statechart<Sched>, input: &mut Option<InEvent>, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent), dirty: Arenas) -> Arenas {
  121. let mut fired: Arenas = ARENA_NONE;
  122. let mut scope = &mut sc.data;
  123. let root = &mut sc.configuration;
  124. 'arena_root: loop {
  125. match *root {
  126. Root::S_P(ref mut s_P) => {
  127. let s_P_Alarm = &mut s_P.s_P_Alarm;
  128. let s_P_Indiglo = &mut s_P.s_P_Indiglo;
  129. let s_P_ChronoWrapper = &mut s_P.s_P_ChronoWrapper;
  130. let s_P_Display = &mut s_P.s_P_Display;
  131. let s_P_Time = &mut s_P.s_P_Time;
  132. // Orthogonal region
  133. if (fired | dirty) & ARENA_P_Alarm == ARENA_NONE {
  134. 'arena_P_Alarm: loop {
  135. match *s_P_Alarm {
  136. State_P_Alarm::S_Off(ref mut s_P_Alarm_Off) => {
  137. // Outgoing transition 0
  138. if let Some(InEvent::E_bottomLeftPressed) = &input {
  139. if f0_guard((*s_P_Indiglo, *s_P_ChronoWrapper, *s_P_Display, *s_P_Time, ), ) {
  140. // Exit actions
  141. s_P_Alarm_Off.exit_current(&mut sc.timers, scope, internal, sched, output);
  142. // Enter actions
  143. State_P_Alarm_On::enter_default(&mut sc.timers, scope, internal, sched, output);
  144. // Build new state configuration
  145. let new_s_P_Alarm_On: State_P_Alarm_On = Default::default();
  146. let new_s_P_Alarm = State_P_Alarm::S_On(new_s_P_Alarm_On);
  147. // Update arena configuration
  148. *s_P_Alarm = new_s_P_Alarm;
  149. fired |= ARENA_P_Alarm; // Stable target
  150. // Internal Event Lifeline: Next Small Step
  151. internal.cycle();
  152. break 'arena_P_Alarm;
  153. }
  154. }
  155. },
  156. State_P_Alarm::S_On(ref mut s_P_Alarm_On) => {
  157. if (fired | dirty) & ARENA_P_Alarm_On == ARENA_NONE {
  158. 'arena_P_Alarm_On: loop {
  159. match *s_P_Alarm_On {
  160. State_P_Alarm_On::S_NotBlinking(ref mut s_P_Alarm_On_NotBlinking) => {
  161. // Outgoing transition 0
  162. if let Some(InEvent::E_alarmStart) = &input {
  163. // Exit actions
  164. s_P_Alarm_On_NotBlinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  165. // Enter actions
  166. State_P_Alarm_On_Blinking::enter_default(&mut sc.timers, scope, internal, sched, output);
  167. // Build new state configuration
  168. let new_s_P_Alarm_On_Blinking: State_P_Alarm_On_Blinking = Default::default();
  169. let new_s_P_Alarm_On = State_P_Alarm_On::S_Blinking(new_s_P_Alarm_On_Blinking);
  170. // Update arena configuration
  171. *s_P_Alarm_On = new_s_P_Alarm_On;
  172. fired |= ARENA_P_Alarm_On; // Stable target
  173. // Internal Event Lifeline: Next Small Step
  174. internal.cycle();
  175. break 'arena_P_Alarm_On;
  176. }
  177. // Outgoing transition 1
  178. // A transition may have fired earlier that overlaps with our arena:
  179. if fired & (ARENA_P_Alarm) == ARENA_NONE {
  180. if let Some(InEvent::E_bottomLeftPressed) = &input {
  181. if f1_guard((*s_P_Indiglo, *s_P_ChronoWrapper, *s_P_Display, *s_P_Time, ), ) {
  182. // Exit actions
  183. s_P_Alarm_On_NotBlinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  184. State_P_Alarm_On::exit_actions(&mut sc.timers, scope, internal, sched, output);
  185. // Enter actions
  186. State_P_Alarm_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  187. // Build new state configuration
  188. let new_s_P_Alarm_Off: State_P_Alarm_Off = Default::default();
  189. let new_s_P_Alarm = State_P_Alarm::S_Off(new_s_P_Alarm_Off);
  190. // Update arena configuration
  191. *s_P_Alarm = new_s_P_Alarm;
  192. fired |= ARENA_P_Alarm; // Stable target
  193. // Internal Event Lifeline: Next Small Step
  194. internal.cycle();
  195. break 'arena_P_Alarm;
  196. }
  197. }
  198. }
  199. },
  200. State_P_Alarm_On::S_Blinking(ref mut s_P_Alarm_On_Blinking) => {
  201. // Outgoing transition 0
  202. // A transition may have fired earlier that overlaps with our arena:
  203. if fired & (ARENA_P_Alarm) == ARENA_NONE {
  204. if let Some(InEvent::E_topRightPressed) = &input {
  205. // Exit actions
  206. s_P_Alarm_On_Blinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  207. State_P_Alarm_On::exit_actions(&mut sc.timers, scope, internal, sched, output);
  208. // Enter actions
  209. State_P_Alarm_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  210. // Build new state configuration
  211. let new_s_P_Alarm_Off: State_P_Alarm_Off = Default::default();
  212. let new_s_P_Alarm = State_P_Alarm::S_Off(new_s_P_Alarm_Off);
  213. // Update arena configuration
  214. *s_P_Alarm = new_s_P_Alarm;
  215. fired |= ARENA_P_Alarm; // Stable target
  216. // Internal Event Lifeline: Next Small Step
  217. internal.cycle();
  218. break 'arena_P_Alarm;
  219. }
  220. }
  221. // Outgoing transition 1
  222. // A transition may have fired earlier that overlaps with our arena:
  223. if fired & (ARENA_P_Alarm) == ARENA_NONE {
  224. if let Some(InEvent::E_topLeftPressed) = &input {
  225. // Exit actions
  226. s_P_Alarm_On_Blinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  227. State_P_Alarm_On::exit_actions(&mut sc.timers, scope, internal, sched, output);
  228. // Enter actions
  229. State_P_Alarm_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  230. // Build new state configuration
  231. let new_s_P_Alarm_Off: State_P_Alarm_Off = Default::default();
  232. let new_s_P_Alarm = State_P_Alarm::S_Off(new_s_P_Alarm_Off);
  233. // Update arena configuration
  234. *s_P_Alarm = new_s_P_Alarm;
  235. fired |= ARENA_P_Alarm; // Stable target
  236. // Internal Event Lifeline: Next Small Step
  237. internal.cycle();
  238. break 'arena_P_Alarm;
  239. }
  240. }
  241. // Outgoing transition 2
  242. // A transition may have fired earlier that overlaps with our arena:
  243. if fired & (ARENA_P_Alarm) == ARENA_NONE {
  244. if let Some(InEvent::E_bottomRightPressed) = &input {
  245. // Exit actions
  246. s_P_Alarm_On_Blinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  247. State_P_Alarm_On::exit_actions(&mut sc.timers, scope, internal, sched, output);
  248. // Enter actions
  249. State_P_Alarm_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  250. // Build new state configuration
  251. let new_s_P_Alarm_Off: State_P_Alarm_Off = Default::default();
  252. let new_s_P_Alarm = State_P_Alarm::S_Off(new_s_P_Alarm_Off);
  253. // Update arena configuration
  254. *s_P_Alarm = new_s_P_Alarm;
  255. fired |= ARENA_P_Alarm; // Stable target
  256. // Internal Event Lifeline: Next Small Step
  257. internal.cycle();
  258. break 'arena_P_Alarm;
  259. }
  260. }
  261. // Outgoing transition 3
  262. // A transition may have fired earlier that overlaps with our arena:
  263. if fired & (ARENA_P_Alarm) == ARENA_NONE {
  264. if let Some(InEvent::E_bottomLeftPressed) = &input {
  265. // Exit actions
  266. s_P_Alarm_On_Blinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  267. State_P_Alarm_On::exit_actions(&mut sc.timers, scope, internal, sched, output);
  268. // Enter actions
  269. State_P_Alarm_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  270. // Build new state configuration
  271. let new_s_P_Alarm_Off: State_P_Alarm_Off = Default::default();
  272. let new_s_P_Alarm = State_P_Alarm::S_Off(new_s_P_Alarm_Off);
  273. // Update arena configuration
  274. *s_P_Alarm = new_s_P_Alarm;
  275. fired |= ARENA_P_Alarm; // Stable target
  276. // Internal Event Lifeline: Next Small Step
  277. internal.cycle();
  278. break 'arena_P_Alarm;
  279. }
  280. }
  281. // Outgoing transition 4
  282. // A transition may have fired earlier that overlaps with our arena:
  283. if fired & (ARENA_P_Alarm_On) == ARENA_NONE {
  284. if let Some(InEvent::A2) = &input {
  285. // Exit actions
  286. s_P_Alarm_On_Blinking.exit_current(&mut sc.timers, scope, internal, sched, output);
  287. // Enter actions
  288. State_P_Alarm_On_NotBlinking::enter_default(&mut sc.timers, scope, internal, sched, output);
  289. // Build new state configuration
  290. let new_s_P_Alarm_On_NotBlinking: State_P_Alarm_On_NotBlinking = Default::default();
  291. let new_s_P_Alarm_On = State_P_Alarm_On::S_NotBlinking(new_s_P_Alarm_On_NotBlinking);
  292. // Update arena configuration
  293. *s_P_Alarm_On = new_s_P_Alarm_On;
  294. fired |= ARENA_P_Alarm_On; // Stable target
  295. // Internal Event Lifeline: Next Small Step
  296. internal.cycle();
  297. break 'arena_P_Alarm_On;
  298. }
  299. }
  300. if (fired | dirty) & ARENA_P_Alarm_On_Blinking == ARENA_NONE {
  301. 'arena_P_Alarm_On_Blinking: loop {
  302. match *s_P_Alarm_On_Blinking {
  303. State_P_Alarm_On_Blinking::S_On(ref mut s_P_Alarm_On_Blinking_On) => {
  304. // Outgoing transition 0
  305. if let Some(InEvent::A0) = &input {
  306. // Exit actions
  307. s_P_Alarm_On_Blinking_On.exit_current(&mut sc.timers, scope, internal, sched, output);
  308. // Enter actions
  309. State_P_Alarm_On_Blinking_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  310. // Build new state configuration
  311. let new_s_P_Alarm_On_Blinking_Off: State_P_Alarm_On_Blinking_Off = Default::default();
  312. let new_s_P_Alarm_On_Blinking = State_P_Alarm_On_Blinking::S_Off(new_s_P_Alarm_On_Blinking_Off);
  313. // Update arena configuration
  314. *s_P_Alarm_On_Blinking = new_s_P_Alarm_On_Blinking;
  315. fired |= ARENA_P_Alarm_On_Blinking; // Stable target
  316. // Internal Event Lifeline: Next Small Step
  317. internal.cycle();
  318. break 'arena_P_Alarm_On_Blinking;
  319. }
  320. },
  321. State_P_Alarm_On_Blinking::S_Off(ref mut s_P_Alarm_On_Blinking_Off) => {
  322. // Outgoing transition 0
  323. // A transition may have fired earlier that overlaps with our arena:
  324. if fired & (ARENA_P_Alarm_On_Blinking) == ARENA_NONE {
  325. if let Some(InEvent::A1) = &input {
  326. // Exit actions
  327. s_P_Alarm_On_Blinking_Off.exit_current(&mut sc.timers, scope, internal, sched, output);
  328. // Enter actions
  329. State_P_Alarm_On_Blinking_On::enter_default(&mut sc.timers, scope, internal, sched, output);
  330. // Build new state configuration
  331. let new_s_P_Alarm_On_Blinking_On: State_P_Alarm_On_Blinking_On = Default::default();
  332. let new_s_P_Alarm_On_Blinking = State_P_Alarm_On_Blinking::S_On(new_s_P_Alarm_On_Blinking_On);
  333. // Update arena configuration
  334. *s_P_Alarm_On_Blinking = new_s_P_Alarm_On_Blinking;
  335. fired |= ARENA_P_Alarm_On_Blinking; // Stable target
  336. // Internal Event Lifeline: Next Small Step
  337. internal.cycle();
  338. break 'arena_P_Alarm_On_Blinking;
  339. }
  340. }
  341. },
  342. };
  343. break;
  344. }
  345. }
  346. },
  347. };
  348. break;
  349. }
  350. }
  351. },
  352. };
  353. break;
  354. }
  355. }
  356. // Orthogonal region
  357. if (fired | dirty) & ARENA_P_Indiglo == ARENA_NONE {
  358. 'arena_P_Indiglo: loop {
  359. match *s_P_Indiglo {
  360. State_P_Indiglo::S_Off(ref mut s_P_Indiglo_Off) => {
  361. // Outgoing transition 0
  362. if let Some(InEvent::E_topRightPressed) = &input {
  363. // Exit actions
  364. s_P_Indiglo_Off.exit_current(&mut sc.timers, scope, internal, sched, output);
  365. // Transition's actions
  366. (output)(OutEvent::E_setIndiglo);
  367. // Enter actions
  368. State_P_Indiglo_Pushed::enter_default(&mut sc.timers, scope, internal, sched, output);
  369. // Build new state configuration
  370. let new_s_P_Indiglo_Pushed: State_P_Indiglo_Pushed = Default::default();
  371. let new_s_P_Indiglo = State_P_Indiglo::S_Pushed(new_s_P_Indiglo_Pushed);
  372. // Update arena configuration
  373. *s_P_Indiglo = new_s_P_Indiglo;
  374. fired |= ARENA_P_Indiglo; // Stable target
  375. // Internal Event Lifeline: Next Small Step
  376. internal.cycle();
  377. break 'arena_P_Indiglo;
  378. }
  379. },
  380. State_P_Indiglo::S_Pushed(ref mut s_P_Indiglo_Pushed) => {
  381. // Outgoing transition 0
  382. // A transition may have fired earlier that overlaps with our arena:
  383. if fired & (ARENA_P_Indiglo) == ARENA_NONE {
  384. if let Some(InEvent::E_topRightReleased) = &input {
  385. // Exit actions
  386. s_P_Indiglo_Pushed.exit_current(&mut sc.timers, scope, internal, sched, output);
  387. // Enter actions
  388. State_P_Indiglo_Released::enter_default(&mut sc.timers, scope, internal, sched, output);
  389. // Build new state configuration
  390. let new_s_P_Indiglo_Released: State_P_Indiglo_Released = Default::default();
  391. let new_s_P_Indiglo = State_P_Indiglo::S_Released(new_s_P_Indiglo_Released);
  392. // Update arena configuration
  393. *s_P_Indiglo = new_s_P_Indiglo;
  394. fired |= ARENA_P_Indiglo; // Stable target
  395. // Internal Event Lifeline: Next Small Step
  396. internal.cycle();
  397. break 'arena_P_Indiglo;
  398. }
  399. }
  400. },
  401. State_P_Indiglo::S_Released(ref mut s_P_Indiglo_Released) => {
  402. // Outgoing transition 0
  403. // A transition may have fired earlier that overlaps with our arena:
  404. if fired & (ARENA_P_Indiglo) == ARENA_NONE {
  405. if let Some(InEvent::E_topRightPressed) = &input {
  406. // Exit actions
  407. s_P_Indiglo_Released.exit_current(&mut sc.timers, scope, internal, sched, output);
  408. // Enter actions
  409. State_P_Indiglo_Pushed::enter_default(&mut sc.timers, scope, internal, sched, output);
  410. // Build new state configuration
  411. let new_s_P_Indiglo_Pushed: State_P_Indiglo_Pushed = Default::default();
  412. let new_s_P_Indiglo = State_P_Indiglo::S_Pushed(new_s_P_Indiglo_Pushed);
  413. // Update arena configuration
  414. *s_P_Indiglo = new_s_P_Indiglo;
  415. fired |= ARENA_P_Indiglo; // Stable target
  416. // Internal Event Lifeline: Next Small Step
  417. internal.cycle();
  418. break 'arena_P_Indiglo;
  419. }
  420. }
  421. // Outgoing transition 1
  422. // A transition may have fired earlier that overlaps with our arena:
  423. if fired & (ARENA_P_Indiglo) == ARENA_NONE {
  424. if let Some(InEvent::A3) = &input {
  425. // Exit actions
  426. s_P_Indiglo_Released.exit_current(&mut sc.timers, scope, internal, sched, output);
  427. // Transition's actions
  428. (output)(OutEvent::E_unsetIndiglo);
  429. // Enter actions
  430. State_P_Indiglo_Off::enter_default(&mut sc.timers, scope, internal, sched, output);
  431. // Build new state configuration
  432. let new_s_P_Indiglo_Off: State_P_Indiglo_Off = Default::default();
  433. let new_s_P_Indiglo = State_P_Indiglo::S_Off(new_s_P_Indiglo_Off);
  434. // Update arena configuration
  435. *s_P_Indiglo = new_s_P_Indiglo;
  436. fired |= ARENA_P_Indiglo; // Stable target
  437. // Internal Event Lifeline: Next Small Step
  438. internal.cycle();
  439. break 'arena_P_Indiglo;
  440. }
  441. }
  442. },
  443. };
  444. break;
  445. }
  446. }
  447. // Orthogonal region
  448. if (fired | dirty) & ARENA_P_ChronoWrapper == ARENA_NONE {
  449. 'arena_P_ChronoWrapper: loop {
  450. match *s_P_ChronoWrapper {
  451. State_P_ChronoWrapper::S_Chrono(ref mut s_P_ChronoWrapper_Chrono) => {
  452. // Outgoing transition 0
  453. if let Some(InEvent::E_bottomLeftPressed) = &input {
  454. if f2_guard((*s_P_Alarm, *s_P_Indiglo, *s_P_Display, *s_P_Time, ), ) {
  455. // Exit actions
  456. s_P_ChronoWrapper_Chrono.exit_current(&mut sc.timers, scope, internal, sched, output);
  457. // Transition's actions
  458. (output)(OutEvent::E_resetChrono);
  459. internal.raise().e_int_refresh_chrono = Some(Event_int_refresh_chrono{});
  460. // Enter actions
  461. State_P_ChronoWrapper_Chrono::enter_actions(&mut sc.timers, scope, internal, sched, output);
  462. State_P_ChronoWrapper_Chrono_Stopped::enter_default(&mut sc.timers, scope, internal, sched, output);
  463. // Build new state configuration
  464. let new_s_P_ChronoWrapper_Chrono_Stopped: State_P_ChronoWrapper_Chrono_Stopped = Default::default();
  465. let new_s_P_ChronoWrapper_Chrono = State_P_ChronoWrapper_Chrono::S_Stopped(new_s_P_ChronoWrapper_Chrono_Stopped);
  466. let new_s_P_ChronoWrapper = State_P_ChronoWrapper::S_Chrono(new_s_P_ChronoWrapper_Chrono);
  467. // Update arena configuration
  468. *s_P_ChronoWrapper = new_s_P_ChronoWrapper;
  469. fired |= ARENA_P_ChronoWrapper; // Stable target
  470. // Internal Event Lifeline: Next Small Step
  471. internal.cycle();
  472. break 'arena_P_ChronoWrapper;
  473. }
  474. }
  475. if (fired | dirty) & ARENA_P_ChronoWrapper_Chrono == ARENA_NONE {
  476. 'arena_P_ChronoWrapper_Chrono: loop {
  477. match *s_P_ChronoWrapper_Chrono {
  478. State_P_ChronoWrapper_Chrono::S_Stopped(ref mut s_P_ChronoWrapper_Chrono_Stopped) => {
  479. // Outgoing transition 0
  480. if let Some(InEvent::E_bottomRightPressed) = &input {
  481. if f3_guard((*s_P_Alarm, *s_P_Indiglo, *s_P_Display, *s_P_Time, ), ) {
  482. // Exit actions
  483. s_P_ChronoWrapper_Chrono_Stopped.exit_current(&mut sc.timers, scope, internal, sched, output);
  484. // Enter actions
  485. State_P_ChronoWrapper_Chrono_Running::enter_default(&mut sc.timers, scope, internal, sched, output);
  486. // Build new state configuration
  487. let new_s_P_ChronoWrapper_Chrono_Running: State_P_ChronoWrapper_Chrono_Running = Default::default();
  488. let new_s_P_ChronoWrapper_Chrono = State_P_ChronoWrapper_Chrono::S_Running(new_s_P_ChronoWrapper_Chrono_Running);
  489. // Update arena configuration
  490. *s_P_ChronoWrapper_Chrono = new_s_P_ChronoWrapper_Chrono;
  491. fired |= ARENA_P_ChronoWrapper_Chrono; // Stable target
  492. // Internal Event Lifeline: Next Small Step
  493. internal.cycle();
  494. break 'arena_P_ChronoWrapper_Chrono;
  495. }
  496. }
  497. },
  498. State_P_ChronoWrapper_Chrono::S_Running(ref mut s_P_ChronoWrapper_Chrono_Running) => {
  499. // Outgoing transition 0
  500. // A transition may have fired earlier that overlaps with our arena:
  501. if fired & (ARENA_P_ChronoWrapper_Chrono) == ARENA_NONE {
  502. if let Some(InEvent::A4) = &input {
  503. // Exit actions
  504. s_P_ChronoWrapper_Chrono_Running.exit_current(&mut sc.timers, scope, internal, sched, output);
  505. // Transition's actions
  506. (output)(OutEvent::E_increaseChronoByOne);
  507. internal.raise().e_int_refresh_chrono = Some(Event_int_refresh_chrono{});
  508. // Enter actions
  509. State_P_ChronoWrapper_Chrono_Running::enter_default(&mut sc.timers, scope, internal, sched, output);
  510. // Build new state configuration
  511. let new_s_P_ChronoWrapper_Chrono_Running: State_P_ChronoWrapper_Chrono_Running = Default::default();
  512. let new_s_P_ChronoWrapper_Chrono = State_P_ChronoWrapper_Chrono::S_Running(new_s_P_ChronoWrapper_Chrono_Running);
  513. // Update arena configuration
  514. *s_P_ChronoWrapper_Chrono = new_s_P_ChronoWrapper_Chrono;
  515. fired |= ARENA_P_ChronoWrapper_Chrono; // Stable target
  516. // Internal Event Lifeline: Next Small Step
  517. internal.cycle();
  518. break 'arena_P_ChronoWrapper_Chrono;
  519. }
  520. }
  521. // Outgoing transition 1
  522. // A transition may have fired earlier that overlaps with our arena:
  523. if fired & (ARENA_P_ChronoWrapper_Chrono) == ARENA_NONE {
  524. if let Some(InEvent::E_bottomRightPressed) = &input {
  525. if f4_guard((*s_P_Alarm, *s_P_Indiglo, *s_P_Display, *s_P_Time, ), ) {
  526. // Exit actions
  527. s_P_ChronoWrapper_Chrono_Running.exit_current(&mut sc.timers, scope, internal, sched, output);
  528. // Enter actions
  529. State_P_ChronoWrapper_Chrono_Stopped::enter_default(&mut sc.timers, scope, internal, sched, output);
  530. // Build new state configuration
  531. let new_s_P_ChronoWrapper_Chrono_Stopped: State_P_ChronoWrapper_Chrono_Stopped = Default::default();
  532. let new_s_P_ChronoWrapper_Chrono = State_P_ChronoWrapper_Chrono::S_Stopped(new_s_P_ChronoWrapper_Chrono_Stopped);
  533. // Update arena configuration
  534. *s_P_ChronoWrapper_Chrono = new_s_P_ChronoWrapper_Chrono;
  535. fired |= ARENA_P_ChronoWrapper_Chrono; // Stable target
  536. // Internal Event Lifeline: Next Small Step
  537. internal.cycle();
  538. break 'arena_P_ChronoWrapper_Chrono;
  539. }
  540. }
  541. }
  542. },
  543. };
  544. break;
  545. }
  546. }
  547. },
  548. };
  549. break;
  550. }
  551. }
  552. // Orthogonal region
  553. if (fired | dirty) & ARENA_P_Display == ARENA_NONE {
  554. 'arena_P_Display: loop {
  555. match *s_P_Display {
  556. State_P_Display::S_TimeUpdate(ref mut s_P_Display_TimeUpdate) => {
  557. // Outgoing transition 0
  558. if let Some(Event_int_refresh_time) = &internal.current().e_int_refresh_time {
  559. // Exit actions
  560. s_P_Display_TimeUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  561. // Enter actions
  562. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  563. // Build new state configuration
  564. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  565. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  566. // Update arena configuration
  567. *s_P_Display = new_s_P_Display;
  568. fired |= ARENA_P_Display; // Stable target
  569. // Internal Event Lifeline: Next Small Step
  570. internal.cycle();
  571. break 'arena_P_Display;
  572. }
  573. // Outgoing transition 1
  574. // A transition may have fired earlier that overlaps with our arena:
  575. if fired & (ARENA_P_Display) == ARENA_NONE {
  576. if let Some(InEvent::E_topLeftPressed) = &input {
  577. // Exit actions
  578. s_P_Display_TimeUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  579. // Enter actions
  580. State_P_Display_ChronoUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  581. // Build new state configuration
  582. let new_s_P_Display_ChronoUpdate: State_P_Display_ChronoUpdate = Default::default();
  583. let new_s_P_Display = State_P_Display::S_ChronoUpdate(new_s_P_Display_ChronoUpdate);
  584. // Update arena configuration
  585. *s_P_Display = new_s_P_Display;
  586. fired |= ARENA_P_Display; // Stable target
  587. // Internal Event Lifeline: Next Small Step
  588. internal.cycle();
  589. break 'arena_P_Display;
  590. }
  591. }
  592. // Outgoing transition 2
  593. // A transition may have fired earlier that overlaps with our arena:
  594. if fired & (ARENA_P_Display) == ARENA_NONE {
  595. if let Some(InEvent::E_bottomRightPressed) = &input {
  596. // Exit actions
  597. s_P_Display_TimeUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  598. // Enter actions
  599. State_P_Display_WaitingToEdit::enter_default(&mut sc.timers, scope, internal, sched, output);
  600. // Build new state configuration
  601. let new_s_P_Display_WaitingToEdit: State_P_Display_WaitingToEdit = Default::default();
  602. let new_s_P_Display = State_P_Display::S_WaitingToEdit(new_s_P_Display_WaitingToEdit);
  603. // Update arena configuration
  604. *s_P_Display = new_s_P_Display;
  605. fired |= ARENA_P_Display; // Stable target
  606. // Internal Event Lifeline: Next Small Step
  607. internal.cycle();
  608. break 'arena_P_Display;
  609. }
  610. }
  611. // Outgoing transition 3
  612. // A transition may have fired earlier that overlaps with our arena:
  613. if fired & (ARENA_P_Display) == ARENA_NONE {
  614. if let Some(InEvent::E_bottomLeftPressed) = &input {
  615. // Exit actions
  616. s_P_Display_TimeUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  617. // Enter actions
  618. State_P_Display_WaitingForAlarm::enter_default(&mut sc.timers, scope, internal, sched, output);
  619. // Build new state configuration
  620. let new_s_P_Display_WaitingForAlarm: State_P_Display_WaitingForAlarm = Default::default();
  621. let new_s_P_Display = State_P_Display::S_WaitingForAlarm(new_s_P_Display_WaitingForAlarm);
  622. // Update arena configuration
  623. *s_P_Display = new_s_P_Display;
  624. fired |= ARENA_P_Display; // Stable target
  625. // Internal Event Lifeline: Next Small Step
  626. internal.cycle();
  627. break 'arena_P_Display;
  628. }
  629. }
  630. },
  631. State_P_Display::S_WaitingToEdit(ref mut s_P_Display_WaitingToEdit) => {
  632. // Outgoing transition 0
  633. // A transition may have fired earlier that overlaps with our arena:
  634. if fired & (ARENA_P_Display) == ARENA_NONE {
  635. if let Some(InEvent::A5) = &input {
  636. // Exit actions
  637. s_P_Display_WaitingToEdit.exit_current(&mut sc.timers, scope, internal, sched, output);
  638. // Enter actions
  639. State_P_Display_EditingTime::enter_default(&mut sc.timers, scope, internal, sched, output);
  640. // Build new state configuration
  641. let new_s_P_Display_EditingTime: State_P_Display_EditingTime = Default::default();
  642. let new_s_P_Display = State_P_Display::S_EditingTime(new_s_P_Display_EditingTime);
  643. // Update arena configuration
  644. *s_P_Display = new_s_P_Display;
  645. fired |= ARENA_P_Display; // Stable target
  646. // Internal Event Lifeline: Next Small Step
  647. internal.cycle();
  648. break 'arena_P_Display;
  649. }
  650. }
  651. // Outgoing transition 1
  652. // A transition may have fired earlier that overlaps with our arena:
  653. if fired & (ARENA_P_Display) == ARENA_NONE {
  654. if let Some(InEvent::E_bottomRightReleased) = &input {
  655. // Exit actions
  656. s_P_Display_WaitingToEdit.exit_current(&mut sc.timers, scope, internal, sched, output);
  657. // Enter actions
  658. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  659. // Build new state configuration
  660. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  661. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  662. // Update arena configuration
  663. *s_P_Display = new_s_P_Display;
  664. fired |= ARENA_P_Display; // Stable target
  665. // Internal Event Lifeline: Next Small Step
  666. internal.cycle();
  667. break 'arena_P_Display;
  668. }
  669. }
  670. },
  671. State_P_Display::S_WaitingForAlarm(ref mut s_P_Display_WaitingForAlarm) => {
  672. // Outgoing transition 0
  673. // A transition may have fired earlier that overlaps with our arena:
  674. if fired & (ARENA_P_Display) == ARENA_NONE {
  675. if let Some(InEvent::A6) = &input {
  676. // Exit actions
  677. s_P_Display_WaitingForAlarm.exit_current(&mut sc.timers, scope, internal, sched, output);
  678. // Transition's actions
  679. internal.raise().e_alarm_edit = Some(Event_alarm_edit{});
  680. // Enter actions
  681. State_P_Display_EditingTime::enter_default(&mut sc.timers, scope, internal, sched, output);
  682. // Build new state configuration
  683. let new_s_P_Display_EditingTime: State_P_Display_EditingTime = Default::default();
  684. let new_s_P_Display = State_P_Display::S_EditingTime(new_s_P_Display_EditingTime);
  685. // Update arena configuration
  686. *s_P_Display = new_s_P_Display;
  687. fired |= ARENA_P_Display; // Stable target
  688. // Internal Event Lifeline: Next Small Step
  689. internal.cycle();
  690. break 'arena_P_Display;
  691. }
  692. }
  693. // Outgoing transition 1
  694. // A transition may have fired earlier that overlaps with our arena:
  695. if fired & (ARENA_P_Display) == ARENA_NONE {
  696. if let Some(InEvent::E_bottomLeftReleased) = &input {
  697. // Exit actions
  698. s_P_Display_WaitingForAlarm.exit_current(&mut sc.timers, scope, internal, sched, output);
  699. // Enter actions
  700. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  701. // Build new state configuration
  702. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  703. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  704. // Update arena configuration
  705. *s_P_Display = new_s_P_Display;
  706. fired |= ARENA_P_Display; // Stable target
  707. // Internal Event Lifeline: Next Small Step
  708. internal.cycle();
  709. break 'arena_P_Display;
  710. }
  711. }
  712. },
  713. State_P_Display::S_EditingTime(ref mut s_P_Display_EditingTime) => {
  714. if (fired | dirty) & ARENA_P_Display_EditingTime == ARENA_NONE {
  715. 'arena_P_Display_EditingTime: loop {
  716. match *s_P_Display_EditingTime {
  717. State_P_Display_EditingTime::S_Waiting(ref mut s_P_Display_EditingTime_Waiting) => {
  718. // Outgoing transition 0
  719. if let Some(InEvent::E_bottomLeftPressed) = &input {
  720. // Exit actions
  721. s_P_Display_EditingTime_Waiting.exit_current(&mut sc.timers, scope, internal, sched, output);
  722. // Enter actions
  723. State_P_Display_EditingTime_Increasing::enter_default(&mut sc.timers, scope, internal, sched, output);
  724. // Build new state configuration
  725. let new_s_P_Display_EditingTime_Increasing: State_P_Display_EditingTime_Increasing = Default::default();
  726. let new_s_P_Display_EditingTime = State_P_Display_EditingTime::S_Increasing(new_s_P_Display_EditingTime_Increasing);
  727. // Update arena configuration
  728. *s_P_Display_EditingTime = new_s_P_Display_EditingTime;
  729. fired |= ARENA_P_Display_EditingTime; // Stable target
  730. // Internal Event Lifeline: Next Small Step
  731. internal.cycle();
  732. break 'arena_P_Display_EditingTime;
  733. }
  734. // Outgoing transition 1
  735. // A transition may have fired earlier that overlaps with our arena:
  736. if fired & (ARENA_P_Display_EditingTime) == ARENA_NONE {
  737. if let Some(InEvent::E_bottomRightPressed) = &input {
  738. // Exit actions
  739. s_P_Display_EditingTime_Waiting.exit_current(&mut sc.timers, scope, internal, sched, output);
  740. // Enter actions
  741. State_P_Display_EditingTime_GoingToNext::enter_default(&mut sc.timers, scope, internal, sched, output);
  742. // Build new state configuration
  743. let new_s_P_Display_EditingTime_GoingToNext: State_P_Display_EditingTime_GoingToNext = Default::default();
  744. let new_s_P_Display_EditingTime = State_P_Display_EditingTime::S_GoingToNext(new_s_P_Display_EditingTime_GoingToNext);
  745. // Update arena configuration
  746. *s_P_Display_EditingTime = new_s_P_Display_EditingTime;
  747. fired |= ARENA_P_Display_EditingTime; // Stable target
  748. // Internal Event Lifeline: Next Small Step
  749. internal.cycle();
  750. break 'arena_P_Display_EditingTime;
  751. }
  752. }
  753. // Outgoing transition 2
  754. // A transition may have fired earlier that overlaps with our arena:
  755. if fired & (ARENA_P_Display) == ARENA_NONE {
  756. if let Some(InEvent::A7) = &input {
  757. // Exit actions
  758. s_P_Display_EditingTime_Waiting.exit_current(&mut sc.timers, scope, internal, sched, output);
  759. State_P_Display_EditingTime::exit_actions(&mut sc.timers, scope, internal, sched, output);
  760. // Enter actions
  761. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  762. // Build new state configuration
  763. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  764. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  765. // Update arena configuration
  766. *s_P_Display = new_s_P_Display;
  767. fired |= ARENA_P_Display; // Stable target
  768. // Internal Event Lifeline: Next Small Step
  769. internal.cycle();
  770. break 'arena_P_Display;
  771. }
  772. }
  773. },
  774. State_P_Display_EditingTime::S_GoingToNext(ref mut s_P_Display_EditingTime_GoingToNext) => {
  775. // Outgoing transition 0
  776. // A transition may have fired earlier that overlaps with our arena:
  777. if fired & (ARENA_P_Display_EditingTime) == ARENA_NONE {
  778. if let Some(InEvent::E_bottomRightReleased) = &input {
  779. // Exit actions
  780. s_P_Display_EditingTime_GoingToNext.exit_current(&mut sc.timers, scope, internal, sched, output);
  781. // Transition's actions
  782. (output)(OutEvent::E_selectNext);
  783. // Enter actions
  784. State_P_Display_EditingTime_Waiting::enter_default(&mut sc.timers, scope, internal, sched, output);
  785. // Build new state configuration
  786. let new_s_P_Display_EditingTime_Waiting: State_P_Display_EditingTime_Waiting = Default::default();
  787. let new_s_P_Display_EditingTime = State_P_Display_EditingTime::S_Waiting(new_s_P_Display_EditingTime_Waiting);
  788. // Update arena configuration
  789. *s_P_Display_EditingTime = new_s_P_Display_EditingTime;
  790. fired |= ARENA_P_Display_EditingTime; // Stable target
  791. // Internal Event Lifeline: Next Small Step
  792. internal.cycle();
  793. break 'arena_P_Display_EditingTime;
  794. }
  795. }
  796. // Outgoing transition 1
  797. // A transition may have fired earlier that overlaps with our arena:
  798. if fired & (ARENA_P_Display) == ARENA_NONE {
  799. if let Some(InEvent::A8) = &input {
  800. // Exit actions
  801. s_P_Display_EditingTime_GoingToNext.exit_current(&mut sc.timers, scope, internal, sched, output);
  802. State_P_Display_EditingTime::exit_actions(&mut sc.timers, scope, internal, sched, output);
  803. // Enter actions
  804. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  805. // Build new state configuration
  806. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  807. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  808. // Update arena configuration
  809. *s_P_Display = new_s_P_Display;
  810. fired |= ARENA_P_Display; // Stable target
  811. // Internal Event Lifeline: Next Small Step
  812. internal.cycle();
  813. break 'arena_P_Display;
  814. }
  815. }
  816. },
  817. State_P_Display_EditingTime::S_Increasing(ref mut s_P_Display_EditingTime_Increasing) => {
  818. // Outgoing transition 0
  819. // A transition may have fired earlier that overlaps with our arena:
  820. if fired & (ARENA_P_Display_EditingTime) == ARENA_NONE {
  821. if let Some(InEvent::A9) = &input {
  822. // Exit actions
  823. s_P_Display_EditingTime_Increasing.exit_current(&mut sc.timers, scope, internal, sched, output);
  824. // Enter actions
  825. State_P_Display_EditingTime_Increasing::enter_default(&mut sc.timers, scope, internal, sched, output);
  826. // Build new state configuration
  827. let new_s_P_Display_EditingTime_Increasing: State_P_Display_EditingTime_Increasing = Default::default();
  828. let new_s_P_Display_EditingTime = State_P_Display_EditingTime::S_Increasing(new_s_P_Display_EditingTime_Increasing);
  829. // Update arena configuration
  830. *s_P_Display_EditingTime = new_s_P_Display_EditingTime;
  831. fired |= ARENA_P_Display_EditingTime; // Stable target
  832. // Internal Event Lifeline: Next Small Step
  833. internal.cycle();
  834. break 'arena_P_Display_EditingTime;
  835. }
  836. }
  837. // Outgoing transition 1
  838. // A transition may have fired earlier that overlaps with our arena:
  839. if fired & (ARENA_P_Display_EditingTime) == ARENA_NONE {
  840. if let Some(InEvent::E_bottomLeftReleased) = &input {
  841. // Exit actions
  842. s_P_Display_EditingTime_Increasing.exit_current(&mut sc.timers, scope, internal, sched, output);
  843. // Enter actions
  844. State_P_Display_EditingTime_Waiting::enter_default(&mut sc.timers, scope, internal, sched, output);
  845. // Build new state configuration
  846. let new_s_P_Display_EditingTime_Waiting: State_P_Display_EditingTime_Waiting = Default::default();
  847. let new_s_P_Display_EditingTime = State_P_Display_EditingTime::S_Waiting(new_s_P_Display_EditingTime_Waiting);
  848. // Update arena configuration
  849. *s_P_Display_EditingTime = new_s_P_Display_EditingTime;
  850. fired |= ARENA_P_Display_EditingTime; // Stable target
  851. // Internal Event Lifeline: Next Small Step
  852. internal.cycle();
  853. break 'arena_P_Display_EditingTime;
  854. }
  855. }
  856. },
  857. };
  858. break;
  859. }
  860. }
  861. },
  862. State_P_Display::S_ChronoUpdate(ref mut s_P_Display_ChronoUpdate) => {
  863. // Outgoing transition 0
  864. // A transition may have fired earlier that overlaps with our arena:
  865. if fired & (ARENA_P_Display) == ARENA_NONE {
  866. if let Some(InEvent::E_topLeftPressed) = &input {
  867. // Exit actions
  868. s_P_Display_ChronoUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  869. // Enter actions
  870. State_P_Display_TimeUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  871. // Build new state configuration
  872. let new_s_P_Display_TimeUpdate: State_P_Display_TimeUpdate = Default::default();
  873. let new_s_P_Display = State_P_Display::S_TimeUpdate(new_s_P_Display_TimeUpdate);
  874. // Update arena configuration
  875. *s_P_Display = new_s_P_Display;
  876. fired |= ARENA_P_Display; // Stable target
  877. // Internal Event Lifeline: Next Small Step
  878. internal.cycle();
  879. break 'arena_P_Display;
  880. }
  881. }
  882. // Outgoing transition 1
  883. // A transition may have fired earlier that overlaps with our arena:
  884. if fired & (ARENA_P_Display) == ARENA_NONE {
  885. if let Some(Event_int_refresh_chrono) = &internal.current().e_int_refresh_chrono {
  886. // Exit actions
  887. s_P_Display_ChronoUpdate.exit_current(&mut sc.timers, scope, internal, sched, output);
  888. // Enter actions
  889. State_P_Display_ChronoUpdate::enter_default(&mut sc.timers, scope, internal, sched, output);
  890. // Build new state configuration
  891. let new_s_P_Display_ChronoUpdate: State_P_Display_ChronoUpdate = Default::default();
  892. let new_s_P_Display = State_P_Display::S_ChronoUpdate(new_s_P_Display_ChronoUpdate);
  893. // Update arena configuration
  894. *s_P_Display = new_s_P_Display;
  895. fired |= ARENA_P_Display; // Stable target
  896. // Internal Event Lifeline: Next Small Step
  897. internal.cycle();
  898. break 'arena_P_Display;
  899. }
  900. }
  901. },
  902. };
  903. break;
  904. }
  905. }
  906. // Orthogonal region
  907. if (fired | dirty) & ARENA_P_Time == ARENA_NONE {
  908. 'arena_P_Time: loop {
  909. match *s_P_Time {
  910. State_P_Time::S_Increasing(ref mut s_P_Time_Increasing) => {
  911. // Outgoing transition 0
  912. if let Some(InEvent::A10) = &input {
  913. // Exit actions
  914. s_P_Time_Increasing.exit_current(&mut sc.timers, scope, internal, sched, output);
  915. // Transition's actions
  916. (output)(OutEvent::E_increaseTimeByOne);
  917. (output)(OutEvent::E_checkTime);
  918. internal.raise().e_int_refresh_time = Some(Event_int_refresh_time{});
  919. // Enter actions
  920. State_P_Time_Increasing::enter_default(&mut sc.timers, scope, internal, sched, output);
  921. // Build new state configuration
  922. let new_s_P_Time_Increasing: State_P_Time_Increasing = Default::default();
  923. let new_s_P_Time = State_P_Time::S_Increasing(new_s_P_Time_Increasing);
  924. // Update arena configuration
  925. *s_P_Time = new_s_P_Time;
  926. fired |= ARENA_P_Time; // Stable target
  927. // Internal Event Lifeline: Next Small Step
  928. internal.cycle();
  929. break 'arena_P_Time;
  930. }
  931. // Outgoing transition 1
  932. // A transition may have fired earlier that overlaps with our arena:
  933. if fired & (ARENA_P_Time) == ARENA_NONE {
  934. if let Some(Event_time_edit) = &internal.current().e_time_edit {
  935. // Exit actions
  936. s_P_Time_Increasing.exit_current(&mut sc.timers, scope, internal, sched, output);
  937. // Enter actions
  938. State_P_Time_Editing::enter_default(&mut sc.timers, scope, internal, sched, output);
  939. // Build new state configuration
  940. let new_s_P_Time_Editing: State_P_Time_Editing = Default::default();
  941. let new_s_P_Time = State_P_Time::S_Editing(new_s_P_Time_Editing);
  942. // Update arena configuration
  943. *s_P_Time = new_s_P_Time;
  944. fired |= ARENA_P_Time; // Stable target
  945. // Internal Event Lifeline: Next Small Step
  946. internal.cycle();
  947. break 'arena_P_Time;
  948. }
  949. }
  950. },
  951. State_P_Time::S_Editing(ref mut s_P_Time_Editing) => {
  952. // Outgoing transition 0
  953. // A transition may have fired earlier that overlaps with our arena:
  954. if fired & (ARENA_P_Time) == ARENA_NONE {
  955. if let Some(Event_edit_done) = &internal.current().e_edit_done {
  956. // Exit actions
  957. s_P_Time_Editing.exit_current(&mut sc.timers, scope, internal, sched, output);
  958. // Enter actions
  959. State_P_Time_Increasing::enter_default(&mut sc.timers, scope, internal, sched, output);
  960. // Build new state configuration
  961. let new_s_P_Time_Increasing: State_P_Time_Increasing = Default::default();
  962. let new_s_P_Time = State_P_Time::S_Increasing(new_s_P_Time_Increasing);
  963. // Update arena configuration
  964. *s_P_Time = new_s_P_Time;
  965. fired |= ARENA_P_Time; // Stable target
  966. // Internal Event Lifeline: Next Small Step
  967. internal.cycle();
  968. break 'arena_P_Time;
  969. }
  970. }
  971. },
  972. };
  973. break;
  974. }
  975. }
  976. },
  977. };
  978. break;
  979. }
  980. fired
  981. }
  982. fn combo_step<Sched: statechart::Scheduler<InEvent=InEvent>>(sc: &mut Statechart<Sched>, input: &mut Option<InEvent>, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent), dirty: Arenas) -> Arenas {
  983. // Combo-Step Maximality: TAKE_ONE
  984. fair_step(sc, input, internal, sched, output, dirty)
  985. }
  986. fn big_step<Sched: statechart::Scheduler<InEvent=InEvent>>(sc: &mut Statechart<Sched>, input: &mut Option<InEvent>, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent), dirty: Arenas) -> Arenas {
  987. // Big-Step Maximality: TAKE_ONE
  988. combo_step(sc, input, internal, sched, output, dirty)
  989. }
  990. impl<Sched: statechart::Scheduler<InEvent=InEvent>> statechart::SC for Statechart<Sched> {
  991. type InEvent = InEvent;
  992. type OutEvent = OutEvent;
  993. type Sched = Sched;
  994. fn init(&mut self, sched: &mut Self::Sched, output: &mut impl FnMut(Self::OutEvent)) {
  995. Root::enter_default(&mut self.timers, &mut self.data, &mut Default::default(), sched, output)
  996. }
  997. fn big_step(&mut self, mut input: Option<InEvent>, sched: &mut Self::Sched, output: &mut impl FnMut(Self::OutEvent)) {
  998. let mut internal: InternalLifeline = Default::default();
  999. big_step(self, &mut input, &mut internal, sched, output, ARENA_NONE);
  1000. }
  1001. }
  1002. // And-state
  1003. #[derive(Default, Copy, Clone)]
  1004. struct State_P_Alarm_Off {
  1005. }
  1006. impl State_P_Alarm_Off {
  1007. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1008. let scope = data;
  1009. }
  1010. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1011. let scope = data;
  1012. }
  1013. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1014. State_P_Alarm_Off::enter_actions(timers, data, internal, sched, output);
  1015. }
  1016. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1017. State_P_Alarm_Off::exit_actions(timers, data, internal, sched, output);
  1018. }
  1019. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1020. State_P_Alarm_Off::enter_actions(timers, data, internal, sched, output);
  1021. }
  1022. }
  1023. // And-state
  1024. #[derive(Default, Copy, Clone)]
  1025. struct State_P_Alarm_On_NotBlinking {
  1026. }
  1027. impl State_P_Alarm_On_NotBlinking {
  1028. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1029. let scope = data;
  1030. }
  1031. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1032. let scope = data;
  1033. }
  1034. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1035. State_P_Alarm_On_NotBlinking::enter_actions(timers, data, internal, sched, output);
  1036. }
  1037. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1038. State_P_Alarm_On_NotBlinking::exit_actions(timers, data, internal, sched, output);
  1039. }
  1040. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1041. State_P_Alarm_On_NotBlinking::enter_actions(timers, data, internal, sched, output);
  1042. }
  1043. }
  1044. // And-state
  1045. #[derive(Default, Copy, Clone)]
  1046. struct State_P_Alarm_On_Blinking_On {
  1047. }
  1048. impl State_P_Alarm_On_Blinking_On {
  1049. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1050. let scope = data;
  1051. (output)(OutEvent::E_setIndiglo);
  1052. timers[0] = sched.set_timeout(500, InEvent::A0);
  1053. }
  1054. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1055. let scope = data;
  1056. sched.unset_timeout(&timers[0]);
  1057. (output)(OutEvent::E_unsetIndiglo);
  1058. }
  1059. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1060. State_P_Alarm_On_Blinking_On::enter_actions(timers, data, internal, sched, output);
  1061. }
  1062. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1063. State_P_Alarm_On_Blinking_On::exit_actions(timers, data, internal, sched, output);
  1064. }
  1065. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1066. State_P_Alarm_On_Blinking_On::enter_actions(timers, data, internal, sched, output);
  1067. }
  1068. }
  1069. // And-state
  1070. #[derive(Default, Copy, Clone)]
  1071. struct State_P_Alarm_On_Blinking_Off {
  1072. }
  1073. impl State_P_Alarm_On_Blinking_Off {
  1074. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1075. let scope = data;
  1076. timers[1] = sched.set_timeout(500, InEvent::A1);
  1077. }
  1078. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1079. let scope = data;
  1080. sched.unset_timeout(&timers[1]);
  1081. }
  1082. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1083. State_P_Alarm_On_Blinking_Off::enter_actions(timers, data, internal, sched, output);
  1084. }
  1085. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1086. State_P_Alarm_On_Blinking_Off::exit_actions(timers, data, internal, sched, output);
  1087. }
  1088. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1089. State_P_Alarm_On_Blinking_Off::enter_actions(timers, data, internal, sched, output);
  1090. }
  1091. }
  1092. // Or-state
  1093. #[derive(Copy, Clone)]
  1094. enum State_P_Alarm_On_Blinking {
  1095. S_On(State_P_Alarm_On_Blinking_On),
  1096. S_Off(State_P_Alarm_On_Blinking_Off),
  1097. }
  1098. impl Default for State_P_Alarm_On_Blinking {
  1099. fn default() -> Self {
  1100. Self::S_On(Default::default())
  1101. }
  1102. }
  1103. impl State_P_Alarm_On_Blinking {
  1104. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1105. let scope = data;
  1106. timers[2] = sched.set_timeout(4000, InEvent::A2);
  1107. }
  1108. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1109. let scope = data;
  1110. sched.unset_timeout(&timers[2]);
  1111. }
  1112. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1113. State_P_Alarm_On_Blinking::enter_actions(timers, data, internal, sched, output);
  1114. State_P_Alarm_On_Blinking_On::enter_default(timers, data, internal, sched, output);
  1115. }
  1116. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1117. match self {
  1118. Self::S_On(s) => { s.exit_current(timers, data, internal, sched, output); },
  1119. Self::S_Off(s) => { s.exit_current(timers, data, internal, sched, output); },
  1120. }
  1121. State_P_Alarm_On_Blinking::exit_actions(timers, data, internal, sched, output);
  1122. }
  1123. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1124. State_P_Alarm_On_Blinking::enter_actions(timers, data, internal, sched, output);
  1125. match self {
  1126. Self::S_On(s) => { s.enter_current(timers, data, internal, sched, output); },
  1127. Self::S_Off(s) => { s.enter_current(timers, data, internal, sched, output); },
  1128. }
  1129. }
  1130. }
  1131. // Or-state
  1132. #[derive(Copy, Clone)]
  1133. enum State_P_Alarm_On {
  1134. S_NotBlinking(State_P_Alarm_On_NotBlinking),
  1135. S_Blinking(State_P_Alarm_On_Blinking),
  1136. }
  1137. impl Default for State_P_Alarm_On {
  1138. fn default() -> Self {
  1139. Self::S_NotBlinking(Default::default())
  1140. }
  1141. }
  1142. impl State_P_Alarm_On {
  1143. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1144. let scope = data;
  1145. (output)(OutEvent::E_setAlarm);
  1146. }
  1147. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1148. let scope = data;
  1149. (output)(OutEvent::E_setAlarm);
  1150. }
  1151. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1152. State_P_Alarm_On::enter_actions(timers, data, internal, sched, output);
  1153. State_P_Alarm_On_NotBlinking::enter_default(timers, data, internal, sched, output);
  1154. }
  1155. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1156. match self {
  1157. Self::S_NotBlinking(s) => { s.exit_current(timers, data, internal, sched, output); },
  1158. Self::S_Blinking(s) => { s.exit_current(timers, data, internal, sched, output); },
  1159. }
  1160. State_P_Alarm_On::exit_actions(timers, data, internal, sched, output);
  1161. }
  1162. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1163. State_P_Alarm_On::enter_actions(timers, data, internal, sched, output);
  1164. match self {
  1165. Self::S_NotBlinking(s) => { s.enter_current(timers, data, internal, sched, output); },
  1166. Self::S_Blinking(s) => { s.enter_current(timers, data, internal, sched, output); },
  1167. }
  1168. }
  1169. }
  1170. // Or-state
  1171. #[derive(Copy, Clone)]
  1172. enum State_P_Alarm {
  1173. S_Off(State_P_Alarm_Off),
  1174. S_On(State_P_Alarm_On),
  1175. }
  1176. impl Default for State_P_Alarm {
  1177. fn default() -> Self {
  1178. Self::S_Off(Default::default())
  1179. }
  1180. }
  1181. impl State_P_Alarm {
  1182. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1183. let scope = data;
  1184. }
  1185. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1186. let scope = data;
  1187. }
  1188. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1189. State_P_Alarm::enter_actions(timers, data, internal, sched, output);
  1190. State_P_Alarm_Off::enter_default(timers, data, internal, sched, output);
  1191. }
  1192. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1193. match self {
  1194. Self::S_Off(s) => { s.exit_current(timers, data, internal, sched, output); },
  1195. Self::S_On(s) => { s.exit_current(timers, data, internal, sched, output); },
  1196. }
  1197. State_P_Alarm::exit_actions(timers, data, internal, sched, output);
  1198. }
  1199. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1200. State_P_Alarm::enter_actions(timers, data, internal, sched, output);
  1201. match self {
  1202. Self::S_Off(s) => { s.enter_current(timers, data, internal, sched, output); },
  1203. Self::S_On(s) => { s.enter_current(timers, data, internal, sched, output); },
  1204. }
  1205. }
  1206. }
  1207. // And-state
  1208. #[derive(Default, Copy, Clone)]
  1209. struct State_P_Indiglo_Off {
  1210. }
  1211. impl State_P_Indiglo_Off {
  1212. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1213. let scope = data;
  1214. }
  1215. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1216. let scope = data;
  1217. }
  1218. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1219. State_P_Indiglo_Off::enter_actions(timers, data, internal, sched, output);
  1220. }
  1221. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1222. State_P_Indiglo_Off::exit_actions(timers, data, internal, sched, output);
  1223. }
  1224. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1225. State_P_Indiglo_Off::enter_actions(timers, data, internal, sched, output);
  1226. }
  1227. }
  1228. // And-state
  1229. #[derive(Default, Copy, Clone)]
  1230. struct State_P_Indiglo_Pushed {
  1231. }
  1232. impl State_P_Indiglo_Pushed {
  1233. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1234. let scope = data;
  1235. }
  1236. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1237. let scope = data;
  1238. }
  1239. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1240. State_P_Indiglo_Pushed::enter_actions(timers, data, internal, sched, output);
  1241. }
  1242. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1243. State_P_Indiglo_Pushed::exit_actions(timers, data, internal, sched, output);
  1244. }
  1245. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1246. State_P_Indiglo_Pushed::enter_actions(timers, data, internal, sched, output);
  1247. }
  1248. }
  1249. // And-state
  1250. #[derive(Default, Copy, Clone)]
  1251. struct State_P_Indiglo_Released {
  1252. }
  1253. impl State_P_Indiglo_Released {
  1254. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1255. let scope = data;
  1256. timers[3] = sched.set_timeout(2000, InEvent::A3);
  1257. }
  1258. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1259. let scope = data;
  1260. sched.unset_timeout(&timers[3]);
  1261. }
  1262. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1263. State_P_Indiglo_Released::enter_actions(timers, data, internal, sched, output);
  1264. }
  1265. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1266. State_P_Indiglo_Released::exit_actions(timers, data, internal, sched, output);
  1267. }
  1268. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1269. State_P_Indiglo_Released::enter_actions(timers, data, internal, sched, output);
  1270. }
  1271. }
  1272. // Or-state
  1273. #[derive(Copy, Clone)]
  1274. enum State_P_Indiglo {
  1275. S_Off(State_P_Indiglo_Off),
  1276. S_Pushed(State_P_Indiglo_Pushed),
  1277. S_Released(State_P_Indiglo_Released),
  1278. }
  1279. impl Default for State_P_Indiglo {
  1280. fn default() -> Self {
  1281. Self::S_Off(Default::default())
  1282. }
  1283. }
  1284. impl State_P_Indiglo {
  1285. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1286. let scope = data;
  1287. }
  1288. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1289. let scope = data;
  1290. }
  1291. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1292. State_P_Indiglo::enter_actions(timers, data, internal, sched, output);
  1293. State_P_Indiglo_Off::enter_default(timers, data, internal, sched, output);
  1294. }
  1295. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1296. match self {
  1297. Self::S_Off(s) => { s.exit_current(timers, data, internal, sched, output); },
  1298. Self::S_Pushed(s) => { s.exit_current(timers, data, internal, sched, output); },
  1299. Self::S_Released(s) => { s.exit_current(timers, data, internal, sched, output); },
  1300. }
  1301. State_P_Indiglo::exit_actions(timers, data, internal, sched, output);
  1302. }
  1303. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1304. State_P_Indiglo::enter_actions(timers, data, internal, sched, output);
  1305. match self {
  1306. Self::S_Off(s) => { s.enter_current(timers, data, internal, sched, output); },
  1307. Self::S_Pushed(s) => { s.enter_current(timers, data, internal, sched, output); },
  1308. Self::S_Released(s) => { s.enter_current(timers, data, internal, sched, output); },
  1309. }
  1310. }
  1311. }
  1312. // And-state
  1313. #[derive(Default, Copy, Clone)]
  1314. struct State_P_ChronoWrapper_Chrono_Stopped {
  1315. }
  1316. impl State_P_ChronoWrapper_Chrono_Stopped {
  1317. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1318. let scope = data;
  1319. }
  1320. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1321. let scope = data;
  1322. }
  1323. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1324. State_P_ChronoWrapper_Chrono_Stopped::enter_actions(timers, data, internal, sched, output);
  1325. }
  1326. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1327. State_P_ChronoWrapper_Chrono_Stopped::exit_actions(timers, data, internal, sched, output);
  1328. }
  1329. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1330. State_P_ChronoWrapper_Chrono_Stopped::enter_actions(timers, data, internal, sched, output);
  1331. }
  1332. }
  1333. // And-state
  1334. #[derive(Default, Copy, Clone)]
  1335. struct State_P_ChronoWrapper_Chrono_Running {
  1336. }
  1337. impl State_P_ChronoWrapper_Chrono_Running {
  1338. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1339. let scope = data;
  1340. timers[4] = sched.set_timeout(10, InEvent::A4);
  1341. }
  1342. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1343. let scope = data;
  1344. sched.unset_timeout(&timers[4]);
  1345. }
  1346. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1347. State_P_ChronoWrapper_Chrono_Running::enter_actions(timers, data, internal, sched, output);
  1348. }
  1349. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1350. State_P_ChronoWrapper_Chrono_Running::exit_actions(timers, data, internal, sched, output);
  1351. }
  1352. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1353. State_P_ChronoWrapper_Chrono_Running::enter_actions(timers, data, internal, sched, output);
  1354. }
  1355. }
  1356. // Or-state
  1357. #[derive(Copy, Clone)]
  1358. enum State_P_ChronoWrapper_Chrono {
  1359. S_Stopped(State_P_ChronoWrapper_Chrono_Stopped),
  1360. S_Running(State_P_ChronoWrapper_Chrono_Running),
  1361. }
  1362. impl Default for State_P_ChronoWrapper_Chrono {
  1363. fn default() -> Self {
  1364. Self::S_Stopped(Default::default())
  1365. }
  1366. }
  1367. impl State_P_ChronoWrapper_Chrono {
  1368. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1369. let scope = data;
  1370. }
  1371. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1372. let scope = data;
  1373. }
  1374. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1375. State_P_ChronoWrapper_Chrono::enter_actions(timers, data, internal, sched, output);
  1376. State_P_ChronoWrapper_Chrono_Stopped::enter_default(timers, data, internal, sched, output);
  1377. }
  1378. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1379. match self {
  1380. Self::S_Stopped(s) => { s.exit_current(timers, data, internal, sched, output); },
  1381. Self::S_Running(s) => { s.exit_current(timers, data, internal, sched, output); },
  1382. }
  1383. State_P_ChronoWrapper_Chrono::exit_actions(timers, data, internal, sched, output);
  1384. }
  1385. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1386. State_P_ChronoWrapper_Chrono::enter_actions(timers, data, internal, sched, output);
  1387. match self {
  1388. Self::S_Stopped(s) => { s.enter_current(timers, data, internal, sched, output); },
  1389. Self::S_Running(s) => { s.enter_current(timers, data, internal, sched, output); },
  1390. }
  1391. }
  1392. }
  1393. // Or-state
  1394. #[derive(Copy, Clone)]
  1395. enum State_P_ChronoWrapper {
  1396. S_Chrono(State_P_ChronoWrapper_Chrono),
  1397. }
  1398. impl Default for State_P_ChronoWrapper {
  1399. fn default() -> Self {
  1400. Self::S_Chrono(Default::default())
  1401. }
  1402. }
  1403. impl State_P_ChronoWrapper {
  1404. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1405. let scope = data;
  1406. }
  1407. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1408. let scope = data;
  1409. }
  1410. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1411. State_P_ChronoWrapper::enter_actions(timers, data, internal, sched, output);
  1412. State_P_ChronoWrapper_Chrono::enter_default(timers, data, internal, sched, output);
  1413. }
  1414. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1415. match self {
  1416. Self::S_Chrono(s) => { s.exit_current(timers, data, internal, sched, output); },
  1417. }
  1418. State_P_ChronoWrapper::exit_actions(timers, data, internal, sched, output);
  1419. }
  1420. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1421. State_P_ChronoWrapper::enter_actions(timers, data, internal, sched, output);
  1422. match self {
  1423. Self::S_Chrono(s) => { s.enter_current(timers, data, internal, sched, output); },
  1424. }
  1425. }
  1426. }
  1427. // And-state
  1428. #[derive(Default, Copy, Clone)]
  1429. struct State_P_Display_TimeUpdate {
  1430. }
  1431. impl State_P_Display_TimeUpdate {
  1432. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1433. let scope = data;
  1434. (output)(OutEvent::E_refreshTimeDisplay);
  1435. }
  1436. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1437. let scope = data;
  1438. }
  1439. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1440. State_P_Display_TimeUpdate::enter_actions(timers, data, internal, sched, output);
  1441. }
  1442. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1443. State_P_Display_TimeUpdate::exit_actions(timers, data, internal, sched, output);
  1444. }
  1445. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1446. State_P_Display_TimeUpdate::enter_actions(timers, data, internal, sched, output);
  1447. }
  1448. }
  1449. // And-state
  1450. #[derive(Default, Copy, Clone)]
  1451. struct State_P_Display_WaitingToEdit {
  1452. }
  1453. impl State_P_Display_WaitingToEdit {
  1454. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1455. let scope = data;
  1456. timers[5] = sched.set_timeout(1500, InEvent::A5);
  1457. }
  1458. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1459. let scope = data;
  1460. sched.unset_timeout(&timers[5]);
  1461. }
  1462. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1463. State_P_Display_WaitingToEdit::enter_actions(timers, data, internal, sched, output);
  1464. }
  1465. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1466. State_P_Display_WaitingToEdit::exit_actions(timers, data, internal, sched, output);
  1467. }
  1468. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1469. State_P_Display_WaitingToEdit::enter_actions(timers, data, internal, sched, output);
  1470. }
  1471. }
  1472. // And-state
  1473. #[derive(Default, Copy, Clone)]
  1474. struct State_P_Display_WaitingForAlarm {
  1475. }
  1476. impl State_P_Display_WaitingForAlarm {
  1477. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1478. let scope = data;
  1479. (output)(OutEvent::E_refreshAlarmDisplay);
  1480. timers[6] = sched.set_timeout(1500, InEvent::A6);
  1481. }
  1482. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1483. let scope = data;
  1484. sched.unset_timeout(&timers[6]);
  1485. }
  1486. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1487. State_P_Display_WaitingForAlarm::enter_actions(timers, data, internal, sched, output);
  1488. }
  1489. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1490. State_P_Display_WaitingForAlarm::exit_actions(timers, data, internal, sched, output);
  1491. }
  1492. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1493. State_P_Display_WaitingForAlarm::enter_actions(timers, data, internal, sched, output);
  1494. }
  1495. }
  1496. // And-state
  1497. #[derive(Default, Copy, Clone)]
  1498. struct State_P_Display_EditingTime_Waiting {
  1499. }
  1500. impl State_P_Display_EditingTime_Waiting {
  1501. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1502. let scope = data;
  1503. timers[7] = sched.set_timeout(5000, InEvent::A7);
  1504. }
  1505. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1506. let scope = data;
  1507. sched.unset_timeout(&timers[7]);
  1508. }
  1509. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1510. State_P_Display_EditingTime_Waiting::enter_actions(timers, data, internal, sched, output);
  1511. }
  1512. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1513. State_P_Display_EditingTime_Waiting::exit_actions(timers, data, internal, sched, output);
  1514. }
  1515. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1516. State_P_Display_EditingTime_Waiting::enter_actions(timers, data, internal, sched, output);
  1517. }
  1518. }
  1519. // And-state
  1520. #[derive(Default, Copy, Clone)]
  1521. struct State_P_Display_EditingTime_GoingToNext {
  1522. }
  1523. impl State_P_Display_EditingTime_GoingToNext {
  1524. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1525. let scope = data;
  1526. timers[8] = sched.set_timeout(2000, InEvent::A8);
  1527. }
  1528. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1529. let scope = data;
  1530. sched.unset_timeout(&timers[8]);
  1531. }
  1532. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1533. State_P_Display_EditingTime_GoingToNext::enter_actions(timers, data, internal, sched, output);
  1534. }
  1535. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1536. State_P_Display_EditingTime_GoingToNext::exit_actions(timers, data, internal, sched, output);
  1537. }
  1538. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1539. State_P_Display_EditingTime_GoingToNext::enter_actions(timers, data, internal, sched, output);
  1540. }
  1541. }
  1542. // And-state
  1543. #[derive(Default, Copy, Clone)]
  1544. struct State_P_Display_EditingTime_Increasing {
  1545. }
  1546. impl State_P_Display_EditingTime_Increasing {
  1547. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1548. let scope = data;
  1549. (output)(OutEvent::E_increaseSelection);
  1550. timers[9] = sched.set_timeout(300, InEvent::A9);
  1551. }
  1552. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1553. let scope = data;
  1554. sched.unset_timeout(&timers[9]);
  1555. }
  1556. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1557. State_P_Display_EditingTime_Increasing::enter_actions(timers, data, internal, sched, output);
  1558. }
  1559. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1560. State_P_Display_EditingTime_Increasing::exit_actions(timers, data, internal, sched, output);
  1561. }
  1562. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1563. State_P_Display_EditingTime_Increasing::enter_actions(timers, data, internal, sched, output);
  1564. }
  1565. }
  1566. // Or-state
  1567. #[derive(Copy, Clone)]
  1568. enum State_P_Display_EditingTime {
  1569. S_Waiting(State_P_Display_EditingTime_Waiting),
  1570. S_GoingToNext(State_P_Display_EditingTime_GoingToNext),
  1571. S_Increasing(State_P_Display_EditingTime_Increasing),
  1572. }
  1573. impl Default for State_P_Display_EditingTime {
  1574. fn default() -> Self {
  1575. Self::S_Waiting(Default::default())
  1576. }
  1577. }
  1578. impl State_P_Display_EditingTime {
  1579. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1580. let scope = data;
  1581. (output)(OutEvent::E_startSelection);
  1582. internal.raise().e_time_edit = Some(Event_time_edit{});
  1583. }
  1584. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1585. let scope = data;
  1586. (output)(OutEvent::E_stopSelection);
  1587. internal.raise().e_edit_done = Some(Event_edit_done{});
  1588. }
  1589. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1590. State_P_Display_EditingTime::enter_actions(timers, data, internal, sched, output);
  1591. State_P_Display_EditingTime_Waiting::enter_default(timers, data, internal, sched, output);
  1592. }
  1593. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1594. match self {
  1595. Self::S_Waiting(s) => { s.exit_current(timers, data, internal, sched, output); },
  1596. Self::S_GoingToNext(s) => { s.exit_current(timers, data, internal, sched, output); },
  1597. Self::S_Increasing(s) => { s.exit_current(timers, data, internal, sched, output); },
  1598. }
  1599. State_P_Display_EditingTime::exit_actions(timers, data, internal, sched, output);
  1600. }
  1601. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1602. State_P_Display_EditingTime::enter_actions(timers, data, internal, sched, output);
  1603. match self {
  1604. Self::S_Waiting(s) => { s.enter_current(timers, data, internal, sched, output); },
  1605. Self::S_GoingToNext(s) => { s.enter_current(timers, data, internal, sched, output); },
  1606. Self::S_Increasing(s) => { s.enter_current(timers, data, internal, sched, output); },
  1607. }
  1608. }
  1609. }
  1610. // And-state
  1611. #[derive(Default, Copy, Clone)]
  1612. struct State_P_Display_ChronoUpdate {
  1613. }
  1614. impl State_P_Display_ChronoUpdate {
  1615. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1616. let scope = data;
  1617. (output)(OutEvent::E_refreshChronoDisplay);
  1618. }
  1619. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1620. let scope = data;
  1621. }
  1622. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1623. State_P_Display_ChronoUpdate::enter_actions(timers, data, internal, sched, output);
  1624. }
  1625. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1626. State_P_Display_ChronoUpdate::exit_actions(timers, data, internal, sched, output);
  1627. }
  1628. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1629. State_P_Display_ChronoUpdate::enter_actions(timers, data, internal, sched, output);
  1630. }
  1631. }
  1632. // Or-state
  1633. #[derive(Copy, Clone)]
  1634. enum State_P_Display {
  1635. S_TimeUpdate(State_P_Display_TimeUpdate),
  1636. S_WaitingToEdit(State_P_Display_WaitingToEdit),
  1637. S_WaitingForAlarm(State_P_Display_WaitingForAlarm),
  1638. S_EditingTime(State_P_Display_EditingTime),
  1639. S_ChronoUpdate(State_P_Display_ChronoUpdate),
  1640. }
  1641. impl Default for State_P_Display {
  1642. fn default() -> Self {
  1643. Self::S_TimeUpdate(Default::default())
  1644. }
  1645. }
  1646. impl State_P_Display {
  1647. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1648. let scope = data;
  1649. }
  1650. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1651. let scope = data;
  1652. }
  1653. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1654. State_P_Display::enter_actions(timers, data, internal, sched, output);
  1655. State_P_Display_TimeUpdate::enter_default(timers, data, internal, sched, output);
  1656. }
  1657. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1658. match self {
  1659. Self::S_TimeUpdate(s) => { s.exit_current(timers, data, internal, sched, output); },
  1660. Self::S_WaitingToEdit(s) => { s.exit_current(timers, data, internal, sched, output); },
  1661. Self::S_WaitingForAlarm(s) => { s.exit_current(timers, data, internal, sched, output); },
  1662. Self::S_EditingTime(s) => { s.exit_current(timers, data, internal, sched, output); },
  1663. Self::S_ChronoUpdate(s) => { s.exit_current(timers, data, internal, sched, output); },
  1664. }
  1665. State_P_Display::exit_actions(timers, data, internal, sched, output);
  1666. }
  1667. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1668. State_P_Display::enter_actions(timers, data, internal, sched, output);
  1669. match self {
  1670. Self::S_TimeUpdate(s) => { s.enter_current(timers, data, internal, sched, output); },
  1671. Self::S_WaitingToEdit(s) => { s.enter_current(timers, data, internal, sched, output); },
  1672. Self::S_WaitingForAlarm(s) => { s.enter_current(timers, data, internal, sched, output); },
  1673. Self::S_EditingTime(s) => { s.enter_current(timers, data, internal, sched, output); },
  1674. Self::S_ChronoUpdate(s) => { s.enter_current(timers, data, internal, sched, output); },
  1675. }
  1676. }
  1677. }
  1678. // And-state
  1679. #[derive(Default, Copy, Clone)]
  1680. struct State_P_Time_Increasing {
  1681. }
  1682. impl State_P_Time_Increasing {
  1683. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1684. let scope = data;
  1685. timers[10] = sched.set_timeout(1000, InEvent::A10);
  1686. }
  1687. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1688. let scope = data;
  1689. sched.unset_timeout(&timers[10]);
  1690. }
  1691. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1692. State_P_Time_Increasing::enter_actions(timers, data, internal, sched, output);
  1693. }
  1694. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1695. State_P_Time_Increasing::exit_actions(timers, data, internal, sched, output);
  1696. }
  1697. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1698. State_P_Time_Increasing::enter_actions(timers, data, internal, sched, output);
  1699. }
  1700. }
  1701. // And-state
  1702. #[derive(Default, Copy, Clone)]
  1703. struct State_P_Time_Editing {
  1704. }
  1705. impl State_P_Time_Editing {
  1706. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1707. let scope = data;
  1708. }
  1709. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1710. let scope = data;
  1711. }
  1712. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1713. State_P_Time_Editing::enter_actions(timers, data, internal, sched, output);
  1714. }
  1715. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1716. State_P_Time_Editing::exit_actions(timers, data, internal, sched, output);
  1717. }
  1718. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1719. State_P_Time_Editing::enter_actions(timers, data, internal, sched, output);
  1720. }
  1721. }
  1722. // Or-state
  1723. #[derive(Copy, Clone)]
  1724. enum State_P_Time {
  1725. S_Increasing(State_P_Time_Increasing),
  1726. S_Editing(State_P_Time_Editing),
  1727. }
  1728. impl Default for State_P_Time {
  1729. fn default() -> Self {
  1730. Self::S_Increasing(Default::default())
  1731. }
  1732. }
  1733. impl State_P_Time {
  1734. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1735. let scope = data;
  1736. }
  1737. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1738. let scope = data;
  1739. }
  1740. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1741. State_P_Time::enter_actions(timers, data, internal, sched, output);
  1742. State_P_Time_Increasing::enter_default(timers, data, internal, sched, output);
  1743. }
  1744. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1745. match self {
  1746. Self::S_Increasing(s) => { s.exit_current(timers, data, internal, sched, output); },
  1747. Self::S_Editing(s) => { s.exit_current(timers, data, internal, sched, output); },
  1748. }
  1749. State_P_Time::exit_actions(timers, data, internal, sched, output);
  1750. }
  1751. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1752. State_P_Time::enter_actions(timers, data, internal, sched, output);
  1753. match self {
  1754. Self::S_Increasing(s) => { s.enter_current(timers, data, internal, sched, output); },
  1755. Self::S_Editing(s) => { s.enter_current(timers, data, internal, sched, output); },
  1756. }
  1757. }
  1758. }
  1759. // And-state
  1760. #[derive(Default, Copy, Clone)]
  1761. struct State_P {
  1762. s_P_Alarm: State_P_Alarm,
  1763. s_P_Indiglo: State_P_Indiglo,
  1764. s_P_ChronoWrapper: State_P_ChronoWrapper,
  1765. s_P_Display: State_P_Display,
  1766. s_P_Time: State_P_Time,
  1767. }
  1768. impl State_P {
  1769. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1770. let scope = data;
  1771. }
  1772. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1773. let scope = data;
  1774. }
  1775. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1776. State_P::enter_actions(timers, data, internal, sched, output);
  1777. State_P_Alarm::enter_default(timers, data, internal, sched, output);
  1778. State_P_Indiglo::enter_default(timers, data, internal, sched, output);
  1779. State_P_ChronoWrapper::enter_default(timers, data, internal, sched, output);
  1780. State_P_Display::enter_default(timers, data, internal, sched, output);
  1781. State_P_Time::enter_default(timers, data, internal, sched, output);
  1782. }
  1783. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1784. self.s_P_Alarm.exit_current(timers, data, internal, sched, output);
  1785. self.s_P_Indiglo.exit_current(timers, data, internal, sched, output);
  1786. self.s_P_ChronoWrapper.exit_current(timers, data, internal, sched, output);
  1787. self.s_P_Display.exit_current(timers, data, internal, sched, output);
  1788. self.s_P_Time.exit_current(timers, data, internal, sched, output);
  1789. State_P::exit_actions(timers, data, internal, sched, output);
  1790. }
  1791. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1792. State_P::enter_actions(timers, data, internal, sched, output);
  1793. self.s_P_Alarm.enter_current(timers, data, internal, sched, output);
  1794. self.s_P_Indiglo.enter_current(timers, data, internal, sched, output);
  1795. self.s_P_ChronoWrapper.enter_current(timers, data, internal, sched, output);
  1796. self.s_P_Display.enter_current(timers, data, internal, sched, output);
  1797. self.s_P_Time.enter_current(timers, data, internal, sched, output);
  1798. }
  1799. }
  1800. // Or-state
  1801. #[derive(Copy, Clone)]
  1802. enum Root {
  1803. S_P(State_P),
  1804. }
  1805. impl Default for Root {
  1806. fn default() -> Self {
  1807. Self::S_P(Default::default())
  1808. }
  1809. }
  1810. impl Root {
  1811. fn enter_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1812. let scope = data;
  1813. }
  1814. fn exit_actions<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1815. let scope = data;
  1816. }
  1817. fn enter_default<Sched: statechart::Scheduler<InEvent=InEvent>>(timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1818. Root::enter_actions(timers, data, internal, sched, output);
  1819. State_P::enter_default(timers, data, internal, sched, output);
  1820. }
  1821. fn exit_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1822. match self {
  1823. Self::S_P(s) => { s.exit_current(timers, data, internal, sched, output); },
  1824. }
  1825. Root::exit_actions(timers, data, internal, sched, output);
  1826. }
  1827. fn enter_current<Sched: statechart::Scheduler<InEvent=InEvent>>(&self, timers: &mut Timers<Sched::TimerId>, data: &mut DataModel, internal: &mut InternalLifeline, sched: &mut Sched, output: &mut impl FnMut(OutEvent)) {
  1828. Root::enter_actions(timers, data, internal, sched, output);
  1829. match self {
  1830. Self::S_P(s) => { s.enter_current(timers, data, internal, sched, output); },
  1831. }
  1832. }
  1833. }
  1834. fn f0_guard(builtin_conf: (State_P_Indiglo, State_P_ChronoWrapper, State_P_Display, State_P_Time, ), ) -> bool {
  1835. let scope = action_lang::Empty{};
  1836. let mut scope = Scope0_guard_l1 {
  1837. _base: scope,
  1838. builtin_conf,
  1839. };
  1840. return { // macro expansion for @in("/P/Display/TimeUpdate")
  1841. let (ref s_P_Indiglo, ref s_P_ChronoWrapper, ref s_P_Display, ref s_P_Time, ) = scope.builtin_conf;
  1842. if let State_P_Display::S_TimeUpdate(ref s_P_Display_TimeUpdate) = s_P_Display {
  1843. true
  1844. } else { false }
  1845. };
  1846. }
  1847. fn f1_guard(builtin_conf: (State_P_Indiglo, State_P_ChronoWrapper, State_P_Display, State_P_Time, ), ) -> bool {
  1848. let scope = action_lang::Empty{};
  1849. let mut scope = Scope1_guard_l1 {
  1850. _base: scope,
  1851. builtin_conf,
  1852. };
  1853. return { // macro expansion for @in("/P/Display/TimeUpdate")
  1854. let (ref s_P_Indiglo, ref s_P_ChronoWrapper, ref s_P_Display, ref s_P_Time, ) = scope.builtin_conf;
  1855. if let State_P_Display::S_TimeUpdate(ref s_P_Display_TimeUpdate) = s_P_Display {
  1856. true
  1857. } else { false }
  1858. };
  1859. }
  1860. fn f2_guard(builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ), ) -> bool {
  1861. let scope = action_lang::Empty{};
  1862. let mut scope = Scope2_guard_l1 {
  1863. _base: scope,
  1864. builtin_conf,
  1865. };
  1866. return { // macro expansion for @in("/P/Display/ChronoUpdate")
  1867. let (ref s_P_Alarm, ref s_P_Indiglo, ref s_P_Display, ref s_P_Time, ) = scope.builtin_conf;
  1868. if let State_P_Display::S_ChronoUpdate(ref s_P_Display_ChronoUpdate) = s_P_Display {
  1869. true
  1870. } else { false }
  1871. };
  1872. }
  1873. fn f3_guard(builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ), ) -> bool {
  1874. let scope = action_lang::Empty{};
  1875. let mut scope = Scope3_guard_l1 {
  1876. _base: scope,
  1877. builtin_conf,
  1878. };
  1879. return { // macro expansion for @in("/P/Display/ChronoUpdate")
  1880. let (ref s_P_Alarm, ref s_P_Indiglo, ref s_P_Display, ref s_P_Time, ) = scope.builtin_conf;
  1881. if let State_P_Display::S_ChronoUpdate(ref s_P_Display_ChronoUpdate) = s_P_Display {
  1882. true
  1883. } else { false }
  1884. };
  1885. }
  1886. fn f4_guard(builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ), ) -> bool {
  1887. let scope = action_lang::Empty{};
  1888. let mut scope = Scope4_guard_l1 {
  1889. _base: scope,
  1890. builtin_conf,
  1891. };
  1892. return { // macro expansion for @in("/P/Display/ChronoUpdate")
  1893. let (ref s_P_Alarm, ref s_P_Indiglo, ref s_P_Display, ref s_P_Time, ) = scope.builtin_conf;
  1894. if let State_P_Display::S_ChronoUpdate(ref s_P_Display_ChronoUpdate) = s_P_Display {
  1895. true
  1896. } else { false }
  1897. };
  1898. }
  1899. inherit_struct! {
  1900. Scope0_guard_l1 (action_lang::Empty) {
  1901. builtin_conf: (State_P_Indiglo, State_P_ChronoWrapper, State_P_Display, State_P_Time, ),
  1902. }
  1903. }
  1904. inherit_struct! {
  1905. Scope1_guard_l1 (action_lang::Empty) {
  1906. builtin_conf: (State_P_Indiglo, State_P_ChronoWrapper, State_P_Display, State_P_Time, ),
  1907. }
  1908. }
  1909. inherit_struct! {
  1910. Scope2_guard_l1 (action_lang::Empty) {
  1911. builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ),
  1912. }
  1913. }
  1914. inherit_struct! {
  1915. Scope3_guard_l1 (action_lang::Empty) {
  1916. builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ),
  1917. }
  1918. }
  1919. inherit_struct! {
  1920. Scope4_guard_l1 (action_lang::Empty) {
  1921. builtin_conf: (State_P_Alarm, State_P_Indiglo, State_P_Display, State_P_Time, ),
  1922. }
  1923. }