sus printout runtime configurable
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-02-19 17:15:38 +01:00
parent f95abfe032
commit 68e1208b7f
3 changed files with 33 additions and 16 deletions

View File

@ -226,17 +226,22 @@ ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool &localData
void SusHandler::setToGoToNormalMode(bool enable) { this->goToNormalModeImmediately = enable; }
void SusHandler::printDataset() {
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SUS == 1
if (divider.checkAndIncrement()) {
sif::info << "SUS " << std::setw(2) << std::dec << static_cast<int>(susIdx) << " ID "
<< std::hex << "0x" << this->getObjectId() << " [" << std::hex << std::setw(3);
sif::info << dataset.ain0 << ",";
sif::info << dataset.ain1 << ",";
sif::info << dataset.ain2 << ",";
sif::info << dataset.ain3 << ",";
sif::info << dataset.ain4 << ",";
sif::info << dataset.ain5 << "] ";
sif::info << "T[C] " << dataset.temperatureCelcius << " C" << std::endl;
if(periodicPrintout) {
if (divider.checkAndIncrement()) {
sif::info << "SUS " << std::setw(2) << std::dec << static_cast<int>(susIdx) << " ID "
<< std::hex << "0x" << this->getObjectId() << " [" << std::hex << std::setw(3);
sif::info << dataset.ain0 << ",";
sif::info << dataset.ain1 << ",";
sif::info << dataset.ain2 << ",";
sif::info << dataset.ain3 << ",";
sif::info << dataset.ain4 << ",";
sif::info << dataset.ain5 << "] ";
sif::info << "T[C] " << dataset.temperatureCelcius << " C" << std::endl;
}
}
#endif
}
void SusHandler::enablePeriodicPrintout(bool enable, uint8_t divider) {
this->periodicPrintout = enable;
this->divider.setDivider(divider);
}

View File

@ -32,7 +32,7 @@ class SusHandler : public DeviceHandlerBase {
LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId);
virtual ~SusHandler();
// virtual ReturnValue_t performOperation(uint8_t counter) override;
void enablePeriodicPrintout(bool enable, uint8_t divider);
virtual ReturnValue_t initialize() override;
void setToGoToNormalMode(bool enable);
@ -48,7 +48,6 @@ class SusHandler : public DeviceHandlerBase {
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
size_t* foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
// void setNormalDatapoolEntriesInvalid() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
@ -68,9 +67,8 @@ class SusHandler : public DeviceHandlerBase {
READ_INT_CLOCKED_CONVERSIONS
};
bool periodicPrintout = false;
PeriodicOperationDivider divider;
// LinuxLibgpioIF* gpioComIF = nullptr;
// gpioId_t chipSelectId = gpio::NO_GPIO;
bool goToNormalModeImmediately = false;
bool commandExecuted = false;