BBBCSIO

The EventData Class

 

The EventData Class

The EventData class provides a container to transport event data. An instantiated object of this class is created by an InteruptPortMM class for every OnInterrupt triggered and is passed as a parameter in the InterruptEventHandlerMM delegate

 

Source Code

The source code for this class is available online for download and also in browseable form.

 

Example Code

Example code which demonstrates the use of this class can be found on the Interrupt Port Example page.

 

Syntax

public class EventData

A class to encapsulate event data.

 

Public Constructors

public EventData(InterruptPortMM portObjectIn)

Constructor.

Parameters
portObjectIn - The InterruptPortMM object which is sending this event.

 

public EventData(InterruptPortMM portObjectIn, int evCodeIn, uint evValueIn)

Constructor.

Parameters
portObjectIn - The InterruptPortMM object which is sending this event.
evCodeIn - A user specified code which appears in the events.
evValueIn - The current state of the pin 0 or 1 (low or high).

 

Public Methods

public override string ToString()

Outputs the event data as a nice human readable string. An example would be

GPIO=GPIO_49, date=2014-11-30 15:22:56.45677, evCode=00A4, evValue=1

 

Public Properties

public int EvCode { get; }

Gets the event code. This is a user defined value specified when the interrupt port was created. There is no set accessor - this value is set in the Constructor.

value
The user-defined identification code for this event.

 

public DateTime EventDateTime { get; }

Gets the event date time. Will never return null. There is no set accessor. The event dateTime is set when the event is created.

value
The datetime value when the event was created.

 

public GpioEnum EvGPIO { get; }

Gets the event GPIO. There is no set accessor - this value is derived from the PortObject.

value
The gpioID of the InterruptPortMM object that generated this event.

 

public int EvMSec { get; }

Gets the milli-seconds value of the event. There is no set accessor - this value is derived from the EventDateTime.

value
The milli-seconds value of the date and time this event was generated.

 

public int EvSec { get; }

Gets the seconds value of the event. There is no set accessor - this value is derived from the EventDateTime

value
The seconds value of the date and time this event was generated.

 

public long EvTicks { get; }

Gets the ticks value of the event.. There is no set accessor - this value is derived from the EventDateTime. A tick is 100 nano seconds or 0.1 micro sec.

value
The number of ticks of the date and time this event was generated.

 

public int EvUSec { get; }

Gets the micro-seconds value of the event. There is no set accessor - this value is derived from the EventDateTime.

value
The micro-seconds value of the date and time this event was generated.

 

public uint EvValue { get; }

Gets the event value. This will be 0 for pin is now low, 1 for pin is now high.

value
The state of the pin when the interrupt was generated.

 

public InterruptPortMM PortObject { get; set; }

Gets/Sets the port object which generated this event.

value
The InterruptPortMM object that generated this event.