mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 03:19:53 +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
|
||||
return 3;
|
||||
|
||||
case AvailablePots:
|
||||
if (IS_JUMPER_TLITE(board))
|
||||
return 0;
|
||||
else
|
||||
return getCapability(board, Pots);
|
||||
|
||||
case FactoryInstalledPots:
|
||||
if (IS_TARANIS_X9(board))
|
||||
return 2;
|
||||
else if (IS_JUMPER_TLITE(board))
|
||||
return 0;
|
||||
else
|
||||
return getCapability(board, Pots);
|
||||
|
||||
|
@ -391,6 +387,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
|||
return 7;
|
||||
else if (board == BOARD_TARANIS_X7)
|
||||
return 8;
|
||||
else if (board == BOARD_JUMPER_TLITE)
|
||||
return 4;
|
||||
else if (IS_FAMILY_T12(board))
|
||||
return 8;
|
||||
else if (IS_TARANIS_XLITE(board))
|
||||
|
@ -404,20 +402,14 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
|||
else
|
||||
return 7;
|
||||
|
||||
case AvailableSwitches:
|
||||
if (IS_JUMPER_TLITE(board))
|
||||
return 4;
|
||||
else
|
||||
return getCapability(board, Switches);
|
||||
|
||||
case FactoryInstalledSwitches:
|
||||
if (IS_TARANIS_X9E(board))
|
||||
return 8;
|
||||
else if (IS_JUMPER_TLITE(board))
|
||||
return 4;
|
||||
if (IS_FAMILY_T12(board))
|
||||
else if (IS_FAMILY_T12(board))
|
||||
return 6;
|
||||
if (IS_HORUS_X12S(board))
|
||||
else if (IS_HORUS_X12S(board))
|
||||
return 8;
|
||||
else
|
||||
return getCapability(board, Switches);
|
||||
|
|
|
@ -119,7 +119,6 @@ namespace Board {
|
|||
enum Capability {
|
||||
Sticks,
|
||||
Pots,
|
||||
AvailablePots,
|
||||
FactoryInstalledPots,
|
||||
Sliders,
|
||||
MouseAnalogs,
|
||||
|
@ -129,7 +128,7 @@ namespace Board {
|
|||
MultiposPotsPositions,
|
||||
Switches,
|
||||
SwitchPositions,
|
||||
AvailableSwitches,
|
||||
|
||||
FactoryInstalledSwitches,
|
||||
NumTrims,
|
||||
NumTrimSwitches
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * name, AutoComboBox * type, bool threePos)
|
||||
{
|
||||
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("2 Positions Toggle"), Board::SWITCH_TOGGLE);
|
||||
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();
|
||||
|
||||
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());
|
||||
type->addItem(tr("None"), Board::POT_NONE);
|
||||
type->addItem(tr("Pot with detent"), Board::POT_WITH_DETENT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue