Subversion Repositories Projects

Rev

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

Rev 715 Rev 750
Line 55... Line 55...
55
    setWindowTitle(QA_NAME + " " + QA_VERSION);
55
    setWindowTitle(QA_NAME + " " + QA_VERSION);
Line 56... Line 56...
56
 
56
 
57
    resize(o_Settings->GUI.Size);
57
    resize(o_Settings->GUI.Size);
Line -... Line 58...
-
 
58
    move(o_Settings->GUI.Point);
-
 
59
 
-
 
60
    f_Terminal->resize(o_Settings->TERMINAL.Size);
-
 
61
    f_Terminal->move(o_Settings->TERMINAL.Point);
-
 
62
 
-
 
63
    f_Terminal->cb_Data->setChecked(o_Settings->DATA.Data);
-
 
64
    f_Terminal->cb_Info->setChecked(o_Settings->DATA.Info);
-
 
65
    f_Terminal->cb_Send->setChecked(o_Settings->DATA.Send);
58
    move(o_Settings->GUI.Point);
66
    f_Terminal->cb_TCP->setChecked(o_Settings->DATA.TCP);
59
 
67
 
60
    if (o_Settings->GUI.isMax)
68
    if (o_Settings->GUI.isMax)
61
    {
69
    {
Line 94... Line 102...
94
    cb_Server->setCurrentIndex(o_Settings->CLIENT.TCP_ID);
102
    cb_Server->setCurrentIndex(o_Settings->CLIENT.TCP_ID);
Line 95... Line 103...
95
 
103
 
96
    // Password für IP-Verbindung.
104
    // Password für IP-Verbindung.
Line -... Line 105...
-
 
105
    le_Password->setText(o_Settings->CLIENT.TCP_Password);
-
 
106
 
97
    le_Password->setText(o_Settings->CLIENT.TCP_Password);
107
    btn_Debug->setVisible(false);
Line 98... Line 108...
98
 
108
    btn_ConnectServer->setVisible(false);
99
}
109
}
100
 
110
 
Line 112... Line 122...
112
    connect(btn_cLogger,   SIGNAL(clicked()), this, SLOT(slot_btn_cLogger()));
122
    connect(btn_cLogger,   SIGNAL(clicked()), this, SLOT(slot_btn_cLogger()));
Line 113... Line 123...
113
 
123
 
114
    connect(btn_Terminal,      SIGNAL(clicked()), this, SLOT(slot_btn_Terminal()));
124
    connect(btn_Terminal,      SIGNAL(clicked()), this, SLOT(slot_btn_Terminal()));
Line -... Line 125...
-
 
125
    connect(btn_ConnectServer, SIGNAL(clicked()), this, SLOT(slot_btn_ConnectServer()));
-
 
126
 
-
 
127
    connect(btn_Debug, SIGNAL(clicked()), this, SLOT(slot_btn_Debug()));
-
 
128
 
-
 
129
    connect(rb_NC,      SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
-
 
130
    connect(rb_FC,      SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
115
    connect(btn_ConnectServer, SIGNAL(clicked()), this, SLOT(slot_btn_ConnectServer()));
131
    connect(rb_MK3MAG,  SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
116
 
132
 
117
    // About QMK-Kernel & About-QT Dialog einfügen
133
    // About QMK-Kernel & About-QT Dialog einfügen
118
    connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
134
    connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
119
    connect(ac_Server, SIGNAL(triggered()), this, SLOT(slot_ac_Server()));
135
    connect(ac_Server, SIGNAL(triggered()), this, SLOT(slot_ac_Server()));
Line 149... Line 165...
149
 
165
 
150
// Eingangsdaten verarbeiten
166
// Eingangsdaten verarbeiten
151
////////////////////////////
167
////////////////////////////
152
void dlg_Main::parse_Input_Data(QString t_Data)
168
void dlg_Main::parse_Input_Data(QString t_Data)
153
{
169
{
154
    unsigned char OutData[150];
170
    unsigned char OutData[180];
Line 155... Line 171...
155
    char *InData = t_Data.toLatin1().data();
171
    char *InData = t_Data.toLatin1().data();
156
 
172
 
157
    if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
173
    if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
Line 336... Line 352...
336
            break;
352
            break;
337
        }
353
        }
338
    }
354
    }
339
}
355
}
Line 340... Line 356...
340
 
356
 
341
// IP-Input-Daten verarbeiten.
357
// IP-Output-Daten verarbeiten. (Live-Data)
342
void dlg_Main::parse_TCP_Output_Data(QString t_Data)
358
void dlg_Main::parse_TCP_Output_Data(QString t_Data)
343
{
359
{
344
    QStringList Data;
360
    QStringList Data;
Line 370... Line 386...
370
                    {
386
                    {
371
//                        qDebug("Request PW");
387
//                        qDebug("Request PW");
372
                        QString s_MD5PW;
388
                        QString s_MD5PW;
373
                        QByteArray a_MD5PW;
389
                        QByteArray a_MD5PW;
Line 374... Line 390...
374
 
390
 
Line 375... Line 391...
375
                        a_MD5PW = QCryptographicHash::hash(QString("madlen").toAscii(),QCryptographicHash::Md5);
391
                        a_MD5PW = QCryptographicHash::hash(QString(QByteArray::fromBase64(Base64Hash.toLatin1()) + o_Settings->LIVEDATA.Password).toAscii(),QCryptographicHash::Md5);
Line 376... Line 392...
376
 
392
 
377
                        s_MD5PW = QString(a_MD5PW.toHex().data());
393
                        s_MD5PW = QString(a_MD5PW.toHex().data());
378
 
394
 
379
                        o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, "keyoz@c64-power.net;" + s_MD5PW));
395
                        o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, o_Settings->LIVEDATA.User + ";" + s_MD5PW));
380
                    }
396
                    }
381
                    break;
397
                    break;
Line 503... Line 519...
503
{
519
{
504
    if (!o_Output->IsOpen())
520
    if (!o_Output->IsOpen())
505
    {
521
    {
506
        Con_Output = Con_Server[0];
522
        Con_Output = Con_Server[0];
Line 507... Line 523...
507
 
523
 
508
        s_Output.Main = "127.0.0.1";//Server[0];
524
        s_Output.Main = o_Settings->LIVEDATA.Server;//Server[0];
Line 509... Line 525...
509
        s_Output.Sub  = "64410";//Server[1];
525
        s_Output.Sub  = o_Settings->LIVEDATA.Port;//Server[1];
510
 
526
 
Line 511... Line 527...
511
        o_Output = new Input_TCP();
527
        o_Output = new Input_TCP();
Line 531... Line 547...
531
            disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0);
547
            disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0);
532
        }
548
        }
533
    }
549
    }
534
}
550
}
Line 535... Line 551...
535
 
551
 
-
 
552
void dlg_Main::slot_btn_Debug()
-
 
553
{
-
 
554
    if (o_Output->IsOpen())
-
 
555
    {
-
 
556
        o_Output->send_Data("#cO=M======wWMrSCuD==A===============================================A=GM======[M=====@==@|p==O=CM=========kN");
-
 
557
    }
-
 
558
}
-
 
559
 
536
void dlg_Main::slot_Output_Disconnected(int Error)
560
void dlg_Main::slot_rb_Hardware()
-
 
561
{
-
 
562
//    if ((rb_NC->isChecked() == false) && (VersionInfo.ID != ADDRESS_NC))
-
 
563
//    {
-
 
564
//        o_Input->send_Data(HandlerMK::get_SelectNC());
-
 
565
 //   }
-
 
566
 
-
 
567
    if (rb_FC->isChecked())
-
 
568
    {
-
 
569
        o_Input->send_Data(HandlerMK::get_SelectFC());
-
 
570
    }
537
{
571
    else
-
 
572
    if (rb_MK3MAG->isChecked())
-
 
573
    {
-
 
574
        o_Input->send_Data(HandlerMK::get_SelectMK3MAG());
-
 
575
    }
538
//    cb_Server->setEnabled(true);
576
    else
-
 
577
    if (rb_NC->isChecked())
-
 
578
    {
-
 
579
        o_Input->send_Data(HandlerMK::get_SelectNC());
Line -... Line 580...
-
 
580
    }
-
 
581
 
-
 
582
    o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
-
 
583
}
-
 
584
 
539
//    le_Password->setEnabled(true);
585
void dlg_Main::slot_Output_Disconnected(int Error)
540
 
586
{
541
    disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0);
587
    disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0);
542
    if (o_Output->Mode() == TCP)
588
    if (o_Output->Mode() == TCP)
543
    {
589
    {
Line 578... Line 624...
578
}
624
}
Line 579... Line 625...
579
 
625
 
580
void dlg_Main::slot_Output_Connected()
626
void dlg_Main::slot_Output_Connected()
581
{
627
{
582
    connect(o_Output, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Output_Data(QString)));
-
 
583
 
-
 
584
//    o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION));
-
 
585
//    o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
-
 
586
//    btn_Connect->setText(tr("Trennen"));
628
    connect(o_Output, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Output_Data(QString)));
Line 587... Line 629...
587
}
629
}
588
 
630
 
589
void dlg_Main::slot_Output_Data(QString t_Data)
631
void dlg_Main::slot_Output_Data(QString t_Data)
590
{
632
{
591
    if ((t_Data[0] == '#'))
633
    if ((t_Data[0] == '#'))
592
    {
634
    {
593
    }
635
    }
594
    else if (o_Output->Mode() == TCP)
636
    else if (o_Output->Mode() == TCP)
595
    {
637
    {
596
        show_Terminal(6, t_Data);
638
        show_Terminal(6, "IP:" + t_Data);
597
        parse_TCP_Output_Data(t_Data);
639
        parse_TCP_Output_Data(t_Data);
Line 598... Line 640...
598
    }
640
    }
Line 852... Line 894...
852
    {
894
    {
853
        int ID = Socket->property("ID").toUInt();
895
        int ID = Socket->property("ID").toUInt();
854
        ID = ID;
896
        ID = ID;
Line 855... Line 897...
855
 
897
 
856
//        QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n'));
898
//        QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n'));
857
        QString t_Data = s_Buffer + QString(Socket->readAll());
899
        QString t_Data = s_Buffer + QString(Socket->readAll()).remove(QChar('\n'));
Line -... Line 900...
-
 
900
        s_Buffer = "";
-
 
901
 
858
        s_Buffer = "";
902
        t_Data = t_Data.replace('\r', "\r\n");
Line 859... Line 903...
859
 
903
 
860
        QStringList l_Data = t_Data.split('\n');
904
        QStringList l_Data = t_Data.split('\n');
861
 
905
 
Line 877... Line 921...
877
                        o_Input->send_Data(l_Data[z]);
921
                        o_Input->send_Data(l_Data[z]);
878
                    }
922
                    }
879
                }
923
                }
880
            }
924
            }
881
            else
925
            else
-
 
926
            {   if (l_Data[z].length() > 1)
882
            {
927
                {
883
                qDebug("Ohne Ende");
928
                    qDebug(QString("Ohne Ende: " + l_Data[z]).toLatin1().data());
884
                s_Buffer = s_Buffer + l_Data[z];
929
                    s_Buffer = s_Buffer + l_Data[z];
-
 
930
                }
885
            }
931
            }
Line 886... Line 932...
886
 
932
 
Line 887... Line 933...
887
        }
933
        }
Line 939... Line 985...
939
{
985
{
940
    o_Settings->GUI.isMax       = isMaximized();
986
    o_Settings->GUI.isMax       = isMaximized();
941
    o_Settings->GUI.Size        = size();
987
    o_Settings->GUI.Size        = size();
942
    o_Settings->GUI.Point       = pos();
988
    o_Settings->GUI.Point       = pos();
Line -... Line 989...
-
 
989
 
-
 
990
//    o_Settings->GUI.isMax       = isMaximized();
-
 
991
    o_Settings->TERMINAL.Size        = f_Terminal->size();
-
 
992
    o_Settings->TERMINAL.Point       = f_Terminal->pos();
943
 
993
 
944
    o_Settings->CLIENT.TTY_MAX = cb_Device->count();
994
    o_Settings->CLIENT.TTY_MAX = cb_Device->count();
Line 945... Line 995...
945
    o_Settings->CLIENT.TTY_ID  = cb_Device->currentIndex();
995
    o_Settings->CLIENT.TTY_ID  = cb_Device->currentIndex();
946
 
996
 
Line 961... Line 1011...
961
        {
1011
        {
962
            o_Settings->CLIENT.TCP_SERVER[z] = cb_Server->itemText(z);
1012
            o_Settings->CLIENT.TCP_SERVER[z] = cb_Server->itemText(z);
963
        }
1013
        }
964
    }
1014
    }
Line -... Line 1015...
-
 
1015
 
-
 
1016
    o_Settings->DATA.Data = f_Terminal->cb_Data->isChecked();
-
 
1017
    o_Settings->DATA.Info = f_Terminal->cb_Info->isChecked();
-
 
1018
    o_Settings->DATA.Send = f_Terminal->cb_Send->isChecked();
-
 
1019
    o_Settings->DATA.TCP  = f_Terminal->cb_TCP->isChecked();
965
 
1020
 
Line 966... Line 1021...
966
    o_Settings->write_Settings();
1021
    o_Settings->write_Settings();
967
 
1022