/* Generated with snc from sncLaserSoft.i */ /* Program "sncLaserSoft" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 31 "../sncLaserSoft.st" static float value = 0; # line 32 "../sncLaserSoft.st" static int i = 0; # line 37 "../sncLaserSoft.st" static float camr_proj_v[480] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* C code definitions */ # line 23 "../sncLaserSoft.st" #include "math.h" # line 24 "../sncLaserSoft.st" #include "epicsPrint.h" # line 26 "../sncLaserSoft.st" #include "tsDefs.h" # line 27 "../sncLaserSoft.st" #include "string.h" # line 28 "../sncLaserSoft.st" #include "stdio.h" /* Program init func */ static void G_prog_init(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) { } /* Event function for state "init" in state set "camerapixelsSS" */ static seqBool E_camerapixelsSS_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 47 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 49 "../sncLaserSoft.st" printf("state init"); # line 50 "../sncLaserSoft.st" for (i = 0; i < 480; i++) { # line 50 "../sncLaserSoft.st" value = i; # line 50 "../sncLaserSoft.st" camr_proj_v[i] = value * 9 / 1000; } # line 52 "../sncLaserSoft.st" for (i = 0; i < 640; i++) { # line 52 "../sncLaserSoft.st" value = i; # line 52 "../sncLaserSoft.st" camr_proj_h[i] = value * 9 / 1000; } # line 53 "../sncLaserSoft.st" seq_pvPut(ssId, 0/*camr_proj_v*/, 0); # line 54 "../sncLaserSoft.st" 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 59 "../sncLaserSoft.st" seq_delayInit(ssId, 0, (10000)); } /* Event function for state "check" in state set "camerapixelsSS" */ static seqBool E_camerapixelsSS_check(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 59 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"CAMR:LS00:1:PROJ_V", (size_t)&camr_proj_v, "camr_proj_v", "float", 480, 1, 0, 0, 0, 0}, {"CAMR:LS00:1:PROJ_H", (size_t)&camr_proj_h, "camr_proj_h", "float", 640, 2, 0, 0, 0, 0} }; /* Event masks for state set "camerapixelsSS" */ static const seqMask EM_camerapixelsSS_init[] = { 0x00000000, }; static const seqMask EM_camerapixelsSS_check[] = { 0x00000000, }; /* State table for state set "camerapixelsSS" */ static seqState G_camerapixelsSS_states[] = { { /* state name */ "init", /* action function */ A_camerapixelsSS_init, /* event function */ E_camerapixelsSS_init, /* delay function */ D_camerapixelsSS_init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_camerapixelsSS_init, /* state options */ (0) }, { /* state name */ "check", /* action function */ A_camerapixelsSS_check, /* event function */ E_camerapixelsSS_check, /* delay function */ D_camerapixelsSS_check, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_camerapixelsSS_check, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "camerapixelsSS", /* states */ G_camerapixelsSS_states, /* number of states */ 2, /* number of delays */ 1 }, }; /* Program table (global) */ seqProgram sncLaserSoft = { /* magic number */ 2001006, /* program name */ "sncLaserSoft", /* channels */ G_channels, /* num. channels */ 2, /* state sets */ G_state_sets, /* num. state sets */ 1, /* user var size */ 0, /* param */ "", /* num. event flags */ 0, /* encoded options */ (0 | OPT_NEWEF), /* init func */ G_prog_init, /* entry func */ NULL, /* exit func */ NULL, /* num. queues */ 0 }; /* Register sequencer commands and program */ #include "epicsExport.h" static void sncLaserSoftRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&sncLaserSoft); } epicsExportRegistrar(sncLaserSoftRegistrar);