]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
New scheme to fetch parameters -- mm
authorhadaq <hadaq>
Wed, 9 Oct 2002 16:00:20 +0000 (16:00 +0000)
committerhadaq <hadaq>
Wed, 9 Oct 2002 16:00:20 +0000 (16:00 +0000)
hadaq/param.tcl
hadaq/readout.c

index f0c67e3621938b11dafad22aba4ec31dee281c07..776fbfbca289d28483f0c15d3dc76f9495cd89c6 100644 (file)
@@ -50,10 +50,60 @@ set ipc9(cardbase) 0xa00000
 set ipc10(cardbase) 0xb00000
 set ipc11(cardbase) 0xc00000
 
+set rich2(unit0) race10
+set rich2(unit1) race11
+set rich2(unit2) race0
+set rich2(unit3) race1
+
+set rich1(unit0) race2
+set rich1(unit1) race3
+set rich1(unit2) race4
+set rich1(unit3) race5
+
+set rich0(unit0) race6
+set rich0(unit1) race7
+set rich0(unit2) race8
+set rich0(unit3) race9
+
+set race0(cardtype) race
+set race1(cardtype) race
+set race2(cardtype) race
+set race3(cardtype) race
+set race4(cardtype) race
+set race5(cardtype) race
+set race6(cardtype) race
+set race7(cardtype) race
+set race8(cardtype) race
+set race9(cardtype) race
+set race10(cardtype) race
+set race11(cardtype) race
+
 set race0(cardbase) 0x00000000
 set race1(cardbase) 0x10000000
-set race2(cardbase) 0x20000000
-set race3(cardbase) 0x30000000
+set race10(cardbase) 0x20000000
+set race11(cardbase) 0x30000000
+set race2(cardbase) 0x00000000
+set race3(cardbase) 0x10000000
+set race4(cardbase) 0x20000000
+set race5(cardbase) 0x30000000
+set race6(cardbase) 0x00000000
+set race7(cardbase) 0x10000000
+set race8(cardbase) 0x20000000
+set race9(cardbase) 0x30000000
+
+set race0(status_id) 100
+set race1(status_id) 101
+set race10(status_id) 102
+set race11(status_id) 103
+set race4(status_id) 100
+set race5(status_id) 101
+set race2(status_id) 102
+set race3(status_id) 103
+set race6(status_id) 100
+set race7(status_id) 101
+set race8(status_id) 102
+set race9(status_id) 103
+
 set conc(cardbase)  0x18000000
 set mu(cardbase)    0xd0000000
 
index 7bb1367e581c717359c0ebaecd3ea9c38403d550..2f64822c570435d8f6295573bb596c1fb8624cac 100644 (file)
@@ -1,5 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/readout.c,v 6.23 2002-10-09 12:42:18 hadaq Exp $";
-
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/readout.c,v 6.24 2002-10-09 16:00:20 hadaq Exp $";
 
 #define _POSIX_C_SOURCE 199309L
 #define SYSLOG_NAMES
@@ -28,6 +27,7 @@ typedef struct TheArgsS {
        unsigned long priority;
        unsigned long queueSize;
        char verbosity[PARAM_MAX_VALUE_LEN];
+       char subsystem[PARAM_MAX_VALUE_LEN];
 } TheArgs;
 
 static jmp_buf terminateJmp;
@@ -49,6 +49,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, "subsystem: %s", my->subsystem);
 }
 
 static void argsDefault(TheArgs *my) {
@@ -57,13 +58,14 @@ static void argsDefault(TheArgs *my) {
        my->isStandalone = 1;
        my->queueSize = 1 * 1024 * 1024;
        strcpy(my->verbosity, "info");
+       strcpy(my->subsystem, "unknown");
 }
 
 static int argsFromCL(TheArgs *my, int argc, char *argv[]) {
        extern char *optarg;
        int i;
 
-       while ((i = getopt(argc, argv, "w:ap:q:v:")) != -1) {
+       while ((i = getopt(argc, argv, "w:ap:q:s:v:")) != -1) {
                switch (i) {
                case 'w':
                        my->waterMark = atoi(optarg);
@@ -77,6 +79,9 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) {
                case 'q':
                        my->queueSize = atoi(optarg);
                        break;
+               case 's':
+                       strcpy(my->subsystem, optarg);
+                       break;
                case 'v':
                        strcpy(my->verbosity, optarg);
                        break;
@@ -98,6 +103,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_getString(param, argv[0], "subsystem", &paramWasFound, my->subsystem);
        desParam(param);
 }
 
@@ -115,6 +121,7 @@ static void storeInfoStart(const char *n, time_t t, TheArgs *my) {
        Param_storeInt(p, n, "prio", my->priority);
        Param_storeInt(p, n, "qsize", my->queueSize);
        Param_storeString(p, n, "verb", my->verbosity);
+       Param_storeString(p, n, "subsystem", my->subsystem);
        desParam(p);
 }
 
@@ -173,7 +180,7 @@ int  main(int argc, char *argv[])
                syslog(LOG_ERR, "connecting to agent: %s", strerror(errno));
                goto bailOut0;
        }
-       if (NULL == (hw = newHardware())) {
+       if (NULL == (hw = newHardware(theArgs->subsystem))) {
                syslog(LOG_ERR, "initializing hardware: %s", strerror(errno));
                goto bailOut1;
        }