eive-obsw/mission/utility/ProgressPrinter.cpp
Robin Mueller 8054694763
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good
update for generator scripts
- Generators will now copy csv files into tmtc folder
- Bump fsfwgen dependency, some bugfixes
- Rerun formatter
- Rerun generator scripts
2022-03-04 15:14:02 +01:00

17 lines
588 B
C++

#include "ProgressPrinter.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
ProgressPrinter::ProgressPrinter(std::string name, uint32_t numSteps)
: name(name), numSteps(numSteps) {}
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;
nextProgressPrint += FIVE_PERCENT;
}
}