Subversion Repositories Projects

Rev

Rev 162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 162 Rev 163
Line 160... Line 160...
160
//    connect(pb_Update,  SIGNAL(clicked()), this, SLOT(slot_pb_Update()));
160
//    connect(pb_Update,  SIGNAL(clicked()), this, SLOT(slot_pb_Update()));
Line 161... Line 161...
161
 
161
 
162
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort()));
162
    connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort()));
Line 163... Line -...
163
    connect(ac_RecordCSV,  SIGNAL(triggered()), this, SLOT(slot_RecordCSV()));
-
 
164
 
-
 
165
    connect(ac_LogDir,       SIGNAL(triggered()), this, SLOT(slot_SetLogDir()));
-
 
166
    connect(ac_ParameterDir, SIGNAL(triggered()), this, SLOT(slot_SetParDir()));
163
    connect(ac_RecordCSV,  SIGNAL(triggered()), this, SLOT(slot_RecordCSV()));
167
 
164
 
Line 168... Line 165...
168
    // Timer-Events
165
    // Timer-Events
169
    connect(Ticker,   SIGNAL(timeout()),       SLOT(slot_Ticker()));
166
    connect(Ticker,   SIGNAL(timeout()),       SLOT(slot_Ticker()));
Line 369... Line 366...
369
    if (f_Config->exec()==QDialog::Accepted)
366
    if (f_Config->exec()==QDialog::Accepted)
370
    {
367
    {
371
        Settings = f_Config->get_Settings();
368
        Settings = f_Config->get_Settings();
372
        Settings->write_Settings_Analog(Mode.ID);
369
        Settings->write_Settings_Analog(Mode.ID);
Line 373... Line 370...
373
 
370
 
-
 
371
        // Plotter neu einrichten
374
        for (int a = 0; a < MaxAnalog; a++)
372
        if (Old_Analog1.PlotView != Settings->Analog1.PlotView)
375
        {
-
 
376
            if (Old_Analog1.PlotView[a] == Settings->Analog1.PlotView[a])
-
 
377
                continue;
-
 
378
            else
-
 
379
            {
373
        {
380
                config_Plot();
-
 
381
                break;
-
 
382
            }
374
            config_Plot();
Line 383... Line 375...
383
        }
375
        }
-
 
376
 
384
 
377
        // CVS-Datei neu anlegen.
385
        if (CSVFile->isOpen())
-
 
386
        {
-
 
387
            for (int a = 0; a < MaxAnalog; a++)
-
 
388
            {
-
 
389
                if (Old_Analog1.LogView[a] == Settings->Analog1.LogView[a])
-
 
390
                    continue;
-
 
391
                else
378
        if ((CSVFile->isOpen()) && (Old_Analog1.LogView != Settings->Analog1.LogView))
392
                {
379
        {
393
                    slot_RecordCSV();
-
 
394
                    slot_RecordCSV();
-
 
395
                    break;
-
 
396
                }
380
            slot_RecordCSV();
Line 397... Line 381...
397
            }
381
            slot_RecordCSV();
398
        }
382
        }
Line 399... Line 383...
399
 
383
 
400
    }
384
    }
401
}
385
}
Line -... Line 386...
-
 
386
 
-
 
387
void MKTool::slot_ac_Preferences()
402
 
388
{
403
void MKTool::slot_ac_Preferences()
389
    dlg_Preferences *f_Preferences = new dlg_Preferences(this);
404
{
-
 
-
 
390
 
-
 
391
    f_Preferences->set_Settings(Settings);
405
    dlg_Preferences *f_Preferences = new dlg_Preferences(this);
392
 
406
 
393
    if (f_Preferences->exec()==QDialog::Accepted)
Line 407... Line 394...
407
    if (f_Preferences->exec()==QDialog::Accepted)
394
    {
408
    {
395
        Settings = f_Preferences->get_Settings();
Line 567... Line 554...
567
 
554
 
568
    te_Shell->setText(QString::fromUtf8(Output)); // ...und endlich: Ausgabe im QLabel
555
    te_Shell->setText(QString::fromUtf8(Output)); // ...und endlich: Ausgabe im QLabel
569
    qDebug("Shell");
556
    qDebug("Shell");
Line 570... Line -...
570
}
-
 
571
 
-
 
572
// Configuration -> Verzeichnisse
-
 
573
/////////////////////////////////
-
 
574
void MKTool::slot_SetLogDir()
-
 
575
{
-
 
576
    QString directory = QFileDialog::getExistingDirectory(this, "Verzeichniss für CSV-Logdateien", Settings->DIR.Logging, QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly);
-
 
577
 
-
 
578
    if ((!directory.isEmpty()) && (Settings->DIR.Logging != directory))
-
 
579
    {
-
 
580
        Settings->DIR.Logging = directory;
-
 
581
        Settings->write_Settings();
-
 
582
    }
-
 
583
}
-
 
584
 
-
 
585
void MKTool::slot_SetParDir()
-
 
586
{
-
 
587
    QString directory = QFileDialog::getExistingDirectory(this, "Verzeichniss für Parameter-Dateien", Settings->DIR.Parameter, QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly);
-
 
588
 
-
 
589
    if ((!directory.isEmpty()) && (Settings->DIR.Parameter != directory))
-
 
590
    {
-
 
591
        Settings->DIR.Parameter = directory;
-
 
592
        Settings->write_Settings();
-
 
593
    }
-
 
594
 
-
 
Line 595... Line 557...
595
}
557
}
596
 
558
 
Line 597... Line 559...
597
 
559
 
Line 1504... Line 1466...
1504
 
1466
 
1505
// Save GUI-Settings
1467
// Save GUI-Settings
1506
////////////////////
1468
////////////////////
1507
void MKTool::write_Settings()
1469
void MKTool::write_Settings()
1508
{
1470
{
1509
    QBitArray TabViews(6);
1471
//    QBitArray TabViews(6);
1510
    TabViews.setBit(0, ac_View0->isChecked());
1472
    Settings->GUI.TabViews.setBit(0, ac_View0->isChecked());
1511
    TabViews.setBit(1, ac_View1->isChecked());
1473
    Settings->GUI.TabViews.setBit(1, ac_View1->isChecked());
1512
    TabViews.setBit(2, ac_View2->isChecked());
1474
    Settings->GUI.TabViews.setBit(2, ac_View2->isChecked());
1513
    TabViews.setBit(3, ac_View3->isChecked());
1475
    Settings->GUI.TabViews.setBit(3, ac_View3->isChecked());
1514
    TabViews.setBit(4, ac_View4->isChecked());
1476
    Settings->GUI.TabViews.setBit(4, ac_View4->isChecked());
Line 1515... Line 1477...
1515
    TabViews.setBit(5, ac_View5->isChecked());
1477
    Settings->GUI.TabViews.setBit(5, ac_View5->isChecked());
1516
 
1478
 
1517
    Settings->GUI.Term_Info   = cb_ShowMSG->isChecked();
1479
    Settings->GUI.Term_Info   = cb_ShowMSG->isChecked();
Line 1518... Line 1480...
1518
    Settings->GUI.Term_Data   = cb_ShowData->isChecked();
1480
    Settings->GUI.Term_Data   = cb_ShowData->isChecked();
Line 1519... Line -...
1519
    Settings->GUI.Term_Always = cb_ShowAlways->isChecked();
-
 
1520
 
1481
    Settings->GUI.Term_Always = cb_ShowAlways->isChecked();
1521
    QSettings Setting("KeyOz-Net", "QMK-Groundstation");
-
 
Line 1522... Line 1482...
1522
 
1482
 
1523
    Setting.beginGroup("Port");
1483
    Settings->TTY.Port = le_Port->text();
1524
        Setting.setValue("TTY", le_Port->text());
1484
 
1525
    Setting.endGroup();
1485
    QSettings Setting("KeyOz-Net", "QMK-Groundstation");
1526
 
-
 
1527
    Setting.beginGroup("GUI");
1486
 
1528
        Setting.setValue("IsMax", isMaximized());
1487
    Setting.beginGroup("GUI");
Line 1529... Line 1488...
1529
        Setting.setValue("Size",  size());
1488
        Setting.setValue("IsMax", isMaximized());
Line 1698... Line 1657...
1698
                break;
1657
                break;
1699
        case 'A' : // DONE 0.71g
1658
        case 'A' : // DONE 0.71g
1700
                    if (ToolBox::Decode64(RX, true))
1659
                    if (ToolBox::Decode64(RX, true))
1701
                    {
1660
                    {
1702
                        int Position = RX.Decode[0];
1661
                        int Position = RX.Decode[0];
1703
                        if (Position < 32)
1662
                        if (Position != 31)
1704
                        {
1663
                        {
1705
                            Settings->Analog1.Label[Position] = ToolBox::Data2QString(RX.Decode,1,17).trimmed();
1664
                            Settings->Analog1.Label[Position] = ToolBox::Data2QString(RX.Decode,1,17).trimmed();
1706
                            Position ++;
1665
                            Position ++;
1707
                            TX_Data[0] = Position;
1666
                            TX_Data[0] = Position;
1708
                            send_Data('a', ADDRESS_ALL, TX_Data, 1, false);
1667
                            send_Data('a', ADDRESS_ALL, TX_Data, 1, false);
Line 1711... Line 1670...
1711
                        {
1670
                        {
1712
                            for (int a = 0; a < MaxAnalog; a++)
1671
                            for (int a = 0; a < MaxAnalog; a++)
1713
                            {
1672
                            {
1714
                                lb_Analog[a]->setText(Settings->Analog1.Label[a]);
1673
                                lb_Analog[a]->setText(Settings->Analog1.Label[a]);
1715
                            }
1674
                            }
-
 
1675
                            Settings->Analog1.Version = Mode.Version;
1716
                            Settings->write_Settings_AnalogLabels(HardwareID);
1676
                            Settings->write_Settings_AnalogLabels(HardwareID);
1717
                            config_Plot();
1677
                            config_Plot();
1718
                        }
1678
                        }
1719
                    }
1679
                    }
1720
                break;
1680
                break;
Line 1799... Line 1759...
1799
 
1759
 
1800
//                            QMessageBox::warning(this, QA_NAME,
1760
//                            QMessageBox::warning(this, QA_NAME,
1801
//                               "Keine Verbindung zur FlightCtrl. \nParameterbearbeitung nicht moeglich.", QMessageBox::Ok);
1761
//                               "Keine Verbindung zur FlightCtrl. \nParameterbearbeitung nicht moeglich.", QMessageBox::Ok);
Line 1802... Line -...
1802
                    }
-
 
1803
 
1762
                    }
-
 
1763
 
-
 
1764
                    Settings->read_Settings_Analog(HardwareID);
-
 
1765
                    Settings->read_Settings_AnalogLabels(HardwareID);
-
 
1766
 
-
 
1767
                    if (Settings->Analog1.Version != Mode.Version)
-
 
1768
                    {
-
 
1769
                        slot_ac_GetLabels();
1804
                    Settings->read_Settings_AnalogLabels(HardwareID);
1770
                    }
1805
                    Settings->read_Settings_Analog(HardwareID);
1771
                    else
1806
                    for (int a = 0; a < MaxAnalog; a++)
1772
                    for (int a = 0; a < MaxAnalog; a++)
1807
                    {
1773
                    {
1808
                        lb_Analog[a]->setText(Settings->Analog1.Label[a]);
1774
                        lb_Analog[a]->setText(Settings->Analog1.Label[a]);
Line 1949... Line 1915...
1949
 
1915
 
1950
    if (CSVFile->isOpen())
1916
    if (CSVFile->isOpen())
1951
    {
1917
    {
1952
        CSVFile->close();
1918
        CSVFile->close();
1953
    }
-
 
1954
 
-
 
1955
//    close();
1919
    }
1956
}
-