Advertisement
Guest User

IFocuserV2

a guest
Aug 25th, 2013
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 23.80 KB | None | 0 0
  1. #region Assembly ASCOM.DeviceInterfaces.dll, v2.0.50727
  2. #endregion
  3.  
  4. using System;
  5. using System.Collections;
  6. using System.Runtime.InteropServices;
  7.  
  8. namespace ASCOM.DeviceInterface
  9. {
  10.     // Summary:
  11.     //     Provides universal access to Focuser drivers
  12.     [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
  13.     [ComVisible(true)]
  14.     [Guid("E430C8A8-539E-4558-895D-A2F293D946E7")]
  15.     public interface IFocuserV2
  16.     {
  17.         // Summary:
  18.         //     True if the focuser is capable of absolute position; that is, being commanded
  19.         //     to a specific step location.
  20.         //
  21.         // Exceptions:
  22.         //   ASCOM.NotConnectedException:
  23.         //     If the driver must be connected in order to determine the property value.
  24.         //
  25.         //   ASCOM.DriverException:
  26.         //     Must throw an exception if the call was not successful
  27.         //
  28.         // Remarks:
  29.         //     Must be implemented
  30.         bool Absolute { get; }
  31.         //
  32.         // Summary:
  33.         //     Set True to connect to the device. Set False to disconnect from the device.
  34.         //      You can also read the property to check whether it is connected.
  35.         //
  36.         // Exceptions:
  37.         //   ASCOM.DriverException:
  38.         //     Must throw an exception if the call was not successful
  39.         //
  40.         // Remarks:
  41.         //     Must be implementedDo not use a NotConnectedException here, that exception
  42.         //     is for use in other methods that require a connection in order to succeed.
  43.         bool Connected { get; set; }
  44.         //
  45.         // Summary:
  46.         //     Returns a description of the device, such as manufacturer and modelnumber.
  47.         //     Any ASCII characters may be used.
  48.         //
  49.         // Exceptions:
  50.         //   ASCOM.NotConnectedException:
  51.         //     If the device is not connected and this information is only available when
  52.         //     connected.
  53.         //
  54.         //   ASCOM.DriverException:
  55.         //     Must throw an exception if the call was not successful
  56.         //
  57.         // Remarks:
  58.         //     Must be implemented
  59.         string Description { get; }
  60.         //
  61.         // Summary:
  62.         //     Descriptive and version information about this ASCOM driver.
  63.         //
  64.         // Exceptions:
  65.         //   ASCOM.DriverException:
  66.         //     Must throw an exception if the call was not successful
  67.         //
  68.         // Remarks:
  69.         //     Must be implemented This string may contain line endings and may be hundreds
  70.         //     to thousands of characters long.  It is intended to display detailed information
  71.         //     on the ASCOM driver, including version and copyright data.  See the ASCOM.DeviceInterface.IFocuserV2.Description
  72.         //     property for information on the device itself.  To get the driver version
  73.         //     in a parseable string, use the ASCOM.DeviceInterface.IFocuserV2.DriverVersion
  74.         //     property.
  75.         string DriverInfo { get; }
  76.         //
  77.         // Summary:
  78.         //     A string containing only the major and minor version of the driver.
  79.         //
  80.         // Exceptions:
  81.         //   ASCOM.DriverException:
  82.         //     Must throw an exception if the call was not successful
  83.         //
  84.         // Remarks:
  85.         //     Must be implemented This must be in the form "n.n".  It should not to be
  86.         //     confused with the ASCOM.DeviceInterface.IFocuserV2.InterfaceVersion property,
  87.         //     which is the version of this specification supported by the driver.
  88.         string DriverVersion { get; }
  89.         //
  90.         // Summary:
  91.         //     The interface version number that this device supports. Should return 2 for
  92.         //     this interface version.
  93.         //
  94.         // Exceptions:
  95.         //   ASCOM.DriverException:
  96.         //     Must throw an exception if the call was not successful
  97.         //
  98.         // Remarks:
  99.         //     Must be implemented Clients can detect legacy V1 drivers by trying to read
  100.         //     ths property.  If the driver raises an error, it is a V1 driver. V1 did not
  101.         //     specify this property. A driver may also return a value of 1. In other words,
  102.         //     a raised error or a return value of 1 indicates that the driver is a V1 driver.
  103.         short InterfaceVersion { get; }
  104.         //
  105.         // Summary:
  106.         //     True if the focuser is currently moving to a new position. False if the focuser
  107.         //     is stationary.
  108.         //
  109.         // Exceptions:
  110.         //   ASCOM.NotConnectedException:
  111.         //     If the driver is not connected.
  112.         //
  113.         //   ASCOM.DriverException:
  114.         //     Must throw an exception if the call was not successful
  115.         //
  116.         // Remarks:
  117.         //     Must be implemented
  118.         bool IsMoving { get; }
  119.         //
  120.         // Summary:
  121.         //     State of the connection to the focuser.
  122.         //
  123.         // Exceptions:
  124.         //   ASCOM.DriverException:
  125.         //     Must throw an exception if the call was not successful
  126.         //
  127.         // Remarks:
  128.         //     Must throw an exception if the call was not successful Must be implemented
  129.         //     Set True to start the connection to the focuser; set False to terminate the
  130.         //     connection. The current connection status can also be read back through this
  131.         //     property. An exception will be raised if the link fails to change state for
  132.         //     any reason.
  133.         //     Note
  134.         //     The FocuserV1 interface was the only interface to name its "Connect" method
  135.         //     "Link" all others named their "Connect" method as "Connected". All interfaces
  136.         //     including Focuser now have a ASCOM.DeviceInterface.IFocuserV2.Connected method
  137.         //     and this is the recommended method to use to "Connect" to Focusers exposing
  138.         //     the V2 and later interfaces.
  139.         //     Do not use a NotConnectedException here, that exception is for use in other
  140.         //     methods that require a connection in order to succeed.
  141.         bool Link { get; set; }
  142.         //
  143.         // Summary:
  144.         //     Maximum increment size allowed by the focuser; i.e. the maximum number of
  145.         //     steps allowed in one move operation.
  146.         //
  147.         // Exceptions:
  148.         //   ASCOM.NotConnectedException:
  149.         //     If the device is not connected and this information is only available when
  150.         //     connected.
  151.         //
  152.         //   ASCOM.DriverException:
  153.         //     Must throw an exception if the call was not successful
  154.         //
  155.         // Remarks:
  156.         //     Must be implemented For most focusers this is the same as the ASCOM.DeviceInterface.IFocuserV2.MaxStep
  157.         //     property. This is normally used to limit the Increment display in the host
  158.         //     software.
  159.         int MaxIncrement { get; }
  160.         //
  161.         // Summary:
  162.         //     Maximum step position permitted.
  163.         //
  164.         // Exceptions:
  165.         //   ASCOM.NotConnectedException:
  166.         //     If the device is not connected and this information is only available when
  167.         //     connected.
  168.         //
  169.         //   ASCOM.DriverException:
  170.         //     Must throw an exception if the call was not successful
  171.         //
  172.         // Remarks:
  173.         //     Must be implemented The focuser can step between 0 and ASCOM.DeviceInterface.IFocuserV2.MaxStep.
  174.         //     If an attempt is made to move the focuser beyond these limits, it will automatically
  175.         //     stop at the limit.
  176.         int MaxStep { get; }
  177.         //
  178.         // Summary:
  179.         //     The short name of the driver, for display purposes
  180.         //
  181.         // Exceptions:
  182.         //   ASCOM.DriverException:
  183.         //     Must throw an exception if the call was not successful
  184.         //
  185.         // Remarks:
  186.         //     Must be implemented
  187.         string Name { get; }
  188.         //
  189.         // Summary:
  190.         //     Current focuser position, in steps.
  191.         //
  192.         // Exceptions:
  193.         //   ASCOM.PropertyNotImplementedException:
  194.         //     If the property is not available for this device.
  195.         //
  196.         //   ASCOM.NotConnectedException:
  197.         //     If the device is not connected and this information is only available when
  198.         //     connected.
  199.         //
  200.         //   ASCOM.DriverException:
  201.         //     Must throw an exception if the call was not successful
  202.         //
  203.         // Remarks:
  204.         //     Can throw a not implemented exception Valid only for absolute positioning
  205.         //     focusers (see the ASCOM.DeviceInterface.IFocuserV2.Absolute property).  A
  206.         //     ASCOM.PropertyNotImplementedException exception must be thrown if this device
  207.         //     is a relative positioning focuser rather than an absolute position focuser.
  208.         int Position { get; }
  209.         //
  210.         // Summary:
  211.         //     Step size (microns) for the focuser.
  212.         //
  213.         // Exceptions:
  214.         //   ASCOM.PropertyNotImplementedException:
  215.         //     If the focuser does not intrinsically know what the step size is.
  216.         //
  217.         //   ASCOM.NotConnectedException:
  218.         //     If the device is not connected and this information is only available when
  219.         //     connected.
  220.         //
  221.         //   ASCOM.DriverException:
  222.         //     Must throw an exception if the call was not successful
  223.         //
  224.         // Remarks:
  225.         //     Can throw a not implemented exception Must throw an exception if the focuser
  226.         //     does not intrinsically know what the step size is.
  227.         double StepSize { get; }
  228.         //
  229.         // Summary:
  230.         //     Returns the list of action names supported by this driver.
  231.         //
  232.         // Exceptions:
  233.         //   ASCOM.DriverException:
  234.         //     Must throw an exception if the call was not successful
  235.         //
  236.         // Remarks:
  237.         //     Must be implemented This method must return an empty arraylist if no actions
  238.         //     are supported. Please do not throw a ASCOM.PropertyNotImplementedException.
  239.         //     This is an aid to client authors and testers who would otherwise have to
  240.         //     repeatedly poll the driver to determine its capabilities. Returned action
  241.         //     names may be in mixed case to enhance presentation but will be recognised
  242.         //     case insensitively in the ASCOM.DeviceInterface.IFocuserV2.Action(System.String,System.String)
  243.         //     method.
  244.         //     An array list collection has been selected as the vehicle for action names
  245.         //     in order to make it easier for clients to determine whether a particular
  246.         //     action is supported. This is easily done through the Contains method. Since
  247.         //     the collection is also ennumerable it is easy to use constructs such as For
  248.         //     Each ... to operate on members without having to be concerned about hom many
  249.         //     members are in the collection.
  250.         //     Collections have been used in the Telescope specification for a number of
  251.         //     years and are known to be compatible with COM. Within .NET the ArrayList
  252.         //     is the correct implementation to use as the .NET Generic methods are not
  253.         //     compatible with COM.
  254.         ArrayList SupportedActions { get; }
  255.         //
  256.         // Summary:
  257.         //     The state of temperature compensation mode (if available), else always False.
  258.         //
  259.         // Exceptions:
  260.         //   ASCOM.PropertyNotImplementedException:
  261.         //     If ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable is False and an attempt
  262.         //     is made to set ASCOM.DeviceInterface.IFocuserV2.TempComp to true.
  263.         //
  264.         //   ASCOM.NotConnectedException:
  265.         //     If the device is not connected and this information is only available when
  266.         //     connected.
  267.         //
  268.         //   ASCOM.DriverException:
  269.         //     Must throw an exception if the call was not successful
  270.         //
  271.         // Remarks:
  272.         //     Can throw a not implemented exception If the ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable
  273.         //     property is True, then setting ASCOM.DeviceInterface.IFocuserV2.TempComp
  274.         //     to True puts the focuser into temperature tracking mode. While in temperature
  275.         //     tracking mode, ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) commands
  276.         //     will be rejected by the focuser. Set to False to turn off temperature tracking.
  277.         //     If temperature compensation is not available, this property must always return
  278.         //     False.
  279.         //     A ASCOM.PropertyNotImplementedException exception must be thrown if ASCOM.DeviceInterface.IFocuserV2.TempCompAvailable
  280.         //     is False and an attempt is made to set ASCOM.DeviceInterface.IFocuserV2.TempComp
  281.         //     to true.
  282.         bool TempComp { get; set; }
  283.         //
  284.         // Summary:
  285.         //     True if focuser has temperature compensation available.
  286.         //
  287.         // Exceptions:
  288.         //   ASCOM.NotConnectedException:
  289.         //     If the device is not connected and this information is only available when
  290.         //     connected.
  291.         //
  292.         //   ASCOM.DriverException:
  293.         //     Must throw an exception if the call was not successful
  294.         //
  295.         // Remarks:
  296.         //     Must be implemented Will be True only if the focuser's temperature compensation
  297.         //     can be turned on and off via the ASCOM.DeviceInterface.IFocuserV2.TempComp
  298.         //     property.
  299.         bool TempCompAvailable { get; }
  300.         //
  301.         // Summary:
  302.         //     Current ambient temperature as measured by the focuser.
  303.         //
  304.         // Exceptions:
  305.         //   ASCOM.PropertyNotImplementedException:
  306.         //     If the property is not available for this device.
  307.         //
  308.         //   ASCOM.NotConnectedException:
  309.         //     If the device is not connected and this information is only available when
  310.         //     connected.
  311.         //
  312.         //   ASCOM.DriverException:
  313.         //     Must throw an exception if the call was not successful
  314.         //
  315.         // Remarks:
  316.         //     Can throw a not implemented exception Raises an exception if ambient temperature
  317.         //     is not available. Commonly available on focusers with a built-in temperature
  318.         //     compensation mode.
  319.         double Temperature { get; }
  320.  
  321.         // Summary:
  322.         //     Invokes the specified device-specific action.
  323.         //
  324.         // Parameters:
  325.         //   ActionName:
  326.         //     A well known name agreed by interested parties that represents the action
  327.         //     to be carried out.
  328.         //
  329.         //   ActionParameters:
  330.         //     List of required parameters or an System.String if none are required.
  331.         //
  332.         // Returns:
  333.         //     A string response. The meaning of returned strings is set by the driver author.
  334.         //
  335.         // Exceptions:
  336.         //   ASCOM.MethodNotImplementedException:
  337.         //     Throws this exception if no actions are suported.
  338.         //
  339.         //   ASCOM.ActionNotImplementedException:
  340.         //     It is intended that the SupportedActions method will inform clients of driver
  341.         //     capabilities, but the driver must still throw an ASCOM.ActionNotImplemented
  342.         //     exception if it is asked to perform an action that it does not support.
  343.         //
  344.         //   ASCOM.NotConnectedException:
  345.         //     If the driver is not connected.
  346.         //
  347.         //   ASCOM.DriverException:
  348.         //     Must throw an exception if the call was not successful
  349.         //
  350.         // Remarks:
  351.         //     Can throw a not implemented exception This method is intended for use in
  352.         //     all current and future device types and to avoid name clashes, management
  353.         //     of action names is important from day 1. A two-part naming convention will
  354.         //     be adopted - DeviceType:UniqueActionName where: DeviceType is the same value
  355.         //     as would be used by ASCOM.Utilities.Chooser.DeviceType e.g. Telescope, Camera,
  356.         //     Switch etc.  UniqueActionName is a single word, or multiple words joined
  357.         //     by underscore characters, that sensibly describes the action to be performed.
  358.         //     It is recommended that UniqueActionNames should be a maximum of 16 characters
  359.         //     for legibility.  Should the same function and UniqueActionName be supported
  360.         //     by more than one type of device, the reserved DeviceType of โ€œGeneralโ€ will
  361.         //     be used. Action names will be case insensitive, so FilterWheel:SelectWheel,
  362.         //     filterwheel:selectwheel and FILTERWHEEL:SELECTWHEEL will all refer to the
  363.         //     same action.
  364.         //     The names of all supported actions must bre returned in the ASCOM.DeviceInterface.IFocuserV2.SupportedActions
  365.         //     property.
  366.         string Action(string ActionName, string ActionParameters);
  367.         //
  368.         // Summary:
  369.         //     Transmits an arbitrary string to the device and does not wait for a response.
  370.         //      Optionally, protocol framing characters may be added to the string before
  371.         //     transmission.
  372.         //
  373.         // Parameters:
  374.         //   Command:
  375.         //     The literal command string to be transmitted.
  376.         //
  377.         //   Raw:
  378.         //     if set to true the string is transmitted 'as-is'.  If set to false then protocol
  379.         //     framing characters may be added prior to transmission.
  380.         //
  381.         // Exceptions:
  382.         //   ASCOM.MethodNotImplementedException:
  383.         //     If the method is not implemented
  384.         //
  385.         //   ASCOM.NotConnectedException:
  386.         //     If the driver is not connected.
  387.         //
  388.         //   ASCOM.DriverException:
  389.         //     Must throw an exception if the call was not successful
  390.         //
  391.         // Remarks:
  392.         //     Can throw a not implemented exception
  393.         void CommandBlind(string Command, bool Raw = false);
  394.         //
  395.         // Summary:
  396.         //     Transmits an arbitrary string to the device and waits for a boolean response.
  397.         //      Optionally, protocol framing characters may be added to the string before
  398.         //     transmission.
  399.         //
  400.         // Parameters:
  401.         //   Command:
  402.         //     The literal command string to be transmitted.
  403.         //
  404.         //   Raw:
  405.         //     if set to true the string is transmitted 'as-is'.  If set to false then protocol
  406.         //     framing characters may be added prior to transmission.
  407.         //
  408.         // Returns:
  409.         //     Returns the interpreted boolean response received from the device.
  410.         //
  411.         // Exceptions:
  412.         //   ASCOM.MethodNotImplementedException:
  413.         //     If the method is not implemented
  414.         //
  415.         //   ASCOM.NotConnectedException:
  416.         //     If the driver is not connected.
  417.         //
  418.         //   ASCOM.DriverException:
  419.         //     Must throw an exception if the call was not successful
  420.         //
  421.         // Remarks:
  422.         //     Can throw a not implemented exception
  423.         bool CommandBool(string Command, bool Raw = false);
  424.         //
  425.         // Summary:
  426.         //     Transmits an arbitrary string to the device and waits for a string response.
  427.         //      Optionally, protocol framing characters may be added to the string before
  428.         //     transmission.
  429.         //
  430.         // Parameters:
  431.         //   Command:
  432.         //     The literal command string to be transmitted.
  433.         //
  434.         //   Raw:
  435.         //     if set to true the string is transmitted 'as-is'.  If set to false then protocol
  436.         //     framing characters may be added prior to transmission.
  437.         //
  438.         // Returns:
  439.         //     Returns the string response received from the device.
  440.         //
  441.         // Exceptions:
  442.         //   ASCOM.MethodNotImplementedException:
  443.         //     If the method is not implemented
  444.         //
  445.         //   ASCOM.NotConnectedException:
  446.         //     If the driver is not connected.
  447.         //
  448.         //   ASCOM.DriverException:
  449.         //     Must throw an exception if the call was not successful
  450.         //
  451.         // Remarks:
  452.         //     Can throw a not implemented exception
  453.         string CommandString(string Command, bool Raw = false);
  454.         //
  455.         // Summary:
  456.         //     Dispose the late-bound interface, if needed. Will release it via COM if it
  457.         //     is a COM object, else if native .NET will just dereference it for GC.
  458.         void Dispose();
  459.         //
  460.         // Summary:
  461.         //     Immediately stop any focuser motion due to a previous ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
  462.         //     method call.
  463.         //
  464.         // Exceptions:
  465.         //   ASCOM.MethodNotImplementedException:
  466.         //     Focuser does not support this method.
  467.         //
  468.         //   ASCOM.NotConnectedException:
  469.         //     If the driver is not connected.
  470.         //
  471.         //   ASCOM.DriverException:
  472.         //     Must throw an exception if the call was not successful
  473.         //
  474.         // Remarks:
  475.         //     Can throw a not implemented exceptionSome focusers may not support this function,
  476.         //     in which case an exception will be raised.
  477.         //     Recommendation: Host software should call this method upon initialization
  478.         //     and, if it fails, disable the Halt button in the user interface.
  479.         void Halt();
  480.         //
  481.         // Summary:
  482.         //     Moves the focuser by the specified amount or to the specified position depending
  483.         //     on the value of the ASCOM.DeviceInterface.IFocuserV2.Absolute property.
  484.         //
  485.         // Parameters:
  486.         //   Position:
  487.         //     Step distance or absolute position, depending on the value of the ASCOM.DeviceInterface.IFocuserV2.Absolute
  488.         //     property.
  489.         //
  490.         // Exceptions:
  491.         //   ASCOM.InvalidOperationException:
  492.         //     If a Move operation is requested when ASCOM.DeviceInterface.IFocuserV2.TempComp
  493.         //     is True
  494.         //
  495.         //   ASCOM.NotConnectedException:
  496.         //     If the device is not connected.
  497.         //
  498.         //   ASCOM.DriverException:
  499.         //     Must throw an exception if the call was not successful
  500.         //
  501.         // Remarks:
  502.         //     Must be implemented If the ASCOM.DeviceInterface.IFocuserV2.Absolute property
  503.         //     is True, then this is an absolute positioning focuser. The ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
  504.         //     command tells the focuser to move to an exact step position, and the Position
  505.         //     parameter of the ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) method
  506.         //     is an integer between 0 and ASCOM.DeviceInterface.IFocuserV2.MaxStep.
  507.         //     If the ASCOM.DeviceInterface.IFocuserV2.Absolute property is False, then
  508.         //     this is a relative positioning focuser. The ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32)
  509.         //     command tells the focuser to move in a relative direction, and the Position
  510.         //     parameter of the ASCOM.DeviceInterface.IFocuserV2.Move(System.Int32) method
  511.         //     (in this case, step distance) is an integer between minus ASCOM.DeviceInterface.IFocuserV2.MaxIncrement
  512.         //     and plus ASCOM.DeviceInterface.IFocuserV2.MaxIncrement.
  513.         void Move(int Position);
  514.         //
  515.         // Summary:
  516.         //     Launches a configuration dialog box for the driver. The call will not return
  517.         //     until the user clicks OK or cancel manually.
  518.         //
  519.         // Exceptions:
  520.         //   ASCOM.DriverException:
  521.         //     Must throw an exception if the call was not successful
  522.         //
  523.         // Remarks:
  524.         //     Must be implemented
  525.         void SetupDialog();
  526.     }
  527. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement