Companion hardware internal module continued (#1342)
* Add ability to undo hardware internal module change * Add internal module protocol check on model edit * Event driven check and update of all models * Fix model edit dialog searches * Add OFF to list of internal modules * Fix internal module protocol list issue #1382
This commit is contained in:
@@ -813,10 +813,11 @@ StringTagMappingTable Boards::getTrimSourcesLookupTable(Board::Type board)
|
||||
QList<int> Boards::getSupportedInternalModules(Board::Type board)
|
||||
{
|
||||
QList<int> modules;
|
||||
modules = {(int)MODULE_TYPE_NONE};
|
||||
if (IS_TARANIS_X9DP_2019(board) || IS_TARANIS_X7_ACCESS(board)) {
|
||||
modules = {(int)MODULE_TYPE_ISRM_PXX2};
|
||||
modules.append({(int)MODULE_TYPE_ISRM_PXX2});
|
||||
} else if (IS_FLYSKY_NV14(board)) {
|
||||
modules = {(int)MODULE_TYPE_FLYSKY};
|
||||
modules.append({(int)MODULE_TYPE_FLYSKY});
|
||||
} else if (IS_FAMILY_HORUS_OR_T16(board) || IS_FAMILY_T12(board)
|
||||
|| (IS_TARANIS_SMALL(board) && IS_ACCESS_RADIO(board))) {
|
||||
modules.append({
|
||||
@@ -826,7 +827,7 @@ QList<int> Boards::getSupportedInternalModules(Board::Type board)
|
||||
(int)MODULE_TYPE_MULTIMODULE,
|
||||
});
|
||||
} else if (IS_TARANIS(board)) {
|
||||
modules = {(int)MODULE_TYPE_XJT_PXX1};
|
||||
modules.append({(int)MODULE_TYPE_XJT_PXX1});
|
||||
}
|
||||
|
||||
return modules;
|
||||
|
||||
@@ -212,7 +212,6 @@ class Boards
|
||||
static QString potTypeToString(int value);
|
||||
static QString sliderTypeToString(int value);
|
||||
static QString switchTypeToString(int value);
|
||||
static QString intModuleTypeToString(int value);
|
||||
static AbstractStaticItemModel * potTypeItemModel();
|
||||
static AbstractStaticItemModel * sliderTypeItemModel();
|
||||
static AbstractStaticItemModel * switchTypeItemModel();
|
||||
@@ -221,7 +220,7 @@ class Boards
|
||||
static StringTagMappingTable getTrimSourcesLookupTable(Board::Type board);
|
||||
static QList<int> getSupportedInternalModules(Board::Type board);
|
||||
static int getDefaultInternalModules(Board::Type board);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
Board::Type m_boardType;
|
||||
|
||||
@@ -381,7 +381,7 @@ bool ModuleData::isProtocolAvailable(int moduleidx, unsigned int protocol, Gener
|
||||
Firmware *fw = getCurrentFirmware();
|
||||
Board::Type board = fw->getBoard();
|
||||
|
||||
if (moduleidx == 0 && Boards::getCapability(board, Board::HasInternalModuleSupport))
|
||||
if (moduleidx == 0)
|
||||
return (int)settings.internalModule == getTypeFromProtocol(protocol);
|
||||
|
||||
QString id = fw->getId();
|
||||
|
||||
Reference in New Issue
Block a user