Added GetCostFromDuration()-functions: to be used for tariffs with only
steps and no special days. Example: Schoenu, Koenigsee.
This commit is contained in:
		@@ -1,6 +1,8 @@
 | 
				
			|||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
#include "configuration.h"
 | 
					#include "configuration.h"
 | 
				
			||||||
 | 
					#include "payment_method.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDateTime>
 | 
					#include <QDateTime>
 | 
				
			||||||
using namespace std;
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,6 +30,11 @@ public:
 | 
				
			|||||||
	/// <returns>Returns cost (data type: double)</returns>
 | 
						/// <returns>Returns cost (data type: double)</returns>
 | 
				
			||||||
    double GetCostFromDuration(Configuration* cfg, uint8_t vehicle_type, const QDateTime start_datetime, QDateTime & end_datetime, double durationMin, bool nextDay = false, bool prepaid = false);
 | 
					    double GetCostFromDuration(Configuration* cfg, uint8_t vehicle_type, const QDateTime start_datetime, QDateTime & end_datetime, double durationMin, bool nextDay = false, bool prepaid = false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Introduced for Schoenau, Koenigsee.
 | 
				
			||||||
 | 
					    // For tariff of following structure: only steps, no special days, nonstop.
 | 
				
			||||||
 | 
					    uint32_t GetCostFromDuration(Configuration const* cfg, QDateTime const &start, quint64 durationMinutes, uint8_t paymentMethod = PaymentMethod::Steps);
 | 
				
			||||||
 | 
					    uint32_t GetCostFromDuration(Configuration const* cfg, QDateTime const &start, QDateTime const &end, uint8_t paymentMethod = PaymentMethod::Steps);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Daily ticket
 | 
					    // Daily ticket
 | 
				
			||||||
    QDateTime GetDailyTicketDuration(Configuration* cfg, const QDateTime start_datetime, uint8_t payment_option, bool carry_over);
 | 
					    QDateTime GetDailyTicketDuration(Configuration* cfg, const QDateTime start_datetime, uint8_t payment_option, bool carry_over);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -35,7 +42,7 @@ public:
 | 
				
			|||||||
    //
 | 
					    //
 | 
				
			||||||
    // helper functions for Schoenau
 | 
					    // helper functions for Schoenau
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    QList<int> GetTimeSteps(Configuration const *cfg, int paymentOption);
 | 
					    QList<int> GetTimeSteps(Configuration const *cfg, int paymentMethod);
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    double GetPriceForTimeStep(Configuration const *cfg, int paymentOption, int timeStep);
 | 
					    uint32_t GetPriceForTimeStep(Configuration const *cfg, uint8_t paymentMethod, int timeStep);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user