Interface ISwitch
Defines the capabilities supported by an ASCOM Alpaca Switch device
Inherited Members
Namespace: ES.Ascom.Alpaca.Devices
Assembly: ES.Ascom.Alpaca.Shared.dll
Syntax
public interface ISwitch : IDevice
Methods
| Improve this Doc View SourceCanWrite(Int32)
Reports if the specified switch device can be written to, default true. This is false if the device cannot be written to, for example a limit switch or a sensor. Devices are numbered from 0 to MaxSwitch - 1
Declaration
bool CanWrite(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Boolean |
GetMaxSwitch()
Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1
Declaration
int GetMaxSwitch()
Returns
Type | Description |
---|---|
System.Int32 |
GetMaxSwitchValue(Int32)
Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Declaration
double GetMaxSwitchValue(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Double |
GetMinSwitchValue(Int32)
Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Declaration
double GetMinSwitchValue(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Double |
GetSwitch(Int32)
Return the state of switch device id as a boolean. Devices are numbered from 0 to MaxSwitch - 1
Declaration
bool GetSwitch(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Boolean |
GetSwitchDescription(Int32)
Gets the description of the specified switch device. This is to allow a fuller description of the device to be returned, for example for a tool tip. Devices are numbered from 0 to MaxSwitch - 1
Declaration
string GetSwitchDescription(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.String |
GetSwitchName(Int32)
Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1
Declaration
string GetSwitchName(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.String |
GetSwitchStep(Int32)
Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.
Declaration
double GetSwitchStep(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Double |
GetSwitchValue(Int32)
Gets the value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1, The value of this switch is expected to be between MinSwitchValue and MaxSwitchValue.
Declaration
double GetSwitchValue(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
Returns
Type | Description |
---|---|
System.Double |
SetSwitch(Int32, Boolean)
Sets a switch controller device to the specified state, true or false.
Declaration
void SetSwitch(int id, bool state)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.Boolean | state | The required control state (True or False) |
SetSwitchName(Int32, String)
Sets a switch device name to the specified value.
Declaration
void SetSwitchName(int id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.String | name | The name of the device |
SetSwitchValue(Int32, Double)
Sets a switch device value to the specified value.
Declaration
void SetSwitchValue(int id, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The device number (0 to MaxSwitch - 1) |
System.Double | value | The value to be set, between MinSwitchValue and MaxSwitchValue |