X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..4a47f1827831f31d6bc7018bb3497108581bc547:/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 7be1af96..a4531703 100644
--- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
+++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
@@ -145,6 +145,8 @@ for (; it != dataList.end(); ++it)
break;
}
+ answerList->push_back("<Period value=\"" + TARIFF::PeriodToString(it->tariffConf.period) + "\"/>");
+
answerList->push_back("</tariff>");
}
answerList->push_back("</Tariffs>");
@@ -302,7 +304,6 @@ return 0;
//-----------------------------------------------------------------------------
int PARSER_CHG_TARIFF::ParseStart(void *, const char * el, const char ** attr)
{
-char st[50];
double price[DIR_NUM];
int t[DIR_NUM];
depth++;
@@ -385,6 +386,7 @@ else
for (int j = 0; j < DIR_NUM; j++)
{
+ char st[50];
snprintf(st, 50, "Time%d", j);
if (strcasecmp(el, st) == 0)
{
@@ -451,6 +453,12 @@ else
}
return 0;
}
+
+ if (strcasecmp(el, "Period") == 0)
+ {
+ td.tariffConf.period = TARIFF::StringToPeriod(attr[1]);
+ return 0;
+ }
}
return -1;
}