QTelescopeMTS.hpp

00001 #ifndef _QTelescopeMTS_hpp_
00002 #define _QTelescopeMTS_hpp_
00003 
00004 #include "QTelescope.hpp"
00005 #include <string>
00006 
00007 using namespace std;
00008 
00019 class QTelescopeMTS : public QTelescope {
00020    Q_OBJECT;
00021 public:
00022    QTelescopeMTS(const char * deviceName);
00023    void buildGUI(QWidget * parent);
00024 public slots:
00025    virtual void goE(float s=0) { sendCommand( righton ); };
00026    virtual void goW(float s=0) { sendCommand( lefton ); };
00027    virtual void goS(float s=0) { sendCommand( downon ); };
00028    virtual void goN(float s=0) { sendCommand( upon ); };
00029    virtual void stopE()        { sendCommand( rightoff ); };
00030    virtual void stopN()        { sendCommand( upoff ); };
00031    virtual void stopW()        { sendCommand( leftoff ); };
00032    virtual void stopS()        { sendCommand( downoff ); };
00033    virtual double setSpeed(double speed);
00034    virtual bool setTracking(bool activated);
00035 protected:
00036   /* Commands without return value */
00037    enum CommandType {
00038       upon,
00039       upoff,
00040       downon,
00041       downoff,
00042       righton,
00043       rightoff,
00044       lefton,
00045       leftoff,
00046       faston,
00047       fastoff,
00048       onon,
00049       onoff,
00050       displayoff
00051    };
00052   /* Method to handle non-returning commands */
00053    void sendCommand( CommandType );
00054 
00055   /* Commands with 1 byte return value (RD1)*/
00056    enum RD1CommandType {
00057      ready,
00058      readswitch
00059    };
00060   /* Method to handle RD1 commands */
00061    int sendCommand( RD1CommandType );
00062 private:
00063    /* Send the command to serial port */
00064    bool sendCmd( int cmd );
00065    /* Read the one Byte result from serial port */
00066    int recvRD1Cmd();
00067    /* The file descpritor of the serial port. */
00068    int descriptor_;
00069 };
00070 #endif

Generated on Sat Oct 27 09:21:03 2007 for QastroCam by  doxygen 1.5.1