Commit 07aef60f authored by legoc's avatar legoc
Browse files

Made dependency to boost only with --enable-cameo option and removed read and...

Made dependency to boost only with --enable-cameo option and removed read and write functions to property_tree from CrateBoard.h
parent e4f23f74
Version 1.2.0, 2018-MM-DD
-------------------------
- Made dependency to boost only with --enable-cameo option.
- Removed read and write functions to property_tree from CrateBoard.h.
Version 1.1.4, 2018-05-22
-------------------------
- Unspecified data added.
......
......@@ -63,9 +63,9 @@ AC_SUBST(ROOT_LDFLAGS)
ROOT_CFLAGS=`root-config --cflags`
AC_SUBST(ROOT_CFLAGS)
AX_BOOST_BASE([1.41],, [AC_MSG_ERROR([Boost 1.41 required])])
AM_COND_IF([CAMEO], [AC_CAMEO])
AM_COND_IF([CAMEO], [AX_BOOST_BASE([1.41],, [AC_MSG_ERROR([Boost 1.41 required])])
AC_CAMEO
])
AM_COND_IF([GNUPLOT], [AC_GNUPLOT])
LST_CXXFLAGS="$BOOST_CPPFLAGS \
......
......@@ -21,9 +21,6 @@
#include <map>
using namespace std;
using namespace boost;
using boost::property_tree::ptree;
namespace lstdpp128 {
......@@ -141,80 +138,6 @@ uint32_t readListModeContextFromBinary(ListModeContext & listModeContext, uint32
return nbBoards;
}
boost::property_tree::ptree writeListModeContextToPropertyTree(const ListModeContext & listModeContext) {
ptree root;
root.put("version", listModeContext.version);
root.put("timeBase", listModeContext.timeBase);
root.put("nbEvents", listModeContext.nbEvents);
ptree crateBoard;
for (int c = 0; c < listModeContext.crateBoard.nbCrates; c++) {
ptree crate;
for (int b = 0; b < listModeContext.crateBoard.crates[c].nbBoards; b++) {
ptree board;
board.put("eventType", listModeContext.crateBoard.crates[c].boards[b].eventType);
board.put("crate", listModeContext.crateBoard.crates[c].boards[b].crate);
board.put("nbChannels", listModeContext.crateBoard.crates[c].boards[b].nbChannels);
board.put("boardType", listModeContext.crateBoard.crates[c].boards[b].boardType);
crate.push_back(make_pair("", board));
}
crateBoard.push_back(make_pair("", crate));
}
root.put_child("crateboard", crateBoard);
return root;
}
void readListModeContextFromPropertyTree(ListModeContext & listModeContext, const boost::property_tree::ptree& data) {
listModeContext.version = data.get<uint32_t>("version");
listModeContext.timeBase = data.get<uint32_t>("timeBase");
listModeContext.nbEvents = data.get<uint32_t>("nbEvents");
ptree crateBoard = data.get_child("crateboard");
listModeContext.crateBoard.nbCrates = crateBoard.size();
// Allocate the crates.
listModeContext.crateBoard.crates = new Crate[listModeContext.crateBoard.nbCrates];
// Allocate the boards.
uint32_t c = 0;
for (ptree::const_iterator cr = crateBoard.begin(); cr != crateBoard.end(); ++cr) {
ptree crate = cr->second;
uint16_t crateNbBoards = crate.size();
listModeContext.crateBoard.crates[c].nbBoards = crateNbBoards;
listModeContext.crateBoard.crates[c].boards = new Board[crateNbBoards];
uint32_t b = 0;
for (ptree::const_iterator br = crate.begin(); br != crate.end(); ++br) {
ptree board = br->second;
listModeContext.crateBoard.crates[c].boards[b].eventType = board.get<uint16_t>("eventType");
listModeContext.crateBoard.crates[c].boards[b].crate = board.get<uint8_t>("crate");
listModeContext.crateBoard.crates[c].boards[b].nbChannels = board.get<uint16_t>("nbChannels");
listModeContext.crateBoard.crates[c].boards[b].boardType = (BoardType)board.get<int>("boardType");
++b;
}
++c;
}
}
void releaseListModeContext(ListModeContext & listModeContext) {
for (int c = 0; c < listModeContext.crateBoard.nbCrates; c++) {
......
......@@ -21,7 +21,6 @@
#include <stdint.h>
#include <iostream>
#include <boost/property_tree/ptree.hpp>
namespace lstdpp128 {
......@@ -239,17 +238,6 @@ std::string writeListModeContextToBinary(const ListModeContext & listModeContext
*/
uint32_t readListModeContextFromBinary(ListModeContext & listModeContext, uint32_t version, uint32_t timeBase, uint32_t nbEvents, uint32_t nbBoards, uint32_t* data);
/**
* Writes the list mode context to JSON.
*/
boost::property_tree::ptree writeListModeContextToPropertyTree(const ListModeContext & listModeContext);
/**
* Reads the list mode context to JSON.
*/
void readListModeContextFromPropertyTree(ListModeContext & listModeContext, const boost::property_tree::ptree& data);
/**
* Releases the data structures of the list mode context.
*/
......
......@@ -17,6 +17,7 @@
*/
#include "EventData.h"
#include <sstream>
#include <iomanip>
using namespace std;
......
......@@ -32,6 +32,7 @@
#include "../../EventData.h"
#include "../../EventBlockArray.h"
#include "../../EventBlockArrayAlgorithm.h"
#include "Utils.h"
using namespace std;
using namespace lstdpp128;
......
......@@ -30,6 +30,7 @@
#include "../../Event.h"
#include "../../EventBlockArray.h"
#include "../../EventBlockArrayAlgorithm.h"
#include "Utils.h"
using namespace std;
using namespace lstdpp128;
......
noinst_LIBRARIES = libcameoutils.a
libcameoutils_a_SOURCES = Utils.cpp
bin_PROGRAMS = \
lstcameohisto128 \
lstcameocoincidence128
libs = ../../liblstdpp128.la ../../algorithms/nomad/liblstdppnomad128.la
libs = ../../liblstdpp128.la ../../algorithms/nomad/liblstdppnomad128.la libcameoutils.a
lstcameohisto128_SOURCES = \
CameoLiveHistogram.cpp
......
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include "Utils.h"
#include <map>
using namespace std;
using namespace boost;
using boost::property_tree::ptree;
namespace lstdpp128 {
void readListModeContextFromPropertyTree(ListModeContext & listModeContext, const boost::property_tree::ptree& data) {
listModeContext.version = data.get<uint32_t>("version");
listModeContext.timeBase = data.get<uint32_t>("timeBase");
listModeContext.nbEvents = data.get<uint32_t>("nbEvents");
ptree crateBoard = data.get_child("crateboard");
listModeContext.crateBoard.nbCrates = crateBoard.size();
// Allocate the crates.
listModeContext.crateBoard.crates = new Crate[listModeContext.crateBoard.nbCrates];
// Allocate the boards.
uint32_t c = 0;
for (ptree::const_iterator cr = crateBoard.begin(); cr != crateBoard.end(); ++cr) {
ptree crate = cr->second;
uint16_t crateNbBoards = crate.size();
listModeContext.crateBoard.crates[c].nbBoards = crateNbBoards;
listModeContext.crateBoard.crates[c].boards = new Board[crateNbBoards];
uint32_t b = 0;
for (ptree::const_iterator br = crate.begin(); br != crate.end(); ++br) {
ptree board = br->second;
listModeContext.crateBoard.crates[c].boards[b].eventType = board.get<uint16_t>("eventType");
listModeContext.crateBoard.crates[c].boards[b].crate = board.get<uint8_t>("crate");
listModeContext.crateBoard.crates[c].boards[b].nbChannels = board.get<uint16_t>("nbChannels");
listModeContext.crateBoard.crates[c].boards[b].boardType = (BoardType)board.get<int>("boardType");
++b;
}
++c;
}
}
}
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://www.osor.eu/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#ifndef LSTDPP_CAMEO_UTILS_H
#define LSTDPP_CAMEO_UTILS_H
#include "../../CrateBoard.h"
#include <boost/property_tree/ptree.hpp>
namespace lstdpp128 {
/**
* Reads the list mode context to JSON.
*/
void readListModeContextFromPropertyTree(ListModeContext & listModeContext, const boost::property_tree::ptree& data);
}
#endif
......@@ -16,10 +16,11 @@
* limitations under the Licence.
*/
#include <iostream>
#include <iomanip>
#include "../../CrateBoard.h"
#include "../../EventData.h"
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
using namespace lstdpp128;
......
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