Companion: Russian UI (#7180)
[opentx.git] / radio / src / gui / 128x64 / radio_diaganas.cpp
blob928e97d46831472341fc0d6133e764eb3e15a1c8
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #include "opentx.h"
23 void menuRadioDiagAnalogs(event_t event)
25 // TODO enum
26 #if defined(TX_CAPACITY_MEASUREMENT)
27 #define ANAS_ITEMS_COUNT 3
28 #elif defined(PCBSKY9X)
29 #define ANAS_ITEMS_COUNT 2
30 #else
31 #define ANAS_ITEMS_COUNT 1
32 #endif
34 SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, HEADER_LINE+ANAS_ITEMS_COUNT);
36 coord_t y = MENU_HEADER_HEIGHT + 1;
38 lcdDrawTextAlignedLeft(y, STICKS_PWM_ENABLED() ? STR_PWM_STICKS_POTS_SLIDERS : STR_STICKS_POTS_SLIDERS);
40 for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
41 uint8_t x;
42 if (i & 1) {
43 x = LCD_W/2 + INDENT_WIDTH;
45 else {
46 x = INDENT_WIDTH;
47 y += FH;
49 drawStringWithIndex(x, y, "A", i+1);
50 lcdDrawChar(lcdNextPos, y, ':');
51 lcdDrawHexNumber(x+3*FW-1, y, anaIn(i));
52 lcdDrawNumber(x+10*FW-1, y, (int16_t)calibratedAnalogs[CONVERT_MODE(i)]*25/256, RIGHT);
55 #if defined(GYRO)
56 y += FH;
57 lcdDrawTextAlignedLeft(y, STR_GYRO);
58 y += FH;
59 uint8_t x = INDENT_WIDTH;
60 lcdDrawText(x, y, "X:");
61 lcdDrawNumber(x+3*FW-1, y, gyro.outputs[0] * 180 / 1024);
62 lcdDrawChar(lcdNextPos, y, '@');
63 lcdDrawNumber(x+10*FW-1, y, gyro.scaledX(), RIGHT);
64 x = LCD_W/2 + INDENT_WIDTH;
65 lcdDrawText(x, y, "Y:");
66 lcdDrawNumber(x+3*FW-1, y, gyro.outputs[1] * 180 / 1024);
67 lcdDrawChar(lcdNextPos, y, '@');
68 lcdDrawNumber(x+10*FW-1, y, gyro.scaledY(), RIGHT);
69 #endif