TelescopeControl.cpp   TelescopeControl.cpp 
skipping to change at line 233 skipping to change at line 233
void TelescopeControl::deinit() void TelescopeControl::deinit()
{ {
//Destroy all clients first in order to avoid displaying a TCP error //Destroy all clients first in order to avoid displaying a TCP error
deleteAllTelescopes(); deleteAllTelescopes();
QHash<int, QProcess*>::const_iterator iterator = telescopeServerProc ess.constBegin(); QHash<int, QProcess*>::const_iterator iterator = telescopeServerProc ess.constBegin();
while(iterator != telescopeServerProcess.constEnd()) while(iterator != telescopeServerProcess.constEnd())
{ {
int slotNumber = iterator.key(); int slotNumber = iterator.key();
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
telescopeServerProcess[slotNumber]->close(); telescopeServerProcess[slotNumber]->close();
#else #else
telescopeServerProcess[slotNumber]->terminate(); telescopeServerProcess[slotNumber]->terminate();
#endif #endif
telescopeServerProcess[slotNumber]->waitForFinished(); telescopeServerProcess[slotNumber]->waitForFinished();
delete telescopeServerProcess[slotNumber]; delete telescopeServerProcess[slotNumber];
qDebug() << "TelescopeControl::deinit(): Server process at s lot" << slotNumber << "terminated successfully."; qDebug() << "TelescopeControl::deinit(): Server process at s lot" << slotNumber << "terminated successfully.";
++iterator; ++iterator;
} }
skipping to change at line 623 skipping to change at line 623
Q_ASSERT(settings); Q_ASSERT(settings);
settings->beginGroup("TelescopeControl"); settings->beginGroup("TelescopeControl");
//Load display flags //Load display flags
setFlagTelescopeReticles(settings->value("flag_telescope_reticles", true).toBool()); setFlagTelescopeReticles(settings->value("flag_telescope_reticles", true).toBool());
setFlagTelescopeLabels(settings->value("flag_telescope_labels", true ).toBool()); setFlagTelescopeLabels(settings->value("flag_telescope_labels", true ).toBool());
setFlagTelescopeCircles(settings->value("flag_telescope_circles", tr ue).toBool()); setFlagTelescopeCircles(settings->value("flag_telescope_circles", tr ue).toBool());
//Load font size //Load font size
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
setFontSize(settings->value("telescope_labels_font_size", 13).toInt( )); //Windows Qt bug workaround setFontSize(settings->value("telescope_labels_font_size", 13).toInt( )); //Windows Qt bug workaround
#else #else
setFontSize(settings->value("telescope_labels_font_size", 12).toInt( )); setFontSize(settings->value("telescope_labels_font_size", 12).toInt( ));
#endif #endif
//Load colours //Load colours
reticleNormalColor = StelUtils::strToVec3f(settings->value("color_te lescope_reticles", "0.6,0.4,0").toString()); reticleNormalColor = StelUtils::strToVec3f(settings->value("color_te lescope_reticles", "0.6,0.4,0").toString());
reticleNightColor = StelUtils::strToVec3f(settings->value("night_col or_telescope_reticles", "0.5,0,0").toString()); reticleNightColor = StelUtils::strToVec3f(settings->value("night_col or_telescope_reticles", "0.5,0,0").toString());
labelNormalColor = StelUtils::strToVec3f(settings->value("color_tele scope_labels", "0.6,0.4,0").toString()); labelNormalColor = StelUtils::strToVec3f(settings->value("color_tele scope_labels", "0.6,0.4,0").toString());
labelNightColor = StelUtils::strToVec3f(settings->value("night_color _telescope_labels", "0.5,0,0").toString()); labelNightColor = StelUtils::strToVec3f(settings->value("night_color _telescope_labels", "0.5,0,0").toString());
skipping to change at line 864 skipping to change at line 864
} }
//Do we have this server? //Do we have this server?
if(!deviceModels.contains(deviceModelName)) if(!deviceModels.contains(deviceModelName))
{ {
qWarning() << "TelescopeControl: Unable to l oad telescope at slot" << slot << "because the specified device model is mi ssing:" << deviceModelName; qWarning() << "TelescopeControl: Unable to l oad telescope at slot" << slot << "because the specified device model is mi ssing:" << deviceModelName;
map.remove(key); map.remove(key);
continue; continue;
} }
if(portSerial.isEmpty() || !portSerial.startsWith(SE RIAL_PORT_PREFIX)) if(portSerial.isEmpty())
{ {
qDebug() << "TelescopeControl: Unable to loa d telescope: No valid serial port specified at slot" << key; qDebug() << "TelescopeControl: Unable to loa d telescope: No valid serial port specified at slot" << key;
map.remove(key); map.remove(key);
continue; continue;
} }
} }
if (connectionType == ConnectionRemote) if (connectionType == ConnectionRemote)
{ {
//Validation: Host name //Validation: Host name
skipping to change at line 1243 skipping to change at line 1243
if (telescopeServers.contains(serverName)) if (telescopeServers.contains(serverName))
{ {
QString serverExecutablePath = StelFileMgr::findFile(serverE xecutablesDirectoryPath + TELESCOPE_SERVER_PATH.arg(serverName), StelFileMg r::File); QString serverExecutablePath = StelFileMgr::findFile(serverE xecutablesDirectoryPath + TELESCOPE_SERVER_PATH.arg(serverName), StelFileMg r::File);
if (serverExecutablePath.isEmpty()) if (serverExecutablePath.isEmpty())
{ {
qDebug() << "TelescopeControl: Error starting telesc ope server: Can't find executable:" << QDir::toNativeSeparators(serverExecu tablePath); qDebug() << "TelescopeControl: Error starting telesc ope server: Can't find executable:" << QDir::toNativeSeparators(serverExecu tablePath);
return false; return false;
} }
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
QString serialPortName; QString serialPortName = "\\\\.\\" + portSerial;
if(portSerial.right(portSerial.size() - SERIAL_PORT_PREFIX.s
ize()).toInt() > 9)
serialPortName = "\\\\.\\" + portSerial;//"\\.\COMxx
", not sure if it will work
else
serialPortName = portSerial;
#else #else
QString serialPortName = portSerial; QString serialPortName = portSerial;
#endif //Q_OS_WIN32 #endif //Q_OS_WIN
QStringList serverArguments; QStringList serverArguments;
serverArguments << QString::number(portTCP) << serialPortNam e; serverArguments << QString::number(portTCP) << serialPortNam e;
if(useTelescopeServerLogs) if(useTelescopeServerLogs)
serverArguments << QString(StelFileMgr::getUserDir() + "/log_TelescopeServer" + slotName + ".txt"); serverArguments << QString(StelFileMgr::getUserDir() + "/log_TelescopeServer" + slotName + ".txt");
qDebug() << "TelescopeControl: Starting tellescope server at slot" << slotName << "with path" << QDir::toNativeSeparators(serverExecuta blePath) << "and arguments" << serverArguments.join(" "); qDebug() << "TelescopeControl: Starting tellescope server at slot" << slotName << "with path" << QDir::toNativeSeparators(serverExecuta blePath) << "and arguments" << serverArguments.join(" ");
//Starting the new process //Starting the new process
telescopeServerProcess.insert(slotNumber, new QProcess()); telescopeServerProcess.insert(slotNumber, new QProcess());
//telescopeServerProcess[slotNumber]->setStandardOutputFile( StelFileMgr::getUserDir() + "/log_TelescopeServer" + slotName + ".txt");//I n case the server does not accept logfiles //telescopeServerProcess[slotNumber]->setStandardOutputFile( StelFileMgr::getUserDir() + "/log_TelescopeServer" + slotName + ".txt");//I n case the server does not accept logfiles
skipping to change at line 1281 skipping to change at line 1277
return false; return false;
} }
bool TelescopeControl::stopServerAtSlot(int slotNumber) bool TelescopeControl::stopServerAtSlot(int slotNumber)
{ {
//Validate //Validate
if(!isValidSlotNumber(slotNumber) || !telescopeServerProcess.contain s(slotNumber)) if(!isValidSlotNumber(slotNumber) || !telescopeServerProcess.contain s(slotNumber))
return false; return false;
//Stop/close the process //Stop/close the process
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN
telescopeServerProcess[slotNumber]->close(); telescopeServerProcess[slotNumber]->close();
#else #else
telescopeServerProcess[slotNumber]->terminate(); telescopeServerProcess[slotNumber]->terminate();
#endif //Q_OS_WIN32 #endif //Q_OS_WIN
telescopeServerProcess[slotNumber]->waitForFinished(); telescopeServerProcess[slotNumber]->waitForFinished();
delete telescopeServerProcess[slotNumber]; delete telescopeServerProcess[slotNumber];
telescopeServerProcess.remove(slotNumber); telescopeServerProcess.remove(slotNumber);
return true; return true;
} }
bool TelescopeControl::startClientAtSlot(int slotNumber, ConnectionType con nectionType, QString name, QString equinox, QString host, int portTCP, int delay, QList<double> circles, QString deviceModelName, QString portSerial) bool TelescopeControl::startClientAtSlot(int slotNumber, ConnectionType con nectionType, QString name, QString equinox, QString host, int portTCP, int delay, QList<double> circles, QString deviceModelName, QString portSerial)
{ {
 End of changes. 7 change blocks. 
14 lines changed or deleted 8 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/