26 #ifndef _TELESCOPE_HPP_ 27 #define _TELESCOPE_HPP_ 29 #include <QHostAddress> 36 #include "StelApp.hpp" 37 #include "StelObject.hpp" 38 #include "InterpolatedPosition.hpp" 65 return Vec3f(1, 1, 1);
76 QString
getType(
void)
const {
return "Telescope";}
80 virtual void telescopeGoto(
const Vec3d &j2000Pos) = 0;
81 virtual bool isConnected(
void)
const = 0;
82 virtual bool hasKnownPosition(
void)
const = 0;
83 void addOcular(
double fov) {
if (fov>=0.0) oculars.push_back(fov);}
84 const QList<double> &getOculars(
void)
const {
return oculars;}
86 virtual bool prepareCommunication() {
return false;}
87 virtual void performCommunication() {}
94 virtual bool isInitialized(
void)
const {
return true;}
95 float getSelectPriority(
const StelCore* core)
const {Q_UNUSED(core);
return -10.f;}
97 QList<double> oculars;
111 desired_pos[0] = XYZ[0] = 1.0;
112 desired_pos[1] = XYZ[1] = 0.0;
113 desired_pos[2] = XYZ[2] = 0.0;
116 bool isConnected(
void)
const 120 bool prepareCommunication(
void)
122 XYZ = XYZ * 31.0 + desired_pos;
123 const double lq = XYZ.lengthSquared();
125 XYZ *= (1.0/std::sqrt(lq));
130 void telescopeGoto(
const Vec3d &j2000Pos)
132 desired_pos = j2000Pos;
133 desired_pos.normalize();
135 bool hasKnownPosition(
void)
const 158 TelescopeTCP(
const QString &name,
const QString ¶ms, Equinox eq = EquinoxJ2000);
163 bool isConnected(
void)
const 166 return (tcpSocket->state() == QAbstractSocket::ConnectedState);
171 bool prepareCommunication();
172 void performCommunication();
173 void telescopeGoto(
const Vec3d &j2000Pos);
174 bool isInitialized(
void)
const 176 return (!address.isNull());
178 void performReading(
void);
179 void performWriting(
void);
183 QHostAddress address;
185 QTcpSocket * tcpSocket;
186 bool wait_for_connection_establishment;
187 qint64 end_of_timeout;
188 char readBuffer[120];
190 char writeBuffer[120];
191 char *writeBufferEnd;
195 virtual bool hasKnownPosition(
void)
const 197 return interpolatedPosition.isKnown();
203 void socketConnected(
void);
204 void socketFailed(QAbstractSocket::SocketError socketError);
207 #endif // _TELESCOPE_HPP_ This TelescopeClient class can controll a telescope by communicating to a server process ("telescope ...
The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
An abstract base class that should never be used directly, only inherited.
Main class for Stellarium core processing.
virtual Vec3d getJ2000EquatorialPos(const StelCore *core) const =0
Get observer-centered equatorial coordinates at equinox J2000.
virtual double getAngularSize(const StelCore *) const
Return the angular radius of a circle containing the object as seen from the observer with the circle...
QString getInfoString(const StelCore *core, const InfoStringGroup &flags) const
TelescopeClient supports the following InfoStringGroup flags:
QString getEnglishName(void) const
Return object's name in english.
Vec3d getJ2000EquatorialPos(const StelCore *) const
Get observer-centered equatorial coordinates at equinox J2000.
Vec3f getInfoColor(void) const
Get a color used to display info about the object.
QString getType(void) const
Return object's type. It should be the name of the class.
QString getNameI18n(void) const
Return translated object's name.