2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
23 $Date: 2010/10/05 20:41:11 $
33 #include "resetable.h"
36 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
69 int singlePrice; // Do not use day/night division
70 int noDiscount; // Do not use threshold
72 //-----------------------------------------------------------------------------
73 struct DIRPRICE_DATA_RES
75 DIRPRICE_DATA_RES & operator= (const DIRPRICE_DATA & dpd)
81 priceDayA = dpd.priceDayA;
82 priceNightA = dpd.priceNightA;
83 priceDayB = dpd.priceDayB;
84 priceNightB = dpd.priceNightB;
85 threshold = dpd.threshold;
86 singlePrice = dpd.singlePrice;
87 noDiscount = dpd.noDiscount;
91 DIRPRICE_DATA GetData()
98 dd.noDiscount = noDiscount;
99 dd.priceDayA = priceDayA;
100 dd.priceDayB = priceDayB;
102 dd.priceNightA = priceNightA;
103 dd.priceNightB = priceNightB;
104 dd.singlePrice = singlePrice;
105 dd.threshold = threshold;
111 RESETABLE<int> hNight;
112 RESETABLE<int> mNight;
113 RESETABLE<double> priceDayA;
114 RESETABLE<double> priceNightA;
115 RESETABLE<double> priceDayB;
116 RESETABLE<double> priceNightB;
117 RESETABLE<int> threshold;
118 RESETABLE<int> singlePrice;
119 RESETABLE<int> noDiscount;
121 //-----------------------------------------------------------------------------
124 double fee; // ÷ÅÌÉÞÉÎÁ ÁÂÏÎÐÌÁÔÙ
125 double free; // îÁ ËÁËÕÀ ÓÕÍÍÕ ÄÅÎÅÇ ÀÚÅÒ ËÁÞÁÅÔ ÂÅÓÐÌÁÔÎÏ
126 int traffType; // UP, DOWN, UP+DOWN, MAX
127 double passiveCost; // óÔÏÉÍÏÓÔØ ÚÁÍÏÒÏÚËÉ
133 traffType(TRAFF_UP_DOWN), // UP-DOWN
138 TARIFF_CONF(const std::string & n)
141 traffType(TRAFF_UP_DOWN), // UP-DOWN
146 //-----------------------------------------------------------------------------
147 struct TARIFF_CONF_RES
149 TARIFF_CONF_RES & operator=(const TARIFF_CONF & tc)
153 traffType = tc.traffType;
154 passiveCost = tc.passiveCost;
159 TARIFF_CONF GetData()
165 tc.passiveCost = passiveCost;
166 tc.traffType = traffType;
170 RESETABLE<double> fee;
171 RESETABLE<double> free;
172 RESETABLE<int> traffType;
173 RESETABLE<double> passiveCost;
174 RESETABLE<std::string> name;
176 //-----------------------------------------------------------------------------
179 TARIFF_CONF tariffConf;
180 std::vector<DIRPRICE_DATA> dirPrice;
187 TARIFF_DATA(const std::string & name)
192 TARIFF_DATA(const TARIFF_DATA & td)
193 : tariffConf(td.tariffConf),
194 dirPrice(td.dirPrice)
197 TARIFF_DATA & operator=(const TARIFF_DATA & td)
199 tariffConf = td.tariffConf;
200 dirPrice = td.dirPrice;
204 //-----------------------------------------------------------------------------
205 struct TARIFF_DATA_RES
207 TARIFF_CONF_RES tariffConf;
208 std::vector<DIRPRICE_DATA_RES> dirPrice;
215 TARIFF_DATA GetData()
218 td.tariffConf = tariffConf.GetData();
219 for (int i = 0; i < DIR_NUM; i++)
220 td.dirPrice[i] = dirPrice[i].GetData();
224 //-----------------------------------------------------------------------------