Commit 80cda74d authored by LEGEARD Luc's avatar LEGEARD Luc
Browse files

Changes for GetMFM

parent 76b5e30b
......@@ -91,7 +91,7 @@ DataScal.cc MFMCoboFrame.cc MFMHelloFrame.cc MFMRibfFrame.cc
MFMCoboTopoFrame.cc MFMMergeFrame.cc MFMS3AlphaFrame.cc MFMVamosICFrame.cc MFMParisFrame.cc
MError.cc MFMCommonFrame.cc MFMMutantFrame.cc MFMS3BaF2Frame.cc MFMVamosPDFrame.cc MFMReaGenericFrame.cc
MFMBasicFrame.cc MFMDiamantFrame.cc MFMNedaCompFrame.cc MFMS3eGUNFrame.cc MFMVamosTACFrame.cc MFMReaTraceFrame.cc
MFMSiriusFrame.cc MFMS3DeflectorFrame.cc GanTape/acq_ebyedat_get_next_event.cxx
MFMSiriusFrame.cc MFMS3DeflectorFrame.cc GanTape/acq_ebyedat_get_next_event.cxx GanTape/gan_acq_swap_buf.c
)
set(HEADERSlib
......
......@@ -3,8 +3,11 @@
#define __CUtilities__
#include <string>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
//
// Few util classes for vectors management
//
......
......@@ -25,9 +25,10 @@
* B. Raine le 20 sept 99
* Remplacement de GEN_TYPE.H par gen_type.h
* Suppression des includes gan_tape_param.h et gan_tape_general.h
* *
* B. Legeard le 25 nov 2021
* SwapInt16 -> GanSwapInt16
****************************************************************************/
bool AutoswBuf,Swbufon;
#include <stdio.h>
#include <string.h>
#include "GEN_TYPE.H"
......@@ -35,7 +36,11 @@
#include "gan_acq_swap_buf.h"
#include "gan_tape_erreur.h"
/* Definition des routines de traitement en fonction du type de buffer */
#ifndef boolbool
typedef enum BOOL {false,true} boolbool;
#endif
boolbool AutoswBuf,Swbufon;
/* Prototypes des routines internes au package */
static int T_LSB(void);
......@@ -162,7 +167,7 @@ void SwapInt32(UNSINT32 *Buf, int NbOctets)
}
}
void SwapInt16(UNSINT16 *Buf, int NbOctets)
void GanSwapInt16(UNSINT16 *Buf, int NbOctets)
{
SW_MOT16 Temp, *Mot16;
int i, NbMots;
......@@ -189,7 +194,7 @@ static int SwapNumBuf(in2p3_buffer_struct *Buff, int Size)
static int SwapEvent(in2p3_buffer_struct *Buff, int Size)
{
SwapNumBuf(Buff, Size);
SwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
GanSwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
return(ACQ_OK);
}
......@@ -198,7 +203,7 @@ static int SwapJbus(in2p3_buffer_struct *Buff, int Size)
{
SwapNumBuf(Buff, Size);
SwapInt32(&Buff->les_donnees.cas.scale.Length, SCALE_HEADER_LEN);
SwapInt16(Buff->les_donnees.cas.scale.jbus_scale.Info_jbus,
GanSwapInt16(Buff->les_donnees.cas.scale.jbus_scale.Info_jbus,
Size - IN2P3_HEADER_LEN - SCALE_HEADER_LEN);
return(ACQ_OK);
......@@ -224,7 +229,7 @@ static int SwTraiteFileh(in2p3_buffer_struct *Buff)
{
int err = ACQ_OK;
extern bool AutoswBuf; /* Valeurs extraites en ligne de commande */
extern boolbool AutoswBuf; /* Valeurs extraites en ligne de commande */
/* les valeurs sont issues de exemple_relecture. */
if (strncmp(Buff->les_donnees.cas.Buf_fileh.OrdreOctets, " MSB", 4) == 0 )
......@@ -250,7 +255,7 @@ static int SwTraiteFileh(in2p3_buffer_struct *Buff)
int acq_swap_buf(in2p3_buffer_struct *Buff, int Size)
{
extern bool AutoswBuf,Swbufon; /* Valeurs extraites en ligne de commande */
extern boolbool AutoswBuf,Swbufon; /* Valeurs extraites en ligne de commande */
char Header[9];
int err = ACQ_OK;
......@@ -328,7 +333,7 @@ static int SwapEventdbToHost(in2p3_buffer_struct *Buff, int Size)
/* inversion des 4 octets du numero de buffer */
SwapInt32(&Buff->les_donnees.Count,4);
SwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
GanSwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
}
return(ACQ_OK);
......@@ -338,12 +343,12 @@ static int SwapEventdbSwapToHost(in2p3_buffer_struct *Buff, int Size)
{
if (Machine_LSB) /* machine little-endian */
{
SwapInt16((UNSINT16 *)Buff, Size);
GanSwapInt16((UNSINT16 *)Buff, Size);
}
else /* machine big-endian */
{
/* swappe Byte/Byte l'ident ASCII */
SwapInt16((UNSINT16 *)Buff,8);
GanSwapInt16((UNSINT16 *)Buff,8);
/* swappe Word/Word le numero de buffer */
SwapDoubleWord(&Buff->les_donnees.Count,4);
......@@ -359,7 +364,7 @@ static int SwapEventctToHost(in2p3_buffer_struct *Buff, int Size)
/* inversion des 4 octets du numero de buffer */
SwapInt32(&Buff->les_donnees.Count,4);
SwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
GanSwapInt16(Buff->les_donnees.cas.Buff, Size - IN2P3_HEADER_LEN);
}
return(ACQ_OK);
......@@ -369,12 +374,12 @@ static int SwapEventctSwapToHost(in2p3_buffer_struct *Buff, int Size)
{
if (Machine_LSB) /* machine little-endian */
{
SwapInt16((UNSINT16 *)Buff, Size);
GanSwapInt16((UNSINT16 *)Buff, Size);
}
else /* machine big-endian */
{
/* swappe Byte/Byte l'ident ASCII */
SwapInt16((UNSINT16 *)Buff,8);
GanSwapInt16((UNSINT16 *)Buff,8);
/* swappe Word/Word le numero de buffer */
SwapDoubleWord(&Buff->les_donnees.Count,4);
......@@ -390,7 +395,7 @@ static int SwapJbusToHost(in2p3_buffer_struct *Buff, int Size)
/* inversion des 4 octets du numero de buffer et des 5 mots de 32 bits suivants */
SwapInt32(&Buff->les_donnees.Count,24);
SwapInt16(Buff->les_donnees.cas.scale.jbus_scale.Info_jbus,
GanSwapInt16(Buff->les_donnees.cas.scale.jbus_scale.Info_jbus,
Size - IN2P3_HEADER_LEN - SCALE_HEADER_LEN);
}
......@@ -401,12 +406,12 @@ static int SwapJbusSwapToHost(in2p3_buffer_struct *Buff, int Size)
{
if (Machine_LSB) /* machine little-endian */
{
SwapInt16((UNSINT16 *)Buff, Size);
GanSwapInt16((UNSINT16 *)Buff, Size);
}
else /* machine big-endian */
{
/* swappe Byte/Byte l'ident ASCII */
SwapInt16((UNSINT16 *)Buff,8);
GanSwapInt16((UNSINT16 *)Buff,8);
/* swappe Word/Word le numero de buffer */
SwapDoubleWord(&Buff->les_donnees.Count,4);
......@@ -426,7 +431,7 @@ static int SwapScalerToHost(in2p3_buffer_struct *Buff, int Size)
SwapInt32(&Buff->les_donnees.Count,(Size - IN2P3_HEADER_LEN - 26));
/* swappe Byte/Byte du checksum et du nombre d'evts */
SwapInt16( ( (UNSINT16 *)Buff + ((Size - 30) / 2) ) , 6 );
GanSwapInt16( ( (UNSINT16 *)Buff + ((Size - 30) / 2) ) , 6 );
}
return(ACQ_OK);
......@@ -436,12 +441,12 @@ static int SwapScalerSwapToHost(in2p3_buffer_struct *Buff, int Size)
{
if (Machine_LSB) /* machine little-endian */
{
SwapInt16((UNSINT16 *)Buff, Size);
GanSwapInt16((UNSINT16 *)Buff, Size);
}
else /* machine big-endian */
{
/* swappe Byte/Byte l'ident ASCII */
SwapInt16((UNSINT16 *)Buff,8);
GanSwapInt16((UNSINT16 *)Buff,8);
/* swappe Word/Word le numero de buffer et ce qui suit sauf le checksum */
SwapDoubleWord(&Buff->les_donnees.Count,(Size - IN2P3_HEADER_LEN - 26));
......@@ -454,12 +459,12 @@ static int SwapStatusSwapToHost(in2p3_buffer_struct *Buff, int Size)
{
if (Machine_LSB) /* machine little-endian */
{
SwapInt16((UNSINT16 *)Buff, Size);
GanSwapInt16((UNSINT16 *)Buff, Size);
}
else /* machine big-endian */
{
/* swappe Byte/Byte l'ident ASCII */
SwapInt16((UNSINT16 *)Buff, 8);
GanSwapInt16((UNSINT16 *)Buff, 8);
/* swappe Word/Word le numero de buffer */
SwapDoubleWord(&Buff->les_donnees.Count, 4);
......@@ -468,7 +473,7 @@ static int SwapStatusSwapToHost(in2p3_buffer_struct *Buff, int Size)
SwapDoubleWord(&Buff->les_donnees.cas.status.Length, 4);
/* swappe Byte/Byte le nom du frontal VME */
SwapInt16((UNSINT16 *)Buff->les_donnees.cas.status.VmeName, 16);
GanSwapInt16((UNSINT16 *)Buff->les_donnees.cas.status.VmeName, 16);
}
return(ACQ_OK);
......@@ -484,13 +489,13 @@ static int SwapEbyedat(in2p3_buffer_struct *Buff, int Size)
SwapInt32((UNSINT32 *)&bufhd->num, 8);
/* swappe source_id, dest_id, le numero de flux et le nombre d'evts */
SwapInt16((UNSINT16 *)&bufhd->source_id, 8);
GanSwapInt16((UNSINT16 *)&bufhd->source_id, 8);
/* swappe le checksum 32 bits et la longueur utile du buffer */
SwapInt32((UNSINT32 *)&bufhd->checksum, 8);
/* Swappe le reste du buffer */
SwapInt16((UNSINT16 *)((char *)Buff + GANIL_BUF_HD_SIZE), Size - GANIL_BUF_HD_SIZE );
GanSwapInt16((UNSINT16 *)((char *)Buff + GANIL_BUF_HD_SIZE), Size - GANIL_BUF_HD_SIZE );
return(ACQ_OK);
}
......
......@@ -34,7 +34,7 @@ int acq_swap_buf(in2p3_buffer_struct *Buff, int Size);
sur la valeur de NbOctets. Ce doit etre un multiple de 4 pour SwapInt32 et
un multiple de 2 pour SwapInt16 */
void SwapInt32(UNSINT32 *Buf, int NbOctets);
void SwapInt16(UNSINT16 *Buf, int NbOctets);
void GanSwapInt16(UNSINT16 *Buf, int NbOctets);
void SwapDoubleWord(UNSINT32 *Buf, int NbOctets);
#ifdef __cplusplus
......
......@@ -42,6 +42,7 @@
#define ACQ_INVARG -15
#define ACQ_ERRDATABUF -16
#define ACQ_BADEVENTFORM -17
#define ACQ_NOBUF -18
#endif
......
......@@ -10,7 +10,7 @@
#include "MFMNumExoFrame.h"
#define REA_GENERIC_NB_STATUS 2
#define MFM_REA_GENE_TYPE_TXT "MFM_REA_GENE_TYPE"
#define MFM_REA_GENE_TYPE_TXT "MFM_REA_GENE_FRAME_TYPE"
#pragma pack(push, 1) // force alignment
......
#define MFM_VERSION "v21.10.06"
#define MFM_VERSION "v21.11.30"
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