Merge branch 'next'
This commit is contained in:
@@ -329,8 +329,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(-125);
|
||||
fswtchParam[i]->setMaximum(125);
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
fswtchParam[i]->setMinimum(-500);
|
||||
fswtchParam[i]->setMaximum(500);
|
||||
}
|
||||
else {
|
||||
fswtchParam[i]->setMinimum(-125);
|
||||
fswtchParam[i]->setMaximum(125);
|
||||
}
|
||||
fswtchParam[i]->setValue(model.funcSw[i].param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
|
||||
ui->sideCB->setCurrentIndex(ed->mode-1);
|
||||
|
||||
if (!firmware->getCapability(FlightPhases)) {
|
||||
if (!firmware->getCapability(FlightModes)) {
|
||||
ui->label_phases->hide();
|
||||
for (int i=0; i<9; i++) {
|
||||
lb_fp[i]->hide();
|
||||
@@ -44,7 +44,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
for (int i=firmware->getCapability(FlightPhases); i<9;i++) {
|
||||
for (int i=firmware->getCapability(FlightModes); i<9;i++) {
|
||||
lb_fp[i]->hide();
|
||||
cb_fp[i]->hide();
|
||||
}
|
||||
@@ -154,11 +154,11 @@ void ExpoDialog::valuesChanged()
|
||||
ed->phases<<=1;
|
||||
}
|
||||
ed->phases>>=1;
|
||||
if (firmware->getCapability(FlightPhases)) {
|
||||
if (firmware->getCapability(FlightModes)) {
|
||||
int zeros=0;
|
||||
int ones=0;
|
||||
int phtemp=ed->phases;
|
||||
for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
|
||||
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
|
||||
if (phtemp & 1) {
|
||||
ones++;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ void ExpoDialog::valuesChanged()
|
||||
}
|
||||
if (zeros==1) {
|
||||
phtemp=ed->phases;
|
||||
for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
|
||||
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
|
||||
if ((phtemp & 1)==0) {
|
||||
break;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ void ExpoDialog::valuesChanged()
|
||||
}
|
||||
else if (ones==1) {
|
||||
phtemp=ed->phases;
|
||||
for (int i=0; i<firmware->getCapability(FlightPhases); i++) {
|
||||
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
|
||||
if (phtemp & 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
|
||||
FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
ui(new Ui::FlightMode),
|
||||
phaseIdx(phaseIdx),
|
||||
@@ -16,7 +16,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
int modesCount = firmware->getCapability(FlightPhases);
|
||||
int modesCount = firmware->getCapability(FlightModes);
|
||||
|
||||
// Phase name
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
@@ -39,7 +39,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
|
||||
}
|
||||
|
||||
// FadeIn / FadeOut
|
||||
if (firmware->getCapability(FlightPhasesHaveFades)) {
|
||||
if (firmware->getCapability(FlightModesHaveFades)) {
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
int range = firmware->getCapability(SlowRange);
|
||||
ui->fadeIn->setMaximum(float(range)/scale);
|
||||
@@ -174,12 +174,12 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
|
||||
update();
|
||||
}
|
||||
|
||||
FlightMode::~FlightMode()
|
||||
FlightModePanel::~FlightModePanel()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FlightMode::update()
|
||||
void FlightModePanel::update()
|
||||
{
|
||||
ui->name->setText(phase.name);
|
||||
|
||||
@@ -232,7 +232,7 @@ void FlightMode::update()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseName_editingFinished()
|
||||
void FlightModePanel::phaseName_editingFinished()
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender());
|
||||
strcpy(phase.name, lineEdit->text().toAscii());
|
||||
@@ -240,14 +240,14 @@ void FlightMode::phaseName_editingFinished()
|
||||
emit nameModified();
|
||||
}
|
||||
|
||||
void FlightMode::phaseSwitch_currentIndexChanged(int index)
|
||||
void FlightModePanel::phaseSwitch_currentIndexChanged(int index)
|
||||
{
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
phase.swtch = RawSwitch(comboBox->itemData(index).toInt());
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void FlightMode::phaseFadeIn_editingFinished()
|
||||
void FlightModePanel::phaseFadeIn_editingFinished()
|
||||
{
|
||||
QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
@@ -255,7 +255,7 @@ void FlightMode::phaseFadeIn_editingFinished()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void FlightMode::phaseFadeOut_editingFinished()
|
||||
void FlightModePanel::phaseFadeOut_editingFinished()
|
||||
{
|
||||
QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
@@ -263,7 +263,7 @@ void FlightMode::phaseFadeOut_editingFinished()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void FlightMode::trimUpdate(unsigned int trim)
|
||||
void FlightModePanel::trimUpdate(unsigned int trim)
|
||||
{
|
||||
lock = true;
|
||||
int chn = CONVERT_MODE(trim+1)-1;
|
||||
@@ -283,7 +283,7 @@ void FlightMode::trimUpdate(unsigned int trim)
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void FlightMode::phaseGVValue_editingFinished()
|
||||
void FlightModePanel::phaseGVValue_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
QSpinBox *spinBox = qobject_cast<QSpinBox*>(sender());
|
||||
@@ -293,7 +293,7 @@ void FlightMode::phaseGVValue_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::GVName_editingFinished()
|
||||
void FlightModePanel::GVName_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
QLineEdit *lineedit = qobject_cast<QLineEdit*>(sender());
|
||||
@@ -304,7 +304,7 @@ void FlightMode::GVName_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::GVSource_currentIndexChanged(int index)
|
||||
void FlightModePanel::GVSource_currentIndexChanged(int index)
|
||||
{
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
int gvar = comboBox->property("index").toInt();
|
||||
@@ -312,7 +312,7 @@ void FlightMode::GVSource_currentIndexChanged(int index)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void FlightMode::phaseGVUse_currentIndexChanged(int index)
|
||||
void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
@@ -330,14 +330,14 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseGVPopupToggled(bool checked)
|
||||
void FlightModePanel::phaseGVPopupToggled(bool checked)
|
||||
{
|
||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||
int gvar = cb->property("index").toInt();
|
||||
model.gvars_popups[gvar] = checked;
|
||||
}
|
||||
|
||||
void FlightMode::phaseREValue_editingFinished()
|
||||
void FlightModePanel::phaseREValue_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
QSpinBox *spinBox = qobject_cast<QSpinBox*>(sender());
|
||||
@@ -347,7 +347,7 @@ void FlightMode::phaseREValue_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseREUse_currentIndexChanged(int index)
|
||||
void FlightModePanel::phaseREUse_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
@@ -365,7 +365,7 @@ void FlightMode::phaseREUse_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseTrimUse_currentIndexChanged(int index)
|
||||
void FlightModePanel::phaseTrimUse_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
@@ -387,7 +387,7 @@ void FlightMode::phaseTrimUse_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseTrim_valueChanged()
|
||||
void FlightModePanel::phaseTrim_valueChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
QSpinBox *spinBox = qobject_cast<QSpinBox*>(sender());
|
||||
@@ -402,7 +402,7 @@ void FlightMode::phaseTrim_valueChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightMode::phaseTrimSlider_valueChanged()
|
||||
void FlightModePanel::phaseTrimSlider_valueChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
QSlider *slider = qobject_cast<QSlider*>(sender());
|
||||
@@ -419,14 +419,14 @@ void FlightMode::phaseTrimSlider_valueChanged()
|
||||
|
||||
/**********************************************************/
|
||||
|
||||
FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
FlightModesPanel::FlightModesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
modesCount(firmware->getCapability(FlightPhases))
|
||||
modesCount(firmware->getCapability(FlightModes))
|
||||
{
|
||||
QGridLayout * gridLayout = new QGridLayout(this);
|
||||
tabWidget = new QTabWidget(this);
|
||||
for (int i=0; i<modesCount; i++) {
|
||||
FlightMode *tab = new FlightMode(tabWidget, model, i, generalSettings, firmware);
|
||||
FlightModePanel *tab = new FlightModePanel(tabWidget, model, i, generalSettings, firmware);
|
||||
tab->setProperty("index", i);
|
||||
panels << tab;
|
||||
connect(tab, SIGNAL(modified()), this, SLOT(onPhaseModified()));
|
||||
@@ -437,16 +437,16 @@ FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings &
|
||||
connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(on_tabWidget_currentChanged(int)));
|
||||
}
|
||||
|
||||
FlightModes::~FlightModes()
|
||||
FlightModesPanel::~FlightModesPanel()
|
||||
{
|
||||
}
|
||||
|
||||
void FlightModes::onPhaseModified()
|
||||
void FlightModesPanel::onPhaseModified()
|
||||
{
|
||||
emit modified();
|
||||
}
|
||||
|
||||
QString FlightModes::getTabName(int index)
|
||||
QString FlightModesPanel::getTabName(int index)
|
||||
{
|
||||
QString result = tr("Flight Mode %1").arg(index);
|
||||
const char *name = model.phaseData[index].name;
|
||||
@@ -460,18 +460,18 @@ QString FlightModes::getTabName(int index)
|
||||
return result;
|
||||
}
|
||||
|
||||
void FlightModes::onPhaseNameChanged()
|
||||
void FlightModesPanel::onPhaseNameChanged()
|
||||
{
|
||||
int index = sender()->property("index").toInt();
|
||||
tabWidget->setTabText(index, getTabName(index));
|
||||
}
|
||||
|
||||
void FlightModes::update()
|
||||
void FlightModesPanel::update()
|
||||
{
|
||||
on_tabWidget_currentChanged(tabWidget->currentIndex());
|
||||
}
|
||||
|
||||
void FlightModes::on_tabWidget_currentChanged(int index)
|
||||
void FlightModesPanel::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
panels[index]->update();
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace Ui {
|
||||
class FlightMode;
|
||||
}
|
||||
|
||||
class FlightMode : public ModelPanel
|
||||
class FlightModePanel : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlightMode(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~FlightMode();
|
||||
FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~FlightModePanel();
|
||||
|
||||
virtual void update();
|
||||
|
||||
@@ -61,13 +61,13 @@ class FlightMode : public ModelPanel
|
||||
|
||||
};
|
||||
|
||||
class FlightModes : public ModelPanel
|
||||
class FlightModesPanel : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlightModes(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~FlightModes();
|
||||
FlightModesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~FlightModesPanel();
|
||||
|
||||
virtual void update();
|
||||
|
||||
@@ -80,7 +80,7 @@ class FlightModes : public ModelPanel
|
||||
int modesCount;
|
||||
QTabWidget *tabWidget;
|
||||
QString getTabName(int index);
|
||||
QVector<FlightMode *> panels;
|
||||
QVector<FlightModePanel *> panels;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
ui->mixerName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->mixerName->setText(md->name);
|
||||
|
||||
if (!firmware->getCapability(FlightPhases)) {
|
||||
if (!firmware->getCapability(FlightModes)) {
|
||||
ui->label_phases->hide();
|
||||
for (int i=0; i<9; i++) {
|
||||
lb_fp[i]->hide();
|
||||
@@ -70,7 +70,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
for (int i=firmware->getCapability(FlightPhases); i<9;i++) {
|
||||
for (int i=firmware->getCapability(FlightModes); i<9;i++) {
|
||||
lb_fp[i]->hide();
|
||||
cb_fp[i]->hide();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
||||
SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
|
||||
addTab(setupPanel, tr("Setup"));
|
||||
addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli"));
|
||||
addTab(new FlightModes(this, model, generalSettings, firmware), tr("Flight Modes"));
|
||||
addTab(new FlightModesPanel(this, model, generalSettings, firmware), tr("Flight Modes"));
|
||||
addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs"));
|
||||
addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes"));
|
||||
Channels * chnPanel = new Channels(this, model, generalSettings, firmware);
|
||||
|
||||
Reference in New Issue
Block a user