Rev 199 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 199 | Rev 227 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | ***************************************************************************/ |
18 | ***************************************************************************/ |
19 | #include <QFileDialog> |
19 | #include <QFileDialog> |
20 | #include <QSettings> |
20 | #include <QSettings> |
Line 21... | Line 21... | ||
21 | 21 | ||
22 | #include "wdg_Settings.h" |
22 | #include "wdg_Settings.h" |
Line 23... | Line 23... | ||
23 | #include "../ToolBox.h" |
23 | #include "../Classes/ToolBox.h" |
24 | 24 | ||
25 | wdg_Settings::wdg_Settings(QWidget *parent) : QWidget(parent) |
25 | wdg_Settings::wdg_Settings(QWidget *parent) : QWidget(parent) |
Line 57... | Line 57... | ||
57 | 57 | ||
58 | connect(sb_11_1, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED16(int))); |
58 | connect(sb_11_1, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED16(int))); |
59 | connect(sb_11_3, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17(int))); |
59 | connect(sb_11_3, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17(int))); |
Line -... | Line 60... | ||
- | 60 | } |
|
- | 61 | ||
- | 62 | void wdg_Settings::set_Config(cSettings *pConfig) |
|
- | 63 | { |
|
- | 64 | Config = pConfig; |
|
60 | } |
65 | } |
61 | 66 | ||
62 | void wdg_Settings::set_LED(QToolButton *ToolButton, bool On) |
67 | void wdg_Settings::set_LED(QToolButton *ToolButton, bool On) |
63 | { |
68 | { |
64 | if (ToolButton->text() == QString("0") && On) |
69 | if (ToolButton->text() == QString("0") && On) |
Line 230... | Line 235... | ||
230 | 235 | ||
231 | void wdg_Settings::slot_tbUp() |
236 | void wdg_Settings::slot_tbUp() |
232 | { |
237 | { |
233 | if (tb_9_6->text() == QString("0")) |
238 | if (tb_9_6->text() == QString("0")) |
234 | { |
239 | { |
235 | tb_9_6->setIcon(ToolBox::Icon(20)); |
240 | // tb_9_6->setIcon(ToolBox::Icon(20)); |
236 | tb_9_6->setText("1"); |
241 | tb_9_6->setText("1"); |
237 | } |
242 | } |
238 | else |
243 | else |
239 | { |
244 | { |
240 | tb_9_6->setIcon(ToolBox::Icon(21)); |
245 | // tb_9_6->setIcon(ToolBox::Icon(21)); |
241 | tb_9_6->setText("0"); |
246 | tb_9_6->setText("0"); |
242 | } |
247 | } |
Line 243... | Line 248... | ||
243 | } |
248 | } |
244 | 249 | ||
245 | void wdg_Settings::slot_tbDown() |
250 | void wdg_Settings::slot_tbDown() |
246 | { |
251 | { |
247 | if (tb_9_7->text() == QString("0")) |
252 | if (tb_9_7->text() == QString("0")) |
248 | { |
253 | { |
249 | tb_9_7->setIcon(ToolBox::Icon(22)); |
254 | // tb_9_7->setIcon(ToolBox::Icon(22)); |
250 | tb_9_7->setText("1"); |
255 | tb_9_7->setText("1"); |
251 | } |
256 | } |
252 | else |
257 | else |
253 | { |
258 | { |
254 | tb_9_7->setIcon(ToolBox::Icon(23)); |
259 | // tb_9_7->setIcon(ToolBox::Icon(23)); |
255 | tb_9_7->setText("0"); |
260 | tb_9_7->setText("0"); |
Line 256... | Line 261... | ||
256 | } |
261 | } |
257 | } |
262 | } |
258 | 263 | ||
259 | void wdg_Settings::slot_tbLeft() |
264 | void wdg_Settings::slot_tbLeft() |
260 | { |
265 | { |
261 | if (tb_9_8->text() == QString("0")) |
266 | if (tb_9_8->text() == QString("0")) |
262 | { |
267 | { |
263 | tb_9_8->setIcon(ToolBox::Icon(24)); |
268 | // tb_9_8->setIcon(ToolBox::Icon(24)); |
264 | tb_9_8->setText("1"); |
269 | tb_9_8->setText("1"); |
265 | } |
270 | } |
266 | else |
271 | else |
267 | { |
272 | { |
268 | tb_9_8->setIcon(ToolBox::Icon(25)); |
273 | // tb_9_8->setIcon(ToolBox::Icon(25)); |
Line 269... | Line 274... | ||
269 | tb_9_8->setText("0"); |
274 | tb_9_8->setText("0"); |
270 | } |
275 | } |
271 | } |
276 | } |
272 | 277 | ||
273 | void wdg_Settings::slot_tbRight() |
278 | void wdg_Settings::slot_tbRight() |
274 | { |
279 | { |
275 | if (tb_9_9->text() == QString("0")) |
280 | if (tb_9_9->text() == QString("0")) |
276 | { |
281 | { |
277 | tb_9_9->setIcon(ToolBox::Icon(26)); |
282 | // tb_9_9->setIcon(ToolBox::Icon(26)); |
278 | tb_9_9->setText("1"); |
283 | tb_9_9->setText("1"); |
279 | } |
284 | } |
280 | else |
285 | else |
281 | { |
286 | { |
Line 282... | Line 287... | ||
282 | tb_9_9->setIcon(ToolBox::Icon(27)); |
287 | // tb_9_9->setIcon(ToolBox::Icon(27)); |
283 | tb_9_9->setText("0"); |
288 | tb_9_9->setText("0"); |
284 | } |
289 | } |
Line 285... | Line 290... | ||
285 | } |
290 | } |
286 | 291 | ||
287 | void wdg_Settings::slot_LoadParameter() // DONE 0.71g |
292 | void wdg_Settings::slot_LoadParameter() // DONE 0.71g |
288 | { |
293 | { |
Line 570... | Line 575... | ||
570 | ParameterSet[Set][P_NAV_SPEED_COMP] = get_Value(cb_13_2); |
575 | ParameterSet[Set][P_NAV_SPEED_COMP] = get_Value(cb_13_2); |
571 | ParameterSet[Set][P_NAV_RADIUS] = get_Value(cb_13_3); |
576 | ParameterSet[Set][P_NAV_RADIUS] = get_Value(cb_13_3); |
572 | ParameterSet[Set][P_NAV_ANGLE_LIMIT] = get_Value(cb_13_4); |
577 | ParameterSet[Set][P_NAV_ANGLE_LIMIT] = get_Value(cb_13_4); |
573 | } |
578 | } |
Line 574... | Line -... | ||
574 | - | ||
575 | 579 | ||
576 | void wdg_Settings::slot_SaveParameter() // DONE 0.71g |
580 | void wdg_Settings::slot_SaveParameter() // DONE 0.71g |
577 | { |
581 | { |
Line 578... | Line 582... | ||
578 | int Set = sb_Set->value() + 5; |
582 | int Set = sb_Set->value() + 5; |
Line 579... | Line 583... | ||
579 | 583 | ||
580 | QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter Parameter speichern", /*Settings->DIR.Parameter*/ "" + le_SetName->text(), "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
584 | QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter Parameter speichern", Config->DIR.Parameter + "" + le_SetName->text(), "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
581 | 585 | ||
582 | if (!Filename.isEmpty()) |
586 | if (!Filename.isEmpty()) |
Line 749... | Line 753... | ||
749 | { |
753 | { |
750 | Name[a] = FCSettings[P_NAME+a]; |
754 | Name[a] = FCSettings[P_NAME+a]; |
751 | } |
755 | } |
752 | le_SetName->setText(QString(Name)); |
756 | le_SetName->setText(QString(Name)); |
Line -... | Line 757... | ||
- | 757 | ||
753 | 758 | ||
754 | // Seite 1 |
759 | // Seite 1 |
755 | { |
760 | { |
756 | cb_1_1->setChecked(FCSettings[P_GLOBAL_CONF] & 0x01); |
761 | cb_1_1->setChecked(FCSettings[P_GLOBAL_CONF] & 0x01); |
757 | cb_1_2->setChecked(FCSettings[P_GLOBAL_CONF] & 0x02); |
762 | cb_1_2->setChecked(FCSettings[P_GLOBAL_CONF] & 0x02); |
Line 825... | Line 830... | ||
825 | } |
830 | } |
826 | // Seite 9 |
831 | // Seite 9 |
827 | { |
832 | { |
828 | if (FCSettings[P_LOOP_CONFIG] & 0x01) |
833 | if (FCSettings[P_LOOP_CONFIG] & 0x01) |
829 | { |
834 | { |
830 | tb_9_6->setIcon(ToolBox::Icon(20)); |
- | |
831 | tb_9_6->setText("1"); |
835 | tb_9_6->setText("1"); |
- | 836 | tb_9_6->setChecked(true); |
|
832 | } |
837 | } |
833 | else |
838 | else |
834 | { |
839 | { |
835 | tb_9_6->setIcon(ToolBox::Icon(21)); |
- | |
836 | tb_9_6->setText("0"); |
840 | tb_9_6->setText("0"); |
- | 841 | tb_9_6->setChecked(false); |
|
837 | } |
842 | } |
Line 838... | Line 843... | ||
838 | 843 | ||
839 | if (FCSettings[P_LOOP_CONFIG] & 0x02) |
844 | if (FCSettings[P_LOOP_CONFIG] & 0x02) |
840 | { |
- | |
841 | tb_9_7->setIcon(ToolBox::Icon(22)); |
845 | { |
842 | tb_9_7->setText("1"); |
846 | tb_9_7->setText("1"); |
843 | } |
847 | } |
844 | else |
848 | else |
845 | { |
- | |
846 | tb_9_7->setIcon(ToolBox::Icon(23)); |
849 | { |
847 | tb_9_7->setText("0"); |
850 | tb_9_7->setText("0"); |
Line 848... | Line 851... | ||
848 | } |
851 | } |
849 | 852 | ||
850 | if (FCSettings[P_LOOP_CONFIG] & 0x04) |
- | |
851 | { |
853 | if (FCSettings[P_LOOP_CONFIG] & 0x04) |
852 | tb_9_8->setIcon(ToolBox::Icon(24)); |
854 | { |
853 | tb_9_8->setText("1"); |
855 | tb_9_8->setText("1"); |
854 | } |
856 | } |
855 | else |
- | |
856 | { |
857 | else |
857 | tb_9_8->setIcon(ToolBox::Icon(25)); |
858 | { |
Line 858... | Line 859... | ||
858 | tb_9_8->setText("0"); |
859 | tb_9_8->setText("0"); |
859 | } |
860 | } |
860 | - | ||
861 | if (FCSettings[P_LOOP_CONFIG] & 0x08) |
861 | |
862 | { |
862 | if (FCSettings[P_LOOP_CONFIG] & 0x08) |
863 | tb_9_9->setIcon(ToolBox::Icon(26)); |
863 | { |
864 | tb_9_9->setText("1"); |
864 | tb_9_9->setText("1"); |
865 | } |
- | |
866 | else |
865 | } |
867 | { |
866 | else |
Line 868... | Line 867... | ||
868 | tb_9_9->setIcon(ToolBox::Icon(27)); |
867 | { |
869 | tb_9_9->setText("0"); |
868 | tb_9_9->setText("0"); |