Added profile calculation
This commit is contained in:
@ -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
|
||||
}
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user