Stellarium 0.14.3
NexStarConnection.hpp
1 /*
2 The stellarium telescope library helps building
3 telescope server programs, that can communicate with stellarium
4 by means of the stellarium TCP telescope protocol.
5 It also contains smaple server classes (dummy, Meade LX200).
6 
7 Author and Copyright of this file and of the stellarium telescope library:
8 Johannes Gajdosik, 2006, modified for NexStar telescopes by Michael Heinz.
9 
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14 
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
23 */
24 
25 #ifndef _NEXSTAR_CONNECTION_HPP_
26 #define _NEXSTAR_CONNECTION_HPP_
27 
28 #include "SerialPort.hpp"
29 
30 #include <list>
31 using namespace std;
32 
33 class NexStarCommand;
34 
37 {
38 public:
39  NexStarConnection(Server &server, const char *serial_device);
40  ~NexStarConnection(void) { resetCommunication(); }
41  void sendGoto(unsigned int ra_int, int dec_int);
42  void sendCommand(NexStarCommand * command);
43 
44 private:
45  void dataReceived(const char *&p, const char *read_buff_end);
46  void sendPosition(unsigned int ra_int, int dec_int, int status) {Q_UNUSED(ra_int); Q_UNUSED(dec_int); Q_UNUSED(status);}
47  void resetCommunication(void);
48 
49 private:
50  list<NexStarCommand*> command_list;
51 };
52 
53 #endif //_NEXSTAR_CONNECTION_HPP_
Base class for telescope server classes.
Definition: Server.hpp:45
STL namespace.
Serial port connection to a Celestron NexStar or a compatible telescope.
Abstract base class for Celestron NexStar (and compatible) commands.
Serial interface connection.
Definition: SerialPort.hpp:37