Commit 0968563a authored by LEGEARD Luc's avatar LEGEARD Luc
Browse files

few improvements and remove a bug in...

 few improvements and remove a bug in MFMScalerDataFrame:FillDataWithRamdomValue,some time size of frame was not calculated
parent 20b0c360
......@@ -81,6 +81,16 @@ void SetExternalPointers(char* buff, int size){
fPt = buff;
IsSpaceInstanciedInThisClass= false;
}
//_______________________________________________________________________________
void SetExternalPointers(UtilVector_c* vect){
fUsedSize = vect->GetUsedSize();
fSize = vect->GetSize();;
fPtTempo = NULL;
if(fPt and IsSpaceInstanciedInThisClass) free(fPt);
fPt = vect->GetPointer();
IsSpaceInstanciedInThisClass= false;
}
//_______________________________________________________________________________
void ReSize(int size) {
......@@ -153,7 +163,12 @@ void CopyAndResizeIfNecessary(char* givenPt,int size) {
memcpy (fPt,givenPt,size);
}
//_______________________________________________________________________________
void DumpRaw( int dumpsize, int increment=0,
std::string * mydump =NULL) const{
void *point = fPt;
DumpRaw(point,dumpsize,increment, mydump) ;
}
//_______________________________________________________________________________
void DumpRaw(void *point, int dumpsize, int increment=0,
std::string * mydump =NULL) const{
......
......@@ -59,10 +59,11 @@ int DataParameters::Fill(const char *buffParam) {
//and parsed by this method to create the list of labels.
//We work on a copy of buffParam because strtok_r modify his parameters
char workString[strlen(buffParam)];
strcpy(workString, buffParam);
char nomParam[20];
char nomParam[256];
int numPar, nbBits, depth;
char *param, *paramElem;
......@@ -98,7 +99,7 @@ int DataParameters::Fill(const char *buffParam) {
//______________________________________________________________________________
void DataParameters::FillLabelToExist() {
// fill vector fLabelToExist
DataPar *par;
int index = 0;
int current_label;
......@@ -110,6 +111,7 @@ void DataParameters::FillLabelToExist() {
}
//______________________________________________________________________________
void DataParameters::FillLabelToIndexVectors() {
// fill vector fLabelToIndex
uint32_t index = 0;
DataPar *par;
int current_label;
......
//////////////////////////////////////////////////////////////////////////
//
// Class to manage list of parameters ( also called literal label) with their numerical label.
// ---------------------------------------------------------------------------
/***************************************************************************
* *
......
......@@ -86,7 +86,7 @@ int MFMBasicFrame::GetNbItems()const{
//_______________________________________________________________________________
void MFMBasicFrame::SetHeaderSize(int headersize) {
/// Set frame header size
((MFM_basic_header*)pHeader)->ext.headerSize = (uint16_t) headersize;
((MFM_basic_header*)pHeader)->ext.headerSize =(uint16_t)headersize;
fHeaderSize = headersize;
}
......@@ -94,7 +94,7 @@ void MFMBasicFrame::SetHeaderSize(int headersize) {
void MFMBasicFrame::SetItemSize(int itemsize) {
/// Set frame item size
fItemSize = itemsize;
((MFM_basic_header*)pHeader)->ext.itemSize = itemsize;
((MFM_basic_header*)pHeader)->ext.itemSize =(uint16_t) itemsize;
}
//_______________________________________________________________________________
void MFMBasicFrame::SetNbItem(int nbitems) {
......
......@@ -488,7 +488,7 @@ void MFMCommonFrame::MFM_make_header(int unitBlock_size, int dataSource,
//_______________________________________________________________________________
void MFMCommonFrame::SetBufferSize(int size, bool ifinferior) {
/// Do memory allocation or a reallacation for frame\n
/// if ifinferior==true the allocaton is forced to size event if the acutal size is bigger\n
/// if ifinferior==true the allocaton is forced to size even if the acutal size is bigger\n
if (size == fBufferSize)
return;
if (!ifinferior or (size > fBufferSize)) {
......
......@@ -205,13 +205,14 @@ void MFMScalerDataFrame::FillScalerWithVector(uint64_t timestamp,uint32_t EventC
if (sizeofvector%nbOfParaInItem !=0) cout <<" error de taille de vecteur\n";
SetAttributs();
int oldframesize = GetFrameSize();
nbitem = (uint32_t)(sizeofvector/nbOfParaInItem);
int framesize = nbitem*sizeof(MFM_ScalerData_Item)+SCALER_DATA_HEADERSIZE ;
;
if (oldframesize != framesize){
//TODO reagencement de la frame si oldframesize != framesize
if (oldframesize != framesize) {
//TODO reagencement de la frame si oldframesize != framesize
int ubs= SCALER_STD_UNIT_BLOCK_SIZE;
if (framesize%ubs==0)
framesize=framesize/ubs ;
......
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