display receiver or module name for each sensor (if available)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "sensordata.h"
|
||||
|
||||
#include "radiodata.h"
|
||||
#include "modeldata.h"
|
||||
|
||||
void SensorData::updateUnit()
|
||||
{
|
||||
@@ -90,3 +91,25 @@ QString SensorData::nameToString(int index) const
|
||||
{
|
||||
return RadioData::getElementName(tr("TELE"), index + 1, label);
|
||||
}
|
||||
|
||||
QString SensorData::getRxOrModName(const ModelData* model) const
|
||||
{
|
||||
if ((type != TELEM_TYPE_CUSTOM) || (!id && !instance))
|
||||
return QString();
|
||||
|
||||
const ModuleData& module = model->moduleData[moduleIdx];
|
||||
|
||||
if (module.isPxx2Module()) {
|
||||
if (module.access.receivers & (1 << rxIdx)) {
|
||||
return QString(module.access.receiverName[rxIdx]);
|
||||
}
|
||||
|
||||
// receiver does not seem to be active
|
||||
return QString();
|
||||
}
|
||||
|
||||
if (moduleIdx)
|
||||
return tr("Internal");
|
||||
|
||||
return tr("External");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user