00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _TELESCOPE_HPP_
00021 #define _TELESCOPE_HPP_
00022
00023 #include <QList>
00024 #include <QString>
00025
00026 #if defined (_MSC_VER)
00027 #include <winsock2.h>
00028 #endif
00029
00030 #include "StelObject.hpp"
00031 #include "StelNavigator.hpp"
00032
00033 long long int GetNow(void);
00034
00035 #ifdef __MINGW32__
00036 struct fd_set;
00037 #endif
00038
00039 class Telescope : public StelObject
00040 {
00041 public:
00042 static Telescope *create(const QString &url);
00043 virtual ~Telescope(void) {}
00044
00045
00046 QString getEnglishName(void) const {return name;}
00047 QString getNameI18n(void) const {return nameI18n;}
00056 QString getInfoString(const StelCore* core, const InfoStringGroup& flags) const;
00057 QString getType(void) const {return "Telescope";}
00058 virtual double getAngularSize(const StelCore* core) const {Q_ASSERT(0); return 0;}
00059
00060
00061 virtual void telescopeGoto(const Vec3d &j2000Pos) = 0;
00062 virtual bool isConnected(void) const = 0;
00063 virtual bool hasKnownPosition(void) const = 0;
00064 void addOcular(double fov) {if (fov>=0.0) oculars.push_back(fov);}
00065 const QList<double> &getOculars(void) const {return oculars;}
00066
00067
00068 virtual void prepareSelectFds(fd_set &read_fds,fd_set &write_fds, int &fdmax) = 0;
00069 virtual void handleSelectFds(const fd_set &read_fds, const fd_set &write_fds) {}
00070
00071 protected:
00072 Telescope(const QString &name);
00073 QString nameI18n;
00074 const QString name;
00075 private:
00076 bool isInitialized(void) const {return true;}
00077 float getSelectPriority(const StelNavigator *nav) const {return -10.f;}
00078 private:
00079 QList<double> oculars;
00080 };
00081
00082 #endif // _TELESCOPE_HPP_