mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-23 08:15:13 +03:00
Fixes #2380: can't select LS or RS as source in INPUT and MIXERS
This commit is contained in:
parent
5ab974e140
commit
a8a3a7e29a
5 changed files with 45 additions and 16 deletions
|
@ -507,6 +507,21 @@ QString RawSource::toString(const ModelData * model) const
|
|||
}
|
||||
}
|
||||
|
||||
bool RawSource::isPot() const
|
||||
{
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS &&
|
||||
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots));
|
||||
}
|
||||
|
||||
bool RawSource::isSlider() const
|
||||
{
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS+GetCurrentFirmware()->getCapability(Pots) &&
|
||||
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders));
|
||||
}
|
||||
|
||||
|
||||
QString SwitchUp(const char sw)
|
||||
{
|
||||
const char result[] = {'S', sw, upArrow[0], upArrow[1], upArrow[2], 0};
|
||||
|
@ -1016,6 +1031,18 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const
|
|||
return switchConfig[index] != SWITCH_NONE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isPotAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
return potConfig[index] != POT_NONE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isSliderAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
return sliderConfig[index] != SLIDER_NONE;
|
||||
}
|
||||
|
||||
GeneralSettings::GeneralSettings()
|
||||
{
|
||||
memset(this, 0, sizeof(GeneralSettings));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue