00001 #ifndef _QTelescopeAutostar_hpp_
00002 #define _QTelescopeAutostar_hpp_
00003
00004 #include "QTelescope.hpp"
00005 #include <string>
00006
00007 using namespace std;
00008
00013 class QTelescopeAutostar : public QTelescope {
00014 Q_OBJECT;
00015 public:
00016 QTelescopeAutostar(const char * deviceName);
00017 void buildGUI(QWidget * parent);
00018 public slots:
00019 virtual void goE(float shift) {sendCommand(moveEast);};
00020 virtual void goW(float shift) {sendCommand(moveWest);};
00021 virtual void goS(float shift) {sendCommand(moveSouth);};
00022 virtual void goN(float shift) {sendCommand(moveNorth);};
00023 virtual void stopE() {sendCommand(stopMoveEast);};
00024 virtual void stopN() {sendCommand(stopMoveNorth);};
00025 virtual void stopW() {sendCommand(stopMoveWest);};
00026 virtual void stopS() {sendCommand(stopMoveSouth);};
00027 virtual double setSpeed(double speed);
00028 virtual bool setTracking(bool activated);
00029 protected:
00032 enum CommandType {
00033 park,
00034 getAlignment,
00035 setAlignment,
00036 moveSouth,
00037 moveNorth,
00038 moveEast,
00039 moveWest,
00040 stopMoveEast,
00041 stopMoveWest,
00042 stopMoveNorth,
00043 stopMoveSouth,
00044 setMoveSpeed
00045 };
00046 enum TrackingMode {
00047 land,
00048 polar,
00049 altAz,
00050 german
00051 };
00052 enum SubVersion {
00053 versionDate,
00054 versionFull,
00055 versionNumber,
00056 versionTime,
00057 productName
00058 };
00059 enum ReturnType {
00060 singleChar,
00061 booleans,
00062 numerics,
00063 strings,
00064 none
00065 };
00066 string sendCommand(CommandType com,const string & param="");
00067 void setTracking(TrackingMode);
00068 string version(SubVersion v);
00069 private:
00071 bool sendCmd(const string & cmd,const string & param="");
00073 string recvCmd(ReturnType t);
00075 int descriptor_;
00076 TrackingMode aligment_;
00077 };
00078 #endif