C# Class CyrusBuilt.MonoPi.Components.Relays.RelayBase

Base class for relay abstraction components.
Inheritance: IRelay
Afficher le fichier Open project: cyrusbuilt/MonoPi

Méthodes publiques

Méthode Description
Close ( ) : void

Closes the dry contacts on the relay.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Relays.RelayBase object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Relays.RelayBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Relays.RelayBase in an unusable state. After calling CyrusBuilt.MonoPi.Components.Relays.RelayBase.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Relays.RelayBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Relays.RelayBase was occupying.

HasProperty ( String key ) : System.Boolean

Determines whether this instance has property the specified key.

IsState ( RelayState state ) : System.Boolean

Determines whether this relay's state matches the specified state.

Open ( ) : void

Opens the dry contacts on the relay.

Pulse ( ) : void

Pulses the relay on and off.

Pulse ( Int32 millis ) : void

Pulses the relay on for the specified number of milliseconds, then back off again.

ToString ( ) : string

Returns a String that represents the current CyrusBuilt.MonoPi.Components.Relays.RelayBase.

Toggle ( ) : void

Toggles the state of the relay (closed, then open).

Méthodes protégées

Méthode Description
Dispose ( System.Boolean disposing ) : void

Releaseses all resources used this object.

OnPulseStart ( EventArgs e ) : void

Raises the pulse start event.

OnPulseStop ( EventArgs e ) : void

Raises the pulse stop event.

OnStateChanged ( RelayStateChangedEventArgs e ) : void

Raises the state changed event.

RelayBase ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Relays.RelayBase class. This is the default constructor.

RelayBase ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Relays.RelayBase class with the pin being used to control the relay.

Method Details

Close() public méthode

Closes the dry contacts on the relay.
public Close ( ) : void
Résultat void

Dispose() public méthode

Releases all resource used by the CyrusBuilt.MonoPi.Components.Relays.RelayBase object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Relays.RelayBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Relays.RelayBase in an unusable state. After calling CyrusBuilt.MonoPi.Components.Relays.RelayBase.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Relays.RelayBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Relays.RelayBase was occupying.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releaseses all resources used this object.
protected Dispose ( System.Boolean disposing ) : void
disposing System.Boolean /// Set true if disposing managed resources in addition to unmanaged. ///
Résultat void

HasProperty() public méthode

Determines whether this instance has property the specified key.
public HasProperty ( String key ) : System.Boolean
key String /// The key name of the property to check for. ///
Résultat System.Boolean

IsState() public méthode

Determines whether this relay's state matches the specified state.
public IsState ( RelayState state ) : System.Boolean
state RelayState /// The state to check for. ///
Résultat System.Boolean

OnPulseStart() protected méthode

Raises the pulse start event.
protected OnPulseStart ( EventArgs e ) : void
e System.EventArgs /// The event arguments. ///
Résultat void

OnPulseStop() protected méthode

Raises the pulse stop event.
protected OnPulseStop ( EventArgs e ) : void
e System.EventArgs /// The event arguments. ///
Résultat void

OnStateChanged() protected méthode

Raises the state changed event.
protected OnStateChanged ( RelayStateChangedEventArgs e ) : void
e RelayStateChangedEventArgs /// The event arguments. ///
Résultat void

Open() public méthode

Opens the dry contacts on the relay.
public Open ( ) : void
Résultat void

Pulse() public méthode

Pulses the relay on and off.
public Pulse ( ) : void
Résultat void

Pulse() public méthode

Pulses the relay on for the specified number of milliseconds, then back off again.
/// Cannot pulse using a pin that is not configured as an output. ///
public Pulse ( Int32 millis ) : void
millis System.Int32 /// The number of milliseconds to wait before switching back off. ///
Résultat void

RelayBase() protected méthode

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Relays.RelayBase class. This is the default constructor.
protected RelayBase ( ) : System
Résultat System

RelayBase() protected méthode

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Relays.RelayBase class with the pin being used to control the relay.
/// cannot null. ///
protected RelayBase ( IGpio pin ) : System
pin IGpio /// The output pin being used to control the relay. ///
Résultat System

ToString() public méthode

Returns a String that represents the current CyrusBuilt.MonoPi.Components.Relays.RelayBase.
public ToString ( ) : string
Résultat string

Toggle() public méthode

Toggles the state of the relay (closed, then open).
public Toggle ( ) : void
Résultat void