IFilterWheelV3Class
- class FilterWheel
Bases:
ASCOM.DeviceInterfaceASCOM Standard IFilterWheel V3 Interface
Methods
- FilterWheel.Action(ActionName: str, ActionParameters)
Added in version 2: Recommended over (now) deprecated
CommandBlind(),CommandBool(), andCommandString()as more flexible extension mechanic.Invoke the specified device-specific custom action
- Parameters:
ActionName (str) – A name from
SupportedActionsthat represents the action to be carried out.ActionParameters (str) – List of required arguments or empty string if none are required.
- Returns:
Action response. The meaning of returned strings is set by the driver author. See notes below.
- Return type:
string
- Raises:
MethodNotImplementedException – If no actions at all are supported
ActionNotImplementedException – If the driver does not support the requested ActionName. The supported action names are listed in
SupportedActions.NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Important
Must be implemented but may throw
MethodNotImplementedExceptionif no custom actions are supported.This method, combined with
SupportedActions, is the supported mechanic for adding non-standard functionality.Note
Action names must be case insensitive, so for example SelectWheel, selectwheel and SELECTWHEEL all refer to the same action.
An example of a string response: Suppose filter wheels start to appear with automatic wheel changers; new actions could be QueryWheels and SelectWheel. The former returning a formatted list of wheel names and the second taking a wheel name and making the change, returning appropriate values to indicate success or failure.
- FilterWheel.CommandBlind(Command: str, Raw: bool)
Added in version 2: Member added as part of common interface elements.
Deprecated since version 3: Use the more flexible
Action()andSupportedActionsmechanic. See Notes below.Transmit an arbitrary string to the device and does not wait for a response.
- Parameters:
Command (str) – The literal command string to be transmitted.
Raw (bool) – If True, command is transmitted ‘as-is’. If False, then protocol framing characters may be added prior to transmission.
- Returns:
Nothing
- Raises:
MethodNotImplementedException – If the method is not implemented
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Deprecated, may result in
MethodNotImplementedExceptionNote
The CommandXXX methods are a historic mechanic that provides clients with direct and unimpeded access to change device hardware configuration. While highly enabling for clients, this mechanic is inherently risky because clients can fundamentally change hardware operation without the driver being aware that a change is taking / has taken place.
The newer
ActionandSupportedActionsmechanic provides discrete, named, functions that can deliver any functionality required.They do need driver authors to make provision for them within the driver, but this approach is much lower risk than using the CommandXXX methods because it enables the driver to resolve conflicts between standard device interface commands and extended commandsprovided as Actions.The driver is always aware of what is happening and can adapt more effectively to client needs.
- FilterWheel.CommandBool(Command: str, Raw: bool)
Added in version 2: Member added as part of common interface elements.
Deprecated since version 3: Use the more flexible
Action()andSupportedActionsmechanic. See Notes below.Transmit an arbitrary string to the device and wait for a boolean response.
- Parameters:
Command (str) – The literal command string to be transmitted.
Raw (bool) – If True, command is transmitted ‘as-is’. If False, then protocol framing characters may be added prior to transmission.
- Returns:
True/False response from the command
- Return type:
boolean
- Raises:
MethodNotImplementedException – If the method is not implemented
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Deprecated, may result in
MethodNotImplementedExceptionNote
The CommandXXX methods are a historic mechanic that provides clients with direct and unimpeded access to change device hardware configuration. While highly enabling for clients, this mechanic is inherently risky because clients can fundamentally change hardware operation without the driver being aware that a change is taking / has taken place.
The newer
ActionandSupportedActionsmechanic provides discrete, named, functions that can deliver any functionality required.They do need driver authors to make provision for them within the driver, but this approach is much lower risk than using the CommandXXX methods because it enables the driver to resolve conflicts between standard device interface commands and extended commandsprovided as Actions.The driver is always aware of what is happening and can adapt more effectively to client needs.
- FilterWheel.CommandString(Command: str, Raw: bool)
Added in version 2: Member added as part of common interface elements.
Deprecated since version 3: Use the more flexible
Action()andSupportedActionsmechanic. See Notes below.Transmit an arbitrary string to the device and wait for a string response.
- Parameters:
Command (str) – The literal command string to be transmitted.
Raw (bool) – If True, command is transmitted ‘as-is’. If False, then protocol framing characters may be added prior to transmission.
- Returns:
String response from the command
- Return type:
string
- Raises:
MethodNotImplementedException – If the method is not implemented
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Deprecated, may result in
MethodNotImplementedExceptionNote
The CommandXXX methods are a historic mechanic that provides clients with direct and unimpeded access to change device hardware configuration. While highly enabling for clients, this mechanic is inherently risky because clients can fundamentally change hardware operation without the driver being aware that a change is taking / has taken place.
The newer
ActionandSupportedActionsmechanic provides discrete, named, functions that can deliver any functionality required.They do need driver authors to make provision for them within the driver, but this approach is much lower risk than using the CommandXXX methods because it enables the driver to resolve conflicts between standard device interface commands and extended commandsprovided as Actions.The driver is always aware of what is happening and can adapt more effectively to client needs.
- async FilterWheel.Connect()
Added in version 3: Preferred asynchronous connection mechanic. See Important section below.
Connect to the device asynchronously. Use this to connect to a device rather than setting
Connectedto True.
- Returns:
Nothing
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Important
Non-Blocking. On return,
Connectingmust be True unless already connected. Connection has successfully completed whenConnectingbecomes (or is) False.This is a mandatory method and must not throw a
MethodNotConnectedException.Use this to connect to a device rather than setting
Connectedto True.
- async FilterWheel.Disconnect()
Added in version 3: Preferred asynchronous connection mechanic. See Important section below.
Disconnect from the device asynchronously. Use this to disconnect from a device rather than setting
Connectedto False.
- Returns:
Nothing
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Important
Non-Blocking. On return,
Connectingmust be True unless already disconnected. Disconnect has successfully completed whenConnectingbecomes (or is) False.This is a mandatory method and must not throw a
MethodNotImplementedException.Use this to disconnect from a device rather than setting
Connectedto False.
- FilterWheel.SetupDialog()
Launches a configuration dialogue box for the driver. The call will not return until the user clicks OK or cancels manually.
Please note that this method is only valid for COM drivers. Alpaca devices should provide configuration through the Alpaca HTML endpoints and should not implement a SetupDialog endpoint.
- Returns:
Nothing
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
Blocking It is permissible that the configuration dialog is modal, and for the driver not to respond to other calls while this dialog is open.
Properties
- property FilterWheel.Connected: boolean
Changed in version 3: Writing to change connection state superseded by asynchronous
Connect(),Disconnect(), andConnecting.(Read/Write) Retrieve or set the connected state of the device. Writing is deprecated, use the newer
Connect()andDisconnect()methods, and the newerConnectingproperty. See remarks below.Set True to connect to the device hardware. Set False to disconnect from the device hardware. You can also read the property to check whether it is connected. This reports the current hardware state. See Notes below.
- Returns:
True if connected to the hardware, else false.
- Return type:
boolean
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Deprecation Notice
Property-write is deprecated as of FilterWheel V3. Starting with Platform 7 and the interface revisions contained therein, writing to Connected is discouraged. To connect and disconnect, use the newer non-blocking
Connect()andDisconnect()methods, with the newConnectingproperty serving as the completion property.Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
Do not use a
NotConnectedExceptionhere, that exception is for use in other methods that require a connection in order to succeed.The Connected property sets and reports the state of connection to the device hardware. For a hub this means that Connected will be True when the first driver connects and will only be set to False when all drivers have disconnected. A second driver may find that Connected is already True and setting Connected to False does not report Connected as False. This is not an error because the physical state is that the hardware connection is still True.
Multiple calls setting Connected to True or False will not cause an error.
- property FilterWheel.Connecting: Boolean
Added in version 3: Preferred asynchronous connection mechanic. See Notes below.
- Returns:
Returns True while the device is undertaking an asynchronous connect or disconnect operation.
- Return type:
boolean
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This is the correct property for determing when the non-blocking methods
Connect()orDisconnect()have completed. Completion is whenConnectingbecomes False after calling either of these methods.New in IFilterWheelV3
- property FilterWheel.Description: String
Added in version 2: Member added
- Returns:
Description of the device such as manufacturer and model number. Any ASCII characters may be used.
- Return type:
string
- Raises:
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This describes the device, not the driver. See the
DriverInfoproperty for information on the ASCOM driver.The description length must be a maximum of 64 characters so that it can be used in FITS image headers, which are limited to 80 characters including the header name.
- property FilterWheel.DeviceState: List[StateValue]
Added in version 3: To allow reduction of status polling
- Returns:
List of
StateValueobjects representing the operational properties of this device. See What is the “read all” feature and what are its rules?.- Return type:
List
- This device must return the following operational properties if they are known:
PositionNote
For more info see What is the “read all” feature and what are its rules?.
Available only for the FilterWheel Interface Version 4 and later.
- property FilterWheel.DriverInfo: String
Added in version 2: Member added
- Returns:
Descriptive and version information about the ASCOM driver
- Return type:
string
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This string may contain line endings and may be hundreds to thousands of characters long.It is intended to display detailed information on the ASCOM driver, including version and copyright data. See the
Descriptionproperty for information on the device itself.To get the driver version in a parse-able string, use theDriverVersionproperty.
- property FilterWheel.DriverVersion: String
Added in version 2: Member added
- Returns:
String containing only the major and minor version of the driver.
- Return type:
string
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This must be in the form “n.n”. It should not to be confused with the
InterfaceVersionproperty, which is the version of this specification supported by the driver.On systems with a comma as the decimal point you may need to make accommodations to parse the value.
- property FilterWheel.FocusOffsets: Array of integers
Focus offset of each filter in the wheel
- Returns:
Integer focus offset values
- Return type:
Array
- Raises:
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
For each valid slot number (from 0 to N-1), reports the focus offset for the given filter position. These values are focuser and filter dependent, and would usually be set up by the user via the SetupDialog.
At least one filter must have an offset of zero so it may be used as the the reference for the offsets of the others.
The number of slots N can be determined from the length of the array.
If focuser offsets are not available, then
FocusOffsetsshould report zero for all filters.
- property FilterWheel.InterfaceVersion: Short
Added in version 2: Member added
- Returns:
ASCOM Device interface definition version that this device supports. Should return 3 for this interface version.
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This is a single “short” integer indicating the version of this specific ASCOM universal interface definition. For IFilterWheelV3, this must be 3. It should not to be confused with the
DriverVersionproperty, which is the major.minor version of the driver for this FilterWheel.Clients can detect legacy V1 drivers by trying to read this property. If the driver raises an error, it is a V1 driver. V1 did not specify this property. A driver may also return a value of 1.In other words, a raised error or a return value of 1 indicates that the driver is a V1 driver.
- property FilterWheel.Name: String
Added in version 2: Member added
- Returns:
The short name of the driver, for display purposes.
- Return type:
string
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
The
Descriptionproperty is used to return info about the device rather than the driver.
- property FilterWheel.Names: Array of strings
- Returns:
Array of the names of each filter in the wheel
- Return type:
Array
- Raises:
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
For each valid slot number (from 0 to N-1), reports the name of the given filter.
The number of slots N can be determined from the length of the array.
If names are not available, the list should contain “Filter 1”, “Filter 2”, … “FilterN”.
- property Filterwheel.Position: integer
(Read/Write) Start a change to, or return the filter wheel position (zero-based). Non-blocking: Returns immediately upon writing to change the filter with
Position= -1 if the operation has been successfully started. See Notes.
- Raises:
InvalidValueException – If an invalid filter number is written to Position.
NotConnectedException – If the device is not connected
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Returning a position of -1 is mandatory while the filter wheel is in motion; valid slot numbers must not be reported back while the filter wheel is rotating past filter positions.
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
Asynchronous (non-blocking): Writing to
Positionreturns as soon as the filter change operation has been successfully started.Positionmust return -1 while the change is in progress. After the requested position has been successfully reached and motion stops,Positionmust return the requested new filter number.Write a position number between 0 and N-1, where N is the number of filter slots (see
Names). Starts filter wheel rotation immediately when written. Reading the property must return current slot number (if wheel stationary) or -1 if wheel is moving.Exception Some filter wheels are built into the camera (one driver, two interfaces). Some cameras may not actually rotate the wheel until the exposure is triggered. In this case, the written value must be available immediately as the read value, and -1 is never returned.
- property FilterWheel.SupportedActions: COM: ArrayList of String elements, Alpaca: Array of String
Added in version 2: Recommended over (now) deprecated
CommandBlind(),CommandBool(), andCommandString()as more flexible extension mechanic.Returns the list of custom action names supported by this driver, to be used with
Action(),
- Returns:
The list of custom action names supported by this driver
- Return type:
COM: ArrayList of String elements, Alpaca: Array of String
- Raises:
DriverException – An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. Includes communication errors.
Attention
Must be implemented, must not throw a
PropertyNotImplementedExceptionNote
This method, combined with
Action(), is the supported mechanic for adding non-standard functionality.SupportedActions is a “discovery” mechanism that enables clients to know which Actions a device supports without having to exercise the Actions themselves. This mechanism is necessary because there could be people / equipment safety issues if actions are called unexpectedly or out of a defined process sequence. It follows from this that SupportedActions must return names that match the spelling of custom action names exactly, without additional descriptive text. However, returned names may use any casing because the
ActionNameparameter ofAction()is case insensitive.