fix(cpn): add default top bar widgets to new models for colour radios (#7254)

This commit is contained in:
Neil Horne
2026-04-21 13:10:37 +10:00
committed by GitHub
parent 122afc4aa5
commit 6e30c244b6
4 changed files with 36 additions and 3 deletions
+4
View File
@@ -336,6 +336,10 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board) ||
IS_RADIOMASTER_TX15(board));
case HasInternalGPS:
return ((IS_FAMILY_HORUS_OR_T16(board) && getCapability(board, HasAuxSerialMode)) ||
IS_RADIOMASTER_TX15(board) || IS_RADIOMASTER_TX16SMK3);
case HasSoftwareSerialPower:
return IS_RADIOMASTER_TX16S(board);
+2 -1
View File
@@ -226,13 +226,14 @@ namespace Board {
HasAuxSerialMode,
HasAux2SerialMode,
HasBacklightColor,
HasBlingLEDS,
HasBluetooth,
HasColorLcd,
HasExternalModuleSupport,
HasIMU,
HasInternalGPS,
HasInternalModuleSupport,
HasIntModuleHeartbeatGPIO,
HasBlingLEDS,
HasRTC,
HasSDCard,
HasSoftwareSerialPower,
+29 -2
View File
@@ -308,8 +308,14 @@ void ModelData::clear()
sensorData[i].clear();
toplcdTimer = 0;
RadioLayout::init("Layout2P1", customScreens);
topBarData.clear();
if (Boards::getCapability(getCurrentBoard(), Board::HasColorLcd)) {
RadioLayout::init("Layout2P1", customScreens);
initTopBar();
} else {
customScreens.clear();
topBarData.clear();
}
for (int i = 0; i < MAX_TOPBAR_ZONES; i++)
topbarWidgetWidth[i] = 1;
@@ -2307,3 +2313,24 @@ void ModelData::updateSourceNumRef(int & value)
updateSourceIntRef(value);
}
}
void ModelData::initTopBar()
{
topBarData.clear();
int zones = RadioLayout::topBarZones();
if (zones - 1 >= 0) {
ZonePersistentData & zone = topBarData.zones[zones - 1];
zone.widgetName = "Date Time";
}
if (zones - 2 >= 0) {
ZonePersistentData & zone = topBarData.zones[zones - 2];
zone.widgetName = "Radio Info";
}
if (zones - 3 >= 0 && Boards::getCapability(getCurrentBoard(), Board::HasInternalGPS)) {
ZonePersistentData & zone = topBarData.zones[zones - 3];
zone.widgetName = "Internal GPS";
}
}
+1
View File
@@ -435,4 +435,5 @@ class ModelData {
}
void updateResetParam(CustomFunctionData * cfd);
void updateSourceNumRef(int & value);
void initTopBar();
};