]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
trigtype added. Sergey.
authorhadaq <hadaq>
Tue, 31 Aug 2010 13:59:12 +0000 (13:59 +0000)
committerhadaq <hadaq>
Tue, 31 Aug 2010 13:59:12 +0000 (13:59 +0000)
ebctrl/ioc/ebctrlApp/src/trigtype.c [new file with mode: 0644]

diff --git a/ebctrl/ioc/ebctrlApp/src/trigtype.c b/ebctrl/ioc/ebctrlApp/src/trigtype.c
new file mode 100644 (file)
index 0000000..48a976e
--- /dev/null
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <dbDefs.h>
+#include <registryFunction.h>
+#include <subRecord.h>
+#include <epicsExport.h>
+#include <genSubRecord.h>
+#include <stringinRecord.h>
+
+#include "worker.h"
+
+int trigtypeDebug;
+
+long trigtype_init( struct genSubRecord *pgsub )
+{
+  return(0);
+}
+
+long trigtype_proc( struct genSubRecord *pgsub )
+{
+  uint32_t *out[16];
+  unsigned long tmp;
+  int i;
+
+  out[0]  = (uint32_t *)pgsub->vala;   /* trigType0 */
+  out[1]  = (uint32_t *)pgsub->valb;   /* trigType1 */
+  out[2]  = (uint32_t *)pgsub->valc;   /* trigType2 */
+  out[3]  = (uint32_t *)pgsub->vald;   /*   ...     */
+  out[4]  = (uint32_t *)pgsub->vale;
+  out[5]  = (uint32_t *)pgsub->valf;
+  out[6]  = (uint32_t *)pgsub->valg;
+  out[7]  = (uint32_t *)pgsub->valh;
+  out[8]  = (uint32_t *)pgsub->vali;
+  out[9]  = (uint32_t *)pgsub->valj;
+  out[10]  = (uint32_t *)pgsub->valk;
+  out[11]  = (uint32_t *)pgsub->vall;
+  out[12]  = (uint32_t *)pgsub->valm;
+  out[13]  = (uint32_t *)pgsub->valn;
+  out[14]  = (uint32_t *)pgsub->valo;
+  out[15]  = (uint32_t *)pgsub->valp;
+
+  char buf[_POSIX_PATH_MAX];
+  sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") );
+
+  char trigTypeBuff[100];
+
+  for( i=0; i<16; i++ ) {
+    sprintf( trigTypeBuff, "evtId%d", i );
+
+    if( Worker_getStatistic( buf, trigTypeBuff, &tmp ) == -1) {
+      if(trigtypeDebug)
+       printf("<E> trigtype.c: Worker_getStatistic failed for %s!\n", trigTypeBuff);
+    }
+    else{
+      *out[i] = (uint32_t)tmp;
+    }
+  }
+
+  return(0);
+}
+    
+/* Register these symbols for use by IOC code: */
+
+epicsExportAddress(int, trigtypeDebug);
+epicsRegisterFunction(trigtype_init);
+epicsRegisterFunction(trigtype_proc);