Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Makefile was generated with the previous command, but the following entries need to be modified / added:

Code Block
titleMakefile
collapsetrue
#
# Generate ACS Error System classes
#
ACSERRDEF := SystemErr

# 
# IDL Files and flags
# 
IDL_FILES = Types Console DataBase Instrument Scheduler Telescope TelescopeControl Camera Storage
IDL_TAO_FLAGS = 
USER_IDL =

TypesStubs_LIBS = acscomponentStubs
ConsoleStubs_LIBS = acscomponentStubs SYSTEMErrStubs TypesStubs
DataBaseStubs_LIBS = acscomponentStubs SYSTEMErrStubs TypesStubs
InstrumentStubs_LIBS = acscomponentStubs SYSTEMErrStubs TypesStubs
SchedulerStubs_LIBS = acscomponentStubs SYSTEMErrStubs
TelescopeStubs_LIBS = acscomponentStubs SYSTEMErrStubs TypesStubs
TelescopeControlStubs_LIBS = baciStubs acscomponentStubs SYSTEMErrStubs TypesStubs
CameraStubs_LIBS = baciStubs acscomponentStubs SYSTEMErrStubs TypesStubs
StorageStubs_LIBS = acscomponent TypesStubs

...

Code Block
languagecpp
titleTelescopeControl.idl
linenumberstrue
collapsetrue
#ifndef _H3E_IDL_
#define _H3E_IDL_

#include <baci.idl>

#pragma prefix "acsws"

module TELESCOPE_MODULE {

   /** @interface TelescopeControl
    * Defines the interface for controlling and monitoring a simple
    * telescope. This model considers a "quantum" of movement defined by
    * the calibration process for the discrete rotation sensors. The telescope
    * can't be operated until the calibration is done. A "calibrated" status bit
    * is kept, thus the commanded position is not going to be followed if this bit
    * is not set. This IDL was thinked for H3E project and for a lego model, but is used for
    * a more general purpose.
    * Please refer to <a href="https://csrg.inf.utfsm.cl/twiki4/bin/view/ACS/HardwareEndToEndExample">
    * CSRG H3E project Twiki site</a> for more information.
    */
   interface TelescopeControl : ACS::CharacteristicComponent {

      /**
       * Asynchronously sets the telescope to the specified position.
       * If the "calibrated" status bit is set, this method returns when the telescope
       * is at the commanded position, accepting an error defined by the calibration of
       * the rotation sensors for each axis. If not, the telescope is not going to move
       * and this method returns immediately.
       * 
       * @param altitude        desired telescope's altitude (degrees)
       * @param azimut          desired telescope's azimut   (degrees)
       */
       void setTo (in double altitude, in double azimuth);


      /**
       * Asynchronously moves away the telescope, starting from actual position.
       * If the "calibrated" status bit is set, this method returns when the telescope is
       * positioned at the actual position plus the indicated values for each axis. If not,
       * the telescope does not move and this method returns immediately.
       * The indicated altitude and azimut offsets must be bigger than the minimal altitude
       * and azimut steps, defined by the calibration process, or the telescope is not going
       * to move.
       * 
       * @param altOffset    desired altitude offset (degrees)
       * @param azOffset     desired azimut offset (degrees)
       */
      void offSet (in double altOffset, in double azOffset);


      /**
       * Moves the telescope to zenith position. It is the same that a "setTo(90,0)" call.
       */
      void zenith ();


      /**
       * Moves the telescope to parking position (implemmentation-dependant).
       */
      void park ();


      /**
       * Unsets the "calibrated" status bit. It is necessary to manually move the
       * telescope (e.g. when it needs to be calibrated).
       */
      void setUncalibrated   ();


      /**
       * Starts the calibration procedure for the conversion from motor rotation
       * to arc degrees. This procedure requires the telescope to be at zenith
       * position due to lack of touch sensors on the Lego MindStorms kit. Don't
       * forget to unset the "calibration" status bit when manually moving the telescope
       * or it is going to try to return to the last commanded position.
       */
      void calibrateEncoders  ();


      /** Indicates the last commanded telescope's altitude.
       */
      readonly attribute ACS::RWdouble commandedAltitude;   // devio, LegoCmdAltDevIO, CORBA::Double

      /** Indicates the last commanded telescope's azimut.
       */
      readonly attribute ACS::RWdouble commandedAzimuth;   // devio, LegoCmdAzDevIO, CORBA::Double

      /** Indicates the actual telescope's altitude.
       */
      readonly attribute ACS::ROdouble actualAltitude;   // devio, LegoAltDevIO, CORBA::Double

      /** Indicates the actual telescope's azimut.
       */
      readonly attribute ACS::ROdouble actualAzimuth;    // devio, LegoAzDevIO, CORBA::Double

      /** Indicates some telescope's status parameters
       */
      readonly attribute ACS::RWpattern status;    // devio, LegoStatusDevIO, ACS::pattern
   };

};

#endif

Error Definitions

The XML Error Definition file has to be placed in the ICD/idl directory:

Code Block
languagecpp
titleSystemErr.xml
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>
<Type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Alma/ACSError" xsi:schemaLocation="Alma/ACSError ACSError.xsd" name="SystemErr" type="900907" _prefix="acsws">
        <ErrorCode name="AlreadyInAutomatic" 
                   shortDescription="Already in automatic mode" 
                   description="Trying to set automatic mode, failed. It has already been set"/>
        <ErrorCode name="PositionOutOfLimits" 
                   shortDescription="Position out of limits" 
                   description="Command tries to move the telescope out of limits"/>
        <ErrorCode name="ProposalNotYetReady" 
                   shortDescription="Proposal is not ready" 
                   description="Proposal is not ready"/>
        <ErrorCode name="InvalidProposalStatusTransition" 
                   shortDescription="Database: Invalid proposal status" 
                   description="Trying to set an invalid status for the proposa."/>
        <ErrorCode name="ImageAlreadyStored" 
                   shortDescription="Image already stored" 
                   description="Image has already been stored in the database."/>
        <ErrorCode name="CameraIsOff" 
                   shortDescription="camera is off" 
                   description="Trying to take exposure with camera off."/>
        <ErrorCode name="SchedulerAlreadyRunning" 
                   shortDescription="Scheduler is already running" 
                   description="Trying to start scheduler, but is already has been started."/>
        <ErrorCode name="SchedulerAlreadyStopped" 
                   shortDescription="Scheduler is already stopped" 
                   description="Trying to stop scheduler, but is already has been stopped."/>
        <ErrorCode name="NoProposalExecuting" 
                   shortDescription="No proposal is executing" 
                   description="Trying to retrieve an executing proposal, but no proposal is executing."/>
        <ErrorCode name="SystemInAutoMode" 
                   shortDescription="System is in automatic mode" 
                   description="Trying to execute a command in console while the system is in automatic mode."/>
        <ErrorCode name="CannotOpenDevice" 
                   shortDescription="Can't open device" 
                   description="Can't open THE device."/>
</Type>

...