added parsing for new duration fields
This commit is contained in:
parent
ae9a54bf02
commit
171b23eebb
@ -144,7 +144,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
continue;
|
||||
}
|
||||
|
||||
qCritical() << " -" << mb_name;
|
||||
// qCritical() << " -" << mb_name;
|
||||
|
||||
// Get array for each JSON object member
|
||||
auto mb_array = document[mb_name].GetArray();
|
||||
@ -797,9 +797,25 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
Duration.pun_fixed = k->value.GetBool();
|
||||
}
|
||||
}
|
||||
else if (strcmp(inner_obj_name, "pun_requires_change") == 0) {
|
||||
else if (strcmp(inner_obj_name, "pun_mutable") == 0) {
|
||||
if (k->value.IsBool()) {
|
||||
Duration.pun_requires_change = k->value.GetBool();
|
||||
Duration.pun_mutable = k->value.GetBool();
|
||||
}
|
||||
}
|
||||
else if (strcmp(inner_obj_name, "pun_round_to_next_24h_boundary") == 0) {
|
||||
if (k->value.IsBool()) {
|
||||
Duration.pun_round_to_next_24h_boundary = k->value.GetBool();
|
||||
}
|
||||
}
|
||||
else if (strcmp(inner_obj_name, "pun_round_to_prev_24h_boundary") == 0) {
|
||||
if (k->value.IsBool()) {
|
||||
Duration.pun_round_to_prev_24h_boundary = k->value.GetBool();
|
||||
}
|
||||
}
|
||||
else if (strcmp(inner_obj_name, "pun_align_with_timepoint") == 0) {
|
||||
if (k->value.IsString()) {
|
||||
QDateTime const &dt = QDateTime::fromString(k->value.GetString(), Qt::ISODate);
|
||||
Duration.pun_align_with_timepoint = dt;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -866,7 +882,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
} break;
|
||||
case MemberType::DurationType:
|
||||
cfg->Duration.insert(pair<int, ATBDuration>(Duration.pun_id, Duration));
|
||||
// qCritical() << Duration;
|
||||
//qCritical() << Duration;
|
||||
break;
|
||||
case MemberType::SpecialDaysWorktimeType:
|
||||
cfg->SpecialDaysWorktime.insert(pair<int, ATBSpecialDaysWorktime>(SpecialDaysWorktime.pedwt_period_exc_day_id, SpecialDaysWorktime));
|
||||
@ -922,7 +938,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
break;
|
||||
case MemberType::PrepaidOptionType:
|
||||
cfg->TariffPrepayOptions.insert(pair<int, ATBPrepay>(TariffPrepayOption.id, TariffPrepayOption));
|
||||
qCritical() << TariffPrepayOption;
|
||||
//qCritical() << TariffPrepayOption;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user