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); |