Rev 722 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 722 | Rev 750 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | { |
29 | { |
30 | setupUi(this); |
30 | setupUi(this); |
Line 31... | Line 31... | ||
31 | 31 | ||
Line 32... | Line 32... | ||
32 | o_Settings = new cSettings(); |
32 | o_Settings = new cSettings(); |
Line 33... | Line 33... | ||
33 | 33 | ||
34 | o_Input = new Input(); |
34 | wg_Connection->set_Client(ID_SETTINGS, QA_NAME + " " + QA_VERSION, DataFields); |
Line 35... | Line 35... | ||
35 | 35 | ||
- | 36 | o_Timer = new QTimer(); |
|
Line 36... | Line 37... | ||
36 | o_Timer = new QTimer(); |
37 | o_Timer->setInterval(500); |
37 | o_Timer->setInterval(500); |
38 | |
38 | 39 | f_MotorMixer = new dlg_MotorMixer(this); |
|
39 | f_MotorMixer = new dlg_MotorMixer(this); |
40 | f_MotorTest = new dlg_MotorTest(this); |
Line 54... | Line 55... | ||
54 | if (o_Settings->GUI.isMax) |
55 | if (o_Settings->GUI.isMax) |
55 | { |
56 | { |
56 | showMaximized(); |
57 | showMaximized(); |
57 | } |
58 | } |
Line 58... | Line 59... | ||
58 | 59 | ||
59 | for(int z = 0; z < o_Settings->SERVER.IP_MAX; z++) |
- | |
60 | { |
- | |
61 | if (cb_Server->findText(o_Settings->SERVER.IP[z]) == -1) |
- | |
62 | { |
60 | wg_Connection->set_SelectVisible(false); |
63 | cb_Server->addItem(o_Settings->SERVER.IP[z]); |
- | |
64 | } |
- | |
Line 65... | Line 61... | ||
65 | } |
61 | wg_Connection->set_IntervalVisible(false); |
Line -... | Line 62... | ||
- | 62 | ||
- | 63 | ac_Toolbar->setChecked(o_Settings->GUI.Toolbar); |
|
66 | 64 | ||
- | 65 | if (ac_Toolbar->isChecked()) |
|
- | 66 | { |
|
- | 67 | wg_Connection->set_ButtonVisible(false); |
|
- | 68 | } |
|
- | 69 | else |
|
67 | cb_Server->setCurrentIndex(o_Settings->SERVER.IP_ID); |
70 | { |
Line 68... | Line 71... | ||
68 | 71 | ToolBar->setVisible(false); |
|
69 | le_Password->setText(o_Settings->SERVER.Password); |
72 | } |
70 | } |
73 | } |
71 | 74 | ||
Line -... | Line 75... | ||
- | 75 | // Signale mit Slots verbinden |
|
72 | // Signale mit Slots verbinden |
76 | void dlg_Main::init_Connections() |
Line 73... | Line 77... | ||
73 | void dlg_Main::init_Connections() |
77 | { |
74 | { |
78 | connect(o_Timer, SIGNAL(timeout()), this, SLOT(slot_Timer())); |
75 | connect(o_Timer, SIGNAL(timeout()), this, SLOT(slot_Timer())); |
79 | |
76 | 80 | connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect())); |
|
Line 77... | Line 81... | ||
77 | connect(ac_Connect, SIGNAL(triggered()), this, SLOT(slot_ac_Connect())); |
81 | connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar())); |
- | 82 | ||
- | 83 | connect(ac_Write, SIGNAL(triggered()), this, SLOT(slot_ac_Write())); |
|
- | 84 | connect(ac_Read, SIGNAL(triggered()), this, SLOT(slot_ac_Read())); |
|
- | 85 | connect(ac_Save, SIGNAL(triggered()), this, SLOT(slot_ac_Save())); |
|
Line 78... | Line 86... | ||
78 | 86 | connect(ac_Load, SIGNAL(triggered()), this, SLOT(slot_ac_Load())); |
|
79 | connect(ac_Write, SIGNAL(triggered()), this, SLOT(slot_ac_Write())); |
87 | |
80 | connect(ac_Read, SIGNAL(triggered()), this, SLOT(slot_ac_Read())); |
88 | connect(ac_MotorMixer, SIGNAL(triggered()), this, SLOT(slot_ac_MotorMixer())); |
Line -... | Line 89... | ||
- | 89 | connect(ac_MotorTest, SIGNAL(triggered()), this, SLOT(slot_ac_MotorTest())); |
|
- | 90 | ||
- | 91 | connect(f_MotorMixer, SIGNAL(sig_SendData(QString,int)), wg_Connection, SLOT(slot_send_Data(QString,int))); |
|
- | 92 | connect(f_MotorTest, SIGNAL(sig_SendData(QString,int)), wg_Connection, SLOT(slot_send_Data(QString,int))); |
|
- | 93 | ||
- | 94 | // About QMK-Settings & About-QT Dialog einfügen |
|
- | 95 | connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About())); |
|
- | 96 | menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt())); |
|
81 | connect(ac_Save, SIGNAL(triggered()), this, SLOT(slot_ac_Save())); |
97 | |
Line 82... | Line 98... | ||
82 | connect(ac_Load, SIGNAL(triggered()), this, SLOT(slot_ac_Load())); |
98 | connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int))); |
83 | 99 | connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware))); |
|
84 | connect(ac_MotorMixer, SIGNAL(triggered()), this, SLOT(slot_ac_MotorMixer())); |
100 | connect(wg_Connection, SIGNAL(sig_MK_ReadSettings(s_MK_Settings)), this, SLOT(slot_MK_ReadSettings(s_MK_Settings))); |
Line 155... | Line 171... | ||
155 | { |
171 | { |
156 | t_Dir->mkdir(s_Dir.Settings); |
172 | t_Dir->mkdir(s_Dir.Settings); |
157 | } |
173 | } |
158 | } |
174 | } |
Line 159... | Line -... | ||
159 | - | ||
160 | void dlg_Main::parse_IP_Data(QString t_Data) |
- | |
161 | { |
- | |
162 | QStringList Data; |
- | |
163 | Data = t_Data.split(":"); |
- | |
164 | - | ||
165 | if (Data.count() > 1) |
- | |
166 | { |
- | |
167 | int CMD = Data[2].toInt(); |
- | |
168 | - | ||
169 | switch(CMD) |
- | |
170 | { |
- | |
171 | case 101 : |
- | |
172 | { |
- | |
173 | o_Input->send_Data(HandlerIP::make_Frame(ID_SETTINGS, 101, QA_NAME + " " + QA_VERSION)); |
- | |
174 | } |
- | |
175 | break; |
- | |
176 | case 502 : |
- | |
177 | { |
- | |
178 | switch (Data[3].toInt()) |
- | |
179 | { |
- | |
180 | case 105 : |
- | |
181 | { |
- | |
182 | QString s_MD5PW; |
- | |
183 | QByteArray a_MD5PW; |
- | |
184 | - | ||
185 | a_MD5PW = QCryptographicHash::hash(le_Password->text().toAscii(),QCryptographicHash::Md5); |
- | |
186 | - | ||
187 | s_MD5PW = QString(a_MD5PW.toHex().data()); |
- | |
188 | - | ||
189 | o_Input->send_Data(HandlerIP::make_Frame(ID_SETTINGS, 105, s_MD5PW)); |
- | |
190 | } |
- | |
191 | break; |
- | |
192 | case 106 : |
- | |
193 | { |
- | |
194 | o_Input->send_Data(HandlerIP::make_Frame(ID_SETTINGS, 106, DataFields)); |
- | |
195 | } |
- | |
196 | break; |
- | |
197 | } |
- | |
198 | } |
- | |
199 | break; |
- | |
200 | case 505 : |
- | |
201 | { |
- | |
202 | if (Data[3] == "OK") |
- | |
203 | { |
- | |
204 | } |
- | |
205 | else |
- | |
206 | { |
- | |
207 | QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen. <br />Daten senden zum Mikrokopter nicht möglich."), QMessageBox::Ok); |
- | |
208 | } |
- | |
209 | } |
- | |
210 | break; |
- | |
211 | } |
- | |
212 | } |
- | |
213 | } |
- | |
214 | - | ||
215 | // Eingangsdaten verarbeiten |
- | |
216 | void dlg_Main::parse_MK_Data(QString t_Data) |
- | |
217 | { |
- | |
218 | unsigned char OutData[150]; |
- | |
219 | char *InData = t_Data.toLatin1().data(); |
- | |
220 | - | ||
221 | if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0) |
- | |
222 | { |
- | |
223 | switch(InData[2]) |
- | |
224 | { |
- | |
225 | case 'V' : // Versions-Info |
- | |
226 | { |
- | |
227 | o_Input->stop_Resend(DATA_VERSION); |
- | |
228 | VersionInfo = HandlerMK::parse_Version(OutData, InData[1] - 'a'); |
- | |
229 | setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + VersionInfo.Hardware + " " + VersionInfo.Version); |
- | |
230 | - | ||
231 | if (VersionInfo.ID == ADDRESS_FC) |
- | |
232 | { |
- | |
233 | // qDebug("get FC-Settings"); |
- | |
234 | c_Data[0] = 0xff; |
- | |
235 | o_Input->send_Data(HandlerMK::make_Frame('q', ADDRESS_FC, c_Data, 1).toLatin1().data(), DATA_READ_SETTINGS); |
- | |
236 | } |
- | |
237 | } |
- | |
238 | break; |
- | |
239 | case 'Q' : // Settings lesen |
- | |
240 | { |
- | |
241 | o_Input->stop_Resend(DATA_READ_SETTINGS); |
- | |
242 | if (OutData[1] == MK_VERSION_SETTINGS) |
- | |
243 | { |
- | |
244 | s_MK_Settings MK_Set; |
- | |
245 | - | ||
246 | memcpy((unsigned char *)&MK_Set, (unsigned char *)&OutData, sizeof(MK_Set)); |
- | |
247 | // qDebug(MK_Set.Name); |
- | |
248 | show_MK_Settings(MK_Set); |
- | |
249 | } |
- | |
250 | else |
- | |
251 | { |
- | |
252 | QMessageBox::warning(this, QA_NAME, tr("Versionen inkompatibel. \nParameterbearbeitung nicht moeglich."), QMessageBox::Ok); |
- | |
253 | ac_Read->setEnabled(false); |
- | |
254 | ac_Write->setEnabled(false); |
- | |
255 | } |
- | |
256 | } |
- | |
257 | break; |
- | |
258 | case 'S' : // Settings geschrieben |
- | |
259 | { |
- | |
260 | o_Input->stop_Resend(DATA_WRITE_SETTINGS); |
- | |
261 | if (OutData[0] == 0) |
- | |
262 | { |
- | |
263 | QMessageBox::warning(this, QA_NAME, tr("Fehler beim Settings-Schreiben."), QMessageBox::Ok); |
- | |
264 | } |
- | |
265 | } |
- | |
266 | break; |
- | |
267 | case 'P' : // RC-Kanäle |
- | |
268 | { |
- | |
269 | int PPM_in[11]; |
- | |
270 | - | ||
271 | memcpy((unsigned char *)&PPM_in, (unsigned char *)&OutData, sizeof(PPM_in)); |
- | |
272 | pb_K1->setValue(PPM_in[0]); |
- | |
273 | pb_K2->setValue(PPM_in[1]); |
- | |
274 | pb_K3->setValue(PPM_in[2]); |
- | |
275 | pb_K4->setValue(PPM_in[3]); |
- | |
276 | pb_K5->setValue(PPM_in[4]); |
- | |
277 | pb_K6->setValue(PPM_in[5]); |
- | |
278 | pb_K7->setValue(PPM_in[6]); |
- | |
279 | pb_K8->setValue(PPM_in[7]); |
- | |
280 | } |
- | |
281 | break; |
- | |
282 | case 'N' : // MotorMixer lesen |
- | |
283 | { |
- | |
284 | o_Input->stop_Resend(DATA_READ_MIXER); |
- | |
285 | - | ||
286 | s_MK_Mixer MK_Mixer; |
- | |
287 | - | ||
288 | memcpy((unsigned char *)&MK_Mixer, (unsigned char *)&OutData, sizeof(MK_Mixer)); |
- | |
289 | - | ||
290 | if (MK_Mixer.Revision == MK_VERSION_MIXER) |
- | |
291 | { |
- | |
292 | f_MotorMixer->set_MotorConfig(MK_Mixer); |
- | |
293 | } |
- | |
294 | } |
- | |
295 | break; |
- | |
296 | case 'M' : // MotorMixer geschrieben |
- | |
297 | { |
- | |
298 | o_Input->stop_Resend(DATA_WRITE_MIXER); |
- | |
299 | - | ||
300 | if (OutData[0] == 0) |
- | |
301 | { |
- | |
302 | QMessageBox::warning(this, QA_NAME, tr("Fehler beim MotorMixer-Schreiben."), QMessageBox::Ok); |
- | |
303 | } |
- | |
304 | } |
- | |
305 | break; |
- | |
306 | - | ||
307 | } |
- | |
308 | } |
- | |
309 | } |
- | |
310 | 175 | ||
311 | /////////// |
176 | /////////// |
312 | // Slots // |
177 | // Slots // |
Line 313... | Line 178... | ||
313 | /////////// |
178 | /////////// |
314 | 179 | ||
315 | // About-Dialog |
180 | // About-Dialog |
316 | void dlg_Main::slot_ac_About() |
181 | void dlg_Main::slot_ac_About() |
317 | { |
182 | { |
Line 318... | Line -... | ||
318 | QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT); |
- | |
319 | } |
183 | QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT); |
320 | 184 | } |
|
321 | // Verbindung zum Server aufbauen |
185 | |
322 | void dlg_Main::slot_ac_Connect() |
186 | void dlg_Main::slot_ac_Toolbar() |
323 | { |
- | |
324 | if (!o_Input->IsOpen()) |
- | |
325 | { |
- | |
326 | if (cb_Server->findText(cb_Server->currentText()) == -1) |
- | |
327 | { |
- | |
328 | cb_Server->addItem(cb_Server->currentText()); |
- | |
329 | cb_Server->setCurrentIndex(cb_Server->findText(cb_Server->currentText())); |
187 | { |
330 | } |
188 | if (ac_Toolbar->isChecked()) |
331 | - | ||
332 | cb_Server->setEnabled(false); |
- | |
333 | le_Password->setEnabled(false); |
- | |
334 | - | ||
335 | if (cb_Server->currentText().startsWith('/')) |
- | |
336 | { |
- | |
337 | o_Input = new Input_TTY(); |
- | |
338 | o_Input->Init(); |
- | |
339 | - | ||
340 | set_Input s_Input; |
- | |
341 | s_Input.Main = cb_Server->currentText(); |
- | |
342 | - | ||
343 | if (o_Input->Open(s_Input) == true) |
- | |
344 | { |
- | |
345 | ac_Connect->setText(tr("Trennen")); |
- | |
346 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
- | |
347 | - | ||
348 | o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION); |
- | |
349 | } |
- | |
350 | else |
- | |
351 | { |
- | |
352 | cb_Server->setEnabled(true); |
- | |
353 | le_Password->setEnabled(true); |
- | |
354 | } |
- | |
355 | - | ||
356 | } |
- | |
357 | else |
- | |
358 | { |
- | |
359 | o_Input = new Input_TCP(); |
- | |
360 | o_Input->Init(); |
- | |
361 | - | ||
362 | set_Input s_Input; |
- | |
363 | - | ||
364 | QStringList Server = cb_Server->currentText().split(":"); |
- | |
365 | - | ||
366 | s_Input.Main = Server[0]; |
- | |
367 | s_Input.Sub = Server[1]; |
- | |
368 | - | ||
369 | if (o_Input->Open(s_Input) == true) |
- | |
370 | { |
- | |
371 | connect(o_Input, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Input_Disconnected(int))); |
- | |
372 | connect(o_Input, SIGNAL(sig_Connected()), this, SLOT(slot_Input_Connected())); |
189 | { |
373 | } |
190 | wg_Connection->set_ButtonVisible(false); |
374 | } |
191 | ToolBar->setVisible(true); |
375 | } |
192 | } |
376 | else |
193 | else |
- | 194 | { |
|
- | 195 | wg_Connection->set_ButtonVisible(true); |
|
Line -... | Line 196... | ||
- | 196 | ToolBar->setVisible(false); |
|
- | 197 | } |
|
- | 198 | } |
|
- | 199 | ||
- | 200 | void dlg_Main::slot_ConnectionStatus(int li_Status) |
|
- | 201 | { |
|
- | 202 | if (li_Status) |
|
- | 203 | { |
|
- | 204 | ac_Connect->setChecked(true); |
|
- | 205 | ac_Connect->setText(tr("Trennen")); |
|
377 | { |
206 | } |
378 | cb_Server->setEnabled(true); |
- | |
379 | le_Password->setEnabled(true); |
- | |
380 | - | ||
381 | ac_Connect->setText(tr("Verbinden")); |
- | |
382 | o_Input->Close(); |
- | |
383 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
- | |
384 | if (o_Input->Mode() == TCP) |
- | |
385 | { |
207 | else |
386 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
208 | { |
Line 387... | Line -... | ||
387 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
- | |
388 | } |
209 | ac_Connect->setChecked(false); |
389 | } |
210 | ac_Connect->setText(tr("Verbinden")); |
- | 211 | } |
|
- | 212 | } |
|
- | 213 | ||
390 | } |
214 | void dlg_Main::slot_MK_Version(s_Hardware ls_Version) |
391 | 215 | { |
|
- | 216 | gs_Version = ls_Version; |
|
392 | // Neue Daten empfangen. |
217 | setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version); |
393 | void dlg_Main::slot_Input_Data(QString t_Data) |
218 | |
- | 219 | if (gs_Version.ID == ADDRESS_FC) |
|
- | 220 | { |
|
394 | { |
221 | c_Data[0] = 0xff; |
395 | if ((t_Data[0] == '#')) |
222 | wg_Connection->send_Data(HandlerMK::make_Frame('q', ADDRESS_FC, c_Data, 1).toLatin1().data(), DATA_READ_SETTINGS); |
396 | { |
223 | } |
397 | 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())))) |
224 | } |
398 | { |
225 | |
399 | parse_MK_Data(t_Data); |
- | |
400 | } |
226 | void dlg_Main::slot_MK_ReadSettings(s_MK_Settings ps_MK_Settings) |
401 | else |
227 | { |
402 | { |
228 | if (ps_MK_Settings.Version == MK_VERSION_SETTINGS) |
- | 229 | { |
|
403 | // qDebug(QString("CRC-Error - " + t_Data).toLatin1().data()); |
230 | show_MK_Settings(ps_MK_Settings); |
- | 231 | } |
|
404 | } |
232 | else |
405 | } |
233 | { |
Line 406... | Line 234... | ||
406 | else if (o_Input->Mode() == TCP) |
234 | QMessageBox::warning(this, QA_NAME, tr("Versionen inkompatibel. \nParameterbearbeitung nicht moeglich."), QMessageBox::Ok); |
407 | { |
235 | ac_Read->setEnabled(false); |
408 | parse_IP_Data(t_Data); |
236 | ac_Write->setEnabled(false); |
- | 237 | } |
|
- | 238 | } |
|
- | 239 | ||
- | 240 | void dlg_Main::slot_MK_WriteSettings(int pi_ID) |
|
- | 241 | { |
|
409 | } |
242 | if (pi_ID == 0) |
- | 243 | { |
|
Line 410... | Line -... | ||
410 | } |
- | |
411 | - | ||
412 | void dlg_Main::slot_Input_Disconnected(int Error) |
- | |
- | 244 | QMessageBox::warning(this, QA_NAME, tr("Fehler beim Settings-Schreiben."), QMessageBox::Ok); |
|
Line -... | Line 245... | ||
- | 245 | } |
|
- | 246 | else |
|
413 | { |
247 | { |
- | 248 | QMessageBox::information(this, QA_NAME, tr("Setting geschrieben."), QMessageBox::Ok); |
|
414 | cb_Server->setEnabled(true); |
249 | } |
- | 250 | ||
- | 251 | } |
|
Line -... | Line 252... | ||
- | 252 | ||
- | 253 | void dlg_Main::slot_MK_ReadMotorMixer(s_MK_Mixer ps_MK_MotorMixer) |
|
415 | le_Password->setEnabled(true); |
254 | { |
416 | 255 | if (ps_MK_MotorMixer.Revision == MK_VERSION_MIXER) |
|
417 | disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0); |
- | |
418 | disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0); |
- | |
419 | disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0); |
- | |
420 | 256 | { |
|
421 | ac_Connect->setChecked(false); |
257 | f_MotorMixer->set_MotorConfig(ps_MK_MotorMixer); |
422 | ac_Connect->setText(tr("Verbinden")); |
- | |
423 | - | ||
424 | switch (Error) |
- | |
425 | { |
- | |
426 | case REMOTECLOSED : |
- | |
427 | { |
258 | } |
428 | // lb_Status->setText(tr("Verbindung vom Server beendet.")); |
- | |
429 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok); |
- | |
430 | } |
259 | } |
431 | break; |
- | |
432 | case REFUSED : |
260 | |
433 | { |
- | |
434 | // lb_Status->setText(tr("Server nicht gefunden.")); |
- | |
435 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok); |
- | |
436 | } |
- | |
437 | break; |
- | |
438 | case 3 : |
- | |
439 | { |
- | |
440 | // lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch.")); |
261 | void dlg_Main::slot_MK_WriteMotorMixer(int pi_ID) |
Line 441... | Line 262... | ||
441 | QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok); |
262 | { |
Line 442... | Line 263... | ||
442 | } |
263 | if (pi_ID == 0) |
443 | break; |
264 | { |
444 | default : |
265 | QMessageBox::warning(this, QA_NAME, tr("Fehler beim MotorMixer-Schreiben."), QMessageBox::Ok); |
Line 445... | Line 266... | ||
445 | { |
266 | } |
- | 267 | else |
|
- | 268 | { |
|
- | 269 | QMessageBox::information(this, QA_NAME, tr("MotorMixer geschrieben."), QMessageBox::Ok); |
|
- | 270 | } |
|
- | 271 | ||
- | 272 | } |
|
- | 273 | ||
- | 274 | void dlg_Main::slot_MK_PPMData(s_MK_PPM_Data ps_PPMData) |
|
- | 275 | { |
|
446 | // lb_Status->setText(tr("Getrennt vom QMK-Datenserver.")); |
276 | qDebug("PPM-Data"); |
- | 277 | ||
- | 278 | // qDebug() << ps_PPMData.Data[1] << ", " << ps_PPMData.Data[2] << ", " << ps_PPMData.Data[3] << ", " << ps_PPMData.Data[4]; |
|
- | 279 | ||
- | 280 | pb_K1->setValue(ps_PPMData.Data[1]); |
|
- | 281 | pb_K2->setValue(ps_PPMData.Data[2]); |
|
- | 282 | pb_K3->setValue(ps_PPMData.Data[3]); |
|
- | 283 | pb_K4->setValue(ps_PPMData.Data[4]); |
|
- | 284 | pb_K5->setValue(ps_PPMData.Data[5]); |
|
- | 285 | pb_K6->setValue(ps_PPMData.Data[6]); |
|
- | 286 | pb_K7->setValue(ps_PPMData.Data[7]); |
|
- | 287 | pb_K8->setValue(ps_PPMData.Data[8]); |
|
- | 288 | pb_K9->setValue(ps_PPMData.Data[9]); |
|
- | 289 | pb_K10->setValue(ps_PPMData.Data[10]); |
|
- | 290 | pb_K11->setValue(ps_PPMData.Data[11]); |
|
- | 291 | pb_K12->setValue(ps_PPMData.Data[12]); |
|
447 | } |
292 | pb_K1_2->setValue(ps_PPMData.Data[13]); |
Line 448... | Line 293... | ||
448 | break; |
293 | pb_K2_2->setValue(ps_PPMData.Data[14]); |
449 | } |
294 | pb_K3_2->setValue(ps_PPMData.Data[15]); |
450 | 295 | pb_K4_2->setValue(ps_PPMData.Data[16]); |
|
Line -... | Line 296... | ||
- | 296 | pb_K5_2->setValue(ps_PPMData.Data[17]); |
|
451 | } |
297 | pb_K6_2->setValue(ps_PPMData.Data[18]); |
452 | 298 | pb_K7_2->setValue(ps_PPMData.Data[19]); |
|
453 | void dlg_Main::slot_Input_Connected() |
299 | pb_K8_2->setValue(ps_PPMData.Data[20]); |
454 | { |
300 | pb_K9_2->setValue(ps_PPMData.Data[21]); |
455 | connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString))); |
301 | pb_K10_2->setValue(ps_PPMData.Data[22]); |
456 | 302 | pb_K11_2->setValue(ps_PPMData.Data[23]); |
|
457 | o_Input->send_Data(HandlerMK::make_Frame('v', ADDRESS_ALL, c_Data, 0).toLatin1().data(), DATA_VERSION); |
303 | pb_K12_2->setValue(ps_PPMData.Data[24]); |
Line 458... | Line 304... | ||
458 | ac_Connect->setText(tr("Trennen")); |
304 | } |
459 | } |
305 | |
460 | 306 | /////////////////////////////////////////////////////////////////// |
|
461 | /////////////////////////////////////////////////////////////////// |
307 | // QMK-Settings // |
Line 462... | Line 308... | ||
462 | // QMK-Settings // |
308 | /////////////////////////////////////////////////////////////////// |
463 | /////////////////////////////////////////////////////////////////// |
309 | |
464 | 310 | ||
465 | void dlg_Main::slot_PageChange(int Page) |
311 | void dlg_Main::slot_PageChange(int Page) |
Line 466... | Line 312... | ||
466 | { |
312 | { |
467 | if (Page == 1) |
313 | if (Page == 1) |
468 | o_Timer->start(); |
314 | o_Timer->start(); |
469 | else |
315 | else |
Line -... | Line 316... | ||
- | 316 | o_Timer->stop(); |
|
- | 317 | } |
|
- | 318 | ||
- | 319 | void dlg_Main::slot_Timer() |
|
- | 320 | { |
|
- | 321 | wg_Connection->send_Data(HandlerMK::make_Frame('p', ADDRESS_FC, c_Data, 0).toLatin1().data(), 0); |
|
- | 322 | } |
|
- | 323 | ||
- | 324 | void dlg_Main::slot_ac_MotorMixer() |
|
- | 325 | { |
|
- | 326 | f_MotorMixer->set_Objects(o_Settings, s_Dir); |
|
- | 327 | f_MotorMixer->read_Mixer(); |
|
470 | o_Timer->stop(); |
328 | |
471 | } |
329 | if (f_MotorMixer->exec()==QDialog::Accepted) |
472 | 330 | { |
|
473 | void dlg_Main::slot_Timer() |
331 | } |
Line 474... | Line 332... | ||
474 | { |
332 | } |
Line 475... | Line 333... | ||
475 | o_Input->send_Data(HandlerMK::make_Frame('p', ADDRESS_FC, c_Data, 0).toLatin1().data(), 0); |
333 | |
Line 476... | Line 334... | ||
476 | } |
334 | void dlg_Main::slot_ac_MotorTest() |
477 | 335 | { |
|
Line 478... | Line 336... | ||
478 | void dlg_Main::slot_ac_MotorMixer() |
336 | // f_MotorMixer->set_Objects(wg_Connection->o_Input, o_Settings, s_Dir); |
479 | { |
337 | // f_MotorMixer->read_Mixer(); |
480 | f_MotorMixer->set_Objects(o_Input, o_Settings, s_Dir); |
338 | |
481 | f_MotorMixer->read_Mixer(); |
339 | if (f_MotorTest->exec()==QDialog::Accepted) |
482 | 340 | { |
|
Line 483... | Line 341... | ||
483 | if (f_MotorMixer->exec()==QDialog::Accepted) |
341 | } |
484 | { |
342 | |
485 | } |
343 | f_MotorTest->Stop(); |
Line 486... | Line 344... | ||
486 | } |
344 | } |
487 | 345 | ||
488 | // Settings-Funktionen |
346 | // Settings-Funktionen |
489 | void dlg_Main::slot_ac_Write() |
347 | void dlg_Main::slot_ac_Write() |
Line 532... | Line 390... | ||
532 | Setting.setValue("Gier", t_Set.Kanalbelegung[3]); |
390 | Setting.setValue("Gier", t_Set.Kanalbelegung[3]); |
533 | Setting.setValue("Poti_1", t_Set.Kanalbelegung[4]); |
391 | Setting.setValue("Poti_1", t_Set.Kanalbelegung[4]); |
534 | Setting.setValue("Poti_2", t_Set.Kanalbelegung[5]); |
392 | Setting.setValue("Poti_2", t_Set.Kanalbelegung[5]); |
535 | Setting.setValue("Poti_3", t_Set.Kanalbelegung[6]); |
393 | Setting.setValue("Poti_3", t_Set.Kanalbelegung[6]); |
536 | Setting.setValue("Poti_4", t_Set.Kanalbelegung[7]); |
394 | Setting.setValue("Poti_4", t_Set.Kanalbelegung[7]); |
- | 395 | Setting.setValue("Poti_5", t_Set.Kanalbelegung[8]); |
|
- | 396 | Setting.setValue("Poti_6", t_Set.Kanalbelegung[9]); |
|
- | 397 | Setting.setValue("Poti_7", t_Set.Kanalbelegung[10]); |
|
- | 398 | Setting.setValue("Poti_8", t_Set.Kanalbelegung[11]); |
|
- | 399 | Setting.setValue("Receiver", t_Set.Receiver); |
|
537 | Setting.endGroup(); |
400 | Setting.endGroup(); |
Line 538... | Line 401... | ||
538 | 401 | ||
539 | Setting.beginGroup("Stick"); |
402 | Setting.beginGroup("Stick"); |
540 | Setting.setValue("Nick_Roll-P", t_Set.Stick_P); |
403 | Setting.setValue("Nick_Roll-P", t_Set.Stick_P); |
Line 579... | Line 442... | ||
579 | Setting.setValue("ServoRollMin", t_Set.ServoRollMin); |
442 | Setting.setValue("ServoRollMin", t_Set.ServoRollMin); |
580 | Setting.setValue("ServoRollMax", t_Set.ServoRollMax); |
443 | Setting.setValue("ServoRollMax", t_Set.ServoRollMax); |
Line 581... | Line 444... | ||
581 | 444 | ||
582 | Setting.setValue("ServoInvert", t_Set.ServoCompInvert); |
445 | Setting.setValue("ServoInvert", t_Set.ServoCompInvert); |
- | 446 | Setting.setValue("ServoNickRefreshRate", t_Set.ServoNickRefresh); |
|
- | 447 | ||
- | 448 | Setting.setValue("Servo3", t_Set.Servo3); |
|
- | 449 | Setting.setValue("Servo4", t_Set.Servo4); |
|
583 | Setting.setValue("ServoNickRefreshRate", t_Set.ServoNickRefresh); |
450 | Setting.setValue("Servo5", t_Set.Servo5); |
Line 584... | Line 451... | ||
584 | Setting.endGroup(); |
451 | Setting.endGroup(); |
585 | 452 | ||
586 | Setting.beginGroup("Others"); |
453 | Setting.beginGroup("Others"); |
Line 676... | Line 543... | ||
676 | t_Set.Kanalbelegung[3] = Setting.value("Gier", 4).toInt(); |
543 | t_Set.Kanalbelegung[3] = Setting.value("Gier", 4).toInt(); |
677 | t_Set.Kanalbelegung[4] = Setting.value("Poti_1", 5).toInt(); |
544 | t_Set.Kanalbelegung[4] = Setting.value("Poti_1", 5).toInt(); |
678 | t_Set.Kanalbelegung[5] = Setting.value("Poti_2", 6).toInt(); |
545 | t_Set.Kanalbelegung[5] = Setting.value("Poti_2", 6).toInt(); |
679 | t_Set.Kanalbelegung[6] = Setting.value("Poti_3", 7).toInt(); |
546 | t_Set.Kanalbelegung[6] = Setting.value("Poti_3", 7).toInt(); |
680 | t_Set.Kanalbelegung[7] = Setting.value("Poti_4", 8).toInt(); |
547 | t_Set.Kanalbelegung[7] = Setting.value("Poti_4", 8).toInt(); |
- | 548 | t_Set.Kanalbelegung[8] = Setting.value("Poti_5", 9).toInt(); |
|
- | 549 | t_Set.Kanalbelegung[9] = Setting.value("Poti_6", 10).toInt(); |
|
- | 550 | t_Set.Kanalbelegung[10] = Setting.value("Poti_7", 11).toInt(); |
|
- | 551 | t_Set.Kanalbelegung[11] = Setting.value("Poti_8", 12).toInt(); |
|
- | 552 | t_Set.Receiver = Setting.value("Receiver", 0).toInt(); |
|
681 | Setting.endGroup(); |
553 | Setting.endGroup(); |
Line 682... | Line 554... | ||
682 | 554 | ||
683 | Setting.beginGroup("Stick"); |
555 | Setting.beginGroup("Stick"); |
684 | t_Set.Stick_P = Setting.value("Nick_Roll-P", 10).toInt(); |
556 | t_Set.Stick_P = Setting.value("Nick_Roll-P", 10).toInt(); |
Line 723... | Line 595... | ||
723 | t_Set.ServoRollMin = Setting.value("ServoRollMin", 0).toInt(); |
595 | t_Set.ServoRollMin = Setting.value("ServoRollMin", 0).toInt(); |
724 | t_Set.ServoRollMax = Setting.value("ServoRollMax", 250).toInt(); |
596 | t_Set.ServoRollMax = Setting.value("ServoRollMax", 250).toInt(); |
Line 725... | Line 597... | ||
725 | 597 | ||
726 | t_Set.ServoCompInvert = Setting.value("ServoInvert", 0).toInt(); |
598 | t_Set.ServoCompInvert = Setting.value("ServoInvert", 0).toInt(); |
- | 599 | t_Set.ServoNickRefresh = Setting.value("ServoNickRefreshRate", 3).toInt(); |
|
- | 600 | ||
- | 601 | t_Set.Servo3 = Setting.value("Servo3", 0).toInt(); |
|
- | 602 | t_Set.Servo4 = Setting.value("Servo4", 0).toInt(); |
|
727 | t_Set.ServoNickRefresh = Setting.value("ServoNickRefreshRate", 3).toInt(); |
603 | t_Set.Servo5 = Setting.value("Servo5", 0).toInt(); |
Line 728... | Line 604... | ||
728 | Setting.endGroup(); |
604 | Setting.endGroup(); |
729 | 605 | ||
730 | Setting.beginGroup("Others"); |
606 | Setting.beginGroup("Others"); |
Line 810... | Line 686... | ||
810 | s_1_7_cb->setChecked(t_Set.GlobalConfig & CFG_DREHRATEN_BEGRENZER); |
686 | s_1_7_cb->setChecked(t_Set.GlobalConfig & CFG_DREHRATEN_BEGRENZER); |
811 | s_1_8_cb->setChecked(t_Set.GlobalConfig & CFG_HEADING_HOLD); |
687 | s_1_8_cb->setChecked(t_Set.GlobalConfig & CFG_HEADING_HOLD); |
812 | } |
688 | } |
813 | // Seite 2 |
689 | // Seite 2 |
814 | { |
690 | { |
815 | sb_2_1->setValue(t_Set.Kanalbelegung[2]); |
691 | cb_2_1->setCurrentIndex(t_Set.Kanalbelegung[2] - 1); |
816 | sb_2_2->setValue(t_Set.Kanalbelegung[3]); |
692 | cb_2_2->setCurrentIndex(t_Set.Kanalbelegung[3] - 1); |
817 | sb_2_3->setValue(t_Set.Kanalbelegung[0]); |
693 | cb_2_3->setCurrentIndex(t_Set.Kanalbelegung[0] - 1); |
818 | sb_2_4->setValue(t_Set.Kanalbelegung[1]); |
694 | cb_2_4->setCurrentIndex(t_Set.Kanalbelegung[1] - 1); |
819 | sb_2_5->setValue(t_Set.Kanalbelegung[4]); |
695 | cb_2_5->setCurrentIndex(t_Set.Kanalbelegung[4] - 1); |
820 | sb_2_6->setValue(t_Set.Kanalbelegung[5]); |
696 | cb_2_6->setCurrentIndex(t_Set.Kanalbelegung[5] - 1); |
821 | sb_2_7->setValue(t_Set.Kanalbelegung[6]); |
697 | cb_2_7->setCurrentIndex(t_Set.Kanalbelegung[6] - 1); |
822 | sb_2_8->setValue(t_Set.Kanalbelegung[7]); |
698 | cb_2_8->setCurrentIndex(t_Set.Kanalbelegung[7] - 1); |
- | 699 | cb_2_9->setCurrentIndex(t_Set.Kanalbelegung[8] - 1); |
|
- | 700 | cb_2_10->setCurrentIndex(t_Set.Kanalbelegung[9] - 1); |
|
- | 701 | cb_2_11->setCurrentIndex(t_Set.Kanalbelegung[10] - 1); |
|
- | 702 | cb_2_12->setCurrentIndex(t_Set.Kanalbelegung[11] - 1); |
|
- | 703 | s_2_13_cb->setCurrentIndex(t_Set.Receiver); |
|
823 | } |
704 | } |
824 | // Seite 3 |
705 | // Seite 3 |
825 | { |
706 | { |
826 | sb_3_1->setValue(t_Set.Stick_P); |
707 | sb_3_1->setValue(t_Set.Stick_P); |
827 | sb_3_2->setValue(t_Set.Stick_D); |
708 | sb_3_2->setValue(t_Set.Stick_D); |
828 | cb_3_3 = setCombo(cb_3_3, t_Set.Gier_P); |
709 | cb_3_3 = setCombo(cb_3_3, t_Set.Gier_P); |
829 | cb_3_4 = setCombo(cb_3_4, t_Set.ExternalControl); |
710 | cb_3_4 = setCombo(cb_3_4, t_Set.ExternalControl); |
830 | } |
711 | } |
831 | // Seite 4 |
712 | // Seite 4 |
832 | { |
713 | { |
833 | if (t_Set.ExtraConfig & CFG2_HEIGHT_LIMIT) { |
714 | // s_4_2_rb->setChecked(t_Set.ExtraConfig & CFG2_HEIGHT_LIMIT); |
- | 715 | ||
834 | s_4_2_rb->setChecked(true); |
716 | if (t_Set.ExtraConfig & CFG2_HEIGHT_LIMIT) |
835 | } else { |
717 | { |
836 | s_4_3_rb->setChecked(true); |
718 | s_4_2_rb->setChecked(true); |
837 | } |
719 | } |
- | 720 | else |
|
- | 721 | { |
|
- | 722 | s_4_3_rb->setChecked(true); |
|
- | 723 | } |
|
- | 724 | ||
838 | s_4_5_cb->setChecked(t_Set.ExtraConfig & CFG2_VARIO_BEEP); |
725 | s_4_5_cb->setChecked(t_Set.ExtraConfig & CFG2_VARIO_BEEP); |
839 | s_4_4_cb->setChecked(t_Set.GlobalConfig & CFG_HOEHEN_SCHALTER); |
726 | s_4_4_cb->setChecked(t_Set.GlobalConfig & CFG_HOEHEN_SCHALTER); |
Line 840... | Line 727... | ||
840 | 727 | ||
841 | cb_4_1 = setCombo(cb_4_1, t_Set.MaxHoehe); |
728 | cb_4_1 = setCombo(cb_4_1, t_Set.MaxHoehe); |
Line 875... | Line 762... | ||
875 | 762 | ||
876 | cb_6_6->setChecked(t_Set.ServoCompInvert & 0x01); |
763 | cb_6_6->setChecked(t_Set.ServoCompInvert & 0x01); |
Line 877... | Line 764... | ||
877 | cb_6_9->setChecked(t_Set.ServoCompInvert & 0x02); |
764 | cb_6_9->setChecked(t_Set.ServoCompInvert & 0x02); |
- | 765 | ||
- | 766 | sb_6_5->setValue(t_Set.ServoNickRefresh); |
|
- | 767 | ||
- | 768 | cb_6_12 = setCombo(cb_6_12, t_Set.Servo3); |
|
- | 769 | cb_6_13 = setCombo(cb_6_13, t_Set.Servo4); |
|
878 | 770 | cb_6_14 = setCombo(cb_6_14, t_Set.Servo5); |
|
879 | sb_6_5->setValue(t_Set.ServoNickRefresh); |
771 | |
880 | } |
772 | } |
881 | // Seite 7 |
773 | // Seite 7 |
882 | { |
774 | { |
Line 964... | Line 856... | ||
964 | sb_11_3->setValue(t_Set.J17Bitmask); |
856 | sb_11_3->setValue(t_Set.J17Bitmask); |
965 | cb_11_4 = setCombo(cb_11_4, int(t_Set.J17Timing)); |
857 | cb_11_4 = setCombo(cb_11_4, int(t_Set.J17Timing)); |
966 | sb_11_5->setValue(t_Set.WARN_J16_Bitmask); |
858 | sb_11_5->setValue(t_Set.WARN_J16_Bitmask); |
967 | sb_11_6->setValue(t_Set.WARN_J17_Bitmask); |
859 | sb_11_6->setValue(t_Set.WARN_J17_Bitmask); |
968 | cb_11_7->setChecked(t_Set.BitConfig & CFG_MOTOR_BLINK); |
860 | cb_11_7->setChecked(t_Set.BitConfig & CFG_MOTOR_BLINK); |
- | 861 | ||
- | 862 | if (t_Set.WARN_J16_Bitmask != 0) |
|
- | 863 | s_11_7_cb->setChecked(true); |
|
- | 864 | else |
|
- | 865 | s_11_7_cb->setChecked(false); |
|
- | 866 | ||
- | 867 | if (t_Set.WARN_J17_Bitmask != 0) |
|
969 | J16_8->setChecked(t_Set.BitConfig & CFG_MOTOR_OFF_LED1); |
868 | s_11_8_cb->setChecked(true); |
- | 869 | else |
|
970 | J17_8->setChecked(t_Set.BitConfig & CFG_MOTOR_OFF_LED2); |
870 | s_11_8_cb->setChecked(false); |
971 | } |
871 | } |
972 | // Seite 12 |
872 | // Seite 12 |
973 | { |
873 | { |
974 | cb_12_1 = setCombo(cb_12_1, t_Set.NaviGpsModeControl); |
874 | cb_12_1 = setCombo(cb_12_1, t_Set.NaviGpsModeControl); |
975 | cb_12_2 = setCombo(cb_12_2, t_Set.NaviGpsGain); |
875 | cb_12_2 = setCombo(cb_12_2, t_Set.NaviGpsGain); |
Line 1023... | Line 923... | ||
1023 | if (s_1_8_cb->isChecked()) |
923 | if (s_1_8_cb->isChecked()) |
1024 | t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_HEADING_HOLD; |
924 | t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_HEADING_HOLD; |
1025 | } |
925 | } |
1026 | // Seite 2 |
926 | // Seite 2 |
1027 | { |
927 | { |
1028 | t_Set.Kanalbelegung[2] = sb_2_1->value(); |
928 | t_Set.Kanalbelegung[2] = cb_2_1->currentIndex() + 1; |
1029 | t_Set.Kanalbelegung[3] = sb_2_2->value(); |
929 | t_Set.Kanalbelegung[3] = cb_2_2->currentIndex() + 1; |
1030 | t_Set.Kanalbelegung[0] = sb_2_3->value(); |
930 | t_Set.Kanalbelegung[0] = cb_2_3->currentIndex() + 1; |
1031 | t_Set.Kanalbelegung[1] = sb_2_4->value(); |
931 | t_Set.Kanalbelegung[1] = cb_2_4->currentIndex() + 1; |
1032 | t_Set.Kanalbelegung[4] = sb_2_5->value(); |
932 | t_Set.Kanalbelegung[4] = cb_2_5->currentIndex() + 1; |
1033 | t_Set.Kanalbelegung[5] = sb_2_6->value(); |
933 | t_Set.Kanalbelegung[5] = cb_2_6->currentIndex() + 1; |
1034 | t_Set.Kanalbelegung[6] = sb_2_7->value(); |
934 | t_Set.Kanalbelegung[6] = cb_2_7->currentIndex() + 1; |
1035 | t_Set.Kanalbelegung[7] = sb_2_8->value(); |
935 | t_Set.Kanalbelegung[7] = cb_2_8->currentIndex() + 1; |
- | 936 | t_Set.Kanalbelegung[8] = cb_2_9->currentIndex() + 1; |
|
- | 937 | t_Set.Kanalbelegung[9] = cb_2_10->currentIndex() + 1; |
|
- | 938 | t_Set.Kanalbelegung[10] = cb_2_11->currentIndex() + 1; |
|
- | 939 | t_Set.Kanalbelegung[11] = cb_2_12->currentIndex() + 1; |
|
- | 940 | t_Set.Receiver = s_2_13_cb->currentIndex(); |
|
1036 | } |
941 | } |
1037 | // Seite 3 |
942 | // Seite 3 |
1038 | { |
943 | { |
1039 | t_Set.Stick_P = sb_3_1->value(); |
944 | t_Set.Stick_P = sb_3_1->value(); |
1040 | t_Set.Stick_D = sb_3_2->value(); |
945 | t_Set.Stick_D = sb_3_2->value(); |
Line 1085... | Line 990... | ||
1085 | t_Set.ServoRollMin = sb_6_10->value(); |
990 | t_Set.ServoRollMin = sb_6_10->value(); |
1086 | t_Set.ServoRollMax = sb_6_11->value(); |
991 | t_Set.ServoRollMax = sb_6_11->value(); |
Line 1087... | Line 992... | ||
1087 | 992 | ||
Line -... | Line 993... | ||
- | 993 | t_Set.ServoNickRefresh = sb_6_5->value(); |
|
- | 994 | ||
- | 995 | t_Set.Servo3 = get_Value(cb_6_12); |
|
- | 996 | t_Set.Servo4 = get_Value(cb_6_13); |
|
1088 | t_Set.ServoNickRefresh = sb_6_5->value(); |
997 | t_Set.Servo5 = get_Value(cb_6_14); |
1089 | 998 | ||
1090 | if (cb_6_6->isChecked()) |
999 | if (cb_6_6->isChecked()) |
1091 | t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x01; |
1000 | t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x01; |
1092 | if (cb_6_9->isChecked()) |
1001 | if (cb_6_9->isChecked()) |
Line 1146... | Line 1055... | ||
1146 | t_Set.WARN_J16_Bitmask = sb_11_5->value(); |
1055 | t_Set.WARN_J16_Bitmask = sb_11_5->value(); |
1147 | t_Set.WARN_J17_Bitmask = sb_11_6->value(); |
1056 | t_Set.WARN_J17_Bitmask = sb_11_6->value(); |
Line 1148... | Line 1057... | ||
1148 | 1057 | ||
1149 | if (cb_11_7->isChecked()) |
1058 | if (cb_11_7->isChecked()) |
- | 1059 | t_Set.BitConfig = t_Set.BitConfig | CFG_MOTOR_BLINK; |
|
1150 | t_Set.BitConfig = t_Set.BitConfig | CFG_MOTOR_BLINK; |
1060 | |
1151 | if (J16_8->isChecked()) |
1061 | if (!s_11_7_cb->isChecked()) |
1152 | t_Set.BitConfig = t_Set.BitConfig | CFG_MOTOR_OFF_LED1; |
1062 | t_Set.WARN_J16_Bitmask = 0; |
1153 | if (J17_8->isChecked()) |
1063 | if (!s_11_8_cb->isChecked()) |
- | 1064 | t_Set.WARN_J17_Bitmask = 0; |
|
1154 | t_Set.BitConfig = t_Set.BitConfig | CFG_MOTOR_OFF_LED2; |
1065 | |
1155 | } |
1066 | } |
1156 | // Seite 12 |
1067 | // Seite 12 |
1157 | { |
1068 | { |
1158 | t_Set.NaviGpsModeControl = get_Value(cb_12_1); |
1069 | t_Set.NaviGpsModeControl = get_Value(cb_12_1); |
Line 1180... | Line 1091... | ||
1180 | } |
1091 | } |
Line 1181... | Line 1092... | ||
1181 | 1092 | ||
1182 | int dlg_Main::get_Value(QComboBox *Combo) |
1093 | int dlg_Main::get_Value(QComboBox *Combo) |
1183 | { |
1094 | { |
1184 | if (Combo->currentText() == QString("Poti 1")) |
1095 | if (Combo->currentText() == QString("Poti 1")) |
1185 | return 251; |
1096 | return 255; |
1186 | if (Combo->currentText() == QString("Poti 2")) |
1097 | if (Combo->currentText() == QString("Poti 2")) |
1187 | return 252; |
1098 | return 254; |
1188 | if (Combo->currentText() == QString("Poti 3")) |
1099 | if (Combo->currentText() == QString("Poti 3")) |
1189 | return 253; |
1100 | return 253; |
- | 1101 | if (Combo->currentText() == QString("Poti 4")) |
|
- | 1102 | return 252; |
|
1190 | if (Combo->currentText() == QString("Poti 4")) |
1103 | if (Combo->currentText() == QString("Poti 5")) |
- | 1104 | return 251; |
|
- | 1105 | if (Combo->currentText() == QString("Poti 6")) |
|
- | 1106 | return 250; |
|
- | 1107 | if (Combo->currentText() == QString("Poti 7")) |
|
- | 1108 | return 249; |
|
- | 1109 | if (Combo->currentText() == QString("Poti 8")) |
|
1191 | return 254; |
1110 | return 248; |
1192 | return Combo->currentText().toInt(); |
1111 | return Combo->currentText().toInt(); |
Line 1193... | Line 1112... | ||
1193 | } |
1112 | } |
1194 | 1113 | ||
1195 | QComboBox *dlg_Main::setCombo(QComboBox *Combo, int Wert) |
1114 | QComboBox *dlg_Main::setCombo(QComboBox *Combo, int Wert) |
1196 | { |
1115 | { |
1197 | if (Wert <= 250) |
1116 | if (Wert <= 245) |
1198 | { |
1117 | { |
1199 | Combo->setItemText(4, QString("%1").arg(Wert)); |
1118 | Combo->setItemText(8, QString("%1").arg(Wert)); |
1200 | Combo->setCurrentIndex(4); |
1119 | Combo->setCurrentIndex(8); |
1201 | } |
1120 | } |
1202 | else |
1121 | else |
1203 | { |
1122 | { |
1204 | Combo->setCurrentIndex(Wert - 251); |
1123 | Combo->setCurrentIndex(255 - Wert); |
1205 | } |
1124 | } |
Line 1206... | Line 1125... | ||
1206 | return Combo; |
1125 | return Combo; |
Line 1405... | Line 1324... | ||
1405 | dlg_Main::~dlg_Main() |
1324 | dlg_Main::~dlg_Main() |
1406 | { |
1325 | { |
1407 | o_Settings->GUI.isMax = isMaximized(); |
1326 | o_Settings->GUI.isMax = isMaximized(); |
1408 | o_Settings->GUI.Size = size(); |
1327 | o_Settings->GUI.Size = size(); |
1409 | o_Settings->GUI.Point = pos(); |
1328 | o_Settings->GUI.Point = pos(); |
1410 | - | ||
1411 | o_Settings->SERVER.Password = le_Password->text(); |
- | |
1412 | o_Settings->SERVER.IP_MAX = cb_Server->count(); |
- | |
1413 | o_Settings->SERVER.IP_ID = cb_Server->currentIndex(); |
1329 | o_Settings->GUI.Toolbar = ac_Toolbar->isChecked(); |
1414 | - | ||
1415 | for (int z = 0; z < cb_Server->count(); z++) |
- | |
1416 | { |
- | |
1417 | if (z < 10) |
- | |
1418 | { |
- | |
1419 | o_Settings->SERVER.IP[z] = cb_Server->itemText(z); |
- | |
1420 | } |
- | |
1421 | } |
- | |
Line 1422... | Line 1330... | ||
1422 | 1330 | ||
1423 | o_Settings->write_Settings(); |
1331 | o_Settings->write_Settings(); |
1424 | // qDebug("Ende."); |
1332 | // qDebug("Ende."); |