Added profile calculation

This commit is contained in:
2025-03-16 16:32:22 +01:00
parent 5814fdd0cb
commit 9c0fc5c61d
22 changed files with 570 additions and 904 deletions

View File

@ -12,12 +12,11 @@
TEST_CASE("Test Csv to binary and back") {
CsvBinary::csvToBinary("Verbrauchsprofile.csv","Verbrauchsprofil.bin");
CsvBinary::binaryToCsv("Verbrauchsprofil.bin","Restored.csv");
auto verbrauchsProfil = CsvBinary::binaryToVector("Verbrauchsprofil.bin");
for (auto &row: *verbrauchsProfil) {
LOG_DEBUG_INFO("Sum from {}: {}",row.first ,std::accumulate(
row.second.begin(), row.second.end(), 0.f,
[](float sum, const std::string& val) {
for (const auto & [fst, snd]: *verbrauchsProfil) {
LOG_DEBUG_INFO("Sum from {}: {}",fst ,std::accumulate(
snd.begin(), snd.end(), 0.f,
[](const float sum, const std::string& val) {
return sum + std::stof(val); // Convert string to float before addition
}
));