Commit 26f515db authored by cyclops's avatar cyclops
Browse files
parents d33af0b4 70cb400f
* Add virtual inheritance for base classes *Properties in Count (TimeCountProperties, KineticCountProperties...). That implied to add init function and empty constructor in some classes.
\ No newline at end of file
......@@ -24,12 +24,4 @@ automake --gnu --add-missing
export CXXFLAGS="$CXXFLAGS -Wall -Wconversion -O2 -g -pthread"
cd build
if [ -d "/usr/local/src/boost" ]
then
# SUSE
../configure --prefix=$NOMAD_HOME/mod --with-boost="/usr/local/src/boost" LIBS=-lboost_system
else
../configure --prefix=$NOMAD_HOME/mod
fi
......@@ -18,6 +18,8 @@ AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
AX_BOOST_BASE([1.41],, [AC_MSG_ERROR([Boost 1.41 required])])
AX_BOOST_DATE_TIME
AX_BOOST_SYSTEM
......@@ -28,8 +30,7 @@ AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK
AC_QT4
NOMAD_CXXFLAGS="$BOOST_CPPFLAGS"
NOMAD_CXXFLAGS="-DBOOST_NO_CXX11_SCOPED_ENUMS $BOOST_CPPFLAGS"
NOMAD_LDFLAGS="$BOOST_LDFLAGS"
NOMAD_LIBS="$BOOST_DATE_TIME_LIB \
......
This diff is collapsed.
# =============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# =============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++11. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 18
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
......@@ -32,7 +32,7 @@ const string CyclopsDataHeader::END = "*";
* Constructor
*/
CyclopsDataHeader::CyclopsDataHeader(const string& name) :
utilities::CountSpy(name) {
ExperimentController(name) {
setFamily(family::HIDDEN);
......@@ -40,6 +40,7 @@ CyclopsDataHeader::CyclopsDataHeader(const string& name) :
m_CamDriver.init(this, "cammeraDriver");
m_Title.init(this, "title");
m_CountSpy.init(this, "count_spy");
m_SampleSettings.init(this, "sample_settings");
m_ScanInfo.init(this, "scan_info");
m_CyclopsSetting.init(this, "cyclops_setting");
......@@ -66,30 +67,17 @@ CyclopsDataHeader::~CyclopsDataHeader() {
* postConfiguration
*/
void CyclopsDataHeader::postConfiguration() {
utilities::CountSpy::postConfiguration();
registerUpdater(m_CountSpy->statusMessage, &CyclopsDataHeader::updateStatusMessage, this);
}
/*
* updateProperty
*/
void CyclopsDataHeader::updateProperty(ChangeAspect* aChangeAspect) {
string propertyName = aChangeAspect->getStringParam();
string controllername = aChangeAspect->getControllerName();
int32 i;
for (i = 0; i < (int32) m_CountControllers.size(); ++i) {
if (m_CountControllers[i]->getName() == controllername) {
break;
}
}
if (i < (int32) m_CountControllers.size()) {
if (propertyName == statusMessage.getName()) {
boost::any propvalue = dynamic_cast<AbstractController*>(m_CountControllers[i])->getValue(propertyName);
if (any_cast<string>(propvalue) == "Writing parameters") {
createHeader();
}
}
void CyclopsDataHeader::updateStatusMessage() {
if (m_CountSpy->statusMessage() == "Writing parameters") {
createHeader();
}
utilities::CountSpy::updateProperty(aChangeAspect);
}
/*
......@@ -115,7 +103,7 @@ void CyclopsDataHeader::createHeader() {
create_i(header, "nbang", m_ScanInfo->nbController(), 0);
create_i(header, "nkmes", m_ScanInfo->nbStep(), 0);
create_i(header, "npmes", m_ScanInfo->actualStep(), 0);
create_i(header, "jcode", modeint(), 0);
create_i(header, "jcode", m_CountSpy->modeint(), 0);
create_i(header, "count", 0, 0);
create_i(header, "gain", m_CyclopsSetting->gain(), 0);
create_i(header, "mode", m_CyclopsSetting->mode(), 0);
......
......@@ -41,7 +41,7 @@ namespace cyclops {
* \class cyclops data server path setiing
* \brief Configure data path and name for cyclops data server
*/
class CyclopsDataHeader: public utilities::CountSpy {
class CyclopsDataHeader: public ExperimentController {
public:
......@@ -59,12 +59,6 @@ public:
*/
virtual ~CyclopsDataHeader();
virtual void updateProperty(ChangeAspect* aChangeAspect);
/*!
* Properties
*/
private:
/*!
......@@ -73,8 +67,11 @@ private:
*/
virtual void postConfiguration();
void updateStatusMessage();
DriverPtr<psl::PslDriver> m_CamDriver;
ControllerPtr<acquisition::ExperimentData> m_Title;
ControllerPtr<utilities::CountSpy> m_CountSpy;
ControllerPtr<sample_environment::SampleSettings> m_SampleSettings;
ControllerPtr<scan::ScanInfo> m_ScanInfo;
ControllerPtr<CyclopsSetting> m_CyclopsSetting;
......
......@@ -32,7 +32,11 @@ const string CAENAdcController::TYPE = "adc_controller";
/*
* Constructor
*/
CAENAdcController::CAENAdcController(const string& name) : ExperimentController(name), ClearData(this), acquisition::ListModeProperties(this) {
CAENAdcController::CAENAdcController(const string& name) {
ExperimentController::init(name);
acquisition::ListModeProperties::init(name);
ClearData::init(this);
setFamily(family::ACQUISITION, family::SETTING);
......
......@@ -33,6 +33,12 @@ public:
ClearData(ExperimentController * c) :
controller::Command(c, "clearData", &ClearData::clearData, this) {
}
ClearData() :
controller::Command() {
}
void init(ExperimentController * c) {
controller::Command::init(c, "clearData", &ClearData::clearData, this);
}
virtual void clearData() = 0;
void clearDataCommand(bool logging = false) {
......@@ -54,7 +60,7 @@ public:
*/
class CAENAdcController: public ExperimentController, public ClearData, public acquisition::ListModeProperties {
class CAENAdcController: public virtual ExperimentController, public ClearData, public acquisition::ListModeProperties {
public:
......
......@@ -196,11 +196,6 @@ void RealStereoElecDriver::qtLoop() {
}
}else if (*command == STOP_COMMAND) {
//read scalers a last time to have a better estimation of T1 accepted
unsigned int accepted_cnt,rejected_cnt,fifo_rejected_cnt;
long elapsedtime;
daq->QtAcqLoopCounter(accepted_cnt,rejected_cnt,fifo_rejected_cnt,false,scalers,elapsedtime);
cout << dec << "T1 accepted " << accepted_cnt << " T1 rejected " << rejected_cnt << " Fifo rejected " << fifo_rejected_cnt<< " T2 accepted " << owner()->nbevent << endl;
daq->DoStop();
cout << "DoStop ok" << endl;
daq->DoSave();
......
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