/QMK-Groundstation/branches/waypoint/Forms/mktool.cpp |
---|
59,9 → 59,6 |
// Tab mit Debug-Elementen verbergen |
tab_Main->removeTab(6); |
// Tab mit Wegpunkte-Elementen verbergen |
tab_Main->removeTab(5); |
// Settings-Tab hinzufügen. |
f_Settings = new wdg_Settings( this ); |
f_Settings->set_Config(Settings); |
270,6 → 267,9 |
connect(rb_SelFC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
connect(rb_SelMag, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
// Wegpunkt-Befehl |
connect(pb_FlyTo, SIGNAL(clicked()), this, SLOT(slot_ac_SendWaypoint())); |
// firmeware Updateen / flashen |
connect(pb_Update, SIGNAL(clicked()), this, SLOT(slot_pb_Update())); |
connect(pb_HexFile, SIGNAL(clicked()), this, SLOT(slot_pb_HexFile())); |
1238,6 → 1238,65 |
*/ |
} |
void MKTool::slot_ac_SendWaypoint() |
{ |
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.exec(); |
return; |
} |
//erstelle einen Wegpunkt, den die NaviCtrl auswerten kann |
Waypoint_t desired_pos; |
bool ok_lat, ok_lon; |
//eingegebene Daten holen |
double desired_long, desired_lat; |
desired_long = le_LonValue->text().toDouble(&ok_lon); |
desired_lat = le_LatValue->text().toDouble(&ok_lat); |
if (ok_lon && desired_long < 100) |
desired_long *= 10000000+0.5; |
if (ok_lat && desired_lat < 100) |
desired_lat *= 10000000+0.5; |
//fülle Wegpunkt-Daten |
desired_pos.Position.Altitude= 0; |
desired_pos.Position.Longitude= int32_t(desired_long); |
desired_pos.Position.Latitude= int32_t(desired_lat); |
desired_pos.Position.Status = NEWDATA; |
desired_pos.Heading = -1; |
desired_pos.ToleranceRadius = 1; |
desired_pos.HoldTime = 60; |
desired_pos.Event_Flag = 0; |
desired_pos.reserve[0] = 0; // reserve |
desired_pos.reserve[1] = 0; // reserve |
desired_pos.reserve[2] = 0; // reserve |
desired_pos.reserve[3] = 0; // reserve |
//...und sende ihn an die NaviCtrl |
int max_radius = 10000; |
if (ok_lat && ok_lon && |
abs(Navi.Current.Longitude - desired_pos.Position.Longitude) < max_radius && |
abs(Navi.Current.Latitude - desired_pos.Position.Latitude) < max_radius) { |
send_Data('s', ADDRESS_NC, (char *)&desired_pos, sizeof(desired_pos), false); |
} else { |
QMessageBox msgB; |
QString msg; |
msg += "Bitte die Eingabe ueberpruefen!\n"; |
msg += "Die Werte muessen sich in der Naehe der aktuellen Koordinaten befinden\n"; |
msg += "(Lon: "; |
msg += ToolBox::get_Float(Navi.Current.Longitude,10000000); |
msg += ", "; |
msg += "Lat: "; |
msg += ToolBox::get_Float(Navi.Current.Latitude,10000000); |
msg += ")"; |
msgB.setText(msg); |
msgB.exec(); |
} |
} |
// Seriel-Port Bereich, Befehle senden und Daten empfangen |
////////////////////////////////////////////////////////// |
/QMK-Groundstation/branches/waypoint/Forms/mktool.h |
---|
48,6 → 48,7 |
#include "../Classes/cAttitude.h" |
#include "../Classes/cSpeedMeter.h" |
#include "../Logger/Logger.h" |
#include "../waypoint.h" |
class QextSerialPort; |
187,6 → 188,9 |
void slot_ac_LCD(); |
void slot_pb_HexFile(); |
//Wegpunkte senden |
void slot_ac_SendWaypoint(); |
// Default-Ticker |
void slot_Ticker(); |
/QMK-Groundstation/branches/waypoint/Forms/mktool.ui |
---|
5,8 → 5,8 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>699</width> |
<height>428</height> |
<width>733</width> |
<height>459</height> |
</rect> |
</property> |
<property name="windowTitle" > |
56,7 → 56,7 |
<string/> |
</property> |
<property name="currentIndex" > |
<number>0</number> |
<number>5</number> |
</property> |
<widget class="QWidget" name="Tab_0" > |
<attribute name="title" > |
1670,6 → 1670,61 |
<iconset resource="../MKTool.qrc" > |
<normaloff>:/Actions/Images/Actions/Waypoints.png</normaloff>:/Actions/Images/Actions/Waypoints.png</iconset> |
</attribute> |
<layout class="QHBoxLayout" name="horizontalLayout_4" > |
<item> |
<widget class="QGroupBox" name="groupBox_2" > |
<property name="title" > |
<string>Wegpunkt</string> |
</property> |
<widget class="QWidget" name="horizontalLayoutWidget" > |
<property name="geometry" > |
<rect> |
<x>10</x> |
<y>20</y> |
<width>371</width> |
<height>100</height> |
</rect> |
</property> |
<layout class="QHBoxLayout" name="horizontalLayout_5" > |
<item> |
<layout class="QFormLayout" name="formLayout" > |
<property name="fieldGrowthPolicy" > |
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> |
</property> |
<item row="0" column="0" > |
<widget class="QLabel" name="label_8" > |
<property name="text" > |
<string>Longitude</string> |
</property> |
</widget> |
</item> |
<item row="0" column="1" > |
<widget class="QLineEdit" name="le_LonValue" /> |
</item> |
<item row="1" column="0" > |
<widget class="QLabel" name="label_9" > |
<property name="text" > |
<string>Latitude</string> |
</property> |
</widget> |
</item> |
<item row="1" column="1" > |
<widget class="QLineEdit" name="le_LatValue" /> |
</item> |
</layout> |
</item> |
<item> |
<widget class="QPushButton" name="pb_FlyTo" > |
<property name="text" > |
<string>flieg da hin</string> |
</property> |
</widget> |
</item> |
</layout> |
</widget> |
</widget> |
</item> |
</layout> |
</widget> |
<widget class="QWidget" name="Seite" > |
<attribute name="title" > |
1775,8 → 1830,8 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>699</width> |
<height>25</height> |
<width>733</width> |
<height>26</height> |
</rect> |
</property> |
<widget class="QMenu" name="menuProgramm" > |
/QMK-Groundstation/branches/waypoint/debian.pro |
---|
44,6 → 44,7 |
HEADERS = \ |
global.h \ |
waypoint.h \ |
Parameter_Positions.h \ |
SerialPort/qextserialbase.h \ |
SerialPort/qextserialport.h \ |
/QMK-Groundstation/branches/waypoint/eeepc.pro |
---|
1,10 → 1,10 |
TEMPLATE = app |
OBJECTS_DIR = build/.o_unix |
UI_DIR = build/.ui |
MOC_DIR = build/.moc |
RCC_DIR = build/.rcc |
DESTDIR = build/bin |
UI_DIR = build/.ui |
MOC_DIR = build/.moc |
RCC_DIR = build/.rcc |
DESTDIR = build/bin |
DEFINES += _TTY_POSIX_ _EEEPC_ |
39,11 → 39,12 |
Logger/CSVLogger.cpp \ |
Forms/dlg_LCD.cpp |
win32:SOURCES += SerialPort/win_qextserialport.cpp |
unix:SOURCES += SerialPort/posix_qextserialport.cpp |
win32 : SOURCES += SerialPort/win_qextserialport.cpp |
unix : SOURCES += SerialPort/posix_qextserialport.cpp |
HEADERS = \ |
global.h \ |
waypoint.h \ |
Parameter_Positions.h \ |
SerialPort/qextserialbase.h \ |
SerialPort/qextserialport.h \ |
64,8 → 65,8 |
Logger/DefaultLogger.h \ |
Forms/dlg_LCD.h |
win32:HEADERS += SerialPort/win_qextserialport.h |
unix:HEADERS += SerialPort/posix_qextserialport.h |
win32 : HEADERS += SerialPort/win_qextserialport.h |
unix : HEADERS += SerialPort/posix_qextserialport.h |
FORMS += \ |
Forms/mktool.ui \ |
/QMK-Groundstation/branches/waypoint/gentoo.pro |
---|
44,6 → 44,7 |
HEADERS = \ |
global.h \ |
waypoint.h \ |
Parameter_Positions.h \ |
SerialPort/qextserialbase.h \ |
SerialPort/qextserialport.h \ |
/QMK-Groundstation/branches/waypoint/osx.pro |
---|
44,6 → 44,7 |
HEADERS = \ |
global.h \ |
waypoint.h \ |
Parameter_Positions.h \ |
SerialPort/qextserialbase.h \ |
SerialPort/qextserialport.h \ |
/QMK-Groundstation/branches/waypoint/suse.pro |
---|
44,6 → 44,7 |
HEADERS = \ |
global.h \ |
waypoint.h \ |
Parameter_Positions.h \ |
SerialPort/qextserialbase.h \ |
SerialPort/qextserialport.h \ |
/QMK-Groundstation/branches/waypoint/win.pro |
---|
42,6 → 42,7 |
SOURCES = \ |
main.cpp \ |
waypoint.h \ |
SerialPort/qextserialbase.cpp \ |
SerialPort/qextserialport.cpp \ |
SerialPort/ManageSerialPort.cpp \ |
/QMK-Groundstation/branches/waypoint/. |
---|
Property changes: |
Added: svn:mergeinfo |