Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StateMachineSample.cs
1
using
System;
2
using
Waher.Content
;
3
using
Waher.Persistence.Attributes
;
4
using
Waher.Service.IoTBroker.NeuroFeatures
;
5
6
namespace
Waher.Service.IoTBroker.StateMachines
7
{
11
[CollectionName(
"StateMachineSamples"
)]
12
[TypeName(
TypeNameSerialization
.None)]
13
[ArchivingTime(nameof(ArchiveDays))]
14
[Index(
"StateMachineId"
,
"Variable"
,
"Timestamp"
)]
15
[Index(
"StateMachineId"
,
"Timestamp"
,
"Variable"
)]
16
public
class
StateMachineSample
17
{
21
public
const
string
CurrentStateVariable
=
"<State>"
;
22
26
[
ObjectId
]
27
public
string
ObjectId
{
get
;
set
; }
28
32
public
string
StateMachineId
{
get
;
set
; }
33
37
public
string
Variable
{
get
;
set
; }
38
42
public
DateTime
Timestamp
{
get
;
set
; }
43
47
public
object
Value
{
get
;
set
; }
48
52
public
DateTime
Expires
{
get
;
set
; }
53
57
[DefaultValueNull]
58
public
Duration
?
ArchiveRequired
{
get
;
set
; }
59
63
[DefaultValueNull]
64
public
Duration
?
ArchiveOptional
{
get
;
set
; }
65
69
public
int
ArchiveDays
=>
Token
.
CalcArchiveDays
(this.
Expires
, this.
ArchiveRequired
, this.
ArchiveOptional
);
70
}
71
}
Waher.Service.IoTBroker.NeuroFeatures.Token
Neuro-Feature Token
Definition:
Token.cs:60
Waher.Service.IoTBroker.NeuroFeatures.Token.CalcArchiveDays
static int CalcArchiveDays(DateTime Expires, Duration? ArchiveReq, Duration? ArchiveOpt)
Calculates the number of days an object should be archived in the ledger.
Definition:
Token.cs:582
Waher.Service.IoTBroker.StateMachines.CurrentStateVariable
Class representing a persisted state-machine variable value.
Definition:
CurrentStateVariable.cs:11
Waher.Service.IoTBroker.StateMachines.StateMachineSample
Class representing a sample of a state machine variable over time.
Definition:
StateMachineSample.cs:17
Waher.Service.IoTBroker.StateMachines.StateMachineSample.ArchiveDays
int ArchiveDays
Number of days to archive field.
Definition:
StateMachineSample.cs:69
Waher.Service.IoTBroker.StateMachines.StateMachineSample.Expires
DateTime Expires
When state-machine expires
Definition:
StateMachineSample.cs:52
Waher.Service.IoTBroker.StateMachines.StateMachineSample.ArchiveOptional
Duration? ArchiveOptional
Duration after which token expires, and the required archiving time, the token can optionally be arch...
Definition:
StateMachineSample.cs:64
Waher.Service.IoTBroker.StateMachines.StateMachineSample.Timestamp
DateTime Timestamp
Timestamp of sample
Definition:
StateMachineSample.cs:42
Waher.Service.IoTBroker.StateMachines.StateMachineSample.ArchiveRequired
Duration? ArchiveRequired
Duration after which token expires, the token is required to be archived.
Definition:
StateMachineSample.cs:58
Waher.Service.IoTBroker.StateMachines.StateMachineSample.StateMachineId
string StateMachineId
ID of State-Machine.
Definition:
StateMachineSample.cs:32
Waher.Service.IoTBroker.StateMachines.StateMachineSample.Value
object Value
Sampled value
Definition:
StateMachineSample.cs:47
Waher.Service.IoTBroker.StateMachines.StateMachineSample.ObjectId
string ObjectId
Object ID of current state.
Definition:
StateMachineSample.cs:27
Waher.Service.IoTBroker.StateMachines.StateMachineSample.Variable
string Variable
ID of State-Machine.
Definition:
StateMachineSample.cs:37
Waher.Content
Definition:
Array.cs:6
Waher.Persistence.Attributes
Definition:
ArchivingTimeAttribute.cs:4
Waher.Persistence.Attributes.TypeNameSerialization
TypeNameSerialization
How the type name should be serialized.
Definition:
TypeNameAttribute.cs:9
Waher.Service.IoTBroker.NeuroFeatures
Definition:
Created.cs:5
Waher.Service.IoTBroker.StateMachines
Definition:
CurrentState.cs:11
Waher.Content.Duration
Represents a duration value, as defined by the xsd:duration data type: http://www....
Definition:
Duration.cs:13
Waher.Service.IoTBroker
StateMachines
StateMachineSample.cs
Generated by
1.9.5