2using System.Collections.Generic;
3using System.Threading.Tasks;
18 private string name =
string.Empty;
19 private string className =
string.Empty;
20 private string serialNumber =
string.Empty;
21 private string meterNumber =
string.Empty;
22 private string meterLocation =
string.Empty;
23 private string manufacturerDomain =
string.Empty;
24 private string model =
string.Empty;
25 private string productUrl =
string.Empty;
27 private string country =
string.Empty;
28 private string region =
string.Empty;
29 private string city =
string.Empty;
30 private string area =
string.Empty;
31 private string street =
string.Empty;
32 private string streetNr =
string.Empty;
33 private string building =
string.Empty;
34 private string apartment =
string.Empty;
35 private string room =
string.Empty;
37 private double? latitude =
null;
38 private double? longitude =
null;
39 private double? altitude =
null;
40 private double? version =
null;
53 [Page(16,
"Identity", 0)]
54 [Header(28,
"Name:", 10)]
55 [ToolTip(29,
"An additional name can be provided here.")]
56 [DefaultValueStringEmpty]
60 set => this.name = value;
66 [Page(16,
"Identity", 0)]
67 [Header(31,
"Class:", 20)]
68 [ToolTip(32,
"Class of node.")]
69 [DefaultValueStringEmpty]
72 get => this.className;
73 set => this.className = value;
79 [Page(16,
"Identity", 0)]
80 [Header(34,
"Serial number:", 30)]
81 [ToolTip(35,
"Serial number of device.")]
82 [DefaultValueStringEmpty]
85 get => this.serialNumber;
86 set => this.serialNumber = value;
92 [Page(16,
"Identity", 0)]
93 [Header(37,
"Meter number:", 40)]
94 [ToolTip(38,
"Additional identity of meter.")]
95 [DefaultValueStringEmpty]
98 get => this.meterNumber;
99 set => this.meterNumber = value;
105 [Page(16,
"Identity", 0)]
106 [Header(40,
"Meter location:", 50)]
107 [ToolTip(41,
"Identity of the location of the meter.")]
108 [DefaultValueStringEmpty]
111 get => this.meterLocation;
112 set => this.meterLocation = value;
118 [Page(16,
"Identity", 0)]
119 [Header(43,
"Manufacturer domain:", 60)]
120 [ToolTip(44,
"A domain controlled by the manufacturer.")]
121 [DefaultValueStringEmpty]
124 get => this.manufacturerDomain;
125 set => this.manufacturerDomain = value;
131 [Page(16,
"Identity", 0)]
132 [Header(46,
"Model:", 70)]
133 [ToolTip(47,
"Model name of the device.")]
134 [DefaultValueStringEmpty]
138 set => this.model = value;
144 [Page(16,
"Identity", 0)]
145 [Header(78,
"Version:", 80)]
146 [ToolTip(79,
"Version number of model of device.")]
151 set => this.version = value;
157 [Page(16,
"Identity", 0)]
158 [Header(49,
"Product URL:", 90)]
159 [ToolTip(50,
"A URL with more information about the product.")]
160 [DefaultValueStringEmpty]
163 get => this.productUrl;
164 set => this.productUrl = value;
170 [Page(51,
"Location", 10)]
171 [Header(52,
"Country:", 10)]
172 [ToolTip(53,
"Country of device.")]
173 [DefaultValueStringEmpty]
177 set => this.country = value;
183 [Page(51,
"Location", 10)]
184 [Header(55,
"Region:", 20)]
185 [ToolTip(56,
"Region of device.")]
186 [DefaultValueStringEmpty]
190 set => this.region = value;
196 [Page(51,
"Location", 10)]
197 [Header(58,
"City:", 30)]
198 [ToolTip(59,
"City of device.")]
199 [DefaultValueStringEmpty]
203 set => this.city = value;
209 [Page(51,
"Location", 10)]
210 [Header(61,
"Area:", 40)]
211 [ToolTip(62,
"Area of device.")]
212 [DefaultValueStringEmpty]
216 set => this.area = value;
222 [Page(51,
"Location", 10)]
223 [Header(64,
"Street:", 50)]
224 [ToolTip(65,
"Street device resides on.")]
225 [DefaultValueStringEmpty]
229 set => this.street = value;
235 [Page(51,
"Location", 10)]
236 [Header(67,
"Street number:", 60)]
237 [ToolTip(68,
"Street number where device resides.")]
238 [DefaultValueStringEmpty]
241 get => this.streetNr;
242 set => this.streetNr = value;
252 if (
string.IsNullOrEmpty(this.streetNr))
254 else if (
string.IsNullOrEmpty(this.street))
255 return this.streetNr;
257 return this.street +
" " + this.streetNr;
264 [Page(51,
"Location", 10)]
265 [Header(69,
"Building:", 70)]
266 [ToolTip(70,
"Building device resides in.")]
267 [DefaultValueStringEmpty]
270 get => this.building;
271 set => this.building = value;
277 [Page(51,
"Location", 10)]
278 [Header(72,
"Apartment:", 80)]
279 [ToolTip(73,
"Apartment device resides in.")]
280 [DefaultValueStringEmpty]
283 get => this.apartment;
284 set => this.apartment = value;
290 [Page(51,
"Location", 10)]
291 [Header(75,
"Room:", 90)]
292 [ToolTip(76,
"Room device resides in.")]
293 [DefaultValueStringEmpty]
297 set => this.room = value;
303 [Page(81,
"Position", 20)]
304 [Header(82,
"Latitude:", 10)]
305 [ToolTip(83,
"Latitude of device.")]
310 get => this.latitude;
311 set => this.latitude = value;
317 [Page(81,
"Position", 20)]
318 [Header(84,
"Longitude:", 20)]
319 [ToolTip(85,
"Longitude of device.")]
324 get => this.longitude;
325 set => this.longitude = value;
331 [Page(81,
"Position", 20)]
332 [Header(86,
"Altitude:", 30)]
333 [ToolTip(87,
"Altitude of device.")]
337 get => this.altitude;
338 set => this.altitude = value;
349 LinkedList<Parameter> Result = await base.GetDisplayableParametersAsync(
Language, Caller) as LinkedList<Parameter>;
351 if (!
string.IsNullOrEmpty(this.name))
354 if (!
string.IsNullOrEmpty(this.className))
357 if (!
string.IsNullOrEmpty(this.serialNumber))
360 if (!
string.IsNullOrEmpty(this.meterNumber))
363 if (!
string.IsNullOrEmpty(this.meterLocation))
366 if (!
string.IsNullOrEmpty(this.manufacturerDomain))
369 if (!
string.IsNullOrEmpty(this.model))
372 if (this.version.HasValue)
375 if (!
string.IsNullOrEmpty(this.country))
378 if (!
string.IsNullOrEmpty(this.region))
381 if (!
string.IsNullOrEmpty(this.city))
384 if (!
string.IsNullOrEmpty(this.area))
388 if (!
string.IsNullOrEmpty(s))
391 if (!
string.IsNullOrEmpty(this.building))
394 if (!
string.IsNullOrEmpty(this.apartment))
397 if (!
string.IsNullOrEmpty(this.room))
400 if (this.latitude.HasValue)
403 if (this.longitude.HasValue)
406 if (this.altitude.HasValue)
416 public override async Task<KeyValuePair<string, object>[]>
GetMetaData()
418 List<KeyValuePair<string, object>> Result =
new List<KeyValuePair<string, object>>(await base.GetMetaData());
420 if (!
string.IsNullOrEmpty(this.name))
421 Result.Add(
new KeyValuePair<string, object>(
"NAME",
this.name));
423 if (!
string.IsNullOrEmpty(this.className))
424 Result.Add(
new KeyValuePair<string, object>(
"CLASS",
this.className));
426 if (!
string.IsNullOrEmpty(this.serialNumber))
427 Result.Add(
new KeyValuePair<string, object>(
"SN",
this.serialNumber));
429 if (!
string.IsNullOrEmpty(this.meterNumber))
430 Result.Add(
new KeyValuePair<string, object>(
"MNR",
this.meterNumber));
432 if (!
string.IsNullOrEmpty(this.meterLocation))
433 Result.Add(
new KeyValuePair<string, object>(
"MLOC",
this.meterLocation));
435 if (!
string.IsNullOrEmpty(this.manufacturerDomain))
436 Result.Add(
new KeyValuePair<string, object>(
"MAN",
this.manufacturerDomain));
438 if (!
string.IsNullOrEmpty(this.model))
439 Result.Add(
new KeyValuePair<string, object>(
"MODEL",
this.model));
441 if (this.version.HasValue)
442 Result.Add(
new KeyValuePair<string, object>(
"V", this.version.Value));
444 if (!
string.IsNullOrEmpty(this.productUrl))
445 Result.Add(
new KeyValuePair<string, object>(
"PURL",
this.productUrl));
447 if (!
string.IsNullOrEmpty(this.country))
448 Result.Add(
new KeyValuePair<string, object>(
"COUNTRY",
this.country));
450 if (!
string.IsNullOrEmpty(this.region))
451 Result.Add(
new KeyValuePair<string, object>(
"REGION",
this.region));
453 if (!
string.IsNullOrEmpty(this.city))
454 Result.Add(
new KeyValuePair<string, object>(
"CITY",
this.city));
456 if (!
string.IsNullOrEmpty(this.area))
457 Result.Add(
new KeyValuePair<string, object>(
"AREA",
this.area));
459 if (!
string.IsNullOrEmpty(this.street))
460 Result.Add(
new KeyValuePair<string, object>(
"STREET",
this.street));
462 if (!
string.IsNullOrEmpty(this.streetNr))
463 Result.Add(
new KeyValuePair<string, object>(
"STREETNR",
this.streetNr));
465 if (!
string.IsNullOrEmpty(this.building))
466 Result.Add(
new KeyValuePair<string, object>(
"BLD",
this.building));
468 if (!
string.IsNullOrEmpty(this.apartment))
469 Result.Add(
new KeyValuePair<string, object>(
"APT",
this.apartment));
471 if (!
string.IsNullOrEmpty(this.room))
472 Result.Add(
new KeyValuePair<string, object>(
"ROOM",
this.room));
474 if (this.latitude.HasValue)
475 Result.Add(
new KeyValuePair<string, object>(
"LAT", this.latitude.Value));
477 if (this.longitude.HasValue)
478 Result.Add(
new KeyValuePair<string, object>(
"LON", this.longitude.Value));
480 if (this.altitude.HasValue)
481 Result.Add(
new KeyValuePair<string, object>(
"ALT", this.altitude.Value));
483 return Result.ToArray();
495 if (!
string.IsNullOrEmpty(this.name))
498 if (!
string.IsNullOrEmpty(this.className))
501 if (!
string.IsNullOrEmpty(this.serialNumber))
504 if (!
string.IsNullOrEmpty(this.meterNumber))
507 if (!
string.IsNullOrEmpty(this.meterLocation))
508 Fields.Add(
new StringField(
this, Now,
"Meter Location", this.meterLocation,
FieldType.Identity,
FieldQoS.AutomaticReadout, Module, 93));
510 if (!
string.IsNullOrEmpty(this.manufacturerDomain))
511 Fields.Add(
new StringField(
this, Now,
"Manufacturer", this.manufacturerDomain,
FieldType.Identity,
FieldQoS.AutomaticReadout, Module, 45));
513 if (!
string.IsNullOrEmpty(this.model))
516 if (this.version.HasValue)
519 if (!
string.IsNullOrEmpty(this.country))
522 if (!
string.IsNullOrEmpty(this.region))
525 if (!
string.IsNullOrEmpty(this.city))
528 if (!
string.IsNullOrEmpty(this.area))
532 if (!
string.IsNullOrEmpty(s))
535 if (!
string.IsNullOrEmpty(this.building))
538 if (!
string.IsNullOrEmpty(this.apartment))
541 if (!
string.IsNullOrEmpty(this.room))
544 if (this.latitude.HasValue)
547 if (this.longitude.HasValue)
550 if (this.altitude.HasValue)
Helps with parsing of commong data types.
static byte GetNrDecimals(double x)
Calculates the number of decimals of a floating-point number.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Base class for all metering nodes.
Defines the Metering Topology data source. This data source contains a tree structure of persistent r...
Tokens available in request.
Represents a physical quantity value.
Represents a string value.
FieldQoS
Field Quality of Service flags
FieldType
Field Type flags