From: Elena Mamontova Date: Tue, 18 Oct 2016 13:11:20 +0000 (+0300) Subject: Ticket 37. The "stg/common.h" header file added. The X-Git-Tag: 2.409~62 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/388f004853f28a62098da68f9e3037c6a7ec8f2f?hp=f3c345c9cabaa291b0ec12027f309f040debef75 Ticket 37. The "stg/common.h" header file added. The structVal["changePolicyTimeout"] element added in GetTariffInfo(). data.tariffConf.changePolicyTimeout getting added in SetTariffInfo(). --- diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp index c96b7d31..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); @@ -77,6 +79,11 @@ 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(