mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Fixes #1135
This commit is contained in:
parent
f4681eff0c
commit
3ba532cb19
4 changed files with 45 additions and 43 deletions
|
@ -669,48 +669,6 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
|||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
void populateCSWCB(QComboBox *b, int value)
|
||||
{
|
||||
int order[] = {
|
||||
LS_FN_OFF,
|
||||
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VALMOSTEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VPOS,
|
||||
LS_FN_VNEG,
|
||||
// LS_FN_RANGE,
|
||||
LS_FN_APOS,
|
||||
LS_FN_ANEG,
|
||||
LS_FN_AND,
|
||||
LS_FN_OR,
|
||||
LS_FN_XOR,
|
||||
LS_FN_STAY,
|
||||
LS_FN_EQUAL,
|
||||
LS_FN_NEQUAL,
|
||||
LS_FN_GREATER,
|
||||
LS_FN_LESS,
|
||||
LS_FN_EGREATER,
|
||||
LS_FN_ELESS,
|
||||
LS_FN_DPOS,
|
||||
LS_FN_DAPOS,
|
||||
LS_FN_TIMER,
|
||||
LS_FN_STICKY
|
||||
};
|
||||
|
||||
b->clear();
|
||||
for (int i=0; i<LS_FN_MAX; i++) {
|
||||
int func = order[i];
|
||||
if (!IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
if (func == LS_FN_VEQUAL || func == LS_FN_STAY)
|
||||
continue;
|
||||
}
|
||||
b->addItem(LogicalSwitchData(func).funcToString(), func);
|
||||
if (value == func) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
QString image2qstring(QImage image)
|
||||
{
|
||||
if (image.isNull())
|
||||
|
|
|
@ -106,7 +106,6 @@ QString getPhasesStr(unsigned int phases, ModelData & model);
|
|||
// void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
|
||||
void populateGVCB(QComboBox *b, int value);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, const ModelData & model, unsigned int flags);
|
||||
void populateCSWCB(QComboBox *b, int value);
|
||||
QString getPhaseName(int val, const char * phasename=NULL);
|
||||
QString getInputStr(ModelData & model, int index);
|
||||
QString image2qstring(QImage image);
|
||||
|
|
|
@ -323,6 +323,50 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
|||
lock = false;
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::populateCSWCB(QComboBox *b, int value)
|
||||
{
|
||||
int order[] = {
|
||||
LS_FN_OFF,
|
||||
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VALMOSTEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VPOS,
|
||||
LS_FN_VNEG,
|
||||
// LS_FN_RANGE,
|
||||
LS_FN_APOS,
|
||||
LS_FN_ANEG,
|
||||
LS_FN_AND,
|
||||
LS_FN_OR,
|
||||
LS_FN_XOR,
|
||||
LS_FN_STAY,
|
||||
LS_FN_EQUAL,
|
||||
LS_FN_NEQUAL,
|
||||
LS_FN_GREATER,
|
||||
LS_FN_LESS,
|
||||
LS_FN_EGREATER,
|
||||
LS_FN_ELESS,
|
||||
LS_FN_DPOS,
|
||||
LS_FN_DAPOS,
|
||||
LS_FN_TIMER,
|
||||
LS_FN_STICKY
|
||||
};
|
||||
|
||||
b->clear();
|
||||
for (int i=0; i<LS_FN_MAX; i++) {
|
||||
int func = order[i];
|
||||
if (func == LS_FN_NEQUAL || func == LS_FN_EGREATER || func == LS_FN_ELESS)
|
||||
continue;
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
if (func == LS_FN_VEQUAL || func == LS_FN_STAY)
|
||||
continue;
|
||||
}
|
||||
b->addItem(LogicalSwitchData(func).funcToString(), func);
|
||||
if (value == func) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::updateLine(int i)
|
||||
{
|
||||
lock = true;
|
||||
|
|
|
@ -41,6 +41,7 @@ class LogicalSwitchesPanel : public ModelPanel
|
|||
void setSwitchWidgetVisibility(int i);
|
||||
int selectedSwitch;
|
||||
|
||||
void populateCSWCB(QComboBox *b, int value);
|
||||
void updateLine(int index);
|
||||
void updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero=false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue