Subversion Repositories Projects

Rev

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

Rev 393 Rev 396
Line 34... Line 34...
34
#include "dlg_Config.h"
34
#include "dlg_Config.h"
35
#include "dlg_Motortest.h"
35
#include "dlg_Motortest.h"
36
#include "dlg_Preferences.h"
36
#include "dlg_Preferences.h"
37
#include "../global.h"
37
#include "../global.h"
38
#include "../Classes/ToolBox.h"
38
#include "../Classes/ToolBox.h"
39
#include "../com/Parser.h"
-
 
Line 40... Line 39...
40
 
39
 
Line 41... Line 40...
41
#include <stdlib.h>
40
#include <stdlib.h>
42
 
41
 
Line 196... Line 195...
196
    LayOut_Speed->addWidget(SpeedMeter);
195
    LayOut_Speed->addWidget(SpeedMeter);
197
}
196
}
Line 198... Line 197...
198
 
197
 
199
void MKTool::init_Objects()
198
void MKTool::init_Objects()
-
 
199
{
-
 
200
    //new QT-Communication object
-
 
201
    com = new QTCommunication();
-
 
202
 
-
 
203
    //create handler that handles incomming data
-
 
204
    handler = new Handler(com);
200
{
205
 
201
    // QTimer-Instanzen
206
    // QTimer-Instanzen
Line 202... Line 207...
202
    Ticker = new QTimer(this);
207
    Ticker = new QTimer(this);
203
 
208
 
Line 204... Line 209...
204
    // Verbindungsobject
209
    // Verbindungsobject
205
    o_Connection = new cConnection();
210
    //o_Connection = new cConnection();
Line 206... Line 211...
206
 
211
 
207
    // neuer Logger
212
    // Logger
Line 236... Line 241...
236
    // Waypoints übergeben
241
    // Waypoints übergeben
237
    connect(f_Map, SIGNAL(set_Target(sWayPoint)), this , SLOT(slot_MAP_SetTarget(sWayPoint)));
242
    connect(f_Map, SIGNAL(set_Target(sWayPoint)), this , SLOT(slot_MAP_SetTarget(sWayPoint)));
238
    connect(f_Map, SIGNAL(set_WayPoints(QList<sWayPoint>)), this , SLOT(slot_MAP_SetWayPoints(QList<sWayPoint>)));
243
    connect(f_Map, SIGNAL(set_WayPoints(QList<sWayPoint>)), this , SLOT(slot_MAP_SetWayPoints(QList<sWayPoint>)));
Line 239... Line 244...
239
 
244
 
-
 
245
    // Daten Senden / Empfangen
240
    // Daten Senden / Empfangen
246
//FIXME: put this in QTCommunication.cpp
241
    connect(o_Connection, SIGNAL(newData(sRxData)), this, SLOT(slot_newData(sRxData)));
247
//    connect(o_Connection, SIGNAL(newData(sRxData)), this, SLOT(slot_newData(sRxData)));
Line 242... Line 248...
242
    connect(o_Connection, SIGNAL(showTerminal(int, QString)), this, SLOT(slot_showTerminal(int, QString)));
248
//    connect(o_Connection, SIGNAL(showTerminal(int, QString)), this, SLOT(slot_showTerminal(int, QString)));
243
 
249
 
Line 244... Line 250...
244
    // Serielle Verbundung öffnen / schließen
250
    // Serielle Verbundung öffnen / schließen
245
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort()));
251
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort()));
Line 246... Line 252...
246
 
252
 
247
    // TCP-Connection verbinden / trennen
253
    // TCP-Connection for other QMK-Groundstations
248
    connect(ac_QMKServer, SIGNAL(triggered()), this, SLOT(slot_QMKS_Connect()));
254
    connect(ac_QMKServer, SIGNAL(triggered()), this, SLOT(slot_QMKS_Connect()));
Line 404... Line 410...
404
        le_TarLat->setText(ToolBox::get_Float((List[1].toDouble() * 10000000), 7));
410
        le_TarLat->setText(ToolBox::get_Float((List[1].toDouble() * 10000000), 7));
405
    }
411
    }
406
}
412
}
Line 407... Line 413...
407
 
413
 
-
 
414
// Waypoint zur NC Senden.
408
// Waypoint zur NC Senden.
415
//FIXME: put this in cpp/NaviCtrl.cpp
409
void MKTool::slot_pb_SendTarget()
416
void MKTool::slot_pb_SendTarget()
410
{
417
{
411
    if ((Navi.Current.Longitude == 0) && (Navi.Current.Latitude == 0))
418
    if ((Navi.Current.Longitude == 0) && (Navi.Current.Latitude == 0))
412
    {
419
    {
Line 451... Line 458...
451
    int max_radius = 10000;
458
    int max_radius = 10000;
452
    if (ok_lat && ok_lon &&
459
    if (ok_lat && ok_lon &&
453
        abs((double)(Navi.Current.Longitude - desired_pos.Position.Longitude)) < max_radius &&
460
        abs((double)(Navi.Current.Longitude - desired_pos.Position.Longitude)) < max_radius &&
454
        abs((double)(Navi.Current.Latitude  - desired_pos.Position.Latitude)) < max_radius)
461
        abs((double)(Navi.Current.Latitude  - desired_pos.Position.Latitude)) < max_radius)
455
    {
462
    {
-
 
463
//FIXME: Put this in com/Handler.cpp
456
            o_Connection->send_Cmd('s', ADDRESS_NC, (char *)&desired_pos, sizeof(desired_pos), false);
464
//            o_Connection->send_Cmd('s', ADDRESS_NC, (char *)&desired_pos, sizeof(desired_pos), false);
457
    }
465
    }
458
    else
466
    else
459
    {
467
    {
460
        QMessageBox msgB;
468
        QMessageBox msgB;
461
        QString msg;
469
        QString msg;
Line 486... Line 494...
486
}
494
}
Line 487... Line 495...
487
 
495
 
488
// Hardware Auswahl und umschalten
496
// Hardware Auswahl und umschalten
489
void MKTool::slot_rb_Hardware()
497
void MKTool::slot_rb_Hardware()
-
 
498
{
490
{
499
//FIXME:put this in Handler.cpp
491
    if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC))
500
    if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC))
492
    {
501
    {
493
        lb_Status->setText(tr("Schalte um auf NaviCtrl."));
502
        lb_Status->setText(tr("Schalte um auf NaviCtrl."));
494
        TX_Data[0] = 0x1B;
503
        /*TX_Data[0] = 0x1B;
495
        TX_Data[1] = 0x1B;
504
        TX_Data[1] = 0x1B;
496
        TX_Data[2] = 0x55;
505
        TX_Data[2] = 0x55;
497
        TX_Data[3] = 0xAA;
506
        TX_Data[3] = 0xAA;
498
        TX_Data[4] = 0x00;
507
        TX_Data[4] = 0x00;
499
        TX_Data[5] = '\r';
508
        TX_Data[5] = '\r';
500
        o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false);
509
        o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false);
501
        ToolBox::wait(SLEEP);
510
        ToolBox::wait(SLEEP);*/
Line 502... Line 511...
502
    }
511
    }
503
 
512
 
504
    if (rb_SelFC->isChecked())
513
    if (rb_SelFC->isChecked())
505
    {
514
    {
506
        lb_Status->setText(tr("Schalte um auf FlightCtrl."));
515
        lb_Status->setText(tr("Schalte um auf FlightCtrl."));
507
        TX_Data[0] = 0;
516
        /*TX_Data[0] = 0;
508
        o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);
517
        o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);*/
509
    }
518
    }
510
    else
519
    else
511
    if (rb_SelMag->isChecked())
520
    if (rb_SelMag->isChecked())
512
    {
521
    {
513
        lb_Status->setText(tr("Schalte um auf MK3MAG."));
522
        lb_Status->setText(tr("Schalte um auf MK3MAG."));
514
        TX_Data[0] = 1;
523
        /*TX_Data[0] = 1;
515
        o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);
524
        o_Connection->send_Cmd('u', ADDRESS_NC, TX_Data, 1, false);*/
516
    }
525
    }
517
    else
526
    else
518
    if (rb_SelNC->isChecked())
527
    if (rb_SelNC->isChecked())
519
    {
528
    {
520
        lb_Status->setText(tr("Schalte um auf NaviCtrl."));
529
        lb_Status->setText(tr("Schalte um auf NaviCtrl."));
521
        TX_Data[0] = 0x1B;
530
        /*TX_Data[0] = 0x1B;
522
        TX_Data[1] = 0x1B;
531
        TX_Data[1] = 0x1B;
523
        TX_Data[2] = 0x55;
532
        TX_Data[2] = 0x55;
524
        TX_Data[3] = 0xAA;
533
        TX_Data[3] = 0xAA;
525
        TX_Data[4] = 0x00;
534
        TX_Data[4] = 0x00;
526
        TX_Data[5] = '\r';
535
        TX_Data[5] = '\r';
527
        o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false);
536
        o_Connection->send_Cmd('#', ADDRESS_NC, TX_Data, 6, false);*/
Line 528... Line 537...
528
    }
537
    }
529
    ToolBox::wait(SLEEP);
538
    ToolBox::wait(SLEEP);
530
 
539
 
Line 531... Line 540...
531
//    qDebug("Select RB Hardware");
540
//    qDebug("Select RB Hardware");
532
    o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true);
541
    //o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true);
533
}
542
}
534
 
543
 
-
 
544
// Ticker-Event
-
 
545
///////////////
535
// Ticker-Event
546
void MKTool::slot_Ticker()
536
///////////////
547
{
537
void MKTool::slot_Ticker()
548
//FIXME: Put this somewhere in Handler.cpp
538
{
549
/*
539
    if (TickerDiv)
550
    if (TickerDiv)
540
        TickerDiv = false;
-
 
541
    else
-
 
542
        TickerDiv = true;
-
 
543
/*
-
 
544
    if (cb_ClipBoard->isChecked())
-
 
545
    {
-
 
546
        QString s_OLD = te_KML->toPlainText();
-
 
547
        te_KML->clear();
-
 
548
        te_KML->paste();
-
 
549
        if (s_OLD != te_KML->toPlainText())
-
 
550
        {
-
 
551
            parse_TargetKML();
551
        TickerDiv = false;
552
        }
552
    else
553
    }
553
        TickerDiv = true;
554
*/
554
 
555
    for (int a = 0; a < MaxTickerEvents; a++)
555
    for (int a = 0; a < MaxTickerEvents; a++)
Line 601... Line 601...
601
                    }
601
                    }
Line 602... Line 602...
602
 
602
 
603
            }
603
            }
604
        }
604
        }
-
 
605
    }
605
    }
606
*/
Line 606... Line 607...
606
}
607
}
607
 
608
 
608
// Zum QMK-Datenserver verbinden
609
// Zum QMK-Datenserver verbinden
Line 706... Line 707...
706
    TickerEvent[4] = false;
707
    TickerEvent[4] = false;
707
}
708
}
Line 708... Line 709...
708
 
709
 
709
void MKTool::slot_Motortest(sMotor p_Motor)
710
void MKTool::slot_Motortest(sMotor p_Motor)
-
 
711
{
-
 
712
//FIXME: put this in com/Handler.cpp
710
{
713
/*
Line 711... Line 714...
711
    Motor = p_Motor;
714
    Motor = p_Motor;
712
 
715
 
713
    for (int z = 0; z<12; z++)
716
    for (int z = 0; z<12; z++)
714
    {
717
    {
715
        TX_Data[z] = Motor.Speed[z];
718
        TX_Data[z] = Motor.Speed[z];
-
 
719
    }
716
    }
720
    o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 12, false);
Line 717... Line 721...
717
    o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 12, false);
721
*/
718
}
722
}
719
 
723
 
720
// Motormixer-Einstellungen anzeigen
724
// Motormixer-Einstellungen anzeigen
721
void MKTool::slot_ac_MotorMixer()
725
void MKTool::slot_ac_MotorMixer()
Line 722... Line 726...
722
{
726
{
723
    f_MotorMixer->set_Objects(o_Connection, Settings);
727
    f_MotorMixer->set_Objects(handler, Settings);
724
    f_MotorMixer->read_Mixer();
728
    handler->read_mixer();
725
 
729
 
Line 737... Line 741...
737
        f_LCD = new dlg_LCD(this);
741
        f_LCD = new dlg_LCD(this);
Line 738... Line 742...
738
 
742
 
739
        // LCD auf / ab
743
        // LCD auf / ab
740
        connect(f_LCD->pb_LCDup,   SIGNAL(clicked()), this, SLOT(slot_LCD_UP()));
744
        connect(f_LCD->pb_LCDup,   SIGNAL(clicked()), this, SLOT(slot_LCD_UP()));
741
        connect(f_LCD->pb_LCDdown, SIGNAL(clicked()), this, SLOT(slot_LCD_DOWN()));
-
 
-
 
745
        connect(f_LCD->pb_LCDdown, SIGNAL(clicked()), this, SLOT(slot_LCD_DOWN()));
742
 
746
        //FIXME: put this in com/Handler.cpp
743
        f_LCD->show();
747
        f_LCD->show();
744
        TX_Data[0] = 0;
748
        /*TX_Data[0] = 0;
745
        TX_Data[1] = 0;
749
        TX_Data[1] = 0;
746
        o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
750
        o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
-
 
751
        */
747
 
752
        //FIXME: replace ticker with something else
748
        Ticker->setInterval(500);
753
        Ticker->setInterval(500);
749
        TickerEvent[2] = true;
754
        TickerEvent[2] = true;
750
    }
755
    }
Line 759... Line 764...
759
    }
764
    }
760
}
765
}
Line 761... Line 766...
761
 
766
 
762
void MKTool::slot_MAP_SetWayPoints(QList<sWayPoint> l_WayPoints)
767
void MKTool::slot_MAP_SetWayPoints(QList<sWayPoint> l_WayPoints)
-
 
768
{
-
 
769
//FIXME: Put this in com/Handler.cpp or com/NaviCtrlHandler.cpp
763
{
770
/*
764
    Waypoint_t WayPoint;
771
    Waypoint_t WayPoint;
Line 765... Line 772...
765
    double Longitude, Latitude;
772
    double Longitude, Latitude;
766
 
773
 
Line 795... Line 802...
795
        WayPoint.reserve[3] = 0; // reserve
802
        WayPoint.reserve[3] = 0; // reserve
Line 796... Line 803...
796
 
803
 
797
        o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false);
804
        o_Connection->send_Cmd('w', ADDRESS_NC, (char *)&WayPoint, sizeof(WayPoint), false);
798
//        ToolBox::Wait(SLEEP);
805
//        ToolBox::Wait(SLEEP);
799
    }
806
    }
800
 
807
*/
Line 801... Line 808...
801
}
808
}
802
 
809
 
Line 952... Line 959...
952
    if (!ac_NoNavi->isChecked())
959
    if (!ac_NoNavi->isChecked())
953
    {
960
    {
954
        if (ac_FastNavi->isChecked())
961
        if (ac_FastNavi->isChecked())
955
        {
962
        {
956
            lb_Status->setText(tr("Fordere schnelle NaviDaten an."));
963
            lb_Status->setText(tr("Fordere schnelle NaviDaten an."));
957
            TX_Data[0] = Settings->Data.Navi_Fast / 10;
964
            //TX_Data[0] = Settings->Data.Navi_Fast / 10;
958
        }
965
        }
959
        else
966
        else
960
        {
967
        {
961
            lb_Status->setText(tr("Fordere langsame NaviDaten an."));
968
            lb_Status->setText(tr("Fordere langsame NaviDaten an."));
962
            TX_Data[0] = Settings->Data.Navi_Slow / 10;
969
            //TX_Data[0] = Settings->Data.Navi_Slow / 10;
963
        }
970
        }
-
 
971
        //FIXME: put this in com/Handler.cpp / com/NaviCtrl.cpp
964
        o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false);
972
        //o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false);
965
    }
973
    }
966
}
974
}
Line 967... Line 975...
967
 
975
 
968
void MKTool::slot_ac_NoNavi() // DONE NC 0.12i
976
void MKTool::slot_ac_NoNavi() // DONE NC 0.12i
969
{
977
{
970
    if (ac_NoNavi->isChecked())
978
    if (ac_NoNavi->isChecked())
971
    {
979
    {
972
        lb_Status->setText(tr("NaviDaten abstellen."));
980
        lb_Status->setText(tr("NaviDaten abstellen."));
973
        TX_Data[0] = 0;
981
//        TX_Data[0] = 0;
974
    }
982
    }
975
    else
983
    else
976
    {
984
    {
977
        if (ac_FastNavi->isChecked())
985
        if (ac_FastNavi->isChecked())
978
        {
986
        {
979
            lb_Status->setText(tr("Fordere schnelle NaviDaten an."));
987
            lb_Status->setText(tr("Fordere schnelle NaviDaten an."));
980
            TX_Data[0] = Settings->Data.Navi_Fast / 10;
988
//            TX_Data[0] = Settings->Data.Navi_Fast / 10;
981
        }
989
        }
982
        else
990
        else
983
        {
991
        {
984
            lb_Status->setText(tr("Fordere langsame NaviDaten an."));
992
            lb_Status->setText(tr("Fordere langsame NaviDaten an."));
985
            TX_Data[0] = Settings->Data.Navi_Slow / 10;
993
//            TX_Data[0] = Settings->Data.Navi_Slow / 10;
986
        }
994
        }
-
 
995
    }
987
    }
996
//FIXME: Put this in com/Handler.cpp
988
    o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false);
997
//    o_Connection->send_Cmd('o', ADDRESS_NC, TX_Data, 1, false);
Line 989... Line 998...
989
}
998
}
990
 
999
 
991
void MKTool::slot_ac_FastDebug() // DONE 0.71g
1000
void MKTool::slot_ac_FastDebug() // DONE 0.71g
992
{
1001
{
993
    if (!ac_NoDebug->isChecked())
1002
    if (!ac_NoDebug->isChecked())
994
    {
1003
    {
995
        if (ac_FastDebug->isChecked())
1004
        if (ac_FastDebug->isChecked())
996
        {
1005
        {
997
            lb_Status->setText(tr("Fordere schnelle DebugDaten an."));
1006
            lb_Status->setText(tr("Fordere schnelle DebugDaten an."));
998
            TX_Data[0] = Settings->Data.Debug_Fast / 10;
1007
            //TX_Data[0] = Settings->Data.Debug_Fast / 10;
999
        }
1008
        }
1000
        else
1009
        else
1001
        {
1010
        {
1002
            lb_Status->setText(tr("Fordere langsame DebugDaten an."));
1011
            lb_Status->setText(tr("Fordere langsame DebugDaten an."));
-
 
1012
            //TX_Data[0] = Settings->Data.Debug_Slow / 10;
1003
            TX_Data[0] = Settings->Data.Debug_Slow / 10;
1013
        }
1004
        }
1014
//FIXME: Put this in com/Handler.cpp
1005
        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
1015
//        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
Line 1006... Line 1016...
1006
    }
1016
    }
1007
}
1017
}
1008
 
1018
 
1009
void MKTool::slot_ac_NoDebug() // DONE 0.71g
1019
void MKTool::slot_ac_NoDebug() // DONE 0.71g
1010
{
1020
{
1011
    if (ac_NoDebug->isChecked())
1021
    if (ac_NoDebug->isChecked())
1012
    {
1022
    {
1013
        lb_Status->setText(tr("DebugDaten abstellen."));
1023
        lb_Status->setText(tr("DebugDaten abstellen."));
1014
        TickerEvent[3] = false;
1024
        TickerEvent[3] = false;
1015
        TX_Data[0] = 0;
1025
        //TX_Data[0] = 0;
1016
    }
1026
    }
1017
    else
1027
    else
1018
    {
1028
    {
Line 1019... Line 1029...
1019
        // Wenn MK3MAG dann andauernd Daten neu anfragen.
1029
        // Wenn MK3MAG dann andauernd Daten neu anfragen.
1020
        if (Mode.ID == ADDRESS_MK3MAG)
1030
        if (Mode.ID == ADDRESS_MK3MAG)
1021
            TickerEvent[3] = true;
1031
            TickerEvent[3] = true;
1022
 
1032
 
1023
        if (ac_FastDebug->isChecked())
1033
        if (ac_FastDebug->isChecked())
1024
        {
1034
        {
1025
            lb_Status->setText(tr("Fordere schnelle DebugDaten an."));
1035
            lb_Status->setText(tr("Fordere schnelle DebugDaten an."));
1026
            TX_Data[0] = Settings->Data.Debug_Fast / 10;
1036
            //TX_Data[0] = Settings->Data.Debug_Fast / 10;
1027
        }
1037
        }
1028
        else
1038
        else
1029
        {
1039
        {
-
 
1040
            lb_Status->setText(tr("Fordere langsame DebugDaten an."));
1030
            lb_Status->setText(tr("Fordere langsame DebugDaten an."));
1041
            //TX_Data[0] = Settings->Data.Debug_Slow / 10;
1031
            TX_Data[0] = Settings->Data.Debug_Slow / 10;
1042
        }
Line 1032... Line 1043...
1032
        }
1043
    }
1033
    }
1044
//FIXME: Put this in com/Handler.cpp
1034
    o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
1045
//    o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
1035
}
1046
}
Line 1036... Line 1047...
1036
 
1047
 
1037
void MKTool::slot_ac_About()
1048
void MKTool::slot_ac_About()
1038
{
1049
{
-
 
1050
    QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
1039
    QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
1051
}
1040
}
1052
 
1041
 
1053
void MKTool::slot_ac_GetLabels() // DONE 0.71g
Line 1042... Line 1054...
1042
void MKTool::slot_ac_GetLabels() // DONE 0.71g
1054
{
1043
{
1055
    lb_Status->setText(tr("Analoglabels auslesen."));
1044
    lb_Status->setText(tr("Analoglabels auslesen."));
1056
//FIXME: Put this in com/Handler.cpp
Line 1147... Line 1159...
1147
 
1159
 
Line 1148... Line 1160...
1148
        QStringList Argumente;
1160
        QStringList Argumente;
Line -... Line 1161...
-
 
1161
 
1149
 
1162
        Update = new QProcess();
1150
        Update = new QProcess();
1163
 
1151
 
1164
//FIXME: put this in QTCommunication.cpp
1152
        if (o_Connection->isOpen())
1165
/*        if (o_Connection->isOpen())
1153
        {
1166
        {
1154
            slot_OpenPort();
1167
            slot_OpenPort();
1155
        }
1168
        }
1156
 
1169
*/
1157
        Argumente << "-P";
1170
        Argumente << "-P";
1158
        Argumente << le_Port->text();
1171
        Argumente << le_Port->text();
Line 1206... Line 1219...
1206
    Tab = Tab;
1219
    Tab = Tab;
1207
    if (tab_Main->count() != 0)
1220
    if (tab_Main->count() != 0)
1208
    {
1221
    {
1209
        if ((tab_Main->currentWidget()->objectName() == QString("Tab_2")) && (f_Settings->listWidget->currentRow() == 1))
1222
        if ((tab_Main->currentWidget()->objectName() == QString("Tab_2")) && (f_Settings->listWidget->currentRow() == 1))
1210
        {
1223
        {
1211
            TX_Data[0] = 0;
1224
//            TX_Data[0] = 0;
-
 
1225
//FIXME: Put this in com/Handler.cpp
1212
            o_Connection->send_Cmd('p', ADDRESS_FC, TX_Data, 0, false);
1226
//            o_Connection->send_Cmd('p', ADDRESS_FC, TX_Data, 0, false);
Line 1213... Line 1227...
1213
 
1227
 
1214
            Ticker->setInterval(500);
1228
            Ticker->setInterval(500);
1215
            TickerEvent[1] = true;
1229
            TickerEvent[1] = true;
1216
        }
1230
        }
Line 1223... Line 1237...
1223
}
1237
}
Line 1224... Line 1238...
1224
 
1238
 
1225
// LCD-Seiten weiterschalten
1239
// LCD-Seiten weiterschalten
1226
void MKTool::slot_LCD_UP() // DONE 0.71g
1240
void MKTool::slot_LCD_UP() // DONE 0.71g
-
 
1241
{
1227
{
1242
//FIXME: Put this in com/Handler.cpp
1228
    if (LCD_Page == LCD_MAX_Page)
1243
/*    if (LCD_Page == LCD_MAX_Page)
1229
        TX_Data[0] = 0;
1244
        TX_Data[0] = 0;
1230
    else
1245
    else
Line 1231... Line 1246...
1231
        TX_Data[0] = LCD_Page + 1;
1246
        TX_Data[0] = LCD_Page + 1;
1232
 
1247
 
-
 
1248
    TX_Data[1] = 0;
1233
    TX_Data[1] = 0;
1249
    o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
Line 1234... Line 1250...
1234
    o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
1250
*/
1235
}
1251
}
-
 
1252
 
-
 
1253
void MKTool::slot_LCD_DOWN() // DONE 0.71g
1236
 
1254
{
1237
void MKTool::slot_LCD_DOWN() // DONE 0.71g
1255
//FIXME: Put this in com/Handler.cpp
1238
{
1256
/*
1239
    if (LCD_Page == 0)
1257
    if (LCD_Page == 0)
Line 1240... Line 1258...
1240
        TX_Data[0] = LCD_MAX_Page;
1258
        TX_Data[0] = LCD_MAX_Page;
1241
    else
1259
    else
-
 
1260
        TX_Data[0] = LCD_Page - 1;
1242
        TX_Data[0] = LCD_Page - 1;
1261
 
Line 1243... Line 1262...
1243
 
1262
    TX_Data[1] = 0;
1244
    TX_Data[1] = 0;
1263
    o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
1245
    o_Connection->send_Cmd('l', ADDRESS_ALL, TX_Data, 1, true);
1264
*/
1246
}
1265
}
-
 
1266
 
-
 
1267
// Settings aus MK lesen / in MK schreiben
1247
 
1268
void MKTool::slot_GetFCSettings() // DONE 0.71g
1248
// Settings aus MK lesen / in MK schreiben
1269
{
1249
void MKTool::slot_GetFCSettings() // DONE 0.71g
1270
    lb_Status->setText(tr("Lese FlightCtrl-Settings aus."));
-
 
1271
//FIXME: Put this in com/Handler.cpp
1250
{
1272
/*
Line 1251... Line 1273...
1251
    lb_Status->setText(tr("Lese FlightCtrl-Settings aus."));
1273
    TX_Data[0] = f_Settings->sb_Set->value();
1252
    TX_Data[0] = f_Settings->sb_Set->value();
1274
    TX_Data[1] = 0;
-
 
1275
    o_Connection->send_Cmd('q', ADDRESS_FC, TX_Data, 1, true);
-
 
1276
*/
1253
    TX_Data[1] = 0;
1277
}
Line 1254... Line 1278...
1254
    o_Connection->send_Cmd('q', ADDRESS_FC, TX_Data, 1, true);
1278
 
Line 1255... Line 1279...
1255
}
1279
void MKTool::slot_SetFCSettings() // DONE 0.71g
-
 
1280
{
1256
 
1281
//FIXME: Put this in com/Handler.cpp
Line 1257... Line 1282...
1257
void MKTool::slot_SetFCSettings() // DONE 0.71g
1282
/*
1258
{
1283
    char *TX_Data2 = f_Settings->GetFCSettings();
Line 1508... Line 1533...
1508
}
1533
}
Line 1509... Line 1534...
1509
 
1534
 
1510
// Verbindung zum Kopter herstellen / Trennen
1535
// Verbindung zum Kopter herstellen / Trennen
1511
void MKTool::slot_OpenPort()
1536
void MKTool::slot_OpenPort()
-
 
1537
{
-
 
1538
//FIXME: Put this in com/QTCommunication.cpp
1512
{
1539
/*
1513
    if (o_Connection->isOpen())
1540
    if (o_Connection->isOpen())
1514
    {
1541
    {
1515
        TX_Data[0] = Settings->Data.Debug_Off / 10;
1542
        TX_Data[0] = Settings->Data.Debug_Off / 10;
1516
        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
1543
        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
Line 1560... Line 1587...
1560
            o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true);
1587
            o_Connection->send_Cmd('v', ADDRESS_ALL, TX_Data, 0, true);
Line 1561... Line 1588...
1561
 
1588
 
1562
            Ticker->start(2000);
1589
            Ticker->start(2000);
1563
        }
1590
        }
-
 
1591
    }
1564
    }
1592
*/
Line 1565... Line 1593...
1565
}
1593
}
1566
 
1594
 
Line 1567... Line 1595...
1567
// Programm beenden
1595
// Programm beenden
1568
///////////////////
1596
///////////////////
-
 
1597
 
-
 
1598
MKTool::~MKTool()
1569
 
1599
{
1570
MKTool::~MKTool()
1600
//FIXME: Put this in com/QTCommunication.cpp
1571
{
1601
/*
1572
    if (o_Connection->isOpen())
1602
    if (o_Connection->isOpen())
1573
    {
1603
    {
1574
        o_Connection->Close();
1604
        o_Connection->Close();
1575
    }
1605
    }
Line 1576... Line 1606...
1576
 
1606
*/
1577
    set_Preferences();
1607
    set_Preferences();