feat(color,cpn): Updates to the model telemetry page, sensor ID consistency (#3401)

* Add 'Show Instance ID' button to telemetry page to show/hide sensor instance number (default is hidden).
Fix issues with page refresh when all sensors deleted.
Select closest sensor when a single sensor is deleted.
On change, only refresh the sensor list instead of the whole page.
The 'showInstanceIds' property is saved to the model file.
Update Companion to save/load 'showInstanceIds' in model YAML file. Add checkbox to telemetry edit page.

* Update all radio specific files.

* Keep focus on 'Discover/Stop' button when searching for new sensors.
Start sensor ID index at 1 to match B&W radios.
Keep focus on changed parameter when editing sensor, don't rebuild entire parameter list on change.

* Display actual 'instance' ID instead of 'instance' + 1.

* Fix incorrect ID when reloading simulator data.

* Fix incorrect ID when reloading simulator data on B&W radios.
This commit is contained in:
philmoz
2023-04-17 18:44:44 +10:00
committed by GitHub
parent 7bf6dbba0f
commit 6985d3f24b
49 changed files with 559 additions and 345 deletions
@@ -108,7 +108,7 @@ void menuModelSensor(event_t event)
if (sensor->type == TELEM_TYPE_CUSTOM) {
lcdDrawTextAlignedLeft(y, STR_ID);
lcdDrawHexNumber(SENSOR_2ND_COLUMN, y, sensor->id, LEFT|(menuHorizontalPosition==0 ? attr : 0));
lcdDrawNumber(SENSOR_3RD_COLUMN, y, (sensor->instance & 0x1F) + 1, LEFT|(menuHorizontalPosition==1 ? attr : 0));
lcdDrawNumber(SENSOR_3RD_COLUMN, y, sensor->instance & 0x1F, LEFT|(menuHorizontalPosition==1 ? attr : 0));
if (attr && s_editMode > 0) {
switch (menuHorizontalPosition) {
case 0: