From 1fc65fd50f9e49bb3bbc7afcb7c80d9a54b74e22 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 5 Mar 2003 15:20:27 +0000 Subject: [PATCH] The evtId can be set from the command line or parameter file. Helpful, if there is no Matching Unit in the setup. -- mm --- hadaq/evtbuild.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index daafc49..ab27797 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -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", ¶mWasFound, &my->priority); Param_getInt(param, argv[0], "qsize", ¶mWasFound, &my->queueSize); Param_getString(param, argv[0], "verb", ¶mWasFound, my->verbosity); + Param_getInt(param, argv[0], "evtid", ¶mWasFound, &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); } -- 2.43.0