Commit 64292bc8 authored by locatelli's avatar locatelli

Test humidity chamber V4 at SANE lab

parent 04e4cbaa
......@@ -27,7 +27,7 @@ static const std::string READ_PARAM_COMMAND = "readParam";
// - Automatic mode - Read/write - bool - %M50
// => case à cocher dans les configurations NOMAD
// si VRAI => mode auto / si FAUX => mode manu
static const int32 AUTO_MODE_REGISTER = 50;
static const int32 AUTO_MODE_REGISTER = 246;
//Si automatic mode = VRAI, les deux consignes suivantes sont visibles :
......
......@@ -94,34 +94,34 @@ void RealHumidityChamberV4Driver::writeParam() {
* readParam
*/
void RealHumidityChamberV4Driver::readParam() {
int16 value = owner()->readInputRegister(HC_TYPE_REGISTER);
uint16 value = owner()->readHoldingRegister(HC_TYPE_REGISTER);
owner()->typeHC.update((int32) value);
float32 val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_SLOPE_04HCAL10_REGISTER);
owner()->humiditySlopeCoef04HCAL10.update((float64) val32);
val32 = owner()->readInputRegister(HUMIDITY_SENSOR_ZERO_OFFSET_04HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_ZERO_OFFSET_04HCAL10_REGISTER);
owner()->humidityZeroOffsetCoef04HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_SLOPE_04HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_SLOPE_04HCAL10_REGISTER);
owner()->pressureSlopeCoef04HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_ZERO_OFFSET_04HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_ZERO_OFFSET_04HCAL10_REGISTER);
owner()->pressureZeroOffsetCoef04HCAL10.update((float64) val32);
val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_SLOPE_05HCAL10_REGISTER);
owner()->humiditySlopeCoef05HCAL10.update((float64) val32);
val32 = owner()->readInputRegister(HUMIDITY_SENSOR_ZERO_OFFSET_05HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_ZERO_OFFSET_05HCAL10_REGISTER);
owner()->humidityZeroOffsetCoef05HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_SLOPE_05HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_SLOPE_05HCAL10_REGISTER);
owner()->pressureSlopeCoef05HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_ZERO_OFFSET_05HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_ZERO_OFFSET_05HCAL10_REGISTER);
owner()->pressureZeroOffsetCoef05HCAL10.update((float64) val32);
val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_SLOPE_06HCAL10_REGISTER);
owner()->humiditySlopeCoef06HCAL10.update((float64) val32);
val32 = owner()->readInputRegister(HUMIDITY_SENSOR_ZERO_OFFSET_06HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(HUMIDITY_SENSOR_ZERO_OFFSET_06HCAL10_REGISTER);
owner()->humidityZeroOffsetCoef06HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_SLOPE_06HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_SLOPE_06HCAL10_REGISTER);
owner()->pressureSlopeCoef06HCAL10.update((float64) val32);
value = owner()->readInputRegister(PRESSURE_SENSOR_ZERO_OFFSET_06HCAL10_REGISTER);
val32 = owner()->readFloat32HoldingRegister(PRESSURE_SENSOR_ZERO_OFFSET_06HCAL10_REGISTER);
owner()->pressureZeroOffsetCoef06HCAL10.update((float64) val32);
}
......@@ -149,8 +149,11 @@ void RealHumidityChamberV4Driver::read() {
* start
*/
void RealHumidityChamberV4Driver::start() {
bool valBool = static_cast<float32>(owner()->tolerance());
owner()->writeBit(AUTO_MODE_REGISTER, valBool);
int16 val = 0;
if (owner()->automatic()) {
val = 1;
}
owner()->writeSingleRegister(AUTO_MODE_REGISTER, val);
float32 val32 = 0;
val32 = static_cast<float32>(owner()->tolerance());
......
......@@ -7,6 +7,8 @@ HumidityChamberV4Driver.percent=%
HumidityChamberV4Driver.humiditySensorPrefix=Humidity sensor parameters
HumidityChamberV4Driver.typeHCPrefix=Chamber type:
HumidityChamberV4Driver.NoneLabel=None
HumidityChamberV4Driver.NoneValue=0
HumidityChamberV4Driver.04HCAL10Label=04HCAL10
HumidityChamberV4Driver.04HCAL10Value=1
HumidityChamberV4Driver.05HCAL10Label=05HCAL10
......
......@@ -8,7 +8,7 @@
<newLine/>
<group title="HumidityChamberV4Driver.humiditySensorPrefix">
<label role="HumidityChamberV4Driver1" property="typeHC" prefix="HumidityChamberV4Driver.typeHCPrefix" valuesAndLabels="HumidityChamberV4Driver.04HCAL10,HumidityChamberV4Driver.05HCAL10,HumidityChamberV4Driver.06HCAL10"/>
<label role="HumidityChamberV4Driver1" property="typeHC" prefix="HumidityChamberV4Driver.typeHCPrefix" valuesAndLabels="HumidityChamberV4Driver.None,HumidityChamberV4Driver.04HCAL10,HumidityChamberV4Driver.05HCAL10,HumidityChamberV4Driver.06HCAL10"/>
<newLine/>
<table_composite nbColumns="3">
<simple_label prefix="HumidityChamberV4Driver.sensorPrefix"/>
......
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