Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Assembly ASCOM.DeviceInterfaces.dll, v2.0.50727
- #endregion
- using System;
- using System.Collections;
- using System.Runtime.InteropServices;
- namespace ASCOM.DeviceInterface
- {
- // Summary:
- // Provides universal access to Focuser drivers
- [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
- [ComVisible(true)]
- [Guid("E430C8A8-539E-4558-895D-A2F293D946E7")]
- public interface IFocuserV2
- {
- // Summary:
- // True if the focuser is capable of absolute position; that is, being commanded
- // to a specific step location.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the driver must be connected in order to determine the property value.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented
- bool Absolute { get; }
- //
- // Summary:
- // Set True to connect to the device. Set False to disconnect from the device.
- // You can also read the property to check whether it is connected.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implementedDo not use a NotConnectedException here, that exception
- // is for use in other methods that require a connection in order to succeed.
- bool Connected { get; set; }
- //
- // Summary:
- // Returns a description of the device, such as manufacturer and modelnumber.
- // Any ASCII characters may be used.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented
- string Description { get; }
- //
- // Summary:
- // Descriptive and version information about this ASCOM driver.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented 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 ASCOM.DeviceInterface.IFocuserV2.Description
- // property for information on the device itself. To get the driver version
- // in a parseable string, use the ASCOM.DeviceInterface.IFocuserV2.DriverVersion
- // property.
- string DriverInfo { get; }
- //
- // Summary:
- // A string containing only the major and minor version of the driver.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented This must be in the form "n.n". It should not to be
- // confused with the ASCOM.DeviceInterface.IFocuserV2.InterfaceVersion property,
- // which is the version of this specification supported by the driver.
- string DriverVersion { get; }
- //
- // Summary:
- // The interface version number that this device supports. Should return 2 for
- // this interface version.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented Clients can detect legacy V1 drivers by trying to read
- // ths 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.
- short InterfaceVersion { get; }
- //
- // Summary:
- // True if the focuser is currently moving to a new position. False if the focuser
- // is stationary.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented
- bool IsMoving { get; }
- //
- // Summary:
- // State of the connection to the focuser.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must throw an exception if the call was not successful Must be implemented
- // Set True to start the connection to the focuser; set False to terminate the
- // connection. The current connection status can also be read back through this
- // property. An exception will be raised if the link fails to change state for
- // any reason.
- // Note
- // The FocuserV1 interface was the only interface to name its "Connect" method
- // "Link" all others named their "Connect" method as "Connected". All interfaces
- // including Focuser now have a ASCOM.DeviceInterface.IFocuserV2.Connected method
- // and this is the recommended method to use to "Connect" to Focusers exposing
- // the V2 and later interfaces.
- // Do not use a NotConnectedException here, that exception is for use in other
- // methods that require a connection in order to succeed.
- bool Link { get; set; }
- //
- // Summary:
- // Maximum increment size allowed by the focuser; i.e. the maximum number of
- // steps allowed in one move operation.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented For most focusers this is the same as the ASCOM.DeviceInterface.IFocuserV2.MaxStep
- // property. This is normally used to limit the Increment display in the host
- // software.
- int MaxIncrement { get; }
- //
- // Summary:
- // Maximum step position permitted.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented The focuser can step between 0 and ASCOM.DeviceInterface.IFocuserV2.MaxStep.
- // If an attempt is made to move the focuser beyond these limits, it will automatically
- // stop at the limit.
- int MaxStep { get; }
- //
- // Summary:
- // The short name of the driver, for display purposes
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented
- string Name { get; }
- //
- // Summary:
- // Current focuser position, in steps.
- //
- // Exceptions:
- // ASCOM.PropertyNotImplementedException:
- // If the property is not available for this device.
- //
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception Valid only for absolute positioning
- // focusers (see the ASCOM.DeviceInterface.IFocuserV2.Absolute property). A
- // ASCOM.PropertyNotImplementedException exception must be thrown if this device
- // is a relative positioning focuser rather than an absolute position focuser.
- int Position { get; }
- //
- // Summary:
- // Step size (microns) for the focuser.
- //
- // Exceptions:
- // ASCOM.PropertyNotImplementedException:
- // If the focuser does not intrinsically know what the step size is.
- //
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception Must throw an exception if the focuser
- // does not intrinsically know what the step size is.
- double StepSize { get; }
- //
- // Summary:
- // Returns the list of action names supported by this driver.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented This method must return an empty arraylist if no actions
- // are supported. Please do not throw a ASCOM.PropertyNotImplementedException.
- // This is an aid to client authors and testers who would otherwise have to
- // repeatedly poll the driver to determine its capabilities. Returned action
- // names may be in mixed case to enhance presentation but will be recognised
- // case insensitively in the ASCOM.DeviceInterface.IFocuserV2.Action(System.String,System.String)
- // method.
- // An array list collection has been selected as the vehicle for action names
- // in order to make it easier for clients to determine whether a particular
- // action is supported. This is easily done through the Contains method. Since
- // the collection is also ennumerable it is easy to use constructs such as For
- // Each ... to operate on members without having to be concerned about hom many
- // members are in the collection.
- // Collections have been used in the Telescope specification for a number of
- // years and are known to be compatible with COM. Within .NET the ArrayList
- // is the correct implementation to use as the .NET Generic methods are not
- // compatible with COM.
- ArrayList SupportedActions { get; }
- //
- // Summary:
- // The state of temperature compensation mode (if available), else always False.
- //
- // Exceptions:
- // ASCOM.PropertyNotImplementedException:
- // If ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable is False and an attempt
- // is made to set ASCOM.DeviceInterface.IFocuserV2.TempComp to true.
- //
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception If the ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable
- // property is True, then setting ASCOM.DeviceInterface.IFocuserV2.TempComp
- // to True puts the focuser into temperature tracking mode. While in temperature
- // tracking mode, ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) commands
- // will be rejected by the focuser. Set to False to turn off temperature tracking.
- // If temperature compensation is not available, this property must always return
- // False.
- // A ASCOM.PropertyNotImplementedException exception must be thrown if ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable
- // is False and an attempt is made to set ASCOM.DeviceInterface.IFocuserV2.TempComp
- // to true.
- bool TempComp { get; set; }
- //
- // Summary:
- // True if focuser has temperature compensation available.
- //
- // Exceptions:
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented Will be True only if the focuser's temperature compensation
- // can be turned on and off via the ASCOM.DeviceInterface.IFocuserV2.TempComp
- // property.
- bool TempCompAvailable { get; }
- //
- // Summary:
- // Current ambient temperature as measured by the focuser.
- //
- // Exceptions:
- // ASCOM.PropertyNotImplementedException:
- // If the property is not available for this device.
- //
- // ASCOM.NotConnectedException:
- // If the device is not connected and this information is only available when
- // connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception Raises an exception if ambient temperature
- // is not available. Commonly available on focusers with a built-in temperature
- // compensation mode.
- double Temperature { get; }
- // Summary:
- // Invokes the specified device-specific action.
- //
- // Parameters:
- // ActionName:
- // A well known name agreed by interested parties that represents the action
- // to be carried out.
- //
- // ActionParameters:
- // List of required parameters or an System.String if none are required.
- //
- // Returns:
- // A string response. The meaning of returned strings is set by the driver author.
- //
- // Exceptions:
- // ASCOM.MethodNotImplementedException:
- // Throws this exception if no actions are suported.
- //
- // ASCOM.ActionNotImplementedException:
- // It is intended that the SupportedActions method will inform clients of driver
- // capabilities, but the driver must still throw an ASCOM.ActionNotImplemented
- // exception if it is asked to perform an action that it does not support.
- //
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception This method is intended for use in
- // all current and future device types and to avoid name clashes, management
- // of action names is important from day 1. A two-part naming convention will
- // be adopted - DeviceType:UniqueActionName where: DeviceType is the same value
- // as would be used by ASCOM.Utilities.Chooser.DeviceType e.g. Telescope, Camera,
- // Switch etc. UniqueActionName is a single word, or multiple words joined
- // by underscore characters, that sensibly describes the action to be performed.
- // It is recommended that UniqueActionNames should be a maximum of 16 characters
- // for legibility. Should the same function and UniqueActionName be supported
- // by more than one type of device, the reserved DeviceType of โGeneralโ will
- // be used. Action names will be case insensitive, so FilterWheel:SelectWheel,
- // filterwheel:selectwheel and FILTERWHEEL:SELECTWHEEL will all refer to the
- // same action.
- // The names of all supported actions must bre returned in the ASCOM.DeviceInterface.IFocuserV2.SupportedActions
- // property.
- string Action(string ActionName, string ActionParameters);
- //
- // Summary:
- // Transmits an arbitrary string to the device and does not wait for a response.
- // Optionally, protocol framing characters may be added to the string before
- // transmission.
- //
- // Parameters:
- // Command:
- // The literal command string to be transmitted.
- //
- // Raw:
- // if set to true the string is transmitted 'as-is'. If set to false then protocol
- // framing characters may be added prior to transmission.
- //
- // Exceptions:
- // ASCOM.MethodNotImplementedException:
- // If the method is not implemented
- //
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception
- void CommandBlind(string Command, bool Raw = false);
- //
- // Summary:
- // Transmits an arbitrary string to the device and waits for a boolean response.
- // Optionally, protocol framing characters may be added to the string before
- // transmission.
- //
- // Parameters:
- // Command:
- // The literal command string to be transmitted.
- //
- // Raw:
- // if set to true the string is transmitted 'as-is'. If set to false then protocol
- // framing characters may be added prior to transmission.
- //
- // Returns:
- // Returns the interpreted boolean response received from the device.
- //
- // Exceptions:
- // ASCOM.MethodNotImplementedException:
- // If the method is not implemented
- //
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception
- bool CommandBool(string Command, bool Raw = false);
- //
- // Summary:
- // Transmits an arbitrary string to the device and waits for a string response.
- // Optionally, protocol framing characters may be added to the string before
- // transmission.
- //
- // Parameters:
- // Command:
- // The literal command string to be transmitted.
- //
- // Raw:
- // if set to true the string is transmitted 'as-is'. If set to false then protocol
- // framing characters may be added prior to transmission.
- //
- // Returns:
- // Returns the string response received from the device.
- //
- // Exceptions:
- // ASCOM.MethodNotImplementedException:
- // If the method is not implemented
- //
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exception
- string CommandString(string Command, bool Raw = false);
- //
- // Summary:
- // Dispose the late-bound interface, if needed. Will release it via COM if it
- // is a COM object, else if native .NET will just dereference it for GC.
- void Dispose();
- //
- // Summary:
- // Immediately stop any focuser motion due to a previous ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
- // method call.
- //
- // Exceptions:
- // ASCOM.MethodNotImplementedException:
- // Focuser does not support this method.
- //
- // ASCOM.NotConnectedException:
- // If the driver is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Can throw a not implemented exceptionSome focusers may not support this function,
- // in which case an exception will be raised.
- // Recommendation: Host software should call this method upon initialization
- // and, if it fails, disable the Halt button in the user interface.
- void Halt();
- //
- // Summary:
- // Moves the focuser by the specified amount or to the specified position depending
- // on the value of the ASCOM.DeviceInterface.IFocuserV2.Absolute property.
- //
- // Parameters:
- // Position:
- // Step distance or absolute position, depending on the value of the ASCOM.DeviceInterface.IFocuserV2.Absolute
- // property.
- //
- // Exceptions:
- // ASCOM.InvalidOperationException:
- // If a Move operation is requested when ASCOM.DeviceInterface.IFocuserV2.TempComp
- // is True
- //
- // ASCOM.NotConnectedException:
- // If the device is not connected.
- //
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented If the ASCOM.DeviceInterface.IFocuserV2.Absolute property
- // is True, then this is an absolute positioning focuser. The ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
- // command tells the focuser to move to an exact step position, and the Position
- // parameter of the ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) method
- // is an integer between 0 and ASCOM.DeviceInterface.IFocuserV2.MaxStep.
- // If the ASCOM.DeviceInterface.IFocuserV2.Absolute property is False, then
- // this is a relative positioning focuser. The ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
- // command tells the focuser to move in a relative direction, and the Position
- // parameter of the ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) method
- // (in this case, step distance) is an integer between minus ASCOM.DeviceInterface.IFocuserV2.MaxIncrement
- // and plus ASCOM.DeviceInterface.IFocuserV2.MaxIncrement.
- void Move(int Position);
- //
- // Summary:
- // Launches a configuration dialog box for the driver. The call will not return
- // until the user clicks OK or cancel manually.
- //
- // Exceptions:
- // ASCOM.DriverException:
- // Must throw an exception if the call was not successful
- //
- // Remarks:
- // Must be implemented
- void SetupDialog();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement