Now uses the external libopenui
3
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
||||||
[submodule "radio/src/thirdparty/GCS_MAVLink/include_v1.0"]
|
[submodule "radio/src/thirdparty/GCS_MAVLink/include_v1.0"]
|
||||||
path = radio/src/thirdparty/GCS_MAVLink/include_v1.0
|
path = radio/src/thirdparty/GCS_MAVLink/include_v1.0
|
||||||
url = https://github.com/mavlink/c_library_v1.git
|
url = https://github.com/mavlink/c_library_v1.git
|
||||||
|
[submodule "radio/src/thirdparty/libopenui"]
|
||||||
|
path = radio/src/thirdparty/libopenui
|
||||||
|
url = git@github.com:opentx/libopenui.git
|
||||||
|
|
|
@ -34,6 +34,7 @@ set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
|
||||||
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
|
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
|
||||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
|
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
|
||||||
set(SIMU_SRC_DIRECTORY ${COMPANION_SRC_DIRECTORY}/simulation)
|
set(SIMU_SRC_DIRECTORY ${COMPANION_SRC_DIRECTORY}/simulation)
|
||||||
|
set(TOOLS_DIRECTORY ${PROJECT_SOURCE_DIR}/tools)
|
||||||
|
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||||
|
@ -44,7 +45,7 @@ today(DATE)
|
||||||
now(TIME)
|
now(TIME)
|
||||||
git_id(GIT_STR)
|
git_id(GIT_STR)
|
||||||
|
|
||||||
message(STATUS "OpenTX ${VERSION} @${GIT_STR}")
|
message(STATUS "OpenTX ${VERSION} @ ${GIT_STR}")
|
||||||
|
|
||||||
# options shared by all targets
|
# options shared by all targets
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,14 @@ macro(add_bitmaps_target targetname filter width format)
|
||||||
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
|
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(add_truetype_font_target name font size offset)
|
macro(add_truetype_font_target name size subset font offset cn_font cn_offset)
|
||||||
set(target ${RADIO_SRC_DIRECTORY}/fonts/truetype/font_${name})
|
set(target ${RADIO_SRC_DIRECTORY}/fonts/truetype/font_${name})
|
||||||
add_custom_target(truetype_font_${name}
|
add_custom_command(
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${offset} ${target}
|
OUTPUT ${target}.png ${target}.specs
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIRECTORY}/build-font-bitmap.py --subset ${subset} --size ${size} --font ${font}:${offset} --cn-font ${cn_font}:${cn_offset} --output ${target}
|
||||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||||
DEPENDS ${RADIO_DIRECTORY}/util/font2png.py
|
DEPENDS ${TOOLS_DIRECTORY}/build-font-bitmap.py ${TOOLS_DIRECTORY}/charset.py ${RADIO_SRC_DIRECTORY}/translations/cn.h.txt
|
||||||
)
|
)
|
||||||
|
add_custom_target(truetype_font_${name} DEPENDS ${target}.png ${target}.specs)
|
||||||
set(truetype_fonts_targets ${truetype_fonts_targets} truetype_font_${name})
|
set(truetype_fonts_targets ${truetype_fonts_targets} truetype_font_${name})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -556,6 +556,22 @@ Mode 4:
|
||||||
<source>Note: Nightly builds are not available in this version, Release/RC update channel will be used.</source>
|
<source>Note: Nightly builds are not available in this version, Release/RC update channel will be used.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Use releases (stable)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Use release candidates (testing)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Use nightly builds (unstable)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Use releases and release candidates (testing)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>BinEepromFormat</name>
|
<name>BinEepromFormat</name>
|
||||||
|
@ -3909,6 +3925,14 @@ brytare</translation>
|
||||||
<source>Power Off Delay</source>
|
<source>Power Off Delay</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Power On Speed</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Power Off Speed</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GeneralSetupPanel</name>
|
<name>GeneralSetupPanel</name>
|
||||||
|
@ -6085,6 +6109,10 @@ p, li { white-space: pre-wrap; }
|
||||||
<source>DEST -> %1</source>
|
<source>DEST -> %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>FullScreenDialog</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MixersListWidget</name>
|
<name>MixersListWidget</name>
|
||||||
|
@ -6269,6 +6297,10 @@ p, li { white-space: pre-wrap; }
|
||||||
<source>Outputs</source>
|
<source>Outputs</source>
|
||||||
<translation>Utgångar</translation>
|
<translation>Utgångar</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>FullScreenDialog</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ModelPrinter</name>
|
<name>ModelPrinter</name>
|
||||||
|
@ -7072,6 +7104,14 @@ p, li { white-space: pre-wrap; }
|
||||||
<source>WARNING: Requires non-certified firmware!</source>
|
<source>WARNING: Requires non-certified firmware!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Internal</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Ext. + Int.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ModuleData</name>
|
<name>ModuleData</name>
|
||||||
|
|
|
@ -2,7 +2,7 @@ include(CMakeForceCompiler)
|
||||||
include(Bitmaps)
|
include(Bitmaps)
|
||||||
|
|
||||||
set(PCB_TYPES X9LITE X7 XLITE XLITES X9D X9D+ X9E X10 X12S SKY9X 9XRPRO AR9X NV14)
|
set(PCB_TYPES X9LITE X7 XLITE XLITES X9D X9D+ X9E X10 X12S SKY9X 9XRPRO AR9X NV14)
|
||||||
set(GUI_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL)
|
set(GUI_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL CN)
|
||||||
set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU)
|
set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU)
|
||||||
|
|
||||||
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
||||||
|
@ -247,7 +247,7 @@ endif()
|
||||||
if(SDCARD)
|
if(SDCARD)
|
||||||
add_definitions(-DSDCARD)
|
add_definitions(-DSDCARD)
|
||||||
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
||||||
set(SRC ${SRC} sdcard.cpp rtc.cpp logs.cpp)
|
set(SRC ${SRC} sdcard.cpp rtc.cpp logs.cpp thirdparty/libopenui/src/libopenui_file.cpp)
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${FATFS_SRC})
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${FATFS_SRC})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -1261,3 +1261,13 @@ void pushPrompt(uint16_t prompt, uint8_t id)
|
||||||
audioQueue.playFile(filename, 0, id);
|
audioQueue.playFile(filename, 0, id);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onKeyPress()
|
||||||
|
{
|
||||||
|
audioKeyPress();
|
||||||
|
}
|
||||||
|
|
||||||
|
void onKeyError()
|
||||||
|
{
|
||||||
|
audioKeyError();
|
||||||
|
}
|
|
@ -1,88 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) OpenTX
|
|
||||||
*
|
|
||||||
* Based on code named
|
|
||||||
* th9x - http://code.google.com/p/th9x
|
|
||||||
* er9x - http://code.google.com/p/er9x
|
|
||||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
|
||||||
*
|
|
||||||
* This file is based on work published at http://www.coranac.com/documents/working-with-bits-and-bitfields
|
|
||||||
*
|
|
||||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BITFIELD_H
|
|
||||||
#define BITFIELD_H
|
|
||||||
|
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
// A set of bitfield handling macros
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline T bfBit(uint8_t n)
|
|
||||||
{
|
|
||||||
return T(1) << n;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define BFBIT_SET(y, mask) ( y |= (mask) )
|
|
||||||
#define BFBIT_CLEAR(y, mask) ( y &= ~(mask) )
|
|
||||||
#define BFBIT_FLIP(y, mask) ( y ^= (mask) )
|
|
||||||
#define BF_SINGLE_BIT_SET(y, i) BFBIT_SET(y, bfBit(i))
|
|
||||||
|
|
||||||
//! Create a bitmask of length 'len'.
|
|
||||||
template <typename T>
|
|
||||||
inline T bfBitmask(uint8_t len)
|
|
||||||
{
|
|
||||||
return bfBit<T>(len) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Create a bitfield mask of length 'len' starting at bit 'start'.
|
|
||||||
template <typename T>
|
|
||||||
inline T bfMask(uint8_t start, uint8_t len)
|
|
||||||
{
|
|
||||||
return bfBitmask<T>(len) << start;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Prepare a bitmask for insertion or combining.
|
|
||||||
template <typename T>
|
|
||||||
inline T bfPrep(T x, uint8_t start, uint8_t len)
|
|
||||||
{
|
|
||||||
return (x & bfBitmask<T>(len)) << start;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Extract a bitfield of length 'len' starting at bit 'start' from 'y'.
|
|
||||||
template <typename T>
|
|
||||||
inline T bfGet(T y, uint8_t start, uint8_t len)
|
|
||||||
{
|
|
||||||
return ((y)>>(start)) & bfBitmask<T>(len);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Insert 'len' bits of 'x 'into 'y', starting at bit 'start' from 'y'.
|
|
||||||
template <class T>
|
|
||||||
inline T bfSet(T to, T from, uint8_t start, uint8_t len)
|
|
||||||
{
|
|
||||||
return (to & ~bfMask<T>(start, len)) | bfPrep<T>(from, start, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline T bfBitGet(T y, T mask)
|
|
||||||
{
|
|
||||||
return (y & mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline T bfSingleBitGet(T y, uint8_t i)
|
|
||||||
{
|
|
||||||
return bfBitGet(y, bfBit<T>(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //BITFIELD_H
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "dataconstants.h"
|
#include "dataconstants.h"
|
||||||
#include "definitions.h"
|
#include "definitions.h"
|
||||||
#include "bitfield.h"
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
#define N_TARANIS_FIELD(x)
|
#define N_TARANIS_FIELD(x)
|
||||||
|
@ -55,12 +54,6 @@
|
||||||
#define NOBACKUP(...) __VA_ARGS__
|
#define NOBACKUP(...) __VA_ARGS__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBFRSKY)
|
|
||||||
typedef uint16_t source_t;
|
|
||||||
#else
|
|
||||||
typedef uint8_t source_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mixer structure
|
* Mixer structure
|
||||||
*/
|
*/
|
||||||
|
@ -183,8 +176,6 @@ PACK(struct trim_t {
|
||||||
uint16_t mode:5;
|
uint16_t mode:5;
|
||||||
});
|
});
|
||||||
|
|
||||||
typedef int16_t gvar_t;
|
|
||||||
|
|
||||||
PACK(struct FlightModeData {
|
PACK(struct FlightModeData {
|
||||||
trim_t trim[NUM_TRIMS];
|
trim_t trim[NUM_TRIMS];
|
||||||
NOBACKUP(char name[LEN_FLIGHT_MODE_NAME]);
|
NOBACKUP(char name[LEN_FLIGHT_MODE_NAME]);
|
||||||
|
@ -725,7 +716,7 @@ PACK(struct TrainerData {
|
||||||
#define THEME_NAME_LEN 8
|
#define THEME_NAME_LEN 8
|
||||||
#define THEME_DATA \
|
#define THEME_DATA \
|
||||||
NOBACKUP(char themeName[THEME_NAME_LEN]); \
|
NOBACKUP(char themeName[THEME_NAME_LEN]); \
|
||||||
NOBACKUP(Theme::PersistentData themeData);
|
NOBACKUP(ThemeBase::PersistentData themeData);
|
||||||
#else
|
#else
|
||||||
#define THEME_DATA
|
#define THEME_DATA
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
set(FONT "Roboto/Roboto-Regular")
|
set(FONT "Roboto/Roboto-Regular")
|
||||||
set(FONT_BOLD "Roboto/Roboto-Bold")
|
set(FONT_BOLD "Roboto/Roboto-Bold")
|
||||||
set(FONT_OFFSET 1)
|
set(FONT_OFFSET 1)
|
||||||
|
set(CN_FONT "Noto/NotoSansCJKsc-Regular")
|
||||||
|
set(CN_FONT_BOLD "Noto/NotoSansCJKsc-Bold")
|
||||||
|
set(CN_FONT_OFFSET -3)
|
||||||
|
|
||||||
#set(FONT "Kanit/Kanit-Regular")
|
#set(FONT "Kanit/Kanit-Regular")
|
||||||
#set(FONT_BOLD "Kanit/Kanit-Bold")
|
#set(FONT_BOLD "Kanit/Kanit-Bold")
|
||||||
|
@ -10,15 +13,17 @@ set(FONT_OFFSET 1)
|
||||||
#set(FONT_BOLD "Ubuntu/Ubuntu-Bold")
|
#set(FONT_BOLD "Ubuntu/Ubuntu-Bold")
|
||||||
#set(FONT_OFFSET 1)
|
#set(FONT_OFFSET 1)
|
||||||
|
|
||||||
add_truetype_font_target(9 ${FONT} 9 ${FONT_OFFSET})
|
add_truetype_font_target(9 9 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(13 ${FONT} 13 ${FONT_OFFSET})
|
add_truetype_font_target(13 13 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(15 ${FONT} 15 ${FONT_OFFSET})
|
add_truetype_font_target(15 15 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(16 ${FONT} 16 ${FONT_OFFSET})
|
add_truetype_font_target(16 16 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(bold16 ${FONT_BOLD} 16 ${FONT_OFFSET})
|
add_truetype_font_target(16en 16 "en" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(17 ${FONT} 17 ${FONT_OFFSET})
|
add_truetype_font_target(bold16 16 "all" ${FONT_BOLD} ${FONT_OFFSET} ${CN_FONT_BOLD} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(bold17 ${FONT_BOLD} 17 ${FONT_OFFSET})
|
add_truetype_font_target(17 17 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(24 ${FONT} 24 ${FONT_OFFSET})
|
add_truetype_font_target(17en 17 "en" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(32 ${FONT_BOLD} 32 ${FONT_OFFSET})
|
add_truetype_font_target(bold17 17 "all" ${FONT_BOLD} ${FONT_OFFSET} ${CN_FONT_BOLD} ${CN_FONT_OFFSET})
|
||||||
add_truetype_font_target(64 ${FONT_BOLD} 64 ${FONT_OFFSET})
|
add_truetype_font_target(24 24 "all" ${FONT} ${FONT_OFFSET} ${CN_FONT} ${CN_FONT_OFFSET})
|
||||||
|
add_truetype_font_target(32 32 "all" ${FONT_BOLD} ${FONT_OFFSET} ${CN_FONT_BOLD} ${CN_FONT_OFFSET})
|
||||||
|
add_truetype_font_target(64 64 "all" ${FONT_BOLD} ${FONT_OFFSET} ${CN_FONT_BOLD} ${CN_FONT_OFFSET})
|
||||||
|
|
||||||
add_custom_target(truetype_fonts DEPENDS ${truetype_fonts_targets})
|
add_custom_target(truetype_fonts DEPENDS ${truetype_fonts_targets})
|
||||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 52 KiB |
|
@ -1 +1 @@
|
||||||
17,0,4,9,15,24,33,44,54,58,64,70,77,86,90,95,100,107,116,125,134,143,152,161,170,179,188,197,202,206,214,223,231,239,245,255,265,275,285,294,303,313,324,329,338,348,356,369,380,390,400,410,419,428,437,447,457,470,480,489,498,503,510,515,522,529,535,544,553,561,570,578,584,593,602,607,613,621,626,639,648,657,666,675,681,689,695,704,712,723,731,739,747,757,762,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,778,786,795,801,809,819,828,838,847,857,866,875,883,891,899,905,913,921,930,935,943,952,961,970,979,989,995,1004,1013,1023,1032,1041,1050,1060,1065,1074,1085,1095,1105,1115,1125,1134,1145,1154,1163,1172,1181,1191,1201,1211,1220,1229,1238,1246,1254,1259,1268,1277,1285,1293,1301,1311,1321,1330,1338,1349,1359,1368,1377,1386,1395,1404,1413,1423,1433,1443
|
17,0,5,14,23,34,44,48,54,60,67,76,80,85,90,97,106,115,124,133,142,151,160,169,178,187,192,196,204,213,221,229,235,245,255,265,275,284,293,303,314,319,328,338,346,359,370,380,390,400,409,418,427,437,447,460,470,479,488,493,500,505,512,519,525,534,543,551,560,568,574,583,592,597,603,611,616,629,638,647,656,665,671,679,685,694,702,713,721,729,737,747,752,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,768,776,785,791,799,809,818,828,837,847,856,865,873,881,889,895,903,911,920,925,934,943,952,961,971,977,986,995,1005,1014,1023,1032,1042,1047,1056,1067,1077,1087,1097,1107,1116,1127,1136,1145,1155,1164,1173,1181,1189,1194,1203,1211,1219,1227,1237,1247,1256,1264,1275,1284,1293,1302,1312,1321,1331,1340,1350,1360,1369,1377,1387,1396,1406,1415,1429,1443,1457,1471,1485,1499,1513,1527,1541,1555,1569,1583,1597,1611,1625,1639,1653,1667,1681,1695,1709,1723,1737,1751,1765,1779,1793,1807,1821,1835,1849,1863,1877,1891,1905,1919,1933,1947,1961,1975,1989,2003,2017,2031,2045,2059,2073,2087,2101,2115,2129,2143,2157,2171,2185,2199,2213,2227,2241,2255,2269,2283,2297,2311,2325,2339,2353,2367,2381,2395,2409,2423,2437,2451,2465,2479,2493,2507,2521,2535,2549,2563,2577,2591,2605,2619,2633,2647,2661,2675,2689,2703,2717,2731,2745,2759,2773,2787,2801,2815,2829,2843,2857,2871,2885,2899,2913,2927,2941,2955,2969,2983,2997,3011,3025,3039,3053,3067,3081,3095,3109,3123,3137,3151,3165,3179,3193,3207,3221,3235,3249,3263,3277,3291,3305,3319,3333,3347,3361,3375,3389,3403,3417,3431,3445,3459,3473,3487,3501,3515,3529,3543,3557,3571,3585,3599,3613,3627,3641,3655,3669,3683,3697,3711,3725,3739,3753,3767,3781,3795,3809,3823,3837,3851,3865,3879,3893,3907,3921
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 64 KiB |
|
@ -1 +1 @@
|
||||||
19,0,4,9,15,26,36,48,59,63,70,77,85,95,99,105,110,118,128,138,148,158,168,178,188,198,208,218,223,228,237,247,256,265,272,283,294,305,316,326,336,348,360,366,376,387,397,412,424,436,447,459,470,480,490,501,512,527,538,549,559,564,572,577,585,593,599,609,619,628,638,647,654,664,674,679,685,694,699,714,724,734,744,754,761,770,776,786,795,808,817,826,835,847,852,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,861,870,879,889,896,905,916,926,938,948,959,969,979,988,997,1006,1013,1022,1031,1041,1047,1056,1066,1076,1086,1096,1107,1114,1124,1134,1145,1156,1166,1177,1188,1194,1204,1216,1228,1239,1250,1261,1271,1283,1293,1303,1313,1323,1334,1345,1357,1367,1377,1387,1396,1405,1411,1421,1431,1440,1449,1458,1469,1480,1490,1500,1512,1524,1534,1544,1554,1564,1574,1584,1595,1606,1618
|
19,0,5,16,26,38,49,53,60,67,75,85,89,95,100,108,118,128,138,148,158,168,178,188,198,208,213,218,227,237,246,255,262,273,284,295,306,316,326,338,350,356,366,377,387,402,414,426,437,449,460,470,480,491,502,517,528,539,549,554,562,567,575,583,589,599,609,618,628,637,644,654,664,669,675,684,689,704,714,724,734,744,751,760,766,776,785,798,807,816,825,837,842,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,851,860,869,879,886,895,906,916,928,938,949,959,969,978,987,996,1003,1012,1021,1031,1037,1047,1057,1067,1077,1088,1095,1105,1115,1126,1137,1147,1158,1169,1175,1185,1197,1209,1220,1231,1242,1252,1264,1274,1284,1295,1305,1315,1324,1333,1339,1349,1358,1367,1376,1387,1398,1408,1418,1430,1440,1450,1460,1471,1481,1492,1502,1513,1524,1534,1543,1555,1565,1577,1587,1603,1619,1635,1651,1667,1683,1699,1715,1731,1747,1763,1779,1795,1811,1827,1843,1859,1875,1891,1907,1923,1939,1955,1971,1987,2003,2019,2035,2051,2067,2083,2099,2115,2131,2147,2163,2179,2195,2211,2227,2243,2259,2275,2291,2307,2323,2339,2355,2371,2387,2403,2419,2435,2451,2467,2483,2499,2515,2531,2547,2563,2579,2595,2611,2627,2643,2659,2675,2691,2707,2723,2739,2755,2771,2787,2803,2819,2835,2851,2867,2883,2899,2915,2931,2947,2963,2979,2995,3011,3027,3043,3059,3075,3091,3107,3123,3139,3155,3171,3187,3203,3219,3235,3251,3267,3283,3299,3315,3331,3347,3363,3379,3395,3411,3427,3443,3459,3475,3491,3507,3523,3539,3555,3571,3587,3603,3619,3635,3651,3667,3683,3699,3715,3731,3747,3763,3779,3795,3811,3827,3843,3859,3875,3891,3907,3923,3939,3955,3971,3987,4003,4019,4035,4051,4067,4083,4099,4115,4131,4147,4163,4179,4195,4211,4227,4243,4259,4275,4291,4307,4323,4339,4355,4371,4387,4403,4419,4435,4451
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 75 KiB |
|
@ -1 +1 @@
|
||||||
20,0,4,10,17,28,38,51,62,66,73,80,88,99,104,110,116,124,134,144,154,164,174,184,194,204,214,224,229,234,244,254,264,273,280,292,303,315,327,338,348,360,373,379,389,401,411,426,439,451,463,475,486,497,508,520,532,548,560,571,582,588,596,602,610,619,625,635,645,655,666,676,683,693,703,708,714,724,729,745,755,766,776,787,794,804,811,821,830,844,853,862,871,883,888,898,911,924,937,950,963,976,989,1002,1015,1030,1045,1060,1075,1090,1105,1120,1135,1150,1165,1180,1195,1205,1215,1225,1232,1242,1254,1264,1276,1287,1299,1309,1320,1330,1340,1350,1357,1366,1375,1385,1391,1401,1411,1422,1432,1442,1454,1461,1472,1483,1495,1506,1517,1528,1540,1546,1557,1570,1582,1594,1606,1618,1629,1642,1652,1662,1672,1683,1695,1707,1719,1729,1739,1749,1759,1769,1775,1785,1796,1806,1815,1824,1836,1848,1859,1869,1882,1894,1905,1916,1927,1937,1947,1958,1970,1982,1994
|
20,0,6,17,27,40,51,55,62,69,77,88,93,99,105,113,123,133,143,153,163,173,183,193,203,213,218,223,233,243,253,262,269,281,292,304,316,327,337,349,362,368,378,390,400,415,428,440,452,464,475,486,497,509,521,537,549,560,571,577,585,591,599,608,614,624,634,644,655,665,672,682,692,697,703,713,718,734,744,755,765,776,783,793,800,810,819,833,842,851,860,872,877,887,900,913,926,939,952,965,978,991,1004,1019,1034,1049,1064,1079,1094,1109,1124,1139,1154,1169,1184,1194,1204,1214,1221,1231,1243,1253,1265,1276,1288,1298,1309,1319,1329,1339,1346,1355,1364,1374,1380,1390,1401,1411,1421,1433,1440,1451,1462,1474,1485,1496,1507,1519,1525,1536,1549,1561,1573,1585,1597,1608,1621,1631,1641,1653,1663,1673,1683,1693,1699,1709,1719,1728,1737,1749,1761,1772,1782,1795,1806,1817,1828,1840,1850,1862,1872,1884,1896,1907,1917,1929,1940,1952,1963,1980,1997,2014,2031,2048,2065,2082,2099,2116,2133,2150,2167,2184,2201,2218,2235,2252,2269,2286,2303,2320,2337,2354,2371,2388,2405,2422,2439,2456,2473,2490,2507,2524,2541,2558,2575,2592,2609,2626,2643,2660,2677,2694,2711,2728,2745,2762,2779,2796,2813,2830,2847,2864,2881,2898,2915,2932,2949,2966,2983,3000,3017,3034,3051,3068,3085,3102,3119,3136,3153,3170,3187,3204,3221,3238,3255,3272,3289,3306,3323,3340,3357,3374,3391,3408,3425,3442,3459,3476,3493,3510,3527,3544,3561,3578,3595,3612,3629,3646,3663,3680,3697,3714,3731,3748,3765,3782,3799,3816,3833,3850,3867,3884,3901,3918,3935,3952,3969,3986,4003,4020,4037,4054,4071,4088,4105,4122,4139,4156,4173,4190,4207,4224,4241,4258,4275,4292,4309,4326,4343,4360,4377,4394,4411,4428,4445,4462,4479,4496,4513,4530,4547,4564,4581,4598,4615,4632,4649,4666,4683,4700,4717,4734,4751,4768,4785,4802,4819,4836,4853,4870,4887,4904,4921,4938,4955,4972,4989,5006
|
BIN
radio/src/fonts/truetype/font_16en.png
Normal file
After Width: | Height: | Size: 16 KiB |
1
radio/src/fonts/truetype/font_16en.specs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
20,0,6,17,27,40,51,55,62,69,77,88,93,99,105,113,123,133,143,153,163,173,183,193,203,213,218,223,233,243,253,262,269,281,292,304,316,327,337,349,362,368,378,390,400,415,428,440,452,464,475,486,497,509,521,537,549,560,571,577,585,591,599,608,614,624,634,644,655,665,672,682,692,697,703,713,718,734,744,755,765,776,783,793,800,810,819,833,842,851,860,872,877,887,900,913,926,939,952,965,978,991,1004,1019,1034,1049,1064,1079,1094,1109,1124,1139,1154,1169,1184
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 78 KiB |
|
@ -1 +1 @@
|
||||||
21,0,4,10,17,29,40,54,66,70,77,84,93,104,109,115,121,129,140,151,162,173,184,195,206,217,228,239,245,250,260,271,281,291,299,312,324,337,350,361,372,385,399,405,416,428,439,455,469,482,494,507,519,531,543,556,568,585,597,609,621,627,635,641,650,659,666,677,688,698,709,719,726,737,748,754,761,771,777,793,804,815,826,837,844,854,861,872,882,896,906,916,926,939,945,955,968,981,994,1007,1020,1033,1046,1059,1072,1087,1102,1117,1132,1147,1162,1177,1192,1207,1222,1237,1252,1262,1272,1283,1290,1300,1313,1324,1337,1348,1361,1372,1384,1394,1404,1414,1421,1431,1441,1452,1458,1468,1479,1490,1501,1512,1524,1532,1543,1555,1568,1580,1592,1604,1617,1623,1634,1648,1661,1674,1687,1700,1712,1726,1737,1748,1759,1770,1783,1796,1809,1820,1831,1842,1852,1862,1868,1879,1890,1900,1910,1920,1933,1946,1957,1968,1982,1995,2007,2019,2031,2042,2053,2064,2077,2090,2103
|
21,0,6,18,29,43,55,59,66,73,82,93,98,104,110,118,129,140,151,162,173,184,195,206,217,228,234,239,249,260,270,280,288,301,313,326,339,350,361,374,388,394,405,417,428,444,458,471,483,496,508,520,532,545,557,574,586,598,610,616,624,630,639,648,655,666,677,687,698,708,715,726,737,743,750,760,766,782,793,804,815,826,833,843,850,861,871,885,895,905,915,928,934,944,957,970,983,996,1009,1022,1035,1048,1061,1076,1091,1106,1121,1136,1151,1166,1181,1196,1211,1226,1241,1251,1261,1272,1279,1289,1302,1313,1326,1337,1350,1361,1373,1383,1393,1403,1410,1420,1430,1441,1447,1458,1469,1480,1491,1503,1511,1522,1534,1547,1559,1571,1583,1596,1602,1613,1627,1640,1653,1666,1679,1691,1705,1716,1727,1740,1751,1762,1772,1782,1788,1799,1809,1819,1829,1842,1855,1866,1877,1891,1903,1915,1927,1940,1951,1964,1975,1988,2001,2012,2022,2035,2046,2059,2070,2088,2106,2124,2142,2160,2178,2196,2214,2232,2250,2268,2286,2304,2322,2340,2358,2376,2394,2412,2430,2448,2466,2484,2502,2520,2538,2556,2574,2592,2610,2628,2646,2664,2682,2700,2718,2736,2754,2772,2790,2808,2826,2844,2862,2880,2898,2916,2934,2952,2970,2988,3006,3024,3042,3060,3078,3096,3114,3132,3150,3168,3186,3204,3222,3240,3258,3276,3294,3312,3330,3348,3366,3384,3402,3420,3438,3456,3474,3492,3510,3528,3546,3564,3582,3600,3618,3636,3654,3672,3690,3708,3726,3744,3762,3780,3798,3816,3834,3852,3870,3888,3906,3924,3942,3960,3978,3996,4014,4032,4050,4068,4086,4104,4122,4140,4158,4176,4194,4212,4230,4248,4266,4284,4302,4320,4338,4356,4374,4392,4410,4428,4446,4464,4482,4500,4518,4536,4554,4572,4590,4608,4626,4644,4662,4680,4698,4716,4734,4752,4770,4788,4806,4824,4842,4860,4878,4896,4914,4932,4950,4968,4986,5004,5022,5040,5058,5076,5094,5112,5130,5148,5166,5184,5202,5220,5238,5256,5274,5292
|
BIN
radio/src/fonts/truetype/font_17en.png
Normal file
After Width: | Height: | Size: 16 KiB |
1
radio/src/fonts/truetype/font_17en.specs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
21,0,6,18,29,43,55,59,66,73,82,93,98,104,110,118,129,140,151,162,173,184,195,206,217,228,234,239,249,260,270,280,288,301,313,326,339,350,361,374,388,394,405,417,428,444,458,471,483,496,508,520,532,545,557,574,586,598,610,616,624,630,639,648,655,666,677,687,698,708,715,726,737,743,750,760,766,782,793,804,815,826,833,843,850,861,871,885,895,905,915,928,934,944,957,970,983,996,1009,1022,1035,1048,1061,1076,1091,1106,1121,1136,1151,1166,1181,1196,1211,1226,1241
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 114 KiB |
|
@ -1 +1 @@
|
||||||
28,0,4,12,21,37,52,71,87,93,103,113,125,140,146,154,162,173,188,203,218,233,248,263,278,293,308,323,330,337,351,366,380,393,403,420,436,453,470,485,500,518,537,545,560,577,591,613,632,650,667,685,701,717,733,750,767,790,807,823,839,847,858,866,878,890,899,914,929,943,958,972,982,997,1012,1019,1027,1041,1048,1071,1086,1101,1116,1131,1141,1155,1164,1179,1192,1212,1225,1238,1251,1269,1276,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1304,1318,1333,1342,1356,1373,1388,1406,1421,1438,1453,1469,1483,1497,1511,1521,1534,1547,1562,1570,1584,1599,1614,1629,1644,1661,1671,1686,1702,1719,1735,1751,1767,1784,1792,1807,1826,1844,1861,1878,1895,1911,1930,1945,1960,1975,1990,2007,2024,2042,2057,2072,2087,2101,2115,2123,2138,2153,2167,2180,2193,2210,2227,2242,2256,2275,2293,2309,2325,2341,2356,2371,2386,2403,2420,2438
|
28,0,8,24,39,58,74,80,90,100,112,127,133,141,149,160,175,190,205,220,235,250,265,280,295,310,317,324,338,353,367,380,390,407,423,440,457,472,487,505,524,532,547,564,578,600,619,637,654,672,688,704,720,737,754,777,794,810,826,834,845,853,865,877,886,901,916,930,945,959,969,984,999,1006,1014,1028,1035,1058,1073,1088,1103,1118,1128,1142,1151,1166,1179,1199,1212,1225,1238,1256,1263,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1277,1291,1305,1320,1329,1343,1360,1375,1393,1408,1425,1440,1456,1470,1484,1498,1508,1521,1534,1549,1557,1572,1587,1602,1617,1634,1644,1659,1675,1692,1708,1724,1740,1757,1765,1780,1799,1817,1834,1851,1868,1884,1903,1918,1933,1950,1965,1980,1994,2008,2016,2031,2045,2058,2071,2088,2105,2120,2134,2153,2169,2185,2201,2218,2233,2250,2265,2282,2299,2314,2328,2346,2361,2379,2394,2419,2444,2469,2494,2519,2544,2569,2594,2619,2644,2669,2694,2719,2744,2769,2794,2819,2844,2869,2894,2919,2944,2969,2994,3019,3044,3069,3094,3119,3144,3169,3194,3219,3244,3269,3294,3319,3344,3369,3394,3419,3444,3469,3494,3519,3544,3569,3594,3619,3644,3669,3694,3719,3744,3769,3794,3819,3844,3869,3894,3919,3944,3969,3994,4019,4044,4069,4094,4119,4144,4169,4194,4219,4244,4269,4294,4319,4344,4369,4394,4419,4444,4469,4494,4519,4544,4569,4594,4619,4644,4669,4694,4719,4744,4769,4794,4819,4844,4869,4894,4919,4944,4969,4994,5019,5044,5069,5094,5119,5144,5169,5194,5219,5244,5269,5294,5319,5344,5369,5394,5419,5444,5469,5494,5519,5544,5569,5594,5619,5644,5669,5694,5719,5744,5769,5794,5819,5844,5869,5894,5919,5944,5969,5994,6019,6044,6069,6094,6119,6144,6169,6194,6219,6244,6269,6294,6319,6344,6369,6394,6419,6444,6469,6494,6519,6544,6569,6594,6619,6644,6669,6694,6719,6744,6769,6794,6819,6844,6869
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 145 KiB |
|
@ -1 +1 @@
|
||||||
36,0,4,14,26,47,67,92,114,121,134,147,163,182,191,205,216,230,250,270,290,310,330,350,370,390,410,430,441,451,469,489,507,524,538,561,583,605,627,646,665,688,712,723,742,764,783,813,837,861,883,907,929,950,971,994,1016,1045,1067,1088,1109,1119,1135,1145,1160,1176,1188,1207,1227,1245,1265,1284,1297,1317,1336,1346,1358,1377,1387,1416,1435,1455,1475,1495,1508,1526,1538,1557,1575,1600,1618,1636,1654,1676,1686,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1704,1723,1742,1761,1775,1793,1816,1835,1859,1879,1902,1921,1943,1962,1980,1998,2012,2030,2048,2067,2079,2098,2117,2137,2156,2175,2198,2213,2232,2253,2275,2297,2318,2339,2362,2374,2393,2417,2441,2464,2487,2509,2530,2554,2573,2592,2611,2631,2654,2677,2701,2720,2739,2758,2776,2795,2806,2825,2845,2863,2881,2899,2922,2944,2963,2982,3006,3030,3051,3072,3093,3112,3131,3151,3174,3197,3221
|
36,0,10,31,51,76,98,105,118,131,147,166,175,189,200,214,234,254,274,294,314,334,354,374,394,414,425,435,453,473,491,508,522,545,567,589,611,630,649,672,696,707,726,748,767,797,821,845,867,891,913,934,955,978,1000,1029,1051,1072,1093,1103,1119,1129,1144,1160,1172,1191,1211,1229,1249,1268,1281,1301,1320,1330,1342,1361,1371,1400,1419,1439,1459,1479,1492,1510,1522,1541,1559,1584,1602,1620,1638,1660,1670,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1688,1707,1726,1745,1759,1777,1800,1819,1843,1863,1886,1905,1927,1946,1964,1982,1996,2014,2032,2051,2063,2082,2102,2121,2140,2163,2178,2197,2218,2240,2262,2283,2304,2327,2339,2358,2382,2406,2429,2452,2474,2495,2519,2538,2557,2580,2599,2618,2636,2655,2666,2685,2703,2721,2739,2762,2784,2803,2822,2846,2867,2888,2909,2932,2951,2974,2993,3016,3038,3057,3076,3100,3120,3144,3164,3197,3230,3263,3296,3329,3362,3395,3428,3461,3494,3527,3560,3593,3626,3659,3692,3725,3758,3791,3824,3857,3890,3923,3956,3989,4022,4055,4088,4121,4154,4187,4220,4253,4286,4319,4352,4385,4418,4451,4484,4517,4550,4583,4616,4649,4682,4715,4748,4781,4814,4847,4880,4913,4946,4979,5012,5045,5078,5111,5144,5177,5210,5243,5276,5309,5342,5375,5408,5441,5474,5507,5540,5573,5606,5639,5672,5705,5738,5771,5804,5837,5870,5903,5936,5969,6002,6035,6068,6101,6134,6167,6200,6233,6266,6299,6332,6365,6398,6431,6464,6497,6530,6563,6596,6629,6662,6695,6728,6761,6794,6827,6860,6893,6926,6959,6992,7025,7058,7091,7124,7157,7190,7223,7256,7289,7322,7355,7388,7421,7454,7487,7520,7553,7586,7619,7652,7685,7718,7751,7784,7817,7850,7883,7916,7949,7982,8015,8048,8081,8114,8147,8180,8213,8246,8279,8312,8345,8378,8411,8444,8477,8510,8543,8576,8609,8642,8675,8708,8741,8774,8807,8840,8873,8906,8939,8972,9005,9038,9071
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 281 KiB |
|
@ -1 +1 @@
|
||||||
68,0,4,23,45,85,123,172,215,227,251,275,305,341,358,384,404,430,468,506,544,582,620,658,696,734,772,810,830,848,882,920,955,988,1014,1059,1101,1144,1187,1224,1261,1306,1353,1373,1410,1453,1489,1547,1594,1640,1683,1729,1771,1812,1853,1897,1940,1997,2039,2080,2120,2139,2169,2188,2217,2247,2270,2306,2344,2379,2417,2453,2477,2515,2552,2570,2591,2627,2645,2702,2739,2777,2815,2853,2878,2912,2935,2972,3006,3055,3089,3123,3157,3200,3218,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3253,3289,3325,3361,3387,3422,3467,3503,3549,3587,3631,3668,3710,3746,3780,3815,3842,3876,3910,3946,3968,4004,4041,4079,4116,4153,4198,4226,4263,4304,4347,4389,4429,4470,4515,4537,4574,4621,4667,4711,4755,4798,4839,4886,4923,4959,4995,5033,5078,5123,5169,5205,5242,5278,5313,5349,5370,5407,5445,5479,5513,5547,5592,5635,5672,5709,5756,5802,5843,5883,5923,5959,5995,6033,6078,6123,6169
|
68,0,19,59,97,146,189,201,225,249,279,315,332,358,378,404,442,480,518,556,594,632,670,708,746,784,804,822,856,894,929,962,988,1033,1075,1118,1161,1198,1235,1280,1327,1347,1384,1427,1463,1521,1568,1614,1657,1703,1745,1786,1827,1871,1914,1971,2013,2054,2094,2113,2143,2162,2191,2221,2244,2280,2318,2353,2391,2427,2451,2489,2526,2544,2565,2601,2619,2676,2713,2751,2789,2827,2852,2886,2909,2946,2980,3029,3063,3097,3131,3174,3192,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3227,3263,3299,3335,3361,3396,3441,3477,3523,3561,3605,3642,3684,3720,3754,3789,3816,3850,3884,3920,3942,3979,4017,4054,4091,4136,4164,4201,4242,4285,4327,4367,4408,4453,4475,4512,4559,4605,4649,4693,4736,4777,4824,4861,4897,4942,4979,5015,5050,5086,5107,5144,5178,5212,5246,5291,5334,5371,5408,5455,5496,5536,5576,5621,5657,5702,5738,5783,5826,5863,5899,5945,5983,6029,6067,6132,6197,6262,6327,6392,6457,6522,6587,6652,6717,6782,6847,6912,6977,7042,7107,7172,7237,7302,7367,7432,7497,7562,7627,7692,7757,7822,7887,7952,8017,8082,8147,8212,8277,8342,8407,8472,8537,8602,8667,8732,8797,8862,8927,8992,9057,9122,9187,9252,9317,9382,9447,9512,9577,9642,9707,9772,9837,9902,9967,10032,10097,10162,10227,10292,10357,10422,10487,10552,10617,10682,10747,10812,10877,10942,11007,11072,11137,11202,11267,11332,11397,11462,11527,11592,11657,11722,11787,11852,11917,11982,12047,12112,12177,12242,12307,12372,12437,12502,12567,12632,12697,12762,12827,12892,12957,13022,13087,13152,13217,13282,13347,13412,13477,13542,13607,13672,13737,13802,13867,13932,13997,14062,14127,14192,14257,14322,14387,14452,14517,14582,14647,14712,14777,14842,14907,14972,15037,15102,15167,15232,15297,15362,15427,15492,15557,15622,15687,15752,15817,15882,15947,16012,16077,16142,16207,16272,16337,16402,16467,16532,16597,16662,16727,16792,16857,16922,16987,17052,17117,17182,17247,17312,17377,17442,17507,17572,17637,17702
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 36 KiB |
|
@ -1 +1 @@
|
||||||
13,0,4,8,12,19,26,34,41,44,49,54,59,66,69,73,77,82,89,96,103,110,117,124,131,138,145,152,156,159,165,171,177,183,188,195,202,209,216,223,229,237,245,249,255,262,268,277,285,293,300,308,315,322,329,336,343,352,359,366,373,377,382,386,391,397,401,407,414,420,427,433,438,445,451,455,460,466,470,479,485,492,499,506,511,517,521,527,533,541,547,553,559,567,571,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,583,589,595,600,606,613,619,627,634,641,647,654,660,666,672,677,683,689,695,699,705,711,718,724,730,737,742,749,756,763,770,777,784,791,795,802,810,818,825,832,839,846,854,860,866,872,879,886,893,901,907,913,919,925,931,935,941,948,954,960,966,973,980,987,993,1001,1009,1016,1023,1030,1036,1042,1049,1056,1063,1071
|
13,0,4,11,18,26,33,36,41,46,51,58,61,65,69,74,81,88,95,102,109,116,123,130,137,144,148,151,157,163,169,175,180,187,194,201,208,215,221,229,237,241,247,254,260,269,277,285,292,300,307,314,321,328,335,344,351,358,365,369,374,378,383,389,393,399,406,412,419,425,430,437,443,447,452,458,462,471,477,484,491,498,503,509,513,519,525,533,539,545,551,559,563,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,575,581,587,592,598,605,611,619,626,633,639,646,652,658,664,669,675,681,687,691,697,704,710,716,723,728,735,742,749,756,763,770,777,781,788,796,804,811,818,825,832,840,846,852,859,865,871,877,883,887,893,899,905,911,918,925,932,938,946,953,960,967,974,980,987,993,1000,1007,1014,1020,1028,1035,1043,1050,1060,1070,1080,1090,1100,1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220,1230,1240,1250,1260,1270,1280,1290,1300,1310,1320,1330,1340,1350,1360,1370,1380,1390,1400,1410,1420,1430,1440,1450,1460,1470,1480,1490,1500,1510,1520,1530,1540,1550,1560,1570,1580,1590,1600,1610,1620,1630,1640,1650,1660,1670,1680,1690,1700,1710,1720,1730,1740,1750,1760,1770,1780,1790,1800,1810,1820,1830,1840,1850,1860,1870,1880,1890,1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000,2010,2020,2030,2040,2050,2060,2070,2080,2090,2100,2110,2120,2130,2140,2150,2160,2170,2180,2190,2200,2210,2220,2230,2240,2250,2260,2270,2280,2290,2300,2310,2320,2330,2340,2350,2360,2370,2380,2390,2400,2410,2420,2430,2440,2450,2460,2470,2480,2490,2500,2510,2520,2530,2540,2550,2560,2570,2580,2590,2600,2610,2620,2630,2640,2650,2660,2670,2680,2690,2700,2710,2720,2730,2740,2750,2760,2770,2780,2790,2800,2810,2820,2830,2840
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 72 KiB |
|
@ -1 +1 @@
|
||||||
20,0,4,10,17,28,39,52,64,68,75,82,91,101,106,114,120,128,139,150,161,172,183,194,205,216,227,238,244,250,260,271,281,290,298,310,322,334,346,356,366,378,391,397,407,419,429,445,458,471,483,496,508,519,530,542,554,569,581,592,603,609,618,624,632,641,648,658,669,679,690,700,707,718,728,734,741,751,757,772,782,793,804,815,822,832,839,849,859,872,882,892,902,914,920,930,943,956,969,982,995,1008,1021,1034,1047,1062,1077,1092,1107,1122,1137,1152,1167,1182,1197,1212,1227,1237,1247,1257,1265,1275,1287,1297,1310,1321,1333,1343,1355,1365,1375,1385,1393,1403,1413,1423,1430,1440,1450,1461,1471,1481,1493,1501,1511,1522,1534,1546,1557,1568,1580,1587,1597,1610,1623,1635,1647,1659,1670,1683,1693,1703,1713,1724,1736,1748,1761,1771,1781,1791,1801,1811,1817,1827,1838,1848,1858,1868,1880,1892,1902,1912,1925,1938,1949,1960,1971,1981,1991,2002,2014,2026,2039
|
20,0,6,17,28,41,53,57,64,71,80,90,95,103,109,117,128,139,150,161,172,183,194,205,216,227,233,239,249,260,270,279,287,299,311,323,335,345,355,367,380,386,396,408,418,434,447,460,472,485,497,508,519,531,543,558,570,581,592,598,607,613,621,630,637,647,658,668,679,689,696,707,717,723,730,740,746,761,771,782,793,804,811,821,828,838,848,861,871,881,891,903,909,919,932,945,958,971,984,997,1010,1023,1036,1051,1066,1081,1096,1111,1126,1141,1156,1171,1186,1201,1216,1226,1236,1246,1254,1264,1276,1286,1299,1310,1322,1332,1344,1354,1364,1374,1382,1392,1402,1412,1419,1429,1440,1450,1460,1472,1480,1490,1501,1513,1525,1536,1547,1559,1566,1576,1589,1602,1614,1626,1638,1649,1662,1672,1682,1694,1704,1714,1724,1734,1740,1750,1760,1770,1780,1792,1804,1814,1824,1837,1848,1859,1870,1882,1892,1904,1914,1926,1938,1948,1958,1971,1982,1995,2006,2023,2040,2057,2074,2091,2108,2125,2142,2159,2176,2193,2210,2227,2244,2261,2278,2295,2312,2329,2346,2363,2380,2397,2414,2431,2448,2465,2482,2499,2516,2533,2550,2567,2584,2601,2618,2635,2652,2669,2686,2703,2720,2737,2754,2771,2788,2805,2822,2839,2856,2873,2890,2907,2924,2941,2958,2975,2992,3009,3026,3043,3060,3077,3094,3111,3128,3145,3162,3179,3196,3213,3230,3247,3264,3281,3298,3315,3332,3349,3366,3383,3400,3417,3434,3451,3468,3485,3502,3519,3536,3553,3570,3587,3604,3621,3638,3655,3672,3689,3706,3723,3740,3757,3774,3791,3808,3825,3842,3859,3876,3893,3910,3927,3944,3961,3978,3995,4012,4029,4046,4063,4080,4097,4114,4131,4148,4165,4182,4199,4216,4233,4250,4267,4284,4301,4318,4335,4352,4369,4386,4403,4420,4437,4454,4471,4488,4505,4522,4539,4556,4573,4590,4607,4624,4641,4658,4675,4692,4709,4726,4743,4760,4777,4794,4811,4828,4845,4862,4879,4896,4913,4930,4947,4964,4981,4998,5015,5032,5049
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 74 KiB |
|
@ -1 +1 @@
|
||||||
21,0,4,10,17,29,40,54,67,71,78,85,94,105,111,119,125,134,145,156,167,178,189,200,211,222,233,244,250,256,266,277,287,297,305,318,330,343,356,367,378,391,405,411,422,434,445,461,474,487,499,512,524,536,548,561,574,590,602,614,626,632,641,647,656,665,672,683,694,704,715,726,734,745,756,762,769,780,786,802,813,824,835,846,854,864,871,882,892,906,916,926,936,949,955,965,978,991,1004,1017,1030,1043,1056,1069,1082,1097,1112,1127,1142,1157,1172,1187,1202,1217,1232,1247,1262,1273,1284,1295,1303,1313,1326,1337,1350,1361,1374,1385,1397,1408,1418,1428,1436,1446,1456,1467,1474,1485,1496,1507,1518,1529,1542,1551,1562,1574,1587,1599,1611,1623,1636,1643,1654,1667,1680,1693,1706,1719,1731,1744,1755,1766,1777,1788,1801,1814,1827,1838,1849,1860,1870,1881,1888,1899,1910,1920,1930,1940,1953,1966,1977,1988,2001,2014,2026,2038,2050,2061,2072,2083,2096,2109,2122
|
21,0,6,18,29,43,56,60,67,74,83,94,100,108,114,123,134,145,156,167,178,189,200,211,222,233,239,245,255,266,276,286,294,307,319,332,345,356,367,380,394,400,411,423,434,450,463,476,488,501,513,525,537,550,563,579,591,603,615,621,630,636,645,654,661,672,683,693,704,715,723,734,745,751,758,769,775,791,802,813,824,835,843,853,860,871,881,895,905,915,925,938,944,954,967,980,993,1006,1019,1032,1045,1058,1071,1086,1101,1116,1131,1146,1161,1176,1191,1206,1221,1236,1251,1262,1273,1284,1292,1302,1315,1326,1339,1350,1363,1374,1386,1397,1407,1417,1425,1435,1445,1456,1463,1474,1485,1496,1507,1520,1529,1540,1552,1565,1577,1589,1601,1614,1621,1632,1645,1658,1671,1684,1697,1709,1722,1733,1744,1757,1768,1779,1789,1800,1807,1818,1828,1838,1848,1861,1874,1885,1896,1909,1921,1933,1945,1958,1969,1982,1993,2006,2019,2030,2041,2054,2065,2078,2089,2107,2125,2143,2161,2179,2197,2215,2233,2251,2269,2287,2305,2323,2341,2359,2377,2395,2413,2431,2449,2467,2485,2503,2521,2539,2557,2575,2593,2611,2629,2647,2665,2683,2701,2719,2737,2755,2773,2791,2809,2827,2845,2863,2881,2899,2917,2935,2953,2971,2989,3007,3025,3043,3061,3079,3097,3115,3133,3151,3169,3187,3205,3223,3241,3259,3277,3295,3313,3331,3349,3367,3385,3403,3421,3439,3457,3475,3493,3511,3529,3547,3565,3583,3601,3619,3637,3655,3673,3691,3709,3727,3745,3763,3781,3799,3817,3835,3853,3871,3889,3907,3925,3943,3961,3979,3997,4015,4033,4051,4069,4087,4105,4123,4141,4159,4177,4195,4213,4231,4249,4267,4285,4303,4321,4339,4357,4375,4393,4411,4429,4447,4465,4483,4501,4519,4537,4555,4573,4591,4609,4627,4645,4663,4681,4699,4717,4735,4753,4771,4789,4807,4825,4843,4861,4879,4897,4915,4933,4951,4969,4987,5005,5023,5041,5059,5077,5095,5113,5131,5149,5167,5185,5203,5221,5239,5257,5275,5293,5311
|
|
@ -2,7 +2,6 @@ set(GUI_SRC
|
||||||
${GUI_SRC}
|
${GUI_SRC}
|
||||||
lcd.cpp
|
lcd.cpp
|
||||||
splash.cpp
|
splash.cpp
|
||||||
fonts.cpp
|
|
||||||
popups.cpp
|
popups.cpp
|
||||||
widgets.cpp
|
widgets.cpp
|
||||||
startup_shutdown.cpp
|
startup_shutdown.cpp
|
||||||
|
|
|
@ -187,8 +187,6 @@ choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values
|
||||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
|
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
|
||||||
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
|
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
|
||||||
|
|
||||||
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
|
|
||||||
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
#define GVAR_MENU_ITEM(x, y, v, min, max, attr, editflags, event) editGVarFieldValue(x, y, v, min, max, attr, editflags, event)
|
#define GVAR_MENU_ITEM(x, y, v, min, max, attr, editflags, event) editGVarFieldValue(x, y, v, min, max, attr, editflags, event)
|
||||||
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, event_t event);
|
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, event_t event);
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
#include "gui/common/stdlcd/fonts.h"
|
||||||
|
|
||||||
display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
|
|
||||||
void lcdClear()
|
void lcdClear()
|
||||||
{
|
{
|
||||||
|
@ -264,12 +265,10 @@ void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags)
|
||||||
q = &font_3x5[((uint16_t)c-0x20)*3];
|
q = &font_3x5[((uint16_t)c-0x20)*3];
|
||||||
lcdPutPattern(x, y, q, 3, 5, flags);
|
lcdPutPattern(x, y, q, 3, 5, flags);
|
||||||
}
|
}
|
||||||
#if defined(BOLD_FONT)
|
|
||||||
else if (flags & BOLD) {
|
else if (flags & BOLD) {
|
||||||
q = &font_5x7_B[c_remapped*5];
|
q = &font_5x7_B[c_remapped*5];
|
||||||
lcdPutPattern(x, y, q, 5, 7, flags);
|
lcdPutPattern(x, y, q, 5, 7, flags);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -604,7 +603,7 @@ void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat,
|
||||||
|
|
||||||
void drawTelemetryTopBar()
|
void drawTelemetryTopBar()
|
||||||
{
|
{
|
||||||
putsModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
|
drawModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
|
||||||
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
|
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
|
||||||
putsVBat(14*FW,0,att);
|
putsVBat(14*FW,0,att);
|
||||||
if (g_model.timers[0].mode) {
|
if (g_model.timers[0].mode) {
|
||||||
|
@ -776,7 +775,7 @@ void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
void drawModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t len = sizeof(g_model.header.name);
|
uint8_t len = sizeof(g_model.header.name);
|
||||||
while (len>0 && !name[len-1]) --len;
|
while (len>0 && !name[len-1]) --len;
|
||||||
|
|
|
@ -23,14 +23,8 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
typedef int coord_t;
|
|
||||||
struct point_t
|
|
||||||
{
|
|
||||||
coord_t x;
|
|
||||||
coord_t y;
|
|
||||||
};
|
|
||||||
typedef uint32_t LcdFlags;
|
typedef uint32_t LcdFlags;
|
||||||
typedef uint8_t display_t;
|
typedef uint8_t pixel_t;
|
||||||
|
|
||||||
#define BOX_WIDTH 23
|
#define BOX_WIDTH 23
|
||||||
#define CENTER
|
#define CENTER
|
||||||
|
@ -48,11 +42,7 @@ typedef uint8_t display_t;
|
||||||
/* lcdDrawText flags */
|
/* lcdDrawText flags */
|
||||||
#define BLINK 0x01
|
#define BLINK 0x01
|
||||||
#define INVERS 0x02
|
#define INVERS 0x02
|
||||||
#if defined(BOLD_FONT)
|
#define BOLD 0x40
|
||||||
#define BOLD 0x40
|
|
||||||
#else
|
|
||||||
#define BOLD 0x00
|
|
||||||
#endif
|
|
||||||
#define LEFT 0x00 /* fake */
|
#define LEFT 0x00 /* fake */
|
||||||
#define RIGHT 0x04 /* align right */
|
#define RIGHT 0x04 /* align right */
|
||||||
#define CENTERED 0x20
|
#define CENTERED 0x20
|
||||||
|
@ -95,7 +85,7 @@ typedef uint8_t display_t;
|
||||||
|
|
||||||
#define DISPLAY_BUFFER_SIZE (LCD_W*((LCD_H+7)/8))
|
#define DISPLAY_BUFFER_SIZE (LCD_W*((LCD_H+7)/8))
|
||||||
|
|
||||||
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
extern pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
extern coord_t lcdLastRightPos;
|
extern coord_t lcdLastRightPos;
|
||||||
extern coord_t lcdLastLeftPos;
|
extern coord_t lcdLastLeftPos;
|
||||||
extern coord_t lcdNextPos;
|
extern coord_t lcdNextPos;
|
||||||
|
@ -127,7 +117,7 @@ void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags mode, uint8_t len);
|
||||||
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags mode=0);
|
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags mode=0);
|
||||||
void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val);
|
void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val);
|
||||||
|
|
||||||
void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att);
|
void drawModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att);
|
||||||
#if !defined(BOOT) // TODO not here ...
|
#if !defined(BOOT) // TODO not here ...
|
||||||
void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0);
|
void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0);
|
||||||
void drawSource(coord_t x, coord_t y, mixsrc_t idx, LcdFlags att=0);
|
void drawSource(coord_t x, coord_t y, mixsrc_t idx, LcdFlags att=0);
|
||||||
|
@ -190,14 +180,14 @@ uint8_t * lcdLoadBitmap(uint8_t * dest, const char * filename, uint8_t width, ui
|
||||||
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
|
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline display_t getPixel(uint8_t x, uint8_t y)
|
inline pixel_t getPixel(uint8_t x, uint8_t y)
|
||||||
{
|
{
|
||||||
if (x>=LCD_W || y>=LCD_H) {
|
if (x>=LCD_W || y>=LCD_H) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
display_t pixel = displayBuf[(y / 8) * LCD_W + x];
|
pixel_t pixel = displayBuf[(y / 8) * LCD_W + x];
|
||||||
display_t mask = 1 << (y & 7);
|
pixel_t mask = 1 << (y & 7);
|
||||||
return ((pixel & mask) ? 0xf : 0);
|
return ((pixel & mask) ? 0xf : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@ void menuModelFlightModesAll(event_t event)
|
||||||
|
|
||||||
if (menuVerticalOffset != MAX_FLIGHT_MODES-(LCD_LINES-2)) return;
|
if (menuVerticalOffset != MAX_FLIGHT_MODES-(LCD_LINES-2)) return;
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS);
|
lcdDrawText(LCD_W/2, (LCD_LINES-1)*FH+1, STR_CHECKTRIMS, CENTERED);
|
||||||
drawFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
|
drawFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, mixerCurrentFlightMode+1);
|
||||||
if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) {
|
if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) {
|
||||||
lcdInvertLastLine();
|
lcdInvertLastLine();
|
||||||
|
|
|
@ -103,7 +103,7 @@ void menuModelGVarOne(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GVAR_FIELD_POPUP:
|
case GVAR_FIELD_POPUP:
|
||||||
ON_OFF_MENU_ITEM(gvar->popup, GVAR_2ND_COLUMN, y, STR_POPUP, attr, event);
|
gvar->popup = editCheckBox(gvar->popup, GVAR_2ND_COLUMN, y, STR_POPUP, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -307,7 +307,7 @@ void menuModelSelect(event_t event)
|
||||||
k %= MAX_MODELS;
|
k %= MAX_MODELS;
|
||||||
|
|
||||||
if (eeModelExists(k)) {
|
if (eeModelExists(k)) {
|
||||||
putsModelName(4*FW, y, modelHeaders[k].name, k, 0);
|
drawModelName(4*FW, y, modelHeaders[k].name, k, 0);
|
||||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+menuVerticalOffset!=(vertpos_t)sub)) {
|
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+menuVerticalOffset!=(vertpos_t)sub)) {
|
||||||
lcdDrawChar(1, y, '*');
|
lcdDrawChar(1, y, '*');
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,7 +372,7 @@ void menuModelSetup(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, HEADER_LINE + ITEM_MODEL_SETUP_LINES_COUNT);
|
MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, HEADER_LINE + ITEM_MODEL_SETUP_LINES_COUNT);
|
||||||
title(STR_MENUSETUP);
|
title(STR_MENU_MODEL_SETUP);
|
||||||
|
|
||||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) {
|
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) {
|
||||||
memclear(&reusableBuffer.moduleSetup, sizeof(reusableBuffer.moduleSetup));
|
memclear(&reusableBuffer.moduleSetup, sizeof(reusableBuffer.moduleSetup));
|
||||||
|
@ -499,11 +499,11 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_EXTENDED_LIMITS:
|
case ITEM_MODEL_SETUP_EXTENDED_LIMITS:
|
||||||
ON_OFF_MENU_ITEM(g_model.extendedLimits, MODEL_SETUP_2ND_COLUMN, y, STR_ELIMITS, attr, event);
|
g_model.extendedLimits = editCheckBox(g_model.extendedLimits, MODEL_SETUP_2ND_COLUMN, y, STR_ELIMITS, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_EXTENDED_TRIMS:
|
case ITEM_MODEL_SETUP_EXTENDED_TRIMS:
|
||||||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, menuHorizontalPosition<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
g_model.extendedTrims = editCheckBox(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, menuHorizontalPosition<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_RESET_BTN, (menuHorizontalPosition>0 && !NO_HIGHLIGHT()) ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_RESET_BTN, (menuHorizontalPosition>0 && !NO_HIGHLIGHT()) ? attr : 0);
|
||||||
if (attr && menuHorizontalPosition>0) {
|
if (attr && menuHorizontalPosition>0) {
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
|
@ -527,7 +527,7 @@ void menuModelSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
||||||
ON_OFF_MENU_ITEM(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEREVERSE, attr, event ) ;
|
g_model.throttleReversed = editCheckBox(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEREVERSE, attr, event ) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_TRACE:
|
case ITEM_MODEL_SETUP_THROTTLE_TRACE:
|
||||||
|
@ -544,7 +544,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_TRIM:
|
case ITEM_MODEL_SETUP_THROTTLE_TRIM:
|
||||||
ON_OFF_MENU_ITEM(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN, y, STR_TTRIM, attr, event);
|
g_model.thrTrim = editCheckBox(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN, y, STR_TTRIM, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
||||||
|
@ -552,11 +552,11 @@ void menuModelSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
||||||
ON_OFF_MENU_ITEM(g_model.displayChecklist, MODEL_SETUP_2ND_COLUMN, y, STR_CHECKLIST, attr, event);
|
g_model.displayChecklist = editCheckBox(g_model.displayChecklist, MODEL_SETUP_2ND_COLUMN, y, STR_CHECKLIST, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_WARNING:
|
case ITEM_MODEL_SETUP_THROTTLE_WARNING:
|
||||||
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEWARNING, attr, event);
|
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLE_WARNING, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
|
@ -1455,7 +1455,7 @@ void menuModelSetup(event_t event)
|
||||||
auto & module = g_model.moduleData[moduleIdx];
|
auto & module = g_model.moduleData[moduleIdx];
|
||||||
// Lite FCC / Lite FLEX / Lite Pro Flex
|
// Lite FCC / Lite FLEX / Lite Pro Flex
|
||||||
if (isModuleTypeR9MNonAccess(module.type)) {
|
if (isModuleTypeR9MNonAccess(module.type)) {
|
||||||
lcdDrawTextAlignedLeft(y, STR_RFPOWER);
|
lcdDrawTextAlignedLeft(y, STR_RF_POWER);
|
||||||
if (isModuleR9M_FCC_VARIANT(moduleIdx)) {
|
if (isModuleR9M_FCC_VARIANT(moduleIdx)) {
|
||||||
// FCC and FLEX modes ...
|
// FCC and FLEX modes ...
|
||||||
if (isModuleTypeR9MLiteNonPro(module.type)) { // R9M lite FCC has only one power value, so displayed for info only
|
if (isModuleTypeR9MLiteNonPro(module.type)) { // R9M lite FCC has only one power value, so displayed for info only
|
||||||
|
|
|
@ -188,7 +188,7 @@ void menuModelTelemetry(event_t event)
|
||||||
|
|
||||||
#if defined(REVX)
|
#if defined(REVX)
|
||||||
case ITEM_TELEMETRY_INVERTED_SERIAL:
|
case ITEM_TELEMETRY_INVERTED_SERIAL:
|
||||||
ON_OFF_MENU_ITEM(g_model.moduleData[EXTERNAL_MODULE].invertedSerial, TELEM_COL2, y, STR_INVERTED_SERIAL, attr, event);
|
g_model.moduleData[EXTERNAL_MODULE].invertedSerial = editCheckBox(g_model.moduleData[EXTERNAL_MODULE].invertedSerial, TELEM_COL2, y, STR_INVERTED_SERIAL, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ void menuModelTelemetry(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_TELEMETRY_IGNORE_SENSOR_INSTANCE:
|
case ITEM_TELEMETRY_IGNORE_SENSOR_INSTANCE:
|
||||||
ON_OFF_MENU_ITEM(g_model.ignoreSensorIds, TELEM_COL2, y, STR_IGNORE_INSTANCE, attr, event);
|
g_model.ignoreSensorIds = editCheckBox(g_model.ignoreSensorIds, TELEM_COL2, y, STR_IGNORE_INSTANCE, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_TELEMETRY_RSSI_LABEL:
|
case ITEM_TELEMETRY_RSSI_LABEL:
|
||||||
|
|
|
@ -205,7 +205,7 @@ void menuModelSensor(event_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sensor->unit == UNIT_RPMS) {
|
if (sensor->unit == UNIT_RPMS) {
|
||||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_BLADES));
|
lcdDrawTextAlignedLeft(y, STR_BLADES);
|
||||||
if (attr) CHECK_INCDEC_MODELVAR(event, sensor->custom.ratio, 1, 30000);
|
if (attr) CHECK_INCDEC_MODELVAR(event, sensor->custom.ratio, 1, 30000);
|
||||||
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr);
|
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr);
|
||||||
break;
|
break;
|
||||||
|
@ -273,31 +273,30 @@ void menuModelSensor(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case SENSOR_FIELD_AUTOOFFSET:
|
case SENSOR_FIELD_AUTOOFFSET:
|
||||||
ON_OFF_MENU_ITEM(sensor->autoOffset, SENSOR_2ND_COLUMN, y, STR_AUTOOFFSET, attr, event);
|
sensor->autoOffset = editCheckBox(sensor->autoOffset, SENSOR_2ND_COLUMN, y, STR_AUTOOFFSET, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_ONLYPOSITIVE:
|
case SENSOR_FIELD_ONLYPOSITIVE:
|
||||||
ON_OFF_MENU_ITEM(sensor->onlyPositive, SENSOR_2ND_COLUMN, y, STR_ONLYPOSITIVE, attr, event);
|
sensor->onlyPositive = editCheckBox(sensor->onlyPositive, SENSOR_2ND_COLUMN, y, STR_ONLYPOSITIVE, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_FILTER:
|
case SENSOR_FIELD_FILTER:
|
||||||
ON_OFF_MENU_ITEM(sensor->filter, SENSOR_2ND_COLUMN, y, STR_FILTER, attr, event);
|
sensor->filter = editCheckBox(sensor->filter, SENSOR_2ND_COLUMN, y, STR_FILTER, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_PERSISTENT:
|
case SENSOR_FIELD_PERSISTENT:
|
||||||
ON_OFF_MENU_ITEM(sensor->persistent, SENSOR_2ND_COLUMN, y, NO_INDENT(STR_PERSISTENT), attr, event);
|
sensor->persistent = editCheckBox(sensor->persistent, SENSOR_2ND_COLUMN, y, NO_INDENT(STR_PERSISTENT), attr, event);
|
||||||
if (checkIncDec_Ret && !sensor->persistent) {
|
if (checkIncDec_Ret && !sensor->persistent) {
|
||||||
sensor->persistentValue = 0;
|
sensor->persistentValue = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_LOGS:
|
case SENSOR_FIELD_LOGS:
|
||||||
ON_OFF_MENU_ITEM(sensor->logs, SENSOR_2ND_COLUMN, y, STR_LOGS, attr, event);
|
sensor->logs = editCheckBox(sensor->logs, SENSOR_2ND_COLUMN, y, STR_LOGS, attr, event);
|
||||||
if (attr && checkIncDec_Ret) {
|
if (attr && checkIncDec_Ret) {
|
||||||
logsClose();
|
logsClose();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,10 @@ const unsigned char sticks[] = {
|
||||||
|
|
||||||
#define RADIO_SETUP_2ND_COLUMN 79
|
#define RADIO_SETUP_2ND_COLUMN 79
|
||||||
|
|
||||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
#define SLIDER_5POS(y, value, event, attr) { \
|
||||||
int8_t tmp = value; \
|
int8_t tmp = value; \
|
||||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, 2+tmp, 4, attr); \
|
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, 2+tmp, 4, attr); \
|
||||||
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, nullptr, tmp, -2, +2, attr, event); \
|
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, nullptr, tmp, -2, +2, attr, event); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SPLASH)
|
#if defined(SPLASH)
|
||||||
|
@ -134,7 +134,7 @@ void menuRadioSetup(event_t event)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_RADIO_SETUP_MAX, {
|
MENU(STR_RADIO_SETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_RADIO_SETUP_MAX, {
|
||||||
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1)
|
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1)
|
||||||
LABEL(SOUND), CASE_AUDIO(0)
|
LABEL(SOUND), CASE_AUDIO(0)
|
||||||
CASE_BUZZER(0)
|
CASE_BUZZER(0)
|
||||||
|
@ -281,7 +281,7 @@ void menuRadioSetup(event_t event)
|
||||||
#if defined(VOICE)
|
#if defined(VOICE)
|
||||||
case ITEM_RADIO_SETUP_SPEAKER_VOLUME:
|
case ITEM_RADIO_SETUP_SPEAKER_VOLUME:
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(y, STR_SPEAKER_VOLUME);
|
lcdDrawText(INDENT_WIDTH, y, STR_VOLUME);
|
||||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, b, VOLUME_LEVEL_MAX, attr);
|
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, b, VOLUME_LEVEL_MAX, attr);
|
||||||
if (attr) {
|
if (attr) {
|
||||||
|
@ -295,22 +295,28 @@ void menuRadioSetup(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BEEP_VOLUME:
|
case ITEM_RADIO_SETUP_BEEP_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.beepVolume, STR_BEEP_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_BEEP_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.beepVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_WAV_VOLUME:
|
case ITEM_RADIO_SETUP_WAV_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.wavVolume, STR_WAV_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_WAV_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.wavVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKGROUND_VOLUME:
|
case ITEM_RADIO_SETUP_BACKGROUND_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.backgroundVolume, STR_BG_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_BG_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.backgroundVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BEEP_LENGTH:
|
case ITEM_RADIO_SETUP_BEEP_LENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.beepLength, STR_BEEP_LENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_BEEP_LENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.beepLength, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(AUDIO)
|
#if defined(AUDIO)
|
||||||
case ITEM_RADIO_SETUP_SPEAKER_PITCH:
|
case ITEM_RADIO_SETUP_SPEAKER_PITCH:
|
||||||
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
|
lcdDrawText(INDENT_WIDTH, y, STR_BEEP_PITCH);
|
||||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
|
@ -324,23 +330,28 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_RADIO_SETUP_VARIO_LABEL:
|
case ITEM_RADIO_SETUP_VARIO_LABEL:
|
||||||
lcdDrawTextAlignedLeft(y, STR_VARIO);
|
lcdDrawTextAlignedLeft(y, STR_VARIO);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_VOLUME:
|
case ITEM_RADIO_SETUP_VARIO_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.varioVolume, TR_SPEAKER_VOLUME, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.varioVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_PITCH:
|
case ITEM_RADIO_SETUP_VARIO_PITCH:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
lcdDrawText(INDENT_WIDTH, y, STR_PITCH_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_RANGE:
|
case ITEM_RADIO_SETUP_VARIO_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
|
lcdDrawText(INDENT_WIDTH, y, STR_PITCH_AT_MAX);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_REPEAT:
|
case ITEM_RADIO_SETUP_VARIO_REPEAT:
|
||||||
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
lcdDrawText(INDENT_WIDTH, y, STR_REPEAT_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||||
|
@ -357,11 +368,13 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_HAPTIC_LENGTH:
|
case ITEM_RADIO_SETUP_HAPTIC_LENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.hapticLength, STR_LENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_LENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.hapticLength, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_HAPTIC_STRENGTH:
|
case ITEM_RADIO_SETUP_HAPTIC_STRENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.hapticStrength, STR_HAPTICSTRENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_STRENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.hapticStrength, event, attr);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -409,29 +422,32 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BATTERY_WARNING:
|
case ITEM_RADIO_SETUP_BATTERY_WARNING:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BATTERYWARNING);
|
lcdDrawText(INDENT_WIDTH, y, STR_BATTERYWARNING);
|
||||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
||||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_MEMORY_WARNING:
|
case ITEM_RADIO_SETUP_MEMORY_WARNING:
|
||||||
{
|
{
|
||||||
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
|
lcdDrawText(INDENT_WIDTH, y, STR_MEMORYWARNING);
|
||||||
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
|
uint8_t b = 1 - g_eeGeneral.disableMemoryWarning;
|
||||||
|
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_ALARM_WARNING:
|
case ITEM_RADIO_SETUP_ALARM_WARNING:
|
||||||
{
|
{
|
||||||
|
lcdDrawText(INDENT_WIDTH, y, STR_ALARMWARNING);
|
||||||
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
|
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
|
||||||
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
|
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_RSSI_POWEROFF_ALARM:
|
case ITEM_RADIO_SETUP_RSSI_POWEROFF_ALARM:
|
||||||
{
|
{
|
||||||
|
lcdDrawText(INDENT_WIDTH, y, STR_RSSI_SHUTDOWN_ALARM);
|
||||||
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
|
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
|
||||||
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
|
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,7 +460,7 @@ void menuRadioSetup(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_INACTIVITY_ALARM:
|
case ITEM_RADIO_SETUP_INACTIVITY_ALARM:
|
||||||
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
lcdDrawText(INDENT_WIDTH, y, STR_INACTIVITYALARM);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
||||||
lcdDrawChar(lcdLastRightPos, y, 'm');
|
lcdDrawChar(lcdLastRightPos, y, 'm');
|
||||||
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||||
|
@ -455,22 +471,24 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_MODE:
|
case ITEM_RADIO_SETUP_BACKLIGHT_MODE:
|
||||||
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, INDENT TR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
|
lcdDrawText(INDENT_WIDTH, y, STR_MODE);
|
||||||
|
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_FLASH_BEEP:
|
case ITEM_RADIO_SETUP_FLASH_BEEP:
|
||||||
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
|
lcdDrawText(INDENT_WIDTH, y, STR_ALARM);
|
||||||
|
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event ) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_DELAY:
|
case ITEM_RADIO_SETUP_BACKLIGHT_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
lcdDrawText(INDENT_WIDTH, y, STR_DURATION);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
||||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BRIGHTNESS:
|
case ITEM_RADIO_SETUP_BRIGHTNESS:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BRIGHTNESS);
|
lcdDrawText(INDENT_WIDTH, y, STR_BRIGHTNESS);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
||||||
if (attr) {
|
if (attr) {
|
||||||
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
||||||
|
@ -481,13 +499,13 @@ void menuRadioSetup(event_t event)
|
||||||
|
|
||||||
#if defined(PWM_BACKLIGHT)
|
#if defined(PWM_BACKLIGHT)
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_BRIGHTNESS_OFF:
|
case ITEM_RADIO_SETUP_BACKLIGHT_BRIGHTNESS_OFF:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLOFFBRIGHTNESS);
|
lcdDrawText(INDENT_WIDTH, y, STR_BLOFFBRIGHTNESS);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.blOffBright, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.blOffBright, attr|LEFT);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.blOffBright, 0, 15);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.blOffBright, 0, 15);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_BRIGHTNESS_ON:
|
case ITEM_RADIO_SETUP_BACKLIGHT_BRIGHTNESS_ON:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLONBRIGHTNESS);
|
lcdDrawText(INDENT_WIDTH, y, STR_BLONBRIGHTNESS);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 15-g_eeGeneral.blOnBright, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 15-g_eeGeneral.blOnBright, attr|LEFT);
|
||||||
if (attr) g_eeGeneral.blOnBright = 15 - checkIncDecGen(event, 15-g_eeGeneral.blOnBright, 0, 15);
|
if (attr) g_eeGeneral.blOnBright = 15 - checkIncDecGen(event, 15-g_eeGeneral.blOnBright, 0, 15);
|
||||||
break;
|
break;
|
||||||
|
@ -539,22 +557,24 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_ADJUST_RTC:
|
case ITEM_RADIO_SETUP_ADJUST_RTC:
|
||||||
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, STR_ADJUST_RTC, attr, event);
|
lcdDrawTextAlignedLeft(y, STR_ADJUST_RTC);
|
||||||
|
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_GPSFORMAT:
|
case ITEM_RADIO_SETUP_GPSFORMAT:
|
||||||
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
lcdDrawTextAlignedLeft(y, STR_GPS_COORDS_FORMAT);
|
||||||
|
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX1)
|
#if defined(PXX1)
|
||||||
case ITEM_RADIO_SETUP_COUNTRYCODE:
|
case ITEM_RADIO_SETUP_COUNTRYCODE:
|
||||||
g_eeGeneral.countryCode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRYCODE, STR_COUNTRYCODES, g_eeGeneral.countryCode, 0, 2, attr, event);
|
g_eeGeneral.countryCode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRY_CODE, STR_COUNTRY_CODES, g_eeGeneral.countryCode, 0, 2, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_LANGUAGE:
|
case ITEM_RADIO_SETUP_LANGUAGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_VOICELANG);
|
lcdDrawTextAlignedLeft(y, STR_VOICE_LANGUAGE);
|
||||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||||
if (attr) {
|
if (attr) {
|
||||||
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
||||||
|
@ -566,7 +586,7 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_IMPERIAL:
|
case ITEM_RADIO_SETUP_IMPERIAL:
|
||||||
g_eeGeneral.imperial = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_UNITSSYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
|
g_eeGeneral.imperial = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_UNITS_SYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(FAI_CHOICE)
|
#if defined(FAI_CHOICE)
|
||||||
|
@ -597,7 +617,7 @@ void menuRadioSetup(event_t event)
|
||||||
|
|
||||||
#if defined(JACK_DETECT_GPIO)
|
#if defined(JACK_DETECT_GPIO)
|
||||||
case ITEM_RADIO_SETUP_JACK_MODE:
|
case ITEM_RADIO_SETUP_JACK_MODE:
|
||||||
g_eeGeneral.jackMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_JACKMODE, STR_JACKMODES, g_eeGeneral.jackMode, JACK_UNSELECTED_MODE, JACK_MAX_MODE, attr, event);
|
g_eeGeneral.jackMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_JACK_MODE, STR_JACK_MODES, g_eeGeneral.jackMode, JACK_UNSELECTED_MODE, JACK_MAX_MODE, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -403,7 +403,7 @@ void menuMainView(event_t event)
|
||||||
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||||
|
|
||||||
// Model Name
|
// Model Name
|
||||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
drawModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||||
|
|
||||||
// Main Voltage (or alarm if any)
|
// Main Voltage (or alarm if any)
|
||||||
displayVoltageOrAlarm();
|
displayVoltageOrAlarm();
|
||||||
|
|
|
@ -72,7 +72,9 @@ void title(const char * s)
|
||||||
|
|
||||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
|
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
|
||||||
{
|
{
|
||||||
drawFieldLabel(x, y, label);
|
if (label) {
|
||||||
|
drawFieldLabel(x, y, label);
|
||||||
|
}
|
||||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||||
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isValueAvailable);
|
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isValueAvailable);
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -2,7 +2,6 @@ set(GUI_SRC
|
||||||
${GUI_SRC}
|
${GUI_SRC}
|
||||||
lcd.cpp
|
lcd.cpp
|
||||||
splash.cpp
|
splash.cpp
|
||||||
fonts.cpp
|
|
||||||
popups.cpp
|
popups.cpp
|
||||||
widgets.cpp
|
widgets.cpp
|
||||||
startup_shutdown.cpp
|
startup_shutdown.cpp
|
||||||
|
|
|
@ -1,140 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) OpenTX
|
|
||||||
*
|
|
||||||
* Based on code named
|
|
||||||
* th9x - http://code.google.com/p/th9x
|
|
||||||
* er9x - http://code.google.com/p/er9x
|
|
||||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
|
||||||
*
|
|
||||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opentx.h"
|
|
||||||
|
|
||||||
const unsigned char font_5x7[] = {
|
|
||||||
#include "font_05x07.lbm"
|
|
||||||
#if defined(TRANSLATIONS_DE)
|
|
||||||
#include "font_de_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
|
||||||
#include "font_cz_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_ES)
|
|
||||||
#include "font_es_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FI)
|
|
||||||
#include "font_fi_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FR)
|
|
||||||
#include "font_fr_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_IT)
|
|
||||||
#include "font_it_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PL)
|
|
||||||
#include "font_pl_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PT)
|
|
||||||
#include "font_pt_05x07.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_SE)
|
|
||||||
#include "font_se_05x07.lbm"
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_5x7_B[] = {
|
|
||||||
#include "font_05x07_B_compressed.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !defined(BOOT)
|
|
||||||
const unsigned char font_10x14[] = {
|
|
||||||
#include "font_10x14_compressed.lbm"
|
|
||||||
#if defined(TRANSLATIONS_DE)
|
|
||||||
#include "font_de_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
|
||||||
#include "font_cz_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_ES)
|
|
||||||
#include "font_es_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FI)
|
|
||||||
#include "font_fi_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FR)
|
|
||||||
#include "font_fr_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_IT)
|
|
||||||
#include "font_it_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PL)
|
|
||||||
#include "font_pl_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PT)
|
|
||||||
#include "font_pt_10x14.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_SE)
|
|
||||||
#include "font_se_10x14.lbm"
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_3x5[] = {
|
|
||||||
#include "font_03x05.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_4x6[] = {
|
|
||||||
#include "font_04x06.lbm"
|
|
||||||
#if defined(TRANSLATIONS_DE)
|
|
||||||
#include "font_de_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
|
||||||
#include "font_cz_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_ES)
|
|
||||||
#include "font_es_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FI)
|
|
||||||
#include "font_fi_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FR)
|
|
||||||
#include "font_fr_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_IT)
|
|
||||||
#include "font_it_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PL)
|
|
||||||
#include "font_pl_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PT)
|
|
||||||
#include "font_pt_04x06.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_SE)
|
|
||||||
#include "font_se_04x06.lbm"
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_8x10[] = {
|
|
||||||
#include "font_08x10.lbm"
|
|
||||||
#if defined(TRANSLATIONS_DE)
|
|
||||||
#include "font_de_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
|
||||||
#include "font_cz_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_ES)
|
|
||||||
#include "font_es_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FI)
|
|
||||||
#include "font_fi_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_FR)
|
|
||||||
#include "font_fr_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_IT)
|
|
||||||
#include "font_it_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PL)
|
|
||||||
#include "font_pl_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_PT)
|
|
||||||
#include "font_pt_08x10.lbm"
|
|
||||||
#elif defined(TRANSLATIONS_SE)
|
|
||||||
#include "font_se_08x10.lbm"
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_22x38_num[] = {
|
|
||||||
#include "font_22x38_num.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_4x6_extra[] = {
|
|
||||||
#include "font_04x06_extra.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_5x7_extra[] = {
|
|
||||||
#include "font_05x07_extra.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
const unsigned char font_10x14_extra[] = {
|
|
||||||
#include "font_10x14_extra.lbm"
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // !defined(BOOT)
|
|
|
@ -213,8 +213,6 @@ choice_t editChoice(coord_t x, coord_t y, const char *label, const char *values,
|
||||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event);
|
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event);
|
||||||
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
|
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
|
||||||
|
|
||||||
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
|
|
||||||
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags=0);
|
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags=0);
|
||||||
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, event_t event);
|
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, event_t event);
|
||||||
|
|
|
@ -19,14 +19,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
#include "timers.h"
|
#include "common/stdlcd/fonts.h"
|
||||||
|
|
||||||
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
|
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
|
||||||
display_t displayBuf1[DISPLAY_BUFFER_SIZE] __DMA;
|
pixel_t displayBuf1[DISPLAY_BUFFER_SIZE] __DMA;
|
||||||
display_t displayBuf2[DISPLAY_BUFFER_SIZE] __DMA;
|
pixel_t displayBuf2[DISPLAY_BUFFER_SIZE] __DMA;
|
||||||
display_t * displayBuf = displayBuf1;
|
pixel_t * displayBuf = displayBuf1;
|
||||||
#else
|
#else
|
||||||
display_t displayBuf[DISPLAY_BUFFER_SIZE] __DMA;
|
pixel_t displayBuf[DISPLAY_BUFFER_SIZE] __DMA;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline bool lcdIsPointOutside(coord_t x, coord_t y)
|
inline bool lcdIsPointOutside(coord_t x, coord_t y)
|
||||||
|
@ -36,7 +36,7 @@ inline bool lcdIsPointOutside(coord_t x, coord_t y)
|
||||||
|
|
||||||
void lcdClear()
|
void lcdClear()
|
||||||
{
|
{
|
||||||
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE * sizeof(display_t));
|
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE * sizeof(pixel_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t lcdLastRightPos;
|
coord_t lcdLastRightPos;
|
||||||
|
@ -505,7 +505,7 @@ void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat,
|
||||||
|
|
||||||
void drawTelemetryTopBar()
|
void drawTelemetryTopBar()
|
||||||
{
|
{
|
||||||
putsModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
|
drawModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
|
||||||
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
|
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
|
||||||
putsVBat(12*FW, 0, att);
|
putsVBat(12*FW, 0, att);
|
||||||
if (g_model.timers[0].mode) {
|
if (g_model.timers[0].mode) {
|
||||||
|
@ -581,7 +581,7 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att)
|
||||||
putsVolts(x, y, g_vbat100mV, att);
|
putsVolts(x, y, g_vbat100mV, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
void drawStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t length = STR_VSRCRAW[0];
|
uint8_t length = STR_VSRCRAW[0];
|
||||||
lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
||||||
|
@ -681,7 +681,7 @@ void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
void drawModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t len = sizeof(g_model.header.name);
|
uint8_t len = sizeof(g_model.header.name);
|
||||||
while (len>0 && !name[len-1]) --len;
|
while (len>0 && !name[len-1]) --len;
|
||||||
|
|
|
@ -21,14 +21,8 @@
|
||||||
#ifndef _LCD_H_
|
#ifndef _LCD_H_
|
||||||
#define _LCD_H_
|
#define _LCD_H_
|
||||||
|
|
||||||
typedef int coord_t;
|
|
||||||
struct point_t
|
|
||||||
{
|
|
||||||
coord_t x;
|
|
||||||
coord_t y;
|
|
||||||
};
|
|
||||||
typedef uint32_t LcdFlags;
|
typedef uint32_t LcdFlags;
|
||||||
typedef uint8_t display_t;
|
typedef uint8_t pixel_t;
|
||||||
|
|
||||||
#define BOX_WIDTH 31
|
#define BOX_WIDTH 31
|
||||||
#define CENTER "\015"
|
#define CENTER "\015"
|
||||||
|
@ -92,11 +86,11 @@ typedef uint8_t display_t;
|
||||||
#define DISPLAY_BUFFER_SIZE (LCD_W*LCD_H*4/8)
|
#define DISPLAY_BUFFER_SIZE (LCD_W*LCD_H*4/8)
|
||||||
|
|
||||||
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
|
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
|
||||||
extern display_t displayBuf1[DISPLAY_BUFFER_SIZE];
|
extern pixel_t displayBuf1[DISPLAY_BUFFER_SIZE];
|
||||||
extern display_t displayBuf2[DISPLAY_BUFFER_SIZE];
|
extern pixel_t displayBuf2[DISPLAY_BUFFER_SIZE];
|
||||||
extern display_t * displayBuf;
|
extern pixel_t * displayBuf;
|
||||||
#else
|
#else
|
||||||
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
extern pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern coord_t lcdLastRightPos;
|
extern coord_t lcdLastRightPos;
|
||||||
|
@ -122,9 +116,9 @@ void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags mode=0);
|
||||||
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode, uint8_t len);
|
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode, uint8_t len);
|
||||||
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode=0);
|
void lcdDrawNumber(coord_t x, coord_t y, int32_t val, LcdFlags mode=0);
|
||||||
|
|
||||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
|
void drawModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
|
||||||
void drawSwitch(coord_t x, coord_t y, int32_t swtch, LcdFlags att=0);
|
void drawSwitch(coord_t x, coord_t y, int32_t swtch, LcdFlags att=0);
|
||||||
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
|
void drawStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
|
||||||
void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att=0);
|
void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att=0);
|
||||||
void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
||||||
void drawTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att=0);
|
void drawTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att=0);
|
||||||
|
@ -181,13 +175,13 @@ uint8_t * lcdLoadBitmap(uint8_t * dest, const char * filename, uint16_t width, u
|
||||||
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
|
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline display_t getPixel(unsigned int x, unsigned int y)
|
inline pixel_t getPixel(unsigned int x, unsigned int y)
|
||||||
{
|
{
|
||||||
if (x>=LCD_W || y>=LCD_H) {
|
if (x>=LCD_W || y>=LCD_H) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
display_t * p = &displayBuf[y / 2 * LCD_W + x];
|
pixel_t * p = &displayBuf[y / 2 * LCD_W + x];
|
||||||
return (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
return (y & 1) ? (*p >> 4) : (*p & 0x0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ void menuModelGVarOne(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GVAR_FIELD_POPUP:
|
case GVAR_FIELD_POPUP:
|
||||||
ON_OFF_MENU_ITEM(gvar->popup, GVAR_2ND_COLUMN, y, STR_POPUP, attr, event);
|
gvar->popup = editCheckBox(gvar->popup, GVAR_2ND_COLUMN, y, STR_POPUP, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -264,7 +264,7 @@ void menuModelSelect(event_t event)
|
||||||
k %= MAX_MODELS;
|
k %= MAX_MODELS;
|
||||||
|
|
||||||
if (eeModelExists(k)) {
|
if (eeModelExists(k)) {
|
||||||
putsModelName(4*FW, y, modelHeaders[k].name, k, 0);
|
drawModelName(4*FW, y, modelHeaders[k].name, k, 0);
|
||||||
lcdDrawNumber(20*FW, y, eeModelSize(k), RIGHT);
|
lcdDrawNumber(20*FW, y, eeModelSize(k), RIGHT);
|
||||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+menuVerticalOffset!=(vertpos_t)sub))
|
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+menuVerticalOffset!=(vertpos_t)sub))
|
||||||
lcdDrawChar(1, y, '*');
|
lcdDrawChar(1, y, '*');
|
||||||
|
|
|
@ -382,7 +382,7 @@ void menuModelSetup(event_t event)
|
||||||
});
|
});
|
||||||
|
|
||||||
MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, ITEM_MODEL_SETUP_LINES_COUNT);
|
MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, ITEM_MODEL_SETUP_LINES_COUNT);
|
||||||
title(STR_MENUSETUP);
|
title(STR_MENU_MODEL_SETUP);
|
||||||
|
|
||||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) {
|
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) {
|
||||||
memclear(&reusableBuffer.moduleSetup, sizeof(reusableBuffer.moduleSetup));
|
memclear(&reusableBuffer.moduleSetup, sizeof(reusableBuffer.moduleSetup));
|
||||||
|
@ -507,11 +507,11 @@ void menuModelSetup(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_EXTENDED_LIMITS:
|
case ITEM_MODEL_SETUP_EXTENDED_LIMITS:
|
||||||
ON_OFF_MENU_ITEM(g_model.extendedLimits, MODEL_SETUP_2ND_COLUMN, y, STR_ELIMITS, attr, event);
|
g_model.extendedLimits = editCheckBox(g_model.extendedLimits, MODEL_SETUP_2ND_COLUMN, y, STR_ELIMITS, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_EXTENDED_TRIMS:
|
case ITEM_MODEL_SETUP_EXTENDED_TRIMS:
|
||||||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, menuHorizontalPosition<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
g_model.extendedTrims = editCheckBox(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, menuHorizontalPosition<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, (menuHorizontalPosition>0 && !NO_HIGHLIGHT()) ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, (menuHorizontalPosition>0 && !NO_HIGHLIGHT()) ? attr : 0);
|
||||||
if (attr && menuHorizontalPosition>0) {
|
if (attr && menuHorizontalPosition>0) {
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
|
@ -539,7 +539,7 @@ void menuModelSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
||||||
ON_OFF_MENU_ITEM(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEREVERSE, attr, event ) ;
|
g_model.throttleReversed = editCheckBox(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEREVERSE, attr, event ) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_TRACE:
|
case ITEM_MODEL_SETUP_THROTTLE_TRACE:
|
||||||
|
@ -556,7 +556,7 @@ void menuModelSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_TRIM:
|
case ITEM_MODEL_SETUP_THROTTLE_TRIM:
|
||||||
ON_OFF_MENU_ITEM(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN, y, STR_TTRIM, attr, event);
|
g_model.thrTrim = editCheckBox(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN, y, STR_TTRIM, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
||||||
|
@ -564,11 +564,11 @@ void menuModelSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
||||||
ON_OFF_MENU_ITEM(g_model.displayChecklist, MODEL_SETUP_2ND_COLUMN, y, STR_CHECKLIST, attr, event);
|
g_model.displayChecklist = editCheckBox(g_model.displayChecklist, MODEL_SETUP_2ND_COLUMN, y, STR_CHECKLIST, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_MODEL_SETUP_THROTTLE_WARNING:
|
case ITEM_MODEL_SETUP_THROTTLE_WARNING:
|
||||||
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEWARNING, attr, event);
|
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLE_WARNING, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(PCBX9E)
|
#if defined(PCBX9E)
|
||||||
|
@ -1277,7 +1277,7 @@ void menuModelSetup(event_t event)
|
||||||
{
|
{
|
||||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||||
if (isModuleR9MNonAccess(moduleIdx)) {
|
if (isModuleR9MNonAccess(moduleIdx)) {
|
||||||
lcdDrawTextAlignedLeft(y, TR_RFPOWER);
|
lcdDrawTextAlignedLeft(y, TR_RF_POWER);
|
||||||
if (isModuleR9M_FCC_VARIANT(moduleIdx)) {
|
if (isModuleR9M_FCC_VARIANT(moduleIdx)) {
|
||||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_R9M_FCC_POWER_VALUES, g_model.moduleData[moduleIdx].pxx.power, LEFT | attr);
|
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_R9M_FCC_POWER_VALUES, g_model.moduleData[moduleIdx].pxx.power, LEFT | attr);
|
||||||
if (attr)
|
if (attr)
|
||||||
|
|
|
@ -222,7 +222,7 @@ void menuModelTelemetry(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_TELEMETRY_IGNORE_SENSOR_INSTANCE:
|
case ITEM_TELEMETRY_IGNORE_SENSOR_INSTANCE:
|
||||||
ON_OFF_MENU_ITEM(g_model.ignoreSensorIds, TELEM_COL2, y, STR_IGNORE_INSTANCE, attr, event);
|
g_model.ignoreSensorIds = editCheckBox(g_model.ignoreSensorIds, TELEM_COL2, y, STR_IGNORE_INSTANCE, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_TELEMETRY_RSSI_LABEL:
|
case ITEM_TELEMETRY_RSSI_LABEL:
|
||||||
|
|
|
@ -219,7 +219,7 @@ void menuModelSensor(event_t event)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sensor->unit == UNIT_RPMS) {
|
if (sensor->unit == UNIT_RPMS) {
|
||||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_BLADES));
|
lcdDrawTextAlignedLeft(y, STR_BLADES);
|
||||||
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 1, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
|
if (attr) sensor->custom.ratio = checkIncDec(event, sensor->custom.ratio, 1, 30000, EE_MODEL|NO_INCDEC_MARKS|INCDEC_REP10);
|
||||||
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr);
|
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr);
|
||||||
break;
|
break;
|
||||||
|
@ -287,26 +287,26 @@ void menuModelSensor(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case SENSOR_FIELD_AUTOOFFSET:
|
case SENSOR_FIELD_AUTOOFFSET:
|
||||||
ON_OFF_MENU_ITEM(sensor->autoOffset, SENSOR_2ND_COLUMN, y, STR_AUTOOFFSET, attr, event);
|
sensor->autoOffset = editCheckBox(sensor->autoOffset, SENSOR_2ND_COLUMN, y, STR_AUTOOFFSET, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_ONLYPOSITIVE:
|
case SENSOR_FIELD_ONLYPOSITIVE:
|
||||||
ON_OFF_MENU_ITEM(sensor->onlyPositive, SENSOR_2ND_COLUMN, y, STR_ONLYPOSITIVE, attr, event);
|
sensor->onlyPositive = editCheckBox(sensor->onlyPositive, SENSOR_2ND_COLUMN, y, STR_ONLYPOSITIVE, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_FILTER:
|
case SENSOR_FIELD_FILTER:
|
||||||
ON_OFF_MENU_ITEM(sensor->filter, SENSOR_2ND_COLUMN, y, STR_FILTER, attr, event);
|
sensor->filter = editCheckBox(sensor->filter, SENSOR_2ND_COLUMN, y, STR_FILTER, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_PERSISTENT:
|
case SENSOR_FIELD_PERSISTENT:
|
||||||
ON_OFF_MENU_ITEM(sensor->persistent, SENSOR_2ND_COLUMN, y, NO_INDENT(STR_PERSISTENT), attr, event);
|
sensor->persistent = editCheckBox(sensor->persistent, SENSOR_2ND_COLUMN, y, NO_INDENT(STR_PERSISTENT), attr, event);
|
||||||
if (checkIncDec_Ret && !sensor->persistent) {
|
if (checkIncDec_Ret && !sensor->persistent) {
|
||||||
sensor->persistentValue = 0;
|
sensor->persistentValue = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SENSOR_FIELD_LOGS:
|
case SENSOR_FIELD_LOGS:
|
||||||
ON_OFF_MENU_ITEM(sensor->logs, SENSOR_2ND_COLUMN, y, STR_LOGS, attr, event);
|
sensor->logs = editCheckBox(sensor->logs, SENSOR_2ND_COLUMN, y, STR_LOGS, attr, event);
|
||||||
if (attr && checkIncDec_Ret) {
|
if (attr && checkIncDec_Ret) {
|
||||||
logsClose();
|
logsClose();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ void drawPotsBars()
|
||||||
if (IS_POT_SLIDER_AVAILABLE(i)) {
|
if (IS_POT_SLIDER_AVAILABLE(i)) {
|
||||||
uint8_t len = ((calibratedAnalogs[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
|
uint8_t len = ((calibratedAnalogs[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
|
||||||
V_BAR(x, LCD_H-8, len);
|
V_BAR(x, LCD_H-8, len);
|
||||||
putsStickName(x-2, LCD_H-6, i, TINSIZE);
|
drawStickName(x-2, LCD_H-6, i, TINSIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,10 @@ const unsigned char sticks[] = {
|
||||||
#define RADIO_SETUP_DATE_COLUMN RADIO_SETUP_2ND_COLUMN + 4*FWNUM
|
#define RADIO_SETUP_DATE_COLUMN RADIO_SETUP_2ND_COLUMN + 4*FWNUM
|
||||||
#define RADIO_SETUP_TIME_COLUMN RADIO_SETUP_2ND_COLUMN + 2*FWNUM
|
#define RADIO_SETUP_TIME_COLUMN RADIO_SETUP_2ND_COLUMN + 2*FWNUM
|
||||||
|
|
||||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
#define SLIDER_5POS(y, value, event, attr) { \
|
||||||
int8_t tmp = value; \
|
int8_t tmp = value; \
|
||||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||||
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, nullptr, tmp, -2, +2, attr, event); \
|
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, nullptr, tmp, -2, +2, attr, event); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SPLASH)
|
#if defined(SPLASH)
|
||||||
|
@ -121,7 +121,7 @@ void menuRadioSetup(event_t event)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, ITEM_RADIO_SETUP_MAX, {
|
MENU(STR_RADIO_SETUP, menuTabGeneral, MENU_RADIO_SETUP, ITEM_RADIO_SETUP_MAX, {
|
||||||
2, // date
|
2, // date
|
||||||
2, // time
|
2, // time
|
||||||
0, // battery calibration
|
0, // battery calibration
|
||||||
|
@ -279,7 +279,7 @@ void menuRadioSetup(event_t event)
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_GENERAL_VOLUME:
|
case ITEM_RADIO_SETUP_GENERAL_VOLUME:
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(y, STR_SPEAKER_VOLUME);
|
lcdDrawText(INDENT_WIDTH, y, STR_VOLUME);
|
||||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||||
if (attr) {
|
if (attr) {
|
||||||
|
@ -292,23 +292,27 @@ void menuRadioSetup(event_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BEEP_VOLUME:
|
case ITEM_RADIO_SETUP_BEEP_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.beepVolume, STR_BEEP_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_BEEP_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.beepVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_WAV_VOLUME:
|
case ITEM_RADIO_SETUP_WAV_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.wavVolume, STR_WAV_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_WAV_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.wavVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKGROUND_VOLUME:
|
case ITEM_RADIO_SETUP_BACKGROUND_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.backgroundVolume, STR_BG_VOLUME, event, attr);
|
lcdDrawTextAlignedLeft(y, STR_BG_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.backgroundVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BEEP_LENGTH:
|
case ITEM_RADIO_SETUP_BEEP_LENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.beepLength, STR_BEEP_LENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_BEEP_LENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.beepLength, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_SPEAKER_PITCH:
|
case ITEM_RADIO_SETUP_SPEAKER_PITCH:
|
||||||
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
|
lcdDrawText(INDENT_WIDTH, y, STR_BEEP_PITCH);
|
||||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
|
@ -323,25 +327,26 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_VOLUME:
|
case ITEM_RADIO_SETUP_VARIO_VOLUME:
|
||||||
SLIDER_5POS(y, g_eeGeneral.varioVolume, TR_SPEAKER_VOLUME, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_VOLUME);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.varioVolume, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_PITCH:
|
case ITEM_RADIO_SETUP_VARIO_PITCH:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
lcdDrawText(INDENT_WIDTH, y, STR_PITCH_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_RANGE:
|
case ITEM_RADIO_SETUP_VARIO_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
|
lcdDrawText(INDENT_WIDTH, y, STR_PITCH_AT_MAX);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_VARIO_REPEAT:
|
case ITEM_RADIO_SETUP_VARIO_REPEAT:
|
||||||
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
lcdDrawText(INDENT_WIDTH, y, STR_REPEAT_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
||||||
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||||
|
@ -354,15 +359,18 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_HAPTIC_MODE:
|
case ITEM_RADIO_SETUP_HAPTIC_MODE:
|
||||||
g_eeGeneral.hapticMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, INDENT TR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
|
lcdDrawText(INDENT_WIDTH, y, STR_MODE);
|
||||||
|
g_eeGeneral.hapticMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_HAPTIC_LENGTH:
|
case ITEM_RADIO_SETUP_HAPTIC_LENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.hapticLength, STR_LENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_LENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.hapticLength, event, attr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_HAPTIC_STRENGTH:
|
case ITEM_RADIO_SETUP_HAPTIC_STRENGTH:
|
||||||
SLIDER_5POS(y, g_eeGeneral.hapticStrength, STR_HAPTICSTRENGTH, event, attr);
|
lcdDrawText(INDENT_WIDTH, y, STR_STRENGTH);
|
||||||
|
SLIDER_5POS(y, g_eeGeneral.hapticStrength, event, attr);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -380,34 +388,37 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BATTERY_WARNING:
|
case ITEM_RADIO_SETUP_BATTERY_WARNING:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BATTERYWARNING);
|
lcdDrawText(INDENT_WIDTH, y, STR_BATTERYWARNING);
|
||||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); // 4-12V
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); // 4-12V
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_MEMORY_WARNING:
|
case ITEM_RADIO_SETUP_MEMORY_WARNING:
|
||||||
{
|
{
|
||||||
|
lcdDrawText(INDENT_WIDTH, y, STR_MEMORYWARNING);
|
||||||
uint8_t b = 1 - g_eeGeneral.disableMemoryWarning;
|
uint8_t b = 1 - g_eeGeneral.disableMemoryWarning;
|
||||||
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
|
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_ALARM_WARNING:
|
case ITEM_RADIO_SETUP_ALARM_WARNING:
|
||||||
{
|
{
|
||||||
|
lcdDrawText(INDENT_WIDTH, y, STR_ALARMWARNING);
|
||||||
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
|
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
|
||||||
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
|
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_RSSI_POWEROFF_ALARM:
|
case ITEM_RADIO_SETUP_RSSI_POWEROFF_ALARM:
|
||||||
{
|
{
|
||||||
|
lcdDrawText(INDENT_WIDTH, y, STR_RSSI_SHUTDOWN_ALARM);
|
||||||
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
|
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
|
||||||
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
|
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_INACTIVITY_ALARM:
|
case ITEM_RADIO_SETUP_INACTIVITY_ALARM:
|
||||||
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
lcdDrawText(INDENT_WIDTH, y, STR_INACTIVITYALARM);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
||||||
lcdDrawChar(lcdLastRightPos, y, 'm');
|
lcdDrawChar(lcdLastRightPos, y, 'm');
|
||||||
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||||
|
@ -418,11 +429,13 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_MODE:
|
case ITEM_RADIO_SETUP_BACKLIGHT_MODE:
|
||||||
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, INDENT TR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
|
lcdDrawText(INDENT_WIDTH, y, STR_MODE);
|
||||||
|
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_FLASH_BEEP:
|
case ITEM_RADIO_SETUP_FLASH_BEEP:
|
||||||
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
|
lcdDrawText(INDENT_WIDTH, y, STR_ALARM);
|
||||||
|
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event ) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(PXX2)
|
#if defined(PXX2)
|
||||||
|
@ -432,14 +445,14 @@ void menuRadioSetup(event_t event)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_DELAY:
|
case ITEM_RADIO_SETUP_BACKLIGHT_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
lcdDrawText(INDENT_WIDTH, y, STR_DURATION);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
||||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_BRIGHTNESS:
|
case ITEM_RADIO_SETUP_BRIGHTNESS:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BRIGHTNESS);
|
lcdDrawText(INDENT_WIDTH, y, STR_BRIGHTNESS);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
||||||
if (attr) {
|
if (attr) {
|
||||||
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
||||||
|
@ -450,7 +463,7 @@ void menuRadioSetup(event_t event)
|
||||||
|
|
||||||
#if defined(PCBX9DP) || defined(PCBX9E)
|
#if defined(PCBX9DP) || defined(PCBX9E)
|
||||||
case ITEM_RADIO_SETUP_BACKLIGHT_COLOR:
|
case ITEM_RADIO_SETUP_BACKLIGHT_COLOR:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLCOLOR);
|
lcdDrawText(INDENT_WIDTH, y, STR_BLCOLOR);
|
||||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||||
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
|
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
|
||||||
break;
|
break;
|
||||||
|
@ -492,28 +505,30 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_TIMEZONE:
|
case ITEM_RADIO_SETUP_TIMEZONE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_TIMEZONE);
|
lcdDrawText(INDENT_WIDTH, y, STR_TIMEZONE);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_ADJUST_RTC:
|
case ITEM_RADIO_SETUP_ADJUST_RTC:
|
||||||
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, STR_ADJUST_RTC, attr, event);
|
lcdDrawText(INDENT_WIDTH, y, STR_ADJUST_RTC);
|
||||||
|
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_GPSFORMAT:
|
case ITEM_RADIO_SETUP_GPSFORMAT:
|
||||||
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
lcdDrawText(INDENT_WIDTH, y, STR_GPS_COORDS_FORMAT);
|
||||||
|
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, nullptr, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX1)
|
#if defined(PXX1)
|
||||||
case ITEM_RADIO_SETUP_COUNTRYCODE:
|
case ITEM_RADIO_SETUP_COUNTRYCODE:
|
||||||
g_eeGeneral.countryCode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRYCODE, STR_COUNTRYCODES, g_eeGeneral.countryCode, 0, 2, attr, event);
|
g_eeGeneral.countryCode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRY_CODE, STR_COUNTRY_CODES, g_eeGeneral.countryCode, 0, 2, attr, event);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_LANGUAGE:
|
case ITEM_RADIO_SETUP_LANGUAGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_VOICELANG);
|
lcdDrawTextAlignedLeft(y, STR_VOICE_LANGUAGE);
|
||||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||||
if (attr) {
|
if (attr) {
|
||||||
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
||||||
|
@ -525,7 +540,7 @@ void menuRadioSetup(event_t event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_RADIO_SETUP_IMPERIAL:
|
case ITEM_RADIO_SETUP_IMPERIAL:
|
||||||
g_eeGeneral.imperial = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_UNITSSYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
|
g_eeGeneral.imperial = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_UNITS_SYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(FAI_CHOICE)
|
#if defined(FAI_CHOICE)
|
||||||
|
@ -570,7 +585,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_RADIO_SETUP_STICK_MODE:
|
case ITEM_RADIO_SETUP_STICK_MODE:
|
||||||
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
|
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
|
||||||
for (uint8_t i=0; i<4; i++) {
|
for (uint8_t i=0; i<4; i++) {
|
||||||
putsStickName((6+4*i)*FW, y, *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
|
drawStickName((6+4*i)*FW, y, *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
|
||||||
}
|
}
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3);
|
CHECK_INCDEC_GENVAR(event, reusableBuffer.generalSettings.stickMode, 0, 3);
|
||||||
|
|
|
@ -495,7 +495,7 @@ void menuMainView(event_t event)
|
||||||
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||||
|
|
||||||
// Model Name
|
// Model Name
|
||||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
drawModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||||
|
|
||||||
// Trims sliders
|
// Trims sliders
|
||||||
displayTrims(mode);
|
displayTrims(mode);
|
||||||
|
|
|
@ -83,7 +83,9 @@ void title(const char * s)
|
||||||
|
|
||||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
|
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
|
||||||
{
|
{
|
||||||
drawFieldLabel(x, y, label);
|
if (label) {
|
||||||
|
drawFieldLabel(x, y, label);
|
||||||
|
}
|
||||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||||
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isValueAvailable);
|
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isValueAvailable);
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -2,6 +2,7 @@ include_directories(
|
||||||
${RADIO_SRC_DIRECTORY}/gui/colorlcd
|
${RADIO_SRC_DIRECTORY}/gui/colorlcd
|
||||||
${RADIO_SRC_DIRECTORY}/gui/colorlcd/layouts
|
${RADIO_SRC_DIRECTORY}/gui/colorlcd/layouts
|
||||||
${RADIO_SRC_DIRECTORY}/fonts/truetype
|
${RADIO_SRC_DIRECTORY}/fonts/truetype
|
||||||
|
${RADIO_SRC_DIRECTORY}/thirdparty/libopenui/src
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/colorlcd ${RADIO_SRC_DIRECTORY}/gui/colorlcd/themes/*.cpp)
|
file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/colorlcd ${RADIO_SRC_DIRECTORY}/gui/colorlcd/themes/*.cpp)
|
||||||
|
@ -18,12 +19,11 @@ set(GUI_SRC
|
||||||
|
|
||||||
theme.cpp
|
theme.cpp
|
||||||
# topbar.cpp
|
# topbar.cpp
|
||||||
# layout.cpp
|
layout.cpp
|
||||||
# widget.cpp
|
# widget.cpp
|
||||||
${THEMES_SRC}
|
${THEMES_SRC}
|
||||||
# ${LAYOUTS_SRC}
|
${LAYOUTS_SRC}
|
||||||
# ${WIDGETS_SRC}
|
# ${WIDGETS_SRC}
|
||||||
rle.cpp
|
|
||||||
# popups.cpp
|
# popups.cpp
|
||||||
draw_functions.cpp
|
draw_functions.cpp
|
||||||
# menus.cpp
|
# menus.cpp
|
||||||
|
@ -48,6 +48,9 @@ set(GUI_SRC
|
||||||
radio_hardware.cpp
|
radio_hardware.cpp
|
||||||
radio_calibration.cpp
|
radio_calibration.cpp
|
||||||
view_main.cpp
|
view_main.cpp
|
||||||
|
menu_screen.cpp
|
||||||
|
screen_setup.cpp
|
||||||
|
|
||||||
# view_statistics.cpp
|
# view_statistics.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,17 +78,30 @@ if(LUA STREQUAL YES)
|
||||||
# TODO set(GUI_SRC ${GUI_SRC} model_custom_scripts.cpp)
|
# TODO set(GUI_SRC ${GUI_SRC} model_custom_scripts.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# gui/${GUI_DIR}/modelslist.cpp
|
|
||||||
|
|
||||||
set(SRC
|
set(SRC
|
||||||
${SRC}
|
${SRC}
|
||||||
stubs.cpp
|
stubs.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# includes libopenui
|
# includes libopenui
|
||||||
include(gui/libopenui/CMakeLists.txt)
|
include(${RADIO_SRC_DIRECTORY}/thirdparty/libopenui/src/CMakeLists.txt)
|
||||||
include_directories(gui/libopenui)
|
include_directories(gui/libopenui)
|
||||||
add_definitions(-DLIBOPENUI)
|
add_definitions(-DLIBOPENUI)
|
||||||
foreach(LIBOPENUI_FILE ${LIBOPENUI_SRC})
|
foreach(LIBOPENUI_FILE ${LIBOPENUI_SRC})
|
||||||
set(SRC ${SRC} gui/libopenui/${LIBOPENUI_FILE})
|
set(SRC ${SRC} thirdparty/libopenui/src/${LIBOPENUI_FILE})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
add_gui_src(fullscreen_dialog.cpp)
|
||||||
|
add_gui_src(confirm_dialog.cpp)
|
||||||
|
add_gui_src(message_dialog.cpp)
|
||||||
|
add_gui_src(timeedit.cpp)
|
||||||
|
add_gui_src(curve.cpp)
|
||||||
|
add_gui_src(sourcechoice.cpp)
|
||||||
|
add_gui_src(switchchoice.cpp)
|
||||||
|
add_gui_src(curveedit.cpp)
|
||||||
|
|
||||||
|
if(HARDWARE_TOUCH)
|
||||||
|
add_gui_src(keyboard_curve.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# gui/${GUI_DIR}/modelslist.cpp
|
||||||
|
|
|
@ -21,12 +21,7 @@
|
||||||
#ifndef _COLORS_H_
|
#ifndef _COLORS_H_
|
||||||
#define _COLORS_H_
|
#define _COLORS_H_
|
||||||
|
|
||||||
// remove windows default definitions
|
#include "libopenui_config.h"
|
||||||
#undef OPAQUE
|
|
||||||
#undef RGB
|
|
||||||
|
|
||||||
#define RGB(r, g, b) (uint16_t)((((r) & 0xF8) << 8) + (((g) & 0xFC) << 3) + (((b) & 0xF8) >> 3))
|
|
||||||
#define ARGB(a, r, g, b) (uint16_t)((((a) & 0xF0) << 8) + (((r) & 0xF0) << 4) + (((g) & 0xF0) << 0) + (((b) & 0xF0) >> 4))
|
|
||||||
|
|
||||||
#define WHITE RGB(0xFF, 0xFF, 0xFF)
|
#define WHITE RGB(0xFF, 0xFF, 0xFF)
|
||||||
#define BLACK RGB(0, 0, 0)
|
#define BLACK RGB(0, 0, 0)
|
||||||
|
@ -40,49 +35,6 @@
|
||||||
#define DARKRED RGB(160, 0, 6)
|
#define DARKRED RGB(160, 0, 6)
|
||||||
#define GREEN RGB(25, 150, 50)
|
#define GREEN RGB(25, 150, 50)
|
||||||
|
|
||||||
#define OPACITY_MAX 0x0F
|
|
||||||
#define OPACITY(x) ((x)<<24)
|
|
||||||
|
|
||||||
enum LcdColorIndex
|
|
||||||
{
|
|
||||||
TEXT_COLOR_INDEX,
|
|
||||||
TEXT_BGCOLOR_INDEX,
|
|
||||||
TEXT_INVERTED_COLOR_INDEX,
|
|
||||||
TEXT_INVERTED_BGCOLOR_INDEX,
|
|
||||||
TEXT_STATUSBAR_COLOR_INDEX,
|
|
||||||
LINE_COLOR_INDEX,
|
|
||||||
SCROLLBOX_COLOR_INDEX,
|
|
||||||
MENU_TITLE_BGCOLOR_INDEX,
|
|
||||||
MENU_TITLE_COLOR_INDEX,
|
|
||||||
MENU_TITLE_DISABLE_COLOR_INDEX,
|
|
||||||
HEADER_COLOR_INDEX,
|
|
||||||
ALARM_COLOR_INDEX,
|
|
||||||
WARNING_COLOR_INDEX,
|
|
||||||
TEXT_DISABLE_COLOR_INDEX,
|
|
||||||
CURVE_AXIS_COLOR_INDEX,
|
|
||||||
CURVE_COLOR_INDEX,
|
|
||||||
CURVE_CURSOR_COLOR_INDEX,
|
|
||||||
HEADER_BGCOLOR_INDEX,
|
|
||||||
HEADER_ICON_BGCOLOR_INDEX,
|
|
||||||
HEADER_CURRENT_BGCOLOR_INDEX,
|
|
||||||
TITLE_BGCOLOR_INDEX,
|
|
||||||
TRIM_BGCOLOR_INDEX,
|
|
||||||
TRIM_SHADOW_COLOR_INDEX,
|
|
||||||
MAINVIEW_PANES_COLOR_INDEX,
|
|
||||||
MAINVIEW_GRAPHICS_COLOR_INDEX,
|
|
||||||
OVERLAY_COLOR_INDEX,
|
|
||||||
CUSTOM_COLOR_INDEX,
|
|
||||||
BARGRAPH1_COLOR_INDEX,
|
|
||||||
BARGRAPH2_COLOR_INDEX,
|
|
||||||
BARGRAPH_BGCOLOR_INDEX,
|
|
||||||
LCD_COLOR_COUNT
|
|
||||||
};
|
|
||||||
|
|
||||||
extern uint16_t lcdColorTable[LCD_COLOR_COUNT];
|
|
||||||
|
|
||||||
#define COLOR(index) LcdFlags((index) << 16)
|
|
||||||
#define COLOR_IDX(att) uint8_t((att) >> 16)
|
|
||||||
|
|
||||||
#define TEXT_COLOR COLOR(TEXT_COLOR_INDEX)
|
#define TEXT_COLOR COLOR(TEXT_COLOR_INDEX)
|
||||||
#define TEXT_BGCOLOR COLOR(TEXT_BGCOLOR_INDEX)
|
#define TEXT_BGCOLOR COLOR(TEXT_BGCOLOR_INDEX)
|
||||||
#define TEXT_INVERTED_COLOR COLOR(TEXT_INVERTED_COLOR_INDEX)
|
#define TEXT_INVERTED_COLOR COLOR(TEXT_INVERTED_COLOR_INDEX)
|
||||||
|
@ -106,7 +58,7 @@ extern uint16_t lcdColorTable[LCD_COLOR_COUNT];
|
||||||
#define TRIM_SHADOW_COLOR COLOR(TRIM_SHADOW_COLOR_INDEX)
|
#define TRIM_SHADOW_COLOR COLOR(TRIM_SHADOW_COLOR_INDEX)
|
||||||
#define HEADER_BGCOLOR COLOR(HEADER_BGCOLOR_INDEX)
|
#define HEADER_BGCOLOR COLOR(HEADER_BGCOLOR_INDEX)
|
||||||
#define HEADER_ICON_BGCOLOR COLOR(HEADER_ICON_BGCOLOR_INDEX)
|
#define HEADER_ICON_BGCOLOR COLOR(HEADER_ICON_BGCOLOR_INDEX)
|
||||||
constexpr LcdFlags HEADER_CURRENT_BGCOLOR = COLOR(HEADER_CURRENT_BGCOLOR_INDEX);
|
#define HEADER_CURRENT_BGCOLOR COLOR(HEADER_CURRENT_BGCOLOR_INDEX)
|
||||||
#define MAINVIEW_PANES_COLOR COLOR(MAINVIEW_PANES_COLOR_INDEX)
|
#define MAINVIEW_PANES_COLOR COLOR(MAINVIEW_PANES_COLOR_INDEX)
|
||||||
#define MAINVIEW_GRAPHICS_COLOR COLOR(MAINVIEW_GRAPHICS_COLOR_INDEX)
|
#define MAINVIEW_GRAPHICS_COLOR COLOR(MAINVIEW_GRAPHICS_COLOR_INDEX)
|
||||||
#define OVERLAY_COLOR COLOR(OVERLAY_COLOR_INDEX)
|
#define OVERLAY_COLOR COLOR(OVERLAY_COLOR_INDEX)
|
||||||
|
@ -115,27 +67,4 @@ constexpr LcdFlags HEADER_CURRENT_BGCOLOR = COLOR(HEADER_CURRENT_BGCOLOR_INDEX)
|
||||||
#define BARGRAPH_BGCOLOR COLOR(BARGRAPH_BGCOLOR_INDEX)
|
#define BARGRAPH_BGCOLOR COLOR(BARGRAPH_BGCOLOR_INDEX)
|
||||||
#define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
|
#define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
|
||||||
|
|
||||||
#define ARGB_SPLIT(color, a, r, g, b) \
|
|
||||||
uint16_t a = ((color) & 0xF000) >> 12; \
|
|
||||||
uint16_t r = ((color) & 0x0F00) >> 8; \
|
|
||||||
uint16_t g = ((color) & 0x00F0) >> 4; \
|
|
||||||
uint16_t b = ((color) & 0x000F)
|
|
||||||
|
|
||||||
#define RGB_SPLIT(color, r, g, b) \
|
|
||||||
uint16_t r = ((color) & 0xF800) >> 11; \
|
|
||||||
uint16_t g = ((color) & 0x07E0) >> 5; \
|
|
||||||
uint16_t b = ((color) & 0x001F)
|
|
||||||
|
|
||||||
#define RGB_JOIN(r, g, b) \
|
|
||||||
(((r) << 11) + ((g) << 5) + (b))
|
|
||||||
|
|
||||||
#define GET_RED(color) \
|
|
||||||
(((color) & 0xF800) >> 8)
|
|
||||||
|
|
||||||
#define GET_GREEN(color) \
|
|
||||||
(((color) & 0x07E0) >> 3)
|
|
||||||
|
|
||||||
#define GET_BLUE(color) \
|
|
||||||
(((color) & 0x001F) << 3)
|
|
||||||
|
|
||||||
#endif // _COLORS_H_
|
#endif // _COLORS_H_
|
||||||
|
|
44
radio/src/gui/colorlcd/confirm_dialog.cpp
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) OpenTX
|
||||||
|
*
|
||||||
|
* Based on code named
|
||||||
|
* th9x - http://code.google.com/p/th9x
|
||||||
|
* er9x - http://code.google.com/p/er9x
|
||||||
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
|
*
|
||||||
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "confirm_dialog.h"
|
||||||
|
#include "static.h"
|
||||||
|
|
||||||
|
ConfirmDialog::ConfirmDialog(const char *title, const char *message, std::function<void(void)> confirmHandler) :
|
||||||
|
Dialog(title, {50, 73, LCD_W - 100, LCD_H - 146}),
|
||||||
|
confirmHandler(std::move(confirmHandler))
|
||||||
|
{
|
||||||
|
new StaticText(this, {0, height() / 2, width(), PAGE_LINE_HEIGHT}, message, CENTERED);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(HARDWARE_KEYS)
|
||||||
|
void ConfirmDialog::onKeyEvent(event_t event)
|
||||||
|
{
|
||||||
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
|
||||||
|
|
||||||
|
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
|
confirmHandler();
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
else if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -18,23 +18,21 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _COLOREDIT_H_
|
#ifndef _CONFIRM_DIALOG_H_
|
||||||
#define _COLOREDIT_H_
|
#define _CONFIRM_DIALOG_H_
|
||||||
|
|
||||||
#include "window.h"
|
#include "dialog.h"
|
||||||
|
|
||||||
class ColorEdit : public Window {
|
class ConfirmDialog: public Dialog {
|
||||||
public:
|
public:
|
||||||
ColorEdit(Window * parent, const rect_t & rect, std::function<int32_t()> getValue, std::function<void(int32_t)> setValue = nullptr);
|
ConfirmDialog(const char * title, const char * message, std::function<void(void)> confirmHandler);
|
||||||
|
|
||||||
#if defined(DEBUG_WINDOWS)
|
#if defined(HARDWARE_KEYS)
|
||||||
std::string getName() override
|
void onKeyEvent(event_t event) override;
|
||||||
{
|
|
||||||
return "ColorEdit";
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
~ColorEdit() override;
|
protected:
|
||||||
|
std::function<void(void)> confirmHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _COLOREDIT_H_
|
#endif // _CONFIRM_DIALOG_H_
|
|
@ -23,6 +23,7 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "strhelpers.h"
|
#include "strhelpers.h"
|
||||||
|
#include "font.h"
|
||||||
|
|
||||||
void Curve::drawBackground(BitmapBuffer * dc)
|
void Curve::drawBackground(BitmapBuffer * dc)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +41,7 @@ void Curve::drawBackground(BitmapBuffer * dc)
|
||||||
dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, CURVE_AXIS_COLOR);
|
dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, CURVE_AXIS_COLOR);
|
||||||
|
|
||||||
// Outside border
|
// Outside border
|
||||||
// drawSolidRect(dc, 0, 0, width(), height(), 1, TEXT_COLOR);
|
// dc->drawSolidRect(0, 0, width(), height(), 1, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t Curve::getPointX(int x)
|
coord_t Curve::getPointX(int x)
|
|
@ -19,32 +19,33 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
#include "font.h"
|
||||||
|
|
||||||
coord_t getCurveYCoord(FnFuncP fn, int x, int width)
|
coord_t getCurveYCoord(FnFuncP fn, int x, int width)
|
||||||
{
|
{
|
||||||
return limit(-width, -divRoundClosest(fn(divRoundClosest(x * RESX, width)) * width, RESX), +width);
|
return limit(-width, -divRoundClosest(fn(divRoundClosest(x * RESX, width)) * width, RESX), +width);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawFunction(FnFuncP fn, int x, int y, int width)
|
void drawFunction(BitmapBuffer * dc, FnFuncP fn, int x, int y, int width)
|
||||||
{
|
{
|
||||||
int left = x - width;
|
int left = x - width;
|
||||||
int right = x + width;
|
int right = x + width;
|
||||||
|
|
||||||
// Axis
|
// Axis
|
||||||
lcdDrawSolidHorizontalLine(left, y, width*2+1, CURVE_AXIS_COLOR);
|
dc->drawSolidHorizontalLine(left, y, width*2+1, CURVE_AXIS_COLOR);
|
||||||
lcdDrawSolidVerticalLine(x, y-width, width*2, CURVE_AXIS_COLOR);
|
dc->drawSolidVerticalLine(x, y-width, width*2, CURVE_AXIS_COLOR);
|
||||||
|
|
||||||
// Extra lines
|
// Extra lines
|
||||||
lcdDrawVerticalLine(left+width/2, y-width, width*2, STASHED, CURVE_AXIS_COLOR);
|
dc->drawVerticalLine(left+width/2, y-width, width*2, STASHED, CURVE_AXIS_COLOR);
|
||||||
lcdDrawVerticalLine(right-width/2, y-width, width*2, STASHED, CURVE_AXIS_COLOR);
|
dc->drawVerticalLine(right-width/2, y-width, width*2, STASHED, CURVE_AXIS_COLOR);
|
||||||
lcdDrawHorizontalLine(left, y-width/2, width*2+1, STASHED, CURVE_AXIS_COLOR);
|
dc->drawHorizontalLine(left, y-width/2, width*2+1, STASHED, CURVE_AXIS_COLOR);
|
||||||
lcdDrawHorizontalLine(left, y+width/2, width*2+1, STASHED, CURVE_AXIS_COLOR);
|
dc->drawHorizontalLine(left, y+width/2, width*2+1, STASHED, CURVE_AXIS_COLOR);
|
||||||
|
|
||||||
// Outside border
|
// Outside border
|
||||||
lcdDrawSolidVerticalLine(left, y-width, width*2, TEXT_COLOR);
|
dc->drawSolidVerticalLine(left, y-width, width*2, TEXT_COLOR);
|
||||||
lcdDrawSolidVerticalLine(right, y-width, width*2, TEXT_COLOR);
|
dc->drawSolidVerticalLine(right, y-width, width*2, TEXT_COLOR);
|
||||||
lcdDrawSolidHorizontalLine(left, y-width, width*2+1, TEXT_COLOR);
|
dc->drawSolidHorizontalLine(left, y-width, width*2+1, TEXT_COLOR);
|
||||||
lcdDrawSolidHorizontalLine(left, y+width, width*2+1, TEXT_COLOR);
|
dc->drawSolidHorizontalLine(left, y+width, width*2+1, TEXT_COLOR);
|
||||||
|
|
||||||
coord_t prev_yv = (coord_t)-1;
|
coord_t prev_yv = (coord_t)-1;
|
||||||
|
|
||||||
|
@ -53,12 +54,12 @@ void drawFunction(FnFuncP fn, int x, int y, int width)
|
||||||
if (prev_yv != (coord_t)-1) {
|
if (prev_yv != (coord_t)-1) {
|
||||||
if (prev_yv < yv) {
|
if (prev_yv < yv) {
|
||||||
for (int y=prev_yv; y<=yv; y+=1) {
|
for (int y=prev_yv; y<=yv; y+=1) {
|
||||||
lcdDrawBitmapPattern(x+xv-2, y-2, LBM_POINT, TEXT_COLOR);
|
dc->drawBitmapPattern(x+xv-2, y-2, LBM_POINT, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (int y=yv; y<=prev_yv; y+=1) {
|
for (int y=yv; y<=prev_yv; y+=1) {
|
||||||
lcdDrawBitmapPattern(x+xv-2, y-2, LBM_POINT, TEXT_COLOR);
|
dc->drawBitmapPattern(x+xv-2, y-2, LBM_POINT, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,31 +67,31 @@ void drawFunction(FnFuncP fn, int x, int y, int width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCurveVerticalScale(int x)
|
void drawCurveVerticalScale(BitmapBuffer * dc, int x)
|
||||||
{
|
{
|
||||||
for (int i=0; i<=20; i++) {
|
for (int i=0; i<=20; i++) {
|
||||||
lcdDrawSolidHorizontalLine(x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, 10, TEXT_COLOR);
|
dc->drawSolidHorizontalLine(x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, 10, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCurveHorizontalScale()
|
void drawCurveHorizontalScale(BitmapBuffer * dc)
|
||||||
{
|
{
|
||||||
for (int i=0; i<=20; i++) {
|
for (int i=0; i<=20; i++) {
|
||||||
lcdDrawSolidVerticalLine(CURVE_CENTER_X-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+5, 10, TEXT_COLOR);
|
dc->drawSolidVerticalLine(CURVE_CENTER_X-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+5, 10, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCurveCoord(int x, int y, const char * text, bool active)
|
void drawCurveCoord(BitmapBuffer * dc, int x, int y, const char * text, bool active)
|
||||||
{
|
{
|
||||||
lcd->drawSolidFilledRect(x, y, CURVE_COORD_WIDTH, CURVE_COORD_HEIGHT, CURVE_CURSOR_COLOR);
|
dc->drawSolidFilledRect(x, y, CURVE_COORD_WIDTH, CURVE_COORD_HEIGHT, CURVE_CURSOR_COLOR);
|
||||||
lcdDrawText(x+3+(CURVE_COORD_WIDTH-1-getTextWidth(text, SMLSIZE))/2, y+1, text, LEFT|SMLSIZE|TEXT_BGCOLOR);
|
dc->drawText(x+3+(CURVE_COORD_WIDTH-1-getTextWidth(text, SMLSIZE))/2, y+1, text, LEFT|SMLSIZE|TEXT_BGCOLOR);
|
||||||
if (active) {
|
if (active) {
|
||||||
lcdDrawBitmapPattern(x, y, LBM_CURVE_COORD_SHADOW, TEXT_COLOR);
|
dc->drawBitmapPattern(x, y, LBM_CURVE_COORD_SHADOW, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCurvePoint(int x, int y, LcdFlags color)
|
void drawCurvePoint(BitmapBuffer * dc, int x, int y, LcdFlags color)
|
||||||
{
|
{
|
||||||
lcdDrawBitmapPattern(x, y, LBM_CURVE_POINT, color);
|
dc->drawBitmapPattern(x, y, LBM_CURVE_POINT, color);
|
||||||
lcdDrawBitmapPattern(x, y, LBM_CURVE_POINT_CENTER, TEXT_BGCOLOR);
|
dc->drawBitmapPattern(x, y, LBM_CURVE_POINT_CENTER, TEXT_BGCOLOR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ void CustomCurveChoice::paint(BitmapBuffer * dc)
|
||||||
lineColor = TEXT_INVERTED_BGCOLOR;
|
lineColor = TEXT_INVERTED_BGCOLOR;
|
||||||
}
|
}
|
||||||
dc->drawText(3, 2, getCurveString(s, value), flags | textColor);
|
dc->drawText(3, 2, getCurveString(s, value), flags | textColor);
|
||||||
drawSolidRect(dc, 0, 0, rect.w, rect.h, 1, lineColor);
|
dc->drawSolidRect(0, 0, rect.w, rect.h, 1, lineColor);
|
||||||
dc->drawBitmapPattern(rect.w - 14, (rect.h - 5) / 2, LBM_DROPDOWN, lineColor);
|
dc->drawBitmapPattern(rect.w - 14, (rect.h - 5) / 2, LBM_DROPDOWN, lineColor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,99 +20,99 @@
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
void drawStatusText(const char * text)
|
void drawStatusText(BitmapBuffer * dc, const char * text)
|
||||||
{
|
{
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_FOOTER_TOP, text, TEXT_STATUSBAR_COLOR);
|
dc->drawText(MENUS_MARGIN_LEFT, MENU_FOOTER_TOP, text, TEXT_STATUSBAR_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawColumnHeader(const char * const * headers, const char * const * descriptions, uint8_t index)
|
void drawColumnHeader(BitmapBuffer * dc, const char * const * headers, const char * const * descriptions, uint8_t index)
|
||||||
{
|
{
|
||||||
lcdDrawText(LCD_W-MENUS_MARGIN_LEFT, MENU_TITLE_TOP + 2, headers[index], RIGHT | SMLSIZE | MENU_TITLE_COLOR);
|
dc->drawText(LCD_W-MENUS_MARGIN_LEFT, MENU_TITLE_TOP + 2, headers[index], RIGHT | SMLSIZE | MENU_TITLE_COLOR);
|
||||||
if (descriptions) {
|
if (descriptions) {
|
||||||
drawStatusText(descriptions[index]);
|
drawStatusText(dc, descriptions[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
void drawCheckBox(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||||
{
|
{
|
||||||
if (attr) {
|
if (attr) {
|
||||||
lcdDrawSolidFilledRect(x-1, y+3, 14, 14, TEXT_INVERTED_BGCOLOR);
|
dc->drawSolidFilledRect(x-1, y+3, 14, 14, TEXT_INVERTED_BGCOLOR);
|
||||||
lcdDrawSolidFilledRect(x+1, y+5, 10, 10, TEXT_BGCOLOR);
|
dc->drawSolidFilledRect(x+1, y+5, 10, 10, TEXT_BGCOLOR);
|
||||||
if (value) {
|
if (value) {
|
||||||
lcdDrawSolidFilledRect(x+2, y+6, 8, 8, TEXT_INVERTED_BGCOLOR);
|
dc->drawSolidFilledRect(x+2, y+6, 8, 8, TEXT_INVERTED_BGCOLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (value) {
|
if (value) {
|
||||||
lcdDrawSolidFilledRect(x+2, y+6, 8, 8, SCROLLBOX_COLOR);
|
dc->drawSolidFilledRect(x+2, y+6, 8, 8, SCROLLBOX_COLOR);
|
||||||
lcdDrawSolidRect(x, y+4, 12, 12, 1, LINE_COLOR);
|
dc->drawSolidRect(x, y+4, 12, 12, 1, LINE_COLOR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawSolidRect(x, y+4, 12, 12, 1, LINE_COLOR);
|
dc->drawSolidRect(x, y+4, 12, 12, 1, LINE_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
void drawVerticalScrollbar(BitmapBuffer * dc, coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||||
{
|
{
|
||||||
if (visible < count) {
|
if (visible < count) {
|
||||||
lcdDrawSolidVerticalLine(x, y, h, LINE_COLOR);
|
dc->drawSolidVerticalLine(x, y, h, LINE_COLOR);
|
||||||
coord_t yofs = (h*offset + count/2) / count;
|
coord_t yofs = (h*offset + count/2) / count;
|
||||||
coord_t yhgt = (h*visible + count/2) / count;
|
coord_t yhgt = (h*visible + count/2) / count;
|
||||||
if (yhgt + yofs > h)
|
if (yhgt + yofs > h)
|
||||||
yhgt = h - yofs;
|
yhgt = h - yofs;
|
||||||
lcdDrawSolidFilledRect(x-1, y + yofs, 3, yhgt, SCROLLBOX_COLOR);
|
dc->drawSolidFilledRect(x-1, y + yofs, 3, yhgt, SCROLLBOX_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawTrimSquare(coord_t x, coord_t y)
|
void drawTrimSquare(BitmapBuffer * dc, coord_t x, coord_t y)
|
||||||
{
|
{
|
||||||
lcdDrawSolidFilledRect(x-2, y, 15, 15, TRIM_BGCOLOR);
|
dc->drawSolidFilledRect(x-2, y, 15, 15, TRIM_BGCOLOR);
|
||||||
lcdDrawBitmapPattern(x-2, y, LBM_TRIM_SHADOW, TRIM_SHADOW_COLOR);
|
dc->drawBitmapPattern(x-2, y, LBM_TRIM_SHADOW, TRIM_SHADOW_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawHorizontalTrimPosition(coord_t x, coord_t y, int16_t dir)
|
void drawHorizontalTrimPosition(BitmapBuffer * dc, coord_t x, coord_t y, int16_t dir)
|
||||||
{
|
{
|
||||||
drawTrimSquare(x, y);
|
drawTrimSquare(dc, x, y);
|
||||||
if (dir >= 0) {
|
if (dir >= 0) {
|
||||||
lcdDrawSolidVerticalLine(x+8, y+3, 9, TEXT_INVERTED_COLOR);
|
dc->drawSolidVerticalLine(x+8, y+3, 9, TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
if (dir <= 0) {
|
if (dir <= 0) {
|
||||||
lcdDrawSolidVerticalLine(x+2, y+3, 9, TEXT_INVERTED_COLOR);
|
dc->drawSolidVerticalLine(x+2, y+3, 9, TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
// if (exttrim) {
|
// if (exttrim) {
|
||||||
// lcdDrawSolidVerticalLine(xm, ym, 9, TEXT_INVERTED_COLOR);
|
// lcdDrawSolidVerticalLine(xm, ym, 9, TEXT_INVERTED_COLOR);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawVerticalTrimPosition(coord_t x, coord_t y, int16_t dir)
|
void drawVerticalTrimPosition(BitmapBuffer * dc, coord_t x, coord_t y, int16_t dir)
|
||||||
{
|
{
|
||||||
drawTrimSquare(x, y);
|
drawTrimSquare(dc, x, y);
|
||||||
if (dir >= 0) {
|
if (dir >= 0) {
|
||||||
lcdDrawSolidHorizontalLine(x+1, y+4, 9, TEXT_INVERTED_COLOR);
|
dc->drawSolidHorizontalLine(x+1, y+4, 9, TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
if (dir <= 0) {
|
if (dir <= 0) {
|
||||||
lcdDrawSolidHorizontalLine(x+1, y+10, 9, TEXT_INVERTED_COLOR);
|
dc->drawSolidHorizontalLine(x+1, y+10, 9, TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
// if (exttrim) {
|
// if (exttrim) {
|
||||||
// lcdDrawSolidHorizontalLine(xm-1, ym, 3, TEXT_INVERTED_COLOR);
|
// lcdDrawSolidHorizontalLine(xm-1, ym, 3, TEXT_INVERTED_COLOR);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawVerticalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
|
void drawVerticalSlider(BitmapBuffer * dc, coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
|
||||||
{
|
{
|
||||||
val = limit(min, val, max);
|
val = limit(min, val, max);
|
||||||
if (steps) {
|
if (steps) {
|
||||||
int delta = len / steps;
|
int delta = len / steps;
|
||||||
for (int i = 0; i <= len; i += delta) {
|
for (int i = 0; i <= len; i += delta) {
|
||||||
if ((options & OPTION_SLIDER_BIG_TICKS) && (i == 0 || i == len / 2 || i == len))
|
if ((options & OPTION_SLIDER_BIG_TICKS) && (i == 0 || i == len / 2 || i == len))
|
||||||
lcdDrawSolidHorizontalLine(x, y + i, 13, TEXT_COLOR);
|
dc->drawSolidHorizontalLine(x, y + i, 13, TEXT_COLOR);
|
||||||
else
|
else
|
||||||
lcdDrawSolidHorizontalLine(x + 2, y + i, 9, TEXT_COLOR);
|
dc->drawSolidHorizontalLine(x + 2, y + i, 9, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawBitmapPattern(x + 1, y, LBM_VTRIM_FRAME, TEXT_COLOR);
|
dc->drawBitmapPattern(x + 1, y, LBM_VTRIM_FRAME, TEXT_COLOR);
|
||||||
/* if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
/* if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
||||||
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
||||||
lcdDrawNumber((stickIndex==0 ? TRIM_LH_X : TRIM_RH_X)+(trim>0 ? -20 : 50), ym+1, trim, TINSIZE);
|
lcdDrawNumber((stickIndex==0 ? TRIM_LH_X : TRIM_RH_X)+(trim>0 ? -20 : 50), ym+1, trim, TINSIZE);
|
||||||
|
@ -121,18 +121,18 @@ void drawVerticalSlider(coord_t x, coord_t y, int len, int val, int min, int max
|
||||||
}
|
}
|
||||||
y += len - divRoundClosest(len * (val - min), max - min) - 5;
|
y += len - divRoundClosest(len * (val - min), max - min) - 5;
|
||||||
if (options & OPTION_SLIDER_TRIM_BUTTON) {
|
if (options & OPTION_SLIDER_TRIM_BUTTON) {
|
||||||
drawVerticalTrimPosition(x, y - 2, val);
|
drawVerticalTrimPosition(dc, x, y - 2, val);
|
||||||
}
|
}
|
||||||
else if (options & OPTION_SLIDER_NUMBER_BUTTON) {
|
else if (options & OPTION_SLIDER_NUMBER_BUTTON) {
|
||||||
drawTrimSquare(x, y - 2);
|
drawTrimSquare(dc, x, y - 2);
|
||||||
lcdDrawChar(x + 2, y - 1, '0' + val, SMLSIZE | TEXT_INVERTED_COLOR);
|
// TODO lcdDrawChar(x + 2, y - 1, '0' + val, SMLSIZE | TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
drawTrimSquare(x, y - 2);
|
drawTrimSquare(dc, x, y - 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawHorizontalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
|
void drawHorizontalSlider(BitmapBuffer * dc, coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
|
||||||
{
|
{
|
||||||
val = limit(min, val, max);
|
val = limit(min, val, max);
|
||||||
int w = divRoundClosest(len * (val - min), max - min);
|
int w = divRoundClosest(len * (val - min), max - min);
|
||||||
|
@ -141,27 +141,27 @@ void drawHorizontalSlider(coord_t x, coord_t y, int len, int val, int min, int m
|
||||||
int delta = len / steps;
|
int delta = len / steps;
|
||||||
for (int i = 0; i <= len; i += delta) {
|
for (int i = 0; i <= len; i += delta) {
|
||||||
if ((options & OPTION_SLIDER_BIG_TICKS) && (i == 0 || i == len / 2 || i == len))
|
if ((options & OPTION_SLIDER_BIG_TICKS) && (i == 0 || i == len / 2 || i == len))
|
||||||
lcdDrawSolidVerticalLine(x + i, y, 13, TEXT_COLOR);
|
dc->drawSolidVerticalLine(x + i, y, 13, TEXT_COLOR);
|
||||||
else
|
else
|
||||||
lcdDrawSolidVerticalLine(x + i, y + 2, 9, TEXT_COLOR);
|
dc->drawSolidVerticalLine(x + i, y + 2, 9, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (options & OPTION_SLIDER_EMPTY_BAR) {
|
else if (options & OPTION_SLIDER_EMPTY_BAR) {
|
||||||
lcdDrawBitmapPattern(x, y + 1, LBM_HTRIM_FRAME, TEXT_COLOR);
|
dc->drawBitmapPattern(x, y + 1, LBM_HTRIM_FRAME, TEXT_COLOR);
|
||||||
}
|
}
|
||||||
else if (options & OPTION_SLIDER_DBL_COLOR) {
|
else if (options & OPTION_SLIDER_DBL_COLOR) {
|
||||||
lcdDrawBitmapPattern(x, y + 8, LBM_SLIDER_BAR_LEFT, w <= 0 ? LINE_COLOR : TEXT_INVERTED_BGCOLOR);
|
dc->drawBitmapPattern(x, y + 8, LBM_SLIDER_BAR_LEFT, w <= 0 ? LINE_COLOR : TEXT_INVERTED_BGCOLOR);
|
||||||
if (w > 4)
|
if (w > 4)
|
||||||
lcdDrawSolidFilledRect(x + 4, y + 8, w - 4, 4, TEXT_INVERTED_BGCOLOR);
|
dc->drawSolidFilledRect(x + 4, y + 8, w - 4, 4, TEXT_INVERTED_BGCOLOR);
|
||||||
if (w < len - 4)
|
if (w < len - 4)
|
||||||
lcdDrawSolidFilledRect(x + w, y + 8, len - w - 4, 4, LINE_COLOR);
|
dc->drawSolidFilledRect(x + w, y + 8, len - w - 4, 4, LINE_COLOR);
|
||||||
lcdDrawBitmapPattern(x + len - 4, y + 8, LBM_SLIDER_BAR_RIGHT, w >= len ? TEXT_INVERTED_BGCOLOR : LINE_COLOR);
|
dc->drawBitmapPattern(x + len - 4, y + 8, LBM_SLIDER_BAR_RIGHT, w >= len ? TEXT_INVERTED_BGCOLOR : LINE_COLOR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawBitmapPattern(x, y + 8, LBM_SLIDER_BAR_LEFT, LINE_COLOR);
|
dc->drawBitmapPattern(x, y + 8, LBM_SLIDER_BAR_LEFT, LINE_COLOR);
|
||||||
lcdDrawSolidFilledRect(x + 4, y + 8, len - 8, 4, LINE_COLOR);
|
dc->drawSolidFilledRect(x + 4, y + 8, len - 8, 4, LINE_COLOR);
|
||||||
lcdDrawBitmapPattern(x + len - 4, y + 8, LBM_SLIDER_BAR_RIGHT, LINE_COLOR);
|
dc->drawBitmapPattern(x + len - 4, y + 8, LBM_SLIDER_BAR_RIGHT, LINE_COLOR);
|
||||||
//
|
//
|
||||||
/* if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
/* if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
|
||||||
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
|
||||||
|
@ -171,21 +171,21 @@ void drawHorizontalSlider(coord_t x, coord_t y, int len, int val, int min, int m
|
||||||
}
|
}
|
||||||
x += w - 5;
|
x += w - 5;
|
||||||
if (options & OPTION_SLIDER_TRIM_BUTTON) {
|
if (options & OPTION_SLIDER_TRIM_BUTTON) {
|
||||||
drawHorizontalTrimPosition(x, y - 1, val);
|
drawHorizontalTrimPosition(dc, x, y - 1, val);
|
||||||
}
|
}
|
||||||
else if (options & OPTION_SLIDER_NUMBER_BUTTON) {
|
else if (options & OPTION_SLIDER_NUMBER_BUTTON) {
|
||||||
drawTrimSquare(x+2, y - 1);
|
drawTrimSquare(dc, x+2, y - 1);
|
||||||
char text[] = { (char)('0' + val), '\0' };
|
char text[] = { (char)('0' + val), '\0' };
|
||||||
lcdDrawText(x + 7, y - 1, text, SMLSIZE | CENTERED | TEXT_INVERTED_COLOR);
|
dc->drawText(x + 7, y - 1, text, SMLSIZE | CENTERED | TEXT_INVERTED_COLOR);
|
||||||
}
|
}
|
||||||
else if (options & OPTION_SLIDER_SQUARE_BUTTON) {
|
else if (options & OPTION_SLIDER_SQUARE_BUTTON) {
|
||||||
drawTrimSquare(x, y - 1);
|
drawTrimSquare(dc, x, y - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_OUT, TEXT_COLOR);
|
dc->drawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_OUT, TEXT_COLOR);
|
||||||
lcdDrawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_MID, TEXT_BGCOLOR);
|
dc->drawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_MID, TEXT_BGCOLOR);
|
||||||
if ((options & INVERS) && (!(options & BLINK) || !BLINK_ON_PHASE))
|
if ((options & INVERS) && (!(options & BLINK) || !BLINK_ON_PHASE))
|
||||||
lcdDrawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_IN, TEXT_INVERTED_BGCOLOR);
|
dc->drawBitmapPattern(x, y + 2, LBM_SLIDER_POINT_IN, TEXT_INVERTED_BGCOLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
||||||
#else
|
#else
|
||||||
void drawValueOrGVar(BitmapBuffer * dc, coord_t x, coord_t y, gvar_t value, LcdFlags flags)
|
void drawValueOrGVar(BitmapBuffer * dc, coord_t x, coord_t y, gvar_t value, LcdFlags flags)
|
||||||
{
|
{
|
||||||
drawNumber(dc, x, y, value, flags, 0, nullptr, "%");
|
dc->drawNumber(x, y, value, flags, 0, nullptr, "%");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ void drawSleepBitmap()
|
||||||
lcd->clearClippingRect();
|
lcd->clearClippingRect();
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
|
|
||||||
const BitmapBuffer * bitmap = BitmapBuffer::load(getThemePath("sleep.bmp"));
|
const BitmapBuffer * bitmap = BitmapBuffer::load(static_cast<ThemeBase *>(theme)->getFilePath("sleep.bmp"));
|
||||||
if (bitmap) {
|
if (bitmap) {
|
||||||
lcd->drawBitmap((LCD_W-bitmap->getWidth())/2, (LCD_H-bitmap->getHeight())/2, bitmap);
|
lcd->drawBitmap((LCD_W-bitmap->getWidth())/2, (LCD_H-bitmap->getHeight())/2, bitmap);
|
||||||
delete bitmap;
|
delete bitmap;
|
||||||
|
@ -274,21 +274,21 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration, const char
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static uint32_t lastDuration = 0xffffffff;
|
static uint32_t lastDuration = 0xffffffff;
|
||||||
static const BitmapBuffer * shutdown = BitmapBuffer::load(getThemePath("shutdown.bmp"));
|
static const BitmapBuffer * shutdown = BitmapBuffer::load(static_cast<ThemeBase *>(theme)->getFilePath("shutdown.bmp"));
|
||||||
|
|
||||||
if (shutdown) {
|
if (shutdown) {
|
||||||
if (duration < lastDuration) {
|
if (duration < lastDuration) {
|
||||||
theme->drawBackground(lcd);
|
static_cast<ThemeBase *>(theme)->drawBackground(lcd);
|
||||||
lcd->drawBitmap((LCD_W-shutdown->getWidth())/2, (LCD_H-shutdown->getHeight())/2, shutdown);
|
lcd->drawBitmap((LCD_W-shutdown->getWidth())/2, (LCD_H-shutdown->getHeight())/2, shutdown);
|
||||||
lcdStoreBackupBuffer();
|
lcdStoreBackupBuffer();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdRestoreBackupBuffer();
|
lcdRestoreBackupBuffer();
|
||||||
int quarter = duration / (totalDuration / 5);
|
int quarter = duration / (totalDuration / 5);
|
||||||
if (quarter >= 1) lcdDrawBitmapPattern(LCD_W/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, 0, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 1) lcd->drawBitmapPattern(LCD_W/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, 0, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
if (quarter >= 2) lcdDrawBitmapPattern(LCD_W/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 2) lcd->drawBitmapPattern(LCD_W/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
if (quarter >= 3) lcdDrawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 3) lcd->drawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
if (quarter >= 4) lcdDrawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER*3/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 4) lcd->drawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER*3/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -320,7 +320,7 @@ void drawCurveRef(BitmapBuffer * dc, coord_t x, coord_t y, const CurveRef & curv
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURVE_REF_FUNC:
|
case CURVE_REF_FUNC:
|
||||||
drawTextAtIndex(dc, x, y, STR_VCURVEFUNC, curve.value, flags);
|
dc->drawTextAtIndex(x, y, STR_VCURVEFUNC, curve.value, flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURVE_REF_CUSTOM:
|
case CURVE_REF_CUSTOM:
|
||||||
|
@ -330,13 +330,13 @@ void drawCurveRef(BitmapBuffer * dc, coord_t x, coord_t y, const CurveRef & curv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
void drawStickName(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t length = STR_VSRCRAW[0];
|
uint8_t length = STR_VSRCRAW[0];
|
||||||
lcdDrawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
dc->drawSizedText(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
||||||
}
|
}
|
||||||
|
|
||||||
void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att)
|
void drawModelName(BitmapBuffer * dc, coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att)
|
||||||
{
|
{
|
||||||
uint8_t len = sizeof(g_model.header.name);
|
uint8_t len = sizeof(g_model.header.name);
|
||||||
while (len>0 && !name[len-1]) --len;
|
while (len>0 && !name[len-1]) --len;
|
||||||
|
@ -344,15 +344,15 @@ void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att)
|
||||||
drawStringWithIndex(x, y, STR_MODEL, id+1, att|LEADING0);
|
drawStringWithIndex(x, y, STR_MODEL, id+1, att|LEADING0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawSizedText(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
dc->drawSizedText(x, y, name, sizeof(g_model.header.name), att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags flags)
|
void drawCurveName(BitmapBuffer * dc, coord_t x, coord_t y, int8_t idx, LcdFlags flags)
|
||||||
{
|
{
|
||||||
char s[8];
|
char s[8];
|
||||||
getCurveString(s, idx);
|
getCurveString(s, idx);
|
||||||
lcdDrawText(x, y, s, flags);
|
dc->drawText(x, y, s, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawSource(BitmapBuffer * dc, coord_t x, coord_t y, mixsrc_t idx, LcdFlags flags)
|
void drawSource(BitmapBuffer * dc, coord_t x, coord_t y, mixsrc_t idx, LcdFlags flags)
|
||||||
|
@ -390,33 +390,33 @@ void drawDate(BitmapBuffer * dc, coord_t x, coord_t y, TelemetryItem & telemetry
|
||||||
if (att & DBLSIZE) {
|
if (att & DBLSIZE) {
|
||||||
x -= 42;
|
x -= 42;
|
||||||
att &= ~FONTSIZE_MASK;
|
att &= ~FONTSIZE_MASK;
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
dc->drawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos-1, y, '-', att);
|
dc->drawText(lcdNextPos-1, y, "-", att);
|
||||||
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
|
dc->drawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos-1, y, '-', att);
|
dc->drawText(lcdNextPos-1, y, "-", att);
|
||||||
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
|
dc->drawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||||
y += FH;
|
y += FH;
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
dc->drawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos, y, ':', att);
|
dc->drawText(lcdNextPos, y, ":", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos, y, ':', att);
|
dc->drawText(lcdNextPos, y, ":", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
dc->drawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos-1, y, '-', att);
|
dc->drawText(lcdNextPos-1, y, "-", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.month, att|LEFT, 2);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.month, att|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos-1, y, '-', att);
|
dc->drawText(lcdNextPos-1, y, "-", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.year-2000, att|LEFT);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||||
lcdDrawNumber(lcdNextPos+11, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
dc->drawNumber(lcdNextPos+11, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos, y, ':', att);
|
dc->drawText(lcdNextPos, y, ":", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
||||||
lcdDrawChar(lcdNextPos, y, ':', att);
|
dc->drawText(lcdNextPos, y, ":", att);
|
||||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
dc->drawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, LcdFlags flags, bool seconds=true)
|
void drawGPSCoord(BitmapBuffer * dc, coord_t x, coord_t y, int32_t value, const char * direction, LcdFlags flags, bool seconds=true)
|
||||||
{
|
{
|
||||||
char s[32];
|
char s[32];
|
||||||
uint32_t absvalue = abs(value);
|
uint32_t absvalue = abs(value);
|
||||||
|
@ -445,27 +445,26 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
|
||||||
}
|
}
|
||||||
*tmp++ = direction[value>=0 ? 0 : 1];
|
*tmp++ = direction[value>=0 ? 0 : 1];
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
lcdDrawText(x, y, s, flags);
|
dc->drawText(x, y, s, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawGPSPosition(coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags)
|
void drawGPSPosition(BitmapBuffer * dc, coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags)
|
||||||
{
|
{
|
||||||
if (flags & EXPANDED) {
|
if (flags & EXPANDED) {
|
||||||
drawGPSCoord(x, y, latitude, "NS", flags, true);
|
drawGPSCoord(dc, x, y, latitude, "NS", flags, true);
|
||||||
drawGPSCoord(x, y + FH, longitude, "EW", flags, true);
|
drawGPSCoord(dc, x, y + FH, longitude, "EW", flags, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
drawGPSCoord(x, y, latitude, "NS", flags, false);
|
drawGPSCoord(dc, x, y, latitude, "NS", flags, false);
|
||||||
drawGPSCoord(lcdNextPos+5, y, longitude, "EW", flags, false);
|
drawGPSCoord(dc, lcdNextPos+5, y, longitude, "EW", flags, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags flags)
|
void drawGPSSensorValue(BitmapBuffer * dc, coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags flags)
|
||||||
{
|
{
|
||||||
drawGPSPosition(x, y, telemetryItem.gps.longitude, telemetryItem.gps.latitude, flags);
|
drawGPSPosition(dc, x, y, telemetryItem.gps.longitude, telemetryItem.gps.latitude, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void drawSensorCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t sensor, int32_t value, LcdFlags flags)
|
void drawSensorCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t sensor, int32_t value, LcdFlags flags)
|
||||||
{
|
{
|
||||||
if (sensor >= MAX_TELEMETRY_SENSORS) {
|
if (sensor >= MAX_TELEMETRY_SENSORS) {
|
||||||
|
@ -480,14 +479,14 @@ void drawSensorCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t sens
|
||||||
drawDate(dc, x, y, telemetryItem, flags);
|
drawDate(dc, x, y, telemetryItem, flags);
|
||||||
}
|
}
|
||||||
else if (telemetrySensor.unit == UNIT_GPS) {
|
else if (telemetrySensor.unit == UNIT_GPS) {
|
||||||
drawGPSSensorValue(x, y, telemetryItem, flags);
|
drawGPSSensorValue(dc, x, y, telemetryItem, flags);
|
||||||
}
|
}
|
||||||
else if (telemetrySensor.unit == UNIT_BITFIELD) {
|
else if (telemetrySensor.unit == UNIT_BITFIELD) {
|
||||||
if (IS_FRSKY_SPORT_PROTOCOL()) {
|
if (IS_FRSKY_SPORT_PROTOCOL()) {
|
||||||
if (telemetrySensor.id >= RBOX_STATE_FIRST_ID && telemetrySensor.id <= RBOX_STATE_LAST_ID) {
|
if (telemetrySensor.id >= RBOX_STATE_FIRST_ID && telemetrySensor.id <= RBOX_STATE_LAST_ID) {
|
||||||
if (telemetrySensor.subId == 0) {
|
if (telemetrySensor.subId == 0) {
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
lcdDrawText(x, y, "OK", flags);
|
dc->drawText(x, y, "OK", flags);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (uint8_t i=0; i<16; i++) {
|
for (uint8_t i=0; i<16; i++) {
|
||||||
|
@ -551,7 +550,7 @@ void drawSourceCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, source_t sou
|
||||||
// TODO drawTimer(dc, x, y, value, flags);
|
// TODO drawTimer(dc, x, y, value, flags);
|
||||||
}
|
}
|
||||||
else if (source == MIXSRC_TX_VOLTAGE) {
|
else if (source == MIXSRC_TX_VOLTAGE) {
|
||||||
lcdDrawNumber(x, y, value, flags|PREC1);
|
dc->drawNumber(x, y, value, flags|PREC1);
|
||||||
}
|
}
|
||||||
#if defined(INTERNAL_GPS)
|
#if defined(INTERNAL_GPS)
|
||||||
else if (source == MIXSRC_TX_GPS) {
|
else if (source == MIXSRC_TX_GPS) {
|
||||||
|
@ -560,7 +559,7 @@ void drawSourceCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, source_t sou
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(x, y, "sats: ", flags);
|
lcdDrawText(x, y, "sats: ", flags);
|
||||||
lcdDrawNumber(lcdNextPos, y, gpsData.numSat, flags);
|
dc->drawNumber(lcdNextPos, y, gpsData.numSat, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -570,26 +569,26 @@ void drawSourceCustomValue(BitmapBuffer * dc, coord_t x, coord_t y, source_t sou
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (source < MIXSRC_FIRST_CH) {
|
else if (source < MIXSRC_FIRST_CH) {
|
||||||
lcdDrawNumber(x, y, calcRESXto100(value), flags);
|
dc->drawNumber(x, y, calcRESXto100(value), flags);
|
||||||
}
|
}
|
||||||
else if (source <= MIXSRC_LAST_CH) {
|
else if (source <= MIXSRC_LAST_CH) {
|
||||||
#if defined(PPM_UNIT_PERCENT_PREC1)
|
#if defined(PPM_UNIT_PERCENT_PREC1)
|
||||||
lcdDrawNumber(x, y, calcRESXto1000(value), flags|PREC1);
|
dc->drawNumber(x, y, calcRESXto1000(value), flags|PREC1);
|
||||||
#else
|
#else
|
||||||
lcdDrawNumber(x, y, calcRESXto100(value), flags);
|
dc->drawNumber(x, y, calcRESXto100(value), flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawNumber(x, y, value, flags);
|
dc->drawNumber(x, y, value, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawValueWithUnit(BitmapBuffer * dc, coord_t x, coord_t y, int val, uint8_t unit, LcdFlags flags)
|
void drawValueWithUnit(BitmapBuffer * dc, coord_t x, coord_t y, int val, uint8_t unit, LcdFlags flags)
|
||||||
{
|
{
|
||||||
// convertUnit(val, unit);
|
// convertUnit(val, unit);
|
||||||
drawNumber(dc, x, y, val, flags & (~NO_UNIT));
|
dc->drawNumber(x, y, val, flags & (~NO_UNIT));
|
||||||
if (!(flags & NO_UNIT) && unit != UNIT_RAW) {
|
if (!(flags & NO_UNIT) && unit != UNIT_RAW) {
|
||||||
drawTextAtIndex(dc, lcdNextPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
dc->drawTextAtIndex(lcdNextPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
#ifndef _DRAW_FUNCTIONS_H_
|
#ifndef _DRAW_FUNCTIONS_H_
|
||||||
#define _DRAW_FUNCTIONS_H_
|
#define _DRAW_FUNCTIONS_H_
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "dataconstants.h"
|
||||||
|
#include "telemetry/telemetry_sensors.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define OPTION_MENU_NO_FOOTER 0x01
|
#define OPTION_MENU_NO_FOOTER 0x01
|
||||||
|
@ -39,16 +40,33 @@
|
||||||
#define OPTION_SLIDER_NUMBER_BUTTON 0x100
|
#define OPTION_SLIDER_NUMBER_BUTTON 0x100
|
||||||
#define OPTION_SLIDER_SQUARE_BUTTON 0x200
|
#define OPTION_SLIDER_SQUARE_BUTTON 0x200
|
||||||
|
|
||||||
void drawStatusText(const char * text);
|
void drawStringWithIndex(coord_t x, coord_t y, const char * str, int idx, LcdFlags flags, const char * prefix, const char * suffix);
|
||||||
void drawColumnHeader(const char * const * headers, const char * const * descriptions, uint8_t index);
|
void drawValueWithUnit(coord_t x, coord_t y, int val, uint8_t unit, LcdFlags att);
|
||||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
//int editChoice(coord_t x, coord_t y, const char * values, int value, int min, int max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable=nullptr);
|
||||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
//uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, LcdFlags attr, event_t event);
|
||||||
void drawProgressScreen(const char * title, const char * message, int num, int den);
|
//swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event);
|
||||||
void drawTrimSquare(coord_t x, coord_t y);
|
void drawFatalErrorScreen(const char * message);
|
||||||
void drawHorizontalTrimPosition(coord_t x, coord_t y, int16_t dir);
|
void runFatalErrorScreen(const char * message);
|
||||||
void drawVerticalTrimPosition(coord_t x, coord_t y, int16_t dir);
|
void drawPower(coord_t x, coord_t y, int8_t dBm, LcdFlags att);
|
||||||
void drawVerticalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
//void lcdDrawMMM(coord_t x, coord_t y, LcdFlags flags);
|
||||||
void drawHorizontalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
void drawSource(BitmapBuffer * dc, coord_t x, coord_t y, mixsrc_t idx, LcdFlags flags=0);
|
||||||
|
void drawSwitch(BitmapBuffer * dc, coord_t x, coord_t y, int32_t idx, LcdFlags flags=0);
|
||||||
|
void drawTrimMode(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags flags = 0);
|
||||||
|
|
||||||
|
#if defined(FLIGHT_MODES)
|
||||||
|
void drawFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void drawStatusText(BitmapBuffer * dc, const char * text);
|
||||||
|
void drawColumnHeader(BitmapBuffer * dc, const char * const * headers, const char * const * descriptions, uint8_t index);
|
||||||
|
void drawCheckBox(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||||
|
void drawVerticalScrollbar(BitmapBuffer * dc, coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||||
|
void drawProgressScreen(BitmapBuffer * dc, const char * title, const char * message, int num, int den);
|
||||||
|
void drawTrimSquare(BitmapBuffer * dc, coord_t x, coord_t y);
|
||||||
|
void drawHorizontalTrimPosition(BitmapBuffer * dc, coord_t x, coord_t y, int16_t dir);
|
||||||
|
void drawVerticalTrimPosition(BitmapBuffer * dc, coord_t x, coord_t y, int16_t dir);
|
||||||
|
void drawVerticalSlider(BitmapBuffer * dc, coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
||||||
|
void drawHorizontalSlider(BitmapBuffer * dc, coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
||||||
void drawSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
void drawSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options);
|
||||||
void drawValueOrGVar(BitmapBuffer * dc, coord_t x, coord_t y, gvar_t gvar, LcdFlags flags = 0);
|
void drawValueOrGVar(BitmapBuffer * dc, coord_t x, coord_t y, gvar_t gvar, LcdFlags flags = 0);
|
||||||
void drawGVarValue(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags = 0);
|
void drawGVarValue(BitmapBuffer * dc, coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags = 0);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
#include "rle.h"
|
|
||||||
|
|
||||||
const uint16_t font_tinsize_specs[] = {
|
const uint16_t font_tinsize_specs[] = {
|
||||||
#include "font_9.specs"
|
#include "font_9.specs"
|
||||||
|
@ -30,6 +29,14 @@ const unsigned char font_tinsize[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HARDWARE_TOUCH)
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
const uint16_t font_stdsize_en_specs[] = {
|
||||||
|
#include "font_17en.specs"
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsigned char font_stdsize_en[] = {
|
||||||
|
#include "font_17en.lbm"
|
||||||
|
};
|
||||||
|
|
||||||
const uint16_t font_smlsize_specs[] = {
|
const uint16_t font_smlsize_specs[] = {
|
||||||
#include "font_15.specs"
|
#include "font_15.specs"
|
||||||
};
|
};
|
||||||
|
@ -54,6 +61,14 @@ const unsigned char font_stdsizebold[] = {
|
||||||
#include "font_bold17.lbm"
|
#include "font_bold17.lbm"
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
const uint16_t font_stdsize_en_specs[] = {
|
||||||
|
#include "font_16en.specs"
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsigned char font_stdsize_en[] = {
|
||||||
|
#include "font_16en.lbm"
|
||||||
|
};
|
||||||
|
|
||||||
const uint16_t font_smlsize_specs[] = {
|
const uint16_t font_smlsize_specs[] = {
|
||||||
#include "font_13.specs"
|
#include "font_13.specs"
|
||||||
};
|
};
|
||||||
|
@ -103,7 +118,10 @@ const unsigned char font_xxlsize[] = {
|
||||||
#include "font_64.lbm"
|
#include "font_64.lbm"
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if defined(BOOT)
|
||||||
|
const uint16_t * const fontspecsTable[1] = { font_stdsize_en_specs };
|
||||||
|
const uint8_t * fontsTable[1] = { font_stdsize_en };
|
||||||
|
#else
|
||||||
const uint16_t * const fontspecsTable[16] = {
|
const uint16_t * const fontspecsTable[16] = {
|
||||||
font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs,
|
font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs,
|
||||||
font_stdsizebold_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs
|
font_stdsizebold_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsize_specs, font_stdsize_specs
|
||||||
|
@ -113,9 +131,6 @@ const uint8_t * fontsTable[16] = {
|
||||||
font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize,
|
font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize,
|
||||||
font_stdsizebold, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize
|
font_stdsizebold, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsize, font_stdsize
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
const uint16_t * const fontspecsTable[1] = { font_stdsize_specs };
|
|
||||||
const uint8_t * fontsTable[1] = { font_stdsize };
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t * decompressFont(const uint8_t * font)
|
uint8_t * decompressFont(const uint8_t * font)
|
||||||
|
@ -127,9 +142,9 @@ uint8_t * decompressFont(const uint8_t * font)
|
||||||
uint8_t* dec_buf = (uint8_t*)malloc(font_size + 4);
|
uint8_t* dec_buf = (uint8_t*)malloc(font_size + 4);
|
||||||
|
|
||||||
// copy width / height
|
// copy width / height
|
||||||
memcpy(dec_buf,font,4);
|
memcpy(dec_buf, font,4);
|
||||||
|
|
||||||
rle_decode_8bit(dec_buf+4, font_size, font+4);
|
RLEBitmap::decode(dec_buf+4, font_size, font+4);
|
||||||
return dec_buf;
|
return dec_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,12 +154,14 @@ void loadFonts()
|
||||||
if (fonts_loaded) return;
|
if (fonts_loaded) return;
|
||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
int i=0;
|
int i = 0;
|
||||||
for (; i<9; i++)
|
for (; i < 9; i++) {
|
||||||
fontsTable[i] = decompressFont(fontsTable[i]);
|
fontsTable[i] = decompressFont(fontsTable[i]);
|
||||||
|
}
|
||||||
for (; i<16; i++)
|
for (; i < 16; i++) {
|
||||||
fontsTable[i] = fontsTable[i-9];
|
// the next fonts don't exist in BOLD today
|
||||||
|
fontsTable[i] = fontsTable[i - 9];
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
fontsTable[0] = decompressFont(fontsTable[0]);
|
fontsTable[0] = decompressFont(fontsTable[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
156
radio/src/gui/colorlcd/fullscreen_dialog.cpp
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) OpenTX
|
||||||
|
*
|
||||||
|
* Based on code named
|
||||||
|
* th9x - http://code.google.com/p/th9x
|
||||||
|
* er9x - http://code.google.com/p/er9x
|
||||||
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
|
*
|
||||||
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "fullscreen_dialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "opentx.h"
|
||||||
|
|
||||||
|
FullScreenDialog::FullScreenDialog(uint8_t type, std::string title, std::string message, std::string action, std::function<void(void)> confirmHandler):
|
||||||
|
Dialog(title, {0, 0, LCD_W, LCD_H}),
|
||||||
|
type(type),
|
||||||
|
message(std::move(message)),
|
||||||
|
action(std::move(action)),
|
||||||
|
confirmHandler(confirmHandler)
|
||||||
|
{
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
new FabIconButton(this, LCD_W - 50, ALERT_BUTTON_TOP, ICON_NEXT,
|
||||||
|
[=]() -> uint8_t {
|
||||||
|
if (confirmHandler)
|
||||||
|
confirmHandler();
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
FullScreenDialog::~FullScreenDialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void FullScreenDialog::paint(BitmapBuffer * dc)
|
||||||
|
{
|
||||||
|
static_cast<ThemeBase *>(theme)->drawBackground(dc);
|
||||||
|
|
||||||
|
dc->drawFilledRect(0, ALERT_FRAME_TOP, LCD_W, ALERT_FRAME_HEIGHT, SOLID, TEXT_INVERTED_COLOR | OPACITY(8));
|
||||||
|
|
||||||
|
if (type == WARNING_TYPE_ALERT || type == WARNING_TYPE_ASTERISK)
|
||||||
|
dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, static_cast<ThemeBase *>(theme)->asterisk);
|
||||||
|
else if (type == WARNING_TYPE_INFO)
|
||||||
|
dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, static_cast<ThemeBase *>(theme)->busy);
|
||||||
|
else // confirmation
|
||||||
|
dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, static_cast<ThemeBase *>(theme)->question);
|
||||||
|
|
||||||
|
if (type == WARNING_TYPE_ALERT) {
|
||||||
|
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
||||||
|
dc->drawText(ALERT_TITLE_LEFT, ALERT_TITLE_TOP, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||||
|
dc->drawText(ALERT_TITLE_LEFT, ALERT_TITLE_TOP + ALERT_TITLE_LINE_HEIGHT, title, ALARM_COLOR|DBLSIZE);
|
||||||
|
#else
|
||||||
|
dc->drawText(ALERT_TITLE_LEFT, ALERT_TITLE_TOP, title.c_str(), ALARM_COLOR|DBLSIZE);
|
||||||
|
dc->drawText(ALERT_TITLE_LEFT, ALERT_TITLE_TOP + ALERT_TITLE_LINE_HEIGHT, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (!title.empty()) {
|
||||||
|
dc->drawText(ALERT_TITLE_LEFT, ALERT_TITLE_TOP, title.c_str(), ALARM_COLOR|DBLSIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!message.empty()) {
|
||||||
|
dc->drawText(ALERT_MESSAGE_LEFT, ALERT_MESSAGE_TOP, message.c_str(), BOLD);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!action.empty()) {
|
||||||
|
dc->drawText(LCD_W / 2, ALERT_ACTION_TOP, action.c_str(), CENTERED | BOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(HARDWARE_KEYS)
|
||||||
|
void FullScreenDialog::onKeyEvent(event_t event)
|
||||||
|
{
|
||||||
|
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
|
||||||
|
|
||||||
|
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||||
|
deleteLater();
|
||||||
|
if (confirmHandler)
|
||||||
|
confirmHandler();
|
||||||
|
}
|
||||||
|
else if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
bool FullScreenDialog::onTouchEnd(coord_t x, coord_t y)
|
||||||
|
{
|
||||||
|
Window::onTouchEnd(x, y);
|
||||||
|
deleteLater();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void FullScreenDialog::checkEvents()
|
||||||
|
{
|
||||||
|
Window::checkEvents();
|
||||||
|
if (closeCondition && closeCondition()) {
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FullScreenDialog::deleteLater()
|
||||||
|
{
|
||||||
|
if (previousFocus) {
|
||||||
|
previousFocus->setFocus();
|
||||||
|
}
|
||||||
|
if (running) {
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Window::deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FullScreenDialog::runForever()
|
||||||
|
{
|
||||||
|
running = true;
|
||||||
|
|
||||||
|
while (running) {
|
||||||
|
auto check = pwrCheck();
|
||||||
|
if (check == e_power_off) {
|
||||||
|
boardOff();
|
||||||
|
}
|
||||||
|
else if (check == e_power_press) {
|
||||||
|
RTOS_WAIT_MS(20);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkBacklight();
|
||||||
|
wdt_reset();
|
||||||
|
|
||||||
|
RTOS_WAIT_MS(20);
|
||||||
|
mainWindow.run(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Window::deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void raiseAlert(const char * title, const char * msg, const char * action, uint8_t sound)
|
||||||
|
{
|
||||||
|
AUDIO_ERROR_MESSAGE(sound);
|
||||||
|
auto dialog = new FullScreenDialog(WARNING_TYPE_ALERT, title ? title : "", msg ? msg : "", action ? action : "");
|
||||||
|
dialog->runForever();
|
||||||
|
}
|
|
@ -18,10 +18,10 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DIALOG_H_
|
#ifndef _FULLSCREEN_DIALOG_H_
|
||||||
#define _DIALOG_H_
|
#define _FULLSCREEN_DIALOG_H_
|
||||||
|
|
||||||
#include "button.h"
|
#include "dialog.h"
|
||||||
|
|
||||||
enum DialogType {
|
enum DialogType {
|
||||||
WARNING_TYPE_ALERT,
|
WARNING_TYPE_ALERT,
|
||||||
|
@ -31,43 +31,9 @@ enum DialogType {
|
||||||
WARNING_TYPE_INFO
|
WARNING_TYPE_INFO
|
||||||
};
|
};
|
||||||
|
|
||||||
class Dialog: public Window {
|
|
||||||
public:
|
|
||||||
Dialog(std::string title, const rect_t rect);
|
|
||||||
|
|
||||||
void paint(BitmapBuffer * dc) override;
|
|
||||||
|
|
||||||
void deleteLater();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string title;
|
|
||||||
Window * previousFocus;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MessageDialog: public Dialog {
|
|
||||||
public:
|
|
||||||
MessageDialog(const char * title, const char * message);
|
|
||||||
|
|
||||||
#if defined(HARDWARE_KEYS)
|
|
||||||
void onKeyEvent(event_t event) override;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
class ConfirmDialog: public Dialog {
|
|
||||||
public:
|
|
||||||
ConfirmDialog(const char * title, const char * message, std::function<void(void)> confirmHandler);
|
|
||||||
|
|
||||||
#if defined(HARDWARE_KEYS)
|
|
||||||
void onKeyEvent(event_t event) override;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::function<void(void)> confirmHandler;
|
|
||||||
};
|
|
||||||
|
|
||||||
class FullScreenDialog : public Dialog {
|
class FullScreenDialog : public Dialog {
|
||||||
public:
|
public:
|
||||||
FullScreenDialog(uint8_t type, std::string title, std::string message="", std::function<void(void)> confirmHandler=nullptr);
|
FullScreenDialog(uint8_t type, std::string title, std::string message = "", std::string action = "", std::function<void(void)> confirmHandler = nullptr);
|
||||||
|
|
||||||
~FullScreenDialog() override;
|
~FullScreenDialog() override;
|
||||||
|
|
||||||
|
@ -108,14 +74,10 @@ class FullScreenDialog : public Dialog {
|
||||||
protected:
|
protected:
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
std::string message;
|
std::string message;
|
||||||
|
std::string action;
|
||||||
bool running = false;
|
bool running = false;
|
||||||
std::function<bool(void)> closeCondition;
|
std::function<bool(void)> closeCondition;
|
||||||
std::function<void(void)> confirmHandler;
|
std::function<void(void)> confirmHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void POPUP_INFORMATION(const char * str)
|
#endif // _FULLSCREEN_DIALOG_H_
|
||||||
{
|
|
||||||
new MessageDialog("Message", str);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // _CONFIRMATION_H_
|
|
|
@ -28,7 +28,7 @@ std::list<const LayoutFactory *> & getRegisteredLayouts()
|
||||||
|
|
||||||
void registerLayout(const LayoutFactory * factory)
|
void registerLayout(const LayoutFactory * factory)
|
||||||
{
|
{
|
||||||
TRACE("register layout %s", factory->getName());
|
TRACE("register layout %s", factory->getId());
|
||||||
getRegisteredLayouts().push_back(factory);
|
getRegisteredLayouts().push_back(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ const LayoutFactory * getLayoutFactory(const char * name)
|
||||||
{
|
{
|
||||||
std::list<const LayoutFactory *>::const_iterator it = getRegisteredLayouts().cbegin();
|
std::list<const LayoutFactory *>::const_iterator it = getRegisteredLayouts().cbegin();
|
||||||
for (; it != getRegisteredLayouts().cend(); ++it) {
|
for (; it != getRegisteredLayouts().cend(); ++it) {
|
||||||
if (!strcmp(name, (*it)->getName())) {
|
if (!strcmp(name, (*it)->getId())) {
|
||||||
return (*it);
|
return (*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ Layout * loadLayout(const char * name, Layout::PersistentData * persistentData)
|
||||||
|
|
||||||
void loadCustomScreens()
|
void loadCustomScreens()
|
||||||
{
|
{
|
||||||
for (unsigned int i=0; i<MAX_CUSTOM_SCREENS; i++) {
|
for (unsigned int i = 0; i < MAX_CUSTOM_SCREENS; i++) {
|
||||||
delete customScreens[i];
|
delete customScreens[i];
|
||||||
char name[LAYOUT_NAME_LEN + 1];
|
char name[LAYOUT_NAME_LEN + 1];
|
||||||
memset(name, 0, sizeof(name));
|
memset(name, 0, sizeof(name));
|
||||||
|
@ -66,7 +66,7 @@ void loadCustomScreens()
|
||||||
customScreens[0] = getRegisteredLayouts().front()->create(&g_model.screenData[0].layoutData);
|
customScreens[0] = getRegisteredLayouts().front()->create(&g_model.screenData[0].layoutData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topbar) {
|
// if (topbar) {
|
||||||
topbar->load();
|
// topbar->load();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,18 +59,21 @@ void registerLayout(const LayoutFactory * factory);
|
||||||
class LayoutFactory
|
class LayoutFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LayoutFactory(const char * name):
|
LayoutFactory(const char * id, const char * name):
|
||||||
|
id(id),
|
||||||
name(name)
|
name(name)
|
||||||
{
|
{
|
||||||
registerLayout(this);
|
registerLayout(this);
|
||||||
}
|
}
|
||||||
|
const char * getId() const { return id; }
|
||||||
const char * getName() const { return name; }
|
const char * getName() const { return name; }
|
||||||
virtual void drawThumb(uint16_t x, uint16_t y, uint32_t flags) const = 0;
|
virtual void drawThumb(BitmapBuffer * dc, uint16_t x, uint16_t y, LcdFlags flags) const = 0;
|
||||||
virtual const ZoneOption * getOptions() const = 0;
|
virtual const ZoneOption * getOptions() const = 0;
|
||||||
virtual Layout * create(Layout::PersistentData * persistentData) const = 0;
|
virtual Layout * create(Layout::PersistentData * persistentData) const = 0;
|
||||||
virtual Layout * load(Layout::PersistentData * persistentData) const = 0;
|
virtual Layout * load(Layout::PersistentData * persistentData) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
const char * id;
|
||||||
const char * name;
|
const char * name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -78,24 +81,24 @@ template<class T>
|
||||||
class BaseLayoutFactory: public LayoutFactory
|
class BaseLayoutFactory: public LayoutFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseLayoutFactory(const char * name, const uint8_t * bitmap, const ZoneOption * options):
|
BaseLayoutFactory(const char * id, const char * name, const uint8_t * bitmap, const ZoneOption * options):
|
||||||
LayoutFactory(name),
|
LayoutFactory(id, name),
|
||||||
bitmap(bitmap),
|
bitmap(bitmap),
|
||||||
options(options)
|
options(options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void drawThumb(uint16_t x, uint16_t y, uint32_t flags) const
|
void drawThumb(BitmapBuffer * dc, uint16_t x, uint16_t y, uint32_t flags) const override
|
||||||
{
|
{
|
||||||
lcdDrawBitmapPattern(x, y, bitmap, flags);
|
dc->drawBitmapPattern(x, y, bitmap, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const ZoneOption * getOptions() const
|
const ZoneOption * getOptions() const override
|
||||||
{
|
{
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Layout * create(Layout::PersistentData * persistentData) const
|
Layout * create(Layout::PersistentData * persistentData) const override
|
||||||
{
|
{
|
||||||
Layout * layout = new T(this, persistentData);
|
Layout * layout = new T(this, persistentData);
|
||||||
if (layout) {
|
if (layout) {
|
||||||
|
@ -104,7 +107,7 @@ class BaseLayoutFactory: public LayoutFactory
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Layout * load(Layout::PersistentData * persistentData) const
|
Layout * load(Layout::PersistentData * persistentData) const override
|
||||||
{
|
{
|
||||||
Layout * layout = new T(this, persistentData);
|
Layout * layout = new T(this, persistentData);
|
||||||
if (layout) {
|
if (layout) {
|
||||||
|
|
|
@ -38,19 +38,19 @@ class Layout1x1: public Layout
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void create()
|
void create() override
|
||||||
{
|
{
|
||||||
Layout::create();
|
Layout::create();
|
||||||
persistentData->options[0].boolValue = true;
|
persistentData->options[0].boolValue = true;
|
||||||
persistentData->options[1].boolValue = true;
|
persistentData->options[1].boolValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned int getZonesCount() const
|
unsigned int getZonesCount() const override
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Zone getZone(unsigned int index) const
|
Zone getZone(unsigned int index) const override
|
||||||
{
|
{
|
||||||
Zone zone = { 10, 10, LCD_W - 2*10, LCD_H - 2*10 };
|
Zone zone = { 10, 10, LCD_W - 2*10, LCD_H - 2*10 };
|
||||||
if (persistentData->options[0].boolValue) {
|
if (persistentData->options[0].boolValue) {
|
||||||
|
@ -65,28 +65,28 @@ class Layout1x1: public Layout
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void refresh();
|
// virtual void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
void Layout1x1::refresh()
|
//void Layout1x1::refresh()
|
||||||
{
|
//{
|
||||||
theme->drawBackground();
|
// theme->drawBackground();
|
||||||
|
//
|
||||||
|
// if (persistentData->options[0].boolValue) {
|
||||||
|
// drawTopBar();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[1].boolValue) {
|
||||||
|
// // Sliders + Trims + Flight mode
|
||||||
|
// lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name, sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE) / 2,
|
||||||
|
// 232,
|
||||||
|
// g_model.flightModeData[mixerCurrentFlightMode].name,
|
||||||
|
// sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
||||||
|
// drawMainPots();
|
||||||
|
// drawTrims(mixerCurrentFlightMode);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Layout::refresh();
|
||||||
|
//}
|
||||||
|
|
||||||
if (persistentData->options[0].boolValue) {
|
BaseLayoutFactory<Layout1x1> layout1x1("Layout1x1", "Fullscreen", LBM_LAYOUT_1x1, OPTIONS_LAYOUT_1x1);
|
||||||
drawTopBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[1].boolValue) {
|
|
||||||
// Sliders + Trims + Flight mode
|
|
||||||
lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name, sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE) / 2,
|
|
||||||
232,
|
|
||||||
g_model.flightModeData[mixerCurrentFlightMode].name,
|
|
||||||
sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
|
||||||
drawMainPots();
|
|
||||||
drawTrims(mixerCurrentFlightMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseLayoutFactory<Layout1x1> layout1x1("Layout1x1", LBM_LAYOUT_1x1, OPTIONS_LAYOUT_1x1);
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ const ZoneOption OPTIONS_LAYOUT_2P1[] = {
|
||||||
{ "Flight mode", ZoneOption::Bool },
|
{ "Flight mode", ZoneOption::Bool },
|
||||||
{ "Sliders", ZoneOption::Bool },
|
{ "Sliders", ZoneOption::Bool },
|
||||||
{ "Trims", ZoneOption::Bool },
|
{ "Trims", ZoneOption::Bool },
|
||||||
{ NULL, ZoneOption::Bool }
|
{ nullptr, ZoneOption::Bool }
|
||||||
};
|
};
|
||||||
|
|
||||||
const Zone ZONES_LAYOUT_2P1[3] = {
|
const Zone ZONES_LAYOUT_2P1[3] = {
|
||||||
|
@ -46,7 +46,7 @@ class Layout2P1: public Layout
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void create()
|
void create() override
|
||||||
{
|
{
|
||||||
Layout::create();
|
Layout::create();
|
||||||
persistentData->options[0].boolValue = true;
|
persistentData->options[0].boolValue = true;
|
||||||
|
@ -55,49 +55,49 @@ class Layout2P1: public Layout
|
||||||
persistentData->options[3].boolValue = true;
|
persistentData->options[3].boolValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned int getZonesCount() const
|
unsigned int getZonesCount() const override
|
||||||
{
|
{
|
||||||
return DIM(ZONES_LAYOUT_2P1);
|
return DIM(ZONES_LAYOUT_2P1);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Zone getZone(unsigned int index) const
|
Zone getZone(unsigned int index) const override
|
||||||
{
|
{
|
||||||
return ZONES_LAYOUT_2P1[index];
|
return ZONES_LAYOUT_2P1[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void refresh();
|
// virtual void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
void Layout2P1::refresh()
|
//void Layout2P1::refresh()
|
||||||
{
|
//{
|
||||||
theme->drawBackground();
|
// theme->drawBackground();
|
||||||
|
//
|
||||||
|
// if (persistentData->options[0].boolValue) {
|
||||||
|
// drawTopBar();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[1].boolValue) {
|
||||||
|
// // Flight mode
|
||||||
|
// lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name,
|
||||||
|
// sizeof(g_model.flightModeData[mixerCurrentFlightMode].name),
|
||||||
|
// ZCHAR | SMLSIZE) / 2,
|
||||||
|
// 232,
|
||||||
|
// g_model.flightModeData[mixerCurrentFlightMode].name,
|
||||||
|
// sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[2].boolValue) {
|
||||||
|
// // Pots and rear sliders positions
|
||||||
|
// drawMainPots();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[3].boolValue) {
|
||||||
|
// // Trims
|
||||||
|
// drawTrims(mixerCurrentFlightMode);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Layout::refresh();
|
||||||
|
//}
|
||||||
|
|
||||||
if (persistentData->options[0].boolValue) {
|
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", "2 + 1", LBM_LAYOUT_2P1, OPTIONS_LAYOUT_2P1);
|
||||||
drawTopBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[1].boolValue) {
|
|
||||||
// Flight mode
|
|
||||||
lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name,
|
|
||||||
sizeof(g_model.flightModeData[mixerCurrentFlightMode].name),
|
|
||||||
ZCHAR | SMLSIZE) / 2,
|
|
||||||
232,
|
|
||||||
g_model.flightModeData[mixerCurrentFlightMode].name,
|
|
||||||
sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[2].boolValue) {
|
|
||||||
// Pots and rear sliders positions
|
|
||||||
drawMainPots();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[3].boolValue) {
|
|
||||||
// Trims
|
|
||||||
drawTrims(mixerCurrentFlightMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", LBM_LAYOUT_2P1, OPTIONS_LAYOUT_2P1);
|
|
||||||
const LayoutFactory * defaultLayout = &layout2P1;
|
const LayoutFactory * defaultLayout = &layout2P1;
|
||||||
|
|
|
@ -37,18 +37,18 @@ class Layout2x1: public Layout
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void create()
|
void create() override
|
||||||
{
|
{
|
||||||
Layout::create();
|
Layout::create();
|
||||||
persistentData->options[0].boolValue = true;
|
persistentData->options[0].boolValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned int getZonesCount() const
|
unsigned int getZonesCount() const override
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Zone getZone(unsigned int index) const
|
Zone getZone(unsigned int index) const override
|
||||||
{
|
{
|
||||||
Zone zone;
|
Zone zone;
|
||||||
zone.w = (LCD_W-3*10) / 2;
|
zone.w = (LCD_W-3*10) / 2;
|
||||||
|
@ -64,18 +64,18 @@ class Layout2x1: public Layout
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void refresh();
|
// virtual void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
void Layout2x1::refresh()
|
//void Layout2x1::refresh()
|
||||||
{
|
//{
|
||||||
theme->drawBackground();
|
// theme->drawBackground();
|
||||||
|
//
|
||||||
|
// if (persistentData->options[0].boolValue) {
|
||||||
|
// drawTopBar();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Layout::refresh();
|
||||||
|
//}
|
||||||
|
|
||||||
if (persistentData->options[0].boolValue) {
|
BaseLayoutFactory<Layout2x1> Layout2x1("Layout2x1", "2 x 1", LBM_LAYOUT_2x1, OPTIONS_LAYOUT_2x1);
|
||||||
drawTopBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x1> Layout2x1("Layout2x1", LBM_LAYOUT_2x1, OPTIONS_LAYOUT_2x1);
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ const uint8_t LBM_LAYOUT_2x2[] = {
|
||||||
|
|
||||||
const ZoneOption OPTIONS_LAYOUT_2x2[] = {
|
const ZoneOption OPTIONS_LAYOUT_2x2[] = {
|
||||||
{ "Top bar", ZoneOption::Bool },
|
{ "Top bar", ZoneOption::Bool },
|
||||||
{ NULL, ZoneOption::Bool }
|
{ nullptr, ZoneOption::Bool }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Layout2x2: public Layout
|
class Layout2x2: public Layout
|
||||||
|
@ -37,18 +37,18 @@ class Layout2x2: public Layout
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void create()
|
void create() override
|
||||||
{
|
{
|
||||||
Layout::create();
|
Layout::create();
|
||||||
persistentData->options[0].boolValue = true;
|
persistentData->options[0].boolValue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned int getZonesCount() const
|
unsigned int getZonesCount() const override
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Zone getZone(unsigned int index) const
|
Zone getZone(unsigned int index) const override
|
||||||
{
|
{
|
||||||
Zone zone;
|
Zone zone;
|
||||||
zone.w = (LCD_W-3*10) / 2;
|
zone.w = (LCD_W-3*10) / 2;
|
||||||
|
@ -67,18 +67,18 @@ class Layout2x2: public Layout
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void refresh();
|
// virtual void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
void Layout2x2::refresh()
|
//void Layout2x2::refresh()
|
||||||
{
|
//{
|
||||||
theme->drawBackground();
|
// theme->drawBackground();
|
||||||
|
//
|
||||||
|
// if (persistentData->options[0].boolValue) {
|
||||||
|
// drawTopBar();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Layout::refresh();
|
||||||
|
//}
|
||||||
|
|
||||||
if (persistentData->options[0].boolValue) {
|
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", "2 x 2", LBM_LAYOUT_2x2, OPTIONS_LAYOUT_2x2);
|
||||||
drawTopBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", LBM_LAYOUT_2x2, OPTIONS_LAYOUT_2x2);
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Layout2x4: public Layout
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void create()
|
void create() override
|
||||||
{
|
{
|
||||||
Layout::create();
|
Layout::create();
|
||||||
persistentData->options[0].boolValue = true;
|
persistentData->options[0].boolValue = true;
|
||||||
|
@ -57,12 +57,12 @@ class Layout2x4: public Layout
|
||||||
persistentData->options[7].unsignedValue = RGB(77, 112, 203);
|
persistentData->options[7].unsignedValue = RGB(77, 112, 203);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned int getZonesCount() const
|
unsigned int getZonesCount() const override
|
||||||
{
|
{
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Zone getZone(unsigned int index) const
|
Zone getZone(unsigned int index) const override
|
||||||
{
|
{
|
||||||
Zone zone;
|
Zone zone;
|
||||||
zone.x = (index >= 4) ? 260 : 60;
|
zone.x = (index >= 4) ? 260 : 60;
|
||||||
|
@ -72,48 +72,48 @@ class Layout2x4: public Layout
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void refresh();
|
// virtual void refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
void Layout2x4::refresh()
|
//void Layout2x4::refresh()
|
||||||
{
|
//{
|
||||||
theme->drawBackground();
|
// theme->drawBackground();
|
||||||
|
//
|
||||||
|
// if (persistentData->options[0].boolValue) {
|
||||||
|
// drawTopBar();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[1].boolValue) {
|
||||||
|
// // Flight mode
|
||||||
|
// lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name,
|
||||||
|
// sizeof(g_model.flightModeData[mixerCurrentFlightMode].name),
|
||||||
|
// ZCHAR | SMLSIZE) / 2,
|
||||||
|
// 232,
|
||||||
|
// g_model.flightModeData[mixerCurrentFlightMode].name,
|
||||||
|
// sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[2].boolValue) {
|
||||||
|
// // Pots and rear sliders positions
|
||||||
|
// drawMainPots();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[3].boolValue) {
|
||||||
|
// // Trims
|
||||||
|
// drawTrims(mixerCurrentFlightMode);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[4].boolValue) {
|
||||||
|
// lcdSetColor(persistentData->options[5].unsignedValue);
|
||||||
|
// lcdDrawSolidFilledRect(50, 50, 180, 170, CUSTOM_COLOR);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (persistentData->options[6].boolValue) {
|
||||||
|
// lcdSetColor(persistentData->options[7].unsignedValue);
|
||||||
|
// lcdDrawSolidFilledRect(250, 50, 180, 170, CUSTOM_COLOR);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Layout::refresh();
|
||||||
|
//}
|
||||||
|
|
||||||
if (persistentData->options[0].boolValue) {
|
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", "2 x 4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4);
|
||||||
drawTopBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[1].boolValue) {
|
|
||||||
// Flight mode
|
|
||||||
lcdDrawSizedText(LCD_W / 2 - getTextWidth(g_model.flightModeData[mixerCurrentFlightMode].name,
|
|
||||||
sizeof(g_model.flightModeData[mixerCurrentFlightMode].name),
|
|
||||||
ZCHAR | SMLSIZE) / 2,
|
|
||||||
232,
|
|
||||||
g_model.flightModeData[mixerCurrentFlightMode].name,
|
|
||||||
sizeof(g_model.flightModeData[mixerCurrentFlightMode].name), ZCHAR | SMLSIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[2].boolValue) {
|
|
||||||
// Pots and rear sliders positions
|
|
||||||
drawMainPots();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[3].boolValue) {
|
|
||||||
// Trims
|
|
||||||
drawTrims(mixerCurrentFlightMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[4].boolValue) {
|
|
||||||
lcdSetColor(persistentData->options[5].unsignedValue);
|
|
||||||
lcdDrawSolidFilledRect(50, 50, 180, 170, CUSTOM_COLOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (persistentData->options[6].boolValue) {
|
|
||||||
lcdSetColor(persistentData->options[7].unsignedValue);
|
|
||||||
lcdDrawSolidFilledRect(250, 50, 180, 170, CUSTOM_COLOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4);
|
|
||||||
|
|
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 2.9 KiB |