Subversion Repositories Projects

Rev

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

Rev 449 Rev 500
Line 58... Line 58...
58
void MKTool::init_GUI()
58
void MKTool::init_GUI()
59
{
59
{
60
    setWindowTitle(QA_NAME + " v" + QA_VERSION);
60
    setWindowTitle(QA_NAME + " v" + QA_VERSION);
61
 
61
 
62
    // Tab mit Debug-Elementen verbergen
62
    // Tab mit Debug-Elementen verbergen
63
    tab_Main->removeTab(6);
63
    //tab_Main->removeTab(6);
64
 
64
 
65
    // Develop - Nicht gebrauchte sachen abschalten.
65
    // Develop - Nicht gebrauchte sachen abschalten.
66
    pb_SettingsReset->hide();
66
    pb_SettingsReset->hide();
67
    pb_Flash->hide();
67
    pb_Flash->hide();
68
    rb_NC->hide();
68
    rb_NC->hide();
Line 200... Line 200...
200
{
200
{
201
    //new KopterData object that contains all data from MK
201
    //new KopterData object that contains all data from MK
202
    data = new KopterData();
202
    data = new KopterData();
203
 
203
 
204
    //new QT-Communication object
204
    //new QT-Communication object
205
    com = new QTSerialCommunication();
205
    com = new QTSerialCommunication(handler);
206
 
206
 
207
    //create handler that handles incomming data
207
    //create handler that handles incomming data
208
    handler = new Handler(com, data);
208
    handler = new Handler(com, data);
209
 
209
 
210
    // QTimer-Instanzen
210
    // QTimer-Instanzen
Line 247... Line 247...
247
    // Daten Senden / Empfangen
247
    // Daten Senden / Empfangen
248
//FIXME: put this in QTCommunication.cpp
248
//FIXME: put this in QTCommunication.cpp
249
//    connect(o_Connection, SIGNAL(newData(sRxData)), this, SLOT(slot_newData(sRxData)));
249
//    connect(o_Connection, SIGNAL(newData(sRxData)), this, SLOT(slot_newData(sRxData)));
250
//    connect(o_Connection, SIGNAL(showTerminal(int, QString)), this, SLOT(slot_showTerminal(int, QString)));
250
//    connect(o_Connection, SIGNAL(showTerminal(int, QString)), this, SLOT(slot_showTerminal(int, QString)));
251
 
251
 
252
    // Serielle Verbundung öffnen / schließen
252
    // click on button to open/close serial connection
253
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort()));
253
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_serial_connect()));
254
 
254
 
255
    // TCP-Connection for other QMK-Groundstations
255
    // clock on button for the TCP-Connection to other QMK-Groundstations
256
    connect(ac_QMKServer, SIGNAL(triggered()), this, SLOT(slot_QMKS_Connect()));
256
    connect(ac_QMKServer, SIGNAL(triggered()), this, SLOT(slot_QMKS_Connect()));
257
 
257
 
258
    // Buttons Settings lesen / schreiben
258
    // Buttons Settings lesen / schreiben
259
    connect(f_Settings->pb_Read,   SIGNAL(clicked()), this, SLOT(slot_GetFCSettings()));
259
    connect(f_Settings->pb_Read,   SIGNAL(clicked()), this, SLOT(slot_GetFCSettings()));
260
    connect(f_Settings->pb_Write,  SIGNAL(clicked()), this, SLOT(slot_SetFCSettings()));
260
    connect(f_Settings->pb_Write,  SIGNAL(clicked()), this, SLOT(slot_SetFCSettings()));
Line 566... Line 566...
566
//FIXME: Put this somewhere in libMK/QTCommunication.cpp
566
//FIXME: Put this somewhere in libMK/QTCommunication.cpp
567
// Ticker-Event
567
// Ticker-Event
568
///////////////
568
///////////////
569
/*void MKTool::slot_Ticker()
569
/*void MKTool::slot_Ticker()
570
{
570
{
571
 
-
 
572
 
-
 
573
    if (TickerDiv)
571
    if (TickerDiv)
574
        TickerDiv = false;
572
        TickerDiv = false;
575
    else
573
    else
576
        TickerDiv = true;
574
        TickerDiv = true;
577
 
575
 
Line 1478... Line 1476...
1478
        }
1476
        }
1479
        break;
1477
        break;
1480
    }
1478
    }
1481
}
1479
}
1482
 
1480
 
1483
// Verbindung zum Kopter herstellen / Trennen
1481
// connect to MK
1484
void MKTool::slot_OpenPort()
1482
void MKTool::slot_serial_connect()
1485
{
1483
{
-
 
1484
    //connect to Mikrokopter
-
 
1485
    com->connect_MK(le_Port->text().toAscii().data());
-
 
1486
    //TODO: check, if connection really is established
-
 
1487
    ac_ConnectTTY->setText(tr("Kopter Trennen"));
-
 
1488
 
-
 
1489
    le_Port->setEnabled(false);
-
 
1490
 
-
 
1491
    //send command to get version of MK
-
 
1492
    handler->get_version();
-
 
1493
 
-
 
1494
    //TODO: Ticker->start(2000);
-
 
1495
    //TODO: disconnect
-
 
1496
 
1486
//FIXME: Put this in libMK/QTCommunication.cpp
1497
    //FIXME: Put this in libMK/QTCommunication.cpp
1487
/*
1498
/*
1488
    if (o_Connection->isOpen())
1499
    if (o_Connection->isOpen())
1489
    {
1500
    {
1490
        TX_Data[0] = Settings->Data.Debug_Off / 10;
1501
        TX_Data[0] = Settings->Data.Debug_Off / 10;
1491
        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);
1502
        o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false);