Commit d0f6f1b3 authored by Paolo Mutti's avatar Paolo Mutti
Browse files

No commit message

No commit message
parent d1f2f582
...@@ -60,6 +60,10 @@ CAENAdcController::CAENAdcController(const string& name) : ExperimentController( ...@@ -60,6 +60,10 @@ CAENAdcController::CAENAdcController(const string& name) : ExperimentController(
curve3.init(this, NOSAVE, "curve3_table"); curve3.init(this, NOSAVE, "curve3_table");
curve4.init(this, NOSAVE, "curve4_table"); curve4.init(this, NOSAVE, "curve4_table");
enableCoincidence.init(this, NOSAVE, "enable_coincidence");
coincidenceWindow.init(this, NOSAVE, "coincidence_window");
coincidenceMask.init(this, NOSAVE, "coincidence_mask");
registerFunction(TYPE); registerFunction(TYPE);
} }
......
...@@ -97,6 +97,11 @@ public: ...@@ -97,6 +97,11 @@ public:
ArrayProperty<int32> curve3; ArrayProperty<int32> curve3;
ArrayProperty<int32> curve4; ArrayProperty<int32> curve4;
// Coincidence properties
Property<int32> enableCoincidence;
Property<int32> coincidenceWindow;
Property<int32> coincidenceMask;
protected: protected:
virtual void refreshNbChannelsProperty(int32 aValue) throw (CannotSetValue) = 0; virtual void refreshNbChannelsProperty(int32 aValue) throw (CannotSetValue) = 0;
......
...@@ -44,6 +44,7 @@ DPPAcquisitionController::DPPAcquisitionController(const string& name) : ...@@ -44,6 +44,7 @@ DPPAcquisitionController::DPPAcquisitionController(const string& name) :
nbBits.init(this, SAVE, "nb_bits"); nbBits.init(this, SAVE, "nb_bits");
gateWidth.init(this, SAVE, "gate_width"); gateWidth.init(this, SAVE, "gate_width");
scopeChannel.init(this, NOSAVE, "scope_channel"); scopeChannel.init(this, NOSAVE, "scope_channel");
useWaveForm.init(this, NOSAVE, "waveform_mode");
useScope.init(this, NOSAVE, "scope_mode"); useScope.init(this, NOSAVE, "scope_mode");
totalChannels.init(this, NOSAVE, "total_channels"); totalChannels.init(this, NOSAVE, "total_channels");
useScopeStr.init(this, NOSAVE, "scope_mode_str"); useScopeStr.init(this, NOSAVE, "scope_mode_str");
...@@ -92,8 +93,8 @@ void DPPAcquisitionController::postConfiguration() { ...@@ -92,8 +93,8 @@ void DPPAcquisitionController::postConfiguration() {
registerRefresher(nbBits, &DPPAcquisitionController::refreshNbBitsProperty, this); registerRefresher(nbBits, &DPPAcquisitionController::refreshNbBitsProperty, this);
for (int32 i = 0; i < nbAdcControllers(); ++i) { for (int32 i = 0; i < nbAdcControllers(); ++i) {
registerUpdater(adcController[i]->dppAcqMode, &DPPAcquisitionController::updateUseScopeProperty, this, i); registerUpdater(adcController[i]->dppAcqMode, &DPPAcquisitionController::updateAcqModeProperty, this, i);
registerUpdater(adcController[i]->displayChannel, &DPPAcquisitionController::updateUseScopeProperty, this, i); registerUpdater(adcController[i]->displayChannel, &DPPAcquisitionController::updateAcqModeProperty, this, i);
registerUpdater(adcController[i]->channels, &DPPAcquisitionController::setChannelsPerBoard, this); registerUpdater(adcController[i]->channels, &DPPAcquisitionController::setChannelsPerBoard, this);
registerUpdater(adcController[i]->recordLength, &DPPAcquisitionController::updateRecordLengthProperty, this, i); registerUpdater(adcController[i]->recordLength, &DPPAcquisitionController::updateRecordLengthProperty, this, i);
} }
...@@ -206,7 +207,7 @@ void DPPAcquisitionController::updateCurve4ArrayProperty(int32 index) { ...@@ -206,7 +207,7 @@ void DPPAcquisitionController::updateCurve4ArrayProperty(int32 index) {
/* /*
* updateUseScopeProperty * updateUseScopeProperty
*/ */
void DPPAcquisitionController::updateUseScopeProperty(int32 index) { void DPPAcquisitionController::updateAcqModeProperty(int32 index) {
int32 boardChannel = 0; int32 boardChannel = 0;
int32 aValue = adcController[index]->dppAcqMode(); int32 aValue = adcController[index]->dppAcqMode();
...@@ -217,6 +218,7 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) { ...@@ -217,6 +218,7 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) {
adcController[i]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE; adcController[i]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE;
} }
} }
adcController[index]->dppAcqMode = acquisition::DPPAcquisitionCommon::SCOPE_MODE;
useScope = 1; useScope = 1;
useScopeStr = "Active"; useScopeStr = "Active";
for (int32 i=0; i<index; ++i) { for (int32 i=0; i<index; ++i) {
...@@ -225,8 +227,7 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) { ...@@ -225,8 +227,7 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) {
boardChannel += adcController[index]->displayChannel(); boardChannel += adcController[index]->displayChannel();
useListMode = 0; useListMode = 0;
usePn1Coincidence = 0; usePn1Coincidence = 0;
} } else if (aValue == acquisition::DPPAcquisitionCommon::LISTMODE_MODE) {
else if (aValue == acquisition::DPPAcquisitionCommon::LISTMODE_MODE) {
useScope = 0; useScope = 0;
useScopeStr = "Inactive"; useScopeStr = "Inactive";
} }
...@@ -237,20 +238,20 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) { ...@@ -237,20 +238,20 @@ void DPPAcquisitionController::updateUseScopeProperty(int32 index) {
dppDriver[board]->scopeChannel = boardChannel; dppDriver[board]->scopeChannel = boardChannel;
dppDriver[board]->scopeCardActivated = adcController[index]->modelName(); dppDriver[board]->scopeCardActivated = adcController[index]->modelName();
dppDriver[board]->recordLength = adcController[index]->recordLength(); dppDriver[board]->recordLength = adcController[index]->recordLength();
dppDriver[board]->useListMode = useListMode(); dppDriver[board]->useListMode = (useListMode() == true ? 1 : 0);
dppDriver[board]->usePn1Coincidence = usePn1Coincidence(); dppDriver[board]->usePn1Coincidence = usePn1Coincidence();
} }
/* /*
* refreshUseListModeProperty * refreshUseListModeProperty
*/ */
void DPPAcquisitionController::refreshUseListModeProperty(int32 aValue) throw (CannotSetValue) { void DPPAcquisitionController::refreshUseListModeProperty(bool aValue) throw (CannotSetValue) {
for (int32 board=0; board<nDrivers(); ++board) { for (int32 board=0; board<nDrivers(); ++board) {
dppDriver[board]->useListMode = aValue; dppDriver[board]->useListMode = (aValue == true ? 1 : 0);
} }
if (aValue == 1) { if (aValue == true) {
for (int32 adc = 0; adc < nbAdcControllers(); ++adc) { for (int32 adc = 0; adc < nbAdcControllers(); ++adc) {
adcController[adc]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE; adcController[adc]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE;
} }
...@@ -267,7 +268,10 @@ void DPPAcquisitionController::refreshUsePn1CoincidenceModeProperty(int32 aValue ...@@ -267,7 +268,10 @@ void DPPAcquisitionController::refreshUsePn1CoincidenceModeProperty(int32 aValue
dppDriver[board]->gateWidth = gateWidth(); dppDriver[board]->gateWidth = gateWidth();
} }
adcController[0]->enableCoincidence = aValue;
if (aValue == 1) { if (aValue == 1) {
adcController[0]->coincidenceWindow = gateWidth();
adcController[0]->coincidenceMask = 0x103;
for (int32 adc = 0; adc < nbAdcControllers(); ++adc) { for (int32 adc = 0; adc < nbAdcControllers(); ++adc) {
adcController[adc]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE; adcController[adc]->dppAcqMode = acquisition::DPPAcquisitionCommon::LISTMODE_MODE;
} }
...@@ -340,7 +344,7 @@ void DPPAcquisitionController::writeParams() { ...@@ -340,7 +344,7 @@ void DPPAcquisitionController::writeParams() {
dppDriver[i]->scopeChannel = scopeChannel(); dppDriver[i]->scopeChannel = scopeChannel();
dppDriver[i]->gateWidth = gateWidth(); dppDriver[i]->gateWidth = gateWidth();
dppDriver[i]->usePn1Coincidence = usePn1Coincidence(); dppDriver[i]->usePn1Coincidence = usePn1Coincidence();
dppDriver[i]->useListMode = useListMode(); dppDriver[i]->useListMode = (useListMode() == true ? 1 : 0);
dppDriver[i]->useScope = useScope(); dppDriver[i]->useScope = useScope();
/* /*
...@@ -493,8 +497,8 @@ void DPPAcquisitionController::setContext() { ...@@ -493,8 +497,8 @@ void DPPAcquisitionController::setContext() {
} }
} }
cout << "context before live process" << endl; // cout << "context before live process" << endl;
cout << listModeContext << endl; // cout << listModeContext << endl;
} }
} }
...@@ -92,6 +92,7 @@ public: ...@@ -92,6 +92,7 @@ public:
Property<int32> scopeChannel; // Scope channel Property<int32> scopeChannel; // Scope channel
Property<int32> totalChannels; // Total nb of channels Property<int32> totalChannels; // Total nb of channels
Property<int32> usePn1Coincidence; Property<int32> usePn1Coincidence;
Property<int32> useWaveForm;
Property<int32> useScope; Property<int32> useScope;
Property<std::string> useScopeStr; Property<std::string> useScopeStr;
...@@ -115,11 +116,11 @@ private: ...@@ -115,11 +116,11 @@ private:
void updateCurve2ArrayProperty(int32 index); void updateCurve2ArrayProperty(int32 index);
void updateCurve3ArrayProperty(int32 index); void updateCurve3ArrayProperty(int32 index);
void updateCurve4ArrayProperty(int32 index); void updateCurve4ArrayProperty(int32 index);
void updateUseScopeProperty(int32 index); void updateAcqModeProperty(int32 index);
void updateRecordLengthProperty(int32 index); void updateRecordLengthProperty(int32 index);
void refreshNbAdcControllersProperty(int32 aValue) throw (CannotSetValue); void refreshNbAdcControllersProperty(int32 aValue) throw (CannotSetValue);
virtual void refreshUseListModeProperty(int32 aValue) throw (CannotSetValue); virtual void refreshUseListModeProperty(bool aValue) throw (CannotSetValue);
void refreshUsePn1CoincidenceModeProperty(int32 aValue) throw (CannotSetValue); void refreshUsePn1CoincidenceModeProperty(int32 aValue) throw (CannotSetValue);
void refreshNbBitsProperty(int32 value) throw (CannotSetValue); void refreshNbBitsProperty(int32 value) throw (CannotSetValue);
......
/*
* HistoEAEDetectorElement.cpp
*
* Created on: Mar 30, 2016
* Author: acq
*/
#include "ETotDetectorElement.h"
namespace npp {
const string ETotDetectorElement::TYPE = "etot_detector_element";
/*
* Constructor
*/
ETotDetectorElement::ETotDetectorElement(const string& name) : acquisition::DetectorElement(name) {
registerFunction(TYPE);
m_Driver.init(this, "driver");
}
/*
* Destructor
*/
ETotDetectorElement::~ETotDetectorElement() {
}
/*
* postConfiguration
*/
void ETotDetectorElement::postConfiguration() {
acquisition::DetectorElement::postConfiguration();
registerUpdater(m_Driver->histo_e_de, &ETotDetectorElement::updateData, this);
}
/*
* updateData
*/
void ETotDetectorElement::updateData() {
detSize = m_Driver->histo_e_de.getSize();
int32* ldata = m_Driver->histo_e_de();
data.update(ldata);
data.setSize(detSize());
data.sendEvent();
calculateDetectorSum();
}
}
/*
* HistoEAEDetectorElement.h
*
* Created on: Mar 30, 2016
* Author: acq
*/
#ifndef ETOTDETECTORELEMENT_H_
#define ETOTDETECTORELEMENT_H_
#include "controllers/common/acquisition/detector/DetectorElement.h"
#include "drivers/ioxos/mpda_dpp/MpdaDPPDriver.h"
namespace npp {
/*!
* \class EDEDetectorElement
* \brief EDEDetectorElement class
*
* \par
* This class overload. DetectorElement class. It creates a new data array for plot window.
* The data have to be rotated for the plot.
*/
class ETotDetectorElement: public acquisition::DetectorElement {
public:
//! Type of controller
static const std::string TYPE;
/*!
* \brief Constructor
* \param[in] name the name of the experiment controller
*/
ETotDetectorElement(const std::string& name);
/*!
* \brief Destructor
*/
virtual ~ETotDetectorElement();
/*!
* \brief Method called before changing the property value
*
* This method is called after setting configuration during the creation of controller.
*/
virtual void postConfiguration();
private:
DriverPtr<mpda_dpp::MpdaDPPDriver> m_Driver; //! Pointer on histo data
void updateData();
};
}
#endif
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<controller class="npp::DPPCoincidence"/> <controller class="npp::DPPCoincidence"/>
<controller class="npp::DPPLiveProcessCountRelay"/> <controller class="npp::DPPLiveProcessCountRelay"/>
<controller class="npp::BidimHistoDetectorElement"/> <controller class="npp::BidimHistoDetectorElement"/>
<controller class="npp::PN1CoincidenceDetectorElement"/>
<controller class="npp::ETotDetectorElement"/>
<include path="$(NOMAD_HOME)/../NomadModules/src"/> <include path="$(NOMAD_HOME)/../NomadModules/src"/>
......
/*
* 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://joinup.ec.europa.eu/software/page/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 "PN1CoincidenceDetectorElement.h"
namespace npp {
const string PN1CoincidenceDetectorElement::TYPE = "pn1_coincidence_detector_element";
/*
* Constructor
*/
PN1CoincidenceDetectorElement::PN1CoincidenceDetectorElement(const string& name) :
acquisition::DetectorElement(name) {
registerFunction(TYPE);
m_Driver.init(this, "driver");
}
/*
* Destructor
*/
PN1CoincidenceDetectorElement::~PN1CoincidenceDetectorElement() {
}
/*
* postConfiguration
*/
void PN1CoincidenceDetectorElement::postConfiguration() {
acquisition::DetectorElement::postConfiguration();
registerUpdater(m_Driver->pn1ConicidenceZData, &PN1CoincidenceDetectorElement::updateData, this);
}
/*
* updateData
*/
void PN1CoincidenceDetectorElement::updateData() {
detSize = m_Driver->pn1ConicidenceZData.getSize();
int32* ldata = m_Driver->pn1ConicidenceZData();
data.update(ldata);
data.setSize(detSize());
data.sendEvent();
calculateDetectorSum();
}
}
/*
* 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://joinup.ec.europa.eu/software/page/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.
*/
/*!
* \brief PN1Coincidence Detector Element class
* \author J. Locatelli
* \date 10-01-2010
*/
#ifndef PN1COINCIDENCEDETECTORELEMENT_H
#define PN1COINCIDENCEDETECTORELEMENT_H
#include "controllers/common/acquisition/detector/DetectorElement.h"
#include "drivers/ioxos/mpda_dpp/MpdaDPPDriver.h"
namespace npp {
/*!
* \class PN1CoincidenceDetectorElement
* \brief PN1CoincidenceDetectorElement class
*
* \par
* This class overload. DetectorElement class. It creates a new data array for plot window.
* The data have to be rotated for the plot.
*/
class PN1CoincidenceDetectorElement: public acquisition::DetectorElement {
public:
//! Type of controller
static const std::string TYPE;
/*!
* \brief Constructor
* \param[in] name the name of the experiment controller
*/
PN1CoincidenceDetectorElement(const std::string& name);
/*!
* \brief Destructor
*/
virtual ~PN1CoincidenceDetectorElement();
/*!
* \brief Method called before changing the property value
*
* This method is called after setting configuration during the creation of controller.
*/
virtual void postConfiguration();
private:
DriverPtr<mpda_dpp::MpdaDPPDriver> m_Driver; //! Pointer on histo data
void updateData();
};
}
#endif
...@@ -20,8 +20,8 @@ dppacquisition_setup.scopeMode=Scope mode: ...@@ -20,8 +20,8 @@ dppacquisition_setup.scopeMode=Scope mode:
dppacquisition_setup.scopeChannel=Scope channel: dppacquisition_setup.scopeChannel=Scope channel:
dppacquisition_setup.listMode=List Mode dppacquisition_setup.listMode=List Mode
dppacquisition_setup.listmodeCheckedValue=1 dppacquisition_setup.listmodeCheckedValue=true
dppacquisition_setup.listmodeUncheckedValue=0 dppacquisition_setup.listmodeUncheckedValue=false
dppacquisition_setup.pn1Coincidence=PN1 Coincidence dppacquisition_setup.pn1Coincidence=PN1 Coincidence
dppacquisition_setup.coincidenceCheckedValue=1 dppacquisition_setup.coincidenceCheckedValue=1
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<label role="dppacquisition_setup1" property="scope_channel" prefix="dppacquisition_setup.scopeChannel"/> <label role="dppacquisition_setup1" property="scope_channel" prefix="dppacquisition_setup.scopeChannel"/>
</switchable_composite> </switchable_composite>
<newLine/> <newLine/>
<check role="dppacquisition_setup1" property="list_mode" prefix="dppacquisition_setup.listMode" checkBoxValues="dppacquisition_setup.listmode"/> <check role="dppacquisition_setup1" property="use_listmode" prefix="dppacquisition_setup.listMode" checkBoxValues="dppacquisition_setup.listmode"/>
<newLine/> <newLine/>
<check role="dppacquisition_setup1" property="pn1_coincidence" prefix="dppacquisition_setup.pn1Coincidence" checkBoxValues="dppacquisition_setup.coincidence"/> <check role="dppacquisition_setup1" property="pn1_coincidence" prefix="dppacquisition_setup.pn1Coincidence" checkBoxValues="dppacquisition_setup.coincidence"/>
<switchable_composite switch_values="1" switcher_key="pn1CoincidenceSwitcher"> <switchable_composite switch_values="1" switcher_key="pn1CoincidenceSwitcher">
......
...@@ -111,6 +111,8 @@ pha_controller.oscilloscopeValue=0 ...@@ -111,6 +111,8 @@ pha_controller.oscilloscopeValue=0
pha_controller.oscilloscopeLabel=Oscilloscope pha_controller.oscilloscopeLabel=Oscilloscope
pha_controller.histogramValue=1 pha_controller.histogramValue=1
pha_controller.histogramLabel=Histogram pha_controller.histogramLabel=Histogram
pha_controller.waveformValue=2
pha_controller.waveformLabel=Wave Form
# Plot group # Plot group
pha_controller.histogranPlotTitle=Energy histogram pha_controller.histogranPlotTitle=Energy histogram
......
<plugin> <plugin>
<controller type="pha_controller" role="pha_controller1"/> <controller type="pha_controller" role="pha_controller1"/>
<property_switcher role="pha_controller1" property="dpp_acq_mode" switcher_key="useScopeSwitcher"/> <property_switcher role="pha_controller1" property="dpp_acq_mode" switcher_key="acqModeSwitcher"/>
<group title="pha_controller.boardParamsTitle"> <group title="pha_controller.boardParamsTitle">
<text role="pha_controller1" property="nb_channels" prefix="pha_controller.nbChannels"/> <text role="pha_controller1" property="nb_channels" prefix="pha_controller.nbChannels"/>
<label role="pha_controller1" property="nb_bits" prefix="pha_controller.nbBits"/> <label role="pha_controller1" property="nb_bits" prefix="pha_controller.nbBits"/>
<newLine/> <newLine/>
<combo role="pha_controller1" property="dpp_acq_mode" prefix="pha_controller.acqMode" valuesAndLabels="pha_controller.oscilloscope,pha_controller.histogram"/> <combo role="pha_controller1" property="dpp_acq_mode" prefix="pha_controller.acqMode" valuesAndLabels="pha_controller.oscilloscope,pha_controller.histogram,pha_controller.waveform"/>
<switchable_composite switcher_key="useScopeSwitcher" switch_values="0"> <switchable_composite switcher_key="acqModeSwitcher" switch_values="0">
<text role="pha_controller1" property="record_length" prefix="pha_controller.recordLength"/> <text role="pha_controller1" property="record_length" prefix="pha_controller.recordLength"/>
<plot_launcher role="pha_controller1" data="pha_input_plot,pha_trapezoid_plot,pha_trigger_plot,pha_peaking_plot" title="pha_controller.inputPlotTitle" height="20"/> <plot_launcher role="pha_controller1" data="pha_input_plot,pha_trapezoid_plot,pha_trigger_plot,pha_peaking_plot" title="pha_controller.inputPlotTitle" height="20"/>
</switchable_composite> </switchable_composite>
<switchable_composite switcher_key="acqModeSwitcher" switch_values="2">
<text role="pha_controller1" property="record_length" prefix="pha_controller.recordLength"/>
</switchable_composite>
</group> </group>
<newLine/> <newLine/>
......
...@@ -63,6 +63,12 @@ CAENPhaDriver::CAENPhaDriver(const string& name) { ...@@ -63,6 +63,12 @@ CAENPhaDriver::CAENPhaDriver(const string& name) {
triggerMode.init(this, SAVE, "trigger_mode"); triggerMode.init(this, SAVE, "trigger_mode");
channelMask.init(this, SAVE, "channel_mask"); channelMask.init(this, SAVE, "channel_mask");
enableCoincidence.init(this, NOSAVE, "enable_coincidence");
coincidenceWindow.init(this, NOSAVE, "coincidence_window");
coincidenceMask.init(this, NOSAVE, "coincidence_mask");
usePn1Coincidence.init(this, SAVE, "use_Pn1_Coincidence");
// Channels properties // Channels properties
signalDecayTime.init(this, SAVE, "decay_time"); signalDecayTime.init(this, SAVE, "decay_time");
trapezoidFlatTop.init(this, SAVE, "trapezoid_flat"); trapezoidFlatTop.init(this, SAVE, "trapezoid_flat");
......
...@@ -81,6 +81,13 @@ public: ...@@ -81,6 +81,13 @@ public:
Property<int32> triggerMode; Property<int32> triggerMode;
Property<int32> channelMask; Property<int32> channelMask;