]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp
Ticket. The stgTime argument added in TariffChangeIsAllowed()
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / tariff_helper.cpp
index c96b7d31cd58b025a83a52d3950f438d3389d67e..7c023e25fd37c3a4bf96abddab964e2d3b652173 100644 (file)
@@ -1,6 +1,7 @@
 #include <ostream> // xmlrpc-c devs have missed something :)
 
 #include "tariff_helper.h"
 #include <ostream> // xmlrpc-c devs have missed something :)
 
 #include "tariff_helper.h"
+#include "stg/common.h"
 
 void TARIFF_HELPER::GetTariffInfo(xmlrpc_c::value * info) const
 {
 
 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["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<xmlrpc_c::value> prices(DIR_NUM);
 
 
 std::vector<xmlrpc_c::value> 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));
     }
 
     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<xmlrpc_c::value> prices(
 if ((it = structVal.find("dirprices")) != structVal.end())
     {
     std::vector<xmlrpc_c::value> prices(