Commit 5e70c80e authored by in16's avatar in16

Merge branch 'V3.1_182' of https://code.ill.fr/instrument-control/nomad-modules into V3.1_182

parents 60d91dc3 b9cf8eae
......@@ -643,8 +643,7 @@ void Count::start() {
currentTotalReps.update(iRep + 1);
stringstream ss1;
logIntro(ss1);
logIntro();
// Print log for rep > 1
if (totalReps() > 1) {
log(Level::s_Info) << " repetition " << currentTotalReps << " over " << totalReps << endlog;
......@@ -858,7 +857,6 @@ void Count::start() {
* logCount
*/
void Count::logCount() {
stringstream ss2;
stringstream sstitle;
stringstream ssvalues;
......@@ -874,9 +872,6 @@ void Count::logCount() {
logTime.setUnit(" s");
logStream << "Numor: " << numor << " Time: " << logTime;
ss2 << "Numor: " << numor << " Time: ";
logConclu(ss2);
if (experimentData->isIncremental() == false) {
sstitle << " Numor ";
ssvalues << " " << numor;
......@@ -953,8 +948,6 @@ void Count::logCount() {
logTime.setUnit(" s");
logStream << "Numor: " << numor << " Time: " << logTime;
ss2 << "Numor: " << numor << " Time: ";
logConclu(ss2);
if (experimentData->isIncremental() == false) {
sstitle << " Numor ";
......@@ -1028,9 +1021,6 @@ void Count::logCount() {
logTime.setUnit(" s");
logStream << "Numor: " << numor << " Time: " << logTime;
ss2 << "Numor: " << numor << " Time: ";
logConclu(ss2);
if (experimentData->isIncremental() == false) {
sstitle << " Numor ";
ssvalues << " " << numor;
......
......@@ -148,8 +148,8 @@ protected:
virtual void postStart() = 0;
virtual void gateStart() = 0;
virtual void gateSynchro() = 0;
virtual void logIntro(std::stringstream& astream) = 0;
virtual void logConclu(std::stringstream& astream) = 0;
virtual void logIntro() {
}
virtual void logCount();
virtual bool refreshData() = 0;
......
......@@ -34,7 +34,7 @@ const string ExternalChopperFreq::TYPE = "external_freq";
/*
* Constructor
*/
ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::LinkerMpdaChopper(name) {
ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::LinkerMpdaChopper(name),controller::Stoppable(this){
setFamily(family::ACQUISITION);
......@@ -54,6 +54,18 @@ ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::Link
*/
ExternalChopperFreq::~ExternalChopperFreq() {
}
/*
* start
*/
void ExternalChopperFreq::start() {
// Execute the read command on Driver
speedChopperForMpda.setpoint=externalFreq() * 60;
speedChopperForMpda=externalFreq() * 60;
}
void ExternalChopperFreq::stop() {
// Execute the read command on Driver
}
/*
......
......@@ -35,7 +35,7 @@ namespace acquisition {
* \brief Contains information about the sample(s) of the current selected proposal
*
*/
class ExternalChopperFreq: public acquisition::LinkerMpdaChopper {
class ExternalChopperFreq: public acquisition::LinkerMpdaChopper, public controller::Stoppable{
public:
......@@ -59,6 +59,11 @@ public:
*/
Property<float64> externalFreq;
/*
* read
*/
virtual void start();
virtual void stop();
......
......@@ -101,35 +101,6 @@ void KineticCount::updateNbRepaint() {
currentLocalReps = m_KineticGate->nbRepaint();
}
/*
* logIntro
*/
void KineticCount::logIntro(std::stringstream& astream) {
astream << slicesFile();
if (localReps() > 1) {
astream << " repaint " << localReps() << " times";
}
}
/*
* logConclu
*/
void KineticCount::logConclu(std::stringstream& astream) {
if (logStyle() == STANDARD_LOG_STYLE) {
if (m_UseMasterAcq == true) {
astream << boost::format("%10.2d s") % time();
}
else {
astream << boost::format("%10.2d s") % (time() * localReps());
}
// }
} else if (logStyle() == TAS_LOG_STYLE) {
astream << boost::format("%10.2f s") % (time() * localReps());
} else if (logStyle() == DIFF_LOG_STYLE) {
astream << boost::format("%10.2f s") % (time() * localReps());
}
}
/*
* preStart
*/
......
......@@ -60,9 +60,6 @@ protected:
virtual void pause();
virtual void resume();
virtual void logIntro(std::stringstream& astream);
virtual void logConclu(std::stringstream& astream);
virtual bool refreshData();
ControllerPtr<KineticAcquisitionController> m_KineticGate;
......
......@@ -72,41 +72,6 @@ void RocCount::updateActualCycle() {
}
}
/*
* logIntro
*/
void RocCount::logIntro(std::stringstream& astream) {
if (mode() == RocAcquisitionController::CYCLE_MODE) {
if (full()) {
astream << cycles.setpoint() << " cycles go and return";
}
else {
astream << cycles.setpoint() << " cycles single";
}
} else if (mode() == TimeAcquisitionController::TIME_MODE) {
if (full()) {
astream << time.setpoint() << " " << timeType() << " go and return";
}
else {
astream << time.setpoint() << " " << timeType() << " single";
}
}
}
/*
* logConclu
*/
void RocCount::logConclu(std::stringstream& astream) {
if (logStyle() == STANDARD_LOG_STYLE) {
astream << boost::format("%10.2d s") % time();
// }
} else if (logStyle() == TAS_LOG_STYLE) {
astream << boost::format("%10.2f s") % time();
} else if (logStyle() == DIFF_LOG_STYLE) {
astream << boost::format("%10.2f s") % time();
}
}
/*
* preStart
*/
......
......@@ -51,9 +51,6 @@ private:
virtual void preStart();
virtual void postStart();
virtual void logIntro(std::stringstream& astream);
virtual void logConclu(std::stringstream& astream);
virtual bool refreshData();
ControllerPtr<RocAcquisitionController> m_RocGate;
......
......@@ -139,56 +139,6 @@ void TimeCount::updateInhibitTime() {
}
}
/*
* logIntro
*/
void TimeCount::logIntro(std::stringstream& astream) {
if (mode() == TimeAcquisitionController::TIME_MODE) {
astream << time.setpoint() << " " << timeType();
} else if (mode() == TimeAcquisitionController::MONITOR1_MODE) {
astream << counts.setpoint();
} else if (mode() == TimeAcquisitionController::MONITOR2_MODE) {
astream << counts2.setpoint();
}
// } else if (m_Type == AcquisitionController::STROBO_TYPE) {
// ss1 << m_WantedCycles << " cycles and " << m_NBSlices << " slices";
// } else if ((m_Type == AcquisitionController::KINETIC_TYPE) || (m_Type == AcquisitionController::FCU_TYPE)) {
// ss1 << any_cast<string> (getValue(KINETIC_SLICES_FILE_PROPERTY));
// // Print log for repaint > 1
// if (m_LocalRepetitions > 1) {
// ss1 << " repaint " << m_LocalRepetitions << " times";
// }
// }
}
/*
* logConclu
*/
void TimeCount::logConclu(std::stringstream& astream) {
if (logStyle() == STANDARD_LOG_STYLE) {
// if (((m_Type == AcquisitionController::KINETIC_TYPE) || (m_Type == AcquisitionController::FCU_TYPE))
// && (m_UseMasterAcq == false)) {
// ss2 << boost::format("%10.2d s") % (any_cast<float64>(getValue(ACTUAL_TIME_PROPERTY)) * m_LocalRepetitions);
// } else if ((m_Type == AcquisitionController::KINETIC_TYPE) && (m_UseMasterAcq == true)) {
// ss2 << boost::format("%10.2d s") % (any_cast<float64>(getValue(ACTUAL_TIME_PROPERTY)));
// } else {
astream << boost::format("%10.2d s") % time();
// }
} else if (logStyle() == TAS_LOG_STYLE) {
// if ((m_Type == AcquisitionController::KINETIC_TYPE) || (m_Type == AcquisitionController::FCU_TYPE)) {
// ss2 << boost::format("%10.2f s") % (time() * localReps());
// } else {
astream << boost::format("%10.2f s") % time();
// }
} else if (logStyle() == DIFF_LOG_STYLE) {
// if ((m_Type == AcquisitionController::KINETIC_TYPE) || (m_Type == AcquisitionController::FCU_TYPE)) {
// ss2 << boost::format("%10.2f s") % (time() * localReps());
// } else {
astream << boost::format("%10.2f s") % time();
// }
}
}
/*
* preStart
*/
......
......@@ -62,9 +62,6 @@ private:
virtual void gateStart();
virtual void gateSynchro();
virtual void logIntro(std::stringstream& astream);
virtual void logConclu(std::stringstream& astream);
virtual bool refreshData();
ControllerPtr<TimeAcquisitionController> m_TimeGate;
......
......@@ -361,7 +361,11 @@ void DetectorController::synchronizeRead() {
void DetectorController::erase() {
commandProgression = 0;
if (m_UseDriver == true) {
m_Driver.execute(DetectorCommon::CLEAR_COMMAND, true);
m_Driver.setTimeout(DetectorCommon::CLEAR_COMMAND, 60);
try {
m_Driver.execute(DetectorCommon::CLEAR_COMMAND, true);
} catch (TimeOutOccured&) {
}
}
commandProgression = 100;
}
......@@ -373,7 +377,11 @@ void DetectorController::writeMask() {
commandProgression = 0;
if (m_UseDriver == true) {
if (m_MaskChanged == true) {
m_Driver.execute(DetectorCommon::REGROUP_COMMAND, true);
m_Driver.setTimeout(DetectorCommon::REGROUP_COMMAND, 60);
try {
m_Driver.execute(DetectorCommon::REGROUP_COMMAND, true);
} catch (TimeOutOccured&) {
}
m_MaskChanged = false;
} else {
// cout << getName() <<" DetectorController::writeMask don't write mask " << endl;
......
......@@ -53,6 +53,7 @@
<switchable_composite switch_values="true" switcher_key="enableListModeSwitcher">
<check role="acquisition1" property="use_listmode" prefix="acquisition.useListModePrefix" checkBoxValues="acquisition.useListMode"/>
</switchable_composite>
<plot_launcher role="data_plot1" data="detector_plot_data0" titleProperty="plot_name.0" xAxisTitleProperty="x_legend.0" yAxisTitleProperty="y_legend.0" height="20" spaceBefore="false"/>
</composite>
</composite>
......
......@@ -3,6 +3,6 @@
<image key="TITLE"/>
<settings view="external_freqView.xml"/>
<command view="external_freqCommandView.xml" sequential_fixed="true"/>
<command view="external_freqCommandView.xml" />
</controller_plugin_config>
......@@ -65,10 +65,14 @@ void ShuttleAxisController::refreshWantedPositionProperty(float64 value) throw (
secondPosition = axisDriver2->actualPosition();
}
if (fabs(secondPosition - (m_PositionSetPoint - position.offset())) > nocollision_dist()) {
cout << "ShuttleAxisController::refreshWantedPositionProperty "<< (fabs(secondPosition - (value - position.offset())) )<< endl;
if (fabs(secondPosition - (value - position.offset())) > nocollision_dist()) {
AxisController::refreshWantedPositionProperty(value);
} else {
throw CannotSetValue();
sendErrorEvent(BELOW_LOW_LIMIT_ERROR, "Collision risk");
throw CannotSetValue(LIMIT_STR);
throw CannotSetValue();
}
}
/*
......@@ -90,7 +94,7 @@ void ShuttleAxisController::start() {
commandProgression = 100;
return;
}
sleep(12);
commandProgression = 100;
}
......
......@@ -2,24 +2,19 @@
<controller type="pickupnto1" role="pickupnto11"/>
<number_of_lines nb_lines="1"/>
<property_switcher role="pickupnto11" property="mode" switcher_key="pickupnto1.modeSwitcher"/>
<combo role="pickupnto11" property="mode" prefix="pickupnto1.modePrefix" valuesAndLabels="pickupnto1.modesingle,pickupnto1.modemulti" />
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="single">
<switchable_composite switcher_key="pickupnto.modeSwitcher" switch_values="single">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterSinglePrefix"/>
</switchable_composite>
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterPrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.slavePrefix"/>
<switchable_composite switcher_key="pickupnto.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.masterPrefix"/>
</switchable_composite>
<text role="pickupnto11" property="delay" prefix="pickupnto1.delayPrefix"/>
</plugin>
......@@ -12,8 +12,8 @@
</switchable_composite>
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterPrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.masterPrefix"/>
</switchable_composite>
<newLine/>
......
......@@ -156,27 +156,6 @@ void FcuCount::updateNbCounters() {
}
}
/*
* logIntro
*/
void FcuCount::logIntro(std::stringstream& astream) {
astream << slicesFile();
if (nbCycles() > 1) {
astream << " repaint " << nbCycles() << " times";
}
}
/*
* logConclu
*/
void FcuCount::logConclu(std::stringstream& astream) {
if (m_UseMasterAcq == true) {
astream << boost::format("%10.2d s") % time();
} else {
astream << boost::format("%10.2d s") % (time() * nbCycles());
}
}
/*
* logCount
*/
......@@ -192,7 +171,6 @@ void FcuCount::logCount() {
logStream << " Count_P Count_M Time_P Time_M Monit_P Monit_M pol dpol" << endlog;
sstitle << " Count_P Count_M Time_P Time_M Monit_P Monit_M pol dpol";
logConclu(ss2);
ssvalues << ss2.str();
logStream << ss2.str();
......
......@@ -66,8 +66,6 @@ private:
virtual void resume();
virtual void stop();
virtual void logIntro(std::stringstream& astream);
virtual void logConclu(std::stringstream& astream);
virtual void logCount();
virtual bool refreshData();
......
......@@ -139,6 +139,8 @@ void CountIterator::setActionUpdateCommand(Command * command) {
void CountIterator::start() {
bool hasbegin = false;
// Getting the count controller
if (m_countController == 0) {
return;
......@@ -195,6 +197,7 @@ void CountIterator::start() {
m_sequencesActivated = true;
// Beginning a new block in any case
hasbegin = true;
Sender<ClientCommand>::begin();
// Test boolean to check if there is an error during the iteration
......@@ -207,7 +210,10 @@ void CountIterator::start() {
if (a->toStart == true) {
if (!m_OnError) {
if (a->newBlock) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
if (hasbegin) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
hasbegin = false;
}
m_checkCurrentControllerStatus();
m_removeCurrentControllers();
if (m_OnError) {
......@@ -217,6 +223,7 @@ void CountIterator::start() {
// we can exit between begin and endIf calls
m_exit();
hasbegin = true;
Sender<ClientCommand>::begin();
}
}
......@@ -303,9 +310,12 @@ void CountIterator::start() {
}
if (hasbegin) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
hasbegin = false;
}
if (!m_OnError) {
// End of the block (before a count)
Sender<ClientCommand>::endIf(End<ClientCommand> ());
m_checkCurrentControllerStatus();
m_removeCurrentControllers();
}
......
notification.warningMessage=Use "," for separating phone numbers and email address
notification.warningMessage=Use "," to separate phone numbers and email addresses
notification.messagePrefix=Message
notification.phone_numberPrefix=Send a SMS to
notification.emailPrefix=Mail to
\ No newline at end of file
......@@ -149,6 +149,17 @@ Centering::Centering(const string& name) :
axisScanCenLabels.resize(size);
axisScanCenValues.resize(size);
m_numberAxisToScan = 0;
m_currentScanStartValue = 0;
m_currentScanEndValue = 0;
m_currentScanDeltaValue = 0;
m_currentScanCenterValue = 0;
m_omegaScanAtEnd = 0;
m_rate = 0;
m_ibad = 0;
m_tth = 0;
m_docpp = 0;
m_amplitude = 0;
}
/*
......@@ -390,6 +401,7 @@ float64 Centering::extrap(int32 n, float64 x, float64 *xs, float64 *ys) {
void Centering::load_sequence_type_scan() {
loadNumberAxisToScanscan();
if (type_of_cen.setpoint() == CEN5) {
cout << "CEN5 Not implemented Yet " << endl;
} else if (type_of_cen.setpoint() == CEN) {
......@@ -400,7 +412,6 @@ void Centering::load_sequence_type_scan() {
m_omegaScanAtEnd = false;
currentCenNumberPoints.setpoint = cen_ScanNumberPoints();
} else if (type_of_cen.setpoint() == CEN0) {
loadNumberAxisToScanscan();
m_omegaScanAtEnd = omegaScanAtEnd();
// m_SettingMode = singleCrystalSetting->mode();!< store mode from setting SingleCrystalSettings::NORMALBEAM_MODE SingleCrystalSettings::FOURCIRCLE_MODE
......@@ -430,7 +441,6 @@ void Centering::load_sequence_type_scan() {
} else if (type_of_cen.setpoint() == CEN2) {
loadNumberAxisToScanscan();
m_omegaScanAtEnd = omegaScanAtEnd();
// ControllerPtr<SingleCrystalHKL>& hklptr = singleCrystalSetting->getHKLControllerPtr();
......@@ -454,7 +464,6 @@ void Centering::load_sequence_type_scan() {
hklptr->psi.setpoint = cen4_psi.setpoint();
log(Level::s_Info) << hklptr->toStringSetpoint() << endlog;
loadNumberAxisToScanscan();
m_omegaScanAtEnd = omegaScanAtEnd();
if (m_singleCrystalSetting->mode() == SingleCrystalSettings::NORMALBEAM_MODE) {
......
......@@ -222,7 +222,7 @@ void D3BPBScan::start() {
m_FcuCount->startCommand();
m_CountStarted = false;
}
ComputeValues(local_step, local_rep);
computeValues(local_step, local_rep);
++local_step;
}
// Log special
......@@ -321,12 +321,14 @@ void D3BPBScan::resume() {
}
}
void D3BPBScan::ComputeValues(int32 local_step, int32 local_rep) {
void D3BPBScan::computeValues(int32 local_step, int32 local_rep) {
// test1(local_step, local_rep);
m_Count_P = m_FcuCount->detP();
m_Count_M = m_FcuCount->detM();
m_Monit_P = m_FcuCount->moniP();
m_Monit_M = m_FcuCount->moniM();
m_Time_P = m_FcuCount->timeP();
m_Time_M = m_FcuCount->timeM();
if ((local_step == 0) && (local_rep == 0)) {
m_TotalTime = (m_timeSetPoint[0] + m_timeSetPoint[1] + m_timeSetPoint[2]) * totalRep();
for (int32 i = 0; i < 18; ++i) {
......@@ -355,7 +357,7 @@ void D3BPBScan::ComputeValues(int32 local_step, int32 local_rep) {
m1DownPlot.sendEvent();
if (local_step == 0) {
log(Level::s_Info) << " Omega" << m_FcuCount->logTitle << endlog;
log(Level::s_Info) << " Omega " << m_FcuCount->logTitle << endlog;
}
stringstream ss2;
ss2 << boost::format("%9s") % m_ang_plot[local_step];
......@@ -681,21 +683,21 @@ void D3BPBScan::test() {
m_FcuCount->moniM = 113008;
m_Time_P = 1;
m_Time_M = 1;
ComputeValues(0, 0);
computeValues(0, 0);
m_FcuCount->detP = 44525;
m_FcuCount->detM = 9799;
m_FcuCount->moniP = 1357931;
m_FcuCount->moniM = 1357954;
m_Time_P = 12;
m_Time_M = 12;
ComputeValues(1, 0);
computeValues(1, 0);
m_FcuCount->detP = 14;
m_FcuCount->detM = 6;
m_FcuCount->moniP = 113503;
m_FcuCount->moniM = 113467;
m_Time_P = 1;
m_Time_M = 1;
ComputeValues(2, 0);
computeValues(2, 0);
test.checkFloat64Equal(m_R, 4.56450, 1e-5);
test.checkFloat64Equal(m_dR, 0.05226, 1e-5);
test.checkFloat64Equal(m_Pol, 0.64058, 1e-5);
......@@ -714,21 +716,21 @@ void D3BPBScan::test() {
m_FcuCount->moniM = 203109;
m_Time_P = 0.2000;
m_Time_M = 1.8000;
ComputeValues(0, 1);
computeValues(0, 1);
m_FcuCount->detP = 25698;
m_FcuCount->detM = 16997;
m_FcuCount->moniP = 791486;
m_FcuCount->moniM = 2374332;
m_Time_P = 7.0000;
m_Time_M = 21.0000;
ComputeValues(1, 1);
computeValues(1, 1);
m_FcuCount->detP = 2;
m_FcuCount->detM = 8;
m_FcuCount->moniP = 22395;
m_FcuCount->moniM = 204383;
m_Time_P = 0.2000;
m_Time_M = 1.8000;
ComputeValues(2, 1);
computeValues(2, 1);
test.checkFloat64Equal(m_R, 4.56441, 1e-5);
test.checkFloat64Equal(m_dR, 0.03344, 1e-5);
test.checkFloat64Equal(m_Pol, 0.64057, 1e-5);
......@@ -747,21 +749,21 @@ void D3BPBScan::test() {
m_FcuCount->moniM = 128078;
m_Time_P = 0.8600;
m_Time_M = 1.1400;
ComputeValues(0, 2);
computeValues(0, 2);
m_FcuCount->detP = 24906;
m_FcuCount->detM = 17115;
m_FcuCount->moniP = 759441;
m_FcuCount->moniM = 2403620;
m_Time_P = 6.7200;
m_Time_M = 21.2800;
ComputeValues(1, 2);
computeValues(1, 2);
m_FcuCount->detP = 12;
m_FcuCount->detM = 4;
m_FcuCount->moniP = 97163;
m_FcuCount->moniM = 128452;
m_Time_P = 0.8600;
m_Time_M = 1.1400;
ComputeValues(2, 2);
computeValues(2, 2);
test.checkFloat64Equal(m_R, 4.58587, 1e-5);
test.checkFloat64Equal(m_dR, 0.02704, 1e-5);
test.checkFloat64Equal(m_Pol, 0.64195, 1e-5);
......