]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
The evtId can be set from the command line or parameter file.
authorhadaq <hadaq>
Wed, 5 Mar 2003 15:20:27 +0000 (15:20 +0000)
committerhadaq <hadaq>
Wed, 5 Mar 2003 15:20:27 +0000 (15:20 +0000)
Helpful, if there is no Matching Unit in the setup.
-- mm

hadaq/evtbuild.c

index daafc49fb4bc29b2087ec92f5577da76e453bfe5..ab27797ed26b92551476dfc46ec29816a47c0046 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.61 2003-03-02 16:24:59 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.62 2003-03-05 15:20:27 hadaq Exp $";
 
 
 #define _POSIX_C_SOURCE 199309L
@@ -53,6 +53,7 @@ typedef struct TheArgsS {
        unsigned long priority;
        unsigned long queueSize;
        char verbosity[PARAM_MAX_VALUE_LEN];
+       unsigned long evtId;
 }
 
 TheArgs;
@@ -140,6 +141,7 @@ static void argsDump(TheArgs *my)
        syslog(LOG_DEBUG, "isStandalone: %d", my->isStandalone);
        syslog(LOG_DEBUG, "queueSize: %d", my->queueSize);
        syslog(LOG_DEBUG, "verbosity: %s", my->verbosity);
+       syslog(LOG_DEBUG, "evtId: %s", my->evtId);
 }
 
 static void argsDefault(TheArgs *my)
@@ -158,6 +160,7 @@ static void argsDefault(TheArgs *my)
        my->isStandalone = 1;
        my->queueSize = 1 * 1024 * 1024;
        strcpy(my->verbosity, "info");
+       my->evtId = 0;
 }
 
 static int argsFromCL(TheArgs *my, int argc, char *argv[])
@@ -165,7 +168,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[])
        extern char *optarg;
        int i;
 
-       while ((i = getopt(argc, argv, "am:f:s:r:o:d:q:p:v:x:")) != -1) {
+       while ((i = getopt(argc, argv, "am:f:s:r:o:d:q:p:v:x:I:")) != -1) {
                switch (i) {
                case 'm':
                        my->nrOfMsgs = strtoul(optarg, NULL, 0);
@@ -198,6 +201,9 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[])
                case 'v':
                        strcpy(my->verbosity, optarg);
                        break;
+               case 'I':
+                       my->evtId = strtoul(optarg, NULL, 0);
+                       break;
                default:
                        return -1;
                        break;
@@ -223,6 +229,7 @@ static int argsFromParam(TheArgs *my, int argc, char *argv[])
        Param_getInt(param, argv[0], "prio", &paramWasFound, &my->priority);
        Param_getInt(param, argv[0], "qsize", &paramWasFound, &my->queueSize);
        Param_getString(param, argv[0], "verb", &paramWasFound, my->verbosity);
+       Param_getInt(param, argv[0], "evtid", &paramWasFound, &my->evtId);
        desParam(param);
 }
 
@@ -589,7 +596,11 @@ int main(int argc, char *argv[])
                        if (i == 0) {
                                currTrigNr = SubEvt_trigNr(subEvt) >> 8;
                                currTrigTag = SubEvt_trigNr(subEvt) & 0xff;
-                               currId = SubEvt_pureId(subEvt);
+                               if (theArgs->evtId != 0) {
+                                       currId = theArgs->evtId;
+                               } else {
+                                       currId = SubEvt_pureId(subEvt);
+                               }
                                syslog(LOG_DEBUG,
                                           "currTrigNr: 0x%06x, currTrigTag 0x%02x, currId 0x%08x", currTrigNr, currTrigTag, currId);
                        }