Rev 334 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 334 | Rev 337 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | rb_NC->hide(); |
67 | rb_NC->hide(); |
Line 68... | Line 68... | ||
68 | 68 | ||
69 | // Beta-Sachen einschalten. |
69 | // Beta-Sachen einschalten. |
70 | #ifdef _BETA_ |
70 | #ifdef _BETA_ |
71 | ac_QMKServer->setEnabled(true); |
- | |
72 | #else |
- | |
73 | ac_MotorMixer->setVisible(false); |
71 | ac_QMKServer->setEnabled(true); |
- | 72 | #endif |
|
74 | #endif |
73 | |
75 | // Settings-Tab hinzufügen. |
74 | // Settings-Tab hinzufügen. |
76 | f_Settings = new wdg_Settings( this ); |
75 | f_Settings = new wdg_Settings( this ); |
77 | f_Settings->set_Config(Settings); |
76 | f_Settings->set_Config(Settings); |
78 | tab_Main->insertTab ( 2, f_Settings, ac_View2->icon(), "FC-Settings"); |
77 | tab_Main->insertTab ( 2, f_Settings, ac_View2->icon(), "FC-Settings"); |
Line 478... | Line 477... | ||
478 | msgB.setText(msg); |
477 | msgB.setText(msg); |
479 | msgB.exec(); |
478 | msgB.exec(); |
480 | } |
479 | } |
481 | } |
480 | } |
Line -... | Line 481... | ||
- | 481 | ||
482 | 482 | // Hardware-Auswahl im Menp |
|
483 | void MKTool::slot_ac_Hardware() |
483 | void MKTool::slot_ac_Hardware() |
484 | { |
484 | { |
Line 485... | Line 485... | ||
485 | QAction *Action = (QAction*)sender(); |
485 | QAction *Action = (QAction*)sender(); |
Line 490... | Line 490... | ||
490 | } |
490 | } |
Line 491... | Line 491... | ||
491 | 491 | ||
492 | slot_rb_Hardware(); |
492 | slot_rb_Hardware(); |
Line -... | Line 493... | ||
- | 493 | } |
|
493 | } |
494 | |
494 | 495 | // Hardware Auswahl und umschalten |
|
495 | void MKTool::slot_rb_Hardware() |
496 | void MKTool::slot_rb_Hardware() |
496 | { |
497 | { |
497 | if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC)) |
498 | if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC)) |
Line 544... | Line 545... | ||
544 | { |
545 | { |
545 | if (TickerDiv) |
546 | if (TickerDiv) |
546 | TickerDiv = false; |
547 | TickerDiv = false; |
547 | else |
548 | else |
548 | TickerDiv = true; |
549 | TickerDiv = true; |
549 | 550 | /* |
|
550 | if (cb_ClipBoard->isChecked()) |
551 | if (cb_ClipBoard->isChecked()) |
551 | { |
552 | { |
552 | QString s_OLD = te_KML->toPlainText(); |
553 | QString s_OLD = te_KML->toPlainText(); |
553 | te_KML->clear(); |
554 | te_KML->clear(); |
554 | te_KML->paste(); |
555 | te_KML->paste(); |
555 | if (s_OLD != te_KML->toPlainText()) |
556 | if (s_OLD != te_KML->toPlainText()) |
556 | { |
557 | { |
557 | parse_TargetKML(); |
558 | parse_TargetKML(); |
558 | } |
559 | } |
559 | } |
560 | } |
560 | 561 | */ |
|
561 | for (int a = 0; a < MaxTickerEvents; a++) |
562 | for (int a = 0; a < MaxTickerEvents; a++) |
562 | { |
563 | { |
563 | if (TickerEvent[a] == true) |
564 | if (TickerEvent[a] == true) |
564 | { |
565 | { |
565 | switch(a) |
566 | switch(a) |
566 | { |
567 | { |
567 | case 0 : |
568 | case 0 : |
568 | if (TickerDiv) |
- | |
569 | { |
569 | { |
570 | QByteArray Temp(LastSend.toUtf8()); |
- | |
571 | // serialPort->sendData(Temp); |
- | |
572 | } |
570 | } |
573 | break; |
571 | break; |
574 | case 1 : |
572 | case 1 : |
575 | TX_Data[0] = 0; |
573 | TX_Data[0] = 0; |
576 | o_Connection->send_Cmd('p', ADDRESS_FC, TX_Data, 0, false); |
574 | o_Connection->send_Cmd('p', ADDRESS_FC, TX_Data, 0, false); |
Line 598... | Line 596... | ||
598 | { |
596 | { |
599 | TX_Data[0] = Settings->Data.Debug_Slow / 10; |
597 | TX_Data[0] = Settings->Data.Debug_Slow / 10; |
600 | o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false); |
598 | o_Connection->send_Cmd('d', ADDRESS_ALL, TX_Data, 1, false); |
601 | } |
599 | } |
602 | break; |
600 | break; |
- | 601 | case 4 : |
|
- | 602 | { |
|
- | 603 | for (int z = 0; z<12; z++) |
|
- | 604 | { |
|
- | 605 | TX_Data[z] = Motor.Speed[z]; |
|
- | 606 | } |
|
- | 607 | o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 12, false); |
|
- | 608 | } |
|
- | 609 | ||
603 | } |
610 | } |
604 | } |
611 | } |
605 | } |
612 | } |
606 | } |
613 | } |
Line -... | Line 614... | ||
- | 614 | ||
607 | 615 | // Zum QMK-Datenserver verbinden |
|
608 | void MKTool::slot_QMKS_Connect() |
616 | void MKTool::slot_QMKS_Connect() |
609 | { |
617 | { |
610 | if (ac_QMKServer->isChecked()) |
618 | if (ac_QMKServer->isChecked()) |
611 | { |
619 | { |
Line 628... | Line 636... | ||
628 | ac_QMKServer->setText("QMK-Server Verbinden"); |
636 | ac_QMKServer->setText("QMK-Server Verbinden"); |
629 | } |
637 | } |
630 | } |
638 | } |
631 | } |
639 | } |
Line -... | Line 640... | ||
- | 640 | ||
632 | 641 | // Verbindung zum QMK-Server hergestellt. |
|
633 | void MKTool::slot_QMKS_Connected() |
642 | void MKTool::slot_QMKS_Connected() |
634 | { |
643 | { |
635 | QMK_Server->setProperty("Connect", true); |
644 | QMK_Server->setProperty("Connect", true); |
636 | ac_QMKServer->setText("QMK-Server Trennnen"); |
645 | ac_QMKServer->setText("QMK-Server Trennnen"); |
637 | lb_Status->setText(tr("Verbunden mit QMK-Datenserver.")); |
646 | lb_Status->setText(tr("Verbunden mit QMK-Datenserver.")); |
Line -... | Line 647... | ||
- | 647 | } |
|
638 | } |
648 | |
639 | 649 | // QMK-Serververbindung getrennt |
|
640 | void MKTool::slot_QMKS_Disconnected(int Error) |
650 | void MKTool::slot_QMKS_Disconnected(int Error) |
641 | { |
651 | { |
642 | QMK_Server->setProperty("Connect", false); |
652 | QMK_Server->setProperty("Connect", false); |
Line 677... | Line 687... | ||
677 | ////////////////////////////////////////// |
687 | ////////////////////////////////////////// |
678 | void MKTool::slot_ac_Motortest() |
688 | void MKTool::slot_ac_Motortest() |
679 | { |
689 | { |
680 | dlg_Motortest *f_Motortest = new dlg_Motortest(this); |
690 | dlg_Motortest *f_Motortest = new dlg_Motortest(this); |
Line 681... | Line 691... | ||
681 | 691 | ||
- | 692 | // connect(f_Motortest, SIGNAL(updateMotor(int, int, int, int)), this, SLOT(slot_Motortest(int, int, int, int))); |
|
- | 693 | connect(f_Motortest, SIGNAL(updateMotor(sMotor)), this, SLOT(slot_Motortest(sMotor))); |
|
- | 694 | ||
- | 695 | ||
- | 696 | Ticker->setInterval(500); |
|
Line 682... | Line 697... | ||
682 | connect(f_Motortest, SIGNAL(updateMotor(int, int, int, int)), this, SLOT(slot_Motortest(int, int, int, int))); |
697 | TickerEvent[4] = true; |
683 | 698 | ||
684 | if (f_Motortest->exec()==QDialog::Accepted) |
699 | if (f_Motortest->exec()==QDialog::Accepted) |
Line 685... | Line 700... | ||
685 | { |
700 | { |
- | 701 | } |
|
- | 702 | ||
- | 703 | disconnect(f_Motortest, 0,0,0); |
|
- | 704 | ||
- | 705 | for (int z = 0; z<12; z++) |
|
- | 706 | { |
|
686 | } |
707 | Motor.Speed[z] = 0; |
- | 708 | } |
|
- | 709 | ||
- | 710 | slot_Motortest(Motor); |
|
- | 711 | ||
- | 712 | Ticker->setInterval(2000); |
|
- | 713 | TickerEvent[4] = false; |
|
- | 714 | } |
|
- | 715 | ||
- | 716 | void MKTool::slot_Motortest(sMotor p_Motor) |
|
- | 717 | { |
|
- | 718 | Motor = p_Motor; |
|
- | 719 | ||
- | 720 | for (int z = 0; z<12; z++) |
|
- | 721 | { |
|
687 | 722 | TX_Data[z] = Motor.Speed[z]; |
|
Line -... | Line 723... | ||
- | 723 | } |
|
688 | disconnect(f_Motortest, 0,0,0); |
724 | o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 12, false); |
689 | slot_Motortest(0,0,0,0); |
725 | } |
690 | } |
726 | |
691 | 727 | // Motormixer-Einstellungen anzeigen |
|
Line 692... | Line 728... | ||
692 | void MKTool::slot_ac_MotorMixer() |
728 | void MKTool::slot_ac_MotorMixer() |
693 | { |
729 | { |
694 | f_MotorMixer->set_Objects(o_Connection, Settings); |
730 | f_MotorMixer->set_Objects(o_Connection, Settings); |
695 | f_MotorMixer->read_Mixer(); |
731 | f_MotorMixer->read_Mixer(); |
Line -... | Line 732... | ||
- | 732 | ||
696 | 733 | if (f_MotorMixer->exec()==QDialog::Accepted) |
|
697 | if (f_MotorMixer->exec()==QDialog::Accepted) |
734 | { |
698 | { |
735 | } |
699 | } |
736 | } |
700 | } |
737 | |
Line 718... | Line 755... | ||
718 | Ticker->setInterval(500); |
755 | Ticker->setInterval(500); |
719 | TickerEvent[2] = true; |
756 | TickerEvent[2] = true; |
720 | } |
757 | } |
721 | } |
758 | } |
Line -... | Line 759... | ||
- | 759 | ||
722 | 760 | // Map-Fenster anzeigen |
|
723 | void MKTool::slot_ac_Map() |
761 | void MKTool::slot_ac_Map() |
724 | { |
762 | { |
725 | if (!f_Map->isVisible()) |
763 | if (!f_Map->isVisible()) |
726 | { |
764 | { |
Line 745... | Line 783... | ||
745 | sb_TarTime->setValue(Target.Time); |
783 | sb_TarTime->setValue(Target.Time); |
Line 746... | Line 784... | ||
746 | 784 | ||
747 | slot_pb_SendWaypoint(); |
785 | slot_pb_SendWaypoint(); |
Line 748... | Line -... | ||
748 | } |
- | |
749 | - | ||
750 | void MKTool::slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4) |
- | |
751 | { |
- | |
752 | TX_Data[0] = Motor1; |
- | |
753 | TX_Data[1] = Motor2; |
- | |
754 | TX_Data[2] = Motor3; |
- | |
755 | TX_Data[3] = Motor4; |
- | |
756 | o_Connection->send_Cmd('t', ADDRESS_FC, TX_Data, 4, false); |
- | |
757 | } |
786 | } |
758 | 787 | ||
759 | void MKTool::slot_ac_Config() |
788 | void MKTool::slot_ac_Config() |
Line 760... | Line 789... | ||
760 | { |
789 | { |