X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1108cd13922be13921cc6c89f78e4ee3ae88af52..127981f11d5d3553925f01102f7c253e012829b5:/include/stg/tariff_conf.h diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index b554e14a..fc9807be 100644 --- a/include/stg/tariff_conf.h +++ b/include/stg/tariff_conf.h @@ -27,12 +27,13 @@ #ifndef TARIFF_CONF_H #define TARIFF_CONF_H -#include -#include - +#include "tariff.h" #include "resetable.h" #include "const.h" +#include +#include + //----------------------------------------------------------------------------- enum { @@ -120,6 +121,21 @@ struct DIRPRICE_DATA_RES return dd; } + void Splice(const DIRPRICE_DATA_RES & rhs) + { + hDay.splice(rhs.hDay); + mDay.splice(rhs.mDay); + hNight.splice(rhs.hNight); + mNight.splice(rhs.mNight); + priceDayA.splice(rhs.priceDayA); + priceNightA.splice(rhs.priceNightA); + priceDayB.splice(rhs.priceDayB); + priceNightB.splice(rhs.priceNightB); + threshold.splice(rhs.threshold); + singlePrice.splice(rhs.singlePrice); + noDiscount.splice(rhs.noDiscount); + } + RESETABLE hDay; RESETABLE mDay; RESETABLE hNight; @@ -135,18 +151,20 @@ struct DIRPRICE_DATA_RES //----------------------------------------------------------------------------- struct TARIFF_CONF { - double fee; - double free; - int traffType; - double passiveCost; - std::string name; + double fee; + double free; + int traffType; + double passiveCost; + std::string name; + TARIFF::PERIOD period; TARIFF_CONF() : fee(0), free(0), traffType(TRAFF_UP_DOWN), passiveCost(0), - name() + name(), + period(TARIFF::MONTH) {} TARIFF_CONF(const std::string & n) @@ -154,7 +172,8 @@ struct TARIFF_CONF free(0), traffType(TRAFF_UP_DOWN), passiveCost(0), - name(n) + name(n), + period(TARIFF::MONTH) {} }; //----------------------------------------------------------------------------- @@ -165,7 +184,8 @@ struct TARIFF_CONF_RES free(), traffType(), passiveCost(), - name() + name(), + period() {} TARIFF_CONF_RES & operator=(const TARIFF_CONF & tc) @@ -175,6 +195,7 @@ struct TARIFF_CONF_RES traffType = tc.traffType; passiveCost = tc.passiveCost; name = tc.name; + period = tc.period; return *this; } @@ -186,14 +207,16 @@ struct TARIFF_CONF_RES tc.name = name.data(); tc.passiveCost = passiveCost.data(); tc.traffType = traffType.data(); + tc.period = period.data(); return tc; } - RESETABLE fee; - RESETABLE free; - RESETABLE traffType; - RESETABLE passiveCost; - RESETABLE name; + RESETABLE fee; + RESETABLE free; + RESETABLE traffType; + RESETABLE passiveCost; + RESETABLE name; + RESETABLE period; }; //----------------------------------------------------------------------------- struct TARIFF_DATA