Stellarium  0.90.0
TelescopeControlGlobals.hpp
1 /*
2  * Stellarium TelescopeControl Plug-in
3  *
4  * Copyright (C) 2009-2010 Bogdan Marinov (this file)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19 */
20 
21 #ifndef _TELESCOPE_CONTROL_GLOBALS_
22 #define _TELESCOPE_CONTROL_GLOBALS_
23 
24 #include <QString>
25 #include <QStringList>
26 
27 namespace TelescopeControlGlobals {
28  const int MIN_SLOT_NUMBER = 1;
29  const int SLOT_COUNT = 9;
30  const int SLOT_NUMBER_LIMIT = MIN_SLOT_NUMBER + SLOT_COUNT;
31  const int MAX_SLOT_NUMBER = SLOT_NUMBER_LIMIT - 1;
32 
33  const int BASE_TCP_PORT = 10000;
34  #define DEFAULT_TCP_PORT_FOR_SLOT(X) (BASE_TCP_PORT + X)
35  const int DEFAULT_TCP_PORT = DEFAULT_TCP_PORT_FOR_SLOT(MIN_SLOT_NUMBER);
36 
37  const int MAX_CIRCLE_COUNT = 10;
38 
39  #ifdef Q_OS_WIN
40  const QString TELESCOPE_SERVER_PATH = QString("/%1.exe");
41  #else
42  const QString TELESCOPE_SERVER_PATH = QString("/%1");
43  #endif
44 
45  const int DEFAULT_DELAY = 500000; //Microseconds; == 0.5 seconds
46  #define MICROSECONDS_FROM_SECONDS(X) (X * 1000000)
47  #define SECONDS_FROM_MICROSECONDS(X) ((double) X / 1000000)
48 
49  enum ConnectionType {
50  ConnectionNA = 0,
51  ConnectionVirtual,
52  ConnectionInternal,
53  ConnectionLocal,
54  ConnectionRemote,
55  ConnectionRTS2,
56  ConnectionCount
57  };
58 
59  struct DeviceModel
60  {
61  QString name;
62  QString description;
63  QString server;
64  int defaultDelay;
65  bool useExecutable;
66  };
67 
69  const QStringList EMBEDDED_TELESCOPE_SERVERS = QString("TelescopeServerDummy TelescopeServerLx200 TelescopeServerNexStar").split(' ', QString::SkipEmptyParts);
70 };
71 
72 #endif //_TELESCOPE_CONTROL_GLOBALS_