X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/69172e0e3684d849825b90b01e53026852e01a97..980332313bffde590173f76fd006837e0c8f3bed:/include/stg/tariff_conf.h?ds=sidebyside diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index ae40c128..fe94b6e5 100644 --- a/include/stg/tariff_conf.h +++ b/include/stg/tariff_conf.h @@ -98,18 +98,17 @@ struct DIRPRICE_DATA_RES DIRPRICE_DATA GetData() const { DIRPRICE_DATA dd; - dd.hDay = hDay.data(); - dd.hNight = hNight.data(); - dd.mDay = mDay.data(); - dd.mNight = mNight.data(); - dd.noDiscount = noDiscount.data(); - dd.priceDayA = priceDayA.data(); - dd.priceDayB = priceDayB.data(); - - dd.priceNightA = priceNightA.data(); - dd.priceNightB = priceNightB.data(); - dd.singlePrice = singlePrice.data(); - dd.threshold = threshold.data(); + hDay.maybeSet(dd.hDay); + hNight.maybeSet(dd.hNight); + mDay.maybeSet(dd.mDay); + mNight.maybeSet(dd.mNight); + noDiscount.maybeSet(dd.noDiscount); + priceDayA.maybeSet(dd.priceDayA); + priceDayB.maybeSet(dd.priceDayB); + priceNightA.maybeSet(dd.priceNightA); + priceNightB.maybeSet(dd.priceNightB); + singlePrice.maybeSet(dd.singlePrice); + threshold.maybeSet(dd.threshold); return dd; } @@ -194,12 +193,12 @@ struct TARIFF_CONF_RES TARIFF_CONF GetData() const { TARIFF_CONF tc; - tc.fee = fee.data(); - tc.free = free.data(); - tc.name = name.data(); - tc.passiveCost = passiveCost.data(); - tc.traffType = traffType.data(); - tc.period = period.data(); + fee.maybeSet(tc.fee); + free.maybeSet(tc.free); + name.maybeSet(tc.name); + passiveCost.maybeSet(tc.passiveCost); + traffType.maybeSet(tc.traffType); + period.maybeSet(tc.period); return tc; }