/* SNC Version 2.0.11: Wed Nov 2 19:48:22 2011: sncLaserSoft.i */ /* Event flags */ /* Program "sncLaserSoft" */ #include "seqCom.h" #define NUM_SS 1 #define NUM_CHANNELS 2 #define NUM_EVENTS 0 #define NUM_QUEUES 0 #define MAX_STRING_SIZE 40 #define ASYNC_OPT FALSE #define CONN_OPT FALSE #define DEBUG_OPT FALSE #define MAIN_OPT FALSE #define NEWEF_OPT TRUE #define REENT_OPT FALSE extern struct seqProgram sncLaserSoft; /* Variable declarations */ static float value; static int i; static float camr_proj_v[480]; static float camr_proj_h[640]; /* Not used (avoids compilation warnings) */ struct UserVar { int dummy; }; /* C code definitions */ # line 24 "../sncLaserSoft.st" #include "math.h" # line 25 "../sncLaserSoft.st" #include "epicsPrint.h" # line 27 "../sncLaserSoft.st" #include "tsDefs.h" # line 28 "../sncLaserSoft.st" #include "string.h" # line 29 "../sncLaserSoft.st" #include "stdio.h" /* Entry handler */ static void entry_handler(SS_ID ssId, struct UserVar *pVar) { } /* Code for state "init" in state set "camerapixelsSS" */ /* Delay function for state "init" in state set "camerapixelsSS" */ static void D_camerapixelsSS_init(SS_ID ssId, struct UserVar *pVar) { # line 55 "../sncLaserSoft.st" } /* Event function for state "init" in state set "camerapixelsSS" */ static long E_camerapixelsSS_init(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 55 "../sncLaserSoft.st" if (1) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "init" in state set "camerapixelsSS" */ static void A_camerapixelsSS_init(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 49 "../sncLaserSoft.st" printf("state init"); for (i = 0; i < 480; i++) { value = i; camr_proj_v[i] = value * 9 / 1000; } # line 52 "../sncLaserSoft.st" for (i = 0; i < 640; i++) { value = i; camr_proj_h[i] = value * 9 / 1000; } # line 53 "../sncLaserSoft.st" seq_pvPut(ssId, 0 /* camr_proj_v */, 0); seq_pvPut(ssId, 1 /* camr_proj_h */, 0); } return; } } /* Code for state "check" in state set "camerapixelsSS" */ /* Delay function for state "check" in state set "camerapixelsSS" */ static void D_camerapixelsSS_check(SS_ID ssId, struct UserVar *pVar) { # line 61 "../sncLaserSoft.st" seq_delayInit(ssId, 0, (10000)); } /* Event function for state "check" in state set "camerapixelsSS" */ static long E_camerapixelsSS_check(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 61 "../sncLaserSoft.st" if (seq_delay(ssId, 0)) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "check" in state set "camerapixelsSS" */ static void A_camerapixelsSS_check(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { } return; } } /* Exit handler */ static void exit_handler(SS_ID ssId, struct UserVar *pVar) { } /************************ Tables ***********************/ /* Database Blocks */ static struct seqChan seqChan[NUM_CHANNELS] = { {"CAMR:LS00:1:PROJ_V", (void *)&camr_proj_v[0], "camr_proj_v[0]", "float", 480, 1, 0, 0, 0, 0, 0}, {"CAMR:LS00:1:PROJ_H", (void *)&camr_proj_h[0], "camr_proj_h[0]", "float", 640, 2, 0, 0, 0, 0, 0}, }; /* Event masks for state set camerapixelsSS */ /* Event mask for state init: */ static bitMask EM_camerapixelsSS_init[] = { 0x00000000, }; /* Event mask for state check: */ static bitMask EM_camerapixelsSS_check[] = { 0x00000000, }; /* State Blocks */ static struct seqState state_camerapixelsSS[] = { /* State "init" */ { /* state name */ "init", /* action function */ (ACTION_FUNC) A_camerapixelsSS_init, /* event function */ (EVENT_FUNC) E_camerapixelsSS_init, /* delay function */ (DELAY_FUNC) D_camerapixelsSS_init, /* entry function */ (ENTRY_FUNC) 0, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_camerapixelsSS_init, /* state options */ (0)}, /* State "check" */ { /* state name */ "check", /* action function */ (ACTION_FUNC) A_camerapixelsSS_check, /* event function */ (EVENT_FUNC) E_camerapixelsSS_check, /* delay function */ (DELAY_FUNC) D_camerapixelsSS_check, /* entry function */ (ENTRY_FUNC) 0, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_camerapixelsSS_check, /* state options */ (0)}, }; /* State Set Blocks */ static struct seqSS seqSS[NUM_SS] = { /* State set "camerapixelsSS" */ { /* ss name */ "camerapixelsSS", /* ptr to state block */ state_camerapixelsSS, /* number of states */ 2, /* error state */ -1}, }; /* Program parameter list */ static char prog_param[] = ""; /* State Program table (global) */ struct seqProgram sncLaserSoft = { /* magic number */ 20000315, /* *name */ "sncLaserSoft", /* *pChannels */ seqChan, /* numChans */ NUM_CHANNELS, /* *pSS */ seqSS, /* numSS */ NUM_SS, /* user variable size */ 0, /* *pParams */ prog_param, /* numEvents */ NUM_EVENTS, /* encoded options */ (0 | OPT_NEWEF), /* entry handler */ (ENTRY_FUNC) entry_handler, /* exit handler */ (EXIT_FUNC) exit_handler, /* numQueues */ NUM_QUEUES, }; /* Register sequencer commands and program */ void sncLaserSoftRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&sncLaserSoft); } epicsExportRegistrar(sncLaserSoftRegistrar);