Class ASensor
Inheritance
Inherited Members
Namespace: Xareus.Scenarios.Sensor
Assembly: Xareus.Scenarios.dll
Syntax
public abstract class ASensor : AFunction
Constructors
ASensor()
Base constructor for sensor
Declaration
protected ASensor()
ASensor(Event, Dictionary<string, Parameter>, IContext, IContext, IContext)
Constructor for a Sensor
Declaration
protected ASensor(Event @event, Dictionary<string, Parameter> parameters, IContext externalContext, IContext scenarioContext, IContext sequenceContext)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The event that holds the sensor |
Dictionary<string, Parameter> | parameters | The parameters of the sensor |
IContext | externalContext | The external context |
IContext | scenarioContext | The scenario context |
IContext | sequenceContext | The merged token of the upstream sequences |
Fields
NEGATE_PARAMETER
Declaration
public const string NEGATE_PARAMETER = "Negate"
Field Value
Type | Description |
---|---|
string |
externalContext
The external context
Declaration
protected IContext externalContext
Field Value
Type | Description |
---|---|
IContext |
inputEventContext
The current event context, coming from previous sensors on the same transition. This is different from the sensor's event context that it produces
Declaration
protected IContext inputEventContext
Field Value
Type | Description |
---|---|
IContext |
scenarioContext
The scenario context
Declaration
protected IContext scenarioContext
Field Value
Type | Description |
---|---|
IContext |
sequenceContext
The sequence context / token
Declaration
protected IContext sequenceContext
Field Value
Type | Description |
---|---|
IContext |
Properties
Event
The Event holding the sensor
Declaration
public Event Event { get; }
Property Value
Type | Description |
---|---|
Event |
Negate
Declaration
[ConfigurationParameter("Negate", "Negate the result of the sensor", Necessity.Optional)]
protected virtual bool Negate { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
Check(IContext)
Checks whether an event was triggered. Note that Check is not called if a previous sensors on the same event returned false
Declaration
public virtual ASensor.Result Check(IContext sequenceContext)
Parameters
Type | Name | Description |
---|---|---|
IContext | sequenceContext |
Returns
Type | Description |
---|---|
ASensor.Result |
FillParameters()
Declaration
public virtual void FillParameters()
PostCheck()
Called after a check has been performed on the event
Declaration
public virtual void PostCheck()
SensorCheck()
Checks whether an event was triggered.
Declaration
public abstract ASensor.Result SensorCheck()
Returns
Type | Description |
---|---|
ASensor.Result |
SetContexts(IContext)
Sets/Updates the contexts used by this sensor
Declaration
public virtual void SetContexts(IContext sequenceContext)
Parameters
Type | Name | Description |
---|---|---|
IContext | sequenceContext |
SetInputEventContext(IContext)
Sets the input event context coming from previous sensors on the same event
Declaration
public virtual void SetInputEventContext(IContext inputEventContext)
Parameters
Type | Name | Description |
---|---|---|
IContext | inputEventContext |
StopCheck()
Stops the sensor check
Declaration
public virtual void StopCheck()