From 4a2b15d0862c4398c5740e2de9b1fa02b76036e9 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 26 Jul 2024 13:34:18 +0200 Subject: [PATCH] Add some debug output into GetDurationForPrice(). --- library/src/calculator_functions.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/src/calculator_functions.cpp b/library/src/calculator_functions.cpp index 2933f58..10ff7c9 100644 --- a/library/src/calculator_functions.cpp +++ b/library/src/calculator_functions.cpp @@ -2723,6 +2723,10 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const { int const pop_id = cfg->getPaymentOptions().pop_id; int const pop_accumulate_prices = cfg->getPaymentOptions().pop_accumulate_prices; + + qCritical() << "(" << __func__ << ":" << __LINE__ << ") accumulate prices" << pop_accumulate_prices; + + int new_price = 0; uint32_t duration = 0; uint32_t duration_previous = 0; @@ -2744,14 +2748,19 @@ uint32_t Calculator::GetDurationForPrice(Configuration *cfg, int price) const { if (pop_accumulate_prices) { new_price += pra_price; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") pra_price:" << pra_price; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") new_price:" << new_price; if (new_price <= price) { - duration_previous = durationUnit; + duration_previous = durationUnit; + qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous; } else { + qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration_previous" << duration_previous; return duration_previous; } } } + qCritical() << "(" << __func__ << ":" << __LINE__ << ") duration" << duration; return duration; }