1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 01:05:10 +03:00
This commit is contained in:
Bertrand Songis 2017-04-25 21:25:46 +02:00
parent 6dd8524ea5
commit b0183efaf1
2 changed files with 13 additions and 2 deletions

View file

@ -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 &&

View file

@ -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;