414,7 → 414,7 |
} |
|
// Waypoint zur NC Senden. |
//FIXME: put this in cpp/NaviCtrl.cpp |
//FIXME: put this in cpp/NaviCtrl.cpp? |
void MKTool::slot_pb_SendTarget() |
{ |
if ((Navi.Current.Longitude == 0) && (Navi.Current.Latitude == 0)) |
462,8 → 462,7 |
abs((double)(Navi.Current.Longitude - desired_pos.Position.Longitude)) < max_radius && |
abs((double)(Navi.Current.Latitude - desired_pos.Position.Latitude)) < max_radius) |
{ |
//FIXME: Put this in com/Handler.cpp |
// o_Connection->send_Cmd('s', ADDRESS_NC, (char *)&desired_pos, sizeof(desired_pos), false); |
handler->send_waypoint(desired_pos); |
} |
else |
{ |
498,49 → 497,35 |
// Hardware Auswahl und umschalten |
void MKTool::slot_rb_Hardware() |
{ |
//FIXME:put this in Handler.cpp |
if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC)) |
{ |
lb_Status->setText(tr("Schalte um auf NaviCtrl.")); |
/*TX_Data[0] = 0x1B; |
TX_Data[1] = 0x1B; |
TX_Data[2] = 0x55; |
TX_Data[3] = 0xAA; |
TX_Data[4] = 0x00; |
TX_Data[5] = '\r'; |
o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false); |
ToolBox::wait(SLEEP);*/ |
handler->switch_navictrl(); |
//FIXME: remove wait? |
ToolBox::wait(SLEEP); |
} |
|
if (rb_SelFC->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf FlightCtrl.")); |
/*TX_Data[0] = 0; |
o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);*/ |
handler->switch_flightctrl(); |
} |
else |
if (rb_SelMag->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf MK3MAG.")); |
/*TX_Data[0] = 1; |
o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);*/ |
handler->switch_mk3mag(); |
} |
else |
if (rb_SelNC->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf NaviCtrl.")); |
/*TX_Data[0] = 0x1B; |
TX_Data[1] = 0x1B; |
TX_Data[2] = 0x55; |
TX_Data[3] = 0xAA; |
TX_Data[4] = 0x00; |
TX_Data[5] = '\r'; |
o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false);*/ |
handler->switch_navictrl(); |
} |
ToolBox::wait(SLEEP); |
|
// qDebug("Select RB Hardware"); |
//o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true); |
handler->get_version(); |
} |
|
// Ticker-Event |
711,16 → 696,7 |
|
void MKTool::slot_Motortest(sMotor p_Motor) |
{ |
//FIXME: put this in com/Handler.cpp |
/* |
Motor = p_Motor; |
|
for (int z = 0; z<12; z++) |
{ |
TX_Data[z] = Motor.Speed[z]; |
} |
o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 12, false); |
*/ |
handler->motor_test(p_Motor); |
} |
|
// Motormixer-Einstellungen anzeigen |
747,10 → 723,7 |
connect(f_LCD->pb_LCDdown, SIGNAL(clicked()), this, SLOT(slot_LCD_DOWN())); |
//FIXME: put this in com/Handler.cpp |
f_LCD->show(); |
/*TX_Data[0] = 0; |
TX_Data[1] = 0; |
o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true); |
*/ |
handler->show_lcd(); |
//FIXME: replace ticker with something else |
Ticker->setInterval(500); |
TickerEvent[2] = true; |
768,14 → 741,12 |
|
void MKTool::slot_MAP_SetWayPoints(QList<sWayPoint> l_WayPoints) |
{ |
//FIXME: Put this in com/Handler.cpp or com/NaviCtrlHandler.cpp |
/* |
Waypoint_t WayPoint; |
//FIXME: Put this in com/Handler.cpp or com/NaviCtrl.cpp |
|
double Longitude, Latitude; |
|
// Waypoint-Liste löschen |
WayPoint.Position.Status = INVALID; |
o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false); |
// delete waypoint-list |
handler->delete_waypoints(); |
ToolBox::wait(SLEEP); |
|
for (int z = 0; z < l_WayPoints.count(); z++) |
789,6 → 760,7 |
if (Latitude < 100) |
Latitude *= 10000000+0.5; |
|
Waypoint_t WayPoint; |
//fülle Wegpunkt-Daten |
WayPoint.Position.Altitude = 0; |
WayPoint.Position.Longitude = int32_t(Longitude); |
803,10 → 775,9 |
WayPoint.reserve[2] = 0; // reserve |
WayPoint.reserve[3] = 0; // reserve |
|
o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false); |
handler->add_waypoint(WayPoint); |
// ToolBox::Wait(SLEEP); |
} |
*/ |
} |
|
void MKTool::slot_MAP_SetTarget(sWayPoint Target) |
963,15 → 934,13 |
if (ac_FastNavi->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle NaviDaten an.")); |
//TX_Data[0] = Settings->Data.Navi_Fast / 10; |
handler->set_navictrl_debug(Settings->Data.Navi_Fast / 10); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame NaviDaten an.")); |
//TX_Data[0] = Settings->Data.Navi_Slow / 10; |
handler->set_navictrl_debug(Settings->Data.Navi_Slow / 10); |
} |
//FIXME: put this in com/Handler.cpp / com/NaviCtrl.cpp |
//o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false); |
} |
} |
|
980,7 → 949,7 |
if (ac_NoNavi->isChecked()) |
{ |
lb_Status->setText(tr("NaviDaten abstellen.")); |
// TX_Data[0] = 0; |
handler->stop_navictrl_debug(); |
} |
else |
{ |
987,16 → 956,14 |
if (ac_FastNavi->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle NaviDaten an.")); |
// TX_Data[0] = Settings->Data.Navi_Fast / 10; |
handler->set_navictrl_debug(Settings->Data.Navi_Fast / 10); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame NaviDaten an.")); |
// TX_Data[0] = Settings->Data.Navi_Slow / 10; |
handler->set_navictrl_debug(Settings->Data.Navi_Slow / 10); |
} |
} |
//FIXME: Put this in com/Handler.cpp |
// o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false); |
} |
|
void MKTool::slot_ac_FastDebug() // DONE 0.71g |
1006,15 → 973,13 |
if (ac_FastDebug->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle DebugDaten an.")); |
//TX_Data[0] = Settings->Data.Debug_Fast / 10; |
handler->set_all_debug(Settings->Data.Debug_Fast / 10); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame DebugDaten an.")); |
//TX_Data[0] = Settings->Data.Debug_Slow / 10; |
handler->set_all_debug(Settings->Data.Debug_Slow / 10); |
} |
//FIXME: Put this in com/Handler.cpp |
// o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
} |
|
1024,7 → 989,7 |
{ |
lb_Status->setText(tr("DebugDaten abstellen.")); |
TickerEvent[3] = false; |
//TX_Data[0] = 0; |
handler->stop_all_debug(); |
} |
else |
{ |
1035,16 → 1000,14 |
if (ac_FastDebug->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle DebugDaten an.")); |
//TX_Data[0] = Settings->Data.Debug_Fast / 10; |
handler->set_all_debug(Settings->Data.Debug_Fast / 10); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame DebugDaten an.")); |
//TX_Data[0] = Settings->Data.Debug_Slow / 10; |
handler->set_all_debug(Settings->Data.Debug_Slow / 10); |
} |
} |
//FIXME: Put this in com/Handler.cpp |
// o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
|
void MKTool::slot_ac_About() |
1055,9 → 1018,7 |
void MKTool::slot_ac_GetLabels() // DONE 0.71g |
{ |
lb_Status->setText(tr("Analoglabels auslesen.")); |
//FIXME: Put this in com/Handler.cpp |
// TX_Data[0] = 0; |
// o_Connection->send_Cmd('a', ADDRESS_ALL, TX_Data, 1, true); |
handler->get_analog(); |
} |
|
void MKTool::slot_ac_StartServer() |
1223,9 → 1184,11 |
{ |
if ((tab_Main->currentWidget()->objectName() == QString("Tab_2")) && (f_Settings->listWidget->currentRow() == 1)) |
{ |
// TX_Data[0] = 0; |
//FIXME: Put this in com/Handler.cpp |
// o_Connection->send_Cmd('p', ADDRESS_FC, TX_Data, 0, false); |
//FIXME: Do we really need the ppm-channels if we change the page? |
// maybe this is a bug or the description on |
// http://www.mikrokopter.com/ucwiki/en/SerialCommands |
// is WRONG! |
handler->get_ppm_channels(); |
|
Ticker->setInterval(500); |
TickerEvent[1] = true; |
1241,29 → 1204,12 |
// LCD-Seiten weiterschalten |
void MKTool::slot_LCD_UP() // DONE 0.71g |
{ |
//FIXME: Put this in com/Handler.cpp |
/* if (LCD_Page == LCD_MAX_Page) |
TX_Data[0] = 0; |
else |
TX_Data[0] = LCD_Page + 1; |
|
TX_Data[1] = 0; |
o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true); |
*/ |
handler->lcd_up(); |
} |
|
void MKTool::slot_LCD_DOWN() // DONE 0.71g |
{ |
//FIXME: Put this in com/Handler.cpp |
/* |
if (LCD_Page == 0) |
TX_Data[0] = LCD_MAX_Page; |
else |
TX_Data[0] = LCD_Page - 1; |
|
TX_Data[1] = 0; |
o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true); |
*/ |
handler->lcd_down(); |
} |
|
// Settings aus MK lesen / in MK schreiben |
1270,24 → 1216,13 |
void MKTool::slot_GetFCSettings() // DONE 0.71g |
{ |
lb_Status->setText(tr("Lese FlightCtrl-Settings aus.")); |
//FIXME: Put this in com/Handler.cpp |
/* |
TX_Data[0] = f_Settings->sb_Set->value(); |
TX_Data[1] = 0; |
o_Connection->send_Cmd('q', ADDRESS_FC, TX_Data, 1, true); |
*/ |
handler->get_flightctrl_settings(f_Settings->sb_Set->value()); |
} |
|
void MKTool::slot_SetFCSettings() // DONE 0.71g |
{ |
//FIXME: Put this in com/Handler.cpp |
/* |
char *TX_Data2 = f_Settings->GetFCSettings(); |
|
handler->set_flightctrl_settings(f_Settings->GetFCSettings()); |
lb_Status->setText(tr("Schreibe FlightCtrl-Settings.")); |
|
o_Connection->send_Cmd('s', ADDRESS_FC, TX_Data2, MaxParameter + 2, true); |
*/ |
} |
|
|