FingerPrintFSM.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. #ifndef FINGERPRINT_FSM_H
  2. #define FINGERPRINT_FSM_H
  3. #include "SpFSM.h"
  4. #include "DevFSMCommBase.hpp"
  5. #include "FingerPrintClass.h"
  6. #include "FingerPrint_UserErrorCode.h"
  7. #include <set>
  8. #include <mutex>
  9. #include "CommEntityUtil.hpp"
  10. using namespace std;
  11. enum EvtType
  12. {
  13. USER_EVT_TEST = EVT_USER + 1,
  14. USER_EVT_INIT,
  15. USER_EVT_INIT_FINISHED,
  16. USER_EVT_GET_DEVINFO,
  17. USER_EVT_SCAN,
  18. USER_EVT_SCAN_FINISHED,
  19. USER_EVT_SCANEX,
  20. USER_EVT_SCANEX_FINISHED,
  21. USER_EVT_MATCH,
  22. USER_EVT_MATCH_FINISHED,
  23. USER_EVT_GETFINGER,
  24. USER_EVT_GETFINGER_FINISHED,
  25. USER_EVT_GENERATE_TEMPLATE,
  26. USER_EVT_GENERATE_TEMPLATE_FINISHED,
  27. USER_EVT_MATCH_FINGERPRINT,
  28. USER_EVT_MATCH_FINGERPRINT_FINISHED,
  29. USER_EVT_CANCEL_SCAN,
  30. USER_EVT_CANCEL_MATCH,
  31. USER_EVT_CANCEL_SCAN_FINISHED,
  32. USER_EVT_QUIT,
  33. USER_EVT_ERROR,
  34. USER_EVT_EXIT,
  35. USER_EVT_FWB_OPEN_SUC,
  36. USER_EVT_FWB_OPEN_SUC_FINISHED,
  37. USER_EVT_JS_GET_FINGERPRINT,
  38. USER_EVT_JS_GET_FINGERPRINT_FINISHED,
  39. USER_EVT_JS_GENERATE_TEMPLATE,
  40. USER_EVT_JS_GENERATE_TEMPLATE_FINISHED,
  41. USER_EVT_JS_CANCEL_SCAN,
  42. USER_EVT_JS_CANCEL_SCAN_FINISHED
  43. };
  44. enum BmpType
  45. {
  46. BmpImage = 1,
  47. TestImage
  48. };
  49. #include "FingerPrint_server_g.h"
  50. #include "FingerPrintClass.h"
  51. using namespace FingerPrint;
  52. class ScanEvent : public FSMEvent
  53. {
  54. public:
  55. ScanEvent() : FSMEvent(USER_EVT_SCAN){}
  56. virtual ~ScanEvent(){}
  57. SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx;
  58. virtual void OnUnhandled()
  59. {
  60. if (ctx != NULL) {
  61. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("ScanEvent unhandled.");
  62. ctx->Answer(Error_InvalidState);
  63. }
  64. }
  65. };
  66. class ScanExEvent : public FSMEvent
  67. {
  68. public:
  69. ScanExEvent() : FSMEvent(USER_EVT_SCANEX) {}
  70. virtual ~ScanExEvent() {}
  71. SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx;
  72. virtual void OnUnhandled()
  73. {
  74. if (ctx != NULL)
  75. {
  76. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("ScanEx unhandled");
  77. ctx->Answer(Error_InvalidState);
  78. }
  79. }
  80. };
  81. class GetFingerEvent : public FSMEvent
  82. {
  83. public:
  84. GetFingerEvent() : FSMEvent(USER_EVT_GETFINGER) {}
  85. virtual ~GetFingerEvent() {}
  86. SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx;
  87. virtual void OnUnhandled()
  88. {
  89. if (ctx != NULL)
  90. {
  91. ctx->Answer(Error_InvalidState);
  92. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GetFinger unhandled");
  93. }
  94. }
  95. };
  96. class GenerateTemplateEvent : public FSMEvent
  97. {
  98. public:
  99. GenerateTemplateEvent() : FSMEvent(USER_EVT_GENERATE_TEMPLATE) {}
  100. virtual ~GenerateTemplateEvent() {}
  101. SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx;
  102. virtual void OnUnhandled()
  103. {
  104. if (ctx != NULL)
  105. {
  106. ctx->Answer(Error_InvalidState);
  107. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GenerateTemplate unhandled.");
  108. }
  109. }
  110. };
  111. class CancelRegisterEvent : public FSMEvent
  112. {
  113. public:
  114. CancelRegisterEvent() : FSMEvent(USER_EVT_CANCEL_SCAN){}
  115. virtual ~CancelRegisterEvent(){}
  116. virtual void OnUnhandled()
  117. {
  118. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("Cancel scan not handled");
  119. }
  120. };
  121. class MatchEvent : public FSMEvent
  122. {
  123. public:
  124. MatchEvent() : FSMEvent(USER_EVT_MATCH){}
  125. virtual ~MatchEvent(){}
  126. SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx;
  127. virtual void OnUnhandled()
  128. {
  129. if (ctx != NULL)
  130. {
  131. ctx->Answer(Error_InvalidState);
  132. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("Match unhandled.");
  133. }
  134. }
  135. };
  136. class MatchFinishedEvent : public FSMEvent
  137. {
  138. public:
  139. MatchFinishedEvent() : FSMEvent(USER_EVT_MATCH_FINISHED){}
  140. ~MatchFinishedEvent(){}
  141. SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx;
  142. virtual void OnUnhandled()
  143. {
  144. if (ctx != NULL)
  145. {
  146. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("Match finished unhandled.");
  147. }
  148. }
  149. };
  150. class GetFingerFinishedEvent : public FSMEvent
  151. {
  152. public:
  153. GetFingerFinishedEvent() : FSMEvent(USER_EVT_GETFINGER_FINISHED) {}
  154. ~GetFingerFinishedEvent() {}
  155. SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx;
  156. virtual void OnUnhandled()
  157. {
  158. if (ctx != NULL)
  159. {
  160. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GetFingerFinished unhandled.");
  161. }
  162. }
  163. };
  164. class CancelMatchEvent : public FSMEvent
  165. {
  166. public:
  167. CancelMatchEvent() : FSMEvent(USER_EVT_CANCEL_MATCH){}
  168. virtual ~CancelMatchEvent(){}
  169. virtual void OnUnhandled()
  170. {
  171. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("Cancel match not handled");
  172. }
  173. };
  174. class GetDevInfoEvent : public FSMEvent
  175. {
  176. public:
  177. GetDevInfoEvent() : FSMEvent(USER_EVT_GET_DEVINFO){}
  178. virtual ~GetDevInfoEvent(){}
  179. SpReqAnsContext<FingerPrintService_GetDevInfo_Req, FingerPrintService_GetDevInfo_Ans>::Pointer ctx;
  180. virtual void OnUnhandled()
  181. {
  182. if(ctx != NULL)
  183. ctx->Answer(Error_InvalidState);
  184. }
  185. };
  186. //JS
  187. class GetFingerPrintJSEvent : public FSMEvent
  188. {
  189. public:
  190. GetFingerPrintJSEvent() : FSMEvent(USER_EVT_JS_GET_FINGERPRINT) {}
  191. virtual ~GetFingerPrintJSEvent() {}
  192. SpReqAnsContext<FingerPrintService_GetFingerPrintJS_Req, FingerPrintService_GetFingerPrintJS_Ans>::Pointer ctx;
  193. virtual void OnUnhandled()
  194. {
  195. if (ctx != NULL)
  196. {
  197. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GetFingerPrintJS unhandled");
  198. }
  199. }
  200. };
  201. class GenerateTemplateJSEvent : public FSMEvent
  202. {
  203. public:
  204. GenerateTemplateJSEvent() : FSMEvent(USER_EVT_JS_GENERATE_TEMPLATE) {}
  205. virtual ~GenerateTemplateJSEvent() {}
  206. SpReqAnsContext<FingerPrintService_GenerateTemplateJS_Req, FingerPrintService_GenerateTemplateJS_Ans>::Pointer ctx;
  207. virtual void OnUnhandled()
  208. {
  209. if (ctx != NULL)
  210. {
  211. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GenerateTemplateJS unhandled.");
  212. }
  213. }
  214. };
  215. class CancelScanJSEvent : public FSMEvent
  216. {
  217. public:
  218. CancelScanJSEvent() : FSMEvent(USER_EVT_JS_CANCEL_SCAN) {}
  219. virtual ~CancelScanJSEvent() {}
  220. SpReqAnsContext<FingerPrintService_CancelScanJS_Req, FingerPrintService_CancelScanJS_Ans>::Pointer ctx;
  221. virtual void OnUnhandled()
  222. {
  223. if (ctx != NULL)
  224. {
  225. DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA242H")("GenerateTemplateJS unhandled.");
  226. }
  227. }
  228. };
  229. class CFingerPrintFSM : public CCommDevFSM<CFingerPrintFSM, FingerPrintClass>
  230. {
  231. public:
  232. enum {s0, s1, s2, s3, s4};
  233. BEGIN_FSM_STATE(CFingerPrintFSM)
  234. FSM_STATE_ENTRY(s0, "Normal", s0_on_entry,s0_on_exit,s0_on_event)
  235. FSM_STATE_ENTRY(s1, "Scan", s1_on_entry,s1_on_exit,s1_on_event)
  236. FSM_STATE_ENTRY(s2, "Fail", s2_on_entry,s2_on_exit,s2_on_event)
  237. FSM_STATE_ENTRY(s3, "Match", s3_on_entry,s3_on_exit,s3_on_event)//废弃的状态
  238. FSM_STATE_ENTRY(s4, "Init", s4_on_entry,s4_on_exit,s4_on_event)
  239. END_FSM_STATE()
  240. BEGIN_FSM_RULE(CFingerPrintFSM, s4)
  241. FSM_RULE_ENTRY(s0, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
  242. FSM_RULE_ENTRY(s0, s1, USER_EVT_SCAN, 0)
  243. FSM_RULE_ENTRY(s0, s1, USER_EVT_SCANEX, 0)
  244. FSM_RULE_ENTRY(s0, s1, USER_EVT_GETFINGER, 0)
  245. FSM_RULE_ENTRY(s0, s1, USER_EVT_GENERATE_TEMPLATE, 0)
  246. FSM_RULE_ENTRY(s0, s1, USER_EVT_SCANEX, 0)
  247. FSM_RULE_ENTRY(s0, s2, USER_EVT_ERROR, 0)
  248. FSM_RULE_ENTRY(s0, s3, USER_EVT_MATCH, 0)
  249. FSM_RULE_ENTRY(s0, s4, USER_EVT_FWB_OPEN_SUC_FINISHED, 0)
  250. FSM_RULE_ENTRY(s0, s1, USER_EVT_JS_GET_FINGERPRINT, 0)//js 扫描
  251. FSM_RULE_ENTRY(s0, s1, USER_EVT_JS_GENERATE_TEMPLATE, 0)//js 指纹模版
  252. FSM_RULE_ENTRY(s1, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
  253. FSM_RULE_ENTRY(s1, s0, USER_EVT_SCAN_FINISHED, 0)
  254. FSM_RULE_ENTRY(s1, s2, USER_EVT_SCAN_FINISHED, 2)
  255. FSM_RULE_ENTRY(s1, s0, USER_EVT_SCANEX_FINISHED, 0)
  256. FSM_RULE_ENTRY(s1, s2, USER_EVT_SCANEX_FINISHED, 2)
  257. FSM_RULE_ENTRY(s1, s0, USER_EVT_GETFINGER_FINISHED, 0)
  258. FSM_RULE_ENTRY(s1, s2, USER_EVT_GETFINGER_FINISHED, 2)
  259. FSM_RULE_ENTRY(s1, s0, USER_EVT_GENERATE_TEMPLATE_FINISHED, 0)
  260. FSM_RULE_ENTRY(s1, s2, USER_EVT_GENERATE_TEMPLATE_FINISHED, 2)
  261. FSM_RULE_ENTRY(s1, s0, USER_EVT_JS_GET_FINGERPRINT_FINISHED, 0)//js 扫描
  262. FSM_RULE_ENTRY(s1, s0, USER_EVT_JS_GENERATE_TEMPLATE_FINISHED, 0)//js 指纹模版
  263. FSM_RULE_ENTRY(s2, s4, USER_EVT_FWB_OPEN_SUC_FINISHED, 0)
  264. FSM_RULE_ENTRY(s3, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
  265. FSM_RULE_ENTRY(s3, s0, USER_EVT_MATCH_FINISHED, 0)
  266. FSM_RULE_ENTRY(s3, s2, USER_EVT_MATCH_FINISHED, 2)
  267. FSM_RULE_ENTRY(s4, s0, USER_EVT_INIT_FINISHED, 0)
  268. FSM_RULE_ENTRY(s4, s2, USER_EVT_INIT_FINISHED, 2)
  269. END_FSM_RULE()
  270. CFingerPrintFSM():m_bCancelRegister(false), m_bCancelMatch(false), m_bExit(false),
  271. m_testResult(Error_Succeed),
  272. m_bCancelScan(false), m_bExitMainPage(false)
  273. {
  274. HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x204);
  275. }
  276. virtual ErrorCodeEnum OnInit();
  277. virtual ErrorCodeEnum OnExit();
  278. void s0_on_entry();
  279. void s0_on_exit();
  280. unsigned int s0_on_event(FSMEvent* e);
  281. void s4_on_entry();
  282. void s4_on_exit();
  283. unsigned int s4_on_event(FSMEvent* e);
  284. void s1_on_entry();
  285. void s1_on_exit();
  286. unsigned int s1_on_event(FSMEvent* e);
  287. void s2_on_entry();
  288. void s2_on_exit();
  289. unsigned int s2_on_event(FSMEvent* e);
  290. void s3_on_entry();
  291. void s3_on_exit();
  292. unsigned int s3_on_event(FSMEvent* e);
  293. int GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx);
  294. int GenerateTemplate(SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx);
  295. void DeleteBmp(int type);
  296. ErrorCodeEnum DeleteFileIfExisted(const char* fileName);
  297. ErrorCodeEnum GetDevCatInfo(DevCategoryInfo& devInfo);
  298. ErrorCodeEnum GetCurDevState(int &state);
  299. int Initial();
  300. CSimpleStringA getRTACode(DWORD dwUserCode) {
  301. return this->GetEntityBase()->GetFunction()->UserCodeToRTACode(dwUserCode);
  302. }
  303. void SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext);
  304. private:
  305. ErrorCodeEnum m_testResult;
  306. DevCategoryInfo m_devCatInfo;
  307. bool m_bCancelRegister;
  308. bool m_bCancelMatch;
  309. bool m_bExit;
  310. public:
  311. int GetFingerPrintJS(SpReqAnsContext<FingerPrintService_GetFingerPrintJS_Req, FingerPrintService_GetFingerPrintJS_Ans>::Pointer ctx);
  312. int GenerateTemplateJS(SpReqAnsContext<FingerPrintService_GenerateTemplateJS_Req, FingerPrintService_GenerateTemplateJS_Ans>::Pointer ctx);
  313. ErrorCodeEnum GetImgBlob(CBlob& data, CSimpleStringA imgPath);
  314. ErrorCodeEnum DeleteFingerBmp(CSimpleStringA imgPath);
  315. ErrorCodeEnum DeleteRegisterFingerBmp();
  316. void insertRegisterFingerBmp(CSimpleStringA bmpPath);
  317. DWORD GetFsmStateErrCode();
  318. private:
  319. bool m_bCancelScan;
  320. bool m_bExitMainPage;
  321. set<CSimpleStringA> m_fingerPrintFileSet;
  322. std::mutex m_fingerfileMtx;
  323. };
  324. //废弃
  325. struct ScanTask : public ITaskSp
  326. {
  327. CFingerPrintFSM* fsm;
  328. SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx;
  329. ScanTask(CFingerPrintFSM* f) : fsm(f){}
  330. void Process()
  331. {
  332. //LOG_FUNCTION();
  333. //FSMEvent* e = new FSMEvent(USER_EVT_SCAN_FINISHED);
  334. //e->param1 = fsm->GetImageAndFeature(ctx);
  335. //fsm->PostEventFIFO(e);
  336. }
  337. };
  338. //废弃
  339. struct ScanExTask : public ITaskSp
  340. {
  341. CFingerPrintFSM* fsm;
  342. SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx;
  343. ScanExTask(CFingerPrintFSM* f) : fsm(f) {}
  344. void Process()
  345. {
  346. //LOG_FUNCTION();
  347. //FSMEvent* e = new FSMEvent(USER_EVT_SCANEX_FINISHED);
  348. //e->param1 = fsm->GetImageAndFeatureEx(ctx);
  349. //fsm->PostEventFIFO(e);
  350. }
  351. };
  352. //有用
  353. struct GetFingerTask : public ITaskSp
  354. {
  355. CFingerPrintFSM* fsm;
  356. SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx;
  357. GetFingerTask(CFingerPrintFSM* f) : fsm(f) {}
  358. void Process()
  359. {
  360. LOG_FUNCTION();
  361. FSMEvent* e = new FSMEvent(USER_EVT_GETFINGER_FINISHED);
  362. e->param1 = fsm->GetFingerPrint(ctx);
  363. fsm->PostEventFIFO(e);
  364. }
  365. };
  366. //有用
  367. struct GenerateTemplateTask : public ITaskSp
  368. {
  369. CFingerPrintFSM* fsm;
  370. SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx;
  371. GenerateTemplateTask(CFingerPrintFSM* f) : fsm(f) {}
  372. void Process()
  373. {
  374. LOG_FUNCTION();
  375. FSMEvent* e = new FSMEvent(USER_EVT_GENERATE_TEMPLATE_FINISHED);
  376. e->param1 = fsm->GenerateTemplate(ctx);
  377. fsm->PostEventFIFO(e);
  378. }
  379. };
  380. //废弃
  381. struct MatchTask : public ITaskSp
  382. {
  383. CFingerPrintFSM* fsm;
  384. SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx;
  385. MatchTask(CFingerPrintFSM* f) : fsm(f){}
  386. void Process()
  387. {
  388. //LOG_FUNCTION();
  389. //MatchFinishedEvent* e = new MatchFinishedEvent();
  390. //e->param1 = fsm->Match(ctx);
  391. //e->ctx = ctx;
  392. //fsm->PostEventFIFO(e);
  393. }
  394. };
  395. //有用
  396. struct InitTask : public ITaskSp
  397. {
  398. CFingerPrintFSM* fsm;
  399. InitTask(CFingerPrintFSM* f) : fsm(f) {}
  400. void Process()
  401. {
  402. FSMEvent* e = new FSMEvent(USER_EVT_INIT_FINISHED);
  403. fsm->m_bOpening = true;
  404. e->param1 = fsm->Initial();
  405. fsm->m_bOpening = false;
  406. fsm->PostEventFIFO(e);
  407. }
  408. };
  409. //JS
  410. struct GetFingerPrintJSTask : public ITaskSp
  411. {
  412. CFingerPrintFSM* fsm;
  413. SpReqAnsContext<FingerPrintService_GetFingerPrintJS_Req, FingerPrintService_GetFingerPrintJS_Ans>::Pointer ctx;
  414. GetFingerPrintJSTask(CFingerPrintFSM* f) : fsm(f) {}
  415. void Process()
  416. {
  417. LOG_FUNCTION();
  418. FSMEvent* e = new FSMEvent(USER_EVT_JS_GET_FINGERPRINT_FINISHED);
  419. e->param1 = fsm->GetFingerPrintJS(ctx);
  420. fsm->PostEventFIFO(e);
  421. }
  422. };
  423. struct GenerateTemplateJSTask : public ITaskSp
  424. {
  425. CFingerPrintFSM* fsm;
  426. SpReqAnsContext<FingerPrintService_GenerateTemplateJS_Req, FingerPrintService_GenerateTemplateJS_Ans>::Pointer ctx;
  427. GenerateTemplateJSTask(CFingerPrintFSM* f) : fsm(f) {}
  428. void Process()
  429. {
  430. LOG_FUNCTION();
  431. FSMEvent* e = new FSMEvent(USER_EVT_JS_GENERATE_TEMPLATE_FINISHED);
  432. e->param1 = fsm->GenerateTemplateJS(ctx);
  433. fsm->PostEventFIFO(e);
  434. }
  435. };
  436. #endif