C# Класс CyrusBuilt.MonoPi.Devices.Access.OpenerDevice

A device that is an abstraction of a door opener (such as a garage door opener). This is an implementation of the CyrusBuilt.MonoPi.Devices.Access.OpenerBase.
Наследование: OpenerBase
Показать файл Открыть проект

Открытые методы

Метод Описание
Close ( ) : void

Closes the opener.

DisableOverride ( ) : void

Disables the lock override. This will cause this opener to resume reading the actual state of the lock (if specified).

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice object.

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

Open ( ) : void

Opens the opener.

OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, and the sensor state that indicates that the opener has opened.

OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState, ISwitch lok ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, the sensor state that indicates that the opener has opened, and the switch that controls the lock.

OverrideLock ( SwitchState overridedState ) : void

Manually overrides the state of the lock. This can be used to force lock or force unlock the opener. This will cause this opener to ignore the state of the lock (if specified) and only read the specified lock state.

Защищенные методы

Метод Описание
GetOpenerState ( SensorState sensState ) : OpenerState

Gets the state of the opener based on the specified sensor state.

Приватные методы

Метод Описание
OnLockStateChanged ( Object sender, SwitchStateChangeEventArgs e ) : void

Handles the lock state changed.

OnSensorStateChanged ( Object sender, SensorStateChangedEventArgs e ) : void

Handles the sensor state changed event.

Описание методов

Close() публичный Метод

Closes the opener.
/// The opener cannot be closed because it is locked. ///
public Close ( ) : void
Результат void

DisableOverride() публичный Метод

Disables the lock override. This will cause this opener to resume reading the actual state of the lock (if specified).
public DisableOverride ( ) : void
Результат void

Dispose() публичный Метод

Releases all resource used by the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice. The Dispose method leaves the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice was occupying.
public Dispose ( ) : void
Результат void

GetOpenerState() защищенный Метод

Gets the state of the opener based on the specified sensor state.
protected GetOpenerState ( SensorState sensState ) : OpenerState
sensState SensorState /// Sensor state. ///
Результат OpenerState

Open() публичный Метод

Opens the opener.
/// The opener cannot be opened because it is locked. ///
public Open ( ) : void
Результат void

OpenerDevice() публичный Метод

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, and the sensor state that indicates that the opener has opened.
public OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState ) : System
relay IRelay /// The relay that controls the opener. ///
sensor ISensor /// The reading the state of the opener. ///
openState SensorState /// The sensor state that indicates the opener has opened. ///
Результат System

OpenerDevice() публичный Метод

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.Access.OpenerDevice class with the relay, sensor, the sensor state that indicates that the opener has opened, and the switch that controls the lock.
public OpenerDevice ( IRelay relay, ISensor sensor, SensorState openState, ISwitch lok ) : System
relay IRelay /// The relay that controls the opener. ///
sensor ISensor /// The reading the state of the opener. ///
openState SensorState /// The sensor state that indicates the opener has opened. ///
lok ISwitch /// The switch that controls the lock. ///
Результат System

OverrideLock() публичный Метод

Manually overrides the state of the lock. This can be used to force lock or force unlock the opener. This will cause this opener to ignore the state of the lock (if specified) and only read the specified lock state.
public OverrideLock ( SwitchState overridedState ) : void
overridedState SwitchState
Результат void