79,7 → 79,8 |
|
// Zusätzliche Widgets in die Toolbar. |
tb_TTY->addWidget(lb_Port); |
tb_TTY->addWidget(le_Port); |
tb_TTY->addWidget(cb_Port); |
// tb_TTY->addWidget(le_Port); |
|
tb_Hardware->addWidget(rb_SelFC); |
tb_Hardware->addWidget(rb_SelNC); |
142,8 → 143,15 |
ac_View5->setChecked(Settings->GUI.TabViews[5]); |
ac_View6->setChecked(Settings->GUI.TabViews[6]); |
|
le_Port->setText(Settings->TTY.Port); |
// le_Port->setText(Settings->TTY.Port); |
|
for(int z = 0; z < Settings->TTY.MaxPorts; z++) |
{ |
cb_Port->addItem(Settings->TTY.Ports[z]); |
} |
|
cb_Port->setCurrentIndex(Settings->TTY.PortID); |
|
cb_ShowMSG->setChecked(Settings->GUI.Term_Info); |
cb_ShowData->setChecked(Settings->GUI.Term_Data); |
cb_ShowAlways->setChecked(Settings->GUI.Term_Always); |
230,12 → 238,8 |
|
void MKTool::init_Connections() |
{ |
connect(Dec, SIGNAL(clicked()), this, SLOT(slot_Test())); |
// connect(Dec, SIGNAL(clicked()), this, SLOT(slot_Test())); |
|
// 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))); |
connect(o_Connection, SIGNAL(showTerminal(int, QString)), this, SLOT(slot_showTerminal(int, QString))); |
539,18 → 543,6 |
TickerDiv = false; |
else |
TickerDiv = true; |
/* |
if (cb_ClipBoard->isChecked()) |
{ |
QString s_OLD = te_KML->toPlainText(); |
te_KML->clear(); |
te_KML->paste(); |
if (s_OLD != te_KML->toPlainText()) |
{ |
parse_TargetKML(); |
} |
} |
*/ |
for (int a = 0; a < MaxTickerEvents; a++) |
{ |
if (TickerEvent[a] == true) |
570,7 → 562,7 |
{ |
if (!f_LCD->isVisible()) |
{ |
Ticker->setInterval(2000); |
Ticker->setInterval(TICKER); |
TickerEvent[2] = false; |
} |
TX_Data[0] = LCD_Page; |
701,7 → 693,7 |
|
slot_Motortest(Motor); |
|
Ticker->setInterval(2000); |
Ticker->setInterval(TICKER); |
TickerEvent[4] = false; |
} |
|
754,6 → 746,11 |
{ |
if (!f_Map->isVisible()) |
{ |
|
// 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>))); |
|
f_Map->show(); |
} |
} |
879,7 → 876,9 |
{ |
dlg_Preferences *f_Preferences = new dlg_Preferences(this); |
|
Settings->TTY.Port = le_Port->text(); |
// Settings->TTY.Port = le_Port->text(); |
Settings->TTY.Port = cb_Port->itemText(cb_Port->currentIndex()); |
|
f_Preferences->set_Settings(Settings); |
|
if (f_Preferences->exec()==QDialog::Accepted) |
886,7 → 885,7 |
{ |
Settings = f_Preferences->get_Settings(); |
Settings->write_Settings(); |
le_Port->setText(Settings->TTY.Port); |
cb_Port->addItem(Settings->TTY.Port); |
config_Plot(); |
} |
} |
1134,7 → 1133,7 |
|
QString Message = trUtf8("Firmeware-Datei \n\n"); |
Message = Message + le_HexFile->text() + "\n\n"; |
Message = Message + trUtf8("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 ") + cb_Port->currentText() + trUtf8(" übertragen?\n"); |
|
if (le_HexFile->text() == "") |
{ |
1154,7 → 1153,7 |
} |
|
Argumente << "-P"; |
Argumente << le_Port->text(); |
Argumente << cb_Port->currentText(); |
Argumente << "-p"; |
Argumente << Device; |
Argumente << "-c"; |
1215,7 → 1214,7 |
} |
else |
{ |
Ticker->setInterval(2000); |
Ticker->setInterval(TICKER); |
TickerEvent[1] = false; |
} |
} |
1289,7 → 1288,18 |
Settings->GUI.Size = size(); |
Settings->GUI.Point = pos(); |
|
Settings->TTY.Port = le_Port->text(); |
// Settings->TTY.Port = le_Port->text(); |
Settings->TTY.Port = cb_Port->currentText(); |
Settings->TTY.MaxPorts = cb_Port->count(); |
Settings->TTY.PortID = cb_Port->currentIndex(); |
|
for (int z = 0; z < cb_Port->count(); z++) |
{ |
if (z < 10) |
{ |
Settings->TTY.Ports[z] = cb_Port->itemText(z); |
} |
} |
} |
|
void MKTool::show_DebugData() |
1311,40 → 1321,43 |
update_Plot(); |
} |
|
le_A_0->setText(QString("%1").arg(AnalogData[0])); |
le_A_1->setText(QString("%1").arg(AnalogData[1])); |
le_A_2->setText(QString("%1").arg(AnalogData[2])); |
le_A_3->setText(QString("%1").arg(AnalogData[3])); |
le_A_4->setText(QString("%1").arg(AnalogData[4])); |
le_A_5->setText(QString("%1").arg(AnalogData[5])); |
le_A_6->setText(QString("%1").arg(AnalogData[6])); |
le_A_7->setText(QString("%1").arg(AnalogData[7])); |
le_A_8->setText(QString("%1").arg(AnalogData[8])); |
le_A_9->setText(QString("%1").arg(AnalogData[9])); |
le_A_10->setText(QString("%1").arg(AnalogData[10])); |
le_A_11->setText(QString("%1").arg(AnalogData[11])); |
le_A_12->setText(QString("%1").arg(AnalogData[12])); |
le_A_13->setText(QString("%1").arg(AnalogData[13])); |
le_A_14->setText(QString("%1").arg(AnalogData[14])); |
le_A_15->setText(QString("%1").arg(AnalogData[15])); |
le_A_16->setText(QString("%1").arg(AnalogData[16])); |
le_A_17->setText(QString("%1").arg(AnalogData[17])); |
le_A_18->setText(QString("%1").arg(AnalogData[18])); |
le_A_19->setText(QString("%1").arg(AnalogData[19])); |
le_A_20->setText(QString("%1").arg(AnalogData[20])); |
le_A_21->setText(QString("%1").arg(AnalogData[21])); |
le_A_22->setText(QString("%1").arg(AnalogData[22])); |
le_A_23->setText(QString("%1").arg(AnalogData[23])); |
le_A_24->setText(QString("%1").arg(AnalogData[24])); |
le_A_25->setText(QString("%1").arg(AnalogData[25])); |
le_A_26->setText(QString("%1").arg(AnalogData[26])); |
le_A_27->setText(QString("%1").arg(AnalogData[27])); |
le_A_28->setText(QString("%1").arg(AnalogData[28])); |
le_A_29->setText(QString("%1").arg(AnalogData[29])); |
le_A_30->setText(QString("%1").arg(AnalogData[30])); |
le_A_31->setText(QString("%1").arg(AnalogData[31])); |
if (tab_Main->currentWidget()->objectName() == QString("Tab_0")) |
{ |
le_A_0->setText(QString("%1").arg(AnalogData[0])); |
le_A_1->setText(QString("%1").arg(AnalogData[1])); |
le_A_2->setText(QString("%1").arg(AnalogData[2])); |
le_A_3->setText(QString("%1").arg(AnalogData[3])); |
le_A_4->setText(QString("%1").arg(AnalogData[4])); |
le_A_5->setText(QString("%1").arg(AnalogData[5])); |
le_A_6->setText(QString("%1").arg(AnalogData[6])); |
le_A_7->setText(QString("%1").arg(AnalogData[7])); |
le_A_8->setText(QString("%1").arg(AnalogData[8])); |
le_A_9->setText(QString("%1").arg(AnalogData[9])); |
le_A_10->setText(QString("%1").arg(AnalogData[10])); |
le_A_11->setText(QString("%1").arg(AnalogData[11])); |
le_A_12->setText(QString("%1").arg(AnalogData[12])); |
le_A_13->setText(QString("%1").arg(AnalogData[13])); |
le_A_14->setText(QString("%1").arg(AnalogData[14])); |
le_A_15->setText(QString("%1").arg(AnalogData[15])); |
le_A_16->setText(QString("%1").arg(AnalogData[16])); |
le_A_17->setText(QString("%1").arg(AnalogData[17])); |
le_A_18->setText(QString("%1").arg(AnalogData[18])); |
le_A_19->setText(QString("%1").arg(AnalogData[19])); |
le_A_20->setText(QString("%1").arg(AnalogData[20])); |
le_A_21->setText(QString("%1").arg(AnalogData[21])); |
le_A_22->setText(QString("%1").arg(AnalogData[22])); |
le_A_23->setText(QString("%1").arg(AnalogData[23])); |
le_A_24->setText(QString("%1").arg(AnalogData[24])); |
le_A_25->setText(QString("%1").arg(AnalogData[25])); |
le_A_26->setText(QString("%1").arg(AnalogData[26])); |
le_A_27->setText(QString("%1").arg(AnalogData[27])); |
le_A_28->setText(QString("%1").arg(AnalogData[28])); |
le_A_29->setText(QString("%1").arg(AnalogData[29])); |
le_A_30->setText(QString("%1").arg(AnalogData[30])); |
le_A_31->setText(QString("%1").arg(AnalogData[31])); |
} |
|
if ((Mode.ID == ADDRESS_FC) && (FCSettings[P_GYRO_ACC_FAKTOR] > 0)) |
if ((Mode.ID == ADDRESS_FC) && (FCSettings[P_GYRO_ACC_FAKTOR] > 0) && (tab_Main->currentWidget()->objectName() == QString("Tab_4"))) |
{ |
bar_UBAT->setValue(AnalogData[9]); |
bar_RX->setValue(AnalogData[10]); |
1369,69 → 1382,73 |
{ |
// qDebug("Navi-Data"); |
|
switch(RX.Decode[N_NC_FLAGS]) |
if (tab_Main->currentWidget()->objectName() == QString("Tab_4")) |
{ |
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; |
} |
switch(RX.Decode[N_NC_FLAGS]) |
{ |
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); |
Navi.Current.Latitude = ToolBox::Data2Long(RX.Decode, N_CUR_LATITUDE, true); |
Navi.Current.Altitude = ToolBox::Data2Long(RX.Decode, N_CUR_ALTITUDE, true); |
Navi.Target.Longitude = ToolBox::Data2Long(RX.Decode, N_TAR_LONGITUDE, true); |
Navi.Target.Latitude = ToolBox::Data2Long(RX.Decode, N_TAR_LATITUDE, true); |
Navi.Target.Altitude = ToolBox::Data2Long(RX.Decode, N_TAR_ALTITUDE, true); |
le_CDistance->setText(QString("%1 cm").arg(ToolBox::Data2Int(RX.Decode, N_HOME_DISTANCE))); |
le_CWPA->setText(QString("%1").arg(RX.Decode[N_WP_INDEX])); |
le_CWPT->setText(QString("%1").arg(RX.Decode[N_WP_NUMBER])); |
le_CSats->setText(QString("%1").arg(RX.Decode[N_SATS_IN_USER])); |
|
le_CDistance->setText(QString("%1 cm").arg(ToolBox::Data2Int(RX.Decode, N_HOME_DISTANCE))); |
le_CWPA->setText(QString("%1").arg(RX.Decode[N_WP_INDEX])); |
le_CWPT->setText(QString("%1").arg(RX.Decode[N_WP_NUMBER])); |
le_CSats->setText(QString("%1").arg(RX.Decode[N_SATS_IN_USER])); |
qwt_Rate->setValue(double(ToolBox::Data2Int(RX.Decode, N_VARIOMETER, true))); |
|
qwt_Rate->setValue(double(ToolBox::Data2Int(RX.Decode, N_VARIOMETER, true))); |
le_CTime->setText(QString("%1 sec.").arg(ToolBox::Data2Int(RX.Decode, N_FLYING_TIME))); |
|
le_CTime->setText(QString("%1 sec.").arg(ToolBox::Data2Int(RX.Decode, N_FLYING_TIME))); |
bar_UBAT->setValue(RX.Decode[N_UBAT]); |
|
bar_UBAT->setValue(RX.Decode[N_UBAT]); |
double Speed = double((ToolBox::Data2Int(RX.Decode, N_GROUND_SPEED)) / 10.0); |
|
double Speed = double((ToolBox::Data2Int(RX.Decode, N_GROUND_SPEED)) / 10.0); |
if ((Speed > 4.5) && SpeedMeter->property("END") == 5) |
{ |
SpeedMeter->setRange(0.0, 10.0); |
SpeedMeter->setScale(1, 2, 1); |
SpeedMeter->setProperty("END", 10); |
} |
|
if ((Speed > 4.5) && SpeedMeter->property("END") == 5) |
{ |
SpeedMeter->setRange(0.0, 10.0); |
SpeedMeter->setScale(1, 2, 1); |
SpeedMeter->setProperty("END", 10); |
} |
if ((Speed > 9) && SpeedMeter->property("END") == 10) |
{ |
SpeedMeter->setRange(0.0, 20.0); |
SpeedMeter->setScale(1, 2, 2); |
SpeedMeter->setProperty("END", 20); |
} |
|
if ((Speed > 9) && SpeedMeter->property("END") == 10) |
{ |
SpeedMeter->setRange(0.0, 20.0); |
SpeedMeter->setScale(1, 2, 2); |
SpeedMeter->setProperty("END", 20); |
} |
SpeedMeter->setValue(Speed); |
|
SpeedMeter->setValue(Speed); |
Compass->setValue(ToolBox::Data2Int(RX.Decode, N_COMAPSS_HEADING)); //(68) |
|
Compass->setValue(ToolBox::Data2Int(RX.Decode, N_COMAPSS_HEADING)); //(68) |
bar_RX->setValue(RX.Decode[N_RC_QUALITY]); |
|
bar_RX->setValue(RX.Decode[N_RC_QUALITY]); |
int Nick = RX.Decode[N_ANGLE_NICK]; |
int Roll = RX.Decode[N_ANGLE_ROLL]; |
|
int Nick = RX.Decode[N_ANGLE_NICK]; |
int Roll = RX.Decode[N_ANGLE_ROLL]; |
if (Roll > 128) |
Roll = Roll - 255; |
|
if (Roll > 128) |
Roll = Roll - 255; |
if (Nick > 128) |
Nick = Nick - 255; |
|
if (Nick > 128) |
Nick = Nick - 255; |
Attitude->setAngle(Roll); |
Attitude->setGradient(double(0.0 - (double(Nick) / 100.0))); |
} |
|
Attitude->setAngle(Roll); |
Attitude->setGradient(double(0.0 - (double(Nick) / 100.0))); |
Navi.Current.Longitude = ToolBox::Data2Long(RX.Decode, N_CUR_LONGITUDE, true); |
Navi.Current.Latitude = ToolBox::Data2Long(RX.Decode, N_CUR_LATITUDE, true); |
Navi.Current.Altitude = ToolBox::Data2Long(RX.Decode, N_CUR_ALTITUDE, true); |
// Navi.Target.Longitude = ToolBox::Data2Long(RX.Decode, N_TAR_LONGITUDE, true); |
// Navi.Target.Latitude = ToolBox::Data2Long(RX.Decode, N_TAR_LATITUDE, true); |
// Navi.Target.Altitude = ToolBox::Data2Long(RX.Decode, N_TAR_ALTITUDE, true); |
|
|
sNaviString NaviString; |
|
NaviString.Longitude = ToolBox::get_Float(Navi.Current.Longitude,7); |
1759,7 → 1776,7 |
break; |
case 3 : |
{ |
if (cb_ShowSend->isChecked()) |
if ((cb_ShowSend->isChecked()) && ((tab_Main->currentWidget()->objectName() == QString("Tab_3")) || (cb_ShowAlways->isChecked()))) |
{ |
te_RX->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor); |
te_RX->insertHtml("<span style='color:#8b0000;'>" + Text + "<br /></span>"); |
1798,7 → 1815,7 |
o_Connection->Close(); |
|
ac_ConnectTTY->setText(tr("Kopter Verbinden")); |
le_Port->setEnabled(true); |
cb_Port->setEnabled(true); |
|
Ticker->stop(); |
} |
1805,7 → 1822,7 |
else |
{ |
int i_Type; |
if (le_Port->text().contains(QString("IP:"))) |
if (cb_Port->currentText().contains(QString("IP:"))) |
{ |
i_Type = C_IP; |
} |
1814,14 → 1831,14 |
i_Type = C_TTY; |
} |
|
if (o_Connection->Open(i_Type, le_Port->text())) |
if (o_Connection->Open(i_Type, cb_Port->currentText())) |
{ |
ac_ConnectTTY->setText(tr("Kopter Trennen")); |
le_Port->setEnabled(false); |
cb_Port->setEnabled(false); |
|
o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true); |
|
Ticker->start(2000); |
Ticker->start(TICKER); |
} |
} |
} |