Commit Graph

177 Commits

Author SHA1 Message Date
ad534eef09 Add 4 new data type for IdentifyJsonMember(). 2023-12-15 13:22:49 +01:00
5ee73bf804 IdentifyJsonMember(): add 4 new data types:
DailyTicket, TimeBase, Customer and TimeRange.
2023-12-15 13:20:42 +01:00
ef7fff79c9 draft for tarif in naz 2023-12-15 13:18:12 +01:00
ea2dfa144f Add new menber types: dailly ticket, timebase, time range and customer. 2023-12-12 17:56:26 +01:00
f56979a61a Minor: rename to ATBCustomer. 2023-12-12 17:55:44 +01:00
cc07b8f20e Minor: rename to ATBTimeBase 2023-12-12 17:55:06 +01:00
81459f7ab4 Minor: remove 'pragma onc' 2023-12-12 17:50:23 +01:00
db7fe35095 Add some new ideas. 2023-12-12 12:14:54 +01:00
08e89df5a5 Include 3 new header files. 2023-12-12 12:14:34 +01:00
d6324f03a8 Add drafts for 3 new haeder files. 2023-12-12 12:14:14 +01:00
2b3ee3f384 Renamed again. 2023-12-12 12:11:32 +01:00
08f8f3a9fd "" 2023-12-12 12:10:55 +01:00
a80bc7294a Removed tartiff_csutomer. 2023-12-12 12:00:04 +01:00
3a0baf266b Add first draft. 2023-12-12 11:59:35 +01:00
31193336cf Define daily ticket structure. 2023-12-12 11:53:22 +01:00
4fbc2c502b Header for definition of daily ticket. 2023-12-12 11:36:58 +01:00
8d7d175b51 GetDailyTicketDuration():
replace ZellersAlgorithm by qts build in method dayOfWeek().
2023-12-12 11:34:04 +01:00
ebb5bad7c5 Minor: replace call to LOG_ERROR() using qCritical(). 2023-12-12 11:30:30 +01:00
b122206a94 Minor add some json files under OTHER_FILES for documentation. 2023-12-12 11:08:10 +01:00
83807a0f99 Add tariff-files for documentation under OTHERFILES. 2023-12-12 11:05:13 +01:00
d0e0699906 Add tests for linsinger maschinenbau. 2023-12-12 10:59:49 +01:00
3006e64b37 private_GetDurationFromCost():
set static variables using helpers moved to namespace Utilities.
2023-12-12 10:58:08 +01:00
c8218bd7af private_GetDurationFromCost():
remove superfluous check if there are special days listed in
json-tariff-file.
2023-12-12 10:56:58 +01:00
ba3dfcd3d6 Minor: private_GetCostFromDuration():
define static variables using helpers moved to namespace Utilities.
2023-12-12 10:55:19 +01:00
c51d350618 Minor: Moved
getMinimalParkingTime(), getMaximalParkingTime(), getMinimalParkingPrice()
computeWeekDaysPrice() and   computeWeekDaysDurationUnit() to Utilities
namespace.
2023-12-12 10:53:10 +01:00
a95a39a557 GetCostFromDuration():
1: Get payment method from tariff file.
  2: Use tariffIs24_7() helper (Tariff for Schoenau is such a case)
  3: Add new code for neuhauser/linsinger maschinenbau:
     Very similar to Schoenau, but here there are extra operating times
     6.00-18.00 during the week, 6-12 on Saturday.
     Check if the current time is inside such time ranges and return
     associated price.
2023-12-12 10:52:16 +01:00
67b12f4b33 Private GetCostFromDuration() and GetCostFromDuration() helpers:
Use pyament method id (=4) as condition for if(...).
The other condition (tariffIs24_7()) is used in calling functions.
2023-12-12 10:49:51 +01:00
60002404da GetDurationFromCost():
1: Get payment method from tariff file.
2: Use tariffIs24_7() helper (Tariff for Schoenau is such a case)
3: Add new code for neuhauser/linsinger maschinenbau:
   Very similar to Schoenau, but here there are extra operating times
   6.00-18.00 during the week, 6-12 on Saturday.
   Check if the current time is inside such time ranges and return
   associated price.
2023-12-12 10:43:16 +01:00
d4e03a51dd Moved
uint32_t computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id) const;
    double computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id) const;
to namespace Utilities.
2023-12-12 10:41:21 +01:00
723b3530cc Added helpers GetPriceForStep() and GetStepForPrice() to make source
more readable.
2023-12-12 10:40:20 +01:00
63f508fb95 Moved
PaymentMethod getPaymentMethodId(Configuration const *cfg);
    int getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId);
    int getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId);
    uint32_t getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId);

to namespace Utilities.
2023-12-12 10:38:31 +01:00
6e0a74c8cc Add helpers GetSteps(), noSpecialDays(), specialDays() and tariffIs24_7()
to make the source more readable.
2023-12-12 10:36:22 +01:00
d11cffb8bd Set pop_business_hours when parsing json-tariff-file. 2023-12-12 10:34:39 +01:00
15f552a973 Minor: Add header tariff_business_hours.h 2023-12-12 10:33:03 +01:00
52ad1c3ba8 Minor: add constructor taking some parameters.. 2023-12-12 10:31:54 +01:00
43b8a8d3bf Add member pop_business_hours. Add default constructor. 2023-12-12 10:30:55 +01:00
ceef73195d Add helper structure
enum BusinessHours
{
    NoRestriction_24_7          = 0,
    OnlyWorkingDays             = 1,    // [Monday-Friday]
    OnlyWeekDays                = 2,    // [Monday-Saturday]
    OnlyWeekEnd                 = 4,    // [Saturday+Sunday]
    OnlyOfficialHolidays        = 8,
    OnlySpecialDays             = 16,
    OnlySchoolHolidays          = 32,
    SpecialAndSchoolHolidays    = 48,
    OnlyOpenForBusinessDays     = 64,   // verkaufsoffen
    NoBusinessHoursDefined      = 255
};

to define inside of tariff-file what operating hours a PSA has.
2023-12-12 10:26:13 +01:00
282a412ef5 IsYearPeriodActive(): return true, even if no YearPeriod is given in tariff-json-file. 2023-12-12 10:23:45 +01:00
9dcf7a8f30 Implement added helpers. 2023-12-12 10:22:34 +01:00
4187598edf Add helpers for collecting them in Utilities namespave.
BusinessHours getBusinessHours(Configuration const *cfg, PaymentMethod methodId);
uint32_t computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id);
double computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id);
2023-12-12 10:20:02 +01:00
88e92dddb9 Fix: nextTimeStep must be between minParkingTime and maxParkingTime. 2023-12-11 09:00:24 +01:00
0f05a1a784 (1) Fix debug output.
(2) Use UpDown-Argument for calculation of next tiem step.
2023-12-08 10:16:52 +01:00
2d696941a5 Fix: use second.pun_duration instead of second.pun_id
Minor: add debug output.
2023-12-08 10:14:48 +01:00
5598b02816 Make distinction base on PaymentMethod, not on some
other data contained in json-tariff-file.
2023-12-07 17:00:28 +01:00
548447af1f set -O option to calm down compiler because of FORTIFY_SOURCE=2 option 2023-12-07 17:00:03 +01:00
b9a7c04db9 Add compute_next_timestep() computing timesteps if PaymentMethod = Steps.
Add additional code for computing time steps dynamically if PaymentMethod = Linear.
2023-12-07 16:28:17 +01:00
5b8d9c62cc Add and implement utilities:
int getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId);
    int getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId);
    uint32_t getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId);
    uint32_t getFirstDurationStep(Configuration const *cfg, PaymentMethod methodId);
2023-12-07 16:27:09 +01:00
56e2843ddb Add compute_next_timestep(). 2023-12-07 16:26:09 +01:00
6b76c4c2dd Add test cases for neuhauser. 2023-12-06 10:52:35 +01:00
54e9a0f86d Minor: add debug ouput (and commnt it out) 2023-12-06 10:51:46 +01:00