Add testcases for schoenau

This commit is contained in:
Gerhard Hoffmann 2024-01-24 16:36:29 +01:00
parent f40ae7200b
commit 124fd60c41

View File

@ -34,13 +34,59 @@ extern "C" char* strptime(const char* s,
#include <calculate_price.h> #include <calculate_price.h>
#define SZEGED (0) #define SZEGED (0)
#define SCHOENAU_KOENIGSEE (1)
#define NEUHAUSER_KORNEUBURG (0) #define NEUHAUSER_KORNEUBURG (0)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0) #define NEUHAUSER_LINSINGER_MASCHINENBAU (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0) #define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (1) #define NEUHAUSER_BILEXA_GALTUER (0)
int main() { int main() {
#if SCHOENAU_KOENIGSEE==1
QString f("/opt/ptu5/opt/customer_332/etc/psa_tariff/tariff01.json");
//QString f("/opt/ptu5/opt/customer_332/etc/psa_tariff/tariff02.json");
std::ifstream input(f.toUtf8().constData());
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) {
qCritical() << "parsed" << f;
int minParkingTime = get_minimal_parkingtime(&cfg);
qCritical() << "minimal_parking_time" << minParkingTime;
QDateTime start = QDateTime::currentDateTime();
// zone 1
//int timeSteps[9] = {60, 180, 1440, 2880, 4320, 5670, 7200, 8640, 10080};
// zone 2
//int timeSteps[3] = {60, 180, 1440};
static QList<int> const timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg);
qCritical() << "TimeSteps" << timeSteps;
// for (int i = 0 ; i < timeSteps.size(); ++i) {
// QDateTime end = start.addSecs(timeSteps.at(i)*60);
//
// double price = Calculator::GetInstance().GetCostFromDuration(
// &cfg,
// start,
// timeSteps.at(i));
// qDebug() << "GetCostFromDuration() time: " << timeSteps.at(i) << "price=" << price;
//}
}
#endif
#if NEUHAUSER_BILEXA_GALTUER==1 #if NEUHAUSER_BILEXA_GALTUER==1
std::ifstream input("/opt/ptu5/opt/customer_745/etc/psa_tariff/tariff01.json"); std::ifstream input("/opt/ptu5/opt/customer_745/etc/psa_tariff/tariff01.json");