From: hades Date: Sun, 21 May 2000 18:35:47 +0000 (+0000) Subject: Somehow added the taping via *AnsiTape functions. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5844da6f5dfcb71fe2b6f174fe478d7f69918b61;p=daqdata.git Somehow added the taping via *AnsiTape functions. --- diff --git a/hadaq/evt.c b/hadaq/evt.c index 2be94d2..0ab739c 100644 --- a/hadaq/evt.c +++ b/hadaq/evt.c @@ -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 @@ -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) { diff --git a/hadaq/evt.h b/hadaq/evt.h index a7fa41f..42b218f 100644 --- a/hadaq/evt.h +++ b/hadaq/evt.h @@ -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); diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index 79963f0..7544c99 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.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 @@ -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); }