GetTimeStep() and GetPriceForTimeStep(): use getPaymentOptions().
This commit is contained in:
		@@ -595,10 +595,10 @@ double Calculator::GetCostFromDuration(Configuration* cfg, uint8_t payment_optio
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
QList<int> Calculator::GetTimeSteps(Configuration const *cfg, int paymentOption) {
 | 
			
		||||
QList<int> Calculator::GetTimeSteps(Configuration *cfg) const {
 | 
			
		||||
    QList<int> timeSteps;
 | 
			
		||||
 | 
			
		||||
    int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id;
 | 
			
		||||
    int const pop_id = cfg->getPaymentOptions().pop_id;
 | 
			
		||||
 | 
			
		||||
    for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
 | 
			
		||||
    {
 | 
			
		||||
@@ -610,9 +610,9 @@ QList<int> Calculator::GetTimeSteps(Configuration const *cfg, int paymentOption)
 | 
			
		||||
    return timeSteps;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t Calculator::GetPriceForTimeStep(Configuration const *cfg, uint8_t paymentOption, int timeStep) {
 | 
			
		||||
uint32_t Calculator::GetPriceForTimeStep(Configuration *cfg, int timeStep) const {
 | 
			
		||||
 | 
			
		||||
    int const pop_id = cfg->PaymentOption.find(paymentOption)->second.pop_id;
 | 
			
		||||
    int const pop_id = cfg->getPaymentOptions().pop_id;
 | 
			
		||||
 | 
			
		||||
    for (auto[itr, rangeEnd] = cfg->PaymentRate.equal_range(pop_id); itr != rangeEnd; ++itr)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user