-appendResetableTag(stream, "changePolicyTimeout", data.tariffConf.changePolicyTimeout);
-for (size_t i = 0; i < DIR_NUM; ++i)
- if (!data.dirPrice[i].hDay.empty() &&
- !data.dirPrice[i].mDay.empty() &&
- !data.dirPrice[i].hNight.empty() &&
- !data.dirPrice[i].mNight.empty())
- stream << "<time" << i << " value=\"" << data.dirPrice[i].hDay.data() << ":"
- << data.dirPrice[i].mDay.data() << "-"
- << data.dirPrice[i].hNight.data() << ":"
- << data.dirPrice[i].mNight.data() << "\"/>";
-
-appendSlashedResetable(stream, "priceDayA", data.dirPrice, &DIRPRICE_DATA_RES::priceDayA);
-appendSlashedResetable(stream, "priceDayB", data.dirPrice, &DIRPRICE_DATA_RES::priceDayB);
-appendSlashedResetable(stream, "priceNightA", data.dirPrice, &DIRPRICE_DATA_RES::priceNightA);
-appendSlashedResetable(stream, "priceNightB", data.dirPrice, &DIRPRICE_DATA_RES::priceNightB);
-appendSlashedResetable(stream, "singlePrice", data.dirPrice, &DIRPRICE_DATA_RES::singlePrice);
-appendSlashedResetable(stream, "noDiscount", data.dirPrice, &DIRPRICE_DATA_RES::noDiscount);
-appendSlashedResetable(stream, "threshold", data.dirPrice, &DIRPRICE_DATA_RES::threshold);
-
-return stream.str();
+ appendResetableTag(stream, "changePolicyTimeout", data.tariffConf.changePolicyTimeout);
+ for (size_t i = 0; i < DIR_NUM; ++i)
+ if (data.dirPrice[i].hDay ||
+ data.dirPrice[i].mDay ||
+ data.dirPrice[i].hNight ||
+ data.dirPrice[i].mNight)
+ stream << "<time" << i << " value=\"" << data.dirPrice[i].hDay.value() << ":"
+ << data.dirPrice[i].mDay.value() << "-"
+ << data.dirPrice[i].hNight.value() << ":"
+ << data.dirPrice[i].mNight.value() << "\"/>";
+
+ appendSlashedResetable(stream, "priceDayA", data.dirPrice, &DirPriceDataOpt::priceDayA);
+ appendSlashedResetable(stream, "priceDayB", data.dirPrice, &DirPriceDataOpt::priceDayB);
+ appendSlashedResetable(stream, "priceNightA", data.dirPrice, &DirPriceDataOpt::priceNightA);
+ appendSlashedResetable(stream, "priceNightB", data.dirPrice, &DirPriceDataOpt::priceNightB);
+ appendSlashedResetable(stream, "singlePrice", data.dirPrice, &DirPriceDataOpt::singlePrice);
+ appendSlashedResetable(stream, "noDiscount", data.dirPrice, &DirPriceDataOpt::noDiscount);
+ appendSlashedResetable(stream, "threshold", data.dirPrice, &DirPriceDataOpt::threshold);
+
+ return stream.str();