mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Corrections on Curves in MixerDialog and ExpoDialog (introduction of
CurveGroup to share code)
This commit is contained in:
parent
0f0db5e1d3
commit
888895b60b
11 changed files with 249 additions and 94 deletions
|
@ -191,6 +191,7 @@ SET( companion9x_MOC_HDRS
|
||||||
myslider.h
|
myslider.h
|
||||||
modelconfigdialog.h
|
modelconfigdialog.h
|
||||||
qcustomplot.h
|
qcustomplot.h
|
||||||
|
helpers.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SET( companion9x_UIS
|
SET( companion9x_UIS
|
||||||
|
|
|
@ -412,7 +412,7 @@ QString RawSwitch::toString()
|
||||||
QString CurveReference::toString()
|
QString CurveReference::toString()
|
||||||
{
|
{
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
return "";
|
return "----";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
|
|
@ -1008,6 +1008,11 @@ enum Capability {
|
||||||
CSFunc,
|
CSFunc,
|
||||||
LCDWidth,
|
LCDWidth,
|
||||||
GetThrSwitch,
|
GetThrSwitch,
|
||||||
|
VirtualInputs,
|
||||||
|
LuaInputs,
|
||||||
|
LimitsPer1000,
|
||||||
|
EnhancedCurves,
|
||||||
|
TelemetryInternalAlarms
|
||||||
};
|
};
|
||||||
|
|
||||||
enum UseContext {
|
enum UseContext {
|
||||||
|
|
|
@ -694,7 +694,13 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||||
case LCDWidth:
|
case LCDWidth:
|
||||||
return (IS_TARANIS(board) ? 212 : 128) ;
|
return (IS_TARANIS(board) ? 212 : 128) ;
|
||||||
case GetThrSwitch:
|
case GetThrSwitch:
|
||||||
return (IS_TARANIS(board) ?DSW_SF1 : DSW_THR) ;
|
return (IS_TARANIS(board) ? DSW_SF1 : DSW_THR) ;
|
||||||
|
case VirtualInputs:
|
||||||
|
case LuaInputs:
|
||||||
|
case LimitsPer1000:
|
||||||
|
case EnhancedCurves:
|
||||||
|
case TelemetryInternalAlarms:
|
||||||
|
return IS_TARANIS(board);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -471,14 +471,35 @@ void populatePhasesCB(QComboBox *b, int value)
|
||||||
b->setCurrentIndex(value + GetEepromInterface()->getCapability(FlightPhases));
|
b->setCurrentIndex(value + GetEepromInterface()->getCapability(FlightPhases));
|
||||||
}
|
}
|
||||||
|
|
||||||
void populateCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags)
|
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
|
||||||
|
QObject(),
|
||||||
|
curveTypeCB(curveTypeCB),
|
||||||
|
curveGVarCB(curveGVarCB),
|
||||||
|
curveValueCB(curveValueCB),
|
||||||
|
curveValueSB(curveValueSB),
|
||||||
|
curve(curve),
|
||||||
|
flags(flags),
|
||||||
|
lock(false),
|
||||||
|
lastType(-1)
|
||||||
{
|
{
|
||||||
if (curveTypeCB->count() == 0) {
|
curveTypeCB->addItem(tr("Diff"));
|
||||||
curveTypeCB->addItem(QObject::tr("Diff"));
|
curveTypeCB->addItem(tr("Expo"));
|
||||||
curveTypeCB->addItem(QObject::tr("Expo"));
|
curveTypeCB->addItem(tr("Func"));
|
||||||
curveTypeCB->addItem(QObject::tr("Func"));
|
curveTypeCB->addItem(tr("Curve"));
|
||||||
curveTypeCB->addItem(QObject::tr("Curve"));
|
|
||||||
}
|
curveValueCB->setMaxVisibleItems(10);
|
||||||
|
|
||||||
|
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||||
|
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||||
|
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||||
|
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CurveGroup::update()
|
||||||
|
{
|
||||||
|
lock = true;
|
||||||
|
|
||||||
curveTypeCB->setCurrentIndex(curve.type);
|
curveTypeCB->setCurrentIndex(curve.type);
|
||||||
|
|
||||||
|
@ -486,7 +507,10 @@ void populateCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QCom
|
||||||
curveGVarCB->show();
|
curveGVarCB->show();
|
||||||
if (curve.value > 100 || curve.value < -100) {
|
if (curve.value > 100 || curve.value < -100) {
|
||||||
curveGVarCB->setChecked(true);
|
curveGVarCB->setChecked(true);
|
||||||
|
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
|
||||||
|
lastType = curve.type;
|
||||||
populateGVCB(curveValueCB, curve.value);
|
populateGVCB(curveValueCB, curve.value);
|
||||||
|
}
|
||||||
curveValueCB->show();
|
curveValueCB->show();
|
||||||
curveValueSB->hide();
|
curveValueSB->hide();
|
||||||
}
|
}
|
||||||
|
@ -503,20 +527,27 @@ void populateCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QCom
|
||||||
curveGVarCB->hide();
|
curveGVarCB->hide();
|
||||||
curveValueSB->hide();
|
curveValueSB->hide();
|
||||||
curveValueCB->show();
|
curveValueCB->show();
|
||||||
curveValueCB->setMaxVisibleItems(10);
|
|
||||||
switch (curve.type) {
|
switch (curve.type) {
|
||||||
case CurveReference::CURVE_REF_FUNC:
|
case CurveReference::CURVE_REF_FUNC:
|
||||||
|
if (lastType != curve.type) {
|
||||||
|
lastType = curve.type;
|
||||||
|
curveValueCB->clear();
|
||||||
for (int i=0; i<=6/*TODO constant*/; i++) {
|
for (int i=0; i<=6/*TODO constant*/; i++) {
|
||||||
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_FUNC, i).toString());
|
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_FUNC, i).toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
curveValueCB->setCurrentIndex(curve.value);
|
curveValueCB->setCurrentIndex(curve.value);
|
||||||
break;
|
break;
|
||||||
case CurveReference::CURVE_REF_CUSTOM:
|
case CurveReference::CURVE_REF_CUSTOM:
|
||||||
{
|
{
|
||||||
int numcurves = GetEepromInterface()->getCapability(NumCurves);
|
int numcurves = GetEepromInterface()->getCapability(NumCurves);
|
||||||
|
if (lastType != curve.type) {
|
||||||
|
lastType = curve.type;
|
||||||
|
curveValueCB->clear();
|
||||||
for (int i=-numcurves; i<numcurves; i++) {
|
for (int i=-numcurves; i<numcurves; i++) {
|
||||||
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
|
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
curveValueCB->setCurrentIndex(curve.value+numcurves);
|
curveValueCB->setCurrentIndex(curve.value+numcurves);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -524,10 +555,27 @@ void populateCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QCom
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void retrieveCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags)
|
void CurveGroup::gvarCBChanged(int state)
|
||||||
{
|
{
|
||||||
|
if (!lock) {
|
||||||
|
if (state) {
|
||||||
|
curve.value = 10000; // TODO constant in EEpromInterface ...
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
curve.value = 0; // TODO could be better
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CurveGroup::valuesChanged()
|
||||||
|
{
|
||||||
|
if (!lock) {
|
||||||
switch (curveTypeCB->currentIndex()) {
|
switch (curveTypeCB->currentIndex()) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -537,7 +585,6 @@ void retrieveCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QCom
|
||||||
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
|
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
|
||||||
else
|
else
|
||||||
value = curveValueSB->value();
|
value = curveValueSB->value();
|
||||||
qDebug() << value;
|
|
||||||
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
|
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -548,7 +595,9 @@ void retrieveCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QCom
|
||||||
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetEepromInterface()->getCapability(NumCurves));
|
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetEepromInterface()->getCapability(NumCurves));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
populateCurveReference(curveTypeCB, curveGVarCB, curveValueCB, curveValueSB, curve, flags);
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void populateTrimUseCB(QComboBox *b, unsigned int phase)
|
void populateTrimUseCB(QComboBox *b, unsigned int phase)
|
||||||
|
@ -831,7 +880,9 @@ void populateGVCB(QComboBox *b, int value)
|
||||||
{
|
{
|
||||||
int selected=0;
|
int selected=0;
|
||||||
int nullitem;
|
int nullitem;
|
||||||
|
|
||||||
b->clear();
|
b->clear();
|
||||||
|
|
||||||
int pgvars = GetEepromInterface()->getCapability(Gvars);
|
int pgvars = GetEepromInterface()->getCapability(Gvars);
|
||||||
for (int i=-pgvars; i<=-1; i++) {
|
for (int i=-pgvars; i<=-1; i++) {
|
||||||
int16_t gval = (int16_t)(-10000+i);
|
int16_t gval = (int16_t)(-10000+i);
|
||||||
|
@ -841,12 +892,15 @@ void populateGVCB(QComboBox *b, int value)
|
||||||
selected=1;
|
selected=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b->addItem("---", 0);
|
b->addItem("---", 0);
|
||||||
|
|
||||||
nullitem=b->count()-1;
|
nullitem=b->count()-1;
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
b->setCurrentIndex(b->count()-1);
|
b->setCurrentIndex(b->count()-1);
|
||||||
selected=1;
|
selected=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=1; i<=pgvars; i++) {
|
for (int i=1; i<=pgvars; i++) {
|
||||||
int16_t gval = (int16_t)(10000+i);
|
int16_t gval = (int16_t)(10000+i);
|
||||||
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
||||||
|
@ -855,6 +909,7 @@ void populateGVCB(QComboBox *b, int value)
|
||||||
selected=1;
|
selected=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected==0)
|
if (selected==0)
|
||||||
b->setCurrentIndex(nullitem);
|
b->setCurrentIndex(nullitem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,29 @@ void populateTTraceCB(QComboBox *b, int value);
|
||||||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||||
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
void populateBacklightCB(QComboBox *b, const uint8_t value);
|
||||||
|
|
||||||
|
class CurveGroup : public QObject {
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
|
||||||
|
void update();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void gvarCBChanged(int);
|
||||||
|
void valuesChanged();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QComboBox *curveTypeCB;
|
||||||
|
QCheckBox *curveGVarCB;
|
||||||
|
QComboBox *curveValueCB;
|
||||||
|
QSpinBox *curveValueSB;
|
||||||
|
CurveReference & curve;
|
||||||
|
unsigned int flags;
|
||||||
|
bool lock;
|
||||||
|
int lastType;
|
||||||
|
};
|
||||||
|
|
||||||
#define POPULATE_ONOFF 0x01
|
#define POPULATE_ONOFF 0x01
|
||||||
#define POPULATE_MSWITCHES 0x02
|
#define POPULATE_MSWITCHES 0x02
|
||||||
#define POPULATE_AND_SWITCHES 0x04
|
#define POPULATE_AND_SWITCHES 0x04
|
||||||
|
@ -42,9 +65,6 @@ void populateFuncParamArmTCB(QComboBox *b, ModelData * g_model, char * value, QS
|
||||||
void populatePhasesCB(QComboBox *b, int value);
|
void populatePhasesCB(QComboBox *b, int value);
|
||||||
void populateTrimUseCB(QComboBox *b, unsigned int phase);
|
void populateTrimUseCB(QComboBox *b, unsigned int phase);
|
||||||
void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||||
void populateCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags);
|
|
||||||
void retrieveCurveReference(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags);
|
|
||||||
void populateCurvesCB(QComboBox *b, int value);
|
|
||||||
void populateCustomScreenFieldCB(QComboBox *b, unsigned int value, bool last, int hubproto);
|
void populateCustomScreenFieldCB(QComboBox *b, unsigned int value, bool last, int hubproto);
|
||||||
void populateTimerSwitchCB(QComboBox *b, int value);
|
void populateTimerSwitchCB(QComboBox *b, int value);
|
||||||
QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model);
|
QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model);
|
||||||
|
|
|
@ -77,10 +77,10 @@ class MyProxyStyle : public QProxyStyle
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Q_INIT_RESOURCE(companion9x);
|
Q_INIT_RESOURCE(companion9x);
|
||||||
QApplication app(argc, argv);
|
QApplication * app = new QApplication(argc, argv);
|
||||||
app.setApplicationName("Companion9x");
|
app->setApplicationName("Companion9x");
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
app.setStyle(new MyProxyStyle);
|
app->setStyle(new MyProxyStyle);
|
||||||
#endif
|
#endif
|
||||||
QString dir;
|
QString dir;
|
||||||
if(argc) dir = QFileInfo(argv[0]).canonicalPath() + "/lang";
|
if(argc) dir = QFileInfo(argv[0]).canonicalPath() + "/lang";
|
||||||
|
@ -95,20 +95,20 @@ int main(int argc, char *argv[])
|
||||||
qtTranslator.load((QString)"qt_" + locale.left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
qtTranslator.load((QString)"qt_" + locale.left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
// qDebug() << locale;
|
// qDebug() << locale;
|
||||||
// qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
// qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
app.installTranslator(&companion9xTranslator);
|
app->installTranslator(&companion9xTranslator);
|
||||||
app.installTranslator(&qtTranslator);
|
app->installTranslator(&qtTranslator);
|
||||||
|
|
||||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||||
|
|
||||||
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
|
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
|
||||||
firmware_id.replace("open9x", "opentx");
|
firmware_id.replace("open9x", "opentx");
|
||||||
firmware_id.replace("x9da", "taranis");
|
firmware_id.replace("x9da", "taranis");
|
||||||
QPixmap pixmap;
|
QPixmap * pixmap;
|
||||||
if (firmware_id.contains("taranis"))
|
if (firmware_id.contains("taranis"))
|
||||||
pixmap = QPixmap(":/images/splasht.png");
|
pixmap = new QPixmap(":/images/splasht.png");
|
||||||
else
|
else
|
||||||
pixmap = QPixmap(":/images/splash.png");
|
pixmap = new QPixmap(":/images/splash.png");
|
||||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
QSplashScreen *splash = new QSplashScreen(*pixmap);
|
||||||
|
|
||||||
RegisterFirmwares();
|
RegisterFirmwares();
|
||||||
|
|
||||||
|
@ -116,15 +116,15 @@ int main(int argc, char *argv[])
|
||||||
current_firmware_variant = GetFirmwareVariant(firmware_id);
|
current_firmware_variant = GetFirmwareVariant(firmware_id);
|
||||||
// qDebug() << current_firmware_variant;
|
// qDebug() << current_firmware_variant;
|
||||||
|
|
||||||
MainWindow mainWin;
|
MainWindow * mainWin = new MainWindow();
|
||||||
|
|
||||||
if (showSplash) {
|
if (showSplash) {
|
||||||
splash->show();
|
splash->show();
|
||||||
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
|
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
|
||||||
QTimer::singleShot(1000*SPLASH_TIME, &mainWin, SLOT(show()));
|
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mainWin.show();
|
mainWin->show();
|
||||||
}
|
}
|
||||||
return app.exec();
|
return app->exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,11 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
||||||
}
|
}
|
||||||
|
|
||||||
populateSwitchCB(ui->switchesCB,ed->swtch);
|
populateSwitchCB(ui->switchesCB,ed->swtch);
|
||||||
populateCurveReference(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, 0);
|
|
||||||
|
|
||||||
ui->modeCB->setCurrentIndex(ed->mode-1);
|
// 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);
|
||||||
|
|
||||||
ui->label_expo->hide();
|
ui->label_expo->hide();
|
||||||
|
|
||||||
|
@ -77,6 +79,19 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||||
|
ui->sideLabel->hide();
|
||||||
|
ui->sideCB->hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->sourceLabel->hide();
|
||||||
|
ui->sourceCB->hide();
|
||||||
|
ui->scaleLabel->hide();
|
||||||
|
ui->scaleSB->hide();
|
||||||
|
ui->trimLabel->hide();
|
||||||
|
ui->trimCB->hide();
|
||||||
|
}
|
||||||
|
|
||||||
int expolength=GetEepromInterface()->getCapability(HasExpoNames);
|
int expolength=GetEepromInterface()->getCapability(HasExpoNames);
|
||||||
if (!expolength) {
|
if (!expolength) {
|
||||||
ui->label_name->hide();
|
ui->label_name->hide();
|
||||||
|
@ -101,7 +116,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ExpoData *expoData, int stickMode) :
|
||||||
connect(ui->weightCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
connect(ui->weightCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||||
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||||
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||||
connect(ui->modeCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
connect(ui->sideCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||||
connect(ui->expoGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
connect(ui->expoGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
||||||
connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
connect(ui->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged()));
|
||||||
for (int i=0; i<9; i++) {
|
for (int i=0; i<9; i++) {
|
||||||
|
@ -164,15 +179,13 @@ 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 };
|
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 };
|
||||||
|
|
||||||
retrieveCurveReference(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, 0);
|
|
||||||
|
|
||||||
if (ui->weightGV->isChecked()) {
|
if (ui->weightGV->isChecked()) {
|
||||||
ed->weight = ui->weightCB->itemData(ui->weightCB->currentIndex()).toInt();
|
ed->weight = ui->weightCB->itemData(ui->weightCB->currentIndex()).toInt();
|
||||||
} else {
|
} else {
|
||||||
ed->weight = ui->weightSB->value();
|
ed->weight = ui->weightSB->value();
|
||||||
}
|
}
|
||||||
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||||
ed->mode = ui->modeCB->currentIndex() + 1;
|
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||||
int i=0;
|
int i=0;
|
||||||
for (i=0; i<ui->expoName->text().toAscii().length(); i++) {
|
for (i=0; i<ui->expoName->text().toAscii().length(); i++) {
|
||||||
ed->name[i]=ui->expoName->text().toAscii().at(i);
|
ed->name[i]=ui->expoName->text().toAscii().at(i);
|
||||||
|
|
|
@ -44,14 +44,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Weight</string>
|
<string>Weight</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="3" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0">
|
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="weightGV">
|
<widget class="QCheckBox" name="weightGV">
|
||||||
|
@ -85,14 +85,14 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_expo">
|
<widget class="QLabel" name="label_expo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Expo</string>
|
<string>Expo</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="4" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,1,0">
|
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="expoGV">
|
<widget class="QCheckBox" name="expoGV">
|
||||||
|
@ -126,14 +126,14 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="label_phases">
|
<widget class="QLabel" name="label_phases">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Flight modes</string>
|
<string>Flight modes</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="6" column="1">
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lb_FP0">
|
<widget class="QLabel" name="lb_FP0">
|
||||||
|
@ -290,14 +290,14 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Switch</string>
|
<string>Switch</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QComboBox" name="switchesCB">
|
<widget class="QComboBox" name="switchesCB">
|
||||||
<property name="whatsThis">
|
<property name="whatsThis">
|
||||||
<string>Switch used by the expo.
|
<string>Switch used by the expo.
|
||||||
|
@ -305,14 +305,14 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="label_curves">
|
<widget class="QLabel" name="label_curves">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Curve</string>
|
<string>Curve</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="8" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1,0">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="curveTypeCB">
|
<widget class="QComboBox" name="curveTypeCB">
|
||||||
|
@ -343,15 +343,15 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="sideLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stick Side</string>
|
<string>Stick Side</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QComboBox" name="modeCB">
|
<widget class="QComboBox" name="sideCB">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>NEG</string>
|
<string>NEG</string>
|
||||||
|
@ -369,7 +369,7 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="11" column="0" colspan="2">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -388,7 +388,7 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" colspan="2">
|
<item row="10" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -401,6 +401,71 @@ If blank then the expo is considered to be "ON" all the time.</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</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="5" column="1">
|
||||||
|
<widget class="QComboBox" name="trimCB">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>No</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Yes</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="sourceLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Source</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="trimLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include Trim</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="scaleLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Scale</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" 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">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||||
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||||
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||||
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
|
@ -76,19 +76,18 @@ void InputsPanel::update()
|
||||||
str = " ";
|
str = " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||||
switch (md->mode) {
|
switch (md->mode) {
|
||||||
case (1): str += " <-"; break;
|
case (1): str += " <-"; break;
|
||||||
case (2): str += " ->"; break;
|
case (2): str += " ->"; break;
|
||||||
default: str += " "; break;
|
default: str += " "; break;
|
||||||
};
|
};
|
||||||
|
|
||||||
str += tr("Weight(%1)").arg(getGVarString(md->weight));
|
|
||||||
|
|
||||||
QString curveStr = md->curve.toString();
|
|
||||||
if (!curveStr.isEmpty()) {
|
|
||||||
str += " " + curveStr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
str += " " + tr("Weight(%1)").arg(getGVarString(md->weight));
|
||||||
|
|
||||||
|
if (md->curve.value) str += " " + md->curve.toString();
|
||||||
|
|
||||||
if (GetEepromInterface()->getCapability(FlightPhases)) {
|
if (GetEepromInterface()->getCapability(FlightPhases)) {
|
||||||
if(md->phases) {
|
if(md->phases) {
|
||||||
if (md->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) {
|
if (md->phases!=(unsigned int)(1<<GetEepromInterface()->getCapability(FlightPhases))-1) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) :
|
||||||
ui->offsetCB->hide();
|
ui->offsetCB->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
populateCurveReference(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, 0);
|
CurveGroup * curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
|
||||||
|
|
||||||
ui->MixDR_CB->setChecked(md->noExpo==0);
|
ui->MixDR_CB->setChecked(md->noExpo==0);
|
||||||
if (!GetEepromInterface()->getCapability(MixesWithoutExpo)) {
|
if (!GetEepromInterface()->getCapability(MixesWithoutExpo)) {
|
||||||
|
@ -143,12 +143,6 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) :
|
||||||
connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)),this,SLOT(valuesChanged()));
|
||||||
connect(ui->weightCB,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->offsetCB,SIGNAL(currentIndexChanged(int)),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->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
connect(ui->weightSB,SIGNAL(editingFinished()),this,SLOT(valuesChanged()));
|
||||||
connect(ui->offsetSB,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->weightGV,SIGNAL(stateChanged(int)),this,SLOT(widgetChanged())); // TODO why the same slot?
|
||||||
|
@ -249,9 +243,6 @@ void MixerDialog::valuesChanged()
|
||||||
}
|
}
|
||||||
md->carryTrim = -(ui->trimCB->currentIndex()-1);
|
md->carryTrim = -(ui->trimCB->currentIndex()-1);
|
||||||
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
|
md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1;
|
||||||
|
|
||||||
retrieveCurveReference(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, 0);
|
|
||||||
|
|
||||||
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||||
md->mixWarn = ui->warningCB->currentIndex();
|
md->mixWarn = ui->warningCB->currentIndex();
|
||||||
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
|
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue