Subversion Repositories Projects

Rev

Rev 246 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 246 Rev 248
Line 57... Line 57...
57
    setWindowTitle(QA_NAME + " v" + QA_VERSION);
57
    setWindowTitle(QA_NAME + " v" + QA_VERSION);
Line 58... Line 58...
58
 
58
 
59
    // Tab mit Debug-Elementen verbergen
59
    // Tab mit Debug-Elementen verbergen
Line 60... Line -...
60
     tab_Main->removeTab(6);
-
 
61
 
-
 
62
    // Tab mit Wegpunkte-Elementen verbergen
-
 
63
    tab_Main->removeTab(5);
60
     tab_Main->removeTab(6);
64
 
61
 
65
    // Settings-Tab hinzufügen.
62
    // Settings-Tab hinzufügen.
66
    f_Settings = new wdg_Settings( this );
63
    f_Settings = new wdg_Settings( this );
67
    f_Settings->set_Config(Settings);
64
    f_Settings->set_Config(Settings);
Line 268... Line 265...
268
 
265
 
269
    connect(rb_SelNC,        SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
266
    connect(rb_SelNC,        SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
270
    connect(rb_SelFC,        SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
267
    connect(rb_SelFC,        SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
Line -... Line 268...
-
 
268
    connect(rb_SelMag,       SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
-
 
269
 
-
 
270
    // Wegpunkt-Befehl
271
    connect(rb_SelMag,       SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
271
    connect(pb_FlyTo,        SIGNAL(clicked()), this, SLOT(slot_ac_SendWaypoint()));
272
 
272
 
273
    // firmeware Updateen / flashen
273
    // firmeware Updateen / flashen
Line 274... Line 274...
274
    connect(pb_Update,   SIGNAL(clicked()), this, SLOT(slot_pb_Update()));
274
    connect(pb_Update,   SIGNAL(clicked()), this, SLOT(slot_pb_Update()));
Line 1236... Line 1236...
1236
    qDebug(NaviString.Latitude.toLatin1().data());
1236
    qDebug(NaviString.Latitude.toLatin1().data());
1237
    qDebug(NaviString.Altitude.toLatin1().data());
1237
    qDebug(NaviString.Altitude.toLatin1().data());
1238
    */
1238
    */
1239
}
1239
}
Line -... Line 1240...
-
 
1240
 
-
 
1241
void MKTool::slot_ac_SendWaypoint()
-
 
1242
{
-
 
1243
    if (Navi.Current.Longitude == 0 &&
-
 
1244
        Navi.Current.Latitude == 0) {
-
 
1245
        QMessageBox msgB;
-
 
1246
        QString msg;
-
 
1247
        msgB.setText("Fehler: Es konnten keine GPS-Daten vom Mikrokopter empfangen werden");
-
 
1248
        msgB.exec();
-
 
1249
        return;
-
 
1250
    }
-
 
1251
    //erstelle einen Wegpunkt, den die NaviCtrl auswerten kann
-
 
1252
    Waypoint_t desired_pos;
-
 
1253
    bool ok_lat, ok_lon;
-
 
1254
 
-
 
1255
    //eingegebene Daten holen
-
 
1256
    double desired_long, desired_lat;
-
 
1257
    desired_long = le_LonValue->text().toDouble(&ok_lon);
-
 
1258
    desired_lat = le_LatValue->text().toDouble(&ok_lat);
-
 
1259
    if (ok_lon && desired_long < 100)
-
 
1260
        desired_long *= 10000000+0.5;
-
 
1261
    if (ok_lat && desired_lat < 100)
-
 
1262
        desired_lat *= 10000000+0.5;
-
 
1263
 
-
 
1264
    //fülle Wegpunkt-Daten
-
 
1265
    desired_pos.Position.Altitude= 0;
-
 
1266
    desired_pos.Position.Longitude= int32_t(desired_long);
-
 
1267
    desired_pos.Position.Latitude= int32_t(desired_lat);
-
 
1268
    desired_pos.Position.Status = NEWDATA;
-
 
1269
    desired_pos.Heading = -1;
-
 
1270
    desired_pos.ToleranceRadius = 1;
-
 
1271
    desired_pos.HoldTime = 60;
-
 
1272
    desired_pos.Event_Flag = 0;
-
 
1273
    desired_pos.reserve[0] = 0; // reserve
-
 
1274
    desired_pos.reserve[1] = 0; // reserve
-
 
1275
    desired_pos.reserve[2] = 0; // reserve
-
 
1276
    desired_pos.reserve[3] = 0; // reserve
-
 
1277
 
-
 
1278
    //...und sende ihn an die NaviCtrl
-
 
1279
    int max_radius = 10000;
-
 
1280
    if (ok_lat && ok_lon &&
-
 
1281
        abs(Navi.Current.Longitude - desired_pos.Position.Longitude) < max_radius &&
-
 
1282
        abs(Navi.Current.Latitude - desired_pos.Position.Latitude) < max_radius) {
-
 
1283
            send_Data('s', ADDRESS_NC, (char *)&desired_pos, sizeof(desired_pos), false);
-
 
1284
    } else  {
-
 
1285
        QMessageBox msgB;
-
 
1286
        QString msg;
-
 
1287
        msg += "Bitte die Eingabe ueberpruefen!\n";
-
 
1288
        msg += "Die Werte muessen sich in der Naehe der aktuellen Koordinaten befinden\n";
-
 
1289
        msg += "(Lon: ";
-
 
1290
        msg += ToolBox::get_Float(Navi.Current.Longitude,10000000);
-
 
1291
        msg += ", ";
-
 
1292
        msg += "Lat: ";
-
 
1293
        msg += ToolBox::get_Float(Navi.Current.Latitude,10000000);
-
 
1294
        msg += ")";
-
 
1295
        msgB.setText(msg);
-
 
1296
        msgB.exec();
-
 
1297
    }
-
 
1298
}
1240
 
1299
 
1241
// Seriel-Port Bereich, Befehle senden und Daten empfangen
1300
// Seriel-Port Bereich, Befehle senden und Daten empfangen
Line 1242... Line 1301...
1242
//////////////////////////////////////////////////////////
1301
//////////////////////////////////////////////////////////
1243
 
1302