Commit 70cb400f authored by Locatelli's avatar Locatelli
Browse files

controller Cyclops data header now is a controller not inheritance from

count spy. it caused problem with spy
parent d3801c07
......@@ -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;
......
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