Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 343 → Rev 358

/QMK-Groundstation/trunk/Classes/ToolBox.cpp
67,7 → 67,7
 
if (RX.Input[ptrIn] == 0)
{
qDebug("QString to Char ERROR...!!!!");
// qDebug("QString to Char ERROR...!!!!");
return false;
}
 
/QMK-Groundstation/trunk/Classes/cConnection.cpp
27,10 → 27,10
 
connect(o_Timer, SIGNAL(timeout()), SLOT(slot_Timer()));
 
TTY->setBaudRate(BAUD57600); //BaudRate
TTY->setDataBits(DATA_8); //DataBits
TTY->setParity(PAR_NONE); //Parity
TTY->setStopBits(STOP_1); //StopBits
TTY->setBaudRate(BAUD57600); //BaudRate
TTY->setDataBits(DATA_8); //DataBits
TTY->setParity(PAR_NONE); //Parity
TTY->setStopBits(STOP_1); //StopBits
TTY->setFlowControl(FLOW_OFF); //FlowControl
 
TTY->setTimeout(0, 10);
/QMK-Groundstation/trunk/Forms/dlg_Map.cpp
27,9 → 27,6
cb_Maps->removeItem(3);
cb_Maps->removeItem(2);
 
// Noch nicht eingebaut also Button weg.
pb_SendWaypoints->setVisible(false);
 
pb_Add->setEnabled(false);
pb_Goto->setEnabled(false);
}
46,6 → 43,7
connect(pb_Add, SIGNAL(clicked()), this, SLOT(slot_AddWayPoint()));
connect(pb_Delete, SIGNAL(clicked()), this, SLOT(slot_DeleteWayPoints()));
connect(pb_Goto, SIGNAL(clicked()), this, SLOT(slot_GotoTarget()));
connect(pb_SendWaypoints, SIGNAL(clicked()), this, SLOT(slot_SendWayPoints()));
connect(cb_Maps, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_ChangeMap(int)));
connect(this, SIGNAL(rejected()), this, SLOT(slot_Close()));
 
85,9 → 83,9
 
WayPoint.Longitude = x;
WayPoint.Latitude = y;
WayPoint.Time = sb_Time->value();
// WayPoint.Time = sb_Time->value();
 
l_WayPoint.append(WayPoint);
l_Track.append(WayPoint);
 
o_Route->removeGeometry(l_RouteFL);
p_RouteFL.append(new Point(x,y));
122,6 → 120,14
// Waypoint zur Liste hinzufügen
void dlg_Map::slot_AddWayPoint()
{
sWayPoint WayPoint;
 
WayPoint.Longitude = LastClick->longitude();
WayPoint.Latitude = LastClick->latitude();
WayPoint.Time = sb_Time->value();
 
l_WayPoints.append(WayPoint);
 
o_Route->removeGeometry(l_RouteWP);
 
p_RouteWP.append(LastClick);
129,6 → 135,8
 
o_Route->addGeometry(l_RouteWP);
o_Map->updateRequestNew();
 
pb_SendWaypoints->setEnabled(true);
}
 
// Waypoint-Liste löschen
136,10 → 144,15
{
o_Route->removeGeometry(l_RouteWP);
p_RouteWP.clear();
l_WayPoint.clear();
l_WayPoints.clear();
o_Map->updateRequestNew();
}
 
void dlg_Map::slot_SendWayPoints()
{
emit(set_WayPoints(l_WayPoints));
}
 
// Zum Zielpunkt fliegen
void dlg_Map::slot_GotoTarget()
{
215,7 → 228,6
break;
case 1 : // Yahoo Sat
{
// o_Adapter = new WMSMapAdapter("openaerialmap.org", "/wms/wms.asp?wms=WorldMap&LAYERS=world&FORMAT=image/png&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&TRANSPARENT=FALSE", 256);
o_Adapter = new TileMapAdapter("tile.openaerialmap.org", "/tiles/1.0.0/openaerialmap-900913/%1/%2/%3.png", 256, 0, 17);
}
break;
/QMK-Groundstation/trunk/Forms/dlg_Map.h
64,7 → 64,8
Point *ClickPoint;
QPointF MapCenter;
 
QList<sWayPoint> l_WayPoint;
QList<sWayPoint> l_WayPoints;
QList<sWayPoint> l_Track;
 
private slots:
void slot_Zoom(int t_Zoom);
73,6 → 74,7
 
void slot_AddWayPoint();
void slot_DeleteWayPoints();
void slot_SendWayPoints();
 
void slot_GotoTarget();
void slot_Close();
82,6 → 84,7
 
signals:
void set_Target(sWayPoint Target);
void set_WayPoints(QList<sWayPoint>);
void set_Settings(cSettings *t_Settings);
 
};
/QMK-Groundstation/trunk/Forms/dlg_MotorMixer.cpp
309,7 → 309,7
 
void dlg_MotorMixer::slot_pb_LOAD()
{
QString Filename = QFileDialog::getOpenFileName(this, "Mikrokopter MotorMixer laden", o_Settings->DIR.Parameter + "", "MK MotorMixer(*.mkm);;Alle Dateien (*)");
QString Filename = QFileDialog::getOpenFileName(this, tr("Mikrokopter MotorMixer laden"), o_Settings->DIR.Parameter + "", tr("MK MotorMixer(*.mkm);;Alle Dateien (*)"));
 
if (!Filename.isEmpty())
{
357,7 → 357,7
 
void dlg_MotorMixer::slot_pb_SAVE()
{
QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter MotorMixer speichern", o_Settings->DIR.Parameter + "/" + le_NAME->text(), "MK MotorMixer(*.mkm);;Alle Dateien (*)");
QString Filename = QFileDialog::getSaveFileName(this, tr("Mikrokopter MotorMixer speichern"), o_Settings->DIR.Parameter + "/" + le_NAME->text(), tr("MK MotorMixer(*.mkm);;Alle Dateien (*)"));
 
if (!Filename.isEmpty())
{
/QMK-Groundstation/trunk/Forms/mktool.cpp
74,7 → 74,7
// Settings-Tab hinzufügen.
f_Settings = new wdg_Settings( this );
f_Settings->set_Config(Settings);
tab_Main->insertTab ( 2, f_Settings, ac_View2->icon(), "FC-Settings");
tab_Main->insertTab ( 2, f_Settings, ac_View2->icon(), tr("FC-Settings"));
tab_Main->widget(2)->setObjectName("Tab_2");
 
// Zusätzliche Widgets in die Toolbar.
234,6 → 234,7
 
// Waypoints übergeben
connect(f_Map, SIGNAL(set_Target(sWayPoint)), this , SLOT(slot_MAP_SetTarget(sWayPoint)));
connect(f_Map, SIGNAL(set_WayPoints(QList<sWayPoint>)), this , SLOT(slot_MAP_SetWayPoints(QList<sWayPoint>)));
 
// Daten Senden / Empfangen
connect(o_Connection, SIGNAL(newData(sRxData)), this, SLOT(slot_newData(sRxData)));
289,7 → 290,7
connect(pb_HexFile, SIGNAL(clicked()), this, SLOT(slot_pb_HexFile()));
 
// Wegpunkt-Befehl
connect(pb_FlyTo, SIGNAL(clicked()), this, SLOT(slot_pb_SendWaypoint()));
connect(pb_FlyTo, SIGNAL(clicked()), this, SLOT(slot_pb_SendTarget()));
 
// CVS-Record starten / stoppen
connect(ac_RecordCSV, SIGNAL(triggered()), this, SLOT(slot_RecordLog()));
377,22 → 378,13
 
void MKTool::slot_Test()
{
// qDebug("Decode Data");
sRxData RX;
 
RX.String = IN->text();
 
// qDebug(RX.String.toLatin1().data());
RX.Input = RX.String.toLatin1().data();
 
// if (ToolBox::check_CRC(RX.String))
{
qDebug("Decode Data CRC OK");
RX.Input = RX.String.toLatin1().data();
 
// qDebug(RX.Input);
 
slot_newData(RX);
}
slot_newData(RX);
}
 
// KML-Datei nach Wegpunkt parsen
413,13 → 405,13
}
 
// Waypoint zur NC Senden.
void MKTool::slot_pb_SendWaypoint()
void MKTool::slot_pb_SendTarget()
{
if ((Navi.Current.Longitude == 0) && (Navi.Current.Latitude == 0))
{
QMessageBox msgB;
QString msg;
msgB.setText("Fehler: Es konnten keine GPS-Daten vom Mikrokopter empfangen werden");
msgB.setText(tr("Fehler: Es konnten keine GPS-Daten vom Mikrokopter empfangen werden"));
msgB.exec();
return;
}
447,7 → 439,7
desired_pos.Position.Status = NEWDATA;
desired_pos.Heading = -1;
desired_pos.ToleranceRadius = 5;
desired_pos.HoldTime = 60;
desired_pos.HoldTime = sb_TarTime->value();
desired_pos.Event_Flag = 0;
desired_pos.reserve[0] = 0; // reserve
desired_pos.reserve[1] = 0; // reserve
466,8 → 458,8
{
QMessageBox msgB;
QString msg;
msg += "Bitte die Eingabe ueberpruefen!\n";
msg += "Die Werte muessen sich in der Naehe der aktuellen Koordinaten befinden\n";
msg += tr("Bitte die Eingabe ueberpruefen!\n");
msg += tr("Die Werte muessen sich in der Naehe der aktuellen Koordinaten befinden\n");
msg += "(Lon: ";
msg += ToolBox::get_Float(Navi.Current.Longitude,7);
msg += ", ";
633,7 → 625,7
 
QMK_Server->Disconnect();
QMK_Server->setProperty("Connect", false);
ac_QMKServer->setText("QMK-Server Verbinden");
ac_QMKServer->setText(tr("QMK-Server Verbinden"));
}
}
}
642,7 → 634,7
void MKTool::slot_QMKS_Connected()
{
QMK_Server->setProperty("Connect", true);
ac_QMKServer->setText("QMK-Server Trennnen");
ac_QMKServer->setText(tr("QMK-Server Trennnen"));
lb_Status->setText(tr("Verbunden mit QMK-Datenserver."));
}
 
650,7 → 642,7
void MKTool::slot_QMKS_Disconnected(int Error)
{
QMK_Server->setProperty("Connect", false);
ac_QMKServer->setText("QMK-Server Verbinden");
ac_QMKServer->setText(tr("QMK-Server Verbinden"));
ac_QMKServer->setChecked(false);
 
disconnect(QMK_Server, SIGNAL(sig_Disconnected(int)), 0, 0);
660,19 → 652,19
case 1 :
{
lb_Status->setText(tr("Verbindung vom Server beendet."));
QMessageBox::warning(this, QA_NAME,"QMK-Datenserver: Verbindung wurde vom Server beendet.", QMessageBox::Ok);
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok);
}
break;
case 2 :
{
lb_Status->setText(tr("Server nicht gefunden."));
QMessageBox::warning(this, QA_NAME,"QMK-Datenserver: Kann nicht zum Server verbinden.", QMessageBox::Ok);
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,"QMK-Datenserver: Loginname oder Password falsch.", QMessageBox::Ok);
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok);
}
break;
default :
766,6 → 758,47
}
}
 
void MKTool::slot_MAP_SetWayPoints(QList<sWayPoint> l_WayPoints)
{
Waypoint_t WayPoint;
double Longitude, Latitude;
 
// Waypoint-Liste löschen
WayPoint.Position.Status = INVALID;
o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false);
ToolBox::Wait(SLEEP);
 
for (int z = 0; z < l_WayPoints.count(); z++)
{
Longitude = l_WayPoints[z].Longitude;
Latitude = l_WayPoints[z].Latitude;
 
if (Longitude < 100)
Longitude *= 10000000+0.5;
 
if (Latitude < 100)
Latitude *= 10000000+0.5;
 
//fülle Wegpunkt-Daten
WayPoint.Position.Altitude = 0;
WayPoint.Position.Longitude = int32_t(Longitude);
WayPoint.Position.Latitude = int32_t(Latitude);
WayPoint.Position.Status = NEWDATA;
WayPoint.Heading = -1;
WayPoint.ToleranceRadius = 5;
WayPoint.HoldTime = l_WayPoints[z].Time;
WayPoint.Event_Flag = 0;
WayPoint.reserve[0] = 0; // reserve
WayPoint.reserve[1] = 0; // reserve
WayPoint.reserve[2] = 0; // reserve
WayPoint.reserve[3] = 0; // reserve
 
o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false);
// ToolBox::Wait(SLEEP);
}
 
}
 
void MKTool::slot_MAP_SetTarget(sWayPoint Target)
{
 
782,7 → 815,7
le_TarLat->setText(s_Lat);
sb_TarTime->setValue(Target.Time);
 
slot_pb_SendWaypoint();
slot_pb_SendTarget();
}
 
void MKTool::slot_ac_Config()
821,12 → 854,12
if (logger->is_active())
{
 
ac_RecordCSV->setText("Log Stop");
ac_RecordCSV->setText(tr("Log Stop"));
lb_Status->setText(tr("Log-Record gestartet."));
}
else
{
ac_RecordCSV->setText("Log Aufzeichnen");
ac_RecordCSV->setText(tr("Log Aufzeichnen"));
lb_Status->setText(tr("Log-Record gestopt."));
}
}
863,14 → 896,14
if (ac_StartPlotter->isChecked())
{
lb_Status->setText(tr("Datenplotter gestartet."));
ac_StartPlotter->setText("Stop Plotter");
pb_StartPlotter->setText("Stop Plotter");
ac_StartPlotter->setText(tr("Stop Plotter"));
pb_StartPlotter->setText(tr("Stop Plotter"));
}
else
{
lb_Status->setText(tr("Datenplotter gestopt."));
ac_StartPlotter->setText("Start Plotter");
pb_StartPlotter->setText("Start Plotter");
ac_StartPlotter->setText(tr("Start Plotter"));
pb_StartPlotter->setText(tr("Start Plotter"));
}
}
 
1099,9 → 1132,9
Hardware = "BL-Ctrl";
}
 
QString Message = "Firmeware-Datei \n\n";
QString Message = trUtf8("Firmeware-Datei \n\n");
Message = Message + le_HexFile->text() + "\n\n";
Message = Message + "an " + Hardware + trUtf8(" mit AVRDUDE - Seriel & Bootloader über ") + le_Port->text() + trUtf8(" übertragen?\n");
Message = Message + trUtf8("an ") + Hardware + trUtf8(" mit AVRDUDE - Seriel & Bootloader über ") + le_Port->text() + trUtf8(" übertragen?\n");
 
if (le_HexFile->text() == "")
{
1338,13 → 1371,13
 
switch(RX.Decode[N_NC_FLAGS])
{
case 0x01 : lb_Mode->setText("Free"); break;
case 0x02 : lb_Mode->setText("Position Hold"); break;
case 0x04 : lb_Mode->setText("Coming Home"); break;
case 0x08 : lb_Mode->setText("Range Limit"); break;
case 0x10 : lb_Mode->setText("Serial Error"); break;
case 0x20 : lb_Mode->setText("Target reached"); break;
case 0x40 : lb_Mode->setText("Manual Control"); break;
case 0x01 : lb_Mode->setText(tr("Free")); break;
case 0x02 : lb_Mode->setText(tr("Position Hold")); break;
case 0x04 : lb_Mode->setText(tr("Coming Home")); break;
case 0x08 : lb_Mode->setText(tr("Range Limit")); break;
case 0x10 : lb_Mode->setText(tr("Serial Error")); break;
case 0x20 : lb_Mode->setText(tr("Target reached")); break;
case 0x40 : lb_Mode->setText(tr("Manual Control")); break;
}
 
Navi.Current.Longitude = ToolBox::Data2Long(RX.Decode, N_CUR_LONGITUDE, true);
1497,7 → 1530,7
f_Settings->pb_Write->setDisabled(true);
 
QMessageBox::warning(this, QA_NAME,
"Versionen inkompatibel. \nParameterbearbeitung nicht moeglich.", QMessageBox::Ok);
tr("Versionen inkompatibel. \nParameterbearbeitung nicht moeglich."), QMessageBox::Ok);
}
}
break;
1601,7 → 1634,7
{
// AllowSend = false;
QMessageBox::warning(this, QA_NAME,
"Serielles Protokoll Inkompatibel. \nBitte neue Programmversion installieren,", QMessageBox::Ok);
tr("Serielles Protokoll Inkompatibel. \nBitte neue Programmversion installieren,"), QMessageBox::Ok);
}
 
if (ac_NoDebug->isChecked())
1659,7 → 1692,7
TX_Data[1] = 0;
 
// DEP: Raus wenn Resend implementiert.
ToolBox::Wait(SLEEP);
// ToolBox::Wait(SLEEP);
o_Connection->send_Cmd('q', ADDRESS_FC, TX_Data, 1, true);
qDebug("FC - Get Settings");
}
1676,7 → 1709,7
 
if (Settings->Analog1.Version != Mode.Version)
{
lb_Status->setText("Analoglabel-Version unterschiedlich. Lese Analoglabels neu aus.");
lb_Status->setText(tr("Analoglabel-Version unterschiedlich. Lese Analoglabels neu aus."));
slot_ac_GetLabels();
}
else
1764,7 → 1797,7
 
o_Connection->Close();
 
ac_ConnectTTY->setText("Kopter Verbinden");
ac_ConnectTTY->setText(tr("Kopter Verbinden"));
le_Port->setEnabled(true);
 
Ticker->stop();
1783,7 → 1816,7
 
if (o_Connection->Open(i_Type, le_Port->text()))
{
ac_ConnectTTY->setText("Kopter Trennen");
ac_ConnectTTY->setText(tr("Kopter Trennen"));
le_Port->setEnabled(false);
 
o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true);
/QMK-Groundstation/trunk/Forms/mktool.h
171,7 → 171,9
void slot_set_Settings(cSettings *t_Settings);
 
void slot_MAP_SetTarget(sWayPoint Target);
void slot_MAP_SetWayPoints(QList<sWayPoint> l_WayPoints);
 
 
void slot_showTerminal(int Typ, QString Text);
 
void slot_ac_Hardware();
197,7 → 199,7
void slot_ac_MotorMixer();
 
void slot_pb_HexFile();
void slot_pb_SendWaypoint();
void slot_pb_SendTarget();
 
// Default-Ticker
void slot_Ticker();
/QMK-Groundstation/trunk/global.h
56,7 → 56,7
static const int SLEEP = 500000;
 
static const QString QA_NAME = "QMK-Groundstation";
static const QString QA_VERSION_NR = "0.8.0";
static const QString QA_VERSION_NR = "0.8.2";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
81,7 → 81,7
#endif
 
 
static const QString QA_DATE = "05.04.2009";
static const QString QA_DATE = "10.04.2009";
static const QString QA_YEAR = "2008-2009";
static const QString QA_AUTHOR = "Manuel Schrape";
static const QString QA_EMAIL = "manuel.schrape@gmx.de";