mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 23:05:12 +03:00
parent
0cbb8107af
commit
f40264b658
4 changed files with 13 additions and 47 deletions
|
@ -151,7 +151,6 @@ const uint8_t STATS_ICONS[] = {
|
||||||
ICON_STATS,
|
ICON_STATS,
|
||||||
ICON_STATS_THROTTLE_GRAPH,
|
ICON_STATS_THROTTLE_GRAPH,
|
||||||
ICON_STATS_DEBUG,
|
ICON_STATS_DEBUG,
|
||||||
ICON_STATS_ANALOGS,
|
|
||||||
#if defined(DEBUG_TRACE_BUFFER)
|
#if defined(DEBUG_TRACE_BUFFER)
|
||||||
ICON_STATS_TIMERS
|
ICON_STATS_TIMERS
|
||||||
#endif
|
#endif
|
||||||
|
@ -240,13 +239,11 @@ enum MenuRadioIndexes
|
||||||
|
|
||||||
bool menuStatsGraph(event_t event);
|
bool menuStatsGraph(event_t event);
|
||||||
bool menuStatsDebug(event_t event);
|
bool menuStatsDebug(event_t event);
|
||||||
bool menuStatsAnalogs(event_t event);
|
|
||||||
bool menuStatsTraces(event_t event);
|
bool menuStatsTraces(event_t event);
|
||||||
|
|
||||||
static const MenuHandlerFunc menuTabStats[] = {
|
static const MenuHandlerFunc menuTabStats[] = {
|
||||||
menuStatsGraph,
|
menuStatsGraph,
|
||||||
menuStatsDebug,
|
menuStatsDebug,
|
||||||
menuStatsAnalogs,
|
|
||||||
#if defined(DEBUG_TRACE_BUFFER)
|
#if defined(DEBUG_TRACE_BUFFER)
|
||||||
menuStatsTraces,
|
menuStatsTraces,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,7 +29,7 @@ bool menuRadioDiagAnalogs(event_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, ICON_MODEL_SETUP, 0);
|
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, ICON_MODEL_SETUP, 0);
|
||||||
|
|
||||||
for (uint8_t i = 0; i < NUM_STICKS + NUM_POTS + NUM_SLIDERS; i++) {
|
for (uint8_t i = 0; i < NUM_ANALOGS; i++) {
|
||||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i / 2) * FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i / 2) * FH;
|
||||||
uint8_t x = i & 1 ? LCD_W / 2 + 10 : LEFT_NAME_COLUMN;
|
uint8_t x = i & 1 ? LCD_W / 2 + 10 : LEFT_NAME_COLUMN;
|
||||||
lcdDrawNumber(x, y, i + 1, LEADING0 | LEFT, 2);
|
lcdDrawNumber(x, y, i + 1, LEADING0 | LEFT, 2);
|
||||||
|
@ -40,7 +40,12 @@ bool menuRadioDiagAnalogs(event_t event)
|
||||||
lcdDrawNumber(x + ANA_OFFSET + 30 - 1, y, avgJitter[i].get(), RIGHT);
|
lcdDrawNumber(x + ANA_OFFSET + 30 - 1, y, avgJitter[i].get(), RIGHT);
|
||||||
lcdDrawNumber(x + ANA_OFFSET + 70 - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
lcdDrawNumber(x + ANA_OFFSET + 70 - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
||||||
#else
|
#else
|
||||||
|
if (i < NUM_STICKS + NUM_POTS + NUM_SLIDERS)
|
||||||
lcdDrawNumber(x + ANA_OFFSET - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
lcdDrawNumber(x + ANA_OFFSET - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
||||||
|
#if NUM_MOUSE_ANALOGS > 0
|
||||||
|
else if (i >= MOUSE1)
|
||||||
|
lcdDrawNumber(x + ANA_OFFSET - 1, y, (int16_t) calibratedAnalogs[CALIBRATED_MOUSE1 + i - MOUSE1] * 25 / 256, RIGHT);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,5 +56,10 @@ bool menuRadioDiagAnalogs(event_t event)
|
||||||
lcdDrawText(LCD_W / 2, RAS_TOP_POSITION, "XJTVER : ");
|
lcdDrawText(LCD_W / 2, RAS_TOP_POSITION, "XJTVER : ");
|
||||||
lcdDrawNumber(lcdNextPos, RAS_TOP_POSITION, telemetryData.xjtVersion, 0);
|
lcdDrawNumber(lcdNextPos, RAS_TOP_POSITION, telemetryData.xjtVersion, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (NUM_PWMSTICKS > 0) && !defined(SIMU)
|
||||||
|
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 8 * FH, STICKS_PWM_ENABLED() ? "Sticks: PWM" : "Sticks: ANA");
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,45 +188,6 @@ bool menuStatsDebug(event_t event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menuStatsAnalogs(event_t event)
|
|
||||||
{
|
|
||||||
SIMPLE_MENU("Analogs", STATS_ICONS, menuTabStats, e_StatsAnalogs, 1);
|
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_ANALOGS; i++) {
|
|
||||||
coord_t y = MENU_CONTENT_TOP + (i/2)*FH;
|
|
||||||
coord_t x = MENUS_MARGIN_LEFT + (i & 1 ? LCD_W/2 : 0);
|
|
||||||
lcdDrawNumber(x, y, i+1, LEADING0|LEFT, 2, NULL, ":");
|
|
||||||
lcdDrawHexNumber(x+40, y, anaIn(i));
|
|
||||||
#if defined(JITTER_MEASURE)
|
|
||||||
lcdDrawNumber(x+100, y, rawJitter[i].get());
|
|
||||||
lcdDrawNumber(x+140, y, avgJitter[i].get());
|
|
||||||
lcdDrawNumber(x+180, y, (int16_t)calibratedAnalogs[CONVERT_MODE(i)]*250/256, PREC1);
|
|
||||||
#else
|
|
||||||
if (i < NUM_STICKS+NUM_POTS+NUM_SLIDERS)
|
|
||||||
lcdDrawNumber(x+100, y, (int16_t)calibratedAnalogs[CONVERT_MODE(i)]*25/256);
|
|
||||||
#if NUM_MOUSE_ANALOGS > 0
|
|
||||||
else if (i >= MOUSE1)
|
|
||||||
lcdDrawNumber(x+100, y, (int16_t)calibratedAnalogs[CALIBRATED_MOUSE1+i-MOUSE1]*25/256);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// RAS
|
|
||||||
if ((isModuleXJT(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) || (isModulePXX1(EXTERNAL_MODULE) && !IS_INTERNAL_MODULE_ON())) {
|
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+7*FH, "RAS");
|
|
||||||
lcdDrawNumber(MENUS_MARGIN_LEFT+100, MENU_CONTENT_TOP+7*FH, telemetryData.swrInternal.value());
|
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT + LCD_W/2, MENU_CONTENT_TOP+7*FH, "XJTVER");
|
|
||||||
lcdDrawNumber(LCD_W/2 + MENUS_MARGIN_LEFT+100, MENU_CONTENT_TOP+7*FH, telemetryData.xjtVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (NUM_PWMSTICKS > 0) && !defined(SIMU)
|
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+8*FH, STICKS_PWM_ENABLED() ? "Sticks: PWM" : "Sticks: ANA");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(DEBUG_TRACE_BUFFER)
|
#if defined(DEBUG_TRACE_BUFFER)
|
||||||
#define STATS_TRACES_INDEX_POS MENUS_MARGIN_LEFT
|
#define STATS_TRACES_INDEX_POS MENUS_MARGIN_LEFT
|
||||||
#define STATS_TRACES_TIME_POS MENUS_MARGIN_LEFT + 4*10
|
#define STATS_TRACES_TIME_POS MENUS_MARGIN_LEFT + 4*10
|
||||||
|
|
|
@ -1366,9 +1366,7 @@ extern uint16_t s_anaFilt[NUM_ANALOGS];
|
||||||
#if defined(JITTER_MEASURE)
|
#if defined(JITTER_MEASURE)
|
||||||
extern JitterMeter<uint16_t> rawJitter[NUM_ANALOGS];
|
extern JitterMeter<uint16_t> rawJitter[NUM_ANALOGS];
|
||||||
extern JitterMeter<uint16_t> avgJitter[NUM_ANALOGS];
|
extern JitterMeter<uint16_t> avgJitter[NUM_ANALOGS];
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||||
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuStatsAnalogs)
|
|
||||||
#elif defined(PCBTARANIS)
|
|
||||||
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuRadioDiagAnalogs)
|
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuRadioDiagAnalogs)
|
||||||
#elif defined(CLI)
|
#elif defined(CLI)
|
||||||
#define JITTER_MEASURE_ACTIVE() (1)
|
#define JITTER_MEASURE_ACTIVE() (1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue