Skip to content

Commit

Permalink
Update dpt 9.x range limits to dpt spec v2.2.1 (closes #127)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed Mar 3, 2024
1 parent a4aea59 commit 844be8a
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 116 deletions.
98 changes: 49 additions & 49 deletions src/io/calimero/dptxlator/DPTXlator2ByteFloat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2006, 2023 B. Malinowsky
Copyright (c) 2006, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,13 +45,13 @@
* <p>
* The KNX data type width is 2 bytes.<br>
* This type is a two byte floating format with a maximum usable range of -671088.64 to
* +670760.96. DPTs adjust the usable range to reasonable limits for its values, the
* 670760. DPTs adjust the usable range to reasonable limits for its values, the
* translator will check and enforce those DPT specific limits in all methods working with
* java values (e.g. {@link #setValue(double)}). Data methods for KNX data (e.g.
* {@link #setData(byte[])} accept all data within the maximum usable range.<br>
* {@link #setData(byte[])}) accept all data within the maximum usable range.<br>
* In value methods expecting a string type, the value is a floating type representation.
* <p>
* The default return value after creation is {@code 0.0}.<br>
* The default return value after creation is {@code 0}.<br>
* Note, that the floating type structure specified by this data type isn't really
* precise, especially for bigger floating numbers, so you have to expect certain rounding
* deviations.
Expand All @@ -61,133 +61,133 @@
public class DPTXlator2ByteFloat extends DPTXlator
{
/**
* DPT ID 9.001, Temperature; values from <b>-273</b> to <b>+670760</b> °C.
* DPT ID 9.001, Temperature; values from <b>-273</b> to <b>670433.28</b> °C.
*/
public static final DPT DPT_TEMPERATURE =
new DPT("9.001", "Temperature", "-273", "+670760", "°C");
new DPT("9.001", "Temperature", "-273", "670433.28", "°C");

/**
* DPT ID 9.002, Temperature difference; value range <b>+/-670760</b> K.
* DPT ID 9.002, Temperature difference; value range <b>-671088.64</b> to <b>670433.28</b> K.
*/
public static final DPT DPT_TEMPERATURE_DIFFERENCE =
new DPT("9.002", "Temperature difference", "-670760", "+670760", "K");
new DPT("9.002", "Temperature difference", "-671088.64", "670433.28", "K");

/**
* DPT ID 9.003, Temperature gradient; value range <b>+/-670760</b> K/h.
* DPT ID 9.003, Temperature gradient; value range <b>-671088.64</b> to <b>670433.28</b> K/h.
*/
public static final DPT DPT_TEMPERATURE_GRADIENT =
new DPT("9.003", "Temperature gradient", "-670760", "+670760", "K/h");
new DPT("9.003", "Temperature gradient", "-671088.64", "670433.28", "K/h");

/**
* DPT ID 9.004, Intensity of light (Lux); values from <b>0</b> to <b>+670760</b> lx. Note, the
* DPT ID 9.004, Intensity of light (Lux); values from <b>0</b> to <b>670433.28</b> lx. Note, the
* unit of measure symbol used here is "lx", and not "Lux" as originally proposed for this DPT.
*/
public static final DPT DPT_INTENSITY_OF_LIGHT =
new DPT("9.004", "Light intensity", "0", "+670760", "lx");
new DPT("9.004", "Light intensity", "0", "670433.28", "lx");

/**
* DPT ID 9.005, Wind speed; values from <b>0</b> to <b>+670760</b> m/s.
* DPT ID 9.005, Wind speed; values from <b>0</b> to <b>670433.28</b> m/s.
*/
public static final DPT DPT_WIND_SPEED = new DPT("9.005", "Wind speed", "0", "+670760", "m/s");
public static final DPT DPT_WIND_SPEED = new DPT("9.005", "Wind speed", "0", "670433.28", "m/s");

/**
* DPT ID 9.006, Air pressure; values from <b>0</b> to <b>+670760</b> Pa.
* DPT ID 9.006, Air pressure; values from <b>0</b> to <b>670433.28</b> Pa.
*/
public static final DPT DPT_AIR_PRESSURE = new DPT("9.006", "Air pressure", "0", "+670760",
public static final DPT DPT_AIR_PRESSURE = new DPT("9.006", "Air pressure", "0", "670433.28",
"Pa");

/**
* DPT ID 9.007, Humidity; values from <b>0</b> to <b>+670760</b> %.
* DPT ID 9.007, Humidity; values from <b>0</b> to <b>670433.28</b> %.
*/
public static final DPT DPT_HUMIDITY = new DPT("9.007", "Humidity", "0", "+670760", "%");
public static final DPT DPT_HUMIDITY = new DPT("9.007", "Humidity", "0", "670433.28", "%");

/**
* DPT ID 9.008, Air quality; values from <b>0</b> to <b>+670760</b> ppm.
* DPT ID 9.008, Air quality; values from <b>0</b> to <b>670433.28</b> ppm.
*/
public static final DPT DPT_AIRQUALITY = new DPT("9.008", "Air quality", "0", "+670760", "ppm");
public static final DPT DPT_AIRQUALITY = new DPT("9.008", "Air quality", "0", "670433.28", "ppm");

/**
* DPT ID 9.009, Air flow; value range <b>+/-670760</b> m&sup3;/h; resolution 0.01 m&sup3;/h.
* DPT ID 9.009, Air flow; value range <b>-671088.64</b> to <b>670433.28</b> m&sup3;/h; resolution 0.01 m&sup3;/h.
*/
public static final DPT DPT_AIR_FLOW = new DPT("9.009", "Air flow", "-670760", "+670760",
public static final DPT DPT_AIR_FLOW = new DPT("9.009", "Air flow", "-671088.64", "670433.28",
"m³/h");

/**
* DPT ID 9.010, Time difference in seconds; value range <b>+/-670760</b> s.
* DPT ID 9.010, Time difference in seconds; value range <b>-671088.64</b> to <b>670433.28</b> s.
*/
public static final DPT DPT_TIME_DIFFERENCE1 =
new DPT("9.010", "Time difference 1", "-670760", "+670760", "s");
new DPT("9.010", "Time difference 1", "-671088.64", "670433.28", "s");

/**
* DPT ID 9.011, Time difference in milliseconds; value range <b>+/-670760</b> ms.
* DPT ID 9.011, Time difference in milliseconds; value range <b>-671088.64</b> to <b>670433.28</b> ms.
*/
public static final DPT DPT_TIME_DIFFERENCE2 =
new DPT("9.011", "Time difference 2", "-670760", "+670760", "ms");
new DPT("9.011", "Time difference 2", "-671088.64", "670433.28", "ms");

/**
* DPT ID 9.020, Voltage; value range <b>+/-670760</b> mV.
* DPT ID 9.020, Voltage; value range <b>-671088.64</b> to <b>670433.28</b> mV.
*/
public static final DPT DPT_VOLTAGE = new DPT("9.020", "Voltage", "-670760", "+670760", "mV");
public static final DPT DPT_VOLTAGE = new DPT("9.020", "Voltage", "-671088.64", "670433.28", "mV");

/**
* DPT ID 9.021, Electrical current; value range <b>+/-670760</b> mA.
* DPT ID 9.021, Electrical current; value range <b>-671088.64</b> to <b>670433.28</b> mA.
*/
public static final DPT DPT_ELECTRICAL_CURRENT =
new DPT("9.021", "Electrical current", "-670760", "+670760", "mA");
new DPT("9.021", "Electrical current", "-671088.64", "670433.28", "mA");

/**
* DPT ID 9.022, Power density; value range <b>+/-670760</b> W/m<sup>2</sup>.
* DPT ID 9.022, Power density; value range <b>-671088.64</b> to <b>670433.28</b> W/m<sup>2</sup>.
*/
public static final DPT DPT_POWERDENSITY =
new DPT("9.022", "Power density", "-670760", "+670760", "W/m²");
new DPT("9.022", "Power density", "-671088.64", "670433.28", "W/m²");

/**
* DPT ID 9.023, Kelvin/percent; value range <b>+/-670760</b> K/%.
* DPT ID 9.023, Kelvin/percent; value range <b>-671088.64</b> to <b>670433.28</b> K/%.
*/
public static final DPT DPT_KELVIN_PER_PERCENT =
new DPT("9.023", "Kelvin/percent", "-670760", "+670760", "K/%");
new DPT("9.023", "Kelvin/percent", "-671088.64", "670433.28", "K/%");

/**
* DPT ID 9.024, Power; value range <b>+/-670760</b> kW.
* DPT ID 9.024, Power; value range <b>-671088.64</b> to <b>670433.28</b> kW.
*/
public static final DPT DPT_POWER = new DPT("9.024", "Power", "-670760", "+670760", "kW");
public static final DPT DPT_POWER = new DPT("9.024", "Power", "-671088.64", "670433.28", "kW");

/**
* DPT ID 9.025, Volume flow in liter/hour; value range <b>+/-670760</b> l/h, resolution 0.01.
* DPT ID 9.025, Volume flow in liter/hour; value range <b>-671088.64</b> to <b>670433.28</b> l/h, resolution 0.01.
*/
public static final DPT DPT_VOLUME_FLOW = new DPT("9.025", "Volume flow", "-670760", "+670760",
public static final DPT DPT_VOLUME_FLOW = new DPT("9.025", "Volume flow", "-671088.64", "670433.28",
"l/h");

/**
* DPT ID 9.026, Rain amount in liters per square meter; values from <b>-671088.64</b> to
* <b>670760.96</b> l/m<sup>2</sup>, resolution 0.01.
* <b>670433.28</b> l/m<sup>2</sup>, resolution 0.01.
*/
public static final DPT DPT_RAIN_AMOUNT = new DPT("9.026", "Rain amount", "-671088.64",
"670760.96", "l/m²");
"670433.28", "l/m²");

/**
* DPT ID 9.027, Temperature in Degree Fahrenheit; values from <b>+/-459.6</b> to
* <b>670760.96</b> °F, resolution 0.01.
* DPT ID 9.027, Temperature in Degree Fahrenheit; values from <b>-459.6</b> to
* <b>670433.28</b> °F, resolution 0.01.
*/
public static final DPT DPT_TEMP_F = new DPT("9.027", "Temperature", "-459.6", "670760.96",
public static final DPT DPT_TEMP_F = new DPT("9.027", "Temperature", "-459.6", "670433.28",
"°F");

/**
* DPT ID 9.028, Wind speed in km/h; values from <b>0</b> to <b>670760.96</b> km/h, resolution
* DPT ID 9.028, Wind speed in km/h; values from <b>0</b> to <b>670433.28</b> km/h, resolution
* 0.01.
*/
public static final DPT DPT_WIND_SPEED_KMH = new DPT("9.028", "Wind speed", "0", "670760.96",
public static final DPT DPT_WIND_SPEED_KMH = new DPT("9.028", "Wind speed", "0", "670433.28",
"km/h");

/**
* DPT ID 9.029, absolute humidity in g/m³; values from <b>0</b> to <b>670760.96</b> g/m³, resolution 0.01.
* DPT ID 9.029, absolute humidity in g/m³; values from <b>0</b> to <b>670760</b> g/m³, resolution 0.01.
*/
public static final DPT DptAbsoluteHumidity = new DPT("9.029", "absolute humidity", "0", "670760.96", "g/m³");
public static final DPT DptAbsoluteHumidity = new DPT("9.029", "absolute humidity", "0", "670760", "g/m³");

/**
* DPT ID 9.030, concentration in µg/m³; values from <b>0</b> to <b>670760.96</b> µg/m³, resolution 0.01.
* DPT ID 9.030, concentration in µg/m³; values from <b>0</b> to <b>670760</b> µg/m³, resolution 0.01.
*/
public static final DPT DptConcentration = new DPT("9.030", "concentration", "0", "670760.96", "µg/m³");
public static final DPT DptConcentration = new DPT("9.030", "concentration", "0", "670760", "µg/m³");



Expand Down
Loading

0 comments on commit 844be8a

Please sign in to comment.