mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 06:15:10 +03:00
Remove uneeded capabilities
This commit is contained in:
parent
14343ea37c
commit
6c25bce475
3 changed files with 9 additions and 18 deletions
|
@ -339,15 +339,11 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||||
else
|
else
|
||||||
return 3;
|
return 3;
|
||||||
|
|
||||||
case AvailablePots:
|
|
||||||
if (IS_JUMPER_TLITE(board))
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return getCapability(board, Pots);
|
|
||||||
|
|
||||||
case FactoryInstalledPots:
|
case FactoryInstalledPots:
|
||||||
if (IS_TARANIS_X9(board))
|
if (IS_TARANIS_X9(board))
|
||||||
return 2;
|
return 2;
|
||||||
|
else if (IS_JUMPER_TLITE(board))
|
||||||
|
return 0;
|
||||||
else
|
else
|
||||||
return getCapability(board, Pots);
|
return getCapability(board, Pots);
|
||||||
|
|
||||||
|
@ -391,6 +387,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||||
return 7;
|
return 7;
|
||||||
else if (board == BOARD_TARANIS_X7)
|
else if (board == BOARD_TARANIS_X7)
|
||||||
return 8;
|
return 8;
|
||||||
|
else if (board == BOARD_JUMPER_TLITE)
|
||||||
|
return 4;
|
||||||
else if (IS_FAMILY_T12(board))
|
else if (IS_FAMILY_T12(board))
|
||||||
return 8;
|
return 8;
|
||||||
else if (IS_TARANIS_XLITE(board))
|
else if (IS_TARANIS_XLITE(board))
|
||||||
|
@ -404,20 +402,14 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||||
else
|
else
|
||||||
return 7;
|
return 7;
|
||||||
|
|
||||||
case AvailableSwitches:
|
|
||||||
if (IS_JUMPER_TLITE(board))
|
|
||||||
return 4;
|
|
||||||
else
|
|
||||||
return getCapability(board, Switches);
|
|
||||||
|
|
||||||
case FactoryInstalledSwitches:
|
case FactoryInstalledSwitches:
|
||||||
if (IS_TARANIS_X9E(board))
|
if (IS_TARANIS_X9E(board))
|
||||||
return 8;
|
return 8;
|
||||||
else if (IS_JUMPER_TLITE(board))
|
else if (IS_JUMPER_TLITE(board))
|
||||||
return 4;
|
return 4;
|
||||||
if (IS_FAMILY_T12(board))
|
else if (IS_FAMILY_T12(board))
|
||||||
return 6;
|
return 6;
|
||||||
if (IS_HORUS_X12S(board))
|
else if (IS_HORUS_X12S(board))
|
||||||
return 8;
|
return 8;
|
||||||
else
|
else
|
||||||
return getCapability(board, Switches);
|
return getCapability(board, Switches);
|
||||||
|
|
|
@ -119,7 +119,6 @@ namespace Board {
|
||||||
enum Capability {
|
enum Capability {
|
||||||
Sticks,
|
Sticks,
|
||||||
Pots,
|
Pots,
|
||||||
AvailablePots,
|
|
||||||
FactoryInstalledPots,
|
FactoryInstalledPots,
|
||||||
Sliders,
|
Sliders,
|
||||||
MouseAnalogs,
|
MouseAnalogs,
|
||||||
|
@ -129,7 +128,7 @@ namespace Board {
|
||||||
MultiposPotsPositions,
|
MultiposPotsPositions,
|
||||||
Switches,
|
Switches,
|
||||||
SwitchPositions,
|
SwitchPositions,
|
||||||
AvailableSwitches,
|
|
||||||
FactoryInstalledSwitches,
|
FactoryInstalledSwitches,
|
||||||
NumTrims,
|
NumTrims,
|
||||||
NumTrimSwitches
|
NumTrimSwitches
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos)
|
void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos)
|
||||||
{
|
{
|
||||||
Board::Type board = getCurrentBoard();
|
Board::Type board = getCurrentBoard();
|
||||||
if (IS_STM32(board) && index < getBoardCapability(board, Board::AvailableSwitches)) {
|
if (IS_STM32(board) && index < getBoardCapability(board, Board::Switches)) {
|
||||||
type->addItem(tr("None"), Board::SWITCH_NOT_AVAILABLE);
|
type->addItem(tr("None"), Board::SWITCH_NOT_AVAILABLE);
|
||||||
type->addItem(tr("2 Positions Toggle"), Board::SWITCH_TOGGLE);
|
type->addItem(tr("2 Positions Toggle"), Board::SWITCH_TOGGLE);
|
||||||
type->addItem(tr("2 Positions"), Board::SWITCH_2POS);
|
type->addItem(tr("2 Positions"), Board::SWITCH_2POS);
|
||||||
|
@ -75,7 +75,7 @@ void HardwarePanel::setupPotType(int index, QLabel * label, AutoLineEdit * name,
|
||||||
{
|
{
|
||||||
Board::Type board = firmware->getBoard();
|
Board::Type board = firmware->getBoard();
|
||||||
|
|
||||||
if (IS_STM32(board) && index < getBoardCapability(board, Board::AvailablePots)) {
|
if (IS_STM32(board) && index < getBoardCapability(board, Board::Pots)) {
|
||||||
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+index).toString());
|
label->setText(RawSource(SOURCE_TYPE_STICK, CPN_MAX_STICKS+index).toString());
|
||||||
type->addItem(tr("None"), Board::POT_NONE);
|
type->addItem(tr("None"), Board::POT_NONE);
|
||||||
type->addItem(tr("Pot with detent"), Board::POT_WITH_DETENT);
|
type->addItem(tr("Pot with detent"), Board::POT_WITH_DETENT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue