mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Fixes #4841
This commit is contained in:
parent
6dd8524ea5
commit
b0183efaf1
2 changed files with 13 additions and 2 deletions
|
@ -552,8 +552,8 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
|||
result = QString(generalSettings->potName[genAryIdx]);
|
||||
else if (isSlider(&genAryIdx))
|
||||
result = QString(generalSettings->sliderName[genAryIdx]);
|
||||
else
|
||||
result = QString(generalSettings->stickName[index]);
|
||||
else if (isStick(&genAryIdx))
|
||||
result = QString(generalSettings->stickName[genAryIdx]);
|
||||
}
|
||||
if (result.isEmpty())
|
||||
result = getCurrentFirmware()->getAnalogInputName(index);;
|
||||
|
@ -608,6 +608,16 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
|
|||
}
|
||||
}
|
||||
|
||||
bool RawSource::isStick(int * stickIndex) const
|
||||
{
|
||||
if (type == SOURCE_TYPE_STICK && index < getBoardCapability(getCurrentBoard(), Board::Sticks)) {
|
||||
if (stickIndex)
|
||||
*stickIndex = index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RawSource::isPot(int * potsIndex) const
|
||||
{
|
||||
if (type == SOURCE_TYPE_STICK &&
|
||||
|
|
|
@ -231,6 +231,7 @@ class RawSource {
|
|||
}
|
||||
|
||||
bool isTimeBased() const;
|
||||
bool isStick(int * potsIndex = NULL) const;
|
||||
bool isPot(int * potsIndex = NULL) const;
|
||||
bool isSlider(int * sliderIndex = NULL) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue