Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
WarmUpTime.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Waher.Content;
8
10{
14 public class WarmUpTime : TedsRecord
15 {
19 public WarmUpTime()
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 == 24 ? Grade.Perfect : Grade.NotAtAll;
40 }
41
49 public override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
50 {
51 return new WarmUpTime()
52 {
53 Class = RecordTypeId.Class,
54 Type = RecordTypeId.Type,
55 RawValue = RawValue.Body,
56 Value = RawValue.NextSingle(nameof(WarmUpTime))
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, "Warm-Up 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("WarmUpTime=");
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 AddFields(ThingReference Thing, DateTime Timestamp, List< Field > Fields, Teds Teds)
Adds fields to a collection of fields.
Definition: WarmUpTime.cs:67
override Grade Supports(ClassTypePair RecordTypeId)
How well the class supports a specific TEDS field type.
Definition: WarmUpTime.cs:37
override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
Parses a TEDS record.
Definition: WarmUpTime.cs:49
float Value
This field contains the period of time, expressed in seconds, in which the TransducerChannel stabiliz...
Definition: WarmUpTime.cs:30
override void AppendDetails(StringBuilder SnifferOutput)
Appends record details to sniffer output.
Definition: WarmUpTime.cs:78
WarmUpTime()
TEDS TransducerChannel warm-up time (§6.5.2.37)
Definition: WarmUpTime.cs:19
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