/* Generated with snc from assign.i */ /* Program "assignTest" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 11 "../assign.st" static int x = 0; struct UserVar_w { int n; } UserVar_w = { # line 23 "../assign.st" 1, }; /* C code definitions */ # line 9 "../assign.st" #include "../testSupport.h" /* Program init func */ static void G_prog_init(struct UserVar *pVar) { } /* Program entry func */ static void G_prog_entry(SS_ID ssId, struct UserVar *pVar) { # line 19 "../assign.st" testPlan(3); } /****** Code for state "w" in state set "w" ******/ /* Delay function for state "w" in state set "w" */ static void D_w_w(SS_ID ssId, struct UserVar *pVar) { # line 27 "../assign.st" seq_delayInit(ssId, 0, (0.01)); } /* Event function for state "w" in state set "w" */ static seqBool E_w_w(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 25 "../assign.st" if (UserVar_w.n > 3) { seq_exit(ssId); *pTransNum = 0; return TRUE; } # line 27 "../assign.st" if (seq_delay(ssId, 0)) { *pNextState = 0; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "w" in state set "w" */ static void A_w_w(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; case 1: { # line 28 "../assign.st" int status; # line 29 "../assign.st" x = !x; # line 30 "../assign.st" status = seq_pvPut(ssId, 0/*x*/, 0); # line 31 "../assign.st" testOk1(status == pvStatERROR); # line 32 "../assign.st" UserVar_w.n++; } return; } } /****** Code for state "yes" in state set "r" ******/ /* Delay function for state "yes" in state set "r" */ static void D_r_yes(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "yes" in state set "r" */ static seqBool E_r_yes(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 39 "../assign.st" if (!x) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "yes" in state set "r" */ static void A_r_yes(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "no" in state set "r" ******/ /* Delay function for state "no" in state set "r" */ static void D_r_no(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "no" in state set "r" */ static seqBool E_r_no(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 43 "../assign.st" if (x) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "no" in state set "r" */ static void A_r_no(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /* Program exit func */ static void G_prog_exit(SS_ID ssId, struct UserVar *pVar) { # line 49 "../assign.st" testDone(); # line 50 "../assign.st" seq_test_done(); } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"", (size_t)&x, "x", "int", 1, 1, 0, 0, 0, 0} }; /* Event masks for state set "w" */ static const seqMask EM_w_w[] = { 0x00000000, }; /* State table for state set "w" */ static seqState G_w_states[] = { { /* state name */ "w", /* action function */ A_w_w, /* event function */ E_w_w, /* delay function */ D_w_w, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_w_w, /* state options */ (0) }, }; /* Event masks for state set "r" */ static const seqMask EM_r_yes[] = { 0x00000002, }; static const seqMask EM_r_no[] = { 0x00000002, }; /* State table for state set "r" */ static seqState G_r_states[] = { { /* state name */ "yes", /* action function */ A_r_yes, /* event function */ E_r_yes, /* delay function */ D_r_yes, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_r_yes, /* state options */ (0) }, { /* state name */ "no", /* action function */ A_r_no, /* event function */ E_r_no, /* delay function */ D_r_no, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_r_no, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "w", /* states */ G_w_states, /* number of states */ 1, /* number of delays */ 1 }, { /* state set name */ "r", /* states */ G_r_states, /* number of states */ 2, /* number of delays */ 0 }, }; /* Program table (global) */ seqProgram assignTest = { /* magic number */ 2001003, /* program name */ "assignTest", /* channels */ G_channels, /* num. channels */ 1, /* state sets */ G_state_sets, /* num. state sets */ 2, /* user var size */ 0, /* param */ "", /* num. event flags */ 0, /* encoded options */ (0 | OPT_CONN | OPT_NEWEF | OPT_MAIN), /* init func */ G_prog_init, /* entry func */ G_prog_entry, /* exit func */ G_prog_exit, /* num. queues */ 0 }; #define PROG_NAME assignTest #include "seqMain.c"