fixed conflicts
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
2022-04-28 18:33:27 +02:00
25 changed files with 1243 additions and 896 deletions

View File

@ -22,7 +22,7 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t
gpioIF(gpioIF),
enTxClock(enTxClock),
enTxData(enTxData),
TRANSMITTER_TIMEOUT(transmitterTimeout) {
transmitterTimeout(transmitterTimeout) {
commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE);
auto mqArgs = MqArgs(objectId, static_cast<void*>(this));
eventQueue =
@ -312,7 +312,7 @@ void CCSDSHandler::enableTransmit() {
// Transmitter already enabled
return;
}
transmitterCountdown.setTimeout(TRANSMITTER_TIMEOUT);
transmitterCountdown.setTimeout(transmitterTimeout);
#ifndef TE0720_1CFA
gpioIF->pullHigh(enTxClock);
gpioIF->pullHigh(enTxData);

View File

@ -133,9 +133,9 @@ class CCSDSHandler : public SystemObject,
gpioId_t enTxClock = gpio::NO_GPIO;
gpioId_t enTxData = gpio::NO_GPIO;
// syrlinks must not be transmitting more than 15 minutes (according to datasheet)
// Value can be configured via CTOR argument to allow test setups
const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min
// Syrlinks must not be transmitting more than 15 minutes (according to datasheet)
// Value initialized by constructor argument
const uint32_t transmitterTimeout = 0;
// Countdown to disable transmitter after 15 minutes
Countdown transmitterCountdown;

View File

@ -1,16 +1,17 @@
#include <iomanip>
#include "ProgressPrinter.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
ProgressPrinter::ProgressPrinter(std::string name, uint32_t numSteps, uint32_t percentageResolution)
ProgressPrinter::ProgressPrinter(std::string name, uint32_t numSteps, float percentageResolution)
: name(name), numSteps(numSteps), percentageResolution(percentageResolution) {}
ProgressPrinter::~ProgressPrinter() {}
void ProgressPrinter::print(uint32_t currentStep) {
float progressInPercent = static_cast<float>(currentStep) / static_cast<float>(numSteps) * 100;
if (static_cast<uint32_t>(progressInPercent) >= nextProgressPrint) {
sif::info << name << " progress: " << progressInPercent << " %" << std::endl;
if (progressInPercent >= nextProgressPrint) {
sif::info << name << " progress: " << std::setprecision(4) << progressInPercent << " %"
<< std::endl;
nextProgressPrint += percentageResolution;
}
}

View File

@ -11,7 +11,9 @@
class ProgressPrinter {
public:
static const uint32_t ONE_PERCENT = 1;
static constexpr float HALF_PERCENT = 0.5;
static constexpr float ONE_PERCENT = 1;
static constexpr float FIVE_PERCENT = 5;
/**
* @brief Constructor
@ -21,7 +23,7 @@ class ProgressPrinter {
* @param percentageResolution Distance between printed percentage steps. E.g. 5 means that
* a printout will be generated after 0%, 5%, 10% etc.
*/
ProgressPrinter(std::string name, uint32_t numSteps, uint32_t percentageResolution = FIVE_PERCENT);
ProgressPrinter(std::string name, uint32_t numSteps, float percentageResolution = FIVE_PERCENT);
virtual ~ProgressPrinter();
/**
@ -32,12 +34,11 @@ class ProgressPrinter {
void print(uint32_t step);
private:
static constexpr uint32_t FIVE_PERCENT = 5;
std::string name = "";
uint32_t numSteps = 0;
uint32_t nextProgressPrint = 0;
uint32_t percentageResolution = 0;
float nextProgressPrint = 0;
float percentageResolution = 0;
};
#endif /* MISSION_UTILITY_PROGRESSPRINTER_H_ */