Commit 891c47ed authored by LEGEARD Luc's avatar LEGEARD Luc
Browse files

new fucntion GetTextGanError() and remove a minor bug in MFMParisFrame

parent 80cda74d
......@@ -89,7 +89,7 @@
#include "str_evt.h"
#include "gan_acq_buf.h"
//#include "acq_ebyedat_get_next_event.h"
#include "gan_tape_erreur.h"gan_tape_erreur.h
#include "gan_tape_erreur.h"
*/
#include <stdio.h>
#include "GEN_TYPE.H"
......@@ -119,6 +119,7 @@ static void dump(char *p, int nb);
//#define EventMaxLen 0x4000
//#define EventMaxLen 0x8000
#define EventMaxLen 0x40000
//_______________________________________________________________________________
int acq_ebyedat_get_next_event_r(UNSINT16 * Buffer, UNSINT16 ** EvtAddr,
int * EvtNum, int EvtFormat, UNSINT16 **CurrentEvent,
......@@ -719,6 +720,7 @@ static void dump(char *p, int nb) {
}
printf("\n\r");
}
//_______________________________________________________________________________
int acq_ebyedat_get_next_event(UNSINT16 * Buffer, UNSINT16 ** EvtAddr,
int * EvtNum, int EvtFormat, int* nbsubevt, long long** timestamps) {
......@@ -728,3 +730,35 @@ int acq_ebyedat_get_next_event(UNSINT16 * Buffer, UNSINT16 ** EvtAddr,
&CurrentEvent, &NextEvent, nbsubevt, timestamps));
}
//_______________________________________________________________________________
const char * GetTextGanError(int error) {
if (error == ACQ_OK) return ACQ_OK_TXT;
if (error == ACQ_ERRPARAM) return ACQ_ERRPARAM_TXT;
if (error == ACQ_ISNOTATAPE) return ACQ_ISNOTATAPE_TXT;
if (error == ACQ_NOTALLOC) return ACQ_NOTALLOC_TXT;
if (error == ACQ_NOTMOUNT) return ACQ_NOTMOUNT_TXT;
if (error == ACQ_ALREADYMOUNT) return ACQ_ALREADYMOUNT_TXT;
if (error == ACQ_ENDOFFILE) return ACQ_ENDOFFILE_TXT;
if (error == ACQ_ENDOFTAPE) return ACQ_ENDOFTAPE_TXT;
if (error == ACQ_ERRDURREAD) return ACQ_ERRDURREAD_TXT;
if (error == ACQ_DEVWRITLOCK) return ACQ_DEVWRITLOCK_TXT;
if (error == ACQ_ENDOFBUFFER) return ACQ_ENDOFBUFFER_TXT;
if (error == ACQ_INVDATABUF) return ACQ_INVDATABUF_TXT;
if (error == ACQ_RAFBUFOVF) return ACQ_RAFBUFOVF_TXT;
if (error == ACQ_ERREVNTLEN) return ACQ_ERREVNTLEN_TXT;
if (error == ACQ_INVARG) return ACQ_INVARG_TXT;
if (error == ACQ_ERRDATABUF) return ACQ_ERRDATABUF_TXT;
if (error == ACQ_BADEVENTFORM) return ACQ_BADEVENTFORM_TXT;
if (error == ACQ_NOBUF) return ACQ_NOBUF_TXT;
if (error == ACQ_UNKBUF) return ACQ_UNKBUF_TXT;
if (error == ACQ_UNKMSB) return ACQ_UNKMSB_TXT;
if (error == ACQ_NOBEGINRUN) return ACQ_NOBEGINRUN_TXT;
if (error == ACQ_BADFILESTRUCT) return ACQ_BADFILESTRUCT_TXT;
if (error == ACQ_BADEVTSTRUCT) return ACQ_BADEVTSTRUCT_TXT;
if (error == ACQ_BADRUNNUM) return ACQ_BADRUNNUM_TXT;
if (error == ACQ_STREVTTMP) return ACQ_STREVTTMP_TXT;
if (error == ACQ_NOIMPLEMENTED) return ACQ_NOIMPLEMENTED_TXT;
return "Unknow error";
}
//_______________________________________________________________________________
......@@ -43,9 +43,30 @@
#define ACQ_ERRDATABUF -16
#define ACQ_BADEVENTFORM -17
#define ACQ_NOBUF -18
#endif
#define ACQ_OK_TXT "ACQ_OK"
#define ACQ_ERRPARAM_TXT "ACQ_ERRPARAM"
#define ACQ_ISNOTATAPE_TXT "ACQ_ISNOTATAPE"
#define ACQ_NOTALLOC_TXT "ACQ_NOTALLOC"
#define ACQ_ALRALLOC_TXT "ACQ_ALRALLOC"
#define ACQ_NOTMOUNT_TXT "ACQ_NOTMOUNT"
#define ACQ_ALREADYMOUNT_TXT "ACQ_ALREADYMOUNT"
#define ACQ_ENDOFFILE_TXT "ACQ_ENDOFFILE"
#define ACQ_ENDOFTAPE_TXT "ACQ_ENDOFTAPE"
#define ACQ_ERRDURREAD_TXT "ACQ_ERRDURREAD"
#define ACQ_DEVWRITLOCK_TXT "ACQ_DEVWRITLOCK"
#define ACQ_ENDOFBUFFER_TXT "ACQ_ENDOFBUFFER"
#define ACQ_INVDATABUF_TXT "ACQ_INVDATABUF"
#define ACQ_RAFBUFOVF_TXT "ACQ_RAFBUFOVF"
#define ACQ_ERREVNTLEN_TXT "ACQ_ERREVNTLEN"
#define ACQ_INVARG_TXT "ACQ_INVARG"
#define ACQ_ERRDATABUF_TXT "ACQ_ERRDATABUF"
#define ACQ_BADEVENTFORM_TXT "ACQ_BADEVENTFORM"
#define ACQ_NOBUF_TXT "ACQ_NOBUF"
/* Erreurs implementees uniquement pour Exemple_relecture */
/* Attention, ils doivent etre utilises a la fois sous UINIX et sous VMS */
......@@ -60,8 +81,21 @@
#define ACQ_NOIMPLEMENTED -107 /* functionnality non implemented for this OS */
#define ACQ_UNKBUF_TXT "ACQ_UNKBUF"
#define ACQ_UNKMSB_TXT "ACQ_UNKMSB"
#define ACQ_NOBEGINRUN_TXT "ACQ_NOBEGINRUN"
#define ACQ_BADFILESTRUCT_TXT "ACQ_BADFILESTRUCT"
#define ACQ_BADEVTSTRUCT_TXT "ACQ_BADEVTSTRUCT"
#define ACQ_BADRUNNUM_TXT "ACQ_BADRUNNUM"
#define ACQ_STREVTTMP_TXT "ACQ_STREVTTMP"
#define ACQ_NOIMPLEMENTED_TXT "ACQ_NOIMPLEMENTED"
void gan_tape_erreur ( int , char * );
const char * GetTextGanError(int error);
#endif
......@@ -107,21 +107,23 @@ void MFMParisFrame::FillDataWithRamdomValue(uint64_t timestamp,
//_______________________________________________________________________________
string MFMParisFrame::GetHeaderDisplay(char* infotext)const{
std::stringstream ss;
std::string display("");
ss << MFMNumExoFrame::GetHeaderDisplay(infotext);
ss << std::endl;
ss << " qShort = " << GetQShort() ;
ss << " qLong = " << GetQLong() << " CFD = " << GetCfd() << " [ns]";
ss << std::endl;
ss << " Flags = " << std::hex << ((MFM_paris_frame*) pHeader)->Data.Flags << std::dec ;
ss << " PLL unlock " << ((GetPLL()) ? "true" : "false");
ss << " PUR " << ((GetPUR()) ? "true" : "false");
ss << " OVR " << ((GetOVR()) ? "true" : "false");
stringstream ss;
string display("");
display = ss.str();
ss << MFMCommonFrame::GetHeaderDisplay(infotext) ;
ss << " Channel = " << GetTGCristalId();
ss << std::endl;
ss << " qShort = " << GetQShort() ;
ss << " qLong = " << GetQLong() << " CFD = " << GetCfd() << " [ns]";
ss << std::endl;
ss << " Flags = " << std::hex << ((MFM_paris_frame*) pHeader)->Data.Flags << std::dec ;
ss << " PLL unlock " << ((GetPLL()) ? "true" : "false");
ss << " PUR " << ((GetPUR()) ? "true" : "false");
ss << " OVR " << ((GetOVR()) ? "true" : "false");
display = ss.str();
return display;
display = ss.str();
return display;
}
//_______________________________________________________________________________
......
#define MFM_VERSION "v21.11.30"
#define MFM_VERSION "v21.12.02"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment