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>, ContextHolder)
Constructor for a Sensor
Declaration
protected ASensor(Event @event, Dictionary<string, Parameter> parameters, ContextHolder contexts)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The event that holds the sensor |
Dictionary<string, Parameter> | parameters | The parameters of the sensor |
ContextHolder | contexts | The contexts |
ASensor(Event, Dictionary<string, Parameter>, IContext, IContext, IContext)
Constructor for a Sensor
Declaration
[Obsolete("Use ASensor(Event, Dictionary<string, Parameter>, ContextHolder) instead.")]
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 |
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 |
externalContext
Declaration
[Obsolete("Use Contexts.ExternalContext instead.")]
protected IContext externalContext { get; }
Property 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
[Obsolete("Use Contexts.EventContext instead.")]
protected IContext inputEventContext { get; }
Property Value
Type | Description |
---|---|
IContext |
scenarioContext
Declaration
[Obsolete("Use Contexts.ScenarioContext instead.")]
protected IContext scenarioContext { get; }
Property Value
Type | Description |
---|---|
IContext |
sequenceContext
Declaration
[Obsolete("Use Contexts.SequenceContext instead.")]
protected IContext sequenceContext { get; }
Property Value
Type | Description |
---|---|
IContext |
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 |
PostCheck()
Called after a check has been performed on the event/transition that contains this sensor whether it was successful or not and whether this sensors was checked or not
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()