Minor: added comments and added some debug output.
This commit is contained in:
		@@ -882,7 +882,7 @@ std::optional<QDateTime> Configuration::getInterpolationEnd(QDateTime const &sta
 | 
			
		||||
                ATBInterpolation interpolation = ipolCheck.value();
 | 
			
		||||
                switch (duration.pun_interpolation_id) {
 | 
			
		||||
                    case static_cast<int>(ATBInterpolation::NO_INTERPOLATION):
 | 
			
		||||
                        qCritical() << "(" << __func__ << ":" << __LINE__ << ") NO_INTERPOLATION";
 | 
			
		||||
                        //qCritical() << "(" << __func__ << ":" << __LINE__ << ") NO_INTERPOLATION";
 | 
			
		||||
                    break;
 | 
			
		||||
                    case static_cast<int>(ATBInterpolation::STATIC_WALLCLOCK_TIME_VALUES):
 | 
			
		||||
                        //qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO";
 | 
			
		||||
@@ -987,6 +987,9 @@ int Configuration::getPaymentOptionIndex(QDateTime const &dt) const {
 | 
			
		||||
            for (int opt=0; opt < numOptions; ++opt) {
 | 
			
		||||
                uint64_t const pop_id = getPaymentOptions(opt).pop_id;
 | 
			
		||||
                if (pop_id == (uint64_t)sd.ped_payment_option_id) {
 | 
			
		||||
 | 
			
		||||
                    qCritical() << __func__ << __LINE__ << opt;
 | 
			
		||||
 | 
			
		||||
                    return opt;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -1026,6 +1029,9 @@ int Configuration::getPaymentOptionIndex(QDateTime const &dt) const {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((pop_business_hours & p) == p) {
 | 
			
		||||
 | 
			
		||||
            qCritical() << __func__ << __LINE__ << opt;
 | 
			
		||||
 | 
			
		||||
            return opt;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -1148,6 +1154,7 @@ int Configuration::getPaymentOptionIndex(PERMIT_TYPE permitType) {
 | 
			
		||||
    if (paymentOptions) {
 | 
			
		||||
        QVector<ATBPaymentOption> const vec = paymentOptions.value();
 | 
			
		||||
        PermitType const p(permitType);
 | 
			
		||||
 | 
			
		||||
        for (int i = 0; i < vec.size(); ++i) {
 | 
			
		||||
            if (vec[i].pop_product_name == p.toString()) {
 | 
			
		||||
               return i;
 | 
			
		||||
@@ -1161,8 +1168,11 @@ int Configuration::getPaymentOptionIndex(PERMIT_TYPE permitType) {
 | 
			
		||||
int Configuration::getPaymentOptionIndex(PERMIT_TYPE permitType) const {
 | 
			
		||||
    std::optional<QVector<ATBPaymentOption>> paymentOptions = getPaymentOptionsForAllKeys();
 | 
			
		||||
    if (paymentOptions) {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        QVector<ATBPaymentOption> const vec = paymentOptions.value();
 | 
			
		||||
        PermitType const p(permitType);
 | 
			
		||||
 | 
			
		||||
        for (int i = 0; i < vec.size(); ++i) {
 | 
			
		||||
            if (vec[i].pop_product_name == p.toString()) {
 | 
			
		||||
               return i;
 | 
			
		||||
@@ -1310,11 +1320,14 @@ Configuration::getPaymentOptionsForAllKeys() const {
 | 
			
		||||
    return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO: umbenennen: getPaymentOptionForPermitType
 | 
			
		||||
std::optional<ATBPaymentOption>
 | 
			
		||||
Configuration::getPaymentOptionForKey(PERMIT_TYPE permitType) const {
 | 
			
		||||
    return getPaymentOptionForKey(static_cast<int>(permitType));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// TODO: umbenennen: getPaymentOptionForPermitType
 | 
			
		||||
std::optional<ATBPaymentOption>
 | 
			
		||||
Configuration::getPaymentOptionForKey(int permitType) const {
 | 
			
		||||
    std::optional<ATBPaymentOption> value;
 | 
			
		||||
@@ -1331,6 +1344,7 @@ Configuration::getPaymentOptionForKey(int permitType) const {
 | 
			
		||||
    return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO: umbenennen: getPaymentOptionForPermitType
 | 
			
		||||
std::optional<ATBPaymentOption>
 | 
			
		||||
Configuration::getPaymentOptionForKey(QString const &permitTypeStr) const {
 | 
			
		||||
    PERMIT_TYPE permitType = PermitType::toPermitType(permitTypeStr);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user