diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 8b46c7b0f..033e096f4 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -12,6 +12,7 @@ MESSAGE(STATUS "OpenTX Companion ${VERSION}") CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +include(Macros) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") SET(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR}) @@ -248,32 +249,6 @@ set(companion_RCS ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc ) -MACRO (TODAY RESULT) - IF (WIN32) - EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}}) - ELSEIF(UNIX) - EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}}) - ELSE (WIN32) - MESSAGE(SEND_ERROR "date not implemented") - SET(${RESULT} 00.00.0000) - ENDIF (WIN32) -ENDMACRO (TODAY) - -MACRO (NOW RESULT) - IF (WIN32) - EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}}) - ELSEIF(UNIX) - EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}}) - ELSE (WIN32) - MESSAGE(SEND_ERROR "time not implemented") - SET(${RESULT} 00:00:00) - ENDIF (WIN32) -ENDMACRO (NOW) - TODAY(DATE) NOW(TIME) diff --git a/companion/src/cmake/Macros.cmake b/companion/src/cmake/Macros.cmake new file mode 100644 index 000000000..cf055bab7 --- /dev/null +++ b/companion/src/cmake/Macros.cmake @@ -0,0 +1,26 @@ +MACRO (TODAY RESULT) + IF (WIN32) + EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}}) + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}}) + ELSE (WIN32) + MESSAGE(SEND_ERROR "date not implemented") + SET(${RESULT} 00.00.0000) + ENDIF (WIN32) +ENDMACRO (TODAY) + +MACRO (NOW RESULT) + IF (WIN32) + EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}}) + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}}) + ELSE (WIN32) + MESSAGE(SEND_ERROR "time not implemented") + SET(${RESULT} 00:00:00) + ENDIF (WIN32) +ENDMACRO (NOW) + diff --git a/companion/src/firmwares/opentx/simulator/CMakeLists.txt b/companion/src/firmwares/opentx/simulator/CMakeLists.txt index d2d2a2def..921f48333 100644 --- a/companion/src/firmwares/opentx/simulator/CMakeLists.txt +++ b/companion/src/firmwares/opentx/simulator/CMakeLists.txt @@ -3,40 +3,87 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src) -add_custom_target(about_lbm_9x - make lbm PCB=9X - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +macro(add_bitmaps_target targetname filter width format) + file(GLOB bitmaps ${filter}) + foreach(bitmap ${bitmaps}) + get_filename_component(target ${bitmap} NAME_WE) + get_filename_component(path ${bitmap} DIRECTORY) + set(target ${path}/${target}.lbm) + add_custom_command( + OUTPUT ${target} + COMMAND python ../util/img2lbm.py ${bitmap} ${target} ${width} ${format} + DEPENDS ${bitmap} + WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} + ) + list(APPEND bitmaps_files ${target}) + endforeach() + add_custom_target(${targetname} DEPENDS ${bitmaps_files}) +endmacro(add_bitmaps_target) -add_custom_target(about_lbm_taranis - make lbm PCB=TARANIS - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +add_bitmaps_target(lbm_xbm_1bit ${RADIO_SRC_DIRECTORY}/bitmaps/*.xbm 128 1bit) +add_bitmaps_target(lbm_fonts_1bit ${RADIO_SRC_DIRECTORY}/fonts/std/*.png 128 "") +add_bitmaps_target(lbm_9x_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/9X/*.png 128 1bit) +add_bitmaps_target(lbm_taranis_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/Taranis/*.png 212 4bits) -add_custom_target(about_lbm_flamenco - make lbm PCB=FLAMENCO - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +add_dependencies(lbm_9x_bitmaps lbm_fonts_1bit lbm_xbm_1bit) +add_dependencies(lbm_taranis_bitmaps lbm_fonts_1bit lbm_xbm_1bit) -add_custom_target(about_lbm_horus - make lbm PCB=HORUS - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +macro(add_truetype_font_target radio name font size) + set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name}) + add_custom_command( + OUTPUT ${target}.png + OUTPUT ${target}.specs + COMMAND ../util/font2png.py ${font} ${size} False ${target} + WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} + ) +endmacro(add_truetype_font_target) -add_custom_target(commondeps - make stamp_header tra - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +add_truetype_font_target(Horus tinsize "DejaVu Sans" 9) +add_truetype_font_target(Horus smlsize "DejaVu Sans" 13) +add_truetype_font_target(Horus stdsize "DejaVu Sans" 16) +add_truetype_font_target(Horus midsize "DejaVu Sans" 24) +add_truetype_font_target(Horus dblsize "DejaVu Sans" 32) +add_truetype_font_target(Horus xxlsize "DejaVu Sans" 48) -set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h) +add_bitmaps_target(lbm_horus_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/Horus/????[^_]*.png" 480 5/6/5/8) +add_bitmaps_target(lbm_horus_masks ${RADIO_SRC_DIRECTORY}/bitmaps/Horus/mask_*.png 480 8bits) +add_bitmaps_target(lbm_horus_fonts ${RADIO_SRC_DIRECTORY}/fonts/Horus/*.png 480 8bits) +add_dependencies(lbm_horus_bitmaps lbm_horus_masks lbm_horus_fonts) -add_custom_target(lua_exports - COMMAND make PCB=TARANIS lua/lua_exports_taranis.inc - COMMAND make PCB=FLAMENCO lua/lua_exports_flamenco.inc - COMMAND make PCB=HORUS lua/lua_exports_horus.inc - DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h - WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} -) +file(GLOB translations ${RADIO_SRC_DIRECTORY}/translations/*.h.txt) +foreach(translation ${translations}) + get_filename_component(language ${translation} NAME_WE) + get_filename_component(path ${translation} DIRECTORY) + set(target ${path}/${language}.h) + add_custom_command( + OUTPUT ${target} + COMMAND python ../util/translate.py ${translation} ${target} ${language} + DEPENDS ${translation} + WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} + ) + list(APPEND translations_files ${target}) +endforeach() + +add_custom_target(firmware_translations DEPENDS ${translations_files}) + +TODAY(DATE) +NOW(TIME) + +configure_file(${RADIO_SRC_DIRECTORY}/stamp.h.in ${RADIO_SRC_DIRECTORY}/stamp.h @ONLY) + +macro(add_lua_export_target target) + string(TOUPPER ${target} pcbdefine) + add_custom_command( + OUTPUT ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc + COMMAND ${CMAKE_C_COMPILER} -E -DPCB${pcbdefine} -DCPUARM -DCPUSTM32 -DLUA -DEXPORT myeeprom.h | grep LEXP > lua/lua_exports_${target}.txt + COMMAND python ../util/luaexport.py ${VERSION} lua/lua_exports_${target}.txt lua/lua_exports_${target}.inc lua/lua_fields_${target}.txt + WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} + ) + add_custom_target(lua_export_${target} DEPENDS ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc) +endmacro(add_lua_export_target) + +add_lua_export_target(taranis) +add_lua_export_target(horus) set(OPENTX_SRC_FILES opentxsimulator.cpp @@ -99,19 +146,22 @@ add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) add_library(opentx-horus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) -add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-ar9x${SUFFIX}-simulator about_lbm_9x commondeps) -add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports) -add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports) -add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports) -add_dependencies(opentx-horus${SUFFIX}-simulator about_lbm_horus commondeps lua_exports) +set(dependencies_9x lbm_9x_bitmaps firmware_translations) +add_dependencies(opentx-9x${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-9xr${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-9x128${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-9xr128${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-gruvin9x${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-mega2560${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-sky9x${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-9xrpro${SUFFIX}-simulator ${dependencies_9x}) +add_dependencies(opentx-ar9x${SUFFIX}-simulator ${dependencies_9x}) +set(dependencies_taranis lbm_taranis_bitmaps lua_export_taranis firmware_translations) +add_dependencies(opentx-taranis${SUFFIX}-simulator ${dependencies_taranis}) +add_dependencies(opentx-taranisplus${SUFFIX}-simulator ${dependencies_taranis}) +add_dependencies(opentx-taranisx9e${SUFFIX}-simulator ${dependencies_taranis}) + +add_dependencies(opentx-horus${SUFFIX}-simulator lbm_horus_bitmaps lbm_horus_fonts firmware_translations lua_export_horus) set(OPENTX_LIBRARIES opentx-9x${SUFFIX}-simulator diff --git a/companion/src/firmwares/opentx/simulator/opentxsimulator.cpp b/companion/src/firmwares/opentx/simulator/opentxsimulator.cpp index 706b0e39d..79243d6b4 100644 --- a/companion/src/firmwares/opentx/simulator/opentxsimulator.cpp +++ b/companion/src/firmwares/opentx/simulator/opentxsimulator.cpp @@ -135,6 +135,7 @@ namespace NAMESPACE { #if defined(PCBHORUS) #include "radio/src/bmp.cpp" #include "radio/src/gui/Horus/bitmaps.cpp" +#include "radio/src/gui/Horus/curves.cpp" #include "radio/src/gui/Horus/fonts.cpp" #include "radio/src/gui/Horus/widgets.cpp" #include "radio/src/gui/Horus/navigation.cpp" diff --git a/radio/src/.gitignore b/radio/src/.gitignore index a33e0f3ed..ca427f7bb 100644 --- a/radio/src/.gitignore +++ b/radio/src/.gitignore @@ -1,4 +1,4 @@ -/stamp-opentx.h +/stamp.h /opentx.elf /simu /opentx.map diff --git a/radio/src/Makefile b/radio/src/Makefile index ffdcfdfd3..dc6d568d4 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -1234,7 +1234,7 @@ ifeq ($(PCB), HORUS) PULSESSRC = pulses/pulses_arm.cpp pulses/ppm_arm.cpp pulses/pxx_arm.cpp CPPSRC += tasks_arm.cpp audio_arm.cpp sbus.cpp telemetry/telemetry.cpp CPPSRC += targets/Horus/pulses_driver.cpp targets/Horus/keys_driver.cpp targets/Horus/adc_driver.cpp targets/Horus/trainer_driver.cpp targets/Horus/audio_driver.cpp targets/Horus/serial2_driver.cpp targets/Horus/telemetry_driver.cpp - CPPSRC += bmp.cpp gui/$(GUIDIRECTORY)/bitmaps.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp debug.cpp + CPPSRC += bmp.cpp gui/$(GUIDIRECTORY)/curves.cpp gui/$(GUIDIRECTORY)/bitmaps.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp debug.cpp SRC += targets/Horus/system_stm32f4xx.c CPPSRC += storage/storage_common.cpp storage/sdcard_raw.cpp SRC += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/src/misc.c @@ -1784,11 +1784,10 @@ lss: $(TARGET).lss sym: $(TARGET).sym # Build stamp-file -stamp_header: - @echo "// Automatically generated file (Makefile) - do not edit" > stamp-opentx.h - @echo "#define DATE_STR \"`date +%Y-%m-%d | tr -d '\r\n'`\"" >> stamp-opentx.h - @echo "#define TIME_STR \"`date +%H:%M:%S | tr -d '\r\n'`\"" >> stamp-opentx.h - @echo "#define VERS_STR \"$(VERSION)\"" >> stamp-opentx.h +stamp.h: + @echo "#define DATE \"`date +%Y-%m-%d | tr -d '\r\n'`\"" > stamp.h + @echo "#define TIME \"`date +%H:%M:%S | tr -d '\r\n'`\"" >> stamp.h + @echo "#define VERSION \"$(VERSION)\"" >> stamp.h opentx-stamp: @echo "#define DATE_STR \"`date +%Y-%m-%d`\"" > stamp-opentx.txt @@ -2005,7 +2004,7 @@ ifeq ($(SIMU_DISKIO), YES) SIMUDEFS += -DSIMU_DISKIO endif -simu: $(LUADEP) stamp_header allsimusrc.cpp Makefile simu.cpp targets/simu/simpgmspace.cpp *.h tra lbm eeprom.bin +simu: $(LUADEP) stamp.h allsimusrc.cpp Makefile simu.cpp targets/simu/simpgmspace.cpp *.h tra lbm eeprom.bin g++ $(CPPFLAGS) $(SIMUCPPFLAGS) $(INCFLAGS) simu.cpp allsimusrc.cpp $(LUASRC) targets/simu/simpgmspace.cpp -MD $(SIMUDEFS) -O0 -o simu $(FOXINC) $(FOXLIB) $(AUDIOINC) $(AUDIOLIB) -pthread -fexceptions eeprom.bin: @@ -2105,7 +2104,7 @@ clean_list : $(REMOVE) *.lst $(REMOVE) allsrc.cpp $(REMOVE) allsimusrc.cpp - $(REMOVE) stamp-opentx.h + $(REMOVE) stamp.h $(REMOVE) bitmaps/*.lbm $(REMOVE) bitmaps/*/*.lbm $(REMOVE) fonts/*/*.lbm diff --git a/radio/src/bitmaps/Horus/mask_coord_shadow.png b/radio/src/bitmaps/Horus/mask_coord_shadow.png new file mode 100644 index 000000000..e486428ca Binary files /dev/null and b/radio/src/bitmaps/Horus/mask_coord_shadow.png differ diff --git a/radio/src/gui/9X/menu_model_curves.cpp b/radio/src/gui/9X/menu_model_curves.cpp index 27420a502..4fc82d84c 100644 --- a/radio/src/gui/9X/menu_model_curves.cpp +++ b/radio/src/gui/9X/menu_model_curves.cpp @@ -65,7 +65,7 @@ point_t getPoint(uint8_t i) void DrawCurve(uint8_t offset=0) { - DrawFunction(curveFn, offset); + drawFunction(curveFn, offset); uint8_t i = 0; do { diff --git a/radio/src/gui/9X/menu_model_inputs_mixes.cpp b/radio/src/gui/9X/menu_model_inputs_mixes.cpp index 33fd0d860..214a837cb 100644 --- a/radio/src/gui/9X/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/9X/menu_model_inputs_mixes.cpp @@ -82,7 +82,7 @@ int16_t expoFn(int16_t x) return anas[ed->chn]; } -void DrawFunction(FnFuncP fn, uint8_t offset) +void drawFunction(FnFuncP fn, uint8_t offset) { lcdDrawVerticalLine(X0-offset, 0, LCD_H, 0xee); lcdDrawHorizontalLine(X0-WCHART-offset, Y0, WCHART*2, 0xee); @@ -368,7 +368,7 @@ void menuModelExpoOne(uint8_t event) y += FH; } - DrawFunction(expoFn); + drawFunction(expoFn); int16_t x512 = calibratedStick[ed->chn]; lcd_outdezAtt(LCD_W-8, 6*FH, calcRESXto100(x512), 0); diff --git a/radio/src/gui/9X/menus.h b/radio/src/gui/9X/menus.h index 703b59acf..bb8ddd4b9 100644 --- a/radio/src/gui/9X/menus.h +++ b/radio/src/gui/9X/menus.h @@ -460,6 +460,6 @@ void displayWarning(uint8_t event); #define EDIT_MODE_INIT -1 typedef int16_t (*FnFuncP) (int16_t x); -void DrawFunction(FnFuncP fn, uint8_t offset=0); +void drawFunction(FnFuncP fn, uint8_t offset=0); #endif // _MENUS_H_ diff --git a/radio/src/gui/Horus/bitmaps.cpp b/radio/src/gui/Horus/bitmaps.cpp index 8ee4ad21a..6bd57df33 100644 --- a/radio/src/gui/Horus/bitmaps.cpp +++ b/radio/src/gui/Horus/bitmaps.cpp @@ -263,3 +263,7 @@ const uint8_t LBM_CURVE_POINT[] = { const uint8_t LBM_CURVE_POINT_CENTER[] = { #include "../../bitmaps/Horus/mask_cvpoint_center.lbm" }; + +const uint8_t LBM_CURVE_COORD_SHADOW[] = { +#include "../../bitmaps/Horus/mask_coord_shadow.lbm" +}; diff --git a/radio/src/gui/Horus/curves.cpp b/radio/src/gui/Horus/curves.cpp new file mode 100644 index 000000000..63799a425 --- /dev/null +++ b/radio/src/gui/Horus/curves.cpp @@ -0,0 +1,111 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * 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. + * + */ + +coord_t getCurveYCoord(FnFuncP fn, coord_t x) +{ + return limit(0, CURVE_CENTER_Y - divRoundClosest(fn(divRoundClosest(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), LCD_H-1); +} + +void drawFunction(FnFuncP fn, int offset) +{ + int left = CURVE_CENTER_X-offset-CURVE_SIDE_WIDTH; + int right = CURVE_CENTER_X-offset+CURVE_SIDE_WIDTH; + int center = CURVE_CENTER_X-offset; + + // Axis + lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y, CURVE_SIDE_WIDTH*2+1, CURVE_AXIS_COLOR); + lcdDrawSolidVerticalLine(center, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, CURVE_AXIS_COLOR); + + // Extra lines + lcdDrawVerticalLine(left+CURVE_SIDE_WIDTH/2, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, STASHED, CURVE_AXIS_COLOR); + lcdDrawVerticalLine(right-CURVE_SIDE_WIDTH/2, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, STASHED, CURVE_AXIS_COLOR); + lcdDrawHorizontalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH/2, CURVE_SIDE_WIDTH*2+1, STASHED, CURVE_AXIS_COLOR); + lcdDrawHorizontalLine(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH/2, CURVE_SIDE_WIDTH*2+1, STASHED, CURVE_AXIS_COLOR); + + // Outside border + lcdDrawSolidVerticalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, TEXT_COLOR); + lcdDrawSolidVerticalLine(right, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, TEXT_COLOR); + lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2+1, TEXT_COLOR); + lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2+1, TEXT_COLOR); + + coord_t prev_yv = (coord_t)-1; + + for (int xv=-CURVE_SIDE_WIDTH; xv<=CURVE_SIDE_WIDTH; xv+=1) { + coord_t yv = getCurveYCoord(fn, xv); + if (prev_yv != (coord_t)-1) { + if (prev_yv < yv) { + for (int y=prev_yv; y<=yv; y+=1) { + lcdDrawBitmapPattern(CURVE_CENTER_X+xv-offset-2, y-2, LBM_POINT, TEXT_COLOR); + } + } + else { + for (int y=yv; y<=prev_yv; y+=1) { + lcdDrawBitmapPattern(CURVE_CENTER_X+xv-offset-2, y-2, LBM_POINT, TEXT_COLOR); + } + } + } + prev_yv = yv; + } +} + +void drawCurveVerticalScale(int x) +{ + for (int i=0; i<=20; i++) { + lcdDrawSolidHorizontalLine(x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, 10, TEXT_COLOR); + } +} + +void drawCurveHorizontalScale() +{ + 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); + } +} + +void drawCurveCoord(int x, int y, const char * text, bool active) +{ + lcdDrawSolidFilledRect(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); + if (active) { + lcdDrawBitmapPattern(x, y, LBM_CURVE_COORD_SHADOW, TEXT_COLOR); + } +} + +void drawCurvePoint(int x, int y, LcdFlags color) +{ + lcdDrawBitmapPattern(x, y, LBM_CURVE_POINT, color); + lcdDrawBitmapPattern(x, y, LBM_CURVE_POINT_CENTER, TEXT_BGCOLOR); +} diff --git a/radio/src/gui/Horus/gui.h b/radio/src/gui/Horus/gui.h index 5a2a096b8..956dfcf6b 100644 --- a/radio/src/gui/Horus/gui.h +++ b/radio/src/gui/Horus/gui.h @@ -37,34 +37,36 @@ #include "lcd.h" #include "menus.h" -#define MENU_HEADER_HEIGHT 45 -#define MENU_TITLE_TOP 48 -#define MENU_TITLE_HEIGHT 21 -#define MENU_BODY_TOP 69 // MENU_TITLE_TOP + MENU_TITLE_HEIGHT -#define MENU_CONTENT_TOP 72 -#define MENU_BODY_HEIGHT 182 -#define MENU_FOOTER_TOP 251 // MENU_BODY_TOP + MENU_BODY_HEIGHT -#define MENU_FOOTER_HEIGHT 21 +#define MENU_HEADER_HEIGHT 45 +#define MENU_TITLE_TOP 48 +#define MENU_TITLE_HEIGHT 21 +#define MENU_BODY_TOP 69 // MENU_TITLE_TOP + MENU_TITLE_HEIGHT +#define MENU_CONTENT_TOP 72 +#define MENU_BODY_HEIGHT 182 +#define MENU_FOOTER_TOP 251 // MENU_BODY_TOP + MENU_BODY_HEIGHT +#define MENU_FOOTER_HEIGHT 21 -#define MENUS_MARGIN_LEFT 6 +#define MENUS_MARGIN_LEFT 6 -#define DEFAULT_SCROLLBAR_X LCD_W-10 -#define DEFAULT_SCROLLBAR_Y MENU_CONTENT_TOP -#define DEFAULT_SCROLLBAR_H (MENU_FOOTER_TOP - DEFAULT_SCROLLBAR_Y - 6) +#define DEFAULT_SCROLLBAR_X LCD_W-10 +#define DEFAULT_SCROLLBAR_Y MENU_CONTENT_TOP +#define DEFAULT_SCROLLBAR_H (MENU_FOOTER_TOP - DEFAULT_SCROLLBAR_Y - 6) -#define NUM_BODY_LINES 9 -#define FH 20 +#define NUM_BODY_LINES 9 +#define FH 20 -#define INVERT_HORZ_MARGIN 3 -#define INVERT_VERT_MARGIN 1 -#define INVERT_LINE_HEIGHT 18 +#define INVERT_HORZ_MARGIN 3 +#define INVERT_VERT_MARGIN 1 +#define INVERT_LINE_HEIGHT 18 -#define CURVE_SIDE_WIDTH 100 -#define CURVE_CENTER_X (LCD_W-CURVE_SIDE_WIDTH-7) -#define CURVE_CENTER_Y 151 +#define CURVE_SIDE_WIDTH 100 +#define CURVE_CENTER_X (LCD_W-CURVE_SIDE_WIDTH-7) +#define CURVE_CENTER_Y 151 +#define CURVE_COORD_WIDTH 36 +#define CURVE_COORD_HEIGHT 17 -#define MENU_TITLE_NEXT_POS (lcdNextPos + 10) -#define MENU_INIT_VPOS -1 +#define MENU_TITLE_NEXT_POS (lcdNextPos + 10) +#define MENU_INIT_VPOS -1 void displaySplash(); void displayScreenIndex(uint8_t index, uint8_t count); @@ -76,6 +78,13 @@ void drawProgressBar(const char *label); void updateProgressBar(int num, int den); void drawTopmenuDatetime(); +// Curve functions +coord_t getCurveYCoord(FnFuncP fn, coord_t x); +void drawFunction(FnFuncP fn, int offset); +void drawCurveVerticalScale(int x); +void drawCurveHorizontalScale(); +void drawCurveCoord(int x, int y, const char * text, bool active=false); +void drawCurvePoint(int x, int y, LcdFlags color); // Header bitmaps extern const uint8_t LBM_TOPMENU_POLYGON[]; @@ -114,3 +123,4 @@ extern const uint8_t LBM_ASTERISK[]; extern const uint8_t LBM_POINT[]; extern const uint8_t LBM_CURVE_POINT[]; extern const uint8_t LBM_CURVE_POINT_CENTER[]; +extern const uint8_t LBM_CURVE_COORD_SHADOW[]; diff --git a/radio/src/gui/Horus/menu_model.cpp b/radio/src/gui/Horus/menu_model.cpp index c76489b66..881384c95 100644 --- a/radio/src/gui/Horus/menu_model.cpp +++ b/radio/src/gui/Horus/menu_model.cpp @@ -114,21 +114,25 @@ static int8_t s_copyTgtOfs; static uint8_t editNameCursorPos = 0; -void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint8_t active) +void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags) { - uint8_t flags = 0; if (active && s_editMode <= 0) { - flags = INVERS; + flags |= INVERS; } if (!active || s_editMode <= 0) { - uint8_t len = zlen(name, size); - if (len == 0) { - char tmp[] = "---"; - lcdDrawTextWithLen(x, y, tmp, size, flags); + if (flags & ZCHAR) { + uint8_t len = zlen(name, size); + if (len == 0) { + char tmp[] = "---"; + lcdDrawTextWithLen(x, y, tmp, size, flags-ZCHAR); + } + else { + lcdDrawTextWithLen(x, y, name, len, flags); + } } else { - lcdDrawTextWithLen(x, y, name, len, ZCHAR | flags); + lcdDrawText(x, y, name, flags); } } @@ -138,8 +142,13 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint int8_t v = c; if (event==EVT_ROTARY_RIGHT || event==EVT_ROTARY_LEFT) { - v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0); - if (c <= 0) v = -v; + if (flags & ZCHAR) { + v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0); + if (c <= 0) v = -v; + } + else { + v = checkIncDec(event, abs(v), '0', 'z', 0); + } } switch (event) { @@ -163,7 +172,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint break; case EVT_KEY_LONG(KEY_ENTER): - if (v==0) { + if (v == ((flags & ZCHAR) ? 0 : ' ')) { s_editMode = 0; killEvents(event); break; @@ -172,10 +181,20 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint case EVT_KEY_LONG(KEY_LEFT): case EVT_KEY_LONG(KEY_RIGHT): - if (v>=-26 && v<=26) { - v = -v; // toggle case - if (event==EVT_KEY_LONG(KEY_LEFT)) - killEvents(KEY_LEFT); + if (flags & ZCHAR) { + if (v>=-26 && v<=26) { + v = -v; // toggle case + if (event==EVT_KEY_LONG(KEY_LEFT)) + killEvents(KEY_LEFT); + } + } + else { + if (v>='A' && v<='Z') { + v = 'a'+v-'A'; // toggle case + } + else if (v>='a' && v<='z') { + v = 'A'+v-'a'; // toggle case + } } break; } @@ -185,10 +204,10 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint storageDirty(g_menuPos[0] == 0 ? EE_MODEL : EE_GENERAL); } - lcdDrawTextWithLen(x, y, name, size, ZCHAR | flags); - coord_t w = (editNameCursorPos == 0 ? 0 : getTextWidth(name, editNameCursorPos, ZCHAR)); - char s[] = { idx2char(name[editNameCursorPos]), '\0' }; - lcdDrawSolidFilledRect(x+w-1, y-INVERT_VERT_MARGIN, getTextWidth(s, 1)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); + lcdDrawTextWithLen(x, y, name, size, flags); + coord_t w = (editNameCursorPos == 0 ? 0 : getTextWidth(name, editNameCursorPos, flags)); + char s[] = { (flags & ZCHAR) ? idx2char(name[editNameCursorPos]) : name[editNameCursorPos], '\0' }; + lcdDrawSolidFilledRect(x+w-1, y-INVERT_VERT_MARGIN, getTextWidth(s, 1, flags)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); lcdDrawText(x+w, y, s, TEXT_INVERTED_COLOR); } else { diff --git a/radio/src/gui/Horus/menu_model_curves.cpp b/radio/src/gui/Horus/menu_model_curves.cpp index 333c66df3..52b023729 100644 --- a/radio/src/gui/Horus/menu_model_curves.cpp +++ b/radio/src/gui/Horus/menu_model_curves.cpp @@ -65,14 +65,14 @@ point_t getPoint(uint8_t i) void DrawCurve(int offset=0) { - DrawFunction(curveFn, offset); + drawFunction(curveFn, offset); - int i = 0; + /*int i = 0; do { point_t point = getPoint(i++); if (point.x == 0) break; lcdDrawSolidFilledRect(point.x-offset, point.y-1, 3, 3, TEXT_COLOR); // do markup square - } while(1); + } while(1);*/ } extern int8_t * curveEnd[MAX_CURVES]; @@ -143,11 +143,13 @@ bool menuModelCurveOne(evt_t event) SIMPLE_SUBMENU(STR_MENUCURVE, 4 + 5+crv.points + (crv.type==CURVE_TYPE_CUSTOM ? 5+crv.points-2 : 0), 0); - lcdDrawNumber(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+2, s_curveChan+1, LEFT|HEADER_COLOR); + lcdDrawNumber(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+1, s_curveChan+1, LEFT|TEXT_COLOR); + // Curve name lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP, STR_NAME); editName(MENUS_MARGIN_LEFT+INDENT_WIDTH, MENU_CONTENT_TOP + FH, g_model.curveNames[s_curveChan], sizeof(g_model.curveNames[s_curveChan]), event, m_posVert==0); + // Curve type LcdFlags attr = (m_posVert==1 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0); lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 2*FH, "Type"); lcdDrawTextAtIndex(MENUS_MARGIN_LEFT+INDENT_WIDTH, MENU_CONTENT_TOP + 3*FH, STR_CURVE_TYPES, crv.type, attr); @@ -165,6 +167,7 @@ bool menuModelCurveOne(evt_t event) } } + // Curve points count attr = (m_posVert==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0); lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 4*FH, STR_COUNT); lcdDrawNumber(MENUS_MARGIN_LEFT+INDENT_WIDTH, MENU_CONTENT_TOP + 5*FH, 5+crv.points, LEFT|attr, 0, NULL, STR_PTS); @@ -186,6 +189,7 @@ bool menuModelCurveOne(evt_t event) } } + // Curve smooth lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 6*FH, STR_SMOOTH); drawCheckBox(lcdNextPos + 10, MENU_CONTENT_TOP + 6*FH, crv.smooth, m_posVert==3 ? INVERS : 0); if (m_posVert==3) crv.smooth = checkIncDecModel(event, crv.smooth, 0, 1); @@ -209,12 +213,11 @@ bool menuModelCurveOne(evt_t event) } if (m_posVert >= 0) { - DrawCurve(6); + DrawCurve(); + drawCurveHorizontalScale(); + if (m_posVert < 4) drawCurveVerticalScale(CURVE_CENTER_X-CURVE_SIDE_WIDTH-15); } - // lcdDrawText(115, MENU_FOOTER_TOP, "X", HEADER_COLOR); - // lcdDrawText(145, MENU_FOOTER_TOP, "Y", HEADER_COLOR); - coord_t posY = MENU_CONTENT_TOP; attr = (s_editMode > 0 ? INVERS|BLINK : INVERS); for (int i=0; i<5+crv.points; i++) { @@ -230,9 +233,10 @@ bool menuModelCurveOne(evt_t event) selectionMode = 2; } + int8_t x = -100 + 200*i/(5+crv.points-1); + if (crv.type==CURVE_TYPE_CUSTOM && i>0 && i<5+crv.points-1) x = points[5+crv.points+i-1]; + if (i>=pointsOfs && i0 && i<5+crv.points-1) x = points[5+crv.points+i-1]; lcdDrawNumber(120, posY, i+1, LEFT|TEXT_DISABLE_COLOR); lcdDrawNumber(150, posY, x, LEFT|(selectionMode==1 ? attr : 0)); lcdDrawNumber(200, posY, points[i], LEFT|(selectionMode==2 ? attr : 0)); @@ -240,8 +244,35 @@ bool menuModelCurveOne(evt_t event) } if (selectionMode > 0) { - // do selection square - lcdDrawSolidFilledRect(point.x-7, point.y-2, 5, 5, TEXT_INVERTED_BGCOLOR); + lcdDrawSolidFilledRect(point.x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR); + + char text[5]; + sprintf(text, "%d", points[i]); + + if (point.x >= CURVE_CENTER_X) { + drawCurveVerticalScale(point.x-15); + if (points[i-1] > points[i]) { + drawCurveCoord(point.x+1-CURVE_COORD_WIDTH, point.y, text, selectionMode==2); + } + else { + drawCurveCoord(point.x+1-CURVE_COORD_WIDTH, point.y-CURVE_COORD_HEIGHT-1, text, selectionMode==2); + } + } + else { + drawCurveVerticalScale(point.x+7); + if (points[i+1] > points[i]) { + drawCurveCoord(point.x+1, point.y, text, selectionMode==2); + } + else { + drawCurveCoord(point.x+1, point.y-CURVE_COORD_HEIGHT-1, text, selectionMode==2); + } + } + + drawCurvePoint(point.x-3, point.y-4, CURVE_CURSOR_COLOR); + + sprintf(text, "%d", x); + drawCurveCoord(limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH-1, point.x-CURVE_COORD_WIDTH/2, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+1), CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, text, selectionMode==1); + if (s_editMode > 0) { if (selectionMode == 1) CHECK_INCDEC_MODELVAR(event, points[5+crv.points+i-1], i==1 ? -100 : points[5+crv.points+i-2], i==5+crv.points-2 ? 100 : points[5+crv.points+i]); // edit X @@ -253,9 +284,12 @@ bool menuModelCurveOne(evt_t event) else if (i > pointsOfs+NUM_BODY_LINES-1) pointsOfs = i-NUM_BODY_LINES+1; } + else { + drawCurvePoint(point.x-3, point.y-4, TEXT_COLOR); + } } - drawScrollbar(250, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H, pointsOfs, 5+crv.points, NUM_BODY_LINES); + drawScrollbar(240, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H+MENU_FOOTER_HEIGHT, pointsOfs, 5+crv.points, NUM_BODY_LINES+1); return true; } diff --git a/radio/src/gui/Horus/menu_model_inputs_mixes.cpp b/radio/src/gui/Horus/menu_model_inputs_mixes.cpp index 6fd2210bd..8e3cb0980 100644 --- a/radio/src/gui/Horus/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/Horus/menu_model_inputs_mixes.cpp @@ -79,67 +79,6 @@ int expoFn(int x) return anas[ed->chn]; } -int divRound(int num, int den) -{ - if (num < 0) - return (num - den/2) / den; - else - return (num + den/2) / den; -} - -coord_t getYCoord(FnFuncP fn, coord_t x) -{ - return limit(0, CURVE_CENTER_Y - divRound(fn(divRound(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), LCD_H-1); -} - -void DrawFunction(FnFuncP fn, int offset) -{ - int left = CURVE_CENTER_X-offset-CURVE_SIDE_WIDTH; - int right = CURVE_CENTER_X-offset+CURVE_SIDE_WIDTH; - int center = CURVE_CENTER_X-offset; - - // Axis - lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y, CURVE_SIDE_WIDTH*2+1, CURVE_AXIS_COLOR); - lcdDrawSolidVerticalLine(center, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, CURVE_AXIS_COLOR); - - // Extra lines - lcdDrawVerticalLine(left+CURVE_SIDE_WIDTH/2, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, STASHED, CURVE_AXIS_COLOR); - lcdDrawVerticalLine(right-CURVE_SIDE_WIDTH/2, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, STASHED, CURVE_AXIS_COLOR); - lcdDrawHorizontalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH/2, CURVE_SIDE_WIDTH*2+1, STASHED, CURVE_AXIS_COLOR); - lcdDrawHorizontalLine(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH/2, CURVE_SIDE_WIDTH*2+1, STASHED, CURVE_AXIS_COLOR); - - // Outside border - lcdDrawSolidVerticalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, TEXT_COLOR); - lcdDrawSolidVerticalLine(right, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2, TEXT_COLOR); - lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2+1, TEXT_COLOR); - lcdDrawSolidHorizontalLine(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH, CURVE_SIDE_WIDTH*2+1, TEXT_COLOR); - - // Horizontal / Vertical scale - for (int i=0; i<=20; i++) { - lcdDrawSolidHorizontalLine(left-15, CURVE_CENTER_Y-CURVE_SIDE_WIDTH+i*CURVE_SIDE_WIDTH/10, 10, TEXT_COLOR); - lcdDrawSolidVerticalLine(left+i*CURVE_SIDE_WIDTH/10, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+5, 10, TEXT_COLOR); - } - - coord_t prev_yv = (coord_t)-1; - - for (int xv=-CURVE_SIDE_WIDTH; xv<=CURVE_SIDE_WIDTH; xv+=1) { - coord_t yv = getYCoord(fn, xv); - if (prev_yv != (coord_t)-1) { - if (prev_yv < yv) { - for (int y=prev_yv; y<=yv; y+=1) { - lcdDrawBitmapPattern(CURVE_CENTER_X+xv-offset-2, y-2, LBM_POINT, TEXT_COLOR); - } - } - else { - for (int y=yv; y<=prev_yv; y+=1) { - lcdDrawBitmapPattern(CURVE_CENTER_X+xv-offset-2, y-2, LBM_POINT, TEXT_COLOR); - } - } - } - prev_yv = yv; - } -} - int getLinesCount(uint8_t expo) { int lastch = -1; @@ -371,7 +310,10 @@ bool menuModelExpoOne(evt_t event) coord_t y = MENU_CONTENT_TOP; - DrawFunction(expoFn); + drawFunction(expoFn); + + drawCurveHorizontalScale(); + drawCurveVerticalScale(CURVE_CENTER_X-CURVE_SIDE_WIDTH-15); { char textx[5]; @@ -390,20 +332,18 @@ bool menuModelExpoOne(evt_t event) int y = limit(-1024, expoFn(x), 1024); sprintf(texty, "%d", calcRESXto100(y)); - x = divRound(x*CURVE_SIDE_WIDTH, RESX); - y = getYCoord(expoFn, x); + x = divRoundClosest(x*CURVE_SIDE_WIDTH, RESX); + y = getCurveYCoord(expoFn, x); lcdDrawSolidFilledRect(CURVE_CENTER_X+x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR); lcdDrawSolidFilledRect(CURVE_CENTER_X-CURVE_SIDE_WIDTH-2, y-1, 2*CURVE_SIDE_WIDTH+2, 2, CURVE_CURSOR_COLOR); lcdDrawBitmapPattern(CURVE_CENTER_X+x-4, y-4, LBM_CURVE_POINT, CURVE_CURSOR_COLOR); lcdDrawBitmapPattern(CURVE_CENTER_X+x-4, y-4, LBM_CURVE_POINT_CENTER, TEXT_BGCOLOR); - int left = (x < -30 ? CURVE_CENTER_X+x : (x > 30 ? CURVE_CENTER_X+x-34 : CURVE_CENTER_X-17+x/2)); - lcdDrawSolidFilledRect(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, 36, 17, CURVE_CURSOR_COLOR); - lcdDrawText(left+3+(35-getTextWidth(textx, SMLSIZE))/2, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+3, textx, LEFT|SMLSIZE|TEXT_BGCOLOR); - int top = (y < CURVE_CENTER_Y-8 ? y-1 : (y > CURVE_CENTER_Y+8 ? y-16 : CURVE_CENTER_Y-8+(y-CURVE_CENTER_Y)/2)); - lcdDrawSolidFilledRect(CURVE_CENTER_X-CURVE_SIDE_WIDTH-37, top, 36, 17, CURVE_CURSOR_COLOR); - lcdDrawText(CURVE_CENTER_X-CURVE_SIDE_WIDTH-34+(35-getTextWidth(texty, SMLSIZE))/2, top+1, texty, LEFT|SMLSIZE|TEXT_BGCOLOR); + int left = limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH, CURVE_CENTER_X-CURVE_COORD_WIDTH/2+x, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+2); + drawCurveCoord(left, CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, textx); + int top = limit(CURVE_CENTER_Y-CURVE_SIDE_WIDTH-1, -CURVE_COORD_HEIGHT/2+y, CURVE_CENTER_Y+CURVE_SIDE_WIDTH-CURVE_COORD_HEIGHT+1); + drawCurveCoord(CURVE_CENTER_X-CURVE_SIDE_WIDTH-37, top, texty); } for (int i=0; i 0) + MENU_ADD_ITEM(STR_DELETE_CATEGORY); + menuHandler = onCategorySelectMenu; + } + else if (selectMode == MODE_SELECT_MODEL) { + killEvents(event); ModelHeader header; const char * error = readModel(selectedFilename, (uint8_t *)&header, sizeof(header)); if (!error) { @@ -204,8 +227,25 @@ bool menuModelSelect(evt_t event) if (!result) break; if (y < LCD_H) { - drawCategory(y, line, currentCategory==index); + if (selectMode == MODE_RENAME_CATEGORY && currentCategory == index) { + s_editMode = EDIT_MODIFY_STRING; + lcdDrawSolidFilledRect(0, y-INVERT_VERT_MARGIN, CATEGORIES_WIDTH, INVERT_LINE_HEIGHT, TEXT_BGCOLOR); + editName(MENUS_MARGIN_LEFT, y, selectedCategory, LEN_MODEL_FILENAME, event, 1, 0); + if (s_editMode == 0 || event == EVT_KEY_BREAK(KEY_EXIT)) { + storageRenameCategory(currentCategory, selectedCategory); + selectMode = MODE_SELECT_CATEGORY; + putEvent(EVT_REFRESH); + } + } + else { + if (currentCategory == index) { + memcpy(selectedCategory, line, sizeof(selectedCategory)); + } + drawCategory(y, line, currentCategory==index); + } } + + y += FH; index++; } diff --git a/radio/src/gui/Horus/menus.h b/radio/src/gui/Horus/menus.h index 98f05f409..16a531c1f 100644 --- a/radio/src/gui/Horus/menus.h +++ b/radio/src/gui/Horus/menus.h @@ -247,7 +247,7 @@ int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, evt_t e #define displayGVar(x, y, v, min, max) lcdDrawNumber(x, y, v) #endif -void editName(coord_t x, coord_t y, char *name, uint8_t size, evt_t event, uint8_t active); +void editName(coord_t x, coord_t y, char *name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags=ZCHAR); #define WARNING_TYPE_ASTERISK 0 #define WARNING_TYPE_CONFIRM 1 @@ -318,6 +318,6 @@ void pushModelNotes(); #define EDIT_MODE_INIT 0 // TODO enum typedef int (*FnFuncP) (int x); -void DrawFunction(FnFuncP fn, int offset=0); +void drawFunction(FnFuncP fn, int offset=0); #endif // _MENUS_H_ diff --git a/radio/src/gui/Taranis/menu_model_curves.cpp b/radio/src/gui/Taranis/menu_model_curves.cpp index 7ae939673..cc989fe0b 100644 --- a/radio/src/gui/Taranis/menu_model_curves.cpp +++ b/radio/src/gui/Taranis/menu_model_curves.cpp @@ -65,7 +65,7 @@ point_t getPoint(uint8_t i) void DrawCurve(uint8_t offset=0) { - DrawFunction(curveFn, offset); + drawFunction(curveFn, offset); uint8_t i = 0; do { diff --git a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp index 7750d6ee2..78e01a713 100644 --- a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp @@ -81,7 +81,7 @@ int16_t expoFn(int16_t x) return anas[ed->chn]; } -void DrawFunction(FnFuncP fn, uint8_t offset) +void drawFunction(FnFuncP fn, uint8_t offset) { lcdDrawVerticalLine(X0-offset, 0/*TODO Y0-WCHART*/, WCHART*2, 0xee); lcdDrawHorizontalLine(X0-WCHART-offset, Y0, WCHART*2, 0xee); @@ -396,7 +396,7 @@ void menuModelExpoOne(uint8_t event) y += FH; } - DrawFunction(expoFn); + drawFunction(expoFn); int x512 = getValue(ed->srcRaw); if (ed->srcRaw >= MIXSRC_FIRST_TELEM) { diff --git a/radio/src/gui/Taranis/menus.h b/radio/src/gui/Taranis/menus.h index 3931fbab8..4e601145d 100644 --- a/radio/src/gui/Taranis/menus.h +++ b/radio/src/gui/Taranis/menus.h @@ -356,6 +356,6 @@ void menuChannelsView(uint8_t event); #define EDIT_MODE_INIT 0 // TODO enum typedef int16_t (*FnFuncP) (int16_t x); -void DrawFunction(FnFuncP fn, uint8_t offset=0); +void drawFunction(FnFuncP fn, uint8_t offset=0); #endif // _MENUS_H_ diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 19ca96d79..12950e73c 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -37,7 +37,7 @@ #include #include #include "opentx.h" -#include "stamp-opentx.h" +#include "stamp.h" #include "lua/lua_api.h" #if defined(PCBHORUS) @@ -108,7 +108,7 @@ Script finished with status 1 */ static int luaGetVersion(lua_State *L) { - lua_pushstring(L, VERS_STR); + lua_pushstring(L, VERSION); lua_pushstring(L, RADIO_VERSION); return 2; } diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index ab235b38b..d6ee4d087 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -35,7 +35,7 @@ */ #include "opentx.h" -#include "stamp-opentx.h" +#include "stamp.h" #define STR2(s) #s #define DEFNUMSTR(s) STR2(s) @@ -53,10 +53,10 @@ #endif #if defined(COLORLCD) - const pm_char vers_stamp[] PROGMEM = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERS_STR; - const pm_char date_stamp[] PROGMEM = "DATE" TAB ": " DATE_STR; - const pm_char time_stamp[] PROGMEM = "TIME" TAB ": " TIME_STR; + const pm_char vers_stamp[] PROGMEM = "VERS" TAB ": " "opentx-" FLAVOUR "-" VERSION; + const pm_char date_stamp[] PROGMEM = "DATE" TAB ": " DATE; + const pm_char time_stamp[] PROGMEM = "TIME" TAB ": " TIME; const pm_char eeprom_stamp[] PROGMEM = "EEPR" TAB ": " EEPROM_STR; #else - const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERS_STR "\036DATE\037\033: " DATE_STR"\036TIME\037\033: " TIME_STR "\036EEPR\037\033: " EEPROM_STR; + const pm_char vers_stamp[] PROGMEM = "FW\037\033: " "opentx-" FLAVOUR "\036VERS\037\033: " VERSION "\036DATE\037\033: " DATE "\036TIME\037\033: " TIME "\036EEPR\037\033: " EEPROM_STR; #endif diff --git a/radio/src/stamp.h.in b/radio/src/stamp.h.in new file mode 100644 index 000000000..b843d18a7 --- /dev/null +++ b/radio/src/stamp.h.in @@ -0,0 +1,3 @@ +#define DATE "@DATE@" +#define TIME "@TIME@" +#define VERSION "@VERSION@" diff --git a/radio/src/storage/sdcard_raw.cpp b/radio/src/storage/sdcard_raw.cpp index 9d79ffc45..996584cd3 100644 --- a/radio/src/storage/sdcard_raw.cpp +++ b/radio/src/storage/sdcard_raw.cpp @@ -326,11 +326,16 @@ bool storageReadNextModel(StorageModelsList * storage, char * line, int maxlen) return false; } -#define STORAGE_INSERT 1 -#define STORAGE_REMOVE 2 -#define STORAGE_RENAME 3 +enum StorageOperation { + STORAGE_INSERT_MODEL, + STORAGE_REMOVE_MODEL, + STORAGE_RENAME_MODEL, + STORAGE_INSERT_CATEGORY, + STORAGE_RENAME_CATEGORY, + STORAGE_REMOVE_CATEGORY +}; -const char * storageModifyModel(unsigned int operation, int category, int position, const char * name="") +const char * storageModifyLine(unsigned int operation, int category, int position, const char * name="") { StorageModelsList storage; FIL file; @@ -357,27 +362,42 @@ const char * storageModifyModel(unsigned int operation, int category, int positi if (!operationdone) { int len = storageGetCategoryLength(line); if (len > 0) { - if (categoryindex++ == category) { - operationdone = true; - if (operation == STORAGE_INSERT) { + if (category >= 0) { + if (categoryindex == category && operation == STORAGE_INSERT_MODEL) { f_puts(name, &file); f_putc('\n', &file); + operationdone = true; + } + categoryindex++; + if (categoryindex == category) { + if (operation == STORAGE_RENAME_CATEGORY) { + f_puts("[", &file); + f_puts(name, &file); + f_puts("]", &file); + f_putc('\n', &file); + operationdone = true; + continue; + } + else if (operation == STORAGE_REMOVE_CATEGORY) { + operationdone = true; + continue; + } } } } else if (categoryindex == category) { if (modelindex++ == position) { operationdone = true; - if (operation == STORAGE_INSERT) { + if (operation == STORAGE_INSERT_MODEL) { f_puts(name, &file); f_putc('\n', &file); } - else if (operation == STORAGE_RENAME) { + else if (operation == STORAGE_RENAME_MODEL) { f_puts(name, &file); f_putc('\n', &file); continue; } - else if (operation == STORAGE_REMOVE) { + else if (operation == STORAGE_REMOVE_MODEL) { TRACE("skip %s", line); continue; } @@ -388,11 +408,21 @@ const char * storageModifyModel(unsigned int operation, int category, int positi f_putc('\n', &file); } - if (!operationdone && categoryindex>=0 && operation==STORAGE_INSERT) { - f_puts(name, &file); - f_putc('\n', &file); + if (!operationdone) { + if (categoryindex>=0 && operation==STORAGE_INSERT_MODEL) { + f_puts(name, &file); + f_putc('\n', &file); + } + else if (operation==STORAGE_INSERT_CATEGORY) { + f_puts("[", &file); + f_puts(name, &file); + f_puts("]", &file); + f_putc('\n', &file); + } } + + f_close(&file); f_unlink(RADIO_PATH "/models.old"); f_rename(RADIO_MODELSLIST_PATH, RADIO_PATH "/models.old"); @@ -400,17 +430,32 @@ const char * storageModifyModel(unsigned int operation, int category, int positi return NULL; } +const char * storageAppendCategory(const char * name) +{ + return storageModifyLine(STORAGE_INSERT_CATEGORY, -1, -1, name); +} + +const char * storageRenameCategory(int category, const char * name) +{ + return storageModifyLine(STORAGE_RENAME_CATEGORY, category, -1, name); +} + +const char * storageRemoveCategory(int category) +{ + return storageModifyLine(STORAGE_REMOVE_CATEGORY, category, -1); +} + const char * storageInsertModel(const char * name, int category, int position) { - return storageModifyModel(STORAGE_INSERT, category, position, name); + return storageModifyLine(STORAGE_INSERT_MODEL, category, position, name); } const char * storageRemoveModel(int category, int position) { - return storageModifyModel(STORAGE_REMOVE, category, position); + return storageModifyLine(STORAGE_REMOVE_MODEL, category, position); } const char * storageRenameModel(const char * name, int category, int position) { - return storageModifyModel(STORAGE_RENAME, category, position, name); + return storageModifyLine(STORAGE_RENAME_MODEL, category, position, name); } diff --git a/radio/src/targets/Horus/lcd_driver.cpp b/radio/src/targets/Horus/lcd_driver.cpp index ab73605e5..3137f008e 100644 --- a/radio/src/targets/Horus/lcd_driver.cpp +++ b/radio/src/targets/Horus/lcd_driver.cpp @@ -298,11 +298,6 @@ void LCD_LayerInit() LTDC_DitherCmd(ENABLE); } -static inline long divRoundClosest(const long n, const long d) -{ - return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d); -} - void LCD_ControlLight(uint16_t dutyCycle) { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; diff --git a/radio/src/thirdparty/Lua/src/lundump.c b/radio/src/thirdparty/Lua/src/lundump.c index 54de011a4..d732d6f60 100644 --- a/radio/src/thirdparty/Lua/src/lundump.c +++ b/radio/src/thirdparty/Lua/src/lundump.c @@ -233,7 +233,7 @@ Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) } #define MYINT(s) (s[0]-'0') -#define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) +#define VERSION_INT MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) #define FORMAT 0 /* this is the official format */ /* @@ -246,7 +246,7 @@ void luaU_header (lu_byte* h) int x=1; memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char)); h+=sizeof(LUA_SIGNATURE)-sizeof(char); - *h++=cast_byte(VERSION); + *h++=cast_byte(VERSION_INT); *h++=cast_byte(FORMAT); *h++=cast_byte(*(char*)&x); /* endianness */ *h++=cast_byte(sizeof(int)); diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index e5e3325d3..d23796293 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -424,6 +424,9 @@ const pm_char STR_PERSISTENT_MAH[] PROGMEM = TR_PERSISTENT_MAH; #if defined(NAVIGATION_MENUS) const pm_char STR_SELECT_MODEL[] PROGMEM = TR_SELECT_MODEL; +const pm_char STR_CREATE_CATEGORY[] PROGMEM = TR_CREATE_CATEGORY; +const pm_char STR_RENAME_CATEGORY[] PROGMEM = TR_RENAME_CATEGORY; +const pm_char STR_DELETE_CATEGORY[] PROGMEM = TR_DELETE_CATEGORY; const pm_char STR_CREATE_MODEL[] PROGMEM = TR_CREATE_MODEL; const pm_char STR_DUPLICATE_MODEL[] PROGMEM = TR_DUPLICATE_MODEL; const pm_char STR_COPY_MODEL[] PROGMEM = TR_COPY_MODEL; diff --git a/radio/src/translations.h b/radio/src/translations.h index 8f26c28f5..eaef82290 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -597,8 +597,11 @@ extern const pm_char STR_CURRENT[]; #if defined(NAVIGATION_MENUS) extern const pm_char STR_SELECT_MODEL[]; + extern const pm_char STR_CREATE_CATEGORY[]; + extern const pm_char STR_RENAME_CATEGORY[]; +extern const pm_char STR_DELETE_CATEGORY[]; extern const pm_char STR_CREATE_MODEL[]; -extern const pm_char STR_DUPLICATE_MODEL[]; + extern const pm_char STR_DUPLICATE_MODEL[]; extern const pm_char STR_COPY_MODEL[]; extern const pm_char STR_MOVE_MODEL[]; extern const pm_char STR_DELETE_MODEL[]; diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 9aeeb0dab..ebcc06c28 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -805,6 +805,9 @@ #define TR_VOLTAGE INDENT"Napětí" #define TR_CURRENT INDENT"Proud" #define TR_SELECT_MODEL "Vyber model" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Nový model" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Kopírovat" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 7e85e1bfe..644924eaa 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -809,6 +809,9 @@ #define TR_VOLTAGE TR(INDENT "Spg", INDENT "Spannungsquelle") //9XR-Pro #define TR_CURRENT TR(INDENT "Strom", INDENT "Stromquelle") #define TR_SELECT_MODEL "Modell Wählen" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Neues Modell" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Kopiere Modell" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 06e6adfd0..587d85620 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -828,6 +828,9 @@ #define TR_VOLTAGE TR(INDENT "Voltage",INDENT "Voltage Source") #define TR_CURRENT TR(INDENT "Current",INDENT "Current Source") #define TR_SELECT_MODEL "Select Model" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Create Model" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copy Model" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 53137e75b..2c5c0be2c 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -759,6 +759,9 @@ #define TR_VOLTAGE INDENT"Voltaje" #define TR_CURRENT INDENT"Actual" #define TR_SELECT_MODEL "Selec Modelo" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Crear Modelo" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copiar Modelo" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 5cc4de5ed..331622198 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -759,6 +759,9 @@ #define TR_VOLTAGE INDENT"Voltage" #define TR_CURRENT INDENT"Current" #define TR_SELECT_MODEL "Select Model" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Create Model" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copy Model" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 5d1e28580..1353c5949 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -796,6 +796,9 @@ #define TR_VOLTAGE TR(INDENT "Tension",INDENT "Source Tension") #define TR_CURRENT TR(INDENT "Courant",INDENT "Source Courant") #define TR_SELECT_MODEL "Sélect. Modèle" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Créer Modèle" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copier Modèle" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 205aab898..f29c8b2da 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -807,6 +807,9 @@ #define TR_VOLTAGE TR(INDENT "Voltagg.",INDENT "Voltaggio") #define TR_CURRENT TR(INDENT "Corrente",INDENT "Corrente") #define TR_SELECT_MODEL "Scegli Memo." +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Crea Modello" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copia Modello" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index ab4fc3eeb..da98bf4e6 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -826,6 +826,9 @@ #define TR_VOLTAGE TR(INDENT "Spg", INDENT "Spanningsbron") //9XR-Pro #define TR_CURRENT TR(INDENT "Stroom", INDENT "Stroombron") #define TR_SELECT_MODEL "Kies Model" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Nieuw Model" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Kopieer Model" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 4fab82065..572135cb5 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -808,6 +808,9 @@ #define TR_VOLTAGE TR (INDENT"Napięcie",INDENT"Źródło Napięcia") #define TR_CURRENT TR (INDENT"Prąd",INDENT"Źródło Prądu") #define TR_SELECT_MODEL "Wybór modelu" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Nowy model" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Skopiuj model" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 5d00d28ee..f6289bdea 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -759,6 +759,9 @@ #define TR_VOLTAGE INDENT"Volts" #define TR_CURRENT INDENT"Amperes" #define TR_SELECT_MODEL "Selec. Modelo" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Criar Modelo" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Copy Model" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index b09c9f530..ec4e1bda5 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -759,6 +759,9 @@ #define TR_VOLTAGE INDENT"Volt" #define TR_CURRENT INDENT"Ampere" #define TR_SELECT_MODEL "Välj Modell" +#define TR_CREATE_CATEGORY "Create Category" +#define TR_RENAME_CATEGORY "Rename Category" +#define TR_DELETE_CATEGORY "Delete Category" #define TR_CREATE_MODEL "Skapa Modell" #define TR_DUPLICATE_MODEL "Duplicate Model" #define TR_COPY_MODEL "Kopiera Modell"