X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/fb083109b84a9f198b4949892b0b816801e1d196..0f4172ffbddd7b51c80f388adc69c4601d230bf6:/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp index b1564406..34f09fe5 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp @@ -16,7 +16,7 @@ /* * Author : Boris Mikhailenko - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ #include "parser_tariffs.h" @@ -115,6 +115,7 @@ void GET_TARIFFS::CreateAnswer() "tariffConf.traffType) + "\"/>" + "tariffConf.period) + "\"/>" + "tariffConf.changePolicy) + "\"/>" + + "tariffConf.changePolicyTimeout) + "\"/>" + ""; } @@ -174,6 +175,8 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) const TARIFF * tariff = m_tariffs.FindByName(attr[1]); if (tariff != NULL) td = tariff->GetTariffData(); + else + return -1; return 0; } } @@ -297,6 +300,14 @@ int CHG_TARIFF::Start(void *, const char * el, const char ** attr) td.tariffConf.changePolicy = TARIFF::StringToChangePolicy(attr[1]); return 0; } + + if (strcasecmp(el, "ChangePolicyTimeout") == 0) + { + int64_t policyTime = 0; + if (str2x(attr[1], policyTime) == 0) + td.tariffConf.changePolicyTimeout = (time_t)policyTime; + return 0; + } } return -1; }