mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 04:15:26 +03:00
Support of inputs / mixes from 'next' continued. More duplicated code
removed.
This commit is contained in:
parent
ddd8d137fc
commit
11e83de0d3
15 changed files with 332 additions and 347 deletions
|
@ -305,7 +305,7 @@ void compareDialog::printPhases()
|
|||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getStickStr(i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
|
||||
|
@ -406,7 +406,7 @@ void compareDialog::printPhases()
|
|||
str.append("</b></td><td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"80\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getStickStr(i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model1, i)));
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetEepromInterface()->getCapability(FlightPhases); i++) {
|
||||
|
@ -694,7 +694,7 @@ void compareDialog::printExpos()
|
|||
}
|
||||
}
|
||||
str.append("</table></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getStickStr(i)+"</b></td>");
|
||||
str.append("<td width=\"10%\" align=\"center\" valign=\"middle\"><b>"+getInputStr(*g_model2, i)+"</b></td>");
|
||||
str.append("<td width=\"45%\">");
|
||||
str.append("<table border=0 cellspacing=0 cellpadding=0>");
|
||||
for (int j=0; j<C9X_MAX_EXPOS; j++) {
|
||||
|
|
|
@ -65,6 +65,7 @@ const uint8_t modn12x3[4][4]= {
|
|||
#define C9X_MAX_MODELS 60
|
||||
#define C9X_MAX_PHASES 9
|
||||
#define C9X_MAX_MIXERS 64
|
||||
#define C9X_MAX_INPUTS 32
|
||||
#define C9X_MAX_EXPOS 64
|
||||
#define C9X_MAX_CURVES 32
|
||||
#define C9X_MAX_POINTS 17
|
||||
|
@ -847,7 +848,10 @@ class ModelData {
|
|||
PhaseData phaseData[C9X_MAX_PHASES];
|
||||
MixData mixData[C9X_MAX_MIXERS];
|
||||
LimitData limitData[C9X_NUM_CHNOUT];
|
||||
|
||||
char inputNames[C9X_MAX_INPUTS][4+1];
|
||||
ExpoData expoData[C9X_MAX_EXPOS];
|
||||
|
||||
CurveData curves[C9X_MAX_CURVES];
|
||||
CustomSwData customSw[C9X_NUM_CSW];
|
||||
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
|
@ -927,7 +931,6 @@ enum Capability {
|
|||
ChannelsName,
|
||||
ExtraChannels,
|
||||
ExtraInputs,
|
||||
ExtraTrims,
|
||||
ExtendedTrims,
|
||||
HasInputFilter,
|
||||
NumCurves,
|
||||
|
|
|
@ -1962,8 +1962,8 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
|
|||
if (IS_TARANIS(board) && version >= 216) {
|
||||
// TODO ScriptData scriptsData[MAX_SCRIPTS];
|
||||
internalField.Append(new SpareBitsField<720>());
|
||||
// TODO char inputNames[MAX_INPUTS][4];
|
||||
internalField.Append(new SpareBitsField<1024>());
|
||||
for (int i=0; i<32; i++)
|
||||
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -598,8 +598,6 @@ int Open9xInterface::getCapability(const Capability capability)
|
|||
return 1;
|
||||
case ExtendedTrims:
|
||||
return 500;
|
||||
case ExtraTrims:
|
||||
return 1;
|
||||
case Simulation:
|
||||
return 1;
|
||||
case DSM2Indexes:
|
||||
|
@ -696,6 +694,7 @@ int Open9xInterface::getCapability(const Capability capability)
|
|||
case GetThrSwitch:
|
||||
return (IS_TARANIS(board) ? DSW_SF1 : DSW_THR) ;
|
||||
case VirtualInputs:
|
||||
return IS_TARANIS(board) ? 32 : 0;
|
||||
case LuaInputs:
|
||||
case LimitsPer1000:
|
||||
case EnhancedCurves:
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
#define DATE_STR "@DATE@"
|
||||
#define TIME_STR "@TIME@"
|
||||
#define VERS_STR "c9x"
|
||||
#define SVN_STR "@FIRMWARE@-r@G9X_WC_REVISION@"
|
||||
#define VERS_STR "@FIRMWARE@-r@G9X_WC_REVISION@"
|
||||
#define MOD_STR "FH"
|
||||
|
|
|
@ -18,9 +18,21 @@ QString getPhaseName(int val, char * phasename)
|
|||
}
|
||||
}
|
||||
|
||||
QString getStickStr(int index)
|
||||
QString getInputStr(ModelData & model, int index)
|
||||
{
|
||||
return RawSource(SOURCE_TYPE_STICK, index).toString();
|
||||
QString result;
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
result = model.inputNames[index];
|
||||
if (result.isEmpty()) {
|
||||
result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, index).toString();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value)
|
||||
|
@ -63,7 +75,7 @@ void populateTTraceCB(QComboBox *b, int value)
|
|||
}
|
||||
int channels=(IS_ARM(GetEepromInterface()->getBoard()) ? 32 : 16);
|
||||
for (int i=1; i<= channels; i++) {
|
||||
b->addItem(QObject::tr("CH")+QString("%1").arg(i,2,10,QChar('0')));
|
||||
b->addItem(QObject::tr("CH%1").arg(i, 2, 10, QChar('0')));
|
||||
}
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
@ -471,6 +483,78 @@ void populatePhasesCB(QComboBox *b, int value)
|
|||
b->setCurrentIndex(value + GetEepromInterface()->getCapability(FlightPhases));
|
||||
}
|
||||
|
||||
bool gvarsEnabled()
|
||||
{
|
||||
int gvars=0;
|
||||
if (GetEepromInterface()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars=1;
|
||||
}
|
||||
return gvars;
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
|
||||
QObject(),
|
||||
weightGV(weightGV),
|
||||
weightSB(weightSB),
|
||||
weightCB(weightCB),
|
||||
weight(weight),
|
||||
flags(flags),
|
||||
lock(false)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
if (gvarsEnabled()) {
|
||||
populateGVCB(weightCB, weight);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
else {
|
||||
weightGV->hide();
|
||||
if (weight > maxi || weight < -mini) {
|
||||
weight = deflt;
|
||||
}
|
||||
}
|
||||
|
||||
weightSB->setMinimum(mini);
|
||||
weightSB->setMaximum(maxi);
|
||||
|
||||
if (weight>maxi || weight<mini) {
|
||||
weightGV->setChecked(true);
|
||||
weightSB->hide();
|
||||
weightCB->show();
|
||||
}
|
||||
else {
|
||||
weightGV->setChecked(false);
|
||||
weightSB->setValue(weight);
|
||||
weightSB->show();
|
||||
weightCB->hide();
|
||||
}
|
||||
|
||||
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void GVarGroup::gvarCBChanged(int state)
|
||||
{
|
||||
weightCB->setVisible(state);
|
||||
weightSB->setVisible(!state);
|
||||
valuesChanged();
|
||||
}
|
||||
|
||||
void GVarGroup::valuesChanged()
|
||||
{
|
||||
if (weightGV->isChecked())
|
||||
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
|
||||
else
|
||||
weight = weightSB->value();
|
||||
}
|
||||
|
||||
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
|
||||
QObject(),
|
||||
curveTypeCB(curveTypeCB),
|
||||
|
|
|
@ -29,6 +29,26 @@ void populateTTraceCB(QComboBox *b, int value);
|
|||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
||||
|
||||
class GVarGroup : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
void valuesChanged();
|
||||
|
||||
protected:
|
||||
QCheckBox *weightGV;
|
||||
QSpinBox *weightSB;
|
||||
QComboBox *weightCB;
|
||||
int & weight;
|
||||
const unsigned int flags;
|
||||
bool lock;
|
||||
};
|
||||
|
||||
class CurveGroup : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
@ -88,7 +108,7 @@ void populateCSWCB(QComboBox *b, int value);
|
|||
QString getTimerMode(int tm);
|
||||
QString getTimerModeB(int tm);
|
||||
QString getPhaseName(int val, char * phasename=NULL);
|
||||
QString getStickStr(int index);
|
||||
QString getInputStr(ModelData & model, int index);
|
||||
QString getCSWFunc(int val);
|
||||
QString getFuncName(unsigned int val);
|
||||
QString getRepeatString(unsigned int val);
|
||||
|
|
|
@ -254,7 +254,7 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
|||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
cswitchOffset[i]->setVisible(true);
|
||||
populateSourceCB(cswitchSource1[i], source, POPULATE_SOURCES | (GetEepromInterface()->getCapability(ExtraTrims) ? POPULATE_TRIMS : 0) | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource1[i], source, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
cswitchOffset[i]->setDecimals(source.getDecimals(model));
|
||||
cswitchOffset[i]->setSingleStep(source.getStep(model));
|
||||
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].func<CS_FN_VEQUAL) {
|
||||
|
@ -280,8 +280,8 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
|||
cswitchSource2[i]->setVisible(true);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
cswitchOffset[i]->setVisible(false);
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), POPULATE_SOURCES | (GetEepromInterface()->getCapability(ExtraTrims) ? POPULATE_TRIMS : 0) | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), POPULATE_SOURCES | (GetEepromInterface()->getCapability(ExtraTrims) ? POPULATE_TRIMS : 0) | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
break;
|
||||
case CS_FAMILY_TIMERS:
|
||||
cswitchSource1[i]->setVisible(false);
|
||||
|
|
|
@ -3,58 +3,24 @@
|
|||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ExpoDialog),
|
||||
model(model),
|
||||
ed(expoData)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
|
||||
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
|
||||
|
||||
setWindowTitle(tr("DEST -> %1").arg(getStickStr(ed->chn)));
|
||||
setWindowTitle(tr("Edit %1").arg(getInputStr(model, ed->chn)));
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
|
||||
int gvars=0;
|
||||
if (GetEepromInterface()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
} else {
|
||||
gvars=1;
|
||||
}
|
||||
|
||||
if (gvars==0) {
|
||||
ui->weightGV->setDisabled(true);
|
||||
ui->curveGVarCB->hide();
|
||||
if ((ed->curve.type == CurveReference::CURVE_REF_EXPO || ed->curve.type == CurveReference::CURVE_REF_DIFF) && ed->curve.value > 100) {
|
||||
ed->curve.value = 0;
|
||||
}
|
||||
if (ed->weight>100 || ed->weight<-100) {
|
||||
ed->weight = 100;
|
||||
}
|
||||
}
|
||||
|
||||
populateGVCB(ui->weightCB, ed->weight);
|
||||
|
||||
ui->weightSB->setMinimum(0);
|
||||
ui->weightSB->setMaximum(100);
|
||||
if (ed->weight>100 || ed->weight<0) {
|
||||
ui->weightGV->setChecked(true);
|
||||
ui->weightSB->hide();
|
||||
ui->weightCB->show();
|
||||
} else {
|
||||
ui->weightGV->setChecked(false);
|
||||
ui->weightSB->setValue(ed->weight);
|
||||
ui->weightSB->show();
|
||||
ui->weightCB->hide();
|
||||
}
|
||||
gvGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
|
||||
|
||||
populateSwitchCB(ui->switchesCB,ed->swtch);
|
||||
|
||||
// TODO keep this group, same in MixerDialog
|
||||
CurveGroup * curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
|
||||
|
||||
ui->sideCB->setCurrentIndex(ed->mode-1);
|
||||
|
||||
if (!GetEepromInterface()->getCapability(FlightPhases)) {
|
||||
|
@ -63,7 +29,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
|||
lb_fp[i]->hide();
|
||||
cb_fp[i]->hide();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
int mask=1;
|
||||
for (int i=0; i<9 ; i++) {
|
||||
if ((ed->phases & mask)==0) {
|
||||
|
@ -80,8 +47,13 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
|||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
ui->sideLabel->hide();
|
||||
ui->sideCB->hide();
|
||||
ui->inputName->setMaxLength(4);
|
||||
populateSourceCB(ui->sourceCB, ed->srcRaw, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0));
|
||||
ui->sourceCB->removeItem(0);
|
||||
}
|
||||
else {
|
||||
ui->inputNameLabel->hide();
|
||||
ui->inputName->hide();
|
||||
ui->sourceLabel->hide();
|
||||
ui->sourceCB->hide();
|
||||
ui->scaleLabel->hide();
|
||||
|
@ -90,30 +62,27 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
|||
ui->trimCB->hide();
|
||||
}
|
||||
|
||||
int expolength=GetEepromInterface()->getCapability(HasExpoNames);
|
||||
int expolength = GetEepromInterface()->getCapability(HasExpoNames);
|
||||
if (!expolength) {
|
||||
ui->label_name->hide();
|
||||
ui->expoName->hide();
|
||||
} else {
|
||||
ui->expoName->setMaxLength(expolength);
|
||||
ui->lineNameLabel->hide();
|
||||
ui->lineName->hide();
|
||||
}
|
||||
else {
|
||||
ui->lineName->setMaxLength(expolength);
|
||||
}
|
||||
|
||||
ui->expoName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->expoName->setText(ed->name);
|
||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->inputName->setText(model.inputNames[ed->chn]);
|
||||
|
||||
ui->lineName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->lineName->setText(ed->name);
|
||||
|
||||
valuesChanged();
|
||||
|
||||
connect(ui->expoName,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
|
||||
connect(ui->curveTypeCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->curveGVarCB,SIGNAL(stateChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->curveValueCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->curveValueSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
|
||||
connect(ui->weightCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->lineName,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->sideCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
||||
for (int i=0; i<9; i++) {
|
||||
connect(cb_fp[i],SIGNAL(toggled(bool)),this,SLOT(valuesChanged()));
|
||||
}
|
||||
|
@ -122,6 +91,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
|||
|
||||
ExpoDialog::~ExpoDialog()
|
||||
{
|
||||
delete gvGroup;
|
||||
delete curveGroup;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -137,54 +108,17 @@ void ExpoDialog::changeEvent(QEvent *e)
|
|||
}
|
||||
}
|
||||
|
||||
void ExpoDialog::widgetChanged()
|
||||
{
|
||||
// TODO so many times duplicated :(
|
||||
int gvars=0;
|
||||
if (GetEepromInterface()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
} else {
|
||||
gvars=1;
|
||||
}
|
||||
|
||||
/* TODO if (gvars==1) {
|
||||
if (ui->expoCurveGV->isChecked()) {
|
||||
ui->expoCurveCB->show();
|
||||
ui->expoCurveSB->hide();
|
||||
} else {
|
||||
ui->expoCurveCB->hide();
|
||||
ui->expoCurveSB->show();
|
||||
}
|
||||
if (ui->weightGV->isChecked()) {
|
||||
ui->weightCB->show();
|
||||
ui->weightSB->hide();
|
||||
} else {
|
||||
ui->weightCB->hide();
|
||||
ui->weightSB->show();
|
||||
}
|
||||
} */
|
||||
valuesChanged();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void ExpoDialog::valuesChanged()
|
||||
{
|
||||
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
|
||||
|
||||
if (ui->weightGV->isChecked()) {
|
||||
ed->weight = ui->weightCB->itemData(ui->weightCB->currentIndex()).toInt();
|
||||
} else {
|
||||
ed->weight = ui->weightSB->value();
|
||||
}
|
||||
ed->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
|
||||
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||
int i=0;
|
||||
for (i=0; i<ui->expoName->text().toAscii().length(); i++) {
|
||||
ed->name[i]=ui->expoName->text().toAscii().at(i);
|
||||
}
|
||||
ed->name[i]=0;
|
||||
|
||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||
strcpy(model.inputNames[ed->chn], ui->inputName->text().toAscii().data());
|
||||
|
||||
ed->phases=0;
|
||||
for (int i=8; i>=0 ; i--) {
|
||||
if (!cb_fp[i]->checkState()) {
|
||||
|
|
|
@ -4,27 +4,32 @@
|
|||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class GVarGroup;
|
||||
class CurveGroup;
|
||||
|
||||
namespace Ui {
|
||||
class ExpoDialog;
|
||||
}
|
||||
|
||||
class ExpoDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExpoDialog(QWidget *parent, ExpoData *mixdata, int stickMode);
|
||||
public:
|
||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode);
|
||||
~ExpoDialog();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void valuesChanged();
|
||||
void widgetChanged();
|
||||
void shrink();
|
||||
|
||||
private:
|
||||
Ui::ExpoDialog *ui;
|
||||
ExpoData *ed;
|
||||
private:
|
||||
Ui::ExpoDialog * ui;
|
||||
ModelData & model;
|
||||
ExpoData * ed;
|
||||
GVarGroup * gvGroup;
|
||||
CurveGroup * curveGroup;
|
||||
};
|
||||
|
||||
#endif // EXPODIALOG_H
|
||||
|
|
|
@ -30,28 +30,35 @@
|
|||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_name">
|
||||
<widget class="QLabel" name="inputNameLabel">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<string>Input name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="expoName">
|
||||
<widget class="QLineEdit" name="inputName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="6" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="weightGV">
|
||||
|
@ -85,14 +92,14 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="8" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
|
@ -249,14 +256,14 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="switchesCB">
|
||||
<property name="whatsThis">
|
||||
<string>Switch used by the expo.
|
||||
|
@ -264,14 +271,14 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="sideLabel">
|
||||
<property name="text">
|
||||
<string>Stick Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="sideCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -290,7 +297,7 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
<item row="13" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -309,7 +316,7 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<item row="12" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -322,14 +329,7 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="scaleSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
|
@ -352,28 +352,21 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="scaleLabel">
|
||||
<property name="text">
|
||||
<string>Scale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="trimLabel">
|
||||
<property name="text">
|
||||
<string>Include Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="trimCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -387,14 +380,14 @@ p, li { white-space: pre-wrap; }
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_curves">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="7" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1,0">
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveTypeCB">
|
||||
|
@ -425,6 +418,27 @@ p, li { white-space: pre-wrap; }
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lineNameLabel">
|
||||
<property name="text">
|
||||
<string>Line name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
|
|
@ -48,6 +48,10 @@ void InputsPanel::update()
|
|||
{
|
||||
lock = true;
|
||||
|
||||
int inputsCount = GetEepromInterface()->getCapability(VirtualInputs);
|
||||
if (inputsCount == 0)
|
||||
inputsCount = NUM_STICKS;
|
||||
|
||||
// curDest -> destination channel
|
||||
// i -> mixer number
|
||||
QByteArray qba;
|
||||
|
@ -58,10 +62,12 @@ void InputsPanel::update()
|
|||
ExpoData *md = &model.expoData[i];
|
||||
|
||||
if (md->mode==0) break;
|
||||
QString str = "";
|
||||
while(curDest<(int)md->chn-1) {
|
||||
|
||||
QString str;
|
||||
|
||||
while (curDest<(int)md->chn-1) {
|
||||
curDest++;
|
||||
str = getStickStr(curDest);
|
||||
str = getInputStr(model, curDest);
|
||||
qba.clear();
|
||||
qba.append((quint8)-curDest-1);
|
||||
QListWidgetItem *itm = new QListWidgetItem(str);
|
||||
|
@ -69,14 +75,21 @@ void InputsPanel::update()
|
|||
ExposlistWidget->addItem(itm);
|
||||
}
|
||||
|
||||
if(curDest!=(int)md->chn) {
|
||||
str = getStickStr(md->chn);
|
||||
if (curDest!=(int)md->chn) {
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||
str = QString("%1").arg(getInputStr(model, md->chn), -8, ' ');
|
||||
else
|
||||
str = getInputStr(model, md->chn);
|
||||
curDest = md->chn;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
str = " ";
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
str += " " + tr("Source(%1)").arg(md->srcRaw.toString());
|
||||
}
|
||||
else {
|
||||
switch (md->mode) {
|
||||
case (1): str += " <-"; break;
|
||||
case (2): str += " ->"; break;
|
||||
|
@ -94,12 +107,10 @@ void InputsPanel::update()
|
|||
if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString());
|
||||
|
||||
if (GetEepromInterface()->getCapability(HasExpoNames)) {
|
||||
QString ExpoName;
|
||||
ExpoName.append(md->name);
|
||||
if (!ExpoName.isEmpty()) {
|
||||
str+=QString("(%1)").arg(ExpoName);
|
||||
}
|
||||
QString expoName = md->name;
|
||||
if (!expoName.isEmpty()) str += QString(" [%1]").arg(expoName);
|
||||
}
|
||||
|
||||
qba.clear();
|
||||
qba.append((quint8)i);
|
||||
qba.append((const char*)md, sizeof(ExpoData));
|
||||
|
@ -108,9 +119,9 @@ void InputsPanel::update()
|
|||
ExposlistWidget->addItem(itm); //(str);
|
||||
}
|
||||
|
||||
while(curDest<NUM_STICKS-1) {
|
||||
while (curDest<inputsCount-1) {
|
||||
curDest++;
|
||||
QString str = getStickStr(curDest);
|
||||
QString str = getInputStr(model, curDest);
|
||||
qba.clear();
|
||||
qba.append((quint8)-curDest-1);
|
||||
QListWidgetItem *itm = new QListWidgetItem(str);
|
||||
|
@ -154,12 +165,13 @@ void InputsPanel::gm_openExpo(int index)
|
|||
emit modified();
|
||||
update();
|
||||
|
||||
ExpoDialog *g = new ExpoDialog(this, &mixd, generalSettings.stickMode);
|
||||
if(g->exec()) {
|
||||
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode);
|
||||
if (g->exec()) {
|
||||
model.expoData[index] = mixd;
|
||||
emit modified();
|
||||
update();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (expoInserted) {
|
||||
gm_deleteExpo(index);
|
||||
}
|
||||
|
|
|
@ -19,76 +19,32 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) :
|
|||
else
|
||||
this->setWindowTitle(tr("DEST -> CH%1%2").arg(md->destCh/10).arg(md->destCh%10));
|
||||
|
||||
populateSourceCB(ui->sourceCB, md->srcRaw, POPULATE_SOURCES | POPULATE_SWITCHES | (GetEepromInterface()->getCapability(ExtraTrims) ? POPULATE_TRIMS : 0) | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0));
|
||||
|
||||
populateSourceCB(ui->sourceCB, md->srcRaw, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0));
|
||||
ui->sourceCB->removeItem(0);
|
||||
int limit=GetEepromInterface()->getCapability(OffsetWeight);
|
||||
int gvars=0;
|
||||
if (GetEepromInterface()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
} else {
|
||||
gvars=1;
|
||||
}
|
||||
if (gvars==0) {
|
||||
ui->offsetGV->setDisabled(true);
|
||||
ui->weightGV->setDisabled(true);
|
||||
if (md->weight>limit || md->weight<-limit) {
|
||||
md->weight=100;
|
||||
}
|
||||
if (md->sOffset>limit || md->sOffset<-limit) {
|
||||
md->sOffset=0;
|
||||
}
|
||||
}
|
||||
populateGVCB(ui->offsetCB,md->sOffset);
|
||||
populateGVCB(ui->weightCB,md->weight);
|
||||
ui->weightSB->setMinimum(-limit);
|
||||
ui->weightSB->setMaximum(limit);
|
||||
if (md->weight>limit || md->weight<-limit) {
|
||||
ui->weightGV->setChecked(true);
|
||||
ui->weightSB->hide();
|
||||
ui->weightCB->show();
|
||||
}
|
||||
else {
|
||||
ui->weightGV->setChecked(false);
|
||||
ui->weightSB->setValue(md->weight);
|
||||
ui->weightSB->show();
|
||||
ui->weightCB->hide();
|
||||
}
|
||||
|
||||
ui->offsetSB->setMinimum(-limit);
|
||||
ui->offsetSB->setMaximum(limit);
|
||||
if (md->sOffset>limit || md->sOffset<-limit) {
|
||||
ui->offsetGV->setChecked(true);
|
||||
ui->offsetSB->hide();
|
||||
ui->offsetCB->show();
|
||||
}
|
||||
else {
|
||||
ui->offsetGV->setChecked(false);
|
||||
ui->offsetSB->setValue(md->sOffset);
|
||||
ui->offsetSB->show();
|
||||
ui->offsetCB->hide();
|
||||
}
|
||||
int limit = GetEepromInterface()->getCapability(OffsetWeight);
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
ui->trimLabel->hide();
|
||||
ui->trimCB->hide();
|
||||
}
|
||||
|
||||
CurveGroup * curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo==0);
|
||||
if (!GetEepromInterface()->getCapability(MixesWithoutExpo)) {
|
||||
ui->MixDR_CB->hide();
|
||||
ui->label_MixDR->hide();
|
||||
}
|
||||
if (GetEepromInterface()->getCapability(ExtraTrims)) {
|
||||
ui->trimCB->addItem(tr("Rud"),1);
|
||||
ui->trimCB->addItem(tr("Ele"),2);
|
||||
ui->trimCB->addItem(tr("Thr"),3);
|
||||
ui->trimCB->addItem(tr("Ail"),4);
|
||||
}
|
||||
|
||||
ui->trimCB->addItem(tr("Rud"), 1);
|
||||
ui->trimCB->addItem(tr("Ele"), 2);
|
||||
ui->trimCB->addItem(tr("Thr"), 3);
|
||||
ui->trimCB->addItem(tr("Ail"), 4);
|
||||
|
||||
ui->trimCB->setCurrentIndex((-md->carryTrim)+1);
|
||||
int namelength=GetEepromInterface()->getCapability(HasMixerNames);
|
||||
if (!namelength) {
|
||||
|
@ -147,12 +103,6 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) :
|
|||
valuesChanged();
|
||||
connect(ui->mixerName,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->weightCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->offsetCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->offsetSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||
connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged())); // TODO why the same slot?
|
||||
connect(ui->offsetGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
||||
connect(ui->trimCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
connect(ui->MixDR_CB,SIGNAL(toggled(bool)),this,SLOT(valuesChanged()));
|
||||
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||
|
@ -169,12 +119,16 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) :
|
|||
|
||||
MixerDialog::~MixerDialog()
|
||||
{
|
||||
delete gvWeightGroup;
|
||||
delete gvOffsetGroup;
|
||||
delete curveGroup;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MixerDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
|
@ -184,41 +138,6 @@ void MixerDialog::changeEvent(QEvent *e)
|
|||
}
|
||||
}
|
||||
|
||||
void MixerDialog::widgetChanged()
|
||||
{
|
||||
int gvars = 0;
|
||||
if (GetEepromInterface()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars = 1;
|
||||
}
|
||||
|
||||
if (gvars == 1) {
|
||||
if (ui->weightGV->isChecked()) {
|
||||
ui->weightCB->show();
|
||||
ui->weightSB->hide();
|
||||
}
|
||||
else {
|
||||
ui->weightCB->hide();
|
||||
ui->weightSB->show();
|
||||
}
|
||||
if (ui->offsetGV->isChecked()) {
|
||||
ui->offsetCB->show();
|
||||
ui->offsetSB->hide();
|
||||
}
|
||||
else {
|
||||
ui->offsetCB->hide();
|
||||
ui->offsetSB->show();
|
||||
}
|
||||
}
|
||||
|
||||
valuesChanged();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void MixerDialog::valuesChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
|
@ -237,16 +156,6 @@ void MixerDialog::valuesChanged()
|
|||
ui->MixDR_CB->setHidden(true);
|
||||
ui->label_MixDR->setHidden(true);
|
||||
}
|
||||
if (ui->weightGV->isChecked()) {
|
||||
md->weight = ui->weightCB->itemData(ui->weightCB->currentIndex()).toInt();
|
||||
} else {
|
||||
md->weight = ui->weightSB->value();
|
||||
}
|
||||
if (ui->offsetGV->isChecked()) {
|
||||
md->sOffset = ui->offsetCB->itemData(ui->offsetCB->currentIndex()).toInt();
|
||||
} else {
|
||||
md->sOffset = ui->offsetSB->value();
|
||||
}
|
||||
md->carryTrim = -(ui->trimCB->currentIndex()-1);
|
||||
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
|
||||
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
|
@ -276,6 +185,7 @@ void MixerDialog::valuesChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void MixerDialog::shrink() {
|
||||
resize(0,0);
|
||||
void MixerDialog::shrink()
|
||||
{
|
||||
resize(0, 0);
|
||||
}
|
||||
|
|
|
@ -4,29 +4,33 @@
|
|||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class GVarGroup;
|
||||
class CurveGroup;
|
||||
|
||||
namespace Ui {
|
||||
class MixerDialog;
|
||||
}
|
||||
|
||||
class MixerDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
public:
|
||||
MixerDialog(QWidget *parent, MixData *mixdata, int stickMode);
|
||||
~MixerDialog();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
void widgetChanged();
|
||||
private slots:
|
||||
void valuesChanged();
|
||||
void shrink();
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
Ui::MixerDialog *ui;
|
||||
MixData *md;
|
||||
bool lock;
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
CurveGroup * curveGroup;
|
||||
};
|
||||
|
||||
#endif // MIXERDIALOG_H
|
||||
|
|
|
@ -176,7 +176,7 @@ QString printDialog::printPhases()
|
|||
str.append("<td rowspan=2 align=\"center\" valign=\"bottom\"><b>"+tr("Switch")+"</b></td></tr><tr><td align=center width=\"90\"><b>"+tr("Flight mode name"));
|
||||
str.append("</b></td><td align=center width=\"30\"><b>"+tr("IN")+"</b></td><td align=center width=\"30\"><b>"+tr("OUT")+"</b></td>");
|
||||
for (int i=0; i<4; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getStickStr(i)));
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>%1</b></td>").arg(getInputStr(*g_model, i)));
|
||||
}
|
||||
if (gvars==1) {
|
||||
for (int i=0; i<gvarnum; i++) {
|
||||
|
@ -241,7 +241,7 @@ void printDialog::printExpo()
|
|||
str.append("<tr><td><font size=+1 face='Courier New'>");
|
||||
if(lastCHN!=ed->chn) {
|
||||
lastCHN=ed->chn;
|
||||
str.append("<b>"+getStickStr(ed->chn)+"</b>");
|
||||
str.append("<b>"+getInputStr(*g_model, ed->chn)+"</b>");
|
||||
}
|
||||
else
|
||||
str.append("<b> </b>");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue