Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 673 → Rev 674

/QMK-Groundstation/trunk/QMK-Maps/Classes/cSettings.cpp
0,0 → 1,118
/***************************************************************************
* Copyright (C) 2008 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(500, 350)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
GUI.Toolbar = Setting.value("Toolbar",true).toBool();
Setting.endGroup();
 
Setting.beginGroup("Data");
DATA.Intervall = Setting.value("Intervall", 500).toInt();
Setting.endGroup();
 
Setting.beginGroup("SERVER");
SERVER.Password = Setting.value("Password", QString("")).toString();
SERVER.IP_MAX = Setting.value("IP_MAX", 1).toInt();
SERVER.IP_ID = Setting.value("IP_ID", 0).toInt();
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
SERVER.IP[z] = Setting.value("IP_" + QString("%1").arg(z), QString("127.0.0.1:64400")).toString();
}
Setting.endGroup();
 
Setting.beginGroup("CONFIG");
CONFIG.cb_CenterPos = Setting.value("cb_CenterPos",true).toBool();
CONFIG.cb_ShowRoute = Setting.value("cb_ShowRoute",true).toBool();
CONFIG.cb_ShowWPs = Setting.value("cb_ShowWPs",true).toBool();
CONFIG.cb_Goto = Setting.value("cb_Goto",true).toBool();
Setting.endGroup();
 
Setting.beginGroup("Navi");
NAVI.StayTime = Setting.value("StayTime", 500).toInt();
NAVI.Latitude = Setting.value("Latitude", 52.5).toDouble();
NAVI.Longitude = Setting.value("Longitude", 13.5).toDouble();
Setting.endGroup();
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.setValue("Toolbar", GUI.Toolbar);
Setting.endGroup();
 
Setting.beginGroup("DATA");
Setting.setValue("Intervall", DATA.Intervall);
Setting.endGroup();
 
Setting.beginGroup("SERVER");
Setting.setValue("Password", SERVER.Password);
Setting.setValue("IP_MAX", SERVER.IP_MAX);
Setting.setValue("IP_ID", SERVER.IP_ID);
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
Setting.setValue("IP_" + QString("%1").arg(z), SERVER.IP[z]);
}
Setting.endGroup();
 
Setting.beginGroup("CONFIG");
Setting.setValue("cb_CenterPos", CONFIG.cb_CenterPos);
Setting.setValue("cb_ShowRoute", CONFIG.cb_ShowRoute);
Setting.setValue("cb_ShowWPs", CONFIG.cb_ShowWPs);
Setting.setValue("cb_Goto", CONFIG.cb_Goto);
Setting.endGroup();
 
Setting.beginGroup("NAVI");
Setting.setValue("StayTime", NAVI.StayTime);
Setting.setValue("Latitude", NAVI.Latitude);
Setting.setValue("Longitude", NAVI.Longitude);
Setting.endGroup();
 
}
/QMK-Groundstation/trunk/QMK-Maps/Classes/cSettings.h
0,0 → 1,80
/***************************************************************************
* Copyright (C) 2008 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef CSETTINGS_H
#define CSETTINGS_H
 
#include <QSize>
#include <QPoint>
#include <QString>
 
#include "../Defines.h"
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
bool Toolbar;
};
 
struct set_DATA
{
int Intervall;
};
 
struct set_SERVER
{
int IP_MAX;
int IP_ID;
QString IP[10];
QString Password;
};
 
struct set_CONFIG
{
bool cb_Goto;
bool cb_ShowRoute;
bool cb_ShowWPs;
bool cb_CenterPos;
};
 
struct set_NAVI
{
int StayTime;
double Latitude;
double Longitude;
};
 
class cSettings
{
public:
cSettings();
void read_Settings();
void write_Settings();
 
int Settings_ID;
 
set_GUI GUI;
set_DATA DATA;
set_SERVER SERVER;
set_CONFIG CONFIG;
set_NAVI NAVI;
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/trunk/QMK-Maps/Defines.h
0,0 → 1,52
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Maps";
static const QString QA_VERSION_NR = "1.1.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "30.10.2009";
static const QString QA_YEAR = "2008-2009";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Maps - Positionsanzeige und Waypoint-Programmierung.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
#endif // DEFINES_H
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_Main.cpp
0,0 → 1,1153
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
 
#include <QMessageBox>
#include <QDomDocument>
#include <QFile>
 
#include "dlg_Main.h"
#include "dlg_MapPos.h"
 
// Konstruktor Main-Form
dlg_Main::dlg_Main()
{
setupUi(this);
 
o_Settings = new cSettings();
 
o_Input = new Input();
 
o_Map = new MapControl(QSize(25,25));
l_RouteWP = new LineString();
init_Directorys();
init_GUI();
init_Connections();
}
 
// Grafische Oberfläche initialisieren
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
for(int z = 0; z < o_Settings->SERVER.IP_MAX; z++)
{
if (cb_Server->findText(o_Settings->SERVER.IP[z]) == -1)
{
cb_Server->addItem(o_Settings->SERVER.IP[z]);
}
}
 
cb_Server->setCurrentIndex(o_Settings->SERVER.IP_ID);
 
le_Password->setText(o_Settings->SERVER.Password);
 
sb_Intervall->setValue(o_Settings->DATA.Intervall);
 
cb_CenterPos->setChecked(o_Settings->CONFIG.cb_CenterPos);
cb_ShowRoute->setChecked(o_Settings->CONFIG.cb_ShowRoute);
cb_ShowWPs->setChecked(o_Settings->CONFIG.cb_ShowWPs);
cb_Goto->setChecked(o_Settings->CONFIG.cb_Goto);
 
// tb_More->addWidget(cb_Maps);
cb_Maps->setVisible(false);
 
ac_Toolbar->setChecked(o_Settings->GUI.Toolbar);
 
if (ac_Toolbar->isChecked())
{
btn_Connect->setVisible(false);
}
else
{
ToolBar->setVisible(false);
tb_More->setVisible(false);
}
}
 
// Signale mit Slots verbinden
void dlg_Main::init_Connections()
{
connect(ac_Connect, SIGNAL(triggered()), this, SLOT(slot_ac_Connect()));
connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
 
connect(sb_Intervall, SIGNAL(valueChanged(int)), this, SLOT(slot_sb_Intervall(int)));
 
connect(sl_Zoom, SIGNAL(valueChanged(int)), this, SLOT(slot_Zoom(int)));
connect(cb_Maps, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_ChangeMap(int)));
 
connect(cb_ShowWPs, SIGNAL(toggled(bool)), this, SLOT(slot_ShowWayPoints(bool)));
 
connect(btn_WPAdd, SIGNAL(clicked()), this, SLOT(slot_btn_WPAdd()));
connect(btn_WPFly, SIGNAL(clicked()), this, SLOT(slot_btn_WPFly()));
connect(btn_WPDelete, SIGNAL(clicked()), this, SLOT(slot_btn_WPDelete()));
 
connect(ac_LoadRoute, SIGNAL(triggered()), this, SLOT(slot_ac_LoadWayPoints()));
connect(ac_SaveRoute, SIGNAL(triggered()), this, SLOT(slot_ac_SaveRoute()));
 
connect(ac_LoadMap, SIGNAL(triggered()), this, SLOT(slot_ac_LoadMapPic()));
connect(ac_Record, SIGNAL(triggered()), this, SLOT(slot_ac_Record()));
connect(ac_RouteDelete, SIGNAL(triggered()), this, SLOT(slot_ac_RouteDelete()));
}
 
void dlg_Main::init_Directorys()
{
QDir *t_Dir = new QDir();
 
s_Dir.MainData = QDir::homePath() + "/QMK-Data";
if (!t_Dir->exists(s_Dir.MainData))
{
t_Dir->mkdir(s_Dir.MainData);
}
 
s_Dir.MapCache = s_Dir.MainData + "/Map-Cache";
if (!t_Dir->exists(s_Dir.MapCache))
{
t_Dir->mkdir(s_Dir.MapCache);
}
 
s_Dir.WPRoutes = s_Dir.MainData + "/WP-Routes";
if (!t_Dir->exists(s_Dir.WPRoutes))
{
t_Dir->mkdir(s_Dir.WPRoutes);
}
 
s_Dir.MapPics = s_Dir.MainData + "/Map-Pics";
if (!t_Dir->exists(s_Dir.MapPics))
{
t_Dir->mkdir(s_Dir.MapPics);
}
 
s_Dir.Flights = s_Dir.MainData + "/Flights";
if (!t_Dir->exists(s_Dir.Flights))
{
t_Dir->mkdir(s_Dir.Flights);
}
}
 
void dlg_Main::parse_IP_Data(QString t_Data)
{
QStringList Data;
Data = t_Data.split(":");
 
if (Data.count() > 1)
{
int CMD = Data[2].toInt();
 
switch(CMD)
{
case 501 :
{
o_Input->send_Data(HandlerIP::make_Frame(0, 105, le_Password->text()));
}
break;
case 505 :
{
if (Data[3] == "OK")
{
}
else
{
QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen. <br />Daten senden zum Mikrokopter nicht möglich."), QMessageBox::Ok);
}
}
break;
}
}
}
 
// Eingangsdaten verarbeiten
void dlg_Main::parse_MK_Data(QString t_Data)
{
unsigned char OutData[150];
char *InData = t_Data.toLatin1().data();
 
if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
{
 
switch(InData[2])
{
case 'V' : // Versions-Info
{
o_Input->stop_Resend(DATA_VERSION);
VersionInfo = HandlerMK::parse_Version(OutData, InData[1] - 'a');
setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + VersionInfo.Hardware + " " + VersionInfo.Version);
 
if (VersionInfo.ID == ADDRESS_NC)
{
c_Data[0] = sb_Intervall->value() / 10;
o_Input->send_Data(HandlerMK::make_Frame('o', ADDRESS_ALL, c_Data, 1).toLatin1().data());
}
else // TODO: Befehl wenden zum Wechseln auf Navi.
{
}
}
break;
case 'O' : // Navi-OSD-Data
{
if (InData[1] - 'a' == ADDRESS_NC)
{
s_MK_NaviData MK_NaviData;
 
memcpy((unsigned char *)&MK_NaviData, (unsigned char *)&OutData, sizeof(MK_NaviData));
if (MK_NaviData.Version == MK_VERSION_NAVI)
{
show_Data(MK_NaviData);
add_Position(MK_NaviData);
}
}
}
break;
case 'W' : // WayPoints
{
o_Input->stop_Resend(DATA_WRITE_WAYPOINT);
 
if (OutData[0] < l_WayPoints.count())
{
send_WayPoints(l_WayPoints, OutData[0] + 1);
}
}
break;
}
}
}
 
///////////////////////////////////////////////////////////////////
// QMK-Maps //
///////////////////////////////////////////////////////////////////
 
void dlg_Main::create_Map()
{
o_Map->resize(w_Map->size() - QSize(25,50));
o_Map->enablePersistentCache(s_Dir.MapCache);
o_Map->showScale(true);
 
o_Adapter = new OSMMapAdapter();
 
o_Layer = new MapLayer("MapLayer", o_Adapter);
o_Click = new GeometryLayer("Click", o_Adapter);
o_Info = new GeometryLayer("Poute", o_Adapter);
o_RouteWP = new GeometryLayer("Route-WayPoint", o_Adapter);
o_RouteFL = new GeometryLayer("Route-Flight", o_Adapter);
 
o_Map->addLayer(o_Layer);
o_Map->addLayer(o_Click);
o_Map->addLayer(o_Info);
o_Map->addLayer(o_RouteWP);
o_Map->addLayer(o_RouteFL);
 
o_Map->setZoom(17);
// o_Map->setView(QPointF(o_Settings->NAVI.Longitude,o_Settings->NAVI.Latitude));
// o_Map->setView(QPointF(13.5,52.5));
o_Map->setView(QPointF(13.419805,52.431787));
connect(o_Map, SIGNAL(mouseEventCoordinate(const QMouseEvent*, const QPointF)), this, SLOT(slot_Click(const QMouseEvent*, const QPointF)));
 
l_Map->addWidget(o_Map);
 
sl_Zoom->setValue(17);
 
// Flight
Pen[0] = new QPen(QColor(0,0,255,255));
Pen[0]->setWidth(2);
Pen[1] = new QPen(QColor(0,0,255,255));
Pen[1]->setWidth(1);
// WayPoint
Pen[2] = new QPen(QColor(255,0,0,255));
Pen[2]->setWidth(2);
Pen[3] = new QPen(QColor(255,0,0,255));
Pen[3]->setWidth(1);
// Info
Pen[4] = new QPen(QColor(0,128,128,255));
Pen[4]->setWidth(2);
Pen[5] = new QPen(QColor(0,128,128,255));
Pen[5]->setWidth(1);
}
 
// auf Veränderung der Fenstergröße reagieren
void dlg_Main::resizeEvent ( QResizeEvent * event )
{
event = event;
o_Map->resize(w_Map->size() - QSize(25,25));
}
 
void dlg_Main::wheelEvent(QWheelEvent *event)
{
int zoomValue = sl_Zoom->value();
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15;
zoomValue += numSteps;
if (zoomValue < 0) { zoomValue = 0;}
if (zoomValue > 17) { zoomValue = 17;}
sl_Zoom->setValue(zoomValue);
}
 
QList<sWayPoint> dlg_Main::parse_WayPointKML(QString s_File)
{
QList<sWayPoint> tmp_WayPoints;
sWayPoint tmp_WayPoint;
 
QFile f_KML(s_File);
f_KML.open(QIODevice::ReadOnly | QIODevice::Text);
 
QByteArray s_KML;
 
while (!f_KML.atEnd())
{
s_KML.append(f_KML.readLine());
}
 
f_KML.close();
 
QDomDocument *UserXML;
UserXML = new QDomDocument;
 
UserXML->setContent(s_KML);
 
QDomElement Root = UserXML->firstChildElement("kml");
QDomElement Document = Root.firstChildElement("Document");
QDomElement Placemark = Document.firstChildElement("Placemark");
QDomElement Linestring = Placemark.firstChildElement("LineString");
 
QString Name = Placemark.firstChildElement("name").toElement().text();
 
QString Route = Linestring.firstChildElement("coordinates").toElement().text();
 
QStringList s_Points = Route.split(" ");
 
QStringList Position;
 
for (int z = 0; z < s_Points.count() - 1; z++)
{
if (z != 20)
{
Position = s_Points[z].split(",");
tmp_WayPoint.Longitude = Position[0].toDouble();
tmp_WayPoint.Latitude = Position[1].toDouble();
tmp_WayPoint.Altitude = Position[2].toDouble();
tmp_WayPoint.Time = sb_Time->value();
 
tmp_WayPoints.append(tmp_WayPoint);
}
else
{
QMessageBox::warning(this, QA_NAME,trUtf8("Die Wegpunkt-Liste umfasst mehr als 20 Einträge. Es werden nur die ersten 20 Einträge übernommen."), QMessageBox::Ok);
 
btn_WPAdd->setEnabled(false);
 
z = s_Points.count();
}
}
return tmp_WayPoints;
}
 
QList<sWayPoint> dlg_Main::parse_WayPointMKW(QString s_File)
{
QList<sWayPoint> tmp_WayPoints;
sWayPoint tmp_WayPoint;
 
QFile f_MKW(s_File);
f_MKW.open(QIODevice::ReadOnly | QIODevice::Text);
 
QString s_MKW;
 
while (!f_MKW.atEnd())
{
s_MKW.append(f_MKW.readLine());
}
 
f_MKW.close();
 
QStringList s_Points = s_MKW.split(" ");
 
QStringList Position;
 
for (int z = 0; z < s_Points.count() - 1; z++)
{
if (z != 20)
{
Position = s_Points[z].split(",");
tmp_WayPoint.Longitude = Position[0].toDouble();
tmp_WayPoint.Latitude = Position[1].toDouble();
tmp_WayPoint.Altitude = Position[2].toDouble();
tmp_WayPoint.Time = Position[3].toInt();
 
tmp_WayPoints.append(tmp_WayPoint);
}
else
{
QMessageBox::warning(this, QA_NAME,trUtf8("Die Wegpunkt-Liste umfasst mehr als 20 Einträge. Es werden nur die ersten 20 Einträge übernommen."), QMessageBox::Ok);
 
btn_WPAdd->setEnabled(false);
 
z = s_Points.count();
}
}
return tmp_WayPoints;
}
 
// Waypoint-Route anzeigen in Karte
void dlg_Main::show_WayPoints(QList<sWayPoint> WayPoints)
{
Point* p_Point;
 
o_RouteWP->removeGeometry(l_RouteWP);
p_RouteWP.clear();
l_WayPoints.clear();
 
l_WayPoints = WayPoints;
 
for (int z = 0; z < WayPoints.count(); z++)
{
p_Point = new Point(WayPoints[z].Longitude, WayPoints[z].Latitude);
 
p_RouteWP.append(p_Point);
}
 
l_RouteWP = new LineString(p_RouteWP, "", Pen[3]);
o_RouteWP->addGeometry(l_RouteWP);
 
o_Map->setView(p_Point);
 
o_Map->updateRequestNew();
}
 
// Waypoint-Liste speichern
void dlg_Main::save_WayPointsMKW(QString s_File)
{
QFile *f_MKW = new QFile(s_File);
 
f_MKW->open(QIODevice::ReadWrite | QIODevice::Text);
 
QTextStream out(f_MKW);
 
out.setRealNumberPrecision(9);
 
for (int z = 0; z < l_WayPoints.count(); z++)
{
out << l_WayPoints[z].Longitude << "," << l_WayPoints[z].Latitude << "," << l_WayPoints[z].Altitude << "," << l_WayPoints[z].Time << " \n";
}
 
f_MKW->close();
}
 
void dlg_Main::show_Data(s_MK_NaviData t_NaviData)
{
QString Mode = "NC-Flags : ";
if (t_NaviData.NCFlags & 0x08) {le_Mode->setText(tr("Range Limit")); Mode += "R";}
if (t_NaviData.NCFlags & 0x10) {le_Mode->setText(tr("Serial Error")); Mode += "S";}
if (t_NaviData.NCFlags & 0x20) {le_Mode->setText(tr("Target reached")); Mode += "T";}
if (t_NaviData.NCFlags & 0x40) {le_Mode->setText(tr("Manual Control")); Mode += "M";}
if (t_NaviData.NCFlags & 0x01) {le_Mode->setText(tr("Free")); Mode += "F";}
if (t_NaviData.NCFlags & 0x02) {le_Mode->setText(tr("Position Hold")); Mode += "P";}
if (t_NaviData.NCFlags & 0x04) {le_Mode->setText(tr("Coming Home")); Mode += "C";}
 
//qDebug(Mode.toLatin1().data());
 
le_WP->setText(QString("%1/").arg(t_NaviData.WaypointIndex) + QString("%1").arg(t_NaviData.WaypointNumber));
le_WPTime->setText(QString("%1:").arg(t_NaviData.TargetHoldTime / 60) + (QString("%1").arg(t_NaviData.TargetHoldTime % 60)).rightJustified(2, '0'));
le_WPDist->setText(QString("%1m").arg(t_NaviData.TargetPositionDeviation.Distance / 10));
le_HomeDist->setText(QString("%1m").arg(t_NaviData.HomePositionDeviation.Distance / 10));
}
 
// Aktuelle MK-Position hinzufügen
void dlg_Main::add_Position(s_MK_NaviData t_NaviData)
{
sWayPoint WayPoint;
 
WayPoint.Longitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Longitude, 7);
WayPoint.Latitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Latitude, 7);
WayPoint.Altitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Altitude, 3);
 
o_Settings->NAVI.Latitude = WayPoint.Latitude;
o_Settings->NAVI.Longitude = WayPoint.Longitude;
 
l_Track.append(WayPoint);
 
o_RouteFL->removeGeometry(l_RouteFL);
p_RouteFL.append(new Point(WayPoint.Longitude, WayPoint.Latitude));
 
o_Click->removeGeometry(LastPos);
 
Point* P = new CirclePoint(WayPoint.Longitude, WayPoint.Latitude, "P1", Point::Middle, Pen[0]);
LastPos = P;
// P->setBaselevel(17);
o_Click->addGeometry(P);
 
// Target anzeigen
o_Click->removeGeometry(Target);
 
Target = new ImagePoint( HandlerMK::Int2Double(t_NaviData.TargetPosition.Longitude, 7), HandlerMK::Int2Double(t_NaviData.TargetPosition.Latitude, 7), ":/Flags/Global/Images/Flags/Target.png", "Start");
Target->setBaselevel(o_Adapter->adaptedZoom());
o_Click->addGeometry(Target);
 
if (cb_CenterPos->isChecked())
{
o_Map->setView(QPointF(WayPoint.Longitude, WayPoint.Latitude));
}
 
if (cb_ShowRoute->isChecked())
{
l_RouteFL = new LineString(p_RouteFL, "", Pen[1]);
 
o_RouteFL->addGeometry(l_RouteFL);
}
o_Map->updateRequestNew();
 
if (ac_Record->isChecked())
{
QTextStream Out(o_Record);
 
Out.setRealNumberPrecision(9);
 
Out << WayPoint.Longitude << ", " << WayPoint.Latitude << ", " << WayPoint.Altitude << "\n";
}
}
 
// Ein Ziel anfliegen.
// TODO: Check auf Entfernung zur IST-Position.
void dlg_Main::send_Target(Point *t_Target)
{
if (l_Track.length() > 0)
{
s_MK_WayPoint s_WayPoint;
 
s_WayPoint.Position.Latitude = int32_t(t_Target->latitude() * 10000000+0.5);
s_WayPoint.Position.Longitude = int32_t(t_Target->longitude() * 10000000+0.5);
s_WayPoint.Position.Altitude = 0;
s_WayPoint.Position.Status = NEWDATA;
s_WayPoint.Heading = -1;
s_WayPoint.ToleranceRadius = 5;
s_WayPoint.HoldTime = sb_Time->value();
s_WayPoint.Event_Flag = 0;
s_WayPoint.reserve[0] = 0; // reserve
s_WayPoint.reserve[1] = 0; // reserve
s_WayPoint.reserve[2] = 0; // reserve
s_WayPoint.reserve[3] = 0;
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
o_Input->send_Data(HandlerMK::make_Frame('s', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data());
}
else
{
QMessageBox::warning(this, QA_NAME,tr("Es wurden noch keine aktuellen Positionsdaten vom Mikrokopter empfangen."), QMessageBox::Ok);
}
}
 
//Waypoint-Liste zum MK senden
void dlg_Main::send_WayPoints(QList<sWayPoint> t_WayPoints, int t_Pos)
{
s_MK_WayPoint s_WayPoint;
double Longitude, Latitude;
 
if (t_Pos == 0)
{ // Waypoint-Liste löschen
s_WayPoint.Position.Status = INVALID;
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
o_Input->send_Data(HandlerMK::make_Frame('w', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data(), DATA_WRITE_WAYPOINT);
}
else
{
int z = t_Pos - 1;
Longitude = t_WayPoints[z].Longitude;
Latitude = t_WayPoints[z].Latitude;
 
if (Longitude < 100)
Longitude *= 10000000+0.5;
 
if (Latitude < 100)
Latitude *= 10000000+0.5;
 
//fülle Wegpunkt-Daten
s_WayPoint.Position.Altitude = 0;
s_WayPoint.Position.Longitude = int32_t(Longitude);
s_WayPoint.Position.Latitude = int32_t(Latitude);
s_WayPoint.Position.Status = NEWDATA;
s_WayPoint.Heading = -1;
s_WayPoint.ToleranceRadius = 5;
s_WayPoint.HoldTime = t_WayPoints[z].Time;
s_WayPoint.Event_Flag = 0;
s_WayPoint.reserve[0] = 0; // reserve
s_WayPoint.reserve[1] = 0; // reserve
s_WayPoint.reserve[2] = 0; // reserve
s_WayPoint.reserve[3] = 0; // reserve
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
o_Input->send_Data(HandlerMK::make_Frame('w', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data(), DATA_WRITE_WAYPOINT);
}
}
 
///////////
// Slots //
///////////
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ac_Toolbar()
{
if (ac_Toolbar->isChecked())
{
btn_Connect->setVisible(false);
ToolBar->setVisible(true);
tb_More->setVisible(true);
}
else
{
btn_Connect->setVisible(true);
ToolBar->setVisible(false);
tb_More->setVisible(false);
}
}
 
 
// Datenintervall geändert.
void dlg_Main::slot_sb_Intervall(int t_Intervall)
{
if (t_Intervall == 0)
{
c_Data[0] = 0;
}
else
{
c_Data[0] = t_Intervall / 10;
}
o_Input->send_Data(HandlerMK::make_Frame('o', ADDRESS_ALL, c_Data, 1).toLatin1().data());
}
 
// Verbindung zum Server auf f_Settings = new wdg_Settings( this );bauen
void dlg_Main::slot_ac_Connect()
{
if (!o_Input->IsOpen())
{
if (cb_Server->findText(cb_Server->currentText()) == -1)
{
cb_Server->addItem(cb_Server->currentText());
cb_Server->setCurrentIndex(cb_Server->findText(cb_Server->currentText()));
}
 
cb_Server->setEnabled(false);
le_Password->setEnabled(false);
 
if (cb_Server->currentText().startsWith('/'))
{
o_Input = new Input_TTY();
o_Input->Init();
 
set_Input s_Input;
s_Input.Main = cb_Server->currentText();
 
if (o_Input->Open(s_Input) == true)
{
ac_Connect->setText(tr("Trennen"));
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
}
else
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
}
 
}
else
{
o_Input = new Input_TCP();
o_Input->Init();
 
set_Input s_Input;
 
QStringList Server = cb_Server->currentText().split(":");
 
s_Input.Main = Server[0];
s_Input.Sub = Server[1];
 
if (o_Input->Open(s_Input) == true)
{
connect(o_Input, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Input_Disconnected(int)));
connect(o_Input, SIGNAL(sig_Connected()), this, SLOT(slot_Input_Connected()));
}
}
}
else
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
ac_Connect->setText(tr("Verbinden"));
o_Input->Close();
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Input->Mode() == TCP)
{
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
}
}
}
 
// Neue Daten empfangen.
void dlg_Main::slot_Input_Data(QString t_Data)
{
if ((t_Data[0] == '#'))
{
if ((HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length() - 1)) || ((o_Input->Mode() == TTY) && (HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length()))))
{
parse_MK_Data(t_Data);
}
else
{
// qDebug(QString("CRC-Error - " + t_Data).toLatin1().data());
}
}
else if (o_Input->Mode() == TCP)
{
parse_IP_Data(t_Data);
}
}
 
// Serververbindung beendet
void dlg_Main::slot_Input_Disconnected(int Error)
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
// qDebug("Close");
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Input->Mode() == TCP)
{
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
}
ac_Connect->setChecked(false);
ac_Connect->setText(tr("Verbinden"));
btn_Connect->setChecked(false);
 
switch (Error)
{
case REMOTECLOSED :
{
// lb_Status->setText(tr("Verbindung vom Server beendet."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok);
}
break;
case REFUSED :
{
// lb_Status->setText(tr("Server nicht gefunden."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok);
}
break;
case 3 :
{
// lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok);
}
break;
default :
{
// lb_Status->setText(tr("Getrennt vom QMK-Datenserver."));
}
break;
}
 
}
 
// Serververbindung hergestellt
void dlg_Main::slot_Input_Connected()
{
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerIP::make_Frame(0, 101, QA_NAME + " " + QA_VERSION));
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
ac_Connect->setText(tr("Trennen"));
}
 
///////////////////////////////////////////////////////////////////
// QMK-Maps //
///////////////////////////////////////////////////////////////////
 
// Zoom der Karte ändern
void dlg_Main::slot_Zoom(int t_Zoom)
{
o_Map->setZoom(t_Zoom);
}
 
// Karte wechseln
void dlg_Main::slot_ChangeMap(int t_Set)
{
int zoom = o_Adapter->adaptedZoom();
QPointF a = o_Map->currentCoordinate();
 
o_Map->setZoom(0);
 
switch(t_Set)
{
case 0 : // OpenStreetMap
{
o_Adapter = new OSMMapAdapter();
}
break;
case 1 : // Yahoo Sat
{
o_Adapter = new TileMapAdapter("tile.openaerialmap.org", "/tiles/1.0.0/openaerialmap-900913/%1/%2/%3.png", 256, 0, 17);
}
break;
case 2 : // Google Maps
{
o_Adapter = new GoogleMapAdapter();
}
break;
case 3 : // Google Sat
{
o_Adapter = new GoogleSatMapAdapter();
}
break;
case 4 : // Yahoo Maps
{
o_Adapter = new YahooMapAdapter();
}
break;
case 5 : // Yahoo Sat
{
o_Adapter = new YahooMapAdapter("us.maps3.yimg.com", "/aerial.maps.yimg.com/png?v=1.7&t=a&s=256&x=%2&y=%3&z=%1");
}
break;
}
 
o_Layer->setMapAdapter(o_Adapter);
o_Click->setMapAdapter(o_Adapter);
o_Info->setMapAdapter(o_Adapter);
o_RouteWP->setMapAdapter(o_Adapter);
o_RouteFL->setMapAdapter(o_Adapter);
 
o_Map->updateRequestNew();
o_Map->setZoom(zoom);
}
 
// Click in die Karte
void dlg_Main::slot_Click(const QMouseEvent* Event, const QPointF Coord)
{
if ((Event->type() == QEvent::MouseButtonPress) && ((Event->button() == Qt::RightButton) || (Event->button() == Qt::MidButton)))
{
sl_Zoom->setValue(o_Adapter->adaptedZoom());
}
 
// Überwachen ob Karte verschoben wird
if ((Event->type() == QEvent::MouseButtonPress) && (Event->button() == Qt::LeftButton))
{
MapCenter = o_Map->currentCoordinate();
}
 
// Nur wenn nicht Verschoben dann einen Punkt setzen
if ((Event->type() == QEvent::MouseButtonRelease) && (Event->button() == Qt::LeftButton))
{
if (o_Map->currentCoordinate() == MapCenter)
{
if (l_WayPoints.count() < 20)
{
btn_WPAdd->setEnabled(true);
}
 
o_Click->removeGeometry(ClickPoint);
 
ClickPoint = new CirclePoint(Coord.x(), Coord.y(), 6, "P1", Point::Middle, Pen[2]);
 
 
LastClick = new Point(Coord.x(), Coord.y());
 
ClickPoint->setBaselevel(o_Adapter->adaptedZoom());
o_Click->addGeometry(ClickPoint);
 
// o_Click->removeGeometry(Flag);
// Flag = new ImagePoint(Coord.x(), Coord.y(), ":/Flags/Global/Images/Flags/Target.png", "Start");
// Flag->setBaselevel(o_Adapter->adaptedZoom());
// o_Click->addGeometry(Flag);
 
 
if (cb_Goto->isChecked())
{
send_Target(LastClick);
}
}
}
 
o_Map->updateRequestNew();
// qDebug(QString("%1").arg(Coord.x()).toLatin1().data());
// qDebug(QString("%1").arg(Coord.y()).toLatin1().data());
}
 
// WayPoint zur Liste hinzufügen
void dlg_Main::slot_btn_WPAdd()
{
cb_ShowWPs->setChecked(true);
 
sWayPoint WayPoint;
 
WayPoint.Longitude = LastClick->longitude();
WayPoint.Latitude = LastClick->latitude();
WayPoint.Time = sb_Time->value();
 
l_WayPoints.append(WayPoint);
 
o_RouteWP->removeGeometry(l_RouteWP);
 
p_RouteWP.append(LastClick);
l_RouteWP = new LineString(p_RouteWP, "", Pen[3]);
 
o_RouteWP->addGeometry(l_RouteWP);
o_Map->updateRequestNew();
 
btn_WPFly->setEnabled(true);
 
if (l_WayPoints.count() == 20)
{
QMessageBox::warning(this, QA_NAME,trUtf8("Wegpunkt-Liste ist voll. Es können maximal 20 Wegpunkte benutzt werden."), QMessageBox::Ok);
btn_WPAdd->setEnabled(false);
}
}
 
// WayPoint-Liste übertragen
void dlg_Main::slot_btn_WPFly()
{
send_WayPoints(l_WayPoints, 0);
}
 
// WayPpoint-Liste löschen
void dlg_Main::slot_btn_WPDelete()
{
p_RouteWP.clear();
l_WayPoints.clear();
o_RouteWP->clearGeometries();
l_RouteWP = new LineString(p_RouteWP, "", Pen[0]);
// o_RouteWP->addGeometry(l_RouteWP);
// o_RouteWP->removeGeometry(l_RouteWP);
 
o_Map->updateRequestNew();
 
btn_WPFly->setEnabled(false);
btn_WPAdd->setEnabled(true);
}
 
// WayPoint-Liste laden
void dlg_Main::slot_ac_LoadWayPoints()
{
QString Filename = QFileDialog::getOpenFileName(this, "WayPoint-Route laden", s_Dir.WPRoutes, "Mikrokopter WayPoints(*.mkw);;KML-Datei(*.kml);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
if (Filename.endsWith(".kml", Qt::CaseInsensitive))
{
cb_ShowWPs->setChecked(true);
btn_WPFly->setEnabled(true);
 
show_WayPoints(parse_WayPointKML(Filename));
}
if (Filename.endsWith(".mkw", Qt::CaseInsensitive))
{
cb_ShowWPs->setChecked(true);
btn_WPFly->setEnabled(true);
 
show_WayPoints(parse_WayPointMKW(Filename));
}
}
}
 
// WayPoint-Liste speichern
void dlg_Main::slot_ac_SaveRoute()
{
QString Filename = QFileDialog::getSaveFileName(this, "WayPoint-Route speichern", s_Dir.WPRoutes, "Mikrokopter WayPoints(*.mkw);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
if (!(Filename.endsWith(".mkw", Qt::CaseInsensitive)))
{
Filename = Filename + QString(".mkw");
}
 
save_WayPointsMKW(Filename);
}
}
 
// Route anzeigen / ausblenden
void dlg_Main::slot_ShowWayPoints(bool Show)
{
if (Show == true)
{
// qDebug("Error 1");
if (l_RouteWP->hasPoints())
{
// qDebug("Error 2");
o_RouteWP->addGeometry(l_RouteWP);
// qDebug("Error 3");
o_Map->updateRequestNew();
// qDebug("Error 4");
}
}
else
{
o_RouteWP->removeGeometry(l_RouteWP);
o_Map->updateRequestNew();
}
}
 
// Bilddatei als Karteladen.
void dlg_Main::slot_ac_LoadMapPic()
{
QString Filename = QFileDialog::getOpenFileName(this, "Bild als Karte", s_Dir.MapPics, "Bilddatei(*.jpg *.png *.gif);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
QFile *f_Points = new QFile(Filename + ".pos");
 
if (f_Points->exists())
{
f_Points->open(QIODevice::ReadOnly | QIODevice::Text);
 
QString s_Points;
 
while (!f_Points->atEnd())
{
s_Points.append(f_Points->readLine());
}
 
f_Points->close();
 
QStringList s_Pos = s_Points.split(",");
 
FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
 
o_Layer->addGeometry(fip);
o_Map->setView(QPointF(((s_Pos[0].toDouble() + s_Pos[2].toDouble()) / 2),((s_Pos[1].toDouble() + s_Pos[3].toDouble()) / 2)));
 
o_Map->updateRequestNew();
}
else
{
dlg_MapPos *f_MapPos = new dlg_MapPos(this);
 
if (f_MapPos->exec()==QDialog::Accepted)
{
QString Data = f_MapPos->get_Data();
 
f_Points->open(QIODevice::ReadWrite | QIODevice::Text);
 
QTextStream out(f_Points);
 
out.setRealNumberPrecision(9);
 
out << Data << "\n";
 
f_Points->close();
 
QStringList s_Pos = Data.split(",");
 
FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
 
o_Layer->addGeometry(fip);
o_Map->updateRequestNew();
}
 
}
}
}
 
// Flug als KML aufzeichnen
void dlg_Main::slot_ac_Record()
{
if (ac_Record->isChecked())
{
QString f_Name = s_Dir.Flights + "/" + QDate::currentDate().toString(("yyyy-MM-dd")) + "_" + QTime::currentTime().toString("hh-mm");
 
ac_Record->setText(tr("Stoppen"));
 
o_Record = new QFile(f_Name + ".kml");
o_Record->open(QIODevice::Append | QIODevice::Text);
 
QTextStream Out(o_Record);
Out << HandlerKML::get_Header(tr("Mikrokopter Flugaufzeichnung")) << "\n";
 
}
else
{
QTextStream Out(o_Record);
Out << HandlerKML::get_Footer() << "\n";
o_Record->close();
ac_Record->setText(tr("Aufzeichnen"));
}
}
 
// WayPpoint-Liste löschen
void dlg_Main::slot_ac_RouteDelete()
{
p_RouteFL.clear();
l_Track.clear();
o_RouteFL->clearGeometries();
l_RouteFL = new LineString(p_RouteFL, "", Pen[0]);
// o_RouteFL->removeGeometry(l_RouteFL);
 
o_Map->updateRequestNew();
}
 
// Programm Ende
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
o_Settings->GUI.Toolbar = ac_Toolbar->isChecked();
 
o_Settings->DATA.Intervall = sb_Intervall->value();
 
o_Settings->SERVER.Password = le_Password->text();
o_Settings->SERVER.IP_MAX = cb_Server->count();
o_Settings->SERVER.IP_ID = cb_Server->currentIndex();
 
for (int z = 0; z < cb_Server->count(); z++)
{
if (z < 10)
{
o_Settings->SERVER.IP[z] = cb_Server->itemText(z);
}
}
 
o_Settings->CONFIG.cb_CenterPos = cb_CenterPos->isChecked();
o_Settings->CONFIG.cb_ShowRoute = cb_ShowRoute->isChecked();
o_Settings->CONFIG.cb_ShowWPs = cb_ShowWPs->isChecked();
o_Settings->CONFIG.cb_Goto = cb_Goto->isChecked();
 
o_Settings->NAVI.StayTime = sb_Time->value();
 
o_Settings->write_Settings();
// qDebug("Ende.");
}
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_Main.h
0,0 → 1,164
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DLG_MAIN_H
#define DLG_MAIN_H
 
#include <QtGui/QMainWindow>
//#include <QTcpServer>
//#include <QTcpSocket>
#include <QFile>
 
#include "ui_dlg_Main.h"
 
#include "../Defines.h"
#include "../TypeDefs.h"
 
#include "../Classes/cSettings.h"
 
#include "../../Global/Kopter.h"
#include "../../Global/MK_Datatypes.h"
 
#include "../../Global/Class_QMapControl.h"
 
#include "../../Global/Class_Input/Input.h"
#include "../../Global/Class_Input/Input_TCP.h"
#include "../../Global/Class_Input/Input_TTY.h"
#include "../../Global/Class_HandlerIP/HandlerIP.h"
#include "../../Global/Class_HandlerMK/HandlerMK.h"
#include "../../Global/Class_HandlerKML/HandlerKML.h"
 
using namespace qmapcontrol;
 
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
Q_OBJECT
 
public:
dlg_Main();
~dlg_Main();
void create_Map();
 
private:
// Input Device.
Input *o_Input;
 
// Info über die Hardware
s_Hardware VersionInfo;
 
// Settings-Object
cSettings *o_Settings;
 
char c_Data[150];
 
// Programm-Initialisirungen
void init_GUI();
void init_Connections();
 
void init_Directorys();
s_Directorys s_Dir;
 
// Einkommende Datenpackete zerlegen.
void parse_MK_Data(QString t_Data);
void parse_IP_Data(QString t_Data);
 
// QMK-Maps
QFile *o_Record;
 
QPen* Pen[6];
 
MapControl *o_Map;
MapAdapter *o_Adapter;
 
Layer *o_Layer;
Layer *o_Click;
 
Layer *o_Info;
Layer *o_RouteWP;
Layer *o_RouteFL;
 
QList<Point*> p_RouteWP;
LineString* l_RouteWP;
 
QList<Point*> p_RouteFL;
LineString* l_RouteFL;
 
Point* LastPos;
Point* LastClick;
Point* ClickPoint;
Point* Flag;
Point* Home;
Point* Target;
 
QPointF MapCenter;
 
QList<sWayPoint> l_WayPoints;
QList<sWayPoint> l_Track;
 
QList<sWayPoint> parse_WayPointKML(QString s_File);
QList<sWayPoint> parse_WayPointMKW(QString s_File);
 
void show_WayPoints(QList<sWayPoint> WayPoints);
 
void save_WayPointsMKW(QString s_File);
 
void add_Position(s_MK_NaviData t_NaviData);
void show_Data(s_MK_NaviData t_NaviData);
void send_Target(Point *t_Target);
void send_WayPoints(QList<sWayPoint> l_WayPoints, int t_Pos = 0);
 
private slots:
void slot_ac_About();
void slot_ac_Toolbar();
 
void slot_ac_Connect();
void slot_sb_Intervall(int t_Intervall);
 
// Einkommende Datenpackete.
void slot_Input_Data(QString t_Data);
void slot_Input_Disconnected(int Error);
void slot_Input_Connected();
 
// QMK-Maps
void slot_Zoom(int t_Zoom);
void slot_ChangeMap(int);
void slot_Click(const QMouseEvent*, const QPointF);
 
void slot_btn_WPAdd();
void slot_btn_WPFly();
void slot_btn_WPDelete();
void slot_ShowWayPoints(bool);
 
void slot_ac_RouteDelete();
 
void slot_ac_LoadMapPic();
void slot_ac_Record();
 
// void slot_GotoTarget();
// void slot_Close();
 
void slot_ac_LoadWayPoints();
void slot_ac_SaveRoute();
 
protected:
virtual void wheelEvent(QWheelEvent *event);
virtual void resizeEvent ( QResizeEvent * event );
 
};
 
#endif // DLG_MAIN_H
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_Main.ui
0,0 → 1,832
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>711</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="1" colspan="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,0,0">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="btn_Connect">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Server:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cb_Server">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>PW:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_Password">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Intervall:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sb_Intervall">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string> ms</string>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>500</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>35</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame_3">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>WP:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WP">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>50</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WPTime">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WPDist">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Home:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_HomeDist">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Mode:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_Mode">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>138</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="2" rowspan="4">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Route</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Verweilzeit</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="sb_Time">
<property name="maximum">
<number>300</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Sek.</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btn_WPAdd">
<property name="text">
<string>hinzufügen</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="btn_WPFly">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>abfliegen</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="btn_WPDelete">
<property name="text">
<string>löschen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_4">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<widget class="QCheckBox" name="cb_ShowWPs">
<property name="text">
<string>ausgewählte
Route anzeigen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cb_CenterPos">
<property name="text">
<string>auf IST-Position
zentrieren</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_ShowRoute">
<property name="text">
<string>geflogene
Route anzeigen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<spacer name="AAA1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QFrame" name="w_Map">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="l_Map"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<spacer name="AAA2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="1">
<widget class="QSlider" name="sl_Zoom">
<property name="maximum">
<number>18</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Zoom:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="cb_Goto">
<property name="text">
<string>Position bei Click Anfliegen</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="cb_Maps">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>OpenStreetMap</string>
</property>
</item>
<item>
<property name="text">
<string>OpenAerialMap</string>
</property>
</item>
<item>
<property name="text">
<string>Google: Map</string>
</property>
</item>
<item>
<property name="text">
<string>Google: Satellit</string>
</property>
</item>
<item>
<property name="text">
<string>Yahoo: Map </string>
</property>
</item>
<item>
<property name="text">
<string>Yahoo: Satellit</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>711</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Quit"/>
<addaction name="ac_Connect"/>
</widget>
<widget class="QMenu" name="menu_Preferences">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Einstellungen</string>
</property>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<widget class="QMenu" name="menuExtras">
<property name="title">
<string>Extras</string>
</property>
<addaction name="ac_RouteDelete"/>
</widget>
<widget class="QMenu" name="menuAnsicht">
<property name="title">
<string>Ansicht</string>
</property>
<addaction name="ac_Toolbar"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menuAnsicht"/>
<addaction name="menu_Preferences"/>
<addaction name="menuExtras"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="ToolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="ac_Connect"/>
<addaction name="separator"/>
<addaction name="ac_LoadRoute"/>
<addaction name="ac_SaveRoute"/>
<addaction name="separator"/>
<addaction name="ac_LoadMap"/>
<addaction name="separator"/>
<addaction name="ac_Record"/>
<addaction name="separator"/>
</widget>
<widget class="QToolBar" name="tb_More">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</iconset>
</property>
<property name="text">
<string>Über QMK-Maps</string>
</property>
</action>
<action name="ac_Connect">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="text">
<string>Verbinden</string>
</property>
</action>
<action name="ac_LoadRoute">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Load.png</normaloff>:/Actions/Global/Images/Actions/Load.png</iconset>
</property>
<property name="text">
<string>Route Laden</string>
</property>
</action>
<action name="ac_SaveRoute">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Save.png</normaloff>:/Actions/Global/Images/Actions/Save.png</iconset>
</property>
<property name="text">
<string>Route Speichern</string>
</property>
</action>
<action name="ac_LoadMap">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Load-Map.png</normaloff>:/Actions/Global/Images/Actions/Load-Map.png</iconset>
</property>
<property name="text">
<string>Karte laden</string>
</property>
</action>
<action name="ac_Record">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Log-Record.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Log-Stop.png</normalon>:/Actions/Global/Images/Actions/Log-Record.png</iconset>
</property>
<property name="text">
<string>Aufzeichnen</string>
</property>
<property name="toolTip">
<string>Flug aufzeichnen</string>
</property>
</action>
<action name="ac_RouteDelete">
<property name="text">
<string>Geflogene Route löschen</string>
</property>
</action>
<action name="ac_Toolbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Toolbar</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="../QMK-Maps.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
<connection>
<sender>ac_Connect</sender>
<signal>triggered(bool)</signal>
<receiver>btn_Connect</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>133</x>
<y>51</y>
</hint>
</hints>
</connection>
<connection>
<sender>btn_Connect</sender>
<signal>clicked()</signal>
<receiver>ac_Connect</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel">
<x>133</x>
<y>51</y>
</hint>
<hint type="destinationlabel">
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_MapPos.cpp
0,0 → 1,29
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dlg_MapPos.h"
 
dlg_MapPos::dlg_MapPos(QWidget *parent) : QDialog(parent)
{
setupUi(this);
}
 
QString dlg_MapPos::get_Data()
{
return QString(le_Links->text().replace(",", ".") + ", " + le_Oben->text().replace(",", ".") + ", " + le_Rechts->text().replace(",", ".") + ", " + le_Unten->text().replace(",", "."));
}
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_MapPos.h
0,0 → 1,35
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DLG_MAPPOS_H
#define DLG_MAPPOS_H
 
#include <QDialog>
 
#include "ui_dlg_MapPos.h"
 
class dlg_MapPos : public QDialog, public Ui::dlg_MapPos_UI
{
Q_OBJECT
 
public:
dlg_MapPos(QWidget *parent = 0);
QString get_Data();
};
 
#endif // DLG_MAPPOS_H
/QMK-Groundstation/trunk/QMK-Maps/Dialogs/dlg_MapPos.ui
0,0 → 1,162
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_MapPos_UI</class>
<widget class="QDialog" name="dlg_MapPos_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>129</height>
</rect>
</property>
<property name="windowTitle">
<string>Karten-Positionen</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="le_Oben"/>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="le_Links"/>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>115</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLineEdit" name="le_Rechts"/>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="le_Unten"/>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pb_Save">
<property name="text">
<string>Speichern</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Abbrechen</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>pb_Save</sender>
<signal>clicked()</signal>
<receiver>dlg_MapPos_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>109</y>
</hint>
<hint type="destinationlabel">
<x>108</x>
<y>100</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>dlg_MapPos_UI</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>340</x>
<y>112</y>
</hint>
<hint type="destinationlabel">
<x>339</x>
<y>65</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/trunk/QMK-Maps/QMK-Maps.pro
0,0 → 1,46
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
 
DEFINES += _TTY_POSIX_
include(../Global/Class_QMapControl.pri)
include(../Global/Class_SerialPort.pri)
 
QT += network \
xml
TARGET = QMK-Maps
TEMPLATE = app
DESTDIR = ../Binary
debug:DEFINES += _BETA_
OBJECTS_DIR = ../Binary/.build/QMK-Maps
UI_DIR = ../Binary/.build/QMK-Maps
MOC_DIR = ../Binary/.build/QMK-Maps
RCC_DIR = ../Binary/.build/QMK-Maps
RESOURCES += QMK-Maps.qrc
SOURCES += main.cpp \
../Global/Class_Input/Input.cpp \
../Global/Class_Input/Input_TCP.cpp \
../Global/Class_Input/Input_TTY.cpp \
../Global/Class_HandlerMK/HandlerMK.cpp \
../Global/Class_HandlerIP/HandlerIP.cpp \
Dialogs/dlg_Main.cpp \
Dialogs/dlg_MapPos.cpp \
Classes/cSettings.cpp \
../Global/Class_HandlerKML/HandlerKML.cpp
HEADERS += Defines.h \
../Global/Kopter.h \
../Global/MK_Datatypes.h \
../Global/Global.h \
../Global/Class_QMapControl.h \
../Global/Class_Input/Input.h \
../Global/Class_Input/Input_TCP.h \
../Global/Class_Input/Input_TTY.h \
../Global/Class_HandlerMK/HandlerMK.h \
../Global/Class_HandlerIP/HandlerIP.h \
Dialogs/dlg_Main.h \
Dialogs/dlg_MapPos.h \
Classes/cSettings.h \
TypeDefs.h \
../Global/Class_HandlerKML/HandlerKML.h
FORMS += Dialogs/dlg_Main.ui \
Dialogs/dlg_MapPos.ui
/QMK-Groundstation/trunk/QMK-Maps/QMK-Maps.pro.user
0,0 → 1,434
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>RunConfiguration0-BaseEnvironmentBase</variable>
<value type="int" >2</value>
</data>
<data>
<variable>RunConfiguration0-CommandLineArguments</variable>
<valuelist type="QVariantList" />
</data>
<data>
<variable>RunConfiguration0-ProFile</variable>
<value type="QString" >QMK-Maps.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString" >QMK-Maps</value>
</data>
<data>
<variable>RunConfiguration0-UseDyldImageSuffix</variable>
<value type="bool" >false</value>
</data>
<data>
<variable>RunConfiguration0-UseTerminal</variable>
<value type="bool" >false</value>
</data>
<data>
<variable>RunConfiguration0-UserEnvironmentChanges</variable>
<valuelist type="QVariantList" />
</data>
<data>
<variable>RunConfiguration0-UserSetName</variable>
<value type="bool" >false</value>
</data>
<data>
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
<value type="bool" >false</value>
</data>
<data>
<variable>RunConfiguration0-UserWorkingDirectory</variable>
<value type="QString" ></value>
</data>
<data>
<variable>RunConfiguration0-type</variable>
<value type="QString" >Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
<data>
<variable>activeRunConfiguration</variable>
<value type="int" >0</value>
</data>
<data>
<variable>activebuildconfiguration</variable>
<value type="QString" >Release</value>
</data>
<data>
<variable>buildConfiguration-Release</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value>
<value key="QtVersionId" type="int" >2</value>
<value key="ToolChain" type="int" >0</value>
<value key="addQDumper" type="" ></value>
<value key="buildConfiguration" type="int" >0</value>
<value key="buildDirectory" type="QString" >/home/Manuel/Documents/Entwicklung/QMK/QMK-Maps</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" >
<value type="QString" >COLORTERM=1</value>
<value type="QString" >CPU=x86_64</value>
<value type="QString" >CSHEDIT=emacs</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bemAcsizF4,guid=358e4873c8a50f474f072d2c4ae946a0</value>
<value type="QString" >DESKTOP_SESSION=kde4</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >DM_CONTROL=/var/run/xdmctl</value>
<value type="QString" >ENV=/etc/bash.bashrc</value>
<value type="QString" >FROM_HEADER=</value>
<value type="QString" >GPG_AGENT_INFO=/tmp/gpg-R686e7/S.gpg-agent:5803:1</value>
<value type="QString" >GS_LIB=/home/Manuel/.fonts</value>
<value type="QString" >GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve/gtk-2.0/gtkrc:/home/Manuel/.gtkrc-2.0-qtengine:/home/Manuel/.gtkrc-2.0:/home/Manuel/.kde4/share/config/gtkrc-2.0</value>
<value type="QString" >GTK_IM_MODULE=cedilla</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/Manuel/.gtkrc::/home/Manuel/.kde4/share/config/gtkrc</value>
<value type="QString" >G_BROKEN_FILENAMES=1</value>
<value type="QString" >G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252</value>
<value type="QString" >HISTSIZE=1000</value>
<value type="QString" >HOME=/home/Manuel</value>
<value type="QString" >HOST=KeyOz-WSL</value>
<value type="QString" >HOSTNAME=KeyOz-WSL</value>
<value type="QString" >HOSTTYPE=x86_64</value>
<value type="QString" >INFODIR=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INFOPATH=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INPUTRC=/etc/inputrc</value>
<value type="QString" >JAVA_BINDIR=/usr/lib64/jvm/java/bin</value>
<value type="QString" >JAVA_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JAVA_ROOT=/usr/lib64/jvm/java</value>
<value type="QString" >JDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JRE_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >KDE_FULL_SESSION=true</value>
<value type="QString" >KDE_MULTIHEAD=false</value>
<value type="QString" >KDE_SESSION_UID=1002</value>
<value type="QString" >KDE_SESSION_VERSION=4</value>
<value type="QString" >LADSPA_PATH=/usr/lib64/ladspa</value>
<value type="QString" >LANG=de_DE.UTF-8</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator-git:</value>
<value type="QString" >LESS=-M -I</value>
<value type="QString" >LESSCLOSE=lessclose.sh %s %s</value>
<value type="QString" >LESSKEY=/etc/lesskey.bin</value>
<value type="QString" >LESSOPEN=lessopen.sh %s</value>
<value type="QString" >LESS_ADVANCED_PREPROCESSOR=no</value>
<value type="QString" >LOGNAME=Manuel</value>
<value type="QString" >LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:</value>
<value type="QString" >LS_OPTIONS=-N --color=tty -T 0</value>
<value type="QString" >MACHTYPE=x86_64-suse-linux</value>
<value type="QString" >MAIL=/var/spool/mail/Manuel</value>
<value type="QString" >MANPATH=/usr/local/man:/usr/share/man:/opt/cross/share/man</value>
<value type="QString" >MINICOM=-c on</value>
<value type="QString" >MORE=-sl</value>
<value type="QString" >NNTPSERVER=news</value>
<value type="QString" >OSTYPE=linux</value>
<value type="QString" >PAGER=less</value>
<value type="QString" >PATH=/usr/bin:/home/Manuel/CodeSourcery/Sourcery_G++_Lite/bin:/home/Manuel/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin</value>
<value type="QString" >PROFILEREAD=true</value>
<value type="QString" >PWD=/home/Manuel/Documents</value>
<value type="QString" >PYTHONSTARTUP=/etc/pythonstart</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >QT_IM_MODULE=xim</value>
<value type="QString" >QT_IM_SWITCHER=imsw-multi</value>
<value type="QString" >QT_PLUGIN_PATH=/home/Manuel/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/</value>
<value type="QString" >QT_SYSTEM_DIR=/usr/share/desktop-data</value>
<value type="QString" >SDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >SESSION_MANAGER=local/KeyOz-WSL:@/tmp/.ICE-unix/5898,unix/KeyOz-WSL:/tmp/.ICE-unix/5898</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=1</value>
<value type="QString" >SSH_AGENT_PID=5804</value>
<value type="QString" >SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-gPQBk5724/agent.5724</value>
<value type="QString" >TERM=xterm</value>
<value type="QString" >TMPDIR=/tmp</value>
<value type="QString" >USER=Manuel</value>
<value type="QString" >USE_FAM=</value>
<value type="QString" >WINDOWMANAGER=/usr/bin/startkde</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHLOCALHOSTNAME=KeyOz-WSL</value>
<value type="QString" >XCURSOR_THEME=Oxygen_White</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share:/etc/opt/kde3/share:/opt/kde3/share</value>
<value type="QString" >XDG_SESSION_COOKIE=d2f223773c984c89331a62fa493ee8fd-1256801948.173169-483963220</value>
<value type="QString" >XDM_MANAGED=method=classic</value>
<value type="QString" >XKEYSYMDB=/usr/share/X11/XKeysymDB</value>
<value type="QString" >XMODIFIERS=@im=local</value>
<value type="QString" >XNLSPATH=/usr/share/X11/nls</value>
<value type="QString" >XSESSION_IS_UP=yes</value>
<value type="QString" >mc=() { . /usr/share/mc/bin/mc-wrapper.sh
}</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >/home/Manuel/Documents/Entwicklung/QMK/QMK-Maps/QMK-Maps.pro</value>
<value type="QString" >-spec</value>
<value type="QString" >/usr/share/qt4/mkspecs/linux-g++-64</value>
<value type="QString" >-r</value>
</valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/qmake</value>
<value key="abstractProcess.enabled" type="bool" >false</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/Manuel/Documents/Entwicklung/QMK/QMK-Maps</value>
<valuelist key="qmakeArgs" type="QVariantList" />
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" >
<value type="QString" >COLORTERM=1</value>
<value type="QString" >CPU=x86_64</value>
<value type="QString" >CSHEDIT=emacs</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-bemAcsizF4,guid=358e4873c8a50f474f072d2c4ae946a0</value>
<value type="QString" >DESKTOP_SESSION=kde4</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >DM_CONTROL=/var/run/xdmctl</value>
<value type="QString" >ENV=/etc/bash.bashrc</value>
<value type="QString" >FROM_HEADER=</value>
<value type="QString" >GPG_AGENT_INFO=/tmp/gpg-R686e7/S.gpg-agent:5803:1</value>
<value type="QString" >GS_LIB=/home/Manuel/.fonts</value>
<value type="QString" >GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve/gtk-2.0/gtkrc:/home/Manuel/.gtkrc-2.0-qtengine:/home/Manuel/.gtkrc-2.0:/home/Manuel/.kde4/share/config/gtkrc-2.0</value>
<value type="QString" >GTK_IM_MODULE=cedilla</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/Manuel/.gtkrc::/home/Manuel/.kde4/share/config/gtkrc</value>
<value type="QString" >G_BROKEN_FILENAMES=1</value>
<value type="QString" >G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252</value>
<value type="QString" >HISTSIZE=1000</value>
<value type="QString" >HOME=/home/Manuel</value>
<value type="QString" >HOST=KeyOz-WSL</value>
<value type="QString" >HOSTNAME=KeyOz-WSL</value>
<value type="QString" >HOSTTYPE=x86_64</value>
<value type="QString" >INFODIR=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INFOPATH=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INPUTRC=/etc/inputrc</value>
<value type="QString" >JAVA_BINDIR=/usr/lib64/jvm/java/bin</value>
<value type="QString" >JAVA_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JAVA_ROOT=/usr/lib64/jvm/java</value>
<value type="QString" >JDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JRE_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >KDE_FULL_SESSION=true</value>
<value type="QString" >KDE_MULTIHEAD=false</value>
<value type="QString" >KDE_SESSION_UID=1002</value>
<value type="QString" >KDE_SESSION_VERSION=4</value>
<value type="QString" >LADSPA_PATH=/usr/lib64/ladspa</value>
<value type="QString" >LANG=de_DE.UTF-8</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator-git:</value>
<value type="QString" >LESS=-M -I</value>
<value type="QString" >LESSCLOSE=lessclose.sh %s %s</value>
<value type="QString" >LESSKEY=/etc/lesskey.bin</value>
<value type="QString" >LESSOPEN=lessopen.sh %s</value>
<value type="QString" >LESS_ADVANCED_PREPROCESSOR=no</value>
<value type="QString" >LOGNAME=Manuel</value>
<value type="QString" >LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:</value>
<value type="QString" >LS_OPTIONS=-N --color=tty -T 0</value>
<value type="QString" >MACHTYPE=x86_64-suse-linux</value>
<value type="QString" >MAIL=/var/spool/mail/Manuel</value>
<value type="QString" >MANPATH=/usr/local/man:/usr/share/man:/opt/cross/share/man</value>
<value type="QString" >MINICOM=-c on</value>
<value type="QString" >MORE=-sl</value>
<value type="QString" >NNTPSERVER=news</value>
<value type="QString" >OSTYPE=linux</value>
<value type="QString" >PAGER=less</value>
<value type="QString" >PATH=/usr/bin:/home/Manuel/CodeSourcery/Sourcery_G++_Lite/bin:/home/Manuel/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin</value>
<value type="QString" >PROFILEREAD=true</value>
<value type="QString" >PWD=/home/Manuel/Documents</value>
<value type="QString" >PYTHONSTARTUP=/etc/pythonstart</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >QT_IM_MODULE=xim</value>
<value type="QString" >QT_IM_SWITCHER=imsw-multi</value>
<value type="QString" >QT_PLUGIN_PATH=/home/Manuel/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/</value>
<value type="QString" >QT_SYSTEM_DIR=/usr/share/desktop-data</value>
<value type="QString" >SDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >SESSION_MANAGER=local/KeyOz-WSL:@/tmp/.ICE-unix/5898,unix/KeyOz-WSL:/tmp/.ICE-unix/5898</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=1</value>
<value type="QString" >SSH_AGENT_PID=5804</value>
<value type="QString" >SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-gPQBk5724/agent.5724</value>
<value type="QString" >TERM=xterm</value>
<value type="QString" >TMPDIR=/tmp</value>
<value type="QString" >USER=Manuel</value>
<value type="QString" >USE_FAM=</value>
<value type="QString" >WINDOWMANAGER=/usr/bin/startkde</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHLOCALHOSTNAME=KeyOz-WSL</value>
<value type="QString" >XCURSOR_THEME=Oxygen_White</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share:/etc/opt/kde3/share:/opt/kde3/share</value>
<value type="QString" >XDG_SESSION_COOKIE=d2f223773c984c89331a62fa493ee8fd-1256801948.173169-483963220</value>
<value type="QString" >XDM_MANAGED=method=classic</value>
<value type="QString" >XKEYSYMDB=/usr/share/X11/XKeysymDB</value>
<value type="QString" >XMODIFIERS=@im=local</value>
<value type="QString" >XNLSPATH=/usr/share/X11/nls</value>
<value type="QString" >XSESSION_IS_UP=yes</value>
<value type="QString" >mc=() { . /usr/share/mc/bin/mc-wrapper.sh
}</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool" >false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >-j2</value>
<value type="QString" >-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool" >true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/Manuel/Documents/Entwicklung/QMK/QMK-Maps</value>
<valuelist key="makeargs" type="QVariantList" >
<value type="QString" >-j2</value>
</valuelist>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" >Release</value>
<valuelist key="abstractProcess.Environment" type="QVariantList" >
<value type="QString" >COLORTERM=1</value>
<value type="QString" >CPU=x86_64</value>
<value type="QString" >CSHEDIT=emacs</value>
<value type="QString" >CVS_RSH=ssh</value>
<value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-cPlUO1gXzY,guid=4f793e28b07bc3f4f2152b9f4aba164f</value>
<value type="QString" >DESKTOP_SESSION=kde4</value>
<value type="QString" >DESKTOP_STARTUP_ID=</value>
<value type="QString" >DISPLAY=:0.0</value>
<value type="QString" >DM_CONTROL=/var/run/xdmctl</value>
<value type="QString" >ENV=/etc/bash.bashrc</value>
<value type="QString" >FROM_HEADER=</value>
<value type="QString" >GPG_AGENT_INFO=/tmp/gpg-gTct3X/S.gpg-agent:4112:1</value>
<value type="QString" >GS_LIB=/home/Manuel/.fonts</value>
<value type="QString" >GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve/gtk-2.0/gtkrc:/home/Manuel/.gtkrc-2.0-qtengine:/home/Manuel/.gtkrc-2.0:/home/Manuel/.kde4/share/config/gtkrc-2.0</value>
<value type="QString" >GTK_IM_MODULE=cedilla</value>
<value type="QString" >GTK_RC_FILES=/etc/gtk/gtkrc:/home/Manuel/.gtkrc::/home/Manuel/.kde4/share/config/gtkrc</value>
<value type="QString" >G_BROKEN_FILENAMES=1</value>
<value type="QString" >G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252</value>
<value type="QString" >HISTSIZE=1000</value>
<value type="QString" >HOME=/home/Manuel</value>
<value type="QString" >HOST=KeyOz-WSL</value>
<value type="QString" >HOSTNAME=KeyOz-WSL</value>
<value type="QString" >HOSTTYPE=x86_64</value>
<value type="QString" >INFODIR=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INFOPATH=/usr/local/info:/usr/share/info:/usr/info</value>
<value type="QString" >INPUTRC=/etc/inputrc</value>
<value type="QString" >JAVA_BINDIR=/usr/lib64/jvm/java/bin</value>
<value type="QString" >JAVA_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JAVA_ROOT=/usr/lib64/jvm/java</value>
<value type="QString" >JDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >JRE_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >KDE_FULL_SESSION=true</value>
<value type="QString" >KDE_MULTIHEAD=false</value>
<value type="QString" >KDE_SESSION_UID=1002</value>
<value type="QString" >KDE_SESSION_VERSION=4</value>
<value type="QString" >LADSPA_PATH=/usr/lib64/ladspa</value>
<value type="QString" >LANG=de_DE.UTF-8</value>
<value type="QString" >LD_LIBRARY_PATH=/usr/lib/qtcreator-git:</value>
<value type="QString" >LESS=-M -I</value>
<value type="QString" >LESSCLOSE=lessclose.sh %s %s</value>
<value type="QString" >LESSKEY=/etc/lesskey.bin</value>
<value type="QString" >LESSOPEN=lessopen.sh %s</value>
<value type="QString" >LESS_ADVANCED_PREPROCESSOR=no</value>
<value type="QString" >LOGNAME=Manuel</value>
<value type="QString" >LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:</value>
<value type="QString" >LS_OPTIONS=-N --color=tty -T 0</value>
<value type="QString" >MACHTYPE=x86_64-suse-linux</value>
<value type="QString" >MAIL=/var/spool/mail/Manuel</value>
<value type="QString" >MANPATH=/usr/local/man:/usr/share/man:/opt/cross/share/man</value>
<value type="QString" >MINICOM=-c on</value>
<value type="QString" >MORE=-sl</value>
<value type="QString" >NNTPSERVER=news</value>
<value type="QString" >OSTYPE=linux</value>
<value type="QString" >PAGER=less</value>
<value type="QString" >PATH=/usr/bin:/home/Manuel/CodeSourcery/Sourcery_G++_Lite/bin:/home/Manuel/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin</value>
<value type="QString" >PROFILEREAD=true</value>
<value type="QString" >PWD=/home/Manuel/Documents</value>
<value type="QString" >PYTHONSTARTUP=/etc/pythonstart</value>
<value type="QString" >QTDIR=/usr</value>
<value type="QString" >QT_IM_MODULE=xim</value>
<value type="QString" >QT_IM_SWITCHER=imsw-multi</value>
<value type="QString" >QT_PLUGIN_PATH=/home/Manuel/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/</value>
<value type="QString" >QT_SYSTEM_DIR=/usr/share/desktop-data</value>
<value type="QString" >SDK_HOME=/usr/lib64/jvm/java</value>
<value type="QString" >SESSION_MANAGER=local/KeyOz-WSL:@/tmp/.ICE-unix/4647,unix/KeyOz-WSL:/tmp/.ICE-unix/4647</value>
<value type="QString" >SHELL=/bin/bash</value>
<value type="QString" >SHLVL=1</value>
<value type="QString" >SSH_AGENT_PID=4113</value>
<value type="QString" >SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass</value>
<value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-bMBMs3941/agent.3941</value>
<value type="QString" >TERM=xterm</value>
<value type="QString" >TMPDIR=/tmp</value>
<value type="QString" >USER=Manuel</value>
<value type="QString" >USE_FAM=</value>
<value type="QString" >WINDOWMANAGER=/usr/bin/startkde</value>
<value type="QString" >WINDOWPATH=7</value>
<value type="QString" >XAUTHLOCALHOSTNAME=KeyOz-WSL</value>
<value type="QString" >XCURSOR_THEME=Oxygen_White</value>
<value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
<value type="QString" >XDG_DATA_DIRS=/usr/share:/etc/opt/kde3/share:/opt/kde3/share</value>
<value type="QString" >XDG_SESSION_COOKIE=d2f223773c984c89331a62fa493ee8fd-1253709386.933592-1670885275</value>
<value type="QString" >XDM_MANAGED=method=classic</value>
<value type="QString" >XKEYSYMDB=/usr/share/X11/XKeysymDB</value>
<value type="QString" >XMODIFIERS=@im=local</value>
<value type="QString" >XNLSPATH=/usr/share/X11/nls</value>
<value type="QString" >XSESSION_IS_UP=yes</value>
<value type="QString" >mc=() { . /usr/share/mc/bin/mc-wrapper.sh
}</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool" >true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList" >
<value type="QString" >clean</value>
<value type="QString" >-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString" >/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool" >true</value>
<value key="abstractProcess.workingDirectory" type="QString" >/home/Manuel/Documents/Entwicklung/QMK/QMK-Maps</value>
<value key="cleanConfig" type="bool" >true</value>
<valuelist key="makeargs" type="QVariantList" >
<value type="QString" >clean</value>
</valuelist>
</valuemap>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList" >
<value type="QString" >Release</value>
</valuelist>
</data>
<data>
<variable>buildstep0</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value>
<value key="mkspec" type="QString" ></value>
</valuemap>
</data>
<data>
<variable>buildstep1</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value>
</valuemap>
</data>
<data>
<variable>buildsteps</variable>
<valuelist type="QVariantList" >
<value type="QString" >trolltech.qt4projectmanager.qmake</value>
<value type="QString" >trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>cleanstep0</variable>
<valuemap type="QVariantMap" >
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString" ></value>
<value key="clean" type="bool" >true</value>
</valuemap>
</data>
<data>
<variable>cleansteps</variable>
<valuelist type="QVariantList" >
<value type="QString" >trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>defaultFileEncoding</variable>
<value type="QByteArray" >UTF-8</value>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap" />
</data>
</qtcreator>
/QMK-Groundstation/trunk/QMK-Maps/QMK-Maps.qrc
0,0 → 1,23
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Maps.png</file>
</qresource>
<qresource prefix="Flags" >
<file>../Global/Images/Flags/Target.png</file>
<file>../Global/Images/Flags/flag-black.png</file>
<file>../Global/Images/Flags/flag-blue.png</file>
<file>../Global/Images/Flags/flag-green.png</file>
<file>../Global/Images/Flags/flag-red.png</file>
<file>../Global/Images/Flags/flag-yellow.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Log-Record.png</file>
<file>../Global/Images/Actions/Log-Stop.png</file>
<file>../Global/Images/Actions/Load-Map.png</file>
<file>../Global/Images/Actions/Save.png</file>
<file>../Global/Images/Actions/Load.png</file>
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
</qresource>
</RCC>
/QMK-Groundstation/trunk/QMK-Maps/TypeDefs.h
0,0 → 1,32
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
 
struct sWayPoint
{
double Longitude;
double Latitude;
double Altitude;
int Time;
};
 
#endif // TYPEDEFS_H
/QMK-Groundstation/trunk/QMK-Maps/main.cpp
0,0 → 1,38
/***************************************************************************
* Copyright (C) 2009 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->show();
 
MainApp->create_Map();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}