Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReadSetupTime.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Waher.Content;
8
10{
15 {
20 : base()
21 {
22 }
23
29 public float Value { get; set; }
30
36 public override Grade Supports(ClassTypePair RecordTypeId)
37 {
38 return RecordTypeId.Class == 3 && RecordTypeId.Type == 22 ? Grade.Perfect : Grade.NotAtAll;
39 }
40
48 public override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
49 {
50 return new ReadSetupTime()
51 {
52 Class = RecordTypeId.Class,
53 Type = RecordTypeId.Type,
54 RawValue = RawValue.Body,
55 Value = RawValue.NextSingle(nameof(ReadSetupTime))
56 };
57 }
58
66 public override void AddFields(ThingReference Thing, DateTime Timestamp, List<Field> Fields, Teds Teds)
67 {
68 Fields.Add(new QuantityField(Thing, Timestamp, "Read Setup Time", this.Value,
69 Math.Min(CommonTypes.GetNrDecimals(this.Value), (byte)2), "s",
70 FieldType.Status, FieldQoS.AutomaticReadout));
71 }
72
77 public override void AppendDetails(StringBuilder SnifferOutput)
78 {
79 SnifferOutput.Append("ReadSetupTime=");
80 SnifferOutput.AppendLine(this.Value.ToString());
81 }
82 }
83}
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 Grade Supports(ClassTypePair RecordTypeId)
How well the class supports a specific TEDS field type.
override void AppendDetails(StringBuilder SnifferOutput)
Appends record details to sniffer output.
ReadSetupTime()
TEDS TransducerChannel write setup time (§6.5.2.35)
float Value
This field contains the maximum time (trs), expressed in seconds, between the receipt of the trigger ...
override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
Parses a TEDS record.
override void AddFields(ThingReference Thing, DateTime Timestamp, List< Field > Fields, Teds Teds)
Adds fields to a collection of fields.
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