2using System.Collections.Generic;
3using System.Threading.Tasks;
66 TaskCompletionSource<bool> ReadoutCompleted =
new TaskCompletionSource<bool>();
72 foreach (Field F in e.Fields)
75 Request.ReportFields(false, e.Fields);
78 ReadoutCompleted.TrySetResult(true);
80 return Task.CompletedTask;
84 List<ThingError> Errors2 = new List<ThingError>();
86 foreach (ThingError Error in e.Errors)
87 Errors2.Add(new ThingError(this, Error.ErrorMessage));
89 Request.ReportErrors(false, Errors2.ToArray());
92 ReadoutCompleted.TrySetResult(true);
94 return Task.CompletedTask;
97 await Sensor.StartReadout(InternalReadout);
99 Task Timeout = Task.Delay(60000);
101 Task T = await Task.WhenAny(ReadoutCompleted.Task, Timeout);
103 if (!ReadoutCompleted.Task.IsCompleted)
124 List<ControlParameter> Result =
new List<ControlParameter>();
129 Result.AddRange(await Actuator.GetControlParameters());
132 return Result.ToArray();
Manages a chat sensor data readout request.
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 ...
Represents a composition of nodes, under a unit.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
async Task StartReadout(ISensorReadout Request)
Starts the readout of the sensor.
ModbusCompositeChildNode()
Represents a composition of nodes, under a unit.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
async Task< ControlParameter[]> GetControlParameters()
Get control parameters for the actuator.
Node representing a TCP/IP connection to a Modbus Gateway
Abstract base class for child nodes to Mobus Unit nodes.
Represents a Unit Device on a Modbus network.
Contains information about an error on a thing
Interface for actuator nodes.
Interface for nodes that are published through the concentrator interface.
Task< IEnumerable< INode > > ChildNodes
Child nodes. If no child nodes are available, null is returned.
INode Parent
Parent Node, or null if a root node.
string LogId
If provided, an ID for the node, as it would appear or be used in system logs. Can be null,...
Interface for sensor nodes.
Interface for classes managing sensor data readouts.
string[] FieldNames
Names of fields to read.
Task ReportErrors(bool Done, params ThingError[] Errors)
Report error states to the client.
FieldType Types
Field Types to read.
DateTime To
To what time readout is to be made. Use DateTime.MaxValue to specify no upper limit.
Task ReportFields(bool Done, params Field[] Fields)
Report read fields to the client.
DateTime From
From what time readout is to be made. Use DateTime.MinValue to specify no lower limit.