X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b58a57adfb73f8b5368b8c31fa120399b7c15ef4..388f004853f28a62098da68f9e3037c6a7ec8f2f:/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp index 548774de..7c023e25 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp @@ -1,6 +1,7 @@ #include // xmlrpc-c devs have missed something :) #include "tariff_helper.h" +#include "stg/common.h" void TARIFF_HELPER::GetTariffInfo(xmlrpc_c::value * info) const { @@ -14,6 +15,7 @@ structVal["passivecost"] = xmlrpc_c::value_double(data.tariffConf.passiveCost); structVal["traffType"] = xmlrpc_c::value_int(data.tariffConf.traffType); structVal["period"] = xmlrpc_c::value_string(TARIFF::PeriodToString(data.tariffConf.period)); structVal["changePolicy"] = xmlrpc_c::value_string(TARIFF::ChangePolicyToString(data.tariffConf.changePolicy)); +structVal["changePolicyTimeout"] = xmlrpc_c::value_string(formatTime(data.tariffConf.changePolicyTimeout)); std::vector prices(DIR_NUM); @@ -72,6 +74,16 @@ if ((it = structVal.find("period")) != structVal.end()) data.tariffConf.period = TARIFF::StringToPeriod(xmlrpc_c::value_string(it->second)); } +if ((it = structVal.find("changePolicy")) != structVal.end()) + { + data.tariffConf.changePolicy = TARIFF::StringToChangePolicy(xmlrpc_c::value_string(it->second)); + } + +if ((it = structVal.find("changePolicyTimeout")) != structVal.end()) + { + data.tariffConf.changePolicyTimeout = readTime(xmlrpc_c::value_string(it->second)); + } + if ((it = structVal.find("dirprices")) != structVal.end()) { std::vector prices(