2using System.Collections.Generic;
3using System.Threading.Tasks;
19 private string entityName;
20 private string ncapId;
21 private byte[] ncapIdBin;
22 private int timeoutMilliseconds = 10000;
23 private int staleSeconds = 60;
24 private int refreshTedsHours = 24;
36 [Page(1,
"IEEE 1451")]
37 [Header(25,
"Entity Name:", 50)]
38 [ToolTip(26,
"Name of entity, as configured in the device.")]
41 get => this.entityName;
42 set => this.entityName = value;
48 [Page(1,
"IEEE 1451")]
49 [Header(2,
"NCAP ID:", 100)]
50 [ToolTip(3,
"NCAP unique identifier.")]
52 [RegularExpression(
"[A-Fa-f0-9]{32}")]
66 [Page(1,
"IEEE 1451")]
67 [Header(16,
"Timeout: (ms)", 1000)]
68 [ToolTip(17,
"Maximum amount of time to wait (in milliseconds) for a response to a request.")]
70 [Range(1,
int.MaxValue)]
73 get => this.timeoutMilliseconds;
74 set => this.timeoutMilliseconds = value;
80 [Page(1,
"IEEE 1451")]
81 [Header(18,
"Stale after: (s)", 2000)]
82 [ToolTip(19,
"Flags information as stale (old) after this amount of time, triggering new requests if information is requested.")]
84 [Range(1,
int.MaxValue)]
87 get => this.staleSeconds;
88 set => this.staleSeconds = value;
94 [Page(1,
"IEEE 1451")]
95 [Header(27,
"Refresh TEDS: (h)", 3000)]
96 [ToolTip(28,
"Re-fetches TEDS from device, if current TEDS is older than this number of hours.")]
98 [Range(1,
int.MaxValue)]
101 get => this.refreshTedsHours;
102 set => this.refreshTedsHours = value;
117 if (!
string.IsNullOrEmpty(this.entityName))
118 return this.entityName;
140 LinkedList<Parameter> Parameters = (LinkedList<Parameter>)await base.GetDisplayableParametersAsync(
Language, Caller);
176 return Grade.Excellent;
179 return Grade.NotAtAll;
193 NcapId = Topic.CurrentSegment
221 return Data.DataReported(
Message);
238 bool Changed =
false;
240 if (this.entityName !=
Name)
242 this.entityName =
Name;
246 if (
string.IsNullOrEmpty(this.Name))
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 ...
Contains methods for simple hash calculations.
static byte[] StringToBinary(string s)
Parses a hex string.
Contains information about a message logged on a node.
MQTT Topic node that publishes discovery commands in accordance with IEEE 1451.0.
Encapsulates messages from an IEEE1451.1.6 device.
Topic node representing an IEEE 1451.0 Channel.
Topic node representing an IEEE 1451.0 NCAP.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a given parent.
virtual async Task NameReceived(string Name)
Name has been received
int StaleSeconds
Timeout for request/response, in milliseconds.
override Task< string > GetTypeNameAsync(Language Language)
Diaplayable type name for node.
MqttNcapTopicNode()
Topic node representing an IEEE 1451.0 NCAP.
int TimeoutMilliseconds
Timeout for request/response, in milliseconds.
byte[] NcapIdBinary
NCAP ID in binary form.
override async Task< IMqttTopicNode > CreateNew(MqttTopicRepresentation Topic)
Creates a new node of the same type.
override Grade Supports(MqttTopicRepresentation Topic)
How well the topic node supports an MQTT topic
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a given child.
int RefreshTedsHours
Refresh TEDS if older than this number of hours.
override async Task< IMqttData > GetDefaultDataObject()
Gets the default data object, if any.
override string LocalId
Local ID
bool ResponseReceived(MqttTopic Topic, Ieee1451_0.Messages.Message Message)
A response message has been received.
Topic node representing an IEEE 1451.0 TIM.
Static class for IEEE 1451-related parsing tasks.
virtual async Task NodeUpdated()
Persists changes to the node, and generates a node updated event.
static async Task< string > GetUniqueNodeId(string NodeId)
Gets a Node ID, based on NodeId that is not already available in the database.
IMqttTopicNode Node
Reference to the MQTT Topic Node
IMqttData Data
Current parsed data.
A Metering node representing an MQTT topic
async Task< MqttTopic > GetTopic()
TODO
string LocalTopic
Local Topic segment
Contains information about an MQTT topic
string CurrentSegment
Current segment being processed.
MqttTopic CurrentParentTopic
Current parent topic.
Tokens available in request.
Interface for nodes that are published through the concentrator interface.
new INode Parent
Parent Node, or null if a root node.
new string NodeId
ID of node.