param file init success
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
3f3bbfcde4
commit
a5e2208e01
@ -203,6 +203,7 @@ void PayloadPcduHandler::handleExtConvRead(const uint8_t* bufStart) {
|
||||
}
|
||||
|
||||
void PayloadPcduHandler::handlePrintout() {
|
||||
using namespace plpcdu;
|
||||
if (periodicPrintout) {
|
||||
if (opDivider.checkAndIncrement()) {
|
||||
sif::info << "PL PCDU ADC hex [" << std::setfill('0') << std::hex;
|
||||
@ -213,6 +214,17 @@ void PayloadPcduHandler::handlePrintout() {
|
||||
}
|
||||
}
|
||||
sif::info << "] | T[C] " << std::dec << adcSet.tempC.value << std::endl;
|
||||
sif::info << "Neg V: " << adcSet.processed[U_NEG_V_FB] << std::endl;
|
||||
sif::info << "I HPA [mA]: " << adcSet.processed[I_HPA] << std::endl;
|
||||
sif::info << "U HPA [V]: " << adcSet.processed[U_HPA_DIV_6] << std::endl;
|
||||
sif::info << "I MPA [mA]: " << adcSet.processed[I_MPA] << std::endl;
|
||||
sif::info << "U MPA [V]: " << adcSet.processed[U_MPA_DIV_6] << std::endl;
|
||||
sif::info << "I TX [mA]: " << adcSet.processed[I_TX] << std::endl;
|
||||
sif::info << "U TX [V]: " << adcSet.processed[U_TX_DIV_6] << std::endl;
|
||||
sif::info << "I X8 [mA]: " << adcSet.processed[I_X8] << std::endl;
|
||||
sif::info << "U X8 [V]: " << adcSet.processed[U_X8_DIV_6] << std::endl;
|
||||
sif::info << "I DRO [mA]: " << adcSet.processed[I_DRO] << std::endl;
|
||||
sif::info << "U DRO [V]: " << adcSet.processed[U_DRO_DIV_6] << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -257,17 +269,19 @@ void PayloadPcduHandler::checkAdcValues() {
|
||||
adcSet.processed[U_X8_DIV_6] = static_cast<float>(adcSet.channels[9]) * SCALE_VOLTAGE;
|
||||
adcSet.processed[I_DRO] = static_cast<float>(adcSet.channels[10]) * SCALE_CURRENT_DRO * 1000.0;
|
||||
adcSet.processed[U_DRO_DIV_6] = static_cast<float>(adcSet.channels[11]) * SCALE_VOLTAGE;
|
||||
if(adcSet.processed[U_BAT_DIV_6] < -6.0 or adcSet.processed[U_BAT_DIV_6] > -3.3) {
|
||||
bool tooLarge = false;
|
||||
if(adcSet.processed[U_BAT_DIV_6] > -3.3) {
|
||||
tooLarge = true;
|
||||
if(state >= States::ON_TRANS_DRO) {
|
||||
if(adcSet.processed[U_BAT_DIV_6] < -6.0 or adcSet.processed[U_BAT_DIV_6] > -3.3) {
|
||||
bool tooLarge = false;
|
||||
if(adcSet.processed[U_BAT_DIV_6] > -3.3) {
|
||||
tooLarge = true;
|
||||
}
|
||||
uint32_t rawVoltage = 0;
|
||||
size_t serSize = 0;
|
||||
SerializeAdapter::serialize(&adcSet.processed[U_BAT_DIV_6],
|
||||
reinterpret_cast<uint8_t*>(&rawVoltage), &serSize, 4, SerializeIF::Endianness::NETWORK);
|
||||
triggerEvent(NEG_V_OUT_OF_BOUNDS, tooLarge, rawVoltage);
|
||||
transitionBackToOff();
|
||||
}
|
||||
uint32_t rawVoltage = 0;
|
||||
size_t serSize = 0;
|
||||
SerializeAdapter::serialize(&adcSet.processed[U_BAT_DIV_6],
|
||||
reinterpret_cast<uint8_t*>(&rawVoltage), &serSize, 4, SerializeIF::Endianness::NETWORK);
|
||||
triggerEvent(NEG_V_OUT_OF_BOUNDS, tooLarge, rawVoltage);
|
||||
transitionBackToOff();
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,8 +291,8 @@ void PayloadPcduHandler::checkJsonFileInit() {
|
||||
sdcMan->getPreferredSdCard(prefSd);
|
||||
if(sdcMan->isSdCardMounted(prefSd)) {
|
||||
params.initialize(sdcMan->getCurrentMountPrefix(prefSd));
|
||||
jsonFileInitComplete = true;
|
||||
}
|
||||
jsonFileInitComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ class PlPcduParameter : public NVMParameterBase {
|
||||
ReturnValue_t initialize(std::string mountPrefix) {
|
||||
setFullName(mountPrefix + "/conf/plpcdu.json");
|
||||
ReturnValue_t result = readJsonFile();
|
||||
if(result == HasReturnvaluesIF::RETURN_OK) {
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
// File does not exist. Create it. Keys and appropriate init values were
|
||||
// specified in constructor
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
|
@ -19,7 +19,7 @@ ReturnValue_t NVMParameterBase::readJsonFile() {
|
||||
|
||||
ReturnValue_t NVMParameterBase::writeJsonFile() {
|
||||
std::ofstream o(fullName);
|
||||
o << std::setw(4) << json;
|
||||
o << std::setw(4) << json << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user