20,7 → 20,7 |
#include <QSettings> |
|
#include "wdg_Settings.h" |
#include "../ToolBox.h" |
#include "../Classes/ToolBox.h" |
|
wdg_Settings::wdg_Settings(QWidget *parent) : QWidget(parent) |
{ |
59,6 → 59,11 |
connect(sb_11_3, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17(int))); |
} |
|
void wdg_Settings::set_Config(cSettings *pConfig) |
{ |
Config = pConfig; |
} |
|
void wdg_Settings::set_LED(QToolButton *ToolButton, bool On) |
{ |
if (ToolButton->text() == QString("0") && On) |
232,12 → 237,12 |
{ |
if (tb_9_6->text() == QString("0")) |
{ |
tb_9_6->setIcon(ToolBox::Icon(20)); |
// tb_9_6->setIcon(ToolBox::Icon(20)); |
tb_9_6->setText("1"); |
} |
else |
{ |
tb_9_6->setIcon(ToolBox::Icon(21)); |
// tb_9_6->setIcon(ToolBox::Icon(21)); |
tb_9_6->setText("0"); |
} |
} |
246,12 → 251,12 |
{ |
if (tb_9_7->text() == QString("0")) |
{ |
tb_9_7->setIcon(ToolBox::Icon(22)); |
// tb_9_7->setIcon(ToolBox::Icon(22)); |
tb_9_7->setText("1"); |
} |
else |
{ |
tb_9_7->setIcon(ToolBox::Icon(23)); |
// tb_9_7->setIcon(ToolBox::Icon(23)); |
tb_9_7->setText("0"); |
} |
} |
260,12 → 265,12 |
{ |
if (tb_9_8->text() == QString("0")) |
{ |
tb_9_8->setIcon(ToolBox::Icon(24)); |
// tb_9_8->setIcon(ToolBox::Icon(24)); |
tb_9_8->setText("1"); |
} |
else |
{ |
tb_9_8->setIcon(ToolBox::Icon(25)); |
// tb_9_8->setIcon(ToolBox::Icon(25)); |
tb_9_8->setText("0"); |
} |
} |
274,12 → 279,12 |
{ |
if (tb_9_9->text() == QString("0")) |
{ |
tb_9_9->setIcon(ToolBox::Icon(26)); |
// tb_9_9->setIcon(ToolBox::Icon(26)); |
tb_9_9->setText("1"); |
} |
else |
{ |
tb_9_9->setIcon(ToolBox::Icon(27)); |
// tb_9_9->setIcon(ToolBox::Icon(27)); |
tb_9_9->setText("0"); |
} |
} |
286,7 → 291,7 |
|
void wdg_Settings::slot_LoadParameter() // DONE 0.71g |
{ |
QString Filename = QFileDialog::getOpenFileName(this, "Mikrokopter Parameter laden", /*Settings->DIR.Parameter*/ "", "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
QString Filename = QFileDialog::getOpenFileName(this, "Mikrokopter Parameter laden", Config->DIR.Parameter + "", "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
|
if (!Filename.isEmpty()) |
{ |
572,12 → 577,11 |
ParameterSet[Set][P_NAV_ANGLE_LIMIT] = get_Value(cb_13_4); |
} |
|
|
void wdg_Settings::slot_SaveParameter() // DONE 0.71g |
{ |
int Set = sb_Set->value() + 5; |
|
QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter Parameter speichern", /*Settings->DIR.Parameter*/ "" + le_SetName->text(), "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter Parameter speichern", Config->DIR.Parameter + "" + le_SetName->text(), "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)"); |
|
if (!Filename.isEmpty()) |
{ |
751,6 → 755,7 |
} |
le_SetName->setText(QString(Name)); |
|
|
// Seite 1 |
{ |
cb_1_1->setChecked(FCSettings[P_GLOBAL_CONF] & 0x01); |
827,45 → 832,39 |
{ |
if (FCSettings[P_LOOP_CONFIG] & 0x01) |
{ |
tb_9_6->setIcon(ToolBox::Icon(20)); |
tb_9_6->setText("1"); |
tb_9_6->setChecked(true); |
} |
else |
{ |
tb_9_6->setIcon(ToolBox::Icon(21)); |
tb_9_6->setText("0"); |
tb_9_6->setChecked(false); |
} |
|
if (FCSettings[P_LOOP_CONFIG] & 0x02) |
{ |
tb_9_7->setIcon(ToolBox::Icon(22)); |
tb_9_7->setText("1"); |
} |
else |
{ |
tb_9_7->setIcon(ToolBox::Icon(23)); |
tb_9_7->setText("0"); |
} |
|
if (FCSettings[P_LOOP_CONFIG] & 0x04) |
{ |
tb_9_8->setIcon(ToolBox::Icon(24)); |
tb_9_8->setText("1"); |
} |
else |
{ |
tb_9_8->setIcon(ToolBox::Icon(25)); |
tb_9_8->setText("0"); |
} |
|
if (FCSettings[P_LOOP_CONFIG] & 0x08) |
{ |
tb_9_9->setIcon(ToolBox::Icon(26)); |
tb_9_9->setText("1"); |
} |
else |
{ |
tb_9_9->setIcon(ToolBox::Icon(27)); |
tb_9_9->setText("0"); |
} |
|