Rev 750 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
674 | KeyOz | 1 | /*************************************************************************** |
2 | * Copyright (C) 2009 by Manuel Schrape * |
||
3 | * manuel.schrape@gmx.de * |
||
4 | * * |
||
5 | * This program is free software; you can redistribute it and/or modify * |
||
6 | * it under the terms of the GNU General Public License as published by * |
||
711 | KeyOz | 7 | * the Free Software Con_Server; either version 2 of the License. * |
674 | KeyOz | 8 | * * |
9 | * This program is distributed in the hope that it will be useful, * |
||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
12 | * GNU General Public License for more details. * |
||
13 | * * |
||
14 | * You should have received a copy of the GNU General Public License * |
||
15 | * along with this program; if not, write to the * |
||
711 | KeyOz | 16 | * Free Software Con_Server, Inc., * |
674 | KeyOz | 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | ***************************************************************************/ |
||
19 | |||
20 | #include <QMessageBox> |
||
711 | KeyOz | 21 | #include <QCryptographicHash> |
674 | KeyOz | 22 | |
23 | #include "dlg_Main.h" |
||
24 | |||
25 | // Konstruktor Main-Form |
||
26 | //////////////////////// |
||
27 | dlg_Main::dlg_Main() |
||
28 | { |
||
29 | setupUi(this); |
||
30 | |||
715 | KeyOz | 31 | s_Buffer = ""; |
674 | KeyOz | 32 | o_Settings = new cSettings(); |
33 | |||
34 | o_Input = new Input(); |
||
711 | KeyOz | 35 | o_Output = new Input(); |
674 | KeyOz | 36 | |
37 | f_Terminal = new dlg_Terminal(this); |
||
38 | |||
39 | init_GUI(); |
||
40 | init_Connections(); |
||
41 | |||
42 | init_TCP(); |
||
43 | } |
||
44 | |||
45 | void dlg_Main::set_ARGV(char *Programm) |
||
46 | { |
||
47 | QString tmp = QString(Programm); |
||
801 | - | 48 | #ifdef WIN32 |
49 | QMK_Dir = tmp.left(tmp.lastIndexOf("\\")); |
||
50 | #else |
||
674 | KeyOz | 51 | QMK_Dir = tmp.left(tmp.lastIndexOf("/")); |
801 | - | 52 | #endif |
53 | |||
54 | qDebug(QMK_Dir.toLatin1().data()); |
||
674 | KeyOz | 55 | } |
56 | |||
57 | // Grafische Oberfläche initialisieren |
||
58 | ////////////////////////////////////// |
||
59 | void dlg_Main::init_GUI() |
||
60 | { |
||
61 | setWindowTitle(QA_NAME + " " + QA_VERSION); |
||
62 | |||
63 | resize(o_Settings->GUI.Size); |
||
64 | move(o_Settings->GUI.Point); |
||
65 | |||
750 | KeyOz | 66 | f_Terminal->resize(o_Settings->TERMINAL.Size); |
67 | f_Terminal->move(o_Settings->TERMINAL.Point); |
||
68 | |||
69 | f_Terminal->cb_Data->setChecked(o_Settings->DATA.Data); |
||
70 | f_Terminal->cb_Info->setChecked(o_Settings->DATA.Info); |
||
71 | f_Terminal->cb_Send->setChecked(o_Settings->DATA.Send); |
||
72 | f_Terminal->cb_TCP->setChecked(o_Settings->DATA.TCP); |
||
73 | |||
674 | KeyOz | 74 | if (o_Settings->GUI.isMax) |
75 | { |
||
76 | showMaximized(); |
||
77 | } |
||
78 | |||
79 | // todo: In abhängigkeit von Settings |
||
80 | wg_IP->setVisible(false); |
||
81 | rb_Device->setChecked(true); |
||
82 | |||
83 | for (int z = 0; z < DEV_IP_MAX; z++) |
||
84 | { |
||
711 | KeyOz | 85 | Item[z] = new QListWidgetItem(); |
674 | KeyOz | 86 | } |
87 | |||
711 | KeyOz | 88 | // Liste der Devices |
674 | KeyOz | 89 | for(int z = 0; z < o_Settings->CLIENT.TTY_MAX; z++) |
90 | { |
||
91 | if (cb_Device->findText(o_Settings->CLIENT.TTY_DEVICES[z]) == -1) |
||
92 | { |
||
93 | cb_Device->addItem(o_Settings->CLIENT.TTY_DEVICES[z]); |
||
94 | } |
||
95 | } |
||
96 | |||
97 | cb_Device->setCurrentIndex(o_Settings->CLIENT.TTY_ID); |
||
711 | KeyOz | 98 | |
99 | // Liste der IP-Server |
||
100 | for(int z = 0; z < o_Settings->CLIENT.TCP_MAX; z++) |
||
101 | { |
||
102 | if (cb_Server->findText(o_Settings->CLIENT.TCP_SERVER[z]) == -1) |
||
103 | { |
||
104 | cb_Server->addItem(o_Settings->CLIENT.TCP_SERVER[z]); |
||
105 | } |
||
106 | } |
||
107 | |||
108 | cb_Server->setCurrentIndex(o_Settings->CLIENT.TCP_ID); |
||
109 | |||
110 | // Password für IP-Verbindung. |
||
111 | le_Password->setText(o_Settings->CLIENT.TCP_Password); |
||
112 | |||
750 | KeyOz | 113 | btn_Debug->setVisible(false); |
114 | btn_ConnectServer->setVisible(false); |
||
674 | KeyOz | 115 | } |
116 | |||
117 | // Signale mit Slots verbinden |
||
118 | ////////////////////////////// |
||
119 | void dlg_Main::init_Connections() |
||
120 | { |
||
121 | // Connect-Button |
||
122 | connect(btn_Connect, SIGNAL(clicked()), this, SLOT(slot_btn_Connect())); |
||
123 | |||
124 | connect(btn_cScope, SIGNAL(clicked()), this, SLOT(slot_btn_cScope())); |
||
125 | connect(btn_cSettings, SIGNAL(clicked()), this, SLOT(slot_btn_cSettings())); |
||
126 | connect(btn_cMaps, SIGNAL(clicked()), this, SLOT(slot_btn_cMaps())); |
||
127 | connect(btn_cVoice, SIGNAL(clicked()), this, SLOT(slot_btn_cVoice())); |
||
128 | connect(btn_cLogger, SIGNAL(clicked()), this, SLOT(slot_btn_cLogger())); |
||
129 | |||
711 | KeyOz | 130 | connect(btn_Terminal, SIGNAL(clicked()), this, SLOT(slot_btn_Terminal())); |
131 | connect(btn_ConnectServer, SIGNAL(clicked()), this, SLOT(slot_btn_ConnectServer())); |
||
674 | KeyOz | 132 | |
750 | KeyOz | 133 | connect(btn_Debug, SIGNAL(clicked()), this, SLOT(slot_btn_Debug())); |
134 | |||
135 | connect(rb_NC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
||
136 | connect(rb_FC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
||
137 | connect(rb_MK3MAG, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
||
138 | |||
674 | KeyOz | 139 | // About QMK-Kernel & About-QT Dialog einfügen |
140 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
||
141 | connect(ac_Server, SIGNAL(triggered()), this, SLOT(slot_ac_Server())); |
||
142 | menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt())); |
||
143 | } |
||
144 | |||
145 | // IP-Ports initialisiern |
||
146 | ///////////////////////// |
||
147 | // todo: Port und Anzahl aus Settings |
||
148 | bool dlg_Main::init_TCP() |
||
149 | { |
||
150 | Connect_Count = 0; |
||
151 | |||
711 | KeyOz | 152 | Con_Server[0].Status = 0; |
153 | |||
154 | Con_Server[0].TCP = false; |
||
155 | Con_Server[0].UDP = false; |
||
156 | |||
674 | KeyOz | 157 | for (int a = 0; a < DEV_IP_MAX; a++) |
158 | { |
||
711 | KeyOz | 159 | Con_Server[a].Status = 0; |
674 | KeyOz | 160 | } |
161 | |||
162 | TCP_Server = new QTcpServer(this); |
||
163 | |||
164 | if (TCP_Server->listen(QHostAddress::Any, qint16(o_Settings->SERVER.TCP_PORT))) |
||
165 | { |
||
166 | connect(TCP_Server, SIGNAL(newConnection()), this, SLOT(slot_TCP_NewConnection())); |
||
167 | } |
||
168 | |||
169 | return true; |
||
170 | } |
||
171 | |||
172 | // Eingangsdaten verarbeiten |
||
173 | //////////////////////////// |
||
174 | void dlg_Main::parse_Input_Data(QString t_Data) |
||
175 | { |
||
750 | KeyOz | 176 | unsigned char OutData[180]; |
674 | KeyOz | 177 | char *InData = t_Data.toLatin1().data(); |
178 | |||
179 | if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0) |
||
180 | { |
||
181 | switch(InData[2]) |
||
182 | { |
||
183 | case 'V' : // Versions-Info |
||
184 | { |
||
185 | o_Input->stop_Resend(DATA_VERSION); |
||
186 | VersionInfo = HandlerMK::parse_Version(OutData, InData[1] - 'a'); |
||
187 | lb_Info->setText(tr("Verbunden mit ") + VersionInfo.Hardware + " " + VersionInfo.Version + trUtf8(" über ") + s_Input.Main + "."); |
||
188 | |||
189 | if (VersionInfo.ID == ADDRESS_FC) |
||
190 | { |
||
191 | rb_FC->setChecked(true); |
||
192 | } |
||
193 | if (VersionInfo.ID == ADDRESS_NC) |
||
194 | { |
||
195 | rb_NC->setChecked(true); |
||
196 | } |
||
197 | if (VersionInfo.ID == ADDRESS_MK3MAG) |
||
198 | { |
||
199 | rb_MK3MAG->setChecked(true); |
||
200 | } |
||
201 | } |
||
202 | break; |
||
203 | } |
||
204 | } |
||
205 | } |
||
206 | |||
207 | void dlg_Main::route_Input_Data(QString t_Data) |
||
208 | { |
||
209 | // An alle offenen TCP-Sockets senden. |
||
210 | for (int a = 1; a < DEV_IP_MAX; a++) |
||
211 | { |
||
711 | KeyOz | 212 | if (Con_Server[a].Status > 0) |
674 | KeyOz | 213 | { |
711 | KeyOz | 214 | if (Con_Server[a].TCP == true) |
674 | KeyOz | 215 | { |
711 | KeyOz | 216 | if ((Con_Server[a].Fields == "") || (Con_Server[a].Fields.contains(t_Data.at(2)) == true)) |
217 | { |
||
218 | if (o_Input->Mode() == TTY) |
||
219 | { |
||
220 | send_TCP(o_TCP[a], t_Data + "\r"); |
||
221 | } |
||
222 | else |
||
223 | { |
||
224 | send_TCP(o_TCP[a], t_Data); |
||
225 | } |
||
226 | } |
||
227 | else |
||
228 | { |
||
229 | // qDebug("Not Send Data"); |
||
230 | // qDebug(t_Data.toLatin1().data()); |
||
231 | } |
||
674 | KeyOz | 232 | } |
233 | } |
||
234 | } |
||
711 | KeyOz | 235 | if ((o_Output->IsOpen()) && ((Con_Output.Fields == "") || (Con_Output.Fields.contains(t_Data.at(2)) == true))) |
236 | { |
||
237 | o_Output->send_Data(t_Data); |
||
238 | } |
||
674 | KeyOz | 239 | } |
240 | |||
711 | KeyOz | 241 | void dlg_Main::parse_TCP_Server_Data(QString t_Data, int t_ID) |
674 | KeyOz | 242 | { |
243 | QStringList Data; |
||
244 | Data = t_Data.split(":"); |
||
245 | |||
246 | if (Data.count() > 1) |
||
247 | { |
||
248 | int CMD = Data[2].toInt(); |
||
711 | KeyOz | 249 | QString A = Data[2]; |
250 | // qDebug(A.toLatin1().data()); |
||
674 | KeyOz | 251 | |
252 | switch(CMD) |
||
253 | { |
||
254 | case 101 : |
||
255 | { |
||
711 | KeyOz | 256 | Con_Server[t_ID].Version = Data[3]; |
257 | Item[t_ID]->setText(" " + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version); |
||
258 | |||
259 | if (Con_Server[t_ID].Status == 2) |
||
260 | { |
||
261 | Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version); |
||
262 | } |
||
263 | else |
||
264 | { |
||
265 | send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "105")); |
||
266 | } |
||
267 | |||
268 | send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "106")); |
||
674 | KeyOz | 269 | } |
270 | break; |
||
271 | case 105 : |
||
272 | { |
||
711 | KeyOz | 273 | if (Con_Server[t_ID].Status != 2) |
674 | KeyOz | 274 | { |
711 | KeyOz | 275 | // qDebug("Get 105"); |
276 | QString s_MD5PW; |
||
277 | QByteArray a_MD5PW; |
||
278 | |||
279 | a_MD5PW = QCryptographicHash::hash(o_Settings->SERVER.Password.toAscii(),QCryptographicHash::Md5); |
||
280 | |||
281 | s_MD5PW = QString(a_MD5PW.toHex().data()); |
||
282 | |||
283 | if ((o_Settings->SERVER.Password != "") && (Data[3] == s_MD5PW)) |
||
674 | KeyOz | 284 | { |
711 | KeyOz | 285 | // qDebug("Set 505 OK"); |
674 | KeyOz | 286 | send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "OK")); |
287 | |||
711 | KeyOz | 288 | Con_Server[t_ID].Status = 2; |
289 | Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version); |
||
674 | KeyOz | 290 | } |
291 | else |
||
292 | { |
||
711 | KeyOz | 293 | // qDebug("Set 505 NO"); |
674 | KeyOz | 294 | send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "NO")); |
295 | } |
||
296 | } |
||
711 | KeyOz | 297 | else |
298 | { |
||
299 | send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "OK")); |
||
300 | } |
||
674 | KeyOz | 301 | } |
302 | break; |
||
711 | KeyOz | 303 | case 106 : // Datenfelder anfordern. |
304 | { |
||
305 | if (Con_Server[t_ID].Status == 2) |
||
306 | { |
||
307 | Con_Server[t_ID].Fields = Data[3]; |
||
308 | Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version + " - " + Con_Server[t_ID].Fields); |
||
309 | // send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 506, Con_Server[t_ID].Fields)); |
||
310 | } |
||
311 | } |
||
674 | KeyOz | 312 | } |
313 | } |
||
314 | } |
||
315 | |||
711 | KeyOz | 316 | // IP-Input-Daten verarbeiten. |
317 | void dlg_Main::parse_TCP_Input_Data(QString t_Data) |
||
318 | { |
||
319 | QStringList Data; |
||
320 | Data = t_Data.split(":"); |
||
321 | |||
322 | if (Data.count() > 1) |
||
323 | { |
||
324 | int CMD = Data[2].toInt(); |
||
325 | |||
326 | switch(CMD) |
||
327 | { |
||
328 | case 502 : |
||
329 | { |
||
330 | // qDebug("Request Data"); |
||
331 | switch (Data[3].toInt()) |
||
332 | { |
||
333 | case 105 : |
||
334 | { |
||
335 | QString s_MD5PW; |
||
336 | QByteArray a_MD5PW; |
||
337 | |||
338 | a_MD5PW = QCryptographicHash::hash(le_Password->text().toAscii(),QCryptographicHash::Md5); |
||
339 | |||
340 | s_MD5PW = QString(a_MD5PW.toHex().data()); |
||
341 | |||
342 | o_Input->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 105, s_MD5PW)); |
||
343 | } |
||
344 | break; |
||
345 | } |
||
346 | } |
||
347 | break; |
||
348 | case 505 : |
||
349 | { |
||
350 | if (Data[3] == "OK") |
||
351 | { |
||
352 | } |
||
353 | else |
||
354 | { |
||
355 | QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen. <br />Daten senden zum Mikrokopter nicht möglich."), QMessageBox::Ok); |
||
356 | } |
||
357 | } |
||
358 | break; |
||
359 | } |
||
360 | } |
||
361 | } |
||
362 | |||
750 | KeyOz | 363 | // IP-Output-Daten verarbeiten. (Live-Data) |
711 | KeyOz | 364 | void dlg_Main::parse_TCP_Output_Data(QString t_Data) |
365 | { |
||
366 | QStringList Data; |
||
367 | Data = t_Data.split(":"); |
||
368 | |||
369 | if (Data.count() > 1) |
||
370 | { |
||
371 | int CMD = Data[2].toInt(); |
||
372 | |||
373 | switch(CMD) |
||
374 | { |
||
375 | case 101 : |
||
376 | { |
||
377 | Con_Output.Version = Data[3]; |
||
378 | o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION)); |
||
379 | } |
||
380 | break; |
||
381 | case 106 : // Datenfelder anfordern. |
||
382 | { |
||
383 | Con_Output.Fields = Data[3]; |
||
384 | // send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 506, Con_Server[t_ID].Fields)); |
||
385 | } |
||
386 | break; |
||
387 | case 502 : |
||
388 | { |
||
389 | switch (Data[3].toInt()) |
||
390 | { |
||
391 | case 104 : |
||
392 | { |
||
393 | // qDebug("Request PW"); |
||
394 | QString s_MD5PW; |
||
395 | QByteArray a_MD5PW; |
||
396 | |||
750 | KeyOz | 397 | a_MD5PW = QCryptographicHash::hash(QString(QByteArray::fromBase64(Base64Hash.toLatin1()) + o_Settings->LIVEDATA.Password).toAscii(),QCryptographicHash::Md5); |
711 | KeyOz | 398 | |
399 | s_MD5PW = QString(a_MD5PW.toHex().data()); |
||
400 | |||
750 | KeyOz | 401 | o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, o_Settings->LIVEDATA.User + ";" + s_MD5PW)); |
711 | KeyOz | 402 | } |
403 | break; |
||
404 | } |
||
405 | } |
||
406 | break; |
||
407 | case 504 : |
||
408 | { |
||
409 | if (Data[3] == "OK") |
||
410 | { |
||
411 | Con_Output.Status = 2; |
||
412 | o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "106")); |
||
413 | } |
||
414 | else |
||
415 | { |
||
416 | QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen."), QMessageBox::Ok); |
||
417 | } |
||
418 | } |
||
419 | break; |
||
420 | } |
||
421 | } |
||
422 | } |
||
423 | |||
674 | KeyOz | 424 | // Freies IP-Socket ermitteln |
425 | int dlg_Main::get_FreeSocket() |
||
426 | { |
||
427 | for (int a = 1; a < DEV_IP_MAX; a++) |
||
428 | { |
||
711 | KeyOz | 429 | if (Con_Server[a].Status == 0) |
674 | KeyOz | 430 | return a; |
431 | } |
||
432 | return 0; |
||
433 | } |
||
434 | |||
435 | // Daten auf TCP Senden |
||
436 | void dlg_Main::send_TCP(QTcpSocket *Socket, QString Data) |
||
437 | { |
||
438 | QByteArray SendText = Data.toAscii(); |
||
439 | |||
440 | Socket->write(SendText + "\n"); |
||
711 | KeyOz | 441 | Socket->flush(); |
442 | |||
443 | // qDebug(SendText.data()); |
||
674 | KeyOz | 444 | } |
445 | |||
711 | KeyOz | 446 | /////////// |
674 | KeyOz | 447 | // Slots // |
448 | /////////// |
||
449 | |||
450 | void dlg_Main::slot_btn_cScope() |
||
451 | { |
||
801 | - | 452 | #ifdef WIN32 |
453 | QString Programm = QMK_Dir + "\QMK-Scope.exe"; |
||
454 | #else |
||
674 | KeyOz | 455 | QString Programm = QMK_Dir + "/QMK-Scope"; |
801 | - | 456 | #endif |
674 | KeyOz | 457 | |
458 | QStringList Argumente; |
||
459 | |||
460 | o_cScope = new QProcess(); |
||
461 | |||
462 | Argumente << ""; |
||
463 | |||
464 | o_cScope->start(Programm, Argumente); // Programmaufruf |
||
465 | } |
||
466 | |||
467 | void dlg_Main::slot_btn_cSettings() |
||
468 | { |
||
801 | - | 469 | #ifdef WIN32 |
470 | QString Programm = QMK_Dir + "\QMK-Settings.exe"; |
||
471 | #else |
||
674 | KeyOz | 472 | QString Programm = QMK_Dir + "/QMK-Settings"; |
801 | - | 473 | #endif |
674 | KeyOz | 474 | |
475 | QStringList Argumente; |
||
476 | |||
477 | o_cSettings = new QProcess(); |
||
478 | |||
479 | Argumente << ""; |
||
480 | |||
481 | o_cSettings->start(Programm, Argumente); // Programmaufruf |
||
482 | } |
||
483 | |||
484 | void dlg_Main::slot_btn_cMaps() |
||
485 | { |
||
801 | - | 486 | #ifdef WIN32 |
487 | QString Programm = QMK_Dir + "\QMK-Maps.exe"; |
||
488 | #else |
||
674 | KeyOz | 489 | QString Programm = QMK_Dir + "/QMK-Maps"; |
801 | - | 490 | #endif |
674 | KeyOz | 491 | |
492 | QStringList Argumente; |
||
493 | |||
494 | o_cMaps = new QProcess(); |
||
495 | |||
496 | Argumente << ""; |
||
497 | |||
498 | o_cMaps->start(Programm, Argumente); // Programmaufruf |
||
499 | } |
||
500 | |||
501 | void dlg_Main::slot_btn_cVoice() |
||
502 | { |
||
801 | - | 503 | #ifdef WIN32 |
504 | QString Programm = QMK_Dir + "\QMK-Voice.exe"; |
||
505 | #else |
||
674 | KeyOz | 506 | QString Programm = QMK_Dir + "/QMK-Voice"; |
801 | - | 507 | #endif |
674 | KeyOz | 508 | |
509 | QStringList Argumente; |
||
510 | |||
511 | o_cVoice = new QProcess(); |
||
512 | |||
513 | Argumente << ""; |
||
514 | |||
515 | o_cVoice->start(Programm, Argumente); // Programmaufruf |
||
516 | } |
||
517 | |||
518 | void dlg_Main::slot_btn_cLogger() |
||
519 | { |
||
801 | - | 520 | #ifdef WIN32 |
521 | QString Programm = QMK_Dir + "\QMK-Logger.exe"; |
||
522 | #else |
||
674 | KeyOz | 523 | QString Programm = QMK_Dir + "/QMK-Logger"; |
801 | - | 524 | #endif |
674 | KeyOz | 525 | |
526 | QStringList Argumente; |
||
527 | |||
528 | o_cLogger = new QProcess(); |
||
529 | |||
530 | Argumente << ""; |
||
531 | |||
532 | o_cLogger->start(Programm, Argumente); // Programmaufruf |
||
533 | } |
||
534 | |||
535 | void dlg_Main::slot_btn_Terminal() |
||
536 | { |
||
537 | if (!f_Terminal->isVisible()) |
||
538 | { |
||
539 | f_Terminal->show(); |
||
540 | } |
||
541 | } |
||
542 | |||
711 | KeyOz | 543 | // Verbindung herstellen zum Datenserver |
544 | void dlg_Main::slot_btn_ConnectServer() |
||
545 | { |
||
546 | if (!o_Output->IsOpen()) |
||
547 | { |
||
548 | Con_Output = Con_Server[0]; |
||
549 | |||
750 | KeyOz | 550 | s_Output.Main = o_Settings->LIVEDATA.Server;//Server[0]; |
551 | s_Output.Sub = o_Settings->LIVEDATA.Port;//Server[1]; |
||
711 | KeyOz | 552 | |
553 | o_Output = new Input_TCP(); |
||
554 | o_Output->Init(); |
||
555 | |||
556 | if (o_Output->Open(s_Output) == true) |
||
557 | { |
||
558 | connect(o_Output, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Output_Disconnected(int))); |
||
559 | connect(o_Output, SIGNAL(sig_Connected()), this, SLOT(slot_Output_Connected())); |
||
560 | } |
||
561 | btn_ConnectServer->setText(tr("Trenne Server")); |
||
562 | Con_Output.Status = 1; |
||
563 | } |
||
564 | else |
||
565 | { |
||
566 | btn_ConnectServer->setText(tr("Verbinde Server")); |
||
567 | |||
568 | o_Output->Close(); |
||
569 | disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0); |
||
570 | if (o_Output->Mode() == TCP) |
||
571 | { |
||
572 | disconnect(o_Output, SIGNAL(sig_Disconnected(int)), 0, 0); |
||
573 | disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0); |
||
574 | } |
||
575 | } |
||
576 | } |
||
577 | |||
750 | KeyOz | 578 | void dlg_Main::slot_btn_Debug() |
579 | { |
||
580 | if (o_Output->IsOpen()) |
||
581 | { |
||
582 | o_Output->send_Data("#cO=M======wWMrSCuD==A===============================================A=GM======[M=====@==@|p==O=CM=========kN"); |
||
583 | } |
||
584 | } |
||
585 | |||
586 | void dlg_Main::slot_rb_Hardware() |
||
587 | { |
||
588 | // if ((rb_NC->isChecked() == false) && (VersionInfo.ID != ADDRESS_NC)) |
||
589 | // { |
||
590 | // o_Input->send_Data(HandlerMK::get_SelectNC()); |
||
591 | // } |
||
592 | |||
593 | if (rb_FC->isChecked()) |
||
594 | { |
||
595 | o_Input->send_Data(HandlerMK::get_SelectFC()); |
||
596 | } |
||
597 | else |
||
598 | if (rb_MK3MAG->isChecked()) |
||
599 | { |
||
600 | o_Input->send_Data(HandlerMK::get_SelectMK3MAG()); |
||
601 | } |
||
602 | else |
||
603 | if (rb_NC->isChecked()) |
||
604 | { |
||
605 | o_Input->send_Data(HandlerMK::get_SelectNC()); |
||
606 | } |
||
607 | |||
608 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
||
609 | } |
||
610 | |||
711 | KeyOz | 611 | void dlg_Main::slot_Output_Disconnected(int Error) |
612 | { |
||
613 | disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0); |
||
614 | if (o_Output->Mode() == TCP) |
||
615 | { |
||
616 | disconnect(o_Output, SIGNAL(sig_Disconnected(int)), 0, 0); |
||
617 | disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0); |
||
618 | } |
||
619 | |||
620 | btn_ConnectServer->setText(tr("Verbinde Server")); |
||
621 | |||
622 | /* switch (Error) |
||
623 | { |
||
624 | case REMOTECLOSED : |
||
625 | { |
||
626 | // lb_Status->setText(tr("Verbindung vom Server beendet.")); |
||
627 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok); |
||
628 | } |
||
629 | break; |
||
630 | case REFUSED : |
||
631 | { |
||
632 | // lb_Status->setText(tr("Server nicht gefunden.")); |
||
633 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok); |
||
634 | } |
||
635 | break; |
||
636 | case 3 : |
||
637 | { |
||
638 | // lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch.")); |
||
639 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok); |
||
640 | } |
||
641 | break; |
||
642 | default : |
||
643 | { |
||
644 | // lb_Status->setText(tr("Getrennt vom QMK-Datenserver.")); |
||
645 | } |
||
646 | break; |
||
647 | } |
||
648 | */ |
||
649 | |||
650 | } |
||
651 | |||
652 | void dlg_Main::slot_Output_Connected() |
||
653 | { |
||
654 | connect(o_Output, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Output_Data(QString))); |
||
655 | } |
||
656 | |||
657 | void dlg_Main::slot_Output_Data(QString t_Data) |
||
658 | { |
||
659 | if ((t_Data[0] == '#')) |
||
660 | { |
||
661 | } |
||
662 | else if (o_Output->Mode() == TCP) |
||
663 | { |
||
750 | KeyOz | 664 | show_Terminal(6, "IP:" + t_Data); |
711 | KeyOz | 665 | parse_TCP_Output_Data(t_Data); |
666 | } |
||
667 | } |
||
668 | |||
669 | // Verbindung herstellen zum Kopter |
||
674 | KeyOz | 670 | void dlg_Main::slot_btn_Connect() |
671 | { |
||
672 | if (!o_Input->IsOpen()) |
||
673 | { |
||
674 | if (rb_Device->isChecked()) |
||
675 | { |
||
676 | if (cb_Device->findText(cb_Device->currentText()) == -1) |
||
677 | { |
||
678 | cb_Device->addItem(cb_Device->currentText()); |
||
679 | cb_Device->setCurrentIndex(cb_Device->findText(cb_Device->currentText())); |
||
680 | } |
||
681 | |||
682 | s_Input.Main = cb_Device->currentText(); |
||
683 | |||
684 | o_Input = new Input_TTY(); |
||
685 | o_Input->Init(); |
||
686 | |||
687 | if (o_Input->Open(s_Input) == true) |
||
688 | { |
||
689 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
||
690 | |||
691 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
||
692 | |||
693 | btn_Connect->setText(tr("Trennen")); |
||
694 | cb_Device->setEnabled(false); |
||
695 | } |
||
696 | } |
||
711 | KeyOz | 697 | else if (rb_TCP->isChecked()) |
698 | { |
||
699 | if (cb_Server->findText(cb_Device->currentText()) == -1) |
||
700 | { |
||
701 | cb_Server->addItem(cb_Server->currentText()); |
||
702 | cb_Server->setCurrentIndex(cb_Server->findText(cb_Server->currentText())); |
||
703 | } |
||
704 | |||
705 | cb_Server->setEnabled(false); |
||
706 | le_Password->setEnabled(false); |
||
707 | |||
708 | o_Input = new Input_TCP(); |
||
709 | o_Input->Init(); |
||
710 | |||
711 | set_Input s_Input; |
||
712 | |||
713 | QStringList Server = cb_Server->currentText().split(":"); |
||
714 | |||
715 | s_Input.Main = Server[0]; |
||
716 | s_Input.Sub = Server[1]; |
||
717 | |||
718 | if (o_Input->Open(s_Input) == true) |
||
719 | { |
||
720 | connect(o_Input, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Input_Disconnected(int))); |
||
721 | connect(o_Input, SIGNAL(sig_Connected()), this, SLOT(slot_Input_Connected())); |
||
722 | } |
||
723 | } |
||
724 | |||
674 | KeyOz | 725 | } |
726 | else |
||
727 | { |
||
728 | { |
||
711 | KeyOz | 729 | cb_Device->setEnabled(true); |
730 | cb_Server->setEnabled(true); |
||
731 | le_Password->setEnabled(true); |
||
732 | |||
674 | KeyOz | 733 | o_Input->Close(); |
734 | btn_Connect->setText(tr("Verbinden")); |
||
711 | KeyOz | 735 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
736 | if (o_Input->Mode() == TCP) |
||
737 | { |
||
738 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
||
739 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
||
740 | } |
||
674 | KeyOz | 741 | } |
742 | } |
||
743 | } |
||
744 | |||
711 | KeyOz | 745 | // Neue Daten empfangen. |
746 | void dlg_Main::slot_Input_Data(QString t_Data) |
||
747 | { |
||
748 | if ((t_Data[0] == '#')) |
||
749 | { |
||
750 | |||
751 | if ((HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length() - 1)) || ((o_Input->Mode() == TTY) && (HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length())))) |
||
752 | { |
||
753 | show_Terminal(1, "MK: " + t_Data); |
||
754 | parse_Input_Data(t_Data); |
||
755 | route_Input_Data(t_Data); |
||
756 | } |
||
757 | else |
||
758 | { |
||
759 | show_Terminal(2, t_Data); |
||
760 | } |
||
761 | } |
||
762 | else if ((o_Input->Mode() == TCP) && (t_Data[0] == '$')) |
||
763 | { |
||
764 | show_Terminal(4, t_Data); |
||
765 | parse_TCP_Input_Data(t_Data); |
||
766 | } |
||
767 | else |
||
768 | { |
||
769 | show_Terminal(2, t_Data); |
||
770 | } |
||
771 | |||
772 | |||
773 | } |
||
774 | |||
775 | void dlg_Main::slot_Input_Disconnected(int Error) |
||
776 | { |
||
777 | cb_Server->setEnabled(true); |
||
778 | le_Password->setEnabled(true); |
||
779 | |||
780 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
||
781 | if (o_Input->Mode() == TCP) |
||
782 | { |
||
783 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
||
784 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
||
785 | } |
||
786 | |||
787 | btn_Connect->setText(tr("Verbinden")); |
||
788 | |||
789 | /* switch (Error) |
||
790 | { |
||
791 | case REMOTECLOSED : |
||
792 | { |
||
793 | // lb_Status->setText(tr("Verbindung vom Server beendet.")); |
||
794 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok); |
||
795 | } |
||
796 | break; |
||
797 | case REFUSED : |
||
798 | { |
||
799 | // lb_Status->setText(tr("Server nicht gefunden.")); |
||
800 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok); |
||
801 | } |
||
802 | break; |
||
803 | case 3 : |
||
804 | { |
||
805 | // lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch.")); |
||
806 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok); |
||
807 | } |
||
808 | break; |
||
809 | default : |
||
810 | { |
||
811 | // lb_Status->setText(tr("Getrennt vom QMK-Datenserver.")); |
||
812 | } |
||
813 | break; |
||
814 | } |
||
815 | */ |
||
816 | |||
817 | } |
||
818 | |||
819 | void dlg_Main::slot_Input_Connected() |
||
820 | { |
||
821 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
||
822 | |||
823 | o_Input->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION)); |
||
715 | KeyOz | 824 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
711 | KeyOz | 825 | btn_Connect->setText(tr("Trennen")); |
826 | } |
||
827 | |||
674 | KeyOz | 828 | // About-Dialog |
829 | void dlg_Main::slot_ac_About() |
||
830 | { |
||
831 | QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT); |
||
832 | } |
||
833 | |||
834 | void dlg_Main::slot_ac_Server() |
||
835 | { |
||
836 | dlg_Preferences *f_Preferences = new dlg_Preferences(this); |
||
837 | |||
838 | f_Preferences->set_Settings(o_Settings); |
||
839 | |||
840 | if (f_Preferences->exec()==QDialog::Accepted) |
||
841 | { |
||
842 | o_Settings = f_Preferences->get_Settings(); |
||
843 | o_Settings->write_Settings(); |
||
844 | } |
||
845 | } |
||
846 | |||
847 | void dlg_Main::show_Terminal(int t_Typ, QString t_Data) |
||
848 | { |
||
849 | if (f_Terminal->isVisible()) |
||
850 | { |
||
851 | f_Terminal->show_Data(t_Typ, t_Data); |
||
852 | } |
||
853 | } |
||
854 | |||
711 | KeyOz | 855 | ///////////////////// |
856 | // IP-Slots Server // |
||
857 | ///////////////////// |
||
674 | KeyOz | 858 | |
859 | void dlg_Main::slot_TCP_NewConnection() |
||
860 | { |
||
861 | if (!o_Input->IsOpen()) |
||
711 | KeyOz | 862 | { |
674 | KeyOz | 863 | slot_btn_Connect(); |
711 | KeyOz | 864 | } |
674 | KeyOz | 865 | |
866 | int ID = get_FreeSocket(); |
||
867 | |||
868 | if (ID != 0) |
||
869 | { |
||
870 | Connect_Count++; |
||
871 | |||
711 | KeyOz | 872 | // Leeres Con_Server erzeugen |
873 | Con_Server[ID] = Con_Server[0]; |
||
874 | |||
875 | Con_Server[ID].Status = 1; |
||
876 | Con_Server[ID].TCP = true; |
||
877 | |||
878 | Con_Server[ID].Fields = ""; |
||
879 | Con_Server[ID].Version = "n/a"; |
||
880 | |||
674 | KeyOz | 881 | o_TCP[ID] = TCP_Server->nextPendingConnection(); |
882 | o_TCP[ID]->setProperty("ID", ID); |
||
883 | |||
711 | KeyOz | 884 | send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION)); |
674 | KeyOz | 885 | |
886 | connect(o_TCP[ID], SIGNAL(disconnected()),o_TCP[ID], SLOT(deleteLater())); |
||
887 | connect(o_TCP[ID], SIGNAL(disconnected()),this, SLOT(slot_TCP_Disconnect())); |
||
888 | connect(o_TCP[ID], SIGNAL(readyRead()),this, SLOT(slot_TCP_Read())); |
||
889 | |||
711 | KeyOz | 890 | Item[ID]->setText(" " + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - n/a"); |
891 | lw_Clients->addItem(Item[ID]); |
||
674 | KeyOz | 892 | |
711 | KeyOz | 893 | if (o_TCP[ID]->peerAddress().toString() == "127.0.0.1") |
894 | { |
||
895 | Con_Server[ID].Status = 2; |
||
896 | Item[ID]->setText("*" + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - n/a"); |
||
897 | } |
||
674 | KeyOz | 898 | |
711 | KeyOz | 899 | if (o_Input->IsOpen()) |
900 | { |
||
901 | // send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 520, cb_Device->currentText())); |
||
902 | } |
||
674 | KeyOz | 903 | |
904 | } |
||
711 | KeyOz | 905 | else // Server voll |
906 | { |
||
674 | KeyOz | 907 | o_TCP[ID] = TCP_Server->nextPendingConnection(); |
908 | o_TCP[ID]->setProperty("ID", ID); |
||
909 | |||
711 | KeyOz | 910 | send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 521, "Sorry, Server full.")); |
674 | KeyOz | 911 | o_TCP[ID]->disconnectFromHost(); |
912 | } |
||
913 | } |
||
914 | |||
915 | void dlg_Main::slot_TCP_Read() |
||
916 | { |
||
917 | QTcpSocket *Socket = (QTcpSocket*)sender(); |
||
918 | |||
919 | // if (Socket->canReadLine()) |
||
920 | { |
||
921 | int ID = Socket->property("ID").toUInt(); |
||
922 | ID = ID; |
||
923 | |||
711 | KeyOz | 924 | // QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n')); |
750 | KeyOz | 925 | QString t_Data = s_Buffer + QString(Socket->readAll()).remove(QChar('\n')); |
715 | KeyOz | 926 | s_Buffer = ""; |
711 | KeyOz | 927 | |
750 | KeyOz | 928 | t_Data = t_Data.replace('\r', "\r\n"); |
929 | |||
715 | KeyOz | 930 | QStringList l_Data = t_Data.split('\n'); |
711 | KeyOz | 931 | |
932 | for (int z = 0; z < l_Data.count(); z++) |
||
933 | { |
||
715 | KeyOz | 934 | if ((l_Data[z][l_Data[z].length() - 1] == '\r')) |
711 | KeyOz | 935 | { |
715 | KeyOz | 936 | l_Data[z].remove(QChar('\r')); |
711 | KeyOz | 937 | if (l_Data[z][0] == '$') |
938 | { |
||
939 | parse_TCP_Server_Data(l_Data[z], ID); |
||
940 | show_Terminal(5, "IP: " + l_Data[z]); |
||
941 | } |
||
942 | else |
||
943 | { |
||
944 | if ((Con_Server[ID].Status >= 2)) |
||
945 | { |
||
946 | show_Terminal(3, "MK> " + l_Data[z]); |
||
947 | o_Input->send_Data(l_Data[z]); |
||
948 | } |
||
949 | } |
||
950 | } |
||
715 | KeyOz | 951 | else |
750 | KeyOz | 952 | { if (l_Data[z].length() > 1) |
953 | { |
||
954 | qDebug(QString("Ohne Ende: " + l_Data[z]).toLatin1().data()); |
||
955 | s_Buffer = s_Buffer + l_Data[z]; |
||
956 | } |
||
715 | KeyOz | 957 | } |
958 | |||
711 | KeyOz | 959 | } |
960 | |||
961 | /* |
||
674 | KeyOz | 962 | QString t_Data = QString(Socket->readLine((Socket->bytesAvailable()))); |
963 | |||
964 | QStringList s_Data = t_Data.split('\r'); |
||
965 | |||
711 | KeyOz | 966 | for (int z = 0; z < s_Data.count() - 1; z++) |
674 | KeyOz | 967 | { |
968 | if (s_Data[z][0] == '$') |
||
969 | { |
||
711 | KeyOz | 970 | parse_TCP_Server_Data(s_Data[z], ID); |
971 | show_Terminal(5, "IP: " + s_Data[z]); |
||
972 | |||
674 | KeyOz | 973 | } |
711 | KeyOz | 974 | else |
975 | { |
||
976 | if ((Con_Server[ID].Status >= 2)) |
||
674 | KeyOz | 977 | { |
978 | show_Terminal(3, s_Data[z]); |
||
979 | o_Input->send_Data(s_Data[z]); |
||
980 | } |
||
981 | } |
||
982 | } |
||
983 | } |
||
711 | KeyOz | 984 | */ |
985 | } |
||
674 | KeyOz | 986 | } |
987 | |||
988 | void dlg_Main::slot_TCP_Disconnect() |
||
989 | { |
||
990 | QTcpSocket *Socket = (QTcpSocket*)sender(); |
||
991 | |||
992 | int ID = Socket->property("ID").toUInt(); |
||
993 | |||
711 | KeyOz | 994 | Item[ID]->setText(" " + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - Disconected"); |
674 | KeyOz | 995 | |
711 | KeyOz | 996 | Con_Server[ID] = Con_Server[0]; |
997 | Con_Server[ID].Status = 0; |
||
674 | KeyOz | 998 | |
999 | Connect_Count--; |
||
1000 | |||
1001 | Socket->setProperty("ID", 0); |
||
1002 | |||
711 | KeyOz | 1003 | if ((Connect_Count == 0) && (o_Input->IsOpen())) |
674 | KeyOz | 1004 | slot_btn_Connect(); |
1005 | } |
||
1006 | |||
1007 | |||
1008 | // Programm Ende |
||
1009 | //////////////// |
||
1010 | dlg_Main::~dlg_Main() |
||
1011 | { |
||
1012 | o_Settings->GUI.isMax = isMaximized(); |
||
1013 | o_Settings->GUI.Size = size(); |
||
1014 | o_Settings->GUI.Point = pos(); |
||
1015 | |||
750 | KeyOz | 1016 | // o_Settings->GUI.isMax = isMaximized(); |
1017 | o_Settings->TERMINAL.Size = f_Terminal->size(); |
||
1018 | o_Settings->TERMINAL.Point = f_Terminal->pos(); |
||
1019 | |||
674 | KeyOz | 1020 | o_Settings->CLIENT.TTY_MAX = cb_Device->count(); |
1021 | o_Settings->CLIENT.TTY_ID = cb_Device->currentIndex(); |
||
1022 | |||
1023 | for (int z = 0; z < cb_Device->count(); z++) |
||
1024 | { |
||
1025 | if (z < 10) |
||
1026 | { |
||
1027 | o_Settings->CLIENT.TTY_DEVICES[z] = cb_Device->itemText(z); |
||
1028 | } |
||
1029 | } |
||
1030 | |||
711 | KeyOz | 1031 | o_Settings->CLIENT.TCP_MAX = cb_Server->count(); |
1032 | o_Settings->CLIENT.TCP_ID = cb_Server->currentIndex(); |
||
674 | KeyOz | 1033 | |
711 | KeyOz | 1034 | for (int z = 0; z < cb_Server->count(); z++) |
1035 | { |
||
1036 | if (z < 10) |
||
1037 | { |
||
1038 | o_Settings->CLIENT.TCP_SERVER[z] = cb_Server->itemText(z); |
||
1039 | } |
||
1040 | } |
||
1041 | |||
750 | KeyOz | 1042 | o_Settings->DATA.Data = f_Terminal->cb_Data->isChecked(); |
1043 | o_Settings->DATA.Info = f_Terminal->cb_Info->isChecked(); |
||
1044 | o_Settings->DATA.Send = f_Terminal->cb_Send->isChecked(); |
||
1045 | o_Settings->DATA.TCP = f_Terminal->cb_TCP->isChecked(); |
||
1046 | |||
674 | KeyOz | 1047 | o_Settings->write_Settings(); |
1048 | |||
1049 | // qDebug("Ende."); |
||
1050 | } |