TelescopeControlGlobals.hpp   TelescopeControlGlobals.hpp 
/* /*
* Stellarium TelescopeControl Plug-in * Stellarium TelescopeControl Plug-in
* *
* Copyright (C) 2009 Bogdan Marinov (this file) * Copyright (C) 2009-2010 Bogdan Marinov (this file)
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _TELESCOPE_CONTROL_GLOBALS_ #ifndef _TELESCOPE_CONTROL_GLOBALS_
#define _TELESCOPE_CONTROL_GLOBALS_ #define _TELESCOPE_CONTROL_GLOBALS_
#include <QString>
#include <QStringList>
namespace TelescopeControlGlobals { namespace TelescopeControlGlobals {
const int MIN_SLOT_NUMBER = 1; const int MIN_SLOT_NUMBER = 1;
const int SLOT_COUNT = 9; const int SLOT_COUNT = 9;
const int SLOT_NUMBER_LIMIT = MIN_SLOT_NUMBER + SLOT_COUNT; const int SLOT_NUMBER_LIMIT = MIN_SLOT_NUMBER + SLOT_COUNT;
const int MAX_SLOT_NUMBER = SLOT_NUMBER_LIMIT - 1; const int MAX_SLOT_NUMBER = SLOT_NUMBER_LIMIT - 1;
const int BASE_TCP_PORT = 10000; const int BASE_TCP_PORT = 10000;
#define DEFAULT_TCP_PORT_FOR_SLOT(X) (BASE_TCP_PORT + X) #define DEFAULT_TCP_PORT_FOR_SLOT(X) (BASE_TCP_PORT + X)
const int DEFAULT_TCP_PORT = DEFAULT_TCP_PORT_FOR_SLOT(MIN_SLOT_NUMB ER); const int DEFAULT_TCP_PORT = DEFAULT_TCP_PORT_FOR_SLOT(MIN_SLOT_NUMB ER);
const int MAX_CIRCLE_COUNT = 10; const int MAX_CIRCLE_COUNT = 10;
#ifdef WIN32 #ifdef Q_OS_WIN32
const QString TELESCOPE_SERVER_PATH = QString("/%1.exe"); const QString TELESCOPE_SERVER_PATH = QString("/%1.exe");
const QString SERIAL_PORT_PREFIX = QString("COM"); const QString SERIAL_PORT_PREFIX = QString("COM");
#else #else
const QString TELESCOPE_SERVER_PATH = QString("/%1"); const QString TELESCOPE_SERVER_PATH = QString("/%1");
const QString SERIAL_PORT_PREFIX = QString("/dev/"); const QString SERIAL_PORT_PREFIX = QString("/dev/");
#endif #endif
const int DEFAULT_DELAY = 500000; //Microseconds; == 0.5 seconds const int DEFAULT_DELAY = 500000; //Microseconds; == 0.5 seconds
#define MICROSECONDS_FROM_SECONDS(X) (X * 1000000) #define MICROSECONDS_FROM_SECONDS(X) (X * 1000000)
#define SECONDS_FROM_MICROSECONDS(X) ((double) X / 1000000) #define SECONDS_FROM_MICROSECONDS(X) ((double) X / 1000000)
enum TelescopeConnection { enum ConnectionType {
ConnectionNA = 0, ConnectionNA = 0,
ConnectionLocalInternal, ConnectionVirtual,
ConnectionLocalExternal, ConnectionInternal,
ConnectionLocal,
ConnectionRemote, ConnectionRemote,
ConnectionCount ConnectionCount
}; };
struct DeviceModel struct DeviceModel
{ {
QString name; QString name;
QString description; QString description;
QString server; QString server;
int defaultDelay; int defaultDelay;
bool useExecutable; bool useExecutable;
}; };
const QString LABEL_TEXT_CONTROL_TIP = QString("To slew a connected telescope, select an object (for example, a star) and then hold down the Ct rl key and press the key with that telescope's number."); const QString LABEL_TEXT_CONTROL_TIP = QString("To slew a connected telescope to an object (for example, a star), select that object, then hold down the Ctrl key and press the key with that telescope's number. To slew it to the center of the current view, hold down the Alt key and press the k ey with that telescope's number.");
const QString LABEL_TEXT_NO_DEVICE_MODELS = QString("No device model descriptions are available. Stellarium will not be able to control a teles cope on its own, but it is still possible to do it through an external appl ication or to connect to a remote host."); const QString LABEL_TEXT_NO_DEVICE_MODELS = QString("No device model descriptions are available. Stellarium will not be able to control a teles cope on its own, but it is still possible to do it through an external appl ication or to connect to a remote host.");
const QString LABEL_TEXT_ADD_TIP = QString("Press the \"Add\" button to set up a new telescope connection."); const QString LABEL_TEXT_ADD_TIP = QString("Press the \"Add\" button to set up a new telescope connection.");
const QString TOOL_TIP_CONTROL = QString("Select an object, then pre ss <strong>Ctrl+%1</strong> to slew this telescope."); const QString TOOL_TIP_CONTROL = QString("Select an object, then pre ss <strong>Ctrl+%1</strong> to slew this telescope to that object. Press <s trong>Alt+%1</strong> to slew to the center of the current view.");
#ifdef WIN32 #ifdef Q_OS_WIN32
const QStringList SERIAL_PORT_NAMES = QString("COM1 COM2 COM3 COM4") .split(' ', QString::SkipEmptyParts); const QStringList SERIAL_PORT_NAMES = QString("COM1 COM2 COM3 COM4") .split(' ', QString::SkipEmptyParts);
#elif defined(MACOSX) #elif defined(Q_OS_MAC)
const QStringList SERIAL_PORT_NAMES = QStringList(); const QStringList SERIAL_PORT_NAMES = QString("/dev/ ").split(' ', Q
String::SkipEmptyParts);
#else #else
const QStringList SERIAL_PORT_NAMES = QString("/dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3" ).split(' ', QString::SkipEmptyParts); const QStringList SERIAL_PORT_NAMES = QString("/dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3" ).split(' ', QString::SkipEmptyParts);
#endif #endif
//! List of the telescope servers that don't need external executabl es //! List of the telescope servers that don't need external executabl es
const QStringList EMBEDDED_TELESCOPE_SERVERS = QString("TelescopeSer verDummy TelescopeServerLx200 TelescopeServerNexStar").split(' ', QString:: SkipEmptyParts); const QStringList EMBEDDED_TELESCOPE_SERVERS = QString("TelescopeSer verDummy TelescopeServerLx200 TelescopeServerNexStar").split(' ', QString:: SkipEmptyParts);
}; };
#endif //_TELESCOPE_CONTROL_GLOBALS_ #endif //_TELESCOPE_CONTROL_GLOBALS_
 End of changes. 9 change blocks. 
10 lines changed or deleted 15 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/