From b4940e98fe5ff0a99bff2b750877b04fe56a392c Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 18 Jan 2024 14:34:57 +0100 Subject: [PATCH] Add test for NEUHAUSER_BILEXA_GALTUER --- main/main.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index 6852467..fcf1da7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -36,10 +36,40 @@ extern "C" char* strptime(const char* s, #define SZEGED (0) #define NEUHAUSER_KORNEUBURG (0) #define NEUHAUSER_LINSINGER_MASCHINENBAU (0) -#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (1) +#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0) +#define NEUHAUSER_BILEXA_GALTUER (1) int main() { +#if NEUHAUSER_BILEXA_GALTUER==1 + std::ifstream input("/opt/ptu5/opt/customer_745/etc/psa_tariff/tariff01.json"); + + std::stringstream sstr; + while(input >> sstr.rdbuf()); + std::string json(sstr.str()); + + Configuration cfg; + + bool isParsed = cfg.ParseJson(&cfg, json.c_str()); + cout << endl; + + if (isParsed) { + QDateTime start = QDateTime::currentDateTime(); + start.setTime(QTime(start.time().hour(), start.time().minute(), 0)); + Calculator calculator(start); + QList timeSteps = calculator.GetTimeSteps(&cfg); + qCritical() << timeSteps; + + for (int i=0; i