mpsoc shutdown after running update procedure

This commit is contained in:
Jakob Meier
2022-04-25 11:03:02 +02:00
parent 6876952bbd
commit 311ec7b194
12 changed files with 343 additions and 86 deletions

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;
}
}