kopia lustrzana https://github.com/weetmuts/wmbusmeters
Refactor.
rodzic
cc89955004
commit
e01500ea30
|
@ -59,7 +59,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyWh,
|
||||
VIFRange::EnergyWh,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -74,7 +74,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::PowerW,
|
||||
VIFRange::PowerW,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -89,7 +89,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("0E833C"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -104,7 +104,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("0BAB3C"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -119,7 +119,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("0AFDC9FC01"),
|
||||
VifScaling::None,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -134,7 +134,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("0AFDC9FC02"),
|
||||
VifScaling::None,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -149,7 +149,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("0AFDC9FC03"),
|
||||
VifScaling::None,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -163,7 +163,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::DateTime,
|
||||
VIFRange::DateTime,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -178,7 +178,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E1003"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(1),
|
||||
IndexNr(1),
|
||||
|
@ -193,7 +193,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E2003"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(2),
|
||||
IndexNr(1),
|
||||
|
@ -209,7 +209,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E3003"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(3),
|
||||
IndexNr(1),
|
||||
|
@ -224,7 +224,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E10833C"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(1),
|
||||
IndexNr(1),
|
||||
|
@ -240,7 +240,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E20833C"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(2),
|
||||
IndexNr(1),
|
||||
|
@ -256,7 +256,7 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi, DriverInfo &di) : MeterCommonImplement
|
|||
DifVifKey("8E30833C"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(3),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -70,7 +70,7 @@ void MeterApator08::processContent(Telegram *t)
|
|||
vendor_values["0413"] = { 25, DVEntry(MeasurementType::Instantaneous, 0x13, 0, 0, 0, total) };
|
||||
int offset;
|
||||
string key;
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &vendor_values))
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &vendor_values))
|
||||
{
|
||||
extractDVdouble(&vendor_values, key, &offset, &total_water_consumption_m3_);
|
||||
// Now divide with 3! Is this the same for all apator08 meters? Time will tell.
|
||||
|
|
|
@ -46,7 +46,7 @@ MeterAventiesHCA::MeterAventiesHCA(MeterInfo &mi, DriverInfo &di) : MeterCommonI
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::HeatCostAllocation,
|
||||
VIFRange::HeatCostAllocation,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -61,7 +61,7 @@ MeterAventiesHCA::MeterAventiesHCA(MeterInfo &mi, DriverInfo &di) : MeterCommonI
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::HeatCostAllocation,
|
||||
VIFRange::HeatCostAllocation,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -82,7 +82,7 @@ MeterAventiesHCA::MeterAventiesHCA(MeterInfo &mi, DriverInfo &di) : MeterCommonI
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::HeatCostAllocation,
|
||||
VIFRange::HeatCostAllocation,
|
||||
StorageNr(i),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -97,7 +97,7 @@ MeterAventiesHCA::MeterAventiesHCA(MeterInfo &mi, DriverInfo &di) : MeterCommonI
|
|||
Quantity::Text,
|
||||
DifVifKey("02FD17"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
|
|
@ -49,7 +49,7 @@ MeterAventiesWM::MeterAventiesWM(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -69,7 +69,7 @@ MeterAventiesWM::MeterAventiesWM(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(i),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -84,7 +84,7 @@ MeterAventiesWM::MeterAventiesWM(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
DifVifKey("02FD17"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
|
|
@ -73,7 +73,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"total_energy_consumption",
|
||||
Quantity::Energy,
|
||||
FIND_FIELD(MeasurementType::Instantaneous, ValueInformation::EnergyWh),
|
||||
FIND_FIELD(MeasurementType::Instantaneous, VIFRange::EnergyWh),
|
||||
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT,
|
||||
"The total heat energy consumption recorded by this meter.",
|
||||
SET_FUNC(total_energy_kwh_, Unit::KWH),
|
||||
|
@ -82,7 +82,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"total_volume",
|
||||
Quantity::Volume,
|
||||
FIND_FIELD(MeasurementType::Instantaneous, ValueInformation::Volume),
|
||||
FIND_FIELD(MeasurementType::Instantaneous, VIFRange::Volume),
|
||||
PrintProperty::JSON | PrintProperty::FIELD | PrintProperty::IMPORTANT,
|
||||
"The total heating media volume recorded by this meter.",
|
||||
SET_FUNC(total_volume_m3_, Unit::M3),
|
||||
|
@ -95,7 +95,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
DifVifKey("02FD17"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -141,7 +141,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addStringFieldWithExtractor(
|
||||
tostrprintf("prev_%d_month", i+1),
|
||||
Quantity::Text,
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, ValueInformation::Date, StorageNr(32+i)),
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, VIFRange::Date, StorageNr(32+i)),
|
||||
PrintProperty::JSON,
|
||||
"The due date.",
|
||||
SET_STRING_FUNC(prev_month_date_[i]),
|
||||
|
@ -155,7 +155,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
tostrprintf("prev_%d_month", i+1),
|
||||
Quantity::Energy,
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, ValueInformation::EnergyWh, StorageNr(32+i)),
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, VIFRange::EnergyWh, StorageNr(32+i)),
|
||||
PrintProperty::JSON,
|
||||
"The total heat energy consumption recorded at end of previous month.",
|
||||
SET_FUNC(total_energy_prev_month_kwh_[i], Unit::KWH),
|
||||
|
@ -169,7 +169,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
tostrprintf("prev_%d_month", i+1),
|
||||
Quantity::Volume,
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, ValueInformation::Volume, StorageNr(32+i)),
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, VIFRange::Volume, StorageNr(32+i)),
|
||||
PrintProperty::JSON,
|
||||
tostrprintf("Previous month %d last date.", i+1),
|
||||
SET_FUNC(total_volume_prev_month_m3_[i], Unit::M3),
|
||||
|
@ -181,7 +181,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"due_energy_consumption",
|
||||
Quantity::Energy,
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, ValueInformation::EnergyWh, StorageNr(8)),
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, VIFRange::EnergyWh, StorageNr(8)),
|
||||
PrintProperty::JSON,
|
||||
"The total heat energy consumption at the due date.",
|
||||
SET_FUNC(due_energy_kwh_, Unit::KWH),
|
||||
|
@ -190,7 +190,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addStringFieldWithExtractor(
|
||||
"due_date",
|
||||
Quantity::Text,
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, ValueInformation::Date, StorageNr(8)),
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, VIFRange::Date, StorageNr(8)),
|
||||
PrintProperty::JSON,
|
||||
"The due date.",
|
||||
SET_STRING_FUNC(due_date_),
|
||||
|
@ -199,7 +199,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"volume_flow",
|
||||
Quantity::Flow,
|
||||
FIND_FIELD(MeasurementType::Instantaneous, ValueInformation::VolumeFlow),
|
||||
FIND_FIELD(MeasurementType::Instantaneous, VIFRange::VolumeFlow),
|
||||
PrintProperty::JSON,
|
||||
"The current heat media volume flow.",
|
||||
SET_FUNC(volume_flow_m3h_, Unit::M3H),
|
||||
|
@ -208,7 +208,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"power",
|
||||
Quantity::Power,
|
||||
FIND_FIELD(MeasurementType::Instantaneous, ValueInformation::PowerW),
|
||||
FIND_FIELD(MeasurementType::Instantaneous, VIFRange::PowerW),
|
||||
PrintProperty::JSON,
|
||||
"The current power consumption.",
|
||||
SET_FUNC(power_kw_, Unit::KW),
|
||||
|
@ -217,7 +217,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addFieldWithExtractor(
|
||||
"total_energy_consumption_last_month",
|
||||
Quantity::Energy,
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, ValueInformation::EnergyWh, StorageNr(32)),
|
||||
FIND_FIELD_S(MeasurementType::Instantaneous, VIFRange::EnergyWh, StorageNr(32)),
|
||||
PrintProperty::JSON,
|
||||
"The total heat energy consumption recorded at end of last month.",
|
||||
SET_FUNC(total_energy_last_month_kwh_, Unit::KWH),
|
||||
|
@ -226,7 +226,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
addStringFieldWithExtractor(
|
||||
"last_month_date",
|
||||
Quantity::Text,
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, ValueInformation::Date, StorageNr(32)),
|
||||
FIND_SFIELD_S(MeasurementType::Instantaneous, VIFRange::Date, StorageNr(32)),
|
||||
PrintProperty::JSON,
|
||||
"The due date.",
|
||||
SET_STRING_FUNC(last_month_date_),
|
||||
|
@ -238,7 +238,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Maximum,
|
||||
ValueInformation::PowerW,
|
||||
VIFRange::PowerW,
|
||||
StorageNr(32),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -253,7 +253,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FlowTemperature,
|
||||
VIFRange::FlowTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -268,7 +268,7 @@ MeterC5isf::MeterC5isf(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ReturnTemperature,
|
||||
VIFRange::ReturnTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -59,7 +59,7 @@ MeterIperl::MeterIperl(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -74,7 +74,7 @@ MeterIperl::MeterIperl(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::VolumeFlow,
|
||||
VIFRange::VolumeFlow,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -58,7 +58,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -72,7 +72,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::DateTime,
|
||||
VIFRange::DateTime,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -87,7 +87,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -101,7 +101,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -115,7 +115,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
DifVifKey("0E79"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::EnhancedIdentification,
|
||||
VIFRange::EnhancedIdentification,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -129,7 +129,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
DifVifKey("047F"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -155,7 +155,7 @@ MeterItron::MeterItron(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementatio
|
|||
Quantity::Text,
|
||||
DifVifKey("027F"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
|
|
@ -57,7 +57,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -72,7 +72,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -86,7 +86,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -100,7 +100,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
DifVifKey("02BB56"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -127,7 +127,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::AtError,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -141,7 +141,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::DateTime,
|
||||
VIFRange::DateTime,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -181,7 +181,7 @@ MeterLSE_07_17::MeterLSE_07_17(MeterInfo &mi, DriverInfo &di) :
|
|||
(lse_07_17) 29: 6D vif (Date and time type)
|
||||
(lse_07_17) 2a: * 180DA924 device datetime (2021-04-09 13:24)
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -53,7 +53,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyWh,
|
||||
VIFRange::EnergyWh,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -68,7 +68,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyWh,
|
||||
VIFRange::EnergyWh,
|
||||
StorageNr(0),
|
||||
TariffNr(1),
|
||||
IndexNr(1),
|
||||
|
@ -83,7 +83,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -98,7 +98,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(2),
|
||||
IndexNr(1),
|
||||
|
@ -113,7 +113,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::VolumeFlow,
|
||||
VIFRange::VolumeFlow,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -128,7 +128,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::PowerW,
|
||||
VIFRange::PowerW,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -143,7 +143,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FlowTemperature,
|
||||
VIFRange::FlowTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -158,7 +158,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ReturnTemperature,
|
||||
VIFRange::ReturnTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -173,7 +173,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
NoDifVifKey,
|
||||
VifScaling::AutoSigned,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::TemperatureDifference,
|
||||
VIFRange::TemperatureDifference,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -187,7 +187,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
Quantity::Text,
|
||||
DifVifKey("01FD17"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -214,7 +214,7 @@ MeterMicroClima::MeterMicroClima(MeterInfo &mi, DriverInfo &di) : MeterCommonImp
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::DateTime,
|
||||
VIFRange::DateTime,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -49,7 +49,7 @@ MeterMinomess::MeterMinomess(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -66,7 +66,7 @@ MeterMinomess::MeterMinomess(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -81,7 +81,7 @@ MeterMinomess::MeterMinomess(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(8),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -95,7 +95,7 @@ MeterMinomess::MeterMinomess(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(8),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -137,7 +137,7 @@ MeterMinomess::MeterMinomess(MeterInfo &mi, DriverInfo &di) : MeterCommonImpleme
|
|||
Quantity::Text,
|
||||
DifVifKey("02FD17"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
|
|
@ -51,7 +51,7 @@ MeterPIIGTH::MeterPIIGTH(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ExternalTemperature,
|
||||
VIFRange::ExternalTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -66,7 +66,7 @@ MeterPIIGTH::MeterPIIGTH(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ExternalTemperature,
|
||||
VIFRange::ExternalTemperature,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -81,7 +81,7 @@ MeterPIIGTH::MeterPIIGTH(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ExternalTemperature,
|
||||
VIFRange::ExternalTemperature,
|
||||
StorageNr(2),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -97,7 +97,7 @@ MeterPIIGTH::MeterPIIGTH(MeterInfo &mi, DriverInfo &di) :
|
|||
DifVifKey("02FB1A"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::RelativeHumidity,
|
||||
VIFRange::RelativeHumidity,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -111,7 +111,7 @@ MeterPIIGTH::MeterPIIGTH(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FabricationNo,
|
||||
VIFRange::FabricationNo,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -223,13 +223,13 @@ void MeterPIIGTH::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 1h (%f C))", average_temperature_1h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_24h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 24h (%f C))", average_temperature_24h_c_);
|
||||
|
|
|
@ -58,7 +58,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -73,7 +73,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -87,7 +87,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -102,7 +102,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(17),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -116,7 +116,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(17),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -130,7 +130,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
DifVifKey("02BB56"),
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Any,
|
||||
VIFRange::Any,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -157,7 +157,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::AtError,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -171,7 +171,7 @@ MeterQWater::MeterQWater(MeterInfo &mi, DriverInfo &di) :
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::DateTime,
|
||||
VIFRange::DateTime,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -52,7 +52,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyWh,
|
||||
VIFRange::EnergyWh,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -67,7 +67,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyWh,
|
||||
VIFRange::EnergyWh,
|
||||
StorageNr(0),
|
||||
TariffNr(1),
|
||||
IndexNr(1),
|
||||
|
@ -82,7 +82,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -97,7 +97,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(2),
|
||||
IndexNr(1),
|
||||
|
@ -112,7 +112,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::VolumeFlow,
|
||||
VIFRange::VolumeFlow,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -127,7 +127,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::PowerW,
|
||||
VIFRange::PowerW,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -142,7 +142,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FlowTemperature,
|
||||
VIFRange::FlowTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -157,7 +157,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ReturnTemperature,
|
||||
VIFRange::ReturnTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -172,7 +172,7 @@ MeterSharky::MeterSharky(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementat
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::TemperatureDifference,
|
||||
VIFRange::TemperatureDifference,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -53,7 +53,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyEnergyVIF,
|
||||
VIFRange::AnyEnergyVIF,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -68,7 +68,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyVolumeVIF,
|
||||
VIFRange::AnyVolumeVIF,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -83,7 +83,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::VolumeFlow,
|
||||
VIFRange::VolumeFlow,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -98,7 +98,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::AutoSigned,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyPowerVIF,
|
||||
VIFRange::AnyPowerVIF,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -113,7 +113,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FlowTemperature,
|
||||
VIFRange::FlowTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -128,7 +128,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ReturnTemperature,
|
||||
VIFRange::ReturnTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -150,7 +150,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
DifVifKey("0AA618"),
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -165,7 +165,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyEnergyVIF,
|
||||
VIFRange::AnyEnergyVIF,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -179,7 +179,7 @@ MeterSharky774::MeterSharky774(MeterInfo &mi, DriverInfo &di) : MeterCommonImpl
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -47,7 +47,7 @@ MeterSupercom587::MeterSupercom587(MeterInfo &mi, DriverInfo &di) : MeterCommonI
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -49,7 +49,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::EnergyMJ,
|
||||
VIFRange::EnergyMJ,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -64,7 +64,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -79,7 +79,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::PowerW,
|
||||
VIFRange::PowerW,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -94,7 +94,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::VolumeFlow,
|
||||
VIFRange::VolumeFlow,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -109,7 +109,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::FlowTemperature,
|
||||
VIFRange::FlowTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -124,7 +124,7 @@ MeterUltraHeat::MeterUltraHeat(MeterInfo &mi, DriverInfo &di) : MeterCommonImple
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::ReturnTemperature,
|
||||
VIFRange::ReturnTemperature,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
|
@ -48,7 +48,7 @@ MeterVario451Mid::MeterVario451Mid(MeterInfo &mi, DriverInfo &di) : MeterCommon
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyEnergyVIF,
|
||||
VIFRange::AnyEnergyVIF,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -63,7 +63,7 @@ MeterVario451Mid::MeterVario451Mid(MeterInfo &mi, DriverInfo &di) : MeterCommon
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyEnergyVIF,
|
||||
VIFRange::AnyEnergyVIF,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -77,7 +77,7 @@ MeterVario451Mid::MeterVario451Mid(MeterInfo &mi, DriverInfo &di) : MeterCommon
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(1),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -92,7 +92,7 @@ MeterVario451Mid::MeterVario451Mid(MeterInfo &mi, DriverInfo &di) : MeterCommon
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::AnyEnergyVIF,
|
||||
VIFRange::AnyEnergyVIF,
|
||||
StorageNr(8),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
@ -106,7 +106,7 @@ MeterVario451Mid::MeterVario451Mid(MeterInfo &mi, DriverInfo &di) : MeterCommon
|
|||
Quantity::Text,
|
||||
NoDifVifKey,
|
||||
MeasurementType::Instantaneous,
|
||||
ValueInformation::Date,
|
||||
VIFRange::Date,
|
||||
StorageNr(8),
|
||||
TariffNr(0),
|
||||
IndexNr(1),
|
||||
|
|
125
src/dvparser.cc
125
src/dvparser.cc
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
|
||||
#include"dvparser.h"
|
||||
#include"wmbus.h"
|
||||
#include"util.h"
|
||||
|
||||
#include<assert.h>
|
||||
|
@ -29,38 +30,63 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
const char *toString(ValueInformation v)
|
||||
const char *toString(VIFRange v)
|
||||
{
|
||||
switch (v) {
|
||||
case ValueInformation::None: return "None";
|
||||
case ValueInformation::Any: return "Any";
|
||||
#define X(name,from,to,quantity,unit) case ValueInformation::name: return #name;
|
||||
LIST_OF_VALUETYPES
|
||||
case VIFRange::None: return "None";
|
||||
case VIFRange::Any: return "Any";
|
||||
#define X(name,from,to,quantity,unit) case VIFRange::name: return #name;
|
||||
LIST_OF_VIF_RANGES
|
||||
#undef X
|
||||
}
|
||||
assert(0);
|
||||
}
|
||||
|
||||
Unit toDefaultUnit(ValueInformation v)
|
||||
Unit toDefaultUnit(VIFRange v)
|
||||
{
|
||||
switch (v) {
|
||||
case ValueInformation::Any:
|
||||
case ValueInformation::None:
|
||||
case VIFRange::Any:
|
||||
case VIFRange::None:
|
||||
assert(0);
|
||||
break;
|
||||
#define X(name,from,to,quantity,unit) case ValueInformation::name: return unit;
|
||||
LIST_OF_VALUETYPES
|
||||
#define X(name,from,to,quantity,unit) case VIFRange::name: return unit;
|
||||
LIST_OF_VIF_RANGES
|
||||
#undef X
|
||||
}
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ValueInformation toValueInformation(int i)
|
||||
VIFRange toVIFRange(int i)
|
||||
{
|
||||
#define X(name,from,to,quantity,unit) if (from <= i && i <= to) return ValueInformation::name;
|
||||
LIST_OF_VALUETYPES
|
||||
#define X(name,from,to,quantity,unit) if (from <= i && i <= to) return VIFRange::name;
|
||||
LIST_OF_VIF_RANGES
|
||||
#undef X
|
||||
return ValueInformation::None;
|
||||
return VIFRange::None;
|
||||
}
|
||||
|
||||
bool isInsideVIFRange(Vif vif, VIFRange vif_range)
|
||||
{
|
||||
if (vif_range == VIFRange::AnyVolumeVIF)
|
||||
{
|
||||
// There are more volume units in the standard that will be added here.
|
||||
return isInsideVIFRange(vif, VIFRange::Volume);
|
||||
}
|
||||
if (vif_range == VIFRange::AnyEnergyVIF)
|
||||
{
|
||||
return
|
||||
isInsideVIFRange(vif, VIFRange::EnergyWh) ||
|
||||
isInsideVIFRange(vif, VIFRange::EnergyMJ);
|
||||
}
|
||||
if (vif_range == VIFRange::AnyPowerVIF)
|
||||
{
|
||||
// There are more power units in the standard that will be added here.
|
||||
return isInsideVIFRange(vif, VIFRange::PowerW);
|
||||
}
|
||||
|
||||
#define X(name,from,to,quantity,unit) if (VIFRange::name == vif_range) { return from <= vif.intValue() && vif.intValue() <= to; }
|
||||
LIST_OF_VIF_RANGES
|
||||
#undef X
|
||||
return false;
|
||||
}
|
||||
|
||||
map<uint16_t,string> hash_to_format_;
|
||||
|
@ -305,7 +331,14 @@ bool parseDV(Telegram *t,
|
|||
}
|
||||
string value = bin2hex(data, data_end, datalen);
|
||||
int offset = start_parse_here+data-data_start;
|
||||
(*values)[key] = { offset, DVEntry(mt, vif&0x7f, storage_nr, tariff, subunit, value) };
|
||||
(*values)[key] = { offset,
|
||||
DVEntry(mt,
|
||||
Vif(vif&0x7f),
|
||||
StorageNr(storage_nr),
|
||||
TariffNr(tariff),
|
||||
SubUnitNr(subunit),
|
||||
value)
|
||||
};
|
||||
if (value.length() > 0) {
|
||||
// This call increments data with datalen.
|
||||
t->addExplanationAndIncrementPos(data, datalen, KindOfData::CONTENT, Understanding::NONE, "%s", value.c_str());
|
||||
|
@ -330,60 +363,18 @@ bool parseDV(Telegram *t,
|
|||
return true;
|
||||
}
|
||||
|
||||
void valueInfoRange(ValueInformation v, int *low, int *hi)
|
||||
{
|
||||
switch (v) {
|
||||
case ValueInformation::Any:
|
||||
case ValueInformation::None: *low = 0; *hi = 0; return;
|
||||
#define X(name,from,to,quantity,unit) case ValueInformation::name: *low = from; *hi = to; return;
|
||||
LIST_OF_VALUETYPES
|
||||
#undef X
|
||||
}
|
||||
assert(0);
|
||||
}
|
||||
|
||||
bool matchSingleVif(int vi, ValueInformation vif)
|
||||
{
|
||||
int low, hi;
|
||||
valueInfoRange(vif, &low, &hi);
|
||||
|
||||
return vi >= low && vi <= hi;
|
||||
}
|
||||
|
||||
bool isVIFMatch(int vi, ValueInformation vif)
|
||||
{
|
||||
if (vif == ValueInformation::AnyVolumeVIF)
|
||||
{
|
||||
// There are more volume units in the standard that will be added here.
|
||||
return matchSingleVif(vi, ValueInformation::Volume);
|
||||
}
|
||||
if (vif == ValueInformation::AnyEnergyVIF)
|
||||
{
|
||||
return
|
||||
matchSingleVif(vi, ValueInformation::EnergyWh) ||
|
||||
matchSingleVif(vi, ValueInformation::EnergyMJ);
|
||||
}
|
||||
if (vif == ValueInformation::AnyPowerVIF)
|
||||
{
|
||||
// There are more power units in the standard that will be added here.
|
||||
return matchSingleVif(vi, ValueInformation::PowerW);
|
||||
}
|
||||
|
||||
return matchSingleVif(vi, vif);
|
||||
}
|
||||
|
||||
bool hasKey(std::map<std::string,std::pair<int,DVEntry>> *values, std::string key)
|
||||
{
|
||||
return values->count(key) > 0;
|
||||
}
|
||||
|
||||
bool findKey(MeasurementType mit, ValueInformation vif, int storagenr, int tariffnr,
|
||||
bool findKey(MeasurementType mit, VIFRange vif, StorageNr storagenr, TariffNr tariffnr,
|
||||
std::string *key, std::map<std::string,std::pair<int,DVEntry>> *values)
|
||||
{
|
||||
return findKeyWithNr(mit, vif, storagenr, tariffnr, 1, key, values);
|
||||
}
|
||||
|
||||
bool findKeyWithNr(MeasurementType mit, ValueInformation vif, int storagenr, int tariffnr, int nr,
|
||||
bool findKeyWithNr(MeasurementType mit, VIFRange vif_range, StorageNr storagenr, TariffNr tariffnr, int nr,
|
||||
std::string *key, std::map<std::string,std::pair<int,DVEntry>> *values)
|
||||
{
|
||||
/*debug("(dvparser) looking for type=%s vif=%s storagenr=%d value_ran_low=%02x value_ran_hi=%02x\n",
|
||||
|
@ -393,24 +384,24 @@ bool findKeyWithNr(MeasurementType mit, ValueInformation vif, int storagenr, int
|
|||
for (auto& v : *values)
|
||||
{
|
||||
MeasurementType ty = v.second.second.type;
|
||||
int vi = v.second.second.value_information;
|
||||
int sn = v.second.second.storagenr;
|
||||
int tn = v.second.second.tariff;
|
||||
Vif vi = v.second.second.value_information;
|
||||
StorageNr sn = v.second.second.storagenr;
|
||||
TariffNr tn = v.second.second.tariff;
|
||||
/*debug("(dvparser) match? %s type=%s vif=%02x (%s) and storagenr=%d\n",
|
||||
v.first.c_str(),
|
||||
measurementTypeName(ty).c_str(), vi, toString(toValueInformation(vi)), storagenr, sn);*/
|
||||
measurementTypeName(ty).c_str(), vi, toString(toVIFRange(vi)), storagenr, sn);*/
|
||||
|
||||
if (isVIFMatch(vi, vif) &&
|
||||
if (isInsideVIFRange(vi, vif_range) &&
|
||||
(mit == MeasurementType::Unknown || mit == ty) &&
|
||||
(storagenr == ANY_STORAGENR || storagenr == sn) &&
|
||||
(tariffnr == ANY_TARIFFNR || tariffnr == tn))
|
||||
(storagenr == AnyStorageNr || storagenr == sn) &&
|
||||
(tariffnr == AnyTariffNr || tariffnr == tn))
|
||||
{
|
||||
*key = v.first;
|
||||
nr--;
|
||||
if (nr <= 0) return true;
|
||||
/*debug("(dvparser) found key %s for type=%s vif=%02x (%s) storagenr=%d\n",
|
||||
v.first.c_str(), measurementTypeName(ty).c_str(),
|
||||
vi, toString(toValueInformation(vi)), storagenr);*/
|
||||
vi, toString(toVIFRange(vi)), storagenr);*/
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
127
src/dvparser.h
127
src/dvparser.h
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include"util.h"
|
||||
#include"units.h"
|
||||
#include"wmbus.h"
|
||||
|
||||
#include<map>
|
||||
#include<stdint.h>
|
||||
|
@ -28,7 +27,7 @@
|
|||
#include<functional>
|
||||
#include<vector>
|
||||
|
||||
#define LIST_OF_VALUETYPES \
|
||||
#define LIST_OF_VIF_RANGES \
|
||||
X(Volume,0x10,0x17,Quantity::Volume,Unit::M3) \
|
||||
X(OperatingTime,0x24,0x27, Quantity::Time, Unit::Second) \
|
||||
X(VolumeFlow,0x38,0x3F, Quantity::Flow, Unit::M3H) \
|
||||
|
@ -49,36 +48,57 @@
|
|||
X(AnyEnergyVIF,0x00,0x00, Quantity::Energy, Unit::Unknown) \
|
||||
X(AnyPowerVIF,0x00,0x00, Quantity::Power, Unit::Unknown) \
|
||||
|
||||
enum class ValueInformation
|
||||
enum class VIFRange
|
||||
{
|
||||
None,
|
||||
Any,
|
||||
#define X(name,from,to,quantity,unit) name,
|
||||
LIST_OF_VALUETYPES
|
||||
LIST_OF_VIF_RANGES
|
||||
#undef X
|
||||
};
|
||||
|
||||
const char *toString(ValueInformation v);
|
||||
Unit toDefaultUnit(ValueInformation v);
|
||||
ValueInformation toValueInformation(int i);
|
||||
const char *toString(VIFRange v);
|
||||
Unit toDefaultUnit(VIFRange v);
|
||||
VIFRange toVIFRange(int i);
|
||||
bool isInsideVIFRange(int i, VIFRange range);
|
||||
|
||||
enum class MeasurementType
|
||||
{
|
||||
Unknown,
|
||||
Instantaneous,
|
||||
Minimum,
|
||||
Maximum,
|
||||
AtError
|
||||
};
|
||||
|
||||
struct DifVifKey
|
||||
{
|
||||
DifVifKey(string key) : key_(key) {}
|
||||
string str() { return key_; }
|
||||
DifVifKey(std::string key) : key_(key) {}
|
||||
std::string str() { return key_; }
|
||||
bool useSearchInstead() { return key_ == ""; }
|
||||
|
||||
private:
|
||||
|
||||
string key_;
|
||||
std::string key_;
|
||||
};
|
||||
|
||||
static DifVifKey NoDifVifKey = DifVifKey("");
|
||||
|
||||
struct Vif
|
||||
{
|
||||
Vif(int n) : nr_(n) {}
|
||||
int intValue() { return nr_; }
|
||||
bool operator==(Vif s) { return nr_ == s.nr_; }
|
||||
|
||||
private:
|
||||
int nr_;
|
||||
};
|
||||
|
||||
struct StorageNr
|
||||
{
|
||||
StorageNr(int n) : nr_(n) {}
|
||||
int intValue() { return nr_; }
|
||||
bool operator==(StorageNr s) { return nr_ == s.nr_; }
|
||||
|
||||
private:
|
||||
int nr_;
|
||||
|
@ -90,6 +110,7 @@ struct TariffNr
|
|||
{
|
||||
TariffNr(int n) : nr_(n) {}
|
||||
int intValue() { return nr_; }
|
||||
bool operator==(TariffNr s) { return nr_ == s.nr_; }
|
||||
|
||||
private:
|
||||
int nr_;
|
||||
|
@ -97,10 +118,21 @@ private:
|
|||
|
||||
static TariffNr AnyTariffNr = TariffNr(-1);
|
||||
|
||||
struct SubUnitNr
|
||||
{
|
||||
SubUnitNr(int n) : nr_(n) {}
|
||||
int intValue() { return nr_; }
|
||||
bool operator==(SubUnitNr s) { return nr_ == s.nr_; }
|
||||
|
||||
private:
|
||||
int nr_;
|
||||
};
|
||||
|
||||
struct IndexNr
|
||||
{
|
||||
IndexNr(int n) : nr_(n) {}
|
||||
int intValue() { return nr_; }
|
||||
bool operator==(IndexNr s) { return nr_ == s.nr_; }
|
||||
|
||||
private:
|
||||
int nr_;
|
||||
|
@ -108,7 +140,63 @@ private:
|
|||
|
||||
static IndexNr AnyIndexNr = IndexNr(-1);
|
||||
|
||||
bool loadFormatBytesFromSignature(uint16_t format_signature, vector<uchar> *format_bytes);
|
||||
struct DVEntry
|
||||
{
|
||||
MeasurementType type {};
|
||||
Vif value_information { 0 };
|
||||
StorageNr storagenr { 0 };
|
||||
TariffNr tariff { 0 };
|
||||
SubUnitNr subunit { 0 };
|
||||
std::string value;
|
||||
|
||||
DVEntry() {}
|
||||
DVEntry(MeasurementType mt, Vif vi, StorageNr st, TariffNr ta, SubUnitNr su, std::string &val) :
|
||||
type(mt), value_information(vi), storagenr(st), tariff(ta), subunit(su), value(val) {}
|
||||
};
|
||||
|
||||
struct FieldMatcher
|
||||
{
|
||||
// Exact difvif hex string matching all other checks are ignored.
|
||||
bool match_dif_vif_key = false;
|
||||
DifVifKey dif_vif_key { "" };
|
||||
|
||||
// Match the measurement_type.
|
||||
bool match_measurement_type = false;
|
||||
MeasurementType measurement_type { MeasurementType::Instantaneous };
|
||||
|
||||
// Match the value information range. See dvparser.h
|
||||
bool match_value_information = false;
|
||||
VIFRange value_information { VIFRange::None };
|
||||
|
||||
// Match the storage nr.
|
||||
bool match_storage_nr = false;
|
||||
StorageNr storage_nr { 0 };
|
||||
|
||||
// Match the tariff nr.
|
||||
bool match_tariff_nr = false;
|
||||
TariffNr tariff_nr { 0 };
|
||||
|
||||
// Match the subunit.
|
||||
bool match_subunit_nr = false;
|
||||
SubUnitNr subunit_nr { 0 };
|
||||
|
||||
// If the telegram has multiple identical difvif entries, use entry with this index nr.
|
||||
// First entry has nr 1, which is the default value.
|
||||
bool match_index_nr = false;
|
||||
IndexNr index_nr { 1 };
|
||||
|
||||
static FieldMatcher build() { return FieldMatcher(); }
|
||||
void set(DifVifKey k) { dif_vif_key = k; }
|
||||
FieldMatcher &set(MeasurementType mt) { measurement_type = mt; return *this; }
|
||||
FieldMatcher &set(VIFRange vi) { value_information = vi; return *this; }
|
||||
FieldMatcher &set(StorageNr s) { storage_nr = s; return *this; }
|
||||
FieldMatcher &set(TariffNr t) { tariff_nr = t; return *this; }
|
||||
FieldMatcher &set(IndexNr i) { index_nr = i; return *this; }
|
||||
};
|
||||
|
||||
bool loadFormatBytesFromSignature(uint16_t format_signature, std::vector<uchar> *format_bytes);
|
||||
|
||||
struct Telegram;
|
||||
|
||||
bool parseDV(Telegram *t,
|
||||
std::vector<uchar> &databytes,
|
||||
|
@ -123,17 +211,14 @@ bool parseDV(Telegram *t,
|
|||
// find an existing difvif entry in the values based on the desired value information type.
|
||||
// Like: Volume, VolumeFlow, FlowTemperature, ExternalTemperature etc
|
||||
// in combination with the storagenr. (Later I will add tariff/subunit)
|
||||
bool findKey(MeasurementType mt, ValueInformation vi, int storagenr, int tariffnr,
|
||||
bool findKey(MeasurementType mt, VIFRange vi, StorageNr storagenr, TariffNr tariffnr,
|
||||
std::string *key, std::map<std::string,std::pair<int,DVEntry>> *values);
|
||||
// Some meters have multiple identical DIF/VIF values! Meh, they are not using storage nrs or tariff nrs.
|
||||
// So here we can pick for example nr 2 of an identical set if DIF/VIF values.
|
||||
// Nr 1 means the first found value.
|
||||
bool findKeyWithNr(MeasurementType mt, ValueInformation vi, int storagenr, int tariffnr, int indexnr,
|
||||
bool findKeyWithNr(MeasurementType mt, VIFRange vi, StorageNr storagenr, TariffNr tariffnr, int indexnr,
|
||||
std::string *key, std::map<std::string,std::pair<int,DVEntry>> *values);
|
||||
|
||||
#define ANY_STORAGENR -1
|
||||
#define ANY_TARIFFNR -1
|
||||
|
||||
bool hasKey(std::map<std::string,std::pair<int,DVEntry>> *values, std::string key);
|
||||
|
||||
bool extractDVuint8(std::map<std::string,std::pair<int,DVEntry>> *values,
|
||||
|
@ -165,8 +250,8 @@ bool extractDVdouble(std::map<std::string,std::pair<int,DVEntry>> *values,
|
|||
bool assume_signed = false);
|
||||
|
||||
// Extract a value without scaling. Works for 8bits to 64 bits, binary and bcd.
|
||||
bool extractDVlong(map<string,pair<int,DVEntry>> *values,
|
||||
string key,
|
||||
bool extractDVlong(std::map<std::string,std::pair<int,DVEntry>> *values,
|
||||
std::string key,
|
||||
int *offset,
|
||||
uint64_t *value);
|
||||
|
||||
|
@ -174,20 +259,20 @@ bool extractDVlong(map<string,pair<int,DVEntry>> *values,
|
|||
bool extractDVHexString(std::map<std::string,std::pair<int,DVEntry>> *values,
|
||||
std::string key,
|
||||
int *offset,
|
||||
string *value);
|
||||
std::string *value);
|
||||
|
||||
// Read the content and attempt to reverse and transform it into a readble string
|
||||
// based on the dif information.
|
||||
bool extractDVReadableString(std::map<std::string,std::pair<int,DVEntry>> *values,
|
||||
std::string key,
|
||||
int *offset,
|
||||
string *value);
|
||||
std::string *value);
|
||||
|
||||
bool extractDVdate(std::map<std::string,std::pair<int,DVEntry>> *values,
|
||||
std::string key,
|
||||
int *offset,
|
||||
struct tm *value);
|
||||
|
||||
void extractDV(string &s, uchar *dif, uchar *vif);
|
||||
void extractDV(std::string &s, uchar *dif, uchar *vif);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -97,13 +97,13 @@ void MeterCMa12w::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_temperature_c_);
|
||||
t->addMoreExplanation(offset, " current temperature (%f C)", current_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 1h (%f C))", average_temperature_1h_c_);
|
||||
|
|
|
@ -69,7 +69,7 @@ void MeterDME_07::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ void MeterEBZWMBE::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy (%f kwh)", total_energy_kwh_);
|
||||
}
|
||||
|
|
|
@ -122,13 +122,13 @@ void MeterEHZP::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::EnergyWh, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::EnergyWh, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy (%f kwh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::PowerW, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::PowerW, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_power_kw_);
|
||||
t->addMoreExplanation(offset, " current power (%f kw)", current_power_kw_);
|
||||
|
|
|
@ -193,7 +193,7 @@ void MeterElf::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
meter_date_ = strdate(&date);
|
||||
|
@ -217,37 +217,37 @@ void MeterElf::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " version (%s)", version_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &target_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " target energy consumption (%f kWh)", target_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::PowerW, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::PowerW, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_power_kw_);
|
||||
t->addMoreExplanation(offset, " current power consumption (%f kW)", current_power_kw_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " flow temperature (%f °C)", flow_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &external_temperature_c_);
|
||||
t->addMoreExplanation(offset, " external temperature (%f °C)", external_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &return_temperature_c_);
|
||||
t->addMoreExplanation(offset, " return temperature (%f °C)", return_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -73,12 +73,12 @@ void MeterEMerlin868::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &actual_total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " actual total consumption (%f m3)", actual_total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &last_total_water_consumption_m3h_);
|
||||
t->addMoreExplanation(offset, " last total consumption (%f m3)", last_total_water_consumption_m3h_);
|
||||
}
|
||||
|
|
|
@ -254,22 +254,22 @@ void MeterESYSWM::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy (%f kwh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::EnergyWh, 0, 1, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::EnergyWh, 0, 1, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_tariff1_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy tariff 1 (%f kwh)", total_energy_tariff1_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::EnergyWh, 0, 2, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::EnergyWh, 0, 2, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_tariff2_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy tariff 2 (%f kwh)", total_energy_tariff2_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::PowerW, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::PowerW, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_power_kw_);
|
||||
t->addMoreExplanation(offset, " current power (%f kw)", current_power_kw_);
|
||||
}
|
||||
|
|
|
@ -210,13 +210,13 @@ void MeterEurisII::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
|
@ -225,7 +225,7 @@ void MeterEurisII::processContent(Telegram *t)
|
|||
|
||||
for (int i=1; i<=17; ++i)
|
||||
{
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, i, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, i, 0, &key, &t->values))
|
||||
{
|
||||
string info;
|
||||
strprintf(info, " consumption at set date %d (%%f hca)", i);
|
||||
|
|
|
@ -73,12 +73,12 @@ void MeterEV200::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &actual_total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " actual total consumption (%f m3)", actual_total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &last_total_water_consumption_m3h_);
|
||||
t->addMoreExplanation(offset, " last total consumption (%f m3)", last_total_water_consumption_m3h_);
|
||||
}
|
||||
|
|
|
@ -259,12 +259,12 @@ void MeterEvo868::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
@ -277,36 +277,36 @@ void MeterEvo868::processContent(Telegram *t)
|
|||
extractDVReadableString(&t->values, "0E78", &offset, &fabrication_no_);
|
||||
t->addMoreExplanation(offset, " fabrication no (%s)", fabrication_no_.c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_m3_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f m3)", consumption_at_set_date_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 2, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 2, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_2_m3_);
|
||||
t->addMoreExplanation(offset, " consumption at set date 2 (%f m3)", consumption_at_set_date_2_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 2, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 2, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_2_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date 2 (%s)", set_date_2_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Maximum, ValueInformation::VolumeFlow, 3, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Maximum, VIFRange::VolumeFlow, 3, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_flow_since_datetime_m3h_);
|
||||
t->addMoreExplanation(offset, " max flow (%f m3/h)", max_flow_since_datetime_m3h_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 3, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 3, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
max_flow_datetime_ = strdatetime(&datetime);
|
||||
|
@ -318,7 +318,7 @@ void MeterEvo868::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " month increment (%d)", month_increment);
|
||||
|
||||
struct tm date;
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 8, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 8, 0, &key, &t->values)) {
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
string start = strdate(&date);
|
||||
t->addMoreExplanation(offset, " history starts with date (%s)", start.c_str());
|
||||
|
@ -327,7 +327,7 @@ void MeterEvo868::processContent(Telegram *t)
|
|||
// 12 months of historical data, starting in storage 8.
|
||||
for (int i=1; i<=12; ++i)
|
||||
{
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, i+7, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, i+7, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_history_date_m3_[i-1]);
|
||||
t->addMoreExplanation(offset, " consumption at history %d (%f m3)", i, consumption_at_history_date_m3_[i-1]);
|
||||
struct tm d = date;
|
||||
|
|
|
@ -154,29 +154,29 @@ void MeterFHKVDataIV::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 8, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 8, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_8_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date 8 (%f hca)", consumption_at_set_date_8_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 8, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 8, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_8_ = strdate(&date);
|
||||
|
@ -191,7 +191,7 @@ void MeterFHKVDataIV::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " error date (%s)", error_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -326,51 +326,51 @@ void MeterFlowIQ2200::processContent(Telegram *t)
|
|||
extractDVuint16(&t->values, "04FF23", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", statusHumanReadable().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
has_total_water_consumption_ = true;
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &target_water_consumption_m3_);
|
||||
has_target_water_consumption_ = true;
|
||||
t->addMoreExplanation(offset, " target consumption (%f m3)", target_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_datetime_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " target_datetime (%s)", target_datetime_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " current flow (%f m3/h)", current_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Maximum, ValueInformation::VolumeFlow, 2, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Maximum, VIFRange::VolumeFlow, 2, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " max flow (%f m3/h)", max_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Minimum, ValueInformation::VolumeFlow, 2, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Minimum, VIFRange::VolumeFlow, 2, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &min_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " min flow (%f m3/h)", min_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Minimum, ValueInformation::FlowTemperature, 2, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Minimum, VIFRange::FlowTemperature, 2, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &min_flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " min flow temperature (%f °C)", min_flow_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Maximum, ValueInformation::FlowTemperature, 2, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Maximum, VIFRange::FlowTemperature, 2, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " max flow temperature (%f °C)", max_flow_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, ANY_STORAGENR, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, AnyStorageNr, 0, &key, &t->values)) {
|
||||
has_external_temperature_ = extractDVdouble(&t->values, key, &offset, &external_temperature_c_);
|
||||
t->addMoreExplanation(offset, " external temperature (%f °C)", external_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ void MeterHydrocalM3::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values))
|
||||
{
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
|
@ -122,32 +122,32 @@ void MeterHydrocalM3::processContent(Telegram *t)
|
|||
|
||||
// The meter either sends the total energy consumed as kWh or as MJ.
|
||||
// First look for kwh
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, 1, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, 1, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_heating_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total heating energy consumption (%f kWh)", total_heating_energy_kwh_);
|
||||
}
|
||||
// Then look for mj.
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, 1, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 0, 0, 1, &key, &t->values))
|
||||
{
|
||||
double mj;
|
||||
extractDVdouble(&t->values, key, &offset, &mj);
|
||||
total_heating_energy_kwh_ = convert(mj, Unit::MJ, Unit::KWH);
|
||||
t->addMoreExplanation(offset, " total heating energy consumption (%f MJ = %f kWh)", mj, total_heating_energy_kwh_);
|
||||
}
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, 1, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, 1, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_heating_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total heating volume (%f m3)", total_heating_volume_m3_);
|
||||
}
|
||||
// Now look for cooling energy, which uses the same DIFVIF but follows the first set of data.
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, 2, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, 2, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_cooling_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total cooling energy consumption (%f kWh)", total_cooling_energy_kwh_);
|
||||
}
|
||||
// Then look for mj.
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, 2, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 0, 0, 2, &key, &t->values))
|
||||
{
|
||||
double mj;
|
||||
extractDVdouble(&t->values, key, &offset, &mj);
|
||||
|
@ -155,30 +155,30 @@ void MeterHydrocalM3::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " total cooling energy consumption (%f MJ = %f kWh)", mj, total_cooling_energy_kwh_);
|
||||
}
|
||||
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, 2, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, 2, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_cooling_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total cooling volume (%f m3)", total_cooling_volume_m3_);
|
||||
}
|
||||
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, 3, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, 3, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &c1_volume_m3_);
|
||||
t->addMoreExplanation(offset, " volume C1 (%f m3)", c1_volume_m3_);
|
||||
}
|
||||
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, 4, &key, &t->values))
|
||||
if (findKeyWithNr(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, 4, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &c2_volume_m3_);
|
||||
t->addMoreExplanation(offset, " volume C2 (%f m3)", c2_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &t1_temperature_c_);
|
||||
t->addMoreExplanation(offset, " supply temperature T1 (%f °C)", t1_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &t2_temperature_c_);
|
||||
t->addMoreExplanation(offset, " return temperature T2 (%f °C)", t2_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -68,12 +68,12 @@ void MeterHydrodigit::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
meter_datetime_ = strdatetime(&datetime);
|
||||
|
|
|
@ -425,74 +425,74 @@ void MeterHydrus::processContent(Telegram *t)
|
|||
|
||||
// Container 0 : current / total
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 1, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 1, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_tariff1_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption at tariff 1 (%f m3)", total_water_consumption_tariff1_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 2, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 2, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_tariff2_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption at tariff 2 (%f m3)", total_water_consumption_tariff2_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " max flow (%f m3/h)", max_flow_m3h_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " flow temperature (%f °C)", flow_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &external_temperature_c_);
|
||||
t->addMoreExplanation(offset, " external temperature (%f °C)", external_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
current_date_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " current date (%s)", current_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::ActualityDuration, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::ActualityDuration, 0, 0, &key, &t->values)) {
|
||||
extractDVuint24(&t->values, key, &offset, &actuality_duration_s_);
|
||||
t->addMoreExplanation(offset, " actuality duration (%f s)", actuality_duration_s_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::OperatingTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::OperatingTime, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &operating_time_h_);
|
||||
t->addMoreExplanation(offset, " operating time (%f h)", operating_time_h_);
|
||||
}
|
||||
|
||||
// Container 1/3 : past/future records
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 1, 0, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 3, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 1, 0, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, VIFRange::Volume, 3, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_at_date_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption at date (%f m3)", total_water_consumption_at_date_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 1, 1, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 3, 1, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 1, 1, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, VIFRange::Volume, 3, 1, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_tariff1_at_date_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption at tariff 1 at date (%f m3)", total_water_consumption_tariff1_at_date_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 1, 2, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 3, 2, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 1, 2, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, VIFRange::Volume, 3, 2, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_tariff2_at_date_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption at tariff 1 at date (%f m3)", total_water_consumption_tariff2_at_date_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date , 1, 0, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 3, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date , 1, 0, &key, &t->values)
|
||||
|| findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 3, 0, &key, &t->values)) {
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
at_date_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " at date (%s)", at_date_.c_str());
|
||||
|
|
|
@ -129,19 +129,19 @@ void MeterLansenTH::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_temperature_c_);
|
||||
t->addMoreExplanation(offset, " current temperature (%f C)", current_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 1h (%f C))", average_temperature_1h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_24h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 24h (%f C))", average_temperature_24h_c_);
|
||||
|
|
|
@ -98,19 +98,19 @@ void MeterLSE_08::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 8, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 8, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 8, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 8, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -295,30 +295,30 @@ void MeterMultical21::processContent(Telegram *t)
|
|||
extractDVuint16(&t->values, "02FF20", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", statusHumanReadable().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
has_total_water_consumption_ = true;
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &target_water_consumption_m3_);
|
||||
has_target_water_consumption_ = true;
|
||||
t->addMoreExplanation(offset, " target consumption (%f m3)", target_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, ANY_STORAGENR, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, AnyStorageNr, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_flow_m3h_);
|
||||
has_max_flow_ = true;
|
||||
t->addMoreExplanation(offset, " max flow (%f m3/h)", max_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::FlowTemperature, ANY_STORAGENR, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::FlowTemperature, AnyStorageNr, 0, &key, &t->values)) {
|
||||
has_flow_temperature_ = extractDVdouble(&t->values, key, &offset, &flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " flow temperature (%f °C)", flow_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, ANY_STORAGENR, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, AnyStorageNr, 0, &key, &t->values)) {
|
||||
has_external_temperature_ = extractDVdouble(&t->values, key, &offset, &external_temperature_c_);
|
||||
t->addMoreExplanation(offset, " external temperature (%f °C)", external_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -151,37 +151,37 @@ void MeterMultical302::processContent(Telegram *t)
|
|||
extractDVuint8(&t->values, "01FF21", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", status().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
} else if (findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
} else if (findKey(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
double mj;
|
||||
extractDVdouble(&t->values, key, &offset, &mj);
|
||||
total_energy_kwh_ = convert(mj, Unit::MJ, Unit::KWH);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &target_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " target energy consumption (%f kWh)", target_energy_kwh_);
|
||||
} else if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 1, 0, &key, &t->values)){
|
||||
} else if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 1, 0, &key, &t->values)){
|
||||
double mj;
|
||||
extractDVdouble(&t->values, key, &offset, &mj);
|
||||
target_energy_kwh_ = convert(mj, Unit::MJ, Unit::KWH);
|
||||
t->addMoreExplanation(offset, " target energy consumption (%f kWh)", target_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::PowerW, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::PowerW, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_power_kw_);
|
||||
t->addMoreExplanation(offset, " current power consumption (%f kW)", current_power_kw_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -157,32 +157,32 @@ void MeterMultical403::processContent(Telegram *t)
|
|||
extractDVuint8(&t->values, "04FF22", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", status().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_mj_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f MJ)", total_energy_mj_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &volume_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " volume flow (%f m3/h)", volume_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t1_temperature_ = extractDVdouble(&t->values, key, &offset, &t1_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T1 flow temperature (%f °C)", t1_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t2_temperature_ = extractDVdouble(&t->values, key, &offset, &t2_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T2 flow temperature (%f °C)", t2_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -233,32 +233,32 @@ void MeterMultical602::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &volume_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " volume flow (%f m3/h)", volume_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t1_temperature_ = extractDVdouble(&t->values, key, &offset, &t1_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T1 flow temperature (%f °C)", t1_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t2_temperature_ = extractDVdouble(&t->values, key, &offset, &t2_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T2 flow temperature (%f °C)", t2_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -206,32 +206,32 @@ void MeterMultical603::processContent(Telegram *t)
|
|||
extractDVuint32(&t->values, "04FF08", &offset, &energy_returned_kwh_);
|
||||
t->addMoreExplanation(offset, " energy returned kwh (%zu)", energy_returned_kwh_);
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &volume_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " volume flow (%f m3/h)", volume_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t1_temperature_ = extractDVdouble(&t->values, key, &offset, &t1_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T1 flow temperature (%f °C)", t1_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t2_temperature_ = extractDVdouble(&t->values, key, &offset, &t2_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T2 flow temperature (%f °C)", t2_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -246,32 +246,32 @@ void MeterMultical803::processContent(Telegram *t)
|
|||
extractDVuint32(&t->values, "04FF08", &offset, &energy_returned_mj_);
|
||||
t->addMoreExplanation(offset, " energy returned mj (%zu)", energy_returned_mj_);
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyMJ, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_mj_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f MJ)", total_energy_mj_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_volume_m3_);
|
||||
t->addMoreExplanation(offset, " total volume (%f m3)", total_volume_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &volume_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " volume flow (%f m3/h)", volume_flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t1_temperature_ = extractDVdouble(&t->values, key, &offset, &t1_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T1 flow temperature (%f °C)", t1_temperature_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ReturnTemperature, 0, 0, &key, &t->values)) {
|
||||
has_t2_temperature_ = extractDVdouble(&t->values, key, &offset, &t2_temperature_c_);
|
||||
t->addMoreExplanation(offset, " T2 flow temperature (%f °C)", t2_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -88,7 +88,7 @@ void MeterMunia::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_temperature_c_);
|
||||
t->addMoreExplanation(offset, " current temperature (%f C)", current_temperature_c_);
|
||||
|
|
|
@ -208,17 +208,17 @@ void MeterQ400::processContent(Telegram *t)
|
|||
|
||||
// Find keys common to both q400 and axioma.
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_m3_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f m3)", consumption_at_set_date_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
|
@ -226,7 +226,7 @@ void MeterQ400::processContent(Telegram *t)
|
|||
}
|
||||
|
||||
// Now the axioma values:
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values))
|
||||
{
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
|
@ -241,12 +241,12 @@ void MeterQ400::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " backward flow (%f m3/h)", backward_flow_m3h_);
|
||||
|
||||
// Why does the meter send both forward flow and flow? Aren't they the same?
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_m3h_);
|
||||
t->addMoreExplanation(offset, " flow (%f m3/h)", flow_m3h_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " flow temperature (%f °C)", flow_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -167,29 +167,29 @@ void MeterQCaloric::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 17, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 17, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_17_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date 17 (%f hca)", consumption_at_set_date_17_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 17, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 17, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_17_ = strdate(&date);
|
||||
|
@ -204,7 +204,7 @@ void MeterQCaloric::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " error date (%s)", error_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -146,43 +146,43 @@ void MeterQHeat::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_kwh_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &last_year_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " last year energy consumption (%f kWh)", last_year_energy_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
last_year_date_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " last year date (%s)", last_year_date_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 17, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 17, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &last_month_energy_kwh_);
|
||||
t->addMoreExplanation(offset, " last month energy consumption (%f kWh)", last_month_energy_kwh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 17, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 17, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
last_month_date_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " last month date (%s)", last_month_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " device datetime (%s)", device_date_time_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::AtError, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::AtError, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_error_date_ = strdatetime(&datetime);
|
||||
|
|
|
@ -284,7 +284,7 @@ void MeterQSmoke::processContent(Telegram *t)
|
|||
}
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 4, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 4, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
ui_event_date_ = strdate(&date);
|
||||
|
@ -298,7 +298,7 @@ void MeterQSmoke::processContent(Telegram *t)
|
|||
}
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Date, 6, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Date, 6, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
al_event_date_ = strdate(&date);
|
||||
|
@ -319,14 +319,14 @@ void MeterQSmoke::processContent(Telegram *t)
|
|||
}
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::AtError, ValueInformation::Date, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::AtError, VIFRange::Date, 0, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
error_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " error date (%s)", error_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -264,45 +264,45 @@ void MeterRfmAmb::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_temperature_c_);
|
||||
t->addMoreExplanation(offset, " current temperature (%f C)", current_temperature_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Maximum, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Maximum, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &maximum_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " maximum temperature 1h (%f C)", maximum_temperature_1h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Minimum, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Minimum, VIFRange::ExternalTemperature, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &minimum_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " minimum temperature 1h (%f C)", minimum_temperature_1h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Maximum, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Maximum, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &maximum_temperature_24h_c_);
|
||||
t->addMoreExplanation(offset, " maximum temperature 24h (%f C)",
|
||||
maximum_temperature_24h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Minimum, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Minimum, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &minimum_temperature_24h_c_);
|
||||
t->addMoreExplanation(offset, " minimum temperature 24h (%f C)",
|
||||
minimum_temperature_24h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_1h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 1h (%f C)", average_temperature_1h_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::ExternalTemperature, 2, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &average_temperature_24h_c_);
|
||||
t->addMoreExplanation(offset, " average temperature 24h (%f C)", average_temperature_24h_c_);
|
||||
|
@ -367,7 +367,7 @@ void MeterRfmAmb::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " relative humidity 24h (%f RH)", average_relative_humidity_24h_rh_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -108,12 +108,12 @@ void MeterRfmTX1::processContent(Telegram *t)
|
|||
return;
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
meter_datetime_ = strdatetime(&datetime);
|
||||
|
|
|
@ -96,14 +96,14 @@ void MeterSensostar::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
meter_timestamp_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " at date (%s)", meter_timestamp_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::EnergyWh, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_energy_consumption_kwh_);
|
||||
t->addMoreExplanation(offset, " total energy consumption (%f kWh)", total_energy_consumption_kwh_);
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ void MeterSensostar::processContent(Telegram *t)
|
|||
extractDVuint8(&t->values, "01FD17", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", status().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_m3_);
|
||||
t->addMoreExplanation(offset, " total water consumption (%f m3)", total_water_m3_);
|
||||
}
|
||||
|
|
|
@ -235,44 +235,44 @@ void MeterSontex868::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &curr_temp_c_);
|
||||
t->addMoreExplanation(offset, " current temperature (%f °C)", curr_temp_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::ExternalTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &curr_room_temp_c_);
|
||||
t->addMoreExplanation(offset, " current room temperature (%f °C)", curr_room_temp_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Maximum, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Maximum, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_temp_c_);
|
||||
t->addMoreExplanation(offset, " max temperature current period (%f °C)", max_temp_c_);
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Maximum, ValueInformation::FlowTemperature, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Maximum, VIFRange::FlowTemperature, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &max_temp_previous_period_c_);
|
||||
t->addMoreExplanation(offset, " max temperature previous period (%f °C)", max_temp_previous_period_c_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -127,15 +127,15 @@ void MeterTopasEsKr::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_temperature_);
|
||||
t->addMoreExplanation(offset, " water temperature (%f °C)", flow_temperature_);
|
||||
}
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::VolumeFlow, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_flow_m3h_);
|
||||
t->addMoreExplanation(offset, " current flow (%f m3/h)", current_flow_m3h_);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ void MeterUltrimis::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void MeterUltrimis::processContent(Telegram *t)
|
|||
extractDVuint24(&t->values, "03FD17", &offset, &info_codes_);
|
||||
t->addMoreExplanation(offset, " info codes (%s)", status().c_str());
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 1, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &target_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " target consumption (%f m3)", target_water_consumption_m3_);
|
||||
}
|
||||
|
|
|
@ -190,27 +190,27 @@ void MeterUnismart::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " fabrication no (%zu)", v);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
total_date_time_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " total datetime (%s)", total_date_time_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 0, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 0, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &total_gas_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_gas_consumption_m3_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::DateTime, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::DateTime, 1, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
target_date_time_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " target datetime (%s)", target_date_time_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Instantaneous, ValueInformation::Volume, 1, 0, &key, &t->values))
|
||||
if (findKey(MeasurementType::Instantaneous, VIFRange::Volume, 1, 0, &key, &t->values))
|
||||
{
|
||||
extractDVdouble(&t->values, key, &offset, &target_gas_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " target consumption (%f m3)", target_gas_consumption_m3_);
|
||||
|
|
|
@ -139,14 +139,14 @@ void MeterWaterstarM::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
meter_timestamp_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " at date (%s)", meter_timestamp_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void MeterWEH_07::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Unknown, VIFRange::Volume, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &total_water_consumption_m3_);
|
||||
t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
|
||||
}
|
||||
|
|
|
@ -164,29 +164,29 @@ void MeterWhe46x::processContent(Telegram *t)
|
|||
// This heat cost allocator cannot even be bothered to send the HCA data according
|
||||
// to the wmbus protocol....Blech..... I suppose the HCA data is hidden
|
||||
// in the variable string vendor string at the end. Sigh.
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 17, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 17, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_17_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date 17 (%f hca)", consumption_at_set_date_17_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 17, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 17, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_17_ = strdate(&date);
|
||||
|
@ -201,14 +201,14 @@ void MeterWhe46x::processContent(Telegram *t)
|
|||
t->addMoreExplanation(offset, " error date (%s)", error_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
t->addMoreExplanation(offset, " device datetime (%s)", device_date_time_.c_str());
|
||||
}
|
||||
|
||||
if(findKey(MeasurementType::Instantaneous, ValueInformation::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
if(findKey(MeasurementType::Instantaneous, VIFRange::FlowTemperature, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &flow_temperature_c_);
|
||||
t->addMoreExplanation(offset, " flow temperature (%f °C)", flow_temperature_c_);
|
||||
}
|
||||
|
|
|
@ -112,24 +112,24 @@ void MeterWhe5x::processContent(Telegram *t)
|
|||
int offset;
|
||||
string key;
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 0, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, ¤t_consumption_hca_);
|
||||
t->addMoreExplanation(offset, " current consumption (%f hca)", current_consumption_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::Date, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::Date, 1, 0, &key, &t->values)) {
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
set_date_ = strdate(&date);
|
||||
t->addMoreExplanation(offset, " set date (%s)", set_date_.c_str());
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::HeatCostAllocation, 1, 0, &key, &t->values)) {
|
||||
extractDVdouble(&t->values, key, &offset, &consumption_at_set_date_hca_);
|
||||
t->addMoreExplanation(offset, " consumption at set date (%f hca)", consumption_at_set_date_hca_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
if (findKey(MeasurementType::Unknown, VIFRange::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
device_date_time_ = strdatetime(&datetime);
|
||||
|
|
|
@ -782,7 +782,7 @@ void MeterCommonImplementation::addPrint(string vname, Quantity vquantity,
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -812,7 +812,7 @@ void MeterCommonImplementation::addPrint(string vname, Quantity vquantity, Unit
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -840,7 +840,7 @@ void MeterCommonImplementation::addPrint(string vname, Quantity vquantity,
|
|||
NoDifVifKey,
|
||||
VifScaling::Auto,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::None,
|
||||
VIFRange::None,
|
||||
AnyStorageNr,
|
||||
AnyTariffNr,
|
||||
IndexNr(1),
|
||||
|
@ -863,7 +863,7 @@ void MeterCommonImplementation::addFieldWithExtractor(
|
|||
DifVifKey dif_vif_key,
|
||||
VifScaling vif_scaling,
|
||||
MeasurementType mt,
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
@ -906,11 +906,11 @@ void MeterCommonImplementation::addFieldWithExtractor(
|
|||
fi->vifScaling() == VifScaling::AutoSigned))
|
||||
{
|
||||
Unit decoded_unit = fi->defaultUnit();
|
||||
if (fi->valueInformation() != ValueInformation::Any &&
|
||||
fi->valueInformation() != ValueInformation::AnyVolumeVIF &&
|
||||
fi->valueInformation() != ValueInformation::AnyEnergyVIF &&
|
||||
fi->valueInformation() != ValueInformation::AnyPowerVIF &&
|
||||
fi->valueInformation() != ValueInformation::None)
|
||||
if (fi->valueInformation() != VIFRange::Any &&
|
||||
fi->valueInformation() != VIFRange::AnyVolumeVIF &&
|
||||
fi->valueInformation() != VIFRange::AnyEnergyVIF &&
|
||||
fi->valueInformation() != VIFRange::AnyPowerVIF &&
|
||||
fi->valueInformation() != VIFRange::None)
|
||||
{
|
||||
decoded_unit = toDefaultUnit(fi->valueInformation());
|
||||
}
|
||||
|
@ -964,7 +964,7 @@ void MeterCommonImplementation::addField(
|
|||
DifVifKey(""),
|
||||
VifScaling::None,
|
||||
MeasurementType::Unknown,
|
||||
ValueInformation::Volume,
|
||||
VIFRange::Volume,
|
||||
StorageNr(0),
|
||||
TariffNr(0),
|
||||
0,
|
||||
|
@ -986,7 +986,7 @@ void MeterCommonImplementation::addStringFieldWithExtractor(
|
|||
Quantity vquantity,
|
||||
DifVifKey dif_vif_key,
|
||||
MeasurementType mt,
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
@ -1018,7 +1018,7 @@ void MeterCommonImplementation::addStringFieldWithExtractor(
|
|||
&t->values);
|
||||
if (!ok) return false;
|
||||
}
|
||||
if (fi->valueInformation() == ValueInformation::DateTime)
|
||||
if (fi->valueInformation() == VIFRange::DateTime)
|
||||
{
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
|
@ -1027,7 +1027,7 @@ void MeterCommonImplementation::addStringFieldWithExtractor(
|
|||
t->addMoreExplanation(offset, fi->renderJsonText());
|
||||
found = true;
|
||||
}
|
||||
else if (fi->valueInformation() == ValueInformation::Date)
|
||||
else if (fi->valueInformation() == VIFRange::Date)
|
||||
{
|
||||
struct tm date;
|
||||
extractDVdate(&t->values, key, &offset, &date);
|
||||
|
@ -1036,8 +1036,8 @@ void MeterCommonImplementation::addStringFieldWithExtractor(
|
|||
t->addMoreExplanation(offset, fi->renderJsonText());
|
||||
found = true;
|
||||
}
|
||||
else if (fi->valueInformation() == ValueInformation::EnhancedIdentification ||
|
||||
fi->valueInformation() == ValueInformation::FabricationNo)
|
||||
else if (fi->valueInformation() == VIFRange::EnhancedIdentification ||
|
||||
fi->valueInformation() == VIFRange::FabricationNo)
|
||||
{
|
||||
string extracted_id;
|
||||
extractDVReadableString(&t->values, key, &offset, &extracted_id);
|
||||
|
@ -1084,7 +1084,7 @@ void MeterCommonImplementation::addStringFieldWithExtractorAndLookup(
|
|||
Quantity vquantity,
|
||||
DifVifKey dif_vif_key,
|
||||
MeasurementType mt,
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
|
|
@ -315,7 +315,7 @@ struct FieldInfo
|
|||
DifVifKey dif_vif_key,
|
||||
VifScaling vif_scaling,
|
||||
MeasurementType measurement_type,
|
||||
ValueInformation value_information,
|
||||
VIFRange value_information,
|
||||
StorageNr storage_nr,
|
||||
TariffNr tariff_nr,
|
||||
IndexNr index_nr,
|
||||
|
@ -358,7 +358,7 @@ struct FieldInfo
|
|||
DifVifKey difVifKey() { return dif_vif_key_; }
|
||||
VifScaling vifScaling() { return vif_scaling_; }
|
||||
MeasurementType measurementType() { return measurement_type_; }
|
||||
ValueInformation valueInformation() { return value_information_; }
|
||||
VIFRange valueInformation() { return value_information_; }
|
||||
StorageNr storageNr() { return storage_nr_; }
|
||||
TariffNr tariffNr() { return tariff_nr_; }
|
||||
IndexNr indexNr() { return index_nr_; }
|
||||
|
@ -390,7 +390,7 @@ private:
|
|||
DifVifKey dif_vif_key_; // Hardcoded difvif key, if empty string then search for mt,vi,s,t,i instead.
|
||||
VifScaling vif_scaling_;
|
||||
MeasurementType measurement_type_;
|
||||
ValueInformation value_information_;
|
||||
VIFRange value_information_;
|
||||
StorageNr storage_nr_;
|
||||
TariffNr tariff_nr_;
|
||||
IndexNr index_nr_;
|
||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
|||
|
||||
#define SET_FUNC(varname,to_unit) {[=](Unit from_unit, double d){varname = convert(d, from_unit, to_unit);}}
|
||||
#define GET_FUNC(varname,from_unit) {[=](Unit to_unit){return convert(varname, from_unit, to_unit);}}
|
||||
#define LOOKUP_FIELD(DVKEY) NoDifVifKey,VifScaling::Auto,MeasurementType::Unknown,ValueInformation::Any,AnyStorageNr,AnyTariffNr,IndexNr(1)
|
||||
#define LOOKUP_FIELD(DVKEY) NoDifVifKey,VifScaling::Auto,MeasurementType::Unknown,VIFRange::Any,AnyStorageNr,AnyTariffNr,IndexNr(1)
|
||||
#define FIND_FIELD(TYPE,INFO) NoDifVifKey,VifScaling::Auto,TYPE,INFO,StorageNr(0),TariffNr(0),IndexNr(1)
|
||||
#define FIND_FIELD_S(TYPE,INFO,STORAGE) NoDifVifKey,VifScaling::Auto,TYPE,INFO,STORAGE,TariffNr(0),IndexNr(1)
|
||||
#define FIND_FIELD_ST(TYPE,INFO,STORAGE,TARIFF) NoDifVifKey,VifScaling::Auto,,TYPE,INFO,STORAGE,TARIFF,IndexNr(1)
|
||||
|
@ -101,7 +101,7 @@ protected:
|
|||
DifVifKey dif_vif_key, // You can hardocde a dif vif header here or use NoDifVifKey
|
||||
VifScaling vif_scaling,
|
||||
MeasurementType mt, // If not using a hardcoded key, search for mt,vi,s,t and i instead.
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
@ -126,7 +126,7 @@ protected:
|
|||
Quantity vquantity, // Value belongs to this quantity.
|
||||
DifVifKey dif_vif_key, // You can hardocde a dif vif header here or use NoDifVifKey
|
||||
MeasurementType mt, // If not using a hardcoded key, search for mt,vi,s,t and i instead.
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
@ -140,7 +140,7 @@ protected:
|
|||
Quantity vquantity, // Value belongs to this quantity.
|
||||
DifVifKey dif_vif_key, // You can hardocde a dif vif header here or use NoDifVifKey
|
||||
MeasurementType mt, // If not using a hardcoded key, search for mt,vi,s,t and i instead.
|
||||
ValueInformation vi,
|
||||
VIFRange vi,
|
||||
StorageNr s,
|
||||
TariffNr t,
|
||||
IndexNr i,
|
||||
|
|
24
src/wmbus.h
24
src/wmbus.h
|
@ -18,6 +18,7 @@
|
|||
#ifndef WMBUS_H
|
||||
#define WMBUS_H
|
||||
|
||||
#include"dvparser.h"
|
||||
#include"manufacturers.h"
|
||||
#include"serial.h"
|
||||
#include"util.h"
|
||||
|
@ -298,29 +299,6 @@ AFLAuthenticationType fromIntToAFLAuthenticationType(int i);
|
|||
const char *toString(AFLAuthenticationType aat);
|
||||
int toLen(AFLAuthenticationType aat);
|
||||
|
||||
enum class MeasurementType
|
||||
{
|
||||
Unknown,
|
||||
Instantaneous,
|
||||
Minimum,
|
||||
Maximum,
|
||||
AtError
|
||||
};
|
||||
|
||||
struct DVEntry
|
||||
{
|
||||
MeasurementType type {};
|
||||
int value_information {};
|
||||
int storagenr {};
|
||||
int tariff {};
|
||||
int subunit {};
|
||||
string value;
|
||||
|
||||
DVEntry() {}
|
||||
DVEntry(MeasurementType mt, int vi, int st, int ta, int su, string &val) :
|
||||
type(mt), value_information(vi), storagenr(st), tariff(ta), subunit(su), value(val) {}
|
||||
};
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct MeterKeys
|
||||
|
|
Ładowanie…
Reference in New Issue