X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/78e14695fc1b743f225a5aa30ca98784bce576c1..f907011b4827e85763372cdea76944b3b1cc3fd2:/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp index e3b26520..bb855faf 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp @@ -1,6 +1,7 @@ #include // snprintf #include +#include "stg/tariffs.h" #include "parser.h" const int pt_mega = 1024 * 1024; @@ -144,6 +145,8 @@ for (; it != dataList.end(); ++it) break; } + answerList->push_back("tariffConf.period) + "\"/>"); + answerList->push_back(""); } answerList->push_back(""); @@ -387,7 +390,10 @@ else snprintf(st, 50, "Time%d", j); if (strcasecmp(el, st) == 0) { - int h1, m1, h2, m2; + int h1 = 0; + int m1 = 0; + int h2 = 0; + int m2 = 0; if (ParseTariffTimeStr(attr[1], h1, m1, h2, m2) == 0) { td.dirPrice[j].hDay = h1; @@ -447,6 +453,12 @@ else } return 0; } + + if (strcasecmp(el, "Period") == 0) + { + td.tariffConf.period = TARIFF::StringToPeriod(attr[1]); + return 0; + } } return -1; }