Rev 750 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 750 | Rev 801 | ||
---|---|---|---|
Line 223... | Line 223... | ||
223 | } |
223 | } |
224 | } |
224 | } |
Line 225... | Line 225... | ||
225 | 225 | ||
226 | void dlg_Main::slot_MK_ReadSettings(s_MK_Settings ps_MK_Settings) |
226 | void dlg_Main::slot_MK_ReadSettings(s_MK_Settings ps_MK_Settings) |
227 | { |
227 | { |
228 | if (ps_MK_Settings.Version == MK_VERSION_SETTINGS) |
228 | if (ps_MK_Settings.Revision == MK_VERSION_SETTINGS) |
229 | { |
229 | { |
230 | show_MK_Settings(ps_MK_Settings); |
230 | show_MK_Settings(ps_MK_Settings); |
231 | } |
231 | } |
232 | else |
232 | else |
Line 376... | Line 376... | ||
376 | 376 | ||
Line 377... | Line 377... | ||
377 | QSettings Setting(Filename, QSettings::IniFormat); |
377 | QSettings Setting(Filename, QSettings::IniFormat); |
378 | 378 | ||
379 | Setting.beginGroup("Setup"); |
379 | Setting.beginGroup("Setup"); |
380 | Setting.setValue("Name", le_SetName->text()); |
380 | Setting.setValue("Name", le_SetName->text()); |
381 | Setting.setValue("IniVersion", 3); |
381 | Setting.setValue("IniVersion", 4); |
382 | Setting.setValue("GlobalConfig", t_Set.GlobalConfig); |
382 | Setting.setValue("GlobalConfig", t_Set.GlobalConfig); |
Line 383... | Line 383... | ||
383 | Setting.setValue("GlobalConfig2", t_Set.ExtraConfig); |
383 | Setting.setValue("GlobalConfig2", t_Set.ExtraConfig); |
Line 426... | Line 426... | ||
426 | Setting.setValue("Gier_I", t_Set.Gyro_Gier_I); |
426 | Setting.setValue("Gier_I", t_Set.Gyro_Gier_I); |
427 | Setting.setValue("DynamicStability", t_Set.DynamicStability); |
427 | Setting.setValue("DynamicStability", t_Set.DynamicStability); |
428 | Setting.setValue("ACC_Gyro-Factor", t_Set.GyroAccFaktor); |
428 | Setting.setValue("ACC_Gyro-Factor", t_Set.GyroAccFaktor); |
429 | Setting.setValue("ACC_Gyro-Compensation", t_Set.GyroAccAbgleich); |
429 | Setting.setValue("ACC_Gyro-Compensation", t_Set.GyroAccAbgleich); |
430 | Setting.setValue("DriftCompensation", t_Set.Driftkomp); |
430 | Setting.setValue("DriftCompensation", t_Set.Driftkomp); |
- | 431 | Setting.setValue("Stability", t_Set.Gyro_Stability); |
|
431 | Setting.setValue("Main-I", t_Set.I_Faktor); |
432 | Setting.setValue("Main-I", t_Set.I_Faktor); |
432 | Setting.endGroup(); |
433 | Setting.endGroup(); |
Line 433... | Line 434... | ||
433 | 434 | ||
434 | Setting.beginGroup("Camera"); |
435 | Setting.beginGroup("Camera"); |
Line 449... | Line 450... | ||
449 | Setting.setValue("Servo4", t_Set.Servo4); |
450 | Setting.setValue("Servo4", t_Set.Servo4); |
450 | Setting.setValue("Servo5", t_Set.Servo5); |
451 | Setting.setValue("Servo5", t_Set.Servo5); |
451 | Setting.endGroup(); |
452 | Setting.endGroup(); |
Line 452... | Line 453... | ||
452 | 453 | ||
453 | Setting.beginGroup("Others"); |
454 | Setting.beginGroup("Others"); |
454 | Setting.setValue("MinGas", t_Set.Gas_Min); |
455 | Setting.setValue("MinGas", t_Set.Gas_Min); |
455 | Setting.setValue("MaxGas", t_Set.Gas_Max); |
456 | Setting.setValue("MaxGas", t_Set.Gas_Max); |
456 | Setting.setValue("Compass-Effect", t_Set.KompassWirkung); |
457 | Setting.setValue("Compass-Effect", t_Set.KompassWirkung); |
457 | Setting.setValue("UnderVoltage", t_Set.UnterspannungsWarnung); |
458 | Setting.setValue("UnderVoltage", t_Set.UnterspannungsWarnung); |
458 | Setting.setValue("NotGas", t_Set.NotGas); |
459 | Setting.setValue("NotGas", t_Set.NotGas); |
- | 460 | Setting.setValue("NotGasTime", t_Set.NotGasZeit); |
|
- | 461 | Setting.setValue("Orientation", t_Set.OrientationAngle); |
|
459 | Setting.setValue("NotGasTime", t_Set.NotGasZeit); |
462 | Setting.setValue("CarefreeControl", t_Set.OrientationModeControl); |
Line 460... | Line 463... | ||
460 | Setting.endGroup(); |
463 | Setting.endGroup(); |
461 | 464 | ||
462 | Setting.beginGroup("Coupling"); |
465 | Setting.beginGroup("Coupling"); |
Line 579... | Line 582... | ||
579 | t_Set.Gyro_Gier_I = Setting.value("Gier_I", 120).toInt(); |
582 | t_Set.Gyro_Gier_I = Setting.value("Gier_I", 120).toInt(); |
580 | t_Set.DynamicStability = Setting.value("DynamicStability", 75).toInt(); |
583 | t_Set.DynamicStability = Setting.value("DynamicStability", 75).toInt(); |
581 | t_Set.GyroAccFaktor = Setting.value("ACC_Gyro-Factor", 30).toInt(); |
584 | t_Set.GyroAccFaktor = Setting.value("ACC_Gyro-Factor", 30).toInt(); |
582 | t_Set.GyroAccAbgleich = Setting.value("ACC_Gyro-Compensation", 32).toInt(); |
585 | t_Set.GyroAccAbgleich = Setting.value("ACC_Gyro-Compensation", 32).toInt(); |
583 | t_Set.Driftkomp = Setting.value("DriftCompensation", 32).toInt(); |
586 | t_Set.Driftkomp = Setting.value("DriftCompensation", 32).toInt(); |
- | 587 | t_Set.Gyro_Stability = Setting.value("Stability", 4).toInt(); |
|
584 | t_Set.I_Faktor = Setting.value("Main-I", 32).toInt(); |
588 | t_Set.I_Faktor = Setting.value("Main-I", 32).toInt(); |
585 | Setting.endGroup(); |
589 | Setting.endGroup(); |
Line 586... | Line 590... | ||
586 | 590 | ||
587 | Setting.beginGroup("Camera"); |
591 | Setting.beginGroup("Camera"); |
Line 602... | Line 606... | ||
602 | t_Set.Servo4 = Setting.value("Servo4", 0).toInt(); |
606 | t_Set.Servo4 = Setting.value("Servo4", 0).toInt(); |
603 | t_Set.Servo5 = Setting.value("Servo5", 0).toInt(); |
607 | t_Set.Servo5 = Setting.value("Servo5", 0).toInt(); |
604 | Setting.endGroup(); |
608 | Setting.endGroup(); |
Line 605... | Line 609... | ||
605 | 609 | ||
606 | Setting.beginGroup("Others"); |
610 | Setting.beginGroup("Others"); |
607 | t_Set.Gas_Min = Setting.value("MinGas", 8).toInt(); |
611 | t_Set.Gas_Min = Setting.value("MinGas", 8).toInt(); |
608 | t_Set.Gas_Max = Setting.value("MaxGas", 230).toInt(); |
612 | t_Set.Gas_Max = Setting.value("MaxGas", 230).toInt(); |
609 | t_Set.KompassWirkung = Setting.value("Compass-Effect", 128).toInt(); |
613 | t_Set.KompassWirkung = Setting.value("Compass-Effect", 128).toInt(); |
610 | t_Set.UnterspannungsWarnung = Setting.value("UnderVoltage", 99).toInt(); |
614 | t_Set.UnterspannungsWarnung = Setting.value("UnderVoltage", 99).toInt(); |
611 | t_Set.NotGas = Setting.value("NotGas", 35).toInt(); |
615 | t_Set.NotGas = Setting.value("NotGas", 35).toInt(); |
- | 616 | t_Set.NotGasZeit = Setting.value("NotGasTime", 30).toInt(); |
|
- | 617 | ||
- | 618 | t_Set.OrientationAngle = Setting.value("Orientation", 0).toInt(); |
|
612 | t_Set.NotGasZeit = Setting.value("NotGasTime", 30).toInt(); |
619 | t_Set.OrientationModeControl = Setting.value("CarefreeControl", 252).toInt(); |
Line 613... | Line 620... | ||
613 | Setting.endGroup(); |
620 | Setting.endGroup(); |
614 | 621 | ||
615 | Setting.beginGroup("Coupling"); |
622 | Setting.beginGroup("Coupling"); |
Line 668... | Line 675... | ||
668 | 675 | ||
669 | show_MK_Settings(t_Set); |
676 | show_MK_Settings(t_Set); |
670 | } |
677 | } |
Line 671... | Line 678... | ||
671 | } |
678 | } |
672 | 679 | ||
673 | void dlg_Main::show_MK_Settings(s_MK_Settings t_Set) // DONE 0.75i |
680 | void dlg_Main::show_MK_Settings(s_MK_Settings t_Set) // DONE 0.80g |
Line 674... | Line 681... | ||
674 | { |
681 | { |
- | 682 | sb_Set->setValue(int(t_Set.Index)); |
|
- | 683 | ||
- | 684 | le_SetName->setText(QString(t_Set.Name)); |
|
675 | sb_Set->setValue(int(t_Set.Index)); |
685 | |
676 | 686 | sb_0_1->setValue(t_Set.OrientationAngle); |
|
677 | le_SetName->setText(QString(t_Set.Name)); |
687 | |
678 | // Seite 1 |
688 | // Seite 1 |
679 | { |
689 | { |
Line 745... | Line 755... | ||
745 | sb_5_5->setValue(t_Set.GyroAccAbgleich); |
755 | sb_5_5->setValue(t_Set.GyroAccAbgleich); |
746 | cb_5_6 = setCombo(cb_5_6, t_Set.I_Faktor); |
756 | cb_5_6 = setCombo(cb_5_6, t_Set.I_Faktor); |
747 | sb_5_7->setValue(t_Set.Driftkomp); |
757 | sb_5_7->setValue(t_Set.Driftkomp); |
748 | cb_5_9 = setCombo(cb_5_9, t_Set.Gyro_Gier_P); |
758 | cb_5_9 = setCombo(cb_5_9, t_Set.Gyro_Gier_P); |
749 | cb_5_10 = setCombo(cb_5_10, t_Set.Gyro_Gier_I); |
759 | cb_5_10 = setCombo(cb_5_10, t_Set.Gyro_Gier_I); |
- | 760 | cb_5_11 = setCombo(cb_5_11, t_Set.Gyro_Stability); |
|
750 | } |
761 | } |
751 | // Seite 6 |
762 | // Seite 6 |
752 | { |
763 | { |
753 | cb_6_1 = setCombo(cb_6_1, t_Set.ServoNickControl); |
764 | cb_6_1 = setCombo(cb_6_1, t_Set.ServoNickControl); |
754 | sb_6_2->setValue(t_Set.ServoNickComp); |
765 | sb_6_2->setValue(t_Set.ServoNickComp); |
Line 776... | Line 787... | ||
776 | sb_7_2->setValue(t_Set.Gas_Max); |
787 | sb_7_2->setValue(t_Set.Gas_Max); |
777 | cb_7_3 = setCombo(cb_7_3, t_Set.KompassWirkung); |
788 | cb_7_3 = setCombo(cb_7_3, t_Set.KompassWirkung); |
778 | sb_7_4->setValue(t_Set.UnterspannungsWarnung); |
789 | sb_7_4->setValue(t_Set.UnterspannungsWarnung); |
779 | sb_7_5->setValue(t_Set.NotGasZeit); |
790 | sb_7_5->setValue(t_Set.NotGasZeit); |
780 | sb_7_6->setValue(t_Set.NotGas); |
791 | sb_7_6->setValue(t_Set.NotGas); |
- | 792 | cb_7_7 = setCombo(cb_7_7, t_Set.OrientationModeControl); |
|
- | 793 | ||
781 | } |
794 | } |
782 | // Seite 8 |
795 | // Seite 8 |
783 | { |
796 | { |
784 | cb_8_1 = setCombo(cb_8_1, t_Set.AchsKopplung1); |
797 | cb_8_1 = setCombo(cb_8_1, t_Set.AchsKopplung1); |
785 | cb_8_2 = setCombo(cb_8_2, t_Set.AchsKopplung2); |
798 | cb_8_2 = setCombo(cb_8_2, t_Set.AchsKopplung2); |
Line 897... | Line 910... | ||
897 | { |
910 | { |
898 | s_MK_Settings t_Set; |
911 | s_MK_Settings t_Set; |
Line 899... | Line 912... | ||
899 | 912 | ||
900 | memcpy(t_Set.Name, le_SetName->text().toLatin1().data(), 12); |
913 | memcpy(t_Set.Name, le_SetName->text().toLatin1().data(), 12); |
901 | t_Set.Index = sb_Set->value(); |
914 | t_Set.Index = sb_Set->value(); |
- | 915 | t_Set.Revision = MK_VERSION_SETTINGS; |
|
- | 916 | ||
Line 902... | Line 917... | ||
902 | t_Set.Version = MK_VERSION_SETTINGS; |
917 | t_Set.OrientationAngle = sb_0_1->value(); |
903 | 918 | ||
904 | // Seite 1 |
919 | // Seite 1 |
905 | { |
920 | { |
Line 975... | Line 990... | ||
975 | t_Set.GyroAccAbgleich = sb_5_5->value(); |
990 | t_Set.GyroAccAbgleich = sb_5_5->value(); |
976 | t_Set.I_Faktor = get_Value(cb_5_6); |
991 | t_Set.I_Faktor = get_Value(cb_5_6); |
977 | t_Set.Driftkomp = sb_5_7->value(); |
992 | t_Set.Driftkomp = sb_5_7->value(); |
978 | t_Set.Gyro_Gier_P = get_Value(cb_5_9); |
993 | t_Set.Gyro_Gier_P = get_Value(cb_5_9); |
979 | t_Set.Gyro_Gier_I = get_Value(cb_5_10); |
994 | t_Set.Gyro_Gier_I = get_Value(cb_5_10); |
- | 995 | t_Set.Gyro_Stability = get_Value(cb_5_11); |
|
980 | } |
996 | } |
981 | // Seite 6 |
997 | // Seite 6 |
982 | { |
998 | { |
983 | t_Set.ServoNickControl = get_Value(cb_6_1); |
999 | t_Set.ServoNickControl = get_Value(cb_6_1); |
984 | t_Set.ServoNickComp = sb_6_2->value(); |
1000 | t_Set.ServoNickComp = sb_6_2->value(); |
Line 1001... | Line 1017... | ||
1001 | if (cb_6_9->isChecked()) |
1017 | if (cb_6_9->isChecked()) |
1002 | t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x02; |
1018 | t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x02; |
1003 | } |
1019 | } |
1004 | // Seite 7 |
1020 | // Seite 7 |
1005 | { |
1021 | { |
1006 | t_Set.Gas_Min = sb_7_1->value(); |
1022 | t_Set.Gas_Min = sb_7_1->value(); |
1007 | t_Set.Gas_Max = sb_7_2->value(); |
1023 | t_Set.Gas_Max = sb_7_2->value(); |
1008 | t_Set.KompassWirkung = get_Value(cb_7_3); |
1024 | t_Set.KompassWirkung = get_Value(cb_7_3); |
1009 | t_Set.UnterspannungsWarnung = sb_7_4->value(); |
1025 | t_Set.UnterspannungsWarnung = sb_7_4->value(); |
1010 | t_Set.NotGasZeit = sb_7_5->value(); |
1026 | t_Set.NotGasZeit = sb_7_5->value(); |
1011 | t_Set.NotGas = sb_7_6->value(); |
1027 | t_Set.NotGas = sb_7_6->value(); |
- | 1028 | t_Set.OrientationModeControl = get_Value(cb_7_7); |
|
1012 | } |
1029 | } |
1013 | // Seite 8 |
1030 | // Seite 8 |
1014 | { |
1031 | { |
1015 | t_Set.AchsKopplung1 = get_Value(cb_8_1); |
1032 | t_Set.AchsKopplung1 = get_Value(cb_8_1); |
1016 | t_Set.AchsKopplung2 = get_Value(cb_8_2); |
1033 | t_Set.AchsKopplung2 = get_Value(cb_8_2); |