1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

Bsongis/gui refactoring for x7 d (#3701)

* [X7D] New board added
* Cosmetics
This commit is contained in:
Bertrand Songis 2016-08-18 11:49:16 +02:00 committed by GitHub
parent 282b856309
commit d3ae3c035d
233 changed files with 7472 additions and 4560 deletions

View file

@ -39,7 +39,7 @@
#define TIMERS_H 25
#define TIMERS_R 193
#define REBOOT_X (LCD_W-FW)
#define VSWITCH_X(i) (((i>=NUM_LOGICAL_SWITCH*3/4) ? BITMAP_X+28 : ((i>=NUM_LOGICAL_SWITCH/2) ? BITMAP_X+25 : ((i>=NUM_LOGICAL_SWITCH/4) ? 21 : 18))) + 3*i)
#define VSWITCH_X(i) (((i>=MAX_LOGICAL_SWITCHES*3/4) ? BITMAP_X+28 : ((i>=MAX_LOGICAL_SWITCHES/2) ? BITMAP_X+25 : ((i>=MAX_LOGICAL_SWITCHES/4) ? 21 : 18))) + 3*i)
#define VSWITCH_Y (LCD_H-9)
#define TRIM_LH_X (32+9)
#define TRIM_LV_X 10
@ -161,7 +161,7 @@ void displayTrims(uint8_t phase)
void drawSliders()
{
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; i++) {
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
#if defined(PCBX9E)
if (i < SLIDER1) continue; // TODO change and display more values
coord_t x = ((i==SLIDER1 || i==SLIDER3) ? 3 : LCD_W-5);
@ -220,7 +220,7 @@ void displayTopBar()
altitude_icon_x = batt_icon_x+7*FW+3;
if (g_model.frsky.voltsSource) {
uint8_t item = g_model.frsky.voltsSource-1;
if (item < MAX_SENSORS) {
if (item < MAX_TELEMETRY_SENSORS) {
TelemetryItem & voltsItem = telemetryItems[item];
if (voltsItem.isAvailable()) {
putsTelemetryChannelValue(batt_icon_x+7*FW+2, BAR_Y+1, item, voltsItem.value, LEFT);
@ -232,7 +232,7 @@ void displayTopBar()
/* Altitude */
if (g_model.frsky.altitudeSource) {
uint8_t item = g_model.frsky.altitudeSource-1;
if (item < MAX_SENSORS) {
if (item < MAX_TELEMETRY_SENSORS) {
TelemetryItem & altitudeItem = telemetryItems[item];
if (altitudeItem.isAvailable()) {
LCD_ICON(altitude_icon_x, BAR_Y, ICON_ALTITUDE);
@ -289,7 +289,7 @@ void displayTopBar()
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER3);
/* RTC time */
putsRtcTime(BAR_TIME_X, BAR_Y+1, LEFT|TIMEBLINK);
drawRtcTime(BAR_TIME_X, BAR_Y+1, LEFT|TIMEBLINK);
/* The background */
lcdDrawFilledRect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY(12)|ROUND);
@ -315,9 +315,9 @@ void displayTimers()
lcdDrawSizedText(TIMERS_X, y-7, timerData.name, LEN_TIMER_NAME, ZCHAR|SMLSIZE);
}
else {
putsTimerMode(TIMERS_X, y-7, timerData.mode, SMLSIZE);
drawTimerMode(TIMERS_X, y-7, timerData.mode, SMLSIZE);
}
putsTimer(TIMERS_X, y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
drawTimer(TIMERS_X, y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
if (timerData.persistent) {
lcdDrawChar(TIMERS_R, y+1, 'P', SMLSIZE);
}
@ -542,7 +542,7 @@ void menuMainView(uint8_t event)
if (SWITCH_EXISTS(i)) {
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
putsSwitches((g_model.view == VIEW_INPUTS) ? (index<4 ? 8*FW+1 : 23*FW+2) : (index<4 ? 3*FW+1 : 8*FW-2), (index%4)*FH+3*FH, sw, 0);
drawSwitch((g_model.view == VIEW_INPUTS) ? (index<4 ? 8*FW+1 : 23*FW+2) : (index<4 ? 3*FW+1 : 8*FW-2), (index%4)*FH+3*FH, sw, 0);
index++;
}
}