]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Somehow added the taping via *AnsiTape functions.
authorhades <hades>
Sun, 21 May 2000 18:35:47 +0000 (18:35 +0000)
committerhades <hades>
Sun, 21 May 2000 18:35:47 +0000 (18:35 +0000)
hadaq/evt.c
hadaq/evt.h
hadaq/evtbuild.c

index 2be94d27c65ad9d1fda8379fd2715d47ccd4ff31..0ab739c2902c4792243665d5bed8200d9b6804de 100644 (file)
@@ -1,4 +1,4 @@
-static char rcsId[] = "$Id: evt.c,v 6.4 2000-04-18 07:26:55 muench Stab $";
+static char rcsId[] = "$Id: evt.c,v 6.5 2000-05-21 18:35:47 hades Exp $";
 
 #define _ANSI_C_SOURCE
 #include <stddef.h>
@@ -11,6 +11,7 @@ static char rcsId[] = "$Id: evt.c,v 6.4 2000-04-18 07:26:55 muench Stab $";
 
 #include "evt.h"
 #include "subevt.h"
+#include "ansiTape.h"
 
 enum EvtIdx {
        EvtIdx_size,
@@ -186,6 +187,11 @@ int Evt_write(void *my, FILE * file)
        return fwrite(my, 1, Evt_paddedSize(my), file);
 }
 
+int Evt_writeTape(void *my, AnsiTape *tape)
+{
+       return writeAnsiTape(tape, my, Evt_paddedSize(my));
+}
+
 void *Evt_appendSubEvt(void *my, void *subEvt)
 {
        if (SubEvt_decoding(subEvt) == SubEvtDecoding_SubEvts) {
index a7fa41fa8966a21234c2d20c202cc8ef90c07e77..42b218f1a680483524cd2ff087fa3256533db0bb 100644 (file)
@@ -59,6 +59,7 @@ void Evt_setRunNr(void *my, UInt4 runNr);
 void *newEvt(UInt4 decoding, UInt4 id, UInt4 runNr);
 void deleteEvt(void *my);
 int Evt_write(void *my, FILE * file);
+int Evt_writeTape(void *my, void *tape);
 void *Evt_fget(FILE * file);
 void *Evt_appendSubEvt(void *my, void *subEvt);
 
index 79963f064c379f92fb566b3673f8bec411fe3503..7544c99c36cc5a0213d0fb564447ed1212c0d6ab 100644 (file)
@@ -1,4 +1,4 @@
-static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.13 2000-05-20 00:28:50 hades Exp $";
+static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.14 2000-05-21 18:35:47 hades Exp $";
 
 #define _XOPEN_SOURCE
 #include <unistd.h>
@@ -20,7 +20,7 @@ static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/had
 #include "evt.h"
 #include "subevt.h"
 #include "shmtrans.h"
-#include "tape.h"
+#include "ansiTape.h"
 
 static jmp_buf terminateJmp;
 
@@ -146,6 +146,7 @@ int main(int argc, char *argv[])
        char *outDev;
        int priority;
        FILE *outFile;
+       AnsiTape *outTape;
        void *subEvt;
        UInt4 nrOfSubEvts = 0;
        UInt4 runNr;
@@ -237,7 +238,7 @@ int main(int argc, char *argv[])
                        }
                }
        } else if (strcmp(outDev, "tape") == 0) {
-               if (NULL == (outFile = openTape(outPath))) {
+               if (NULL == (outTape = openAnsiTape(outPath))) {
                        msglog(LOG_ERR, "%s, %d: %s\n", __FILE__, __LINE__, strerror(errno));
                        exit(EXIT_FAILURE);
                }
@@ -253,9 +254,10 @@ int main(int argc, char *argv[])
        }
        if (nrOfMsgs == 0) {
                /* 
-                  no '-m' option was on command line, we assume that the readout task
-                  (daq_readout) is running on the same node and communicates directly
-                  via shared memory */
+                  no '-m' option was on command line, we assume that the
+                  readout task (daq_readout) is running on the same node and
+                  communicates directly via shared memory
+                */
                shmTrans = allocMem(sizeof(ShmTrans *));
                hadTuQueue = allocMem(sizeof(HadTuQueue *));
 
@@ -285,7 +287,11 @@ int main(int argc, char *argv[])
                evt = appendFile(evt, slowCtrlFiles[i]);
        }
        if (outFile != NULL) {
-               Evt_write(evt, outFile);
+               if (strcmp(outDev, "file")) {
+                       Evt_write(evt, outFile);
+               } else if (strcmp(outDev, "tape")) {
+                       Evt_writeTape(evt, outTape);
+               }
        }
        deleteEvt(evt);
 
@@ -347,7 +353,11 @@ int main(int argc, char *argv[])
                }
                if (currNrOfSubEvts == nrOfSubEvts) {
                        if (outFile != NULL) {
-                               Evt_write(evt, outFile);
+                               if (strcmp(outDev, "file")) {
+                                       Evt_write(evt, outFile);
+                               } else if (strcmp(outDev, "tape")) {
+                                       Evt_writeTape(evt, outTape);
+                               }
                        }
                        Evt_online(evt);
                        (*evtsComplete)++;
@@ -364,7 +374,11 @@ int main(int argc, char *argv[])
                evt = appendFile(evt, slowCtrlFiles[i]);
        }
        if (outFile != NULL) {
-               Evt_write(evt, outFile);
+               if (strcmp(outDev, "file")) {
+                       Evt_write(evt, outFile);
+               } else if (strcmp(outDev, "tape")) {
+                       Evt_writeTape(evt, outTape);
+               }
        }
        deleteEvt(evt);
 
@@ -372,7 +386,7 @@ int main(int argc, char *argv[])
 
        if (outFile != NULL) {
                if (strcmp(outDev, "tape") == 0) {
-                       if (-1 == closeTape(outFile, *bytesWritten, outPath)) {
+                       if (-1 == closeAnsiTape(outTape)) {
                                msglog(LOG_ERR, "%s, %d: %s\n", __FILE__, __LINE__, strerror(errno));
                                exit(EXIT_FAILURE);
                        }