Commit 75dc5b6d authored by Abdelali Elaazzouzi's avatar Abdelali Elaazzouzi

Merge branch 'V3.2_191' of

https://code.ill.fr/instrument-control/nomad-modules.git into V3.2_191
parents b4deadc7 ea610f37
......@@ -118,6 +118,7 @@
<property_switcher role="lss_sample_settings" property="enable_pump" switcher_key="enable_pumpSwitcher"/>
<property_switcher role="lss_sample_settings" property="enable_density_cells" switcher_key="enable_density_cellsSwitcher"/>
<property_switcher role="lss_sample_settings" property="enable_temp_cells" switcher_key="enable_temp_cellsSwitcher"/>
<property_switcher role="lss_sample_settings" property="main_id" switcher_key="main_idSwitcher"/>
<newLine/> <!-- Necessary for controller_name -->
<controller_name role="lss_sample_settings" font_style="BOLD" font_size="12"/>
......@@ -134,15 +135,17 @@
<simple_label prefix="lss_sample_settings.main_idPrefix"/>
<property_combo role="lss_sample_settings" property="main_id"/>
</switchable_composite>
<switchable_composite switcher_key="enable_first_bathSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.first_bath_typePrefix"/>
<property_combo role="lss_sample_settings" property="first_bath_type"/>
<simple_label prefix="lss_sample_settings.first_bath_namePrefix"/>
<property_combo role="lss_sample_settings" property="first_bath_name"/>
<switchable_composite switcher_key="enable_first_external_tempSwitcher" switch_values="true">
<check role="lss_sample_settings" property="use_first_external_temp" prefix="lss_sample_settings.use_first_external_tempPrefix" checkBoxValues="lss_sample_settings.use_first_external_temp"/>
<switchable_composite switcher_key="use_first_external_tempSwitcher" switch_values="true">
<property_combo role="lss_sample_settings" property="first_external_temp"/>
<switchable_composite switcher_key="main_idSwitcher" switch_values="V1,V2,V3">
<switchable_composite switcher_key="enable_first_bathSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.first_bath_typePrefix"/>
<property_combo role="lss_sample_settings" property="first_bath_type"/>
<simple_label prefix="lss_sample_settings.first_bath_namePrefix"/>
<property_combo role="lss_sample_settings" property="first_bath_name"/>
<switchable_composite switcher_key="enable_first_external_tempSwitcher" switch_values="true">
<check role="lss_sample_settings" property="use_first_external_temp" prefix="lss_sample_settings.use_first_external_tempPrefix" checkBoxValues="lss_sample_settings.use_first_external_temp"/>
<switchable_composite switcher_key="use_first_external_tempSwitcher" switch_values="true">
<property_combo role="lss_sample_settings" property="first_external_temp"/>
</switchable_composite>
</switchable_composite>
</switchable_composite>
</switchable_composite>
......@@ -154,15 +157,17 @@
<simple_label prefix="lss_sample_settings.main_idPrefix"/>
<label role="lss_sample_settings" property="main_id" font_style="BOLD"/>
</switchable_composite>
<switchable_composite switcher_key="enable_first_bathSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.first_bath_typePrefix"/>
<label role="lss_sample_settings" property="first_bath_type"/>
<simple_label prefix="lss_sample_settings.first_bath_namePrefix"/>
<label role="lss_sample_settings" property="first_bath_name"/>
<switchable_composite switcher_key="enable_first_external_tempSwitcher" switch_values="true">
<switchable_composite switcher_key="use_first_external_tempSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.use_first_external_tempPrefix"/>
<label role="lss_sample_settings" property="first_external_temp"/>
<switchable_composite switcher_key="main_idSwitcher" switch_values="V1,V2,V3">
<switchable_composite switcher_key="enable_first_bathSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.first_bath_typePrefix"/>
<label role="lss_sample_settings" property="first_bath_type"/>
<simple_label prefix="lss_sample_settings.first_bath_namePrefix"/>
<label role="lss_sample_settings" property="first_bath_name"/>
<switchable_composite switcher_key="enable_first_external_tempSwitcher" switch_values="true">
<switchable_composite switcher_key="use_first_external_tempSwitcher" switch_values="true">
<simple_label prefix="lss_sample_settings.use_first_external_tempPrefix"/>
<label role="lss_sample_settings" property="first_external_temp"/>
</switchable_composite>
</switchable_composite>
</switchable_composite>
</switchable_composite>
......@@ -173,6 +178,7 @@
<newLine/>
<switchable_composite switcher_key="enable_first_bathSwitcher" switch_values="false">
<switchable_composite switcher_key="use_tempSwitcher" switch_values="false">
<check role="lss_sample_settings" property="use_insert" prefix="lss_sample_settings.use_insertPrefix" checkBoxValues="lss_sample_settings.use_insert"/>
......
......@@ -47,6 +47,9 @@ HumidityChamberV4::HumidityChamberV4(const string& name) :
bathReservoirTemperature.setUnit("~degreeC");
bathSampleTemperature.init(this, SAVE | SPY, "actual_bath_sample_temperature", "wanted_bath_sample_temperature", "Bath sample");
bathSampleTemperature.setUnit("~degreeC");
wantedGonioTemperature.init(this, SAVE, "wanted_gonio_temperature");
wantedGonioTemperature.setUnit("~degreeC");
gonioHeater.init(this, SAVE, "gonio_heater");
sampleTopTemperature.init(this, NOSAVE, "sample_top_temperature");
sampleTopTemperature.setUnit("~degreeC");
......@@ -180,6 +183,8 @@ void HumidityChamberV4::start() {
else {
m_HumidityChamberV4Driver->wantedBathReservoirTemperature = bathReservoirTemperature.setpoint();
m_HumidityChamberV4Driver->wantedBathSampleTemperature = bathSampleTemperature.setpoint();
m_HumidityChamberV4Driver->wantedGonioTemperature = wantedGonioTemperature();
m_HumidityChamberV4Driver->gonioHeater = gonioHeater();
}
m_HumidityChamberV4Driver.setTimeout(driver::START_COMMAND, ltimeout);
m_HumidityChamberV4Driver.execute(driver::START_COMMAND, true);
......
......@@ -54,6 +54,8 @@ public:
Property<float64, SETPOINT> temperature;
Property<float64, SETPOINT> bathReservoirTemperature;
Property<float64, SETPOINT> bathSampleTemperature;
Property<float64> wantedGonioTemperature;
Property<int32> gonioHeater;
Property<float64> sampleTopTemperature;
Property<float64> sampleBottomTemperature;
......
......@@ -6,6 +6,10 @@ humidity_chamber_v4.wanted_humidityPrefix=Wanted humidity
humidity_chamber_v4.wanted_bath_reservoir_temperaturePrefix=Wanted reservoir temp.
humidity_chamber_v4.wanted_bath_sample_temperaturePrefix=Wanted sample temp.
humidity_chamber_v4.tolerancePrefix=Tolerance
humidity_chamber_v4.wanted_gonio_temperaturePrefix=Wanted Gonio Temp.
humidity_chamber_v4.gonio_heaterPrefix=Gonio Heater
humidity_chamber_v4.gonio_heaterCheckedValue=1
humidity_chamber_v4.gonio_heaterUncheckedValue=0
humidity_chamber_v4.timeoutPrefix=Time Out
humidity_chamber_v4.stabilisationPrefix=Stabilisation
......@@ -25,5 +29,5 @@ humidity_chamber_v4.sample_bottom_temperaturePrefix=Sample Bottom temperature
humidity_chamber_v4.reservoir_temperaturePrefix=Reservoir temperature
humidity_chamber_v4.calculated_humidityPrefix=Calculated humidity
humidity_chamber_v4.degreeC=~degreeC
humidity_chamber_v4.degreeCelsius=~degreeC
humidity_chamber_v4.percent=%
<plugin>
<controller type="humidity_chamber_v4" role="humidity_chamber_v41"/>
<number_of_lines nb_lines="2"/>
<number_of_lines nb_lines="3"/>
<property_switcher role="humidity_chamber_v41" property="automatic" switcher_key="humidity_chamber_v4.automaticSwitcher"/>
<property_switcher role="humidity_chamber_v41" property="use_timeout" switcher_key="humidity_chamber_v4.timeoutSwitcher"/>
......@@ -8,18 +8,25 @@
<check role="humidity_chamber_v41" property="automatic" prefix="humidity_chamber_v4.automaticPrefix" checkBoxValues="humidity_chamber_v4.automatic"/>
<switchable_composite switcher_key="humidity_chamber_v4.automaticSwitcher" switch_values="true">
<text role="humidity_chamber_v41" property="wanted_temperature" prefix="humidity_chamber_v4.wanted_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_humidity" prefix="humidity_chamber_v4.wanted_humidityPrefix" suffix="HumidityChamberV4Driver.percent"/>
<text role="humidity_chamber_v41" property="wanted_temperature" prefix="humidity_chamber_v4.wanted_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_humidity" prefix="humidity_chamber_v4.wanted_humidityPrefix" suffix="humidity_chamber_v4.percent"/>
</switchable_composite>
<switchable_composite switcher_key="humidity_chamber_v4.automaticSwitcher" switch_values="false">
<text role="humidity_chamber_v41" property="wanted_bath_reservoir_temperature" prefix="humidity_chamber_v4.wanted_bath_reservoir_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_bath_sample_temperature" prefix="humidity_chamber_v4.wanted_bath_sample_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_bath_reservoir_temperature" prefix="humidity_chamber_v4.wanted_bath_reservoir_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_bath_sample_temperature" prefix="humidity_chamber_v4.wanted_bath_sample_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
</switchable_composite>
<text role="humidity_chamber_v41" property="tolerance" prefix="humidity_chamber_v4.tolerancePrefix" suffix="humidity_chamber_v4.percent"/>
<text role="humidity_chamber_v41" property="tolerance" prefix="humidity_chamber_v4.tolerancePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<switchable_composite switcher_key="humidity_chamber_v4.automaticSwitcher" switch_values="false">
<text role="humidity_chamber_v41" property="wanted_gonio_temperature" prefix="humidity_chamber_v4.wanted_gonio_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<check role="humidity_chamber_v41" property="gonio_heater" prefix="humidity_chamber_v4.gonio_heaterPrefix" checkBoxValues="humidity_chamber_v4.gonio_heater"/>
</switchable_composite>
<newLine/>
<check role="humidity_chamber_v41" property="use_timeout" prefix="humidity_chamber_v4.timeoutPrefix" checkBoxValues="humidity_chamber_v4.timeout"/>
<switchable_composite switcher_key="humidity_chamber_v4.timeoutSwitcher" switch_values="true">
<text role="humidity_chamber_v41" property="timeout" spaceBefore="false"/>
......
......@@ -37,6 +37,13 @@
<decimal_format nb_decimal_places="2"/>
</property>
<property name="wanted_gonio_temperature" type="float64" max_length="6">
<decimal_format nb_decimal_places="2"/>
</property>
<property name="gonio_heater" type="int32">
</property>
<property name="sample_top_temperature" type="float64" max_length="6">
<decimal_format nb_decimal_places="2"/>
</property>
......
......@@ -9,18 +9,22 @@
<check role="humidity_chamber_v41" property="automatic" prefix="humidity_chamber_v4.automaticPrefix" checkBoxValues="humidity_chamber_v4.automatic"/>
<newLine/>
<switchable_composite switcher_key="humidity_chamber_v4.automaticSwitcher" switch_values="true">
<text role="humidity_chamber_v41" property="wanted_temperature" prefix="humidity_chamber_v4.wanted_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_temperature" prefix="humidity_chamber_v4.wanted_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<text role="humidity_chamber_v41" property="wanted_humidity" prefix="humidity_chamber_v4.wanted_humidityPrefix" suffix="HumidityChamberV4Driver.percent"/>
</switchable_composite>
<switchable_composite switcher_key="humidity_chamber_v4.automaticSwitcher" switch_values="false">
<text role="humidity_chamber_v41" property="wanted_bath_reservoir_temperature" prefix="humidity_chamber_v4.wanted_bath_reservoir_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_bath_reservoir_temperature" prefix="humidity_chamber_v4.wanted_bath_reservoir_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<text role="humidity_chamber_v41" property="wanted_bath_sample_temperature" prefix="humidity_chamber_v4.wanted_bath_sample_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<text role="humidity_chamber_v41" property="wanted_bath_sample_temperature" prefix="humidity_chamber_v4.wanted_bath_sample_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<text role="humidity_chamber_v41" property="wanted_gonio_temperature" prefix="humidity_chamber_v4.wanted_gonio_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<check role="humidity_chamber_v41" property="gonio_heater" prefix="humidity_chamber_v4.gonio_heaterPrefix" checkBoxValues="humidity_chamber_v4.gonio_heater"/>
</switchable_composite>
<newLine/>
<text role="humidity_chamber_v41" property="tolerance" prefix="humidity_chamber_v4.tolerancePrefix" suffix="humidity_chamber_v4.percent"/>
<text role="humidity_chamber_v41" property="tolerance" prefix="humidity_chamber_v4.tolerancePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<check role="humidity_chamber_v41" property="use_timeout" prefix="humidity_chamber_v4.timeoutPrefix" checkBoxValues="humidity_chamber_v4.timeout"/>
......@@ -38,13 +42,13 @@
<summary>
<summary_content>
<label role="humidity_chamber_v41" property="reservoir_temperature" prefix="humidity_chamber_v4.reservoir_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<label role="humidity_chamber_v41" property="reservoir_temperature" prefix="humidity_chamber_v4.reservoir_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<label role="humidity_chamber_v41" property="sample_top_temperature" prefix="humidity_chamber_v4.sample_top_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<label role="humidity_chamber_v41" property="sample_top_temperature" prefix="humidity_chamber_v4.sample_top_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<label role="humidity_chamber_v41" property="sample_bottom_temperature" prefix="humidity_chamber_v4.sample_bottom_temperaturePrefix" suffix="HumidityChamberV4Driver.degreeCelsius"/>
<label role="humidity_chamber_v41" property="sample_bottom_temperature" prefix="humidity_chamber_v4.sample_bottom_temperaturePrefix" suffix="humidity_chamber_v4.degreeCelsius"/>
<newLine/>
<label role="humidity_chamber_v41" property="calculated_humidity" prefix="humidity_chamber_v4.calculated_humidityPrefix" suffix="HumidityChamberV4Driver.percent"/>
<label role="humidity_chamber_v41" property="calculated_humidity" prefix="humidity_chamber_v4.calculated_humidityPrefix" suffix="humidity_chamber_v4.percent"/>
<newLine/>
<status role="humidity_chamber_v41" property="commandStatus" valuesImagesAndLabels="commandStatusUnknown,commandStatusIdle,commandStatusRunning,commandStatusWarning,commandStatusError"/>
</summary_content>
......
......@@ -40,6 +40,7 @@ const string MagneticFieldCommon::HOUR_UNIT = "h";
const string MagneticFieldCommon::IPS120_TYPE = "ips120";
const string MagneticFieldCommon::MERCURY_TYPE = "mercury";
const string MagneticFieldCommon::SMS_TYPE = "sms";
/*
* Constructor
......
......@@ -128,6 +128,7 @@ public:
//! driver type
static const std::string IPS120_TYPE;
static const std::string MERCURY_TYPE;
static const std::string SMS_TYPE;
private:
......
......@@ -75,6 +75,7 @@ MagneticFieldController::MagneticFieldController(const string& name) :
m_OldDriver.init(this, "driver");
m_NewDriver.init(this, "new_driver");
m_SmsDriver.init(this, "sms_driver");
registerFunction(TYPE);
......@@ -411,10 +412,17 @@ void MagneticFieldController::setEnabledForLoading(bool all, bool postconf) {
if (driverType() == MagneticFieldCommon::MERCURY_TYPE) {
m_Driver.assign(dynamic_cast<TestController*>(*m_NewDriver.getControllerPointer()));
addExcludeSetEnableController(m_OldDriver.getRole());
addExcludeSetEnableController(m_SmsDriver.getRole());
}
else if (driverType() == MagneticFieldCommon::SMS_TYPE) {
m_Driver.assign(dynamic_cast<TestController*>(*m_SmsDriver.getControllerPointer()));
addExcludeSetEnableController(m_OldDriver.getRole());
addExcludeSetEnableController(m_NewDriver.getRole());
}
else {
m_Driver.assign(dynamic_cast<TestController*>(*m_OldDriver.getControllerPointer()));
addExcludeSetEnableController(m_NewDriver.getRole());
addExcludeSetEnableController(m_SmsDriver.getRole());
}
ExperimentController::setEnabledForLoading(all, postconf);
}
......
......@@ -90,6 +90,7 @@ private:
DriverPtr<MagneticFieldCommon> m_OldDriver; //! Old IPS120 driver link
DriverPtr<MagneticFieldCommon> m_NewDriver; //! New mercury driver link
DriverPtr<MagneticFieldCommon> m_SmsDriver; //! New sms cryogenic driver
DriverPtr<MagneticFieldCommon> m_Driver; //! current driver link
/*!
......
......@@ -293,7 +293,6 @@ void DiffMesure::start() {
k = testK.get(nref);
l = testL.get(nref);
psi = 0;
cout << h() << " " << k() << " " << l() << endl;
if (isStopped() == true) {
cout << "isStopped set error " << endl;
break;
......@@ -304,21 +303,13 @@ void DiffMesure::start() {
}
if (hklptr->commandStatus.isError() == false) {
computeScanPoints();
cout << "compute ok" << endl;
if (enableCollisionsCheck() == true) {
applyCollisionCheck();
}
cout << hklptr->calcH() << " " << hklptr->calcK() << " " << hklptr->calcL() << endl;
hklptr->h.setpoint = hklptr->calcH();
hklptr->k.setpoint = hklptr->calcK();
hklptr->l.setpoint = hklptr->calcL();
hklptr->psi.setpoint = hklptr->calcPsi();
cout << "scan config ok" << endl;
cout << testMode.get(nref) << endl;
cout << testTime.get(nref) << endl;
cout << testCounts.get(nref) << endl;
cout << testCounts2.get(nref) << endl;
cout << testTimeType.get(nref) << endl;
m_Scan->countMode = testMode.get(nref);
m_Scan->wantedTime = testTime.get(nref);
m_Scan->wantedCounts = testCounts.get(nref);
......@@ -541,50 +532,56 @@ void DiffMesure::computeScanPoints() throw (CannotSetValue) {
for (int32 i = 0; i < nbsteps; ++i) {
omegas.push_back(omega - sens() * thew / 2 + sens() * thew / (nbsteps - 1) * i);
}
if (hklptr->useNewComputing() == false) {
for (int32 i = 0; i < nbsteps; ++i) {
// check limits
if (omegas[i] < m_Setting->getOmegaPtr()->minPosition()) {
// try tweek...
hklptr->calcTweek = m_Setting->getOmegaPtr()->minPosition() - omegas[0];
doTweek = true;
} else if (omegas[i] > m_Setting->getOmegaPtr()->maxPosition()) {
// try tweek...
hklptr->calcTweek = m_Setting->getOmegaPtr()->maxPosition() - omegas[nbsteps - 1];
doTweek = true;
}
for (int32 i = 0; i < nbsteps; ++i) {
// check limits
if (omegas[i] < m_Setting->getOmegaPtr()->minPosition()) {
// try tweek...
//cout << "Try tweek min" << endl;
hklptr->calcTweek = m_Setting->getOmegaPtr()->minPosition() - omegas[0];
doTweek = true;
} else if (omegas[i] > m_Setting->getOmegaPtr()->maxPosition()) {
// try tweek...
//cout << "Try tweek max" << endl;
hklptr->calcTweek = m_Setting->getOmegaPtr()->maxPosition() - omegas[0] + 0.01;
doTweek = true;
}
if (doTweek == true) {
hklptr->calculateCommand(true);
if (hklptr->calcStatus.isIdle()) {
omega = hklptr->calcResult.get(0);
theta = hklptr->calcResult.get(1);
thew = extrapolation(nbValues(), fabs(theta) / 2., thetaValues, scanValues);
xthew = extrapolation(nbValues(), fabs(theta) / 2., xthetaValues, xxValues);
omegaScanResult = omega;
gammaScanResult = theta;
omegas.clear();
for (int32 i = 0; i < nbsteps; ++i) {
omegas.push_back(omega - sens() * thew / 2 + sens() * thew / (nbsteps - 1) * i);
}
for (int32 i = 0; i < nbsteps; ++i) {
// check limits
if (omegas[i] < m_Setting->getOmegaPtr()->minPosition()) {
// try tweek...
log(Level::s_Error) << "Negative scan-width software limit on " << m_Setting->getOmegaPtr()->getName()
<< " at " << m_Setting->getOmegaPtr()->minPosition() << "(wants: " << omegas[i] << ")"
<< endlog;
throw CannotSetValue();
} else if (omegas[i] > m_Setting->getOmegaPtr()->maxPosition()) {
log(Level::s_Error) << "Positive scan-width software limit on " << m_Setting->getOmegaPtr()->getName()
<< " at " << m_Setting->getOmegaPtr()->maxPosition() << "(wants: " << omegas[i] << ")"
<< endlog;
throw CannotSetValue();
}
}
if (doTweek == true) {
hklptr->calcTypeHKL = 0;
hklptr->calcH = h();
hklptr->calcK = k();
hklptr->calcL = l();
hklptr->calcPsi = psi();
hklptr->calculateCommand(true);
hklptr->calcTweek = 0;
if (hklptr->calcStatus.isIdle()) {
omega = hklptr->calcResult.get(0);
theta = hklptr->calcResult.get(1);
thew = extrapolation(nbValues(), fabs(theta) / 2., thetaValues, scanValues);
xthew = extrapolation(nbValues(), fabs(theta) / 2., xthetaValues, xxValues);
omegaScanResult = omega;
gammaScanResult = theta;
omegas.clear();
for (int32 i = 0; i < nbsteps; ++i) {
omegas.push_back(omega - sens() * thew / 2 + sens() * thew / (nbsteps - 1) * i);
}
for (int32 i = 0; i < nbsteps; ++i) {
// check limits
if (omegas[i] < m_Setting->getOmegaPtr()->minPosition()) {
// try tweek...
log(Level::s_Error) << "Negative scan-width software limit on " << m_Setting->getOmegaPtr()->getName()
<< " at " << m_Setting->getOmegaPtr()->minPosition() << "(wants: " << omegas[i] << ")"
<< endlog;
throw CannotSetValue();
} else if (omegas[i] > m_Setting->getOmegaPtr()->maxPosition()) {
log(Level::s_Error) << "Positive scan-width software limit on " << m_Setting->getOmegaPtr()->getName()
<< " at " << m_Setting->getOmegaPtr()->maxPosition() << "(wants: " << omegas[i] << ")"
<< endlog;
throw CannotSetValue();
}
} else {
throw CannotSetValue();
}
} else {
throw CannotSetValue();
}
}
......
......@@ -422,7 +422,8 @@ int32 FourCircleHKL::computeHKL0(float64 h, float64 k, float64 l, float64& psi,
ref._wave = wave;
ref._instrument = Instrument(m_InstrumentName);
ref._instrument._zeros << 0, 0, 0, 0, 0; // Put zeros offset are integrated in limits (differnt as mad)
ref._instrument._limits << m_Gamma->minPosition(), m_Gamma->maxPosition(), m_Omega->minPosition(), m_Omega->maxPosition(), m_Chi->minPosition(), m_Chi->maxPosition(), m_Phi->minPosition(), m_Phi->maxPosition(), 0, 0;
// cout << "tweek = " << tweek << endl;
ref._instrument._limits << m_Gamma->minPosition(), m_Gamma->maxPosition(), m_Omega->minPosition(), m_Omega->maxPosition() - tweek, m_Chi->minPosition(), m_Chi->maxPosition(), m_Phi->minPosition(), m_Phi->maxPosition(), 0, 0;
ref._instrument._scattGeom = "4 circle";
ref._instrument._chiQuadrant = (chiQuadrant() == true ? 1 : 0);
ref._instrument._blindaction = blindAction();
......@@ -446,6 +447,7 @@ int32 FourCircleHKL::computeHKL0(float64 h, float64 k, float64 l, float64& psi,
psi = ref._psi;
int32 chkerr = 0;
// cout << omega << endl;
// cout << ref._results << endl;
for (int32 i = 0; i < ref._actions.size(); ++i) {
......@@ -469,7 +471,9 @@ int32 FourCircleHKL::computeHKL0(float64 h, float64 k, float64 l, float64& psi,
}
chkerr += checkLimits(m_Gamma, ref._results(i, 0));
chkerr += checkLimits(m_Omega, ref._results(i, 1));
if (tweek == 0) {
chkerr += checkLimits(m_Omega, ref._results(i, 1));
}
chkerr += checkLimits(m_Chi, ref._results(i, 2));
chkerr += checkLimits(m_Phi, ref._results(i, 3));
}
......@@ -480,7 +484,9 @@ int32 FourCircleHKL::computeHKL0(float64 h, float64 k, float64 l, float64& psi,
}
chkerr = 0;
chkerr += checkLimits(m_Gamma, gamma);
chkerr += checkLimits(m_Omega, omega);
if (tweek == 0) {
chkerr += checkLimits(m_Omega, omega);
}
chkerr += checkLimits(m_Chi, chi);
chkerr += checkLimits(m_Phi, phi);
}
......
......@@ -277,6 +277,8 @@ void LSSSampleSettings::refreshMainControllerTypeProperty(const std::string& val
else {
enableFirstBath = false;
enableSecondBath = false;
enableFirstExternalTemp = false;
enableSecondExternalTemp = false;
}
// if (value == HUMIDITY_CHAMBER_TYPE) {
// if (mainTempControllerId() == HUMIDITY_CHAMBER_V1_TYPE) {
......@@ -294,6 +296,8 @@ void LSSSampleSettings::refreshMainControllerTypeProperty(const std::string& val
} else {
enableFirstBath = false;
enableSecondBath = false;
enableFirstExternalTemp = false;
enableSecondExternalTemp = false;
}
SampleSettings::refreshMainControllerTypeProperty(value);
}
......@@ -309,6 +313,14 @@ void LSSSampleSettings::refreshMainControllerIdProperty(const std::string& value
m_V1HumidityController->bathReservoirDeviceName = firstBathName();
m_V1HumidityController->bathSampleDeviceType = secondBathType();
m_V1HumidityController->bathSampleDeviceName = secondBathName();
enableFirstBath = true;
if (m_Bath2Controller != NULL) {
insertControllerType = BATH_TYPE;
enableSecondBath = true;
if (m_BathSelector != NULL) {
enableBathSelector = true;
}
}
}
} else if (value == HUMIDITY_CHAMBER_V2_TYPE) {
if (m_V2HumidityController != NULL) {
......@@ -323,9 +335,21 @@ void LSSSampleSettings::refreshMainControllerIdProperty(const std::string& value
m_V3HumidityController->bathReservoirDeviceName = firstBathName();
m_V3HumidityController->bathSampleDeviceType = secondBathType();
m_V3HumidityController->bathSampleDeviceName = secondBathName();
enableFirstBath = true;
if (m_Bath2Controller != NULL) {
insertControllerType = BATH_TYPE;
enableSecondBath = true;
if (m_BathSelector != NULL) {
enableBathSelector = true;
}
}
}
} else if (value == HUMIDITY_CHAMBER_V4_TYPE) {
// No bath connected
enableFirstBath = false;
enableSecondBath = false;
enableFirstExternalTemp = false;
enableSecondExternalTemp = false;
}
}
SampleSettings::refreshMainControllerIdProperty(value);
......
......@@ -19,7 +19,10 @@
#include "SampleChangerController.h"
#include "controllers/common/family/Families.h"
#include <boost/tokenizer.hpp>
using namespace std;
using namespace boost;
namespace lss {
......@@ -37,7 +40,7 @@ const int32 SampleChangerController::ERROR_STATUS = 7;
//const int32 SampleChangerController::OUT_TOLERANCE_STATUS = 8;
SampleChangerController::SampleChangerController(const std::string& name) :
ExperimentController(name), controller::Stoppable(this), controller::Pausable(this) {
ExperimentController(name), controller::Stoppable(this), controller::Pausable(this) {
setFamily(family::SAMPLE_ENVIRONMENT); //think if it is necessary to have a subfamily
......@@ -105,6 +108,9 @@ SampleChangerController::SampleChangerController(const std::string& name) :
adjustSlot.setEnumeratedValues(adjustSlotValues);
adjustSlot = 1;
equidistantSlots.init(this, SAVE, "equidistantSlots");
spaces.init(this, SAVE, "spaces");
//Init pointers to other controllers
str1.init(this, "str1");
by.init(this, "by");
......@@ -117,16 +123,18 @@ SampleChangerController::SampleChangerController(const std::string& name) :
registerRefresher(strDSlots, &SampleChangerController::refreshStrDSlotsProperty, this);
registerRefresher(strOrigin, &SampleChangerController::refreshStrOriginProperty, this);
registerRefresher(useStr2, &SampleChangerController::refreshUseStr2, this);
registerRefresher(slotMaxNum, &SampleChangerController::refreshSlotMaxNum, this);
}
SampleChangerController::~SampleChangerController() {
}
void SampleChangerController::postConfiguration() {
// Register the refresher for strName here because str can be null.
registerRefresher(strName, &SampleChangerController::refreshStrName, this);
registerRefresher(spaces, &SampleChangerController::refreshSpaces, this);
registerRefresher(equidistantSlots, &SampleChangerController::refreshEquidistantSlots, this);
//Set values attenuator: copy one by one values and labels
if (att.isAssigned()) {
......@@ -177,7 +185,7 @@ void SampleChangerController::refreshChangerNumProperty(int32 number) throw (Can
int32 oldNumber = changerNum();
//Initialize all values
changerValues.resize(number);
// changerLabels.resize(number);
// changerLabels.resize(number);
slotMaxNum.resize(number);
strDSlots.resize(number);
......@@ -187,19 +195,102 @@ void SampleChangerController::refreshChangerNumProperty(int32 number) throw (Can
for (int i = oldNumber; i < number; i++) {
int32 index = i + 1;
// ostringstream os;
// os << "Changer#" << index;
// ostringstream os;
// os << "Changer#" << index;
//std::string name = os.str();
changerValues.set(i, index);
// changerLabels.set(i, name);
// changerLabels.set(i, name);
}
changer.setEnumeratedValues(changerValues);
changer.setEnumeratedLabels(nicknameValues);
//changer = 1; H.ORTIZ 23 MAY 2016: do not override changer value saved in InstrumentConfig !
equidistantSlots.resize(number);
m_slotSpaces.resize(number);
spaces.resize(number);
}
void SampleChangerController::refreshSlotMaxNum(int32 i, int32 value) throw (CannotSetValue) {
// Check that slotSpaces property matches number of slots
cout << "Size of sample changer " << i << " goes from " << m_slotSpaces[i].size() << " to " << value << endl;