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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCritical() << " -" << mb_name;
|
// qCritical() << " -" << mb_name;
|
||||||
|
|
||||||
// Get array for each JSON object member
|
// Get array for each JSON object member
|
||||||
auto mb_array = document[mb_name].GetArray();
|
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();
|
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()) {
|
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;
|
break;
|
||||||
@ -922,7 +938,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
|||||||
break;
|
break;
|
||||||
case MemberType::PrepaidOptionType:
|
case MemberType::PrepaidOptionType:
|
||||||
cfg->TariffPrepayOptions.insert(pair<int, ATBPrepay>(TariffPrepayOption.id, TariffPrepayOption));
|
cfg->TariffPrepayOptions.insert(pair<int, ATBPrepay>(TariffPrepayOption.id, TariffPrepayOption));
|
||||||
qCritical() << TariffPrepayOption;
|
//qCritical() << TariffPrepayOption;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user