Display rxnum in modellist only when needed (#6951)

Fix #6926
This commit is contained in:
3djc
2019-10-16 10:42:52 +02:00
committed by Bertrand Songis
parent ecc5e7553b
commit a173dd0adf
3 changed files with 23 additions and 1 deletions
+21
View File
@@ -57,6 +57,27 @@ bool ModuleData::isPxx1Module() const
}
}
bool ModuleData::supportRxNum() const
{
switch (protocol) {
case PULSES_PXX_XJT_X16:
case PULSES_PXX_R9M:
case PULSES_PXX_R9M_LITE:
case PULSES_PXX_R9M_LITE_PRO:
case PULSES_MULTIMODULE:
case PULSES_ACCESS_ISRM:
case PULSES_ACCST_ISRM_D16:
case PULSES_ACCESS_R9M:
case PULSES_ACCESS_R9M_LITE:
case PULSES_ACCESS_R9M_LITE_PRO:
case PULSES_XJT_LITE_X16:
case PULSES_XJT_LITE_LR12:
case PULSES_PXX_XJT_LR12:
return true;
default:
return false;
}
}
QString ModuleData::rfProtocolToString() const
{
+1
View File
@@ -186,6 +186,7 @@ class ModuleData {
void convert(RadioDataConversionState & cstate);
bool isPxx2Module() const;
bool isPxx1Module() const;
bool supportRxNum() const;
QString polarityToString() const { return ppm.pulsePol ? tr("Positive") : tr("Negative"); }
QString rfProtocolToString() const;
QString subTypeToString(int type = -1) const;
+1 -1
View File
@@ -727,7 +727,7 @@ void TreeModel::refresh()
protocol = moduleData.protocol;
// These are the only RXs that allow nominating RX # but changing RX or copying models can leave residual configuration which can cause issues
// if (protocol == PULSES_PXX_XJT_X16 || protocol == PULSES_PXX_XJT_LR12 || protocol == PULSES_PXX_R9M || protocol == PULSES_DSMX || protocol == PULSES_MULTIMODULE) {
if ((protocol != PULSES_OFF && protocol != PULSES_PXX_XJT_D8 ) && moduleData.modelId > 0) {
if (moduleData.supportRxNum() && moduleData.modelId > 0) {
if (!rxs.isEmpty()) {
rxs.append(", ");
}