From 0217bb89183c40374889cd95975af58bc2ddbd08 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 23 Nov 2023 09:41:40 +0100 Subject: [PATCH] GetTimeStep() and GetPriceForTimeStep(): use getPaymentOptions(). --- library/src/calculator_functions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index 46e2d82..4627994 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -595,10 +595,10 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio -QList Calculator::GetTimeSteps(Configuration const *cfg, int paymentOption) { +QList Calculator::GetTimeSteps(Configuration *cfg) const { QList timeSteps; - int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id; + int const pop_id = cfg->getPaymentOptions().pop_id; for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) { @@ -610,9 +610,9 @@ QList Calculator::GetTimeSteps(Configuration const *cfg, int paymentOption) return timeSteps; } -uint32_t Calculator::GetPriceForTimeStep(Configuration const *cfg, uint8_t paymentOption, int timeStep) { +uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep) const { - int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id; + int const pop_id = cfg->getPaymentOptions().pop_id; for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr) {