Rev 674 | Rev 750 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 674 | Rev 711 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * along with this program; if not, write to the * |
15 | * along with this program; if not, write to the * |
16 | * Free Software Foundation, Inc., * |
16 | * Free Software Foundation, Inc., * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
Line -... | Line 19... | ||
- | 19 | ||
19 | 20 | #include <QCryptographicHash> |
|
20 | #include <QMessageBox> |
21 | #include <QMessageBox> |
21 | #include <QDomDocument> |
22 | #include <QDomDocument> |
Line 22... | Line 23... | ||
22 | #include <QFile> |
23 | #include <QFile> |
Line 92... | Line 93... | ||
92 | void dlg_Main::init_Connections() |
93 | void dlg_Main::init_Connections() |
93 | { |
94 | { |
94 | connect(ac_Connect, SIGNAL(triggered()), this, SLOT(slot_ac_Connect())); |
95 | connect(ac_Connect, SIGNAL(triggered()), this, SLOT(slot_ac_Connect())); |
95 | connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar())); |
96 | connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar())); |
Line 96... | Line -... | ||
96 | - | ||
97 | // About QMK-Kernel & About-QT Dialog einfügen |
- | |
98 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
- | |
99 | menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt())); |
- | |
100 | 97 | ||
Line 101... | Line 98... | ||
101 | connect(sb_Intervall, SIGNAL(valueChanged(int)), this, SLOT(slot_sb_Intervall(int))); |
98 | connect(sb_Intervall, SIGNAL(valueChanged(int)), this, SLOT(slot_sb_Intervall(int))); |
102 | 99 | ||
Line 113... | Line 110... | ||
113 | connect(ac_SaveRoute, SIGNAL(triggered()), this, SLOT(slot_ac_SaveRoute())); |
110 | connect(ac_SaveRoute, SIGNAL(triggered()), this, SLOT(slot_ac_SaveRoute())); |
Line 114... | Line 111... | ||
114 | 111 | ||
115 | connect(ac_LoadMap, SIGNAL(triggered()), this, SLOT(slot_ac_LoadMapPic())); |
112 | connect(ac_LoadMap, SIGNAL(triggered()), this, SLOT(slot_ac_LoadMapPic())); |
116 | connect(ac_Record, SIGNAL(triggered()), this, SLOT(slot_ac_Record())); |
113 | connect(ac_Record, SIGNAL(triggered()), this, SLOT(slot_ac_Record())); |
- | 114 | connect(ac_RouteDelete, SIGNAL(triggered()), this, SLOT(slot_ac_RouteDelete())); |
|
- | 115 | ||
- | 116 | // About QMK-Kernel & About-QT Dialog einfügen |
|
- | 117 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
|
117 | connect(ac_RouteDelete, SIGNAL(triggered()), this, SLOT(slot_ac_RouteDelete())); |
118 | menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt())); |
Line 118... | Line 119... | ||
118 | } |
119 | } |
119 | 120 | ||
120 | void dlg_Main::init_Directorys() |
121 | void dlg_Main::init_Directorys() |
Line 161... | Line 162... | ||
161 | { |
162 | { |
162 | int CMD = Data[2].toInt(); |
163 | int CMD = Data[2].toInt(); |
Line 163... | Line 164... | ||
163 | 164 | ||
164 | switch(CMD) |
165 | switch(CMD) |
165 | { |
166 | { |
- | 167 | case 101 : |
|
- | 168 | { |
|
- | 169 | o_Input->send_Data(HandlerIP::make_Frame(ID_MAPS, 101, QA_NAME + " " + QA_VERSION)); |
|
- | 170 | } |
|
- | 171 | break; |
|
166 | case 501 : |
172 | case 502 : |
- | 173 | { |
|
- | 174 | switch (Data[3].toInt()) |
|
- | 175 | { |
|
- | 176 | case 105 : |
|
- | 177 | { |
|
- | 178 | QString s_MD5PW; |
|
- | 179 | QByteArray a_MD5PW; |
|
- | 180 | ||
- | 181 | a_MD5PW = QCryptographicHash::hash(le_Password->text().toAscii(),QCryptographicHash::Md5); |
|
- | 182 | ||
- | 183 | s_MD5PW = QString(a_MD5PW.toHex().data()); |
|
- | 184 | ||
- | 185 | o_Input->send_Data(HandlerIP::make_Frame(ID_MAPS, 105, s_MD5PW)); |
|
- | 186 | } |
|
- | 187 | break; |
|
- | 188 | case 106 : |
|
167 | { |
189 | { |
- | 190 | o_Input->send_Data(HandlerIP::make_Frame(ID_MAPS, 106, DataFields)); |
|
- | 191 | } |
|
- | 192 | break; |
|
168 | o_Input->send_Data(HandlerIP::make_Frame(0, 105, le_Password->text())); |
193 | } |
169 | } |
194 | } |
170 | break; |
195 | break; |
171 | case 505 : |
196 | case 505 : |
172 | { |
197 | { |
Line 532... | Line 557... | ||
532 | 557 | ||
533 | // Ein Ziel anfliegen. |
558 | // Ein Ziel anfliegen. |
534 | // TODO: Check auf Entfernung zur IST-Position. |
559 | // TODO: Check auf Entfernung zur IST-Position. |
535 | void dlg_Main::send_Target(Point *t_Target) |
560 | void dlg_Main::send_Target(Point *t_Target) |
536 | { |
561 | { |
537 | if (l_Track.length() > 0) |
562 | if (l_Track.count() > 0) |
538 | { |
563 | { |
Line 539... | Line 564... | ||
539 | s_MK_WayPoint s_WayPoint; |
564 | s_MK_WayPoint s_WayPoint; |
540 | 565 | ||
Line 679... | Line 704... | ||
679 | cb_Server->setEnabled(true); |
704 | cb_Server->setEnabled(true); |
680 | le_Password->setEnabled(true); |
705 | le_Password->setEnabled(true); |
681 | } |
706 | } |
Line 682... | Line 707... | ||
682 | 707 | ||
683 | } |
708 | } |
684 | else |
709 | else // Connect über TCPIP |
685 | { |
710 | { |
686 | o_Input = new Input_TCP(); |
711 | o_Input = new Input_TCP(); |
Line 687... | Line 712... | ||
687 | o_Input->Init(); |
712 | o_Input->Init(); |
Line 728... | Line 753... | ||
728 | else |
753 | else |
729 | { |
754 | { |
730 | // qDebug(QString("CRC-Error - " + t_Data).toLatin1().data()); |
755 | // qDebug(QString("CRC-Error - " + t_Data).toLatin1().data()); |
731 | } |
756 | } |
732 | } |
757 | } |
733 | else if (o_Input->Mode() == TCP) |
758 | else if ((o_Input->Mode() == TCP) && (t_Data[0] == '$')) |
734 | { |
759 | { |
735 | parse_IP_Data(t_Data); |
760 | parse_IP_Data(t_Data); |
736 | } |
761 | } |
737 | } |
762 | } |
Line 740... | Line 765... | ||
740 | void dlg_Main::slot_Input_Disconnected(int Error) |
765 | void dlg_Main::slot_Input_Disconnected(int Error) |
741 | { |
766 | { |
742 | cb_Server->setEnabled(true); |
767 | cb_Server->setEnabled(true); |
743 | le_Password->setEnabled(true); |
768 | le_Password->setEnabled(true); |
Line 744... | Line -... | ||
744 | - | ||
745 | // qDebug("Close"); |
769 | |
746 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
- | |
747 | if (o_Input->Mode() == TCP) |
- | |
748 | { |
770 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
749 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
771 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
750 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
772 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
751 | } |
773 | |
752 | ac_Connect->setChecked(false); |
774 | ac_Connect->setChecked(false); |
753 | ac_Connect->setText(tr("Verbinden")); |
775 | ac_Connect->setText(tr("Verbinden")); |
Line 754... | Line 776... | ||
754 | btn_Connect->setChecked(false); |
776 | btn_Connect->setChecked(false); |
Line 785... | Line 807... | ||
785 | // Serververbindung hergestellt |
807 | // Serververbindung hergestellt |
786 | void dlg_Main::slot_Input_Connected() |
808 | void dlg_Main::slot_Input_Connected() |
787 | { |
809 | { |
788 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
810 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
Line 789... | Line -... | ||
789 | - | ||
790 | o_Input->send_Data(HandlerIP::make_Frame(0, 101, QA_NAME + " " + QA_VERSION)); |
811 | |
791 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
812 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
792 | ac_Connect->setText(tr("Trennen")); |
813 | ac_Connect->setText(tr("Trennen")); |
Line 793... | Line 814... | ||
793 | } |
814 | } |
Line 1001... | Line 1022... | ||
1001 | // Route anzeigen / ausblenden |
1022 | // Route anzeigen / ausblenden |
1002 | void dlg_Main::slot_ShowWayPoints(bool Show) |
1023 | void dlg_Main::slot_ShowWayPoints(bool Show) |
1003 | { |
1024 | { |
1004 | if (Show == true) |
1025 | if (Show == true) |
1005 | { |
1026 | { |
1006 | // qDebug("Error 1"); |
- | |
1007 | if (l_RouteWP->hasPoints()) |
1027 | if (l_RouteWP->hasPoints()) |
1008 | { |
1028 | { |
1009 | // qDebug("Error 2"); |
- | |
1010 | o_RouteWP->addGeometry(l_RouteWP); |
1029 | o_RouteWP->addGeometry(l_RouteWP); |
1011 | // qDebug("Error 3"); |
- | |
1012 | o_Map->updateRequestNew(); |
1030 | o_Map->updateRequestNew(); |
1013 | // qDebug("Error 4"); |
- | |
1014 | } |
1031 | } |
1015 | } |
1032 | } |
1016 | else |
1033 | else |
1017 | { |
1034 | { |
1018 | o_RouteWP->removeGeometry(l_RouteWP); |
1035 | o_RouteWP->removeGeometry(l_RouteWP); |