Commit a10aabaa authored by Cristina Cocho's avatar Cristina Cocho

Added refresher in D22Settings of the property DiaphragmMode in order to...

Added refresher in D22Settings of the property DiaphragmMode in order to update properly the properties displayed in combo box
parent 4af22a43
......@@ -144,10 +144,11 @@ void D22Settings::postConfiguration() {
attr = m_att->state.setpoint();
}
//only register refreshers in wavelength and det...
//refreshers
registerRefresher(detPosition.setpoint, &D22Settings::refreshWantedDetPositionProperty, this);
registerRefresher(wavelengthPosition.setpoint, &D22Settings::refreshWantedWavelengthPositionProperty, this);
registerRefresher(dtrPosition.setpoint, &D22Settings::refreshWantedDtrPositionProperty, this);
registerRefresher(diaphragmMode, &D22Settings::refreshDiaphragmModeProperty, this);
//updater
registerUpdater(m_det->position, &D22Settings::updateDetPosition, this);
......@@ -193,6 +194,29 @@ void D22Settings::refreshWantedDtrPositionProperty(float64 wantedDtrPosition) th
calculateQMax(detPosition.setpoint(), wavelengthPosition.setpoint(), wantedDtrPosition);
}
void D22Settings::refreshDiaphragmModeProperty(int32 diaphragmMode) throw (CannotSetValue) {
// Avoid bad property display (in commandBox) when diaphragm mode is rectangular or circular
if (diaphragmMode == CIRCULAR_MODE) {
dia1 = 1;
dia2 = 1;
dia3 = 1;
dia4 = 1;
dia5 = 1;
dia6 = 1;
dia7 = 1;
dia8 = 1;
} else if (diaphragmMode == RECTANGULAR_MODE) {
dia1 = 0;
dia2 = 0;
dia3 = 0;
dia4 = 0;
dia5 = 0;
dia6 = 0;
dia7 = 0;
dia8 = 0;
}
}
void D22Settings::calculateDetCalc() {
detPosition = m_det->position();
sdiPosition = m_sdi->position();
......@@ -216,11 +240,13 @@ void D22Settings::start() {
commandProgression = 0;
log(Level::s_Debug) << "Wavelength " << wavelengthPosition.setpoint << " Detector " << detPosition.setpoint << " DTR " << dtrPosition.setpoint << " Collimator " << colSetupPosition.setpoint << " " << DIAMODE[diaphragmMode()] << " Bx " << bxPosition.setpoint << " By " << byPosition.setpoint << " Attenuator " << attr << endlog;
log(Level::s_Debug) << "Wavelength " << wavelengthPosition.setpoint
<< " Detector " << detPosition.setpoint << " DTR " << dtrPosition.setpoint << " Collimator " << colSetupPosition.setpoint << " " << DIAMODE[diaphragmMode()] << " Bx " << bxPosition.setpoint << " By " << byPosition.setpoint << " Attenuator " << attr << endlog;
//(2) Move all the axis (wavelength, det, col, dtr, bx and by) -> In parallel.
try {
//(1) Security aim: fastShutter CLOSE
//(1) Security aim: fastShutter CLOSE
try {
//m_fastShutter->state.setpoint = stateio::ShutterController::CLOSE;
m_fastShutter->setClose();
......@@ -230,7 +256,7 @@ void D22Settings::start() {
commandProgression = 15;
//Modification done after having problems with detector before moving det move dtr to the position 300.
//Modification done after having problems with detector before moving det move dtr to the position 300.
// float64 originalDtrPosition = dtrPosition.setpoint();
// m_dtr->position.setpoint = 300;
// m_dtr->startCommand();
......@@ -253,31 +279,31 @@ void D22Settings::start() {
m_by->position.setpoint = byPosition.setpoint();
m_att->state.setpoint = attr();
//12/12/16: Execute movement in two block due to problems with card
//12/12/16: Execute movement in two block due to problems with card
m_colSetup->startWithoutShutterCommand(); //do not move the shutter in colSetup controller!!
if (m_det->position.setpoint()<3){
if (abs(m_det->position.setpoint() - m_det->position())>m_det->axisDriver->tolerance()){
m_dtr->position.setpoint =0;
m_dtr->startCommand();
}
Parallel::begin();
m_wavelength->startParallel();
m_det->startParallel();
m_bx->startParallel();
m_by->startParallel();
m_att->startParallel();
Parallel::end();
}else{
Parallel::begin();
m_wavelength->startParallel();
m_det->startParallel();
m_dtr->startParallel();
m_bx->startParallel();
m_by->startParallel();
m_att->startParallel();
Parallel::end();
if (m_det->position.setpoint() < 3) {
if (abs(m_det->position.setpoint() - m_det->position()) > m_det->axisDriver->tolerance()) {
m_dtr->position.setpoint = 0;
m_dtr->startCommand();
}
Parallel::begin();
m_wavelength->startParallel();
m_det->startParallel();
m_bx->startParallel();
m_by->startParallel();
m_att->startParallel();
Parallel::end();
} else {
Parallel::begin();
m_wavelength->startParallel();
m_det->startParallel();
m_dtr->startParallel();
m_bx->startParallel();
m_by->startParallel();
m_att->startParallel();
Parallel::end();
}
}
// // Removed temporarily
// Parallel::begin();
// m_colSetup->startWithoutShutterParallel(); //do not move the shutter in colSetup controller!!
......@@ -289,15 +315,15 @@ void D22Settings::start() {
// m_att->startParallel();
// Parallel::end();
if (m_det->position.setpoint()<3){
if (m_det->position.setpoint() < 3) {
//Once everything finished move the dtr to the desired position
m_dtr->position.setpoint = dtrPosition.setpoint();
m_dtr->startCommand();
}
//Once everything finished move the dtr to the desired position
m_dtr->position.setpoint = dtrPosition.setpoint();
m_dtr->startCommand();
}
commandProgression = 80;
//(3) Security aim: fastShutter OPEN
//(3) Security aim: fastShutter OPEN
try {
//m_fastShutter->state.setpoint = stateio::ShutterController::OPEN;
m_fastShutter->setOpen();
......@@ -306,9 +332,9 @@ void D22Settings::start() {
}
log(Level::s_Info) << "Wavelength " << m_wavelength->wavelength << " Detector " << m_det->position << " DTR " << m_dtr->position << " Collimator " << m_colSetup->selectedColSetup << " " << DIAMODE[diaphragmMode()] << " Bx " << m_bx->position << " By " << m_by->position << " Attenuator " << m_att->state << endlog;
log(Level::s_Info) << "Wavelength " << m_wavelength->wavelength << " Detector "
<< m_det->position << " DTR " << m_dtr->position << " Collimator " << m_colSetup->selectedColSetup << " " << DIAMODE[diaphragmMode()] << " Bx " << m_bx->position << " By " << m_by->position << " Attenuator " << m_att->state << endlog;
commandProgression = 100;
......
......@@ -99,6 +99,7 @@ private:
void refreshWantedDetPositionProperty(float64 wantedDetPosition) throw (CannotSetValue);
void refreshWantedWavelengthPositionProperty(float64 wantedWavelength) throw (CannotSetValue);
void refreshWantedDtrPositionProperty(float64 wantedDtrPosition) throw (CannotSetValue);
void refreshDiaphragmModeProperty(int32 diaphragmMode) throw (CannotSetValue);
virtual void updateDetPosition();
virtual void updateSdiPosition();
......
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