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
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi

공개 메소드들

메소드 설명
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