Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FieldNode.cs
1
using
System;
2
using
System.Collections.Generic;
3
using
System.Threading.Tasks;
4
using
System.Xml;
5
using
TAG.Simulator.ObjectModel.Values
;
6
using
Waher.Content.Xml
;
7
using
Waher.Script
;
8
using
Waher.Things.SensorData
;
9
10
namespace
TAG.Simulator.XMPP.IoT.Activities.Fields
11
{
15
public
abstract
class
FieldNode
:
NodeReference
,
IValueRecipient
16
{
17
private
IValue
value =
null
;
18
private
string
name;
19
private
Waher.Things.SensorData.FieldType
type;
20
private
FieldQoS
qos;
21
private
bool
writable;
22
28
public
FieldNode
(
ISimulationNode
Parent
,
Model
Model
)
29
: base(
Parent
,
Model
)
30
{
31
}
32
36
public
IValue
Value
=> this.value;
37
41
public
string
Name
=> this.name;
42
46
public
Waher.Things.SensorData.FieldType
Type
=> this.type;
47
51
public
FieldQoS
QualityOfService
=> this.qos;
52
56
public
bool
Writable
=> this.writable;
57
62
public
override
Task
FromXml
(XmlElement Definition)
63
{
64
this.name =
XML
.
Attribute
(Definition,
"name"
);
65
this.type = (
Waher
.
Things
.
SensorData
.FieldType)
XML
.
Attribute
(Definition,
"type"
,
Waher
.
Things
.
SensorData
.FieldType.Momentary);
66
this.qos = (
FieldQoS
)
XML
.
Attribute
(Definition,
"qos"
,
FieldQoS
.AutomaticReadout);
67
this.writable =
XML
.
Attribute
(Definition,
"writable"
,
false
);
68
69
return
base.FromXml(Definition);
70
}
71
76
public
void
Register
(
IValue
Value
)
77
{
78
if
(this.value is
null
)
79
this.value =
Value
;
80
else
81
throw
new
Exception(
"Field node already has a value defined."
);
82
}
83
89
public
abstract
Task
AddFields
(LinkedList<Field> Fields,
Variables
Variables
);
90
}
91
}
TAG.Simulator.Model
Root node of a simulation model
Definition:
Model.cs:49
TAG.Simulator.ObjectModel.Values.Value
Abstract base class for values
Definition:
Value.cs:11
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode
Abstract base class for sensor data field nodes.
Definition:
FieldNode.cs:16
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.QualityOfService
FieldQoS QualityOfService
Field Quality of Service
Definition:
FieldNode.cs:51
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.Name
string Name
Field Name
Definition:
FieldNode.cs:41
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.Writable
bool Writable
If the field is writable (using a control parameter with the same name).
Definition:
FieldNode.cs:56
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.Value
IValue Value
Value node
Definition:
FieldNode.cs:36
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.FromXml
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Definition:
FieldNode.cs:62
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.Type
Waher.Things.SensorData.FieldType Type
Field Type
Definition:
FieldNode.cs:46
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.Register
void Register(IValue Value)
Registers a value for the argument.
Definition:
FieldNode.cs:76
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.FieldNode
FieldNode(ISimulationNode Parent, Model Model)
Abstract base class for sensor data field nodes.
Definition:
FieldNode.cs:28
TAG.Simulator.XMPP.IoT.Activities.Fields.FieldNode.AddFields
abstract Task AddFields(LinkedList< Field > Fields, Variables Variables)
Adds sensor-data fields.
TAG.Simulator.XMPP.IoT.NodeReference
Node reference.
Definition:
NodeReference.cs:13
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:19
Waher.Content.Xml.XML.Attribute
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition:
XML.cs:914
Waher.Script.Variables
Collection of variables.
Definition:
Variables.cs:25
TAG.Simulator.ISimulationNode
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Definition:
ISimulationNode.cs:18
TAG.Simulator.ISimulationNode.Parent
ISimulationNode Parent
Parent node in the simulation model.
Definition:
ISimulationNode.cs:23
TAG.Simulator.ObjectModel.Values.IValue
Interface for values
Definition:
IValue.cs:12
TAG.Simulator.ObjectModel.Values.IValueRecipient
Interface for nodes holding a value node
Definition:
IValueRecipient.cs:7
TAG.Simulator.ObjectModel.Values
Definition:
Binary.cs:10
TAG.Simulator.XMPP.IoT.Activities.Fields
Definition:
BooleanField.cs:9
Waher.Content.Xml
Definition:
XmlCodec.cs:11
Waher.Script
Definition:
Duration.cs:8
Waher.Things.SensorData
Definition:
BooleanField.cs:6
Waher.Things.SensorData.FieldQoS
FieldQoS
Field Quality of Service flags
Definition:
FieldQoS.cs:10
Waher.Things.SensorData.FieldType
FieldType
Field Type flags
Definition:
FieldType.cs:10
Waher.Things
Definition:
AnalogInput.cs:15
Waher
Definition:
App.xaml.cs:4
ComSim
TAG.Simulator.XMPP.IoT
Activities
Fields
FieldNode.cs
Generated by
1.9.5