Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReadDelayTime.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Waher.Content;
8
10{
15 {
20 : base()
21 {
22 }
23
30 public float Value { get; set; }
31
37 public override Grade Supports(ClassTypePair RecordTypeId)
38 {
39 return RecordTypeId.Class == 3 && RecordTypeId.Type == 25 ? Grade.Perfect : Grade.NotAtAll;
40 }
41
49 public override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
50 {
51 return new ReadDelayTime()
52 {
53 Class = RecordTypeId.Class,
54 Type = RecordTypeId.Type,
55 RawValue = RawValue.Body,
56 Value = RawValue.NextSingle(nameof(ReadDelayTime))
57 };
58 }
59
67 public override void AddFields(ThingReference Thing, DateTime Timestamp, List<Field> Fields, Teds Teds)
68 {
69 Fields.Add(new QuantityField(Thing, Timestamp, "Read Delay Time", this.Value,
70 Math.Min(CommonTypes.GetNrDecimals(this.Value), (byte)2), "s",
71 FieldType.Status, FieldQoS.AutomaticReadout));
72 }
73
78 public override void AppendDetails(StringBuilder SnifferOutput)
79 {
80 SnifferOutput.Append("ReadDelayTime=");
81 SnifferOutput.AppendLine(this.Value.ToString());
82 }
83 }
84}
Helps with parsing of commong data types.
Definition: CommonTypes.cs:13
static byte GetNrDecimals(double x)
Calculates the number of decimals of a floating-point number.
Definition: CommonTypes.cs:903
override void AppendDetails(StringBuilder SnifferOutput)
Appends record details to sniffer output.
ReadDelayTime()
TEDS TransducerChannel read delay time (§6.5.2.38)
override void AddFields(ThingReference Thing, DateTime Timestamp, List< Field > Fields, Teds Teds)
Adds fields to a collection of fields.
override Grade Supports(ClassTypePair RecordTypeId)
How well the class supports a specific TEDS field type.
override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
Parses a TEDS record.
float Value
This field contains the period of time, expressed in seconds, in which the TransducerChannel stabiliz...
Represents one record in a TEDS
Definition: TedsRecord.cs:16
byte Class
This field identifies the TEDS being accessed. The value is the TEDS access code found in Table 72.
Definition: TedsRecord.cs:42
Represents a physical quantity value.
Contains a reference to a thing
Grade
Grade enumeration
Definition: Grade.cs:7
FieldQoS
Field Quality of Service flags
Definition: FieldQoS.cs:10
FieldType
Field Type flags
Definition: FieldType.cs:10