Commit 69122812 authored by yannick legoc's avatar yannick legoc
Browse files

removed useless GG controller list from LISTMODE_S block

parent 20ac8cf7
......@@ -546,8 +546,6 @@ void DPPAcquisitionController::setContext() {
DataBlock* decodeListModeBlock(AsciiDataFileManager* dataFileManager, AsciiDataFile* dataFile, string blockType, typename boost::tokenizer<boost::char_separator<char> >::iterator iter, typename boost::tokenizer<boost::char_separator<char> >::iterator end) {
cout << "decodeListModeBlock" << endl;
// Change
// - tok1.end() into end
// - getAbstractController into dataFileManager->getAbstractController
......@@ -555,24 +553,6 @@ DataBlock* decodeListModeBlock(AsciiDataFileManager* dataFileManager, AsciiDataF
// - creation of the block to copy and return the block
// - goto error into return NULL
// Get number of GEGE
if (++iter == end) {
return NULL;
}
uint32 nbgeges = (uint32) strtol((*iter).c_str(), NULL, 10);
vector<AbstractController*> gegecontrollers;
for(uint32 i=0;i<nbgeges;++i) {
AbstractController* controller = NULL;
if (++iter == end) {
return NULL;
}
if ((*iter).empty() == false) {
controller = dataFileManager->getAbstractController(*iter);
}
gegecontrollers.push_back(controller);
}
// Get number of detector controller
if (++iter == end) {
return NULL;
......@@ -591,7 +571,7 @@ DataBlock* decodeListModeBlock(AsciiDataFileManager* dataFileManager, AsciiDataF
detectorcontrollers.push_back(detector);
}
npp::ListModeBlock * newBlock = new npp::ListModeBlock(nbgeges, gegecontrollers, nbdetectors, detectorcontrollers);
npp::ListModeBlock * newBlock = new npp::ListModeBlock(nbdetectors, detectorcontrollers);
dataFile->addDataBlock(newBlock);
return newBlock;
......
......@@ -27,9 +27,8 @@ using namespace lstdpp128;
namespace npp {
ListModeBlock::ListModeBlock(uint32 nbgeges, const vector<AbstractController*>& gegeControllers, uint32 nbdetectors,
const vector<AbstractController*>& detectorControllers) :
DataBlock(true), m_NbGeges(nbgeges), m_GegeControllers(gegeControllers), m_NbDetectors(nbdetectors), m_DetectorControllers(
ListModeBlock::ListModeBlock(uint32 nbdetectors, const vector<AbstractController*>& detectorControllers) :
DataBlock(true), m_NbDetectors(nbdetectors), m_DetectorControllers(
detectorControllers), m_Oldlistmodedatasize(0) {
// Empty
}
......@@ -57,30 +56,7 @@ void ListModeBlock::writeBlock(std::ofstream & file) {
// Verify if first write
if (dataFile.tellp() == 0) {
// cout << "DPP context (ListModeBlock)" << endl;
// cout << listModeContext << endl;
// Write header
// uint32 buffer[4 + m_NbGeges];
// buffer[0] = 1;
// buffer[1] = 9;
// buffer[2] = 0;
// buffer[3] = m_NbGeges;
// for (uint32 i = 0; i < m_NbGeges; ++i) {
// if (m_GegeControllers[i] != NULL) {
// int32 evtype = 0; //any_cast<int32>(m_GegeControllers[i]->getValue("display_channel"));
// int32 card = any_cast<int32>(m_GegeControllers[i]->getValue("crate_number"));
// int32 channels = any_cast<int32>(m_GegeControllers[i]->getValue("nb_channels"));
// int32 type = any_cast<int32>(m_GegeControllers[i]->getValue("card_type"));
// buffer[4 + i] = type & 0x3F;
// buffer[4 + i] |= (channels & 0x3F) << 6;
// buffer[4 + i] |= (card & 0xF) << 12;
// buffer[4 + i] |= (evtype & 0xFFFF) << 16;
// }
// }
// dataFile.write((const char *) buffer, (4 + m_NbGeges) * sizeof(uint32));
// Call to library with current context.
string buffer = writeListModeContextToBinary(listModeContext);
dataFile.write(buffer.c_str(), buffer.size());
......
......@@ -31,15 +31,12 @@ namespace npp {
class ListModeBlock: public DataBlock {
public:
ListModeBlock(uint32 nbgeges, const vector<AbstractController*>& gegeControllers, uint32 nbdetectors,
const vector<AbstractController*>& detectorControllers);
ListModeBlock(uint32 nbdetectors, const vector<AbstractController*>& detectorControllers);
virtual ~ListModeBlock();
void writeBlock(std::ofstream & file);
private:
uint32 m_NbGeges;
std::vector<AbstractController*> m_GegeControllers;
uint32 m_NbDetectors;
std::vector<AbstractController*> m_DetectorControllers;
uint32 m_Oldlistmodedatasize;
......
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