|
|
|
@ -573,369 +573,342 @@ void ThermalController::copySus() {
|
|
|
|
|
|
|
|
|
|
void ThermalController::copyDevices() {
|
|
|
|
|
lp_var_t<float> tempQ7s = lp_var_t<float>(objects::CORE_CONTROLLER, core::PoolIds::TEMPERATURE);
|
|
|
|
|
ReturnValue_t result = tempQ7s.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read Q7S temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.q7s.setValid(false);
|
|
|
|
|
deviceTemperatures.q7s = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.q7s = tempQ7s;
|
|
|
|
|
deviceTemperatures.q7s.setValid(tempQ7s.isValid());
|
|
|
|
|
{
|
|
|
|
|
PoolReadGuard pg(&tempQ7s, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if(pg.getReadResult() == returnvalue::OK) {
|
|
|
|
|
deviceTemperatures.q7s = tempQ7s;
|
|
|
|
|
deviceTemperatures.q7s.setValid(tempQ7s.isValid());
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.q7s.setValid(false);
|
|
|
|
|
deviceTemperatures.q7s = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempQ7s.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int16_t> battTemp1 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_1);
|
|
|
|
|
PoolReadGuard pg(&battTemp1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 1" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp1 = battTemp1;
|
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(battTemp1.isValid());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int16_t> battTemp1 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_1);
|
|
|
|
|
result = battTemp1.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 1" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp1 = battTemp1;
|
|
|
|
|
deviceTemperatures.batteryTemp1.setValid(battTemp1.isValid());
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int16_t> battTemp2 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_2);
|
|
|
|
|
PoolReadGuard pg(&battTemp2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 2" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp2 = battTemp2;
|
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(battTemp2.isValid());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = battTemp1.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int16_t> battTemp3 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_3);
|
|
|
|
|
PoolReadGuard pg(&battTemp3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 3" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp3 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp3 = battTemp3;
|
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(battTemp3.isValid());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int16_t> battTemp2 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_2);
|
|
|
|
|
result = battTemp2.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 2" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp2 = battTemp2;
|
|
|
|
|
deviceTemperatures.batteryTemp2.setValid(battTemp2.isValid());
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int16_t> battTemp4 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_4);
|
|
|
|
|
PoolReadGuard pg(&battTemp4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 4" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp4 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp4 = battTemp4;
|
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(battTemp4.isValid());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = battTemp2.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int32_t> tempRw1 = lp_var_t<int32_t>(objects::RW1, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
PoolReadGuard pg(&tempRw1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw1.setValid(false);
|
|
|
|
|
deviceTemperatures.rw1 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw1.setValid(tempRw1.isValid());
|
|
|
|
|
deviceTemperatures.rw1 = tempRw1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int16_t> battTemp3 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_3);
|
|
|
|
|
result = battTemp3.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 3" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp3 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp3 = battTemp3;
|
|
|
|
|
deviceTemperatures.batteryTemp3.setValid(battTemp3.isValid());
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int32_t> tempRw2 = lp_var_t<int32_t>(objects::RW2, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
PoolReadGuard pg(&tempRw2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw2.setValid(false);
|
|
|
|
|
deviceTemperatures.rw2 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw2.setValid(tempRw2.isValid());
|
|
|
|
|
deviceTemperatures.rw2 = tempRw2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = battTemp3.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int32_t> tempRw3 = lp_var_t<int32_t>(objects::RW3, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
PoolReadGuard pg(&tempRw3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 3 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw3.setValid(false);
|
|
|
|
|
deviceTemperatures.rw3 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw3.setValid(tempRw3.isValid());
|
|
|
|
|
deviceTemperatures.rw3 = tempRw3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int16_t> battTemp4 =
|
|
|
|
|
lp_var_t<int16_t>(objects::BPX_BATT_HANDLER, BpxBattery::BATT_TEMP_4);
|
|
|
|
|
result = battTemp4.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read battery temperature 4" << std::endl;
|
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(false);
|
|
|
|
|
deviceTemperatures.batteryTemp4 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.batteryTemp4 = battTemp4;
|
|
|
|
|
deviceTemperatures.batteryTemp4.setValid(battTemp4.isValid());
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int32_t> tempRw4 = lp_var_t<int32_t>(objects::RW4, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
PoolReadGuard pg(&tempRw4, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 4 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw4.setValid(false);
|
|
|
|
|
deviceTemperatures.rw4 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw4.setValid(tempRw4.isValid());
|
|
|
|
|
deviceTemperatures.rw4 = tempRw4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = battTemp4.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempStartracker =
|
|
|
|
|
lp_var_t<float>(objects::STAR_TRACKER, startracker::MCU_TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempStartracker, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read startracker temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.startracker.setValid(false);
|
|
|
|
|
deviceTemperatures.startracker = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.startracker.setValid(tempStartracker.isValid());
|
|
|
|
|
deviceTemperatures.startracker = tempStartracker;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int32_t> tempRw1 = lp_var_t<int32_t>(objects::RW1, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
result = tempRw1.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw1.setValid(false);
|
|
|
|
|
deviceTemperatures.rw1 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw1.setValid(tempRw1.isValid());
|
|
|
|
|
deviceTemperatures.rw1 = tempRw1;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempSyrlinksPowerAmplifier =
|
|
|
|
|
lp_var_t<float>(objects::SYRLINKS_HK_HANDLER, syrlinks::TEMP_POWER_AMPLIFIER);
|
|
|
|
|
PoolReadGuard pg(&tempSyrlinksPowerAmplifier, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks power amplifier temperature"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(false);
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(tempSyrlinksPowerAmplifier.isValid());
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = tempSyrlinksPowerAmplifier;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempRw1.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempSyrlinksBasebandBoard =
|
|
|
|
|
lp_var_t<float>(objects::SYRLINKS_HK_HANDLER, syrlinks::TEMP_BASEBAND_BOARD);
|
|
|
|
|
PoolReadGuard pg(&tempSyrlinksBasebandBoard, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks baseband board temperature"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(false);
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(tempSyrlinksBasebandBoard.isValid());
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = tempSyrlinksBasebandBoard;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int32_t> tempRw2 = lp_var_t<int32_t>(objects::RW2, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
result = tempRw2.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw2.setValid(false);
|
|
|
|
|
deviceTemperatures.rw2 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw2.setValid(tempRw2.isValid());
|
|
|
|
|
deviceTemperatures.rw2 = tempRw2;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<int16_t> tempMgt = lp_var_t<int16_t>(objects::IMTQ_HANDLER, IMTQ::MCU_TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempMgt, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGT temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgt.setValid(false);
|
|
|
|
|
deviceTemperatures.mgt = static_cast<int16_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgt.setValid(tempMgt.isValid());
|
|
|
|
|
deviceTemperatures.mgt = tempMgt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempRw2.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_vec_t<float, 3> tempAcu =
|
|
|
|
|
lp_vec_t<float, 3>(objects::ACU_HANDLER, ACU::pool::ACU_TEMPERATURES);
|
|
|
|
|
PoolReadGuard pg(&tempAcu, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read ACU temperatures" << std::endl;
|
|
|
|
|
deviceTemperatures.acu.setValid(false);
|
|
|
|
|
deviceTemperatures.acu[0] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
deviceTemperatures.acu[1] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
deviceTemperatures.acu[2] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.acu.setValid(tempAcu.isValid());
|
|
|
|
|
deviceTemperatures.acu = tempAcu;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int32_t> tempRw3 = lp_var_t<int32_t>(objects::RW3, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
result = tempRw3.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 3 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw3.setValid(false);
|
|
|
|
|
deviceTemperatures.rw3 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw3.setValid(tempRw3.isValid());
|
|
|
|
|
deviceTemperatures.rw3 = tempRw3;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempPdu1 = lp_var_t<float>(objects::PDU1_HANDLER, PDU::pool::PDU_TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempPdu1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.pdu1.setValid(false);
|
|
|
|
|
deviceTemperatures.pdu1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.pdu1.setValid(tempPdu1.isValid());
|
|
|
|
|
deviceTemperatures.pdu1 = tempPdu1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempRw3.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempPdu2 = lp_var_t<float>(objects::PDU2_HANDLER, PDU::pool::PDU_TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempPdu2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.pdu2.setValid(false);
|
|
|
|
|
deviceTemperatures.pdu2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.pdu2.setValid(tempPdu2.isValid());
|
|
|
|
|
deviceTemperatures.pdu2 = tempPdu2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int32_t> tempRw4 = lp_var_t<int32_t>(objects::RW4, RwDefinitions::TEMPERATURE_C);
|
|
|
|
|
result = tempRw4.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read reaction wheel 4 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.rw4.setValid(false);
|
|
|
|
|
deviceTemperatures.rw4 = static_cast<int32_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.rw4.setValid(tempRw4.isValid());
|
|
|
|
|
deviceTemperatures.rw4 = tempRw4;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> temp1P60dock =
|
|
|
|
|
lp_var_t<float>(objects::P60DOCK_HANDLER, P60Dock::pool::P60DOCK_TEMPERATURE_1);
|
|
|
|
|
PoolReadGuard pg(&temp1P60dock, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 1" << std::endl;
|
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(false);
|
|
|
|
|
deviceTemperatures.temp1P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(temp1P60dock.isValid());
|
|
|
|
|
deviceTemperatures.temp1P60dock = temp1P60dock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempRw4.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> temp2P60dock =
|
|
|
|
|
lp_var_t<float>(objects::P60DOCK_HANDLER, P60Dock::pool::P60DOCK_TEMPERATURE_2);
|
|
|
|
|
PoolReadGuard pg(&temp2P60dock, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 2" << std::endl;
|
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(false);
|
|
|
|
|
deviceTemperatures.temp2P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(temp2P60dock.isValid());
|
|
|
|
|
deviceTemperatures.temp2P60dock = temp2P60dock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempStartracker =
|
|
|
|
|
lp_var_t<float>(objects::STAR_TRACKER, startracker::MCU_TEMPERATURE);
|
|
|
|
|
result = tempStartracker.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read startracker temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.startracker.setValid(false);
|
|
|
|
|
deviceTemperatures.startracker = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.startracker.setValid(tempStartracker.isValid());
|
|
|
|
|
deviceTemperatures.startracker = tempStartracker;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempGyro0 = lp_var_t<float>(objects::GYRO_0_ADIS_HANDLER, ADIS1650X::TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempGyro0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 0 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(tempGyro0.isValid());
|
|
|
|
|
deviceTemperatures.gyro0SideA = tempGyro0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempStartracker.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempGyro1 = lp_var_t<float>(objects::GYRO_1_L3G_HANDLER, L3GD20H::TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempGyro1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro1SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(tempGyro1.isValid());
|
|
|
|
|
deviceTemperatures.gyro1SideA = tempGyro1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempSyrlinksPowerAmplifier =
|
|
|
|
|
lp_var_t<float>(objects::SYRLINKS_HK_HANDLER, syrlinks::TEMP_POWER_AMPLIFIER);
|
|
|
|
|
result = tempSyrlinksPowerAmplifier.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks power amplifier temperature"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(false);
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier.setValid(tempSyrlinksPowerAmplifier.isValid());
|
|
|
|
|
deviceTemperatures.syrlinksPowerAmplifier = tempSyrlinksPowerAmplifier;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempGyro2 = lp_var_t<float>(objects::GYRO_2_ADIS_HANDLER, ADIS1650X::TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempGyro2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(tempGyro2.isValid());
|
|
|
|
|
deviceTemperatures.gyro2SideB = tempGyro2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempSyrlinksPowerAmplifier.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempGyro3 = lp_var_t<float>(objects::GYRO_3_L3G_HANDLER, L3GD20H::TEMPERATURE);
|
|
|
|
|
PoolReadGuard pg(&tempGyro3, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 3 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro3SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(tempGyro3.isValid());
|
|
|
|
|
deviceTemperatures.gyro3SideB = tempGyro3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempSyrlinksBasebandBoard =
|
|
|
|
|
lp_var_t<float>(objects::SYRLINKS_HK_HANDLER, syrlinks::TEMP_BASEBAND_BOARD);
|
|
|
|
|
result = tempSyrlinksBasebandBoard.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read syrlinks baseband board temperature"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(false);
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard.setValid(tempSyrlinksBasebandBoard.isValid());
|
|
|
|
|
deviceTemperatures.syrlinksBasebandBoard = tempSyrlinksBasebandBoard;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempMgm0 =
|
|
|
|
|
lp_var_t<float>(objects::MGM_0_LIS3_HANDLER, MGMLIS3MDL::TEMPERATURE_CELCIUS);
|
|
|
|
|
PoolReadGuard pg(&tempMgm0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 0 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.mgm0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(tempMgm0.isValid());
|
|
|
|
|
deviceTemperatures.mgm0SideA = tempMgm0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result = tempSyrlinksBasebandBoard.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempMgm2 =
|
|
|
|
|
lp_var_t<float>(objects::MGM_2_LIS3_HANDLER, MGMLIS3MDL::TEMPERATURE_CELCIUS);
|
|
|
|
|
PoolReadGuard pg(&tempMgm2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.mgm2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(tempMgm2.isValid());
|
|
|
|
|
deviceTemperatures.mgm2SideB = tempMgm2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<int16_t> tempMgt = lp_var_t<int16_t>(objects::IMTQ_HANDLER, IMTQ::MCU_TEMPERATURE);
|
|
|
|
|
result = tempMgt.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGT temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgt.setValid(false);
|
|
|
|
|
deviceTemperatures.mgt = static_cast<int16_t>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgt.setValid(tempMgt.isValid());
|
|
|
|
|
deviceTemperatures.mgt = tempMgt;
|
|
|
|
|
}
|
|
|
|
|
result = tempMgt.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_vec_t<float, 3> tempAcu =
|
|
|
|
|
lp_vec_t<float, 3>(objects::ACU_HANDLER, ACU::pool::ACU_TEMPERATURES);
|
|
|
|
|
result = tempAcu.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read ACU temperatures" << std::endl;
|
|
|
|
|
deviceTemperatures.acu.setValid(false);
|
|
|
|
|
deviceTemperatures.acu[0] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
deviceTemperatures.acu[1] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
deviceTemperatures.acu[2] = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.acu.setValid(tempAcu.isValid());
|
|
|
|
|
deviceTemperatures.acu = tempAcu;
|
|
|
|
|
}
|
|
|
|
|
result = tempAcu.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempPdu1 = lp_var_t<float>(objects::PDU1_HANDLER, PDU::pool::PDU_TEMPERATURE);
|
|
|
|
|
result = tempPdu1.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.pdu1.setValid(false);
|
|
|
|
|
deviceTemperatures.pdu1 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.pdu1.setValid(tempPdu1.isValid());
|
|
|
|
|
deviceTemperatures.pdu1 = tempPdu1;
|
|
|
|
|
}
|
|
|
|
|
result = tempPdu1.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempPdu2 = lp_var_t<float>(objects::PDU2_HANDLER, PDU::pool::PDU_TEMPERATURE);
|
|
|
|
|
result = tempPdu2.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read PDU2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.pdu2.setValid(false);
|
|
|
|
|
deviceTemperatures.pdu2 = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.pdu2.setValid(tempPdu1.isValid());
|
|
|
|
|
deviceTemperatures.pdu2 = tempPdu1;
|
|
|
|
|
}
|
|
|
|
|
result = tempPdu2.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> temp1P60dock =
|
|
|
|
|
lp_var_t<float>(objects::P60DOCK_HANDLER, P60Dock::pool::P60DOCK_TEMPERATURE_1);
|
|
|
|
|
result = temp1P60dock.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 1" << std::endl;
|
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(false);
|
|
|
|
|
deviceTemperatures.temp1P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.temp1P60dock.setValid(temp1P60dock.isValid());
|
|
|
|
|
deviceTemperatures.temp1P60dock = temp1P60dock;
|
|
|
|
|
}
|
|
|
|
|
result = temp1P60dock.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> temp2P60dock =
|
|
|
|
|
lp_var_t<float>(objects::P60DOCK_HANDLER, P60Dock::pool::P60DOCK_TEMPERATURE_2);
|
|
|
|
|
result = temp2P60dock.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read P60 dock temperature 2" << std::endl;
|
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(false);
|
|
|
|
|
deviceTemperatures.temp2P60dock = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.temp2P60dock.setValid(temp2P60dock.isValid());
|
|
|
|
|
deviceTemperatures.temp2P60dock = temp2P60dock;
|
|
|
|
|
}
|
|
|
|
|
result = temp2P60dock.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempGyro0 = lp_var_t<float>(objects::GYRO_0_ADIS_HANDLER, ADIS1650X::TEMPERATURE);
|
|
|
|
|
result = tempGyro0.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 0 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro0SideA.setValid(tempGyro0.isValid());
|
|
|
|
|
deviceTemperatures.gyro0SideA = tempGyro0;
|
|
|
|
|
}
|
|
|
|
|
result = tempGyro0.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempGyro1 = lp_var_t<float>(objects::GYRO_1_L3G_HANDLER, L3GD20H::TEMPERATURE);
|
|
|
|
|
result = tempGyro1.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 1 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro1SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro1SideA.setValid(tempGyro1.isValid());
|
|
|
|
|
deviceTemperatures.gyro1SideA = tempGyro1;
|
|
|
|
|
}
|
|
|
|
|
result = tempGyro1.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempGyro2 = lp_var_t<float>(objects::GYRO_2_ADIS_HANDLER, ADIS1650X::TEMPERATURE);
|
|
|
|
|
result = tempGyro2.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro2SideB.setValid(tempGyro2.isValid());
|
|
|
|
|
deviceTemperatures.gyro2SideB = tempGyro2;
|
|
|
|
|
}
|
|
|
|
|
result = tempGyro2.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempGyro3 = lp_var_t<float>(objects::GYRO_3_L3G_HANDLER, L3GD20H::TEMPERATURE);
|
|
|
|
|
result = tempGyro3.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read gyro 3 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.gyro3SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.gyro3SideB.setValid(tempGyro3.isValid());
|
|
|
|
|
deviceTemperatures.gyro3SideB = tempGyro3;
|
|
|
|
|
}
|
|
|
|
|
result = tempGyro3.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempMgm0 =
|
|
|
|
|
lp_var_t<float>(objects::MGM_0_LIS3_HANDLER, MGMLIS3MDL::TEMPERATURE_CELCIUS);
|
|
|
|
|
result = tempMgm0.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 0 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(false);
|
|
|
|
|
deviceTemperatures.mgm0SideA = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgm0SideA.setValid(tempMgm0.isValid());
|
|
|
|
|
deviceTemperatures.mgm0SideA = tempMgm0;
|
|
|
|
|
}
|
|
|
|
|
result = tempMgm0.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempMgm2 =
|
|
|
|
|
lp_var_t<float>(objects::MGM_2_LIS3_HANDLER, MGMLIS3MDL::TEMPERATURE_CELCIUS);
|
|
|
|
|
result = tempMgm2.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read MGM 2 temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(false);
|
|
|
|
|
deviceTemperatures.mgm2SideB = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.mgm2SideB.setValid(tempMgm2.isValid());
|
|
|
|
|
deviceTemperatures.mgm2SideB = tempMgm2;
|
|
|
|
|
}
|
|
|
|
|
result = tempMgm2.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
lp_var_t<float> tempAdcPayloadPcdu = lp_var_t<float>(objects::PLPCDU_HANDLER, plpcdu::TEMP);
|
|
|
|
|
result = tempAdcPayloadPcdu.read();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read payload PCDU ADC temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(false);
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(tempAdcPayloadPcdu.isValid());
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu = tempAdcPayloadPcdu;
|
|
|
|
|
}
|
|
|
|
|
result = tempAdcPayloadPcdu.commit();
|
|
|
|
|
if (result != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to commit" << std::endl;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
lp_var_t<float> tempAdcPayloadPcdu = lp_var_t<float>(objects::PLPCDU_HANDLER, plpcdu::TEMP);
|
|
|
|
|
PoolReadGuard pg(&tempAdcPayloadPcdu, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
|
|
|
|
if (pg.getReadResult() != returnvalue::OK) {
|
|
|
|
|
sif::warning << "ThermalController: Failed to read payload PCDU ADC temperature" << std::endl;
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(false);
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu = static_cast<float>(INVALID_TEMPERATURE);
|
|
|
|
|
} else {
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu.setValid(tempAdcPayloadPcdu.isValid());
|
|
|
|
|
deviceTemperatures.adcPayloadPcdu = tempAdcPayloadPcdu;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|