From 8a2eaeef9e79ac49dca3273fbb5a3b1219c4b552 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 9 Apr 2021 18:58:32 +0200 Subject: [PATCH 1/4] add touch diag --- radio/src/gui/colorlcd/radio_diaganas.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp index eed5eac25..23be1e154 100644 --- a/radio/src/gui/colorlcd/radio_diaganas.cpp +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -46,6 +46,19 @@ class RadioAnalogsDiagsWindow: public Window { drawHexNumber(dc, x + 3 * 15 - 1, y, anaIn(i)); dc->drawNumber(x + ANA_OFFSET, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT); } + +#if defined(HARDWARE_TOUCH) + constexpr coord_t y = MENU_CONTENT_TOP + 6 * FH; + + if (touchState.event != TE_NONE && touchState.event != TE_SLIDE_END) { + coord_t x = dc->drawText(MENUS_MARGIN_LEFT, y, STR_TOUCH_PANEL); + x = dc->drawNumber(x + 5, y, touchState.x); + x = dc->drawText(x, y, ":"); + dc->drawNumber(x, y, touchState.y); + dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top(), SOLID, 0); + dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); + } +#endif }; protected: From 4191fa15dde9c2a5d63763f72aa37436488e2e23 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 10 Apr 2021 09:23:00 +0200 Subject: [PATCH 2/4] wip --- radio/src/gui/colorlcd/radio_diaganas.cpp | 3 ++- radio/src/thirdparty/libopenui | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp index 23be1e154..2e48ffc7f 100644 --- a/radio/src/gui/colorlcd/radio_diaganas.cpp +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -55,8 +55,9 @@ class RadioAnalogsDiagsWindow: public Window { x = dc->drawNumber(x + 5, y, touchState.x); x = dc->drawText(x, y, ":"); dc->drawNumber(x, y, touchState.y); + TRACE("Drawing: %d,%d - %d,%d", touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top()); dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top(), SOLID, 0); - dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); + //dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); } #endif }; diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index 9f0cff2c9..5271c882b 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit 9f0cff2c987974c487565ba908199918d25a5b2f +Subproject commit 5271c882bfb4ccf794dbbd7d0161b85401f2e221 From e4134379774c2ce7cd4dea26d193430f3cd7ff3e Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 10 Apr 2021 13:33:32 +0200 Subject: [PATCH 3/4] remove debug --- radio/src/gui/colorlcd/radio_diaganas.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp index 2e48ffc7f..23be1e154 100644 --- a/radio/src/gui/colorlcd/radio_diaganas.cpp +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -55,9 +55,8 @@ class RadioAnalogsDiagsWindow: public Window { x = dc->drawNumber(x + 5, y, touchState.x); x = dc->drawText(x, y, ":"); dc->drawNumber(x, y, touchState.y); - TRACE("Drawing: %d,%d - %d,%d", touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top()); dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top(), SOLID, 0); - //dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); + dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); } #endif }; From f943bb1b744142599d7de9dca0cd04a509bca555 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 9 Apr 2021 18:58:32 +0200 Subject: [PATCH 4/4] add touch diag --- radio/src/gui/colorlcd/radio_diaganas.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp index eed5eac25..23be1e154 100644 --- a/radio/src/gui/colorlcd/radio_diaganas.cpp +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -46,6 +46,19 @@ class RadioAnalogsDiagsWindow: public Window { drawHexNumber(dc, x + 3 * 15 - 1, y, anaIn(i)); dc->drawNumber(x + ANA_OFFSET, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT); } + +#if defined(HARDWARE_TOUCH) + constexpr coord_t y = MENU_CONTENT_TOP + 6 * FH; + + if (touchState.event != TE_NONE && touchState.event != TE_SLIDE_END) { + coord_t x = dc->drawText(MENUS_MARGIN_LEFT, y, STR_TOUCH_PANEL); + x = dc->drawNumber(x + 5, y, touchState.x); + x = dc->drawText(x, y, ":"); + dc->drawNumber(x, y, touchState.y); + dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top(), SOLID, 0); + dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); + } +#endif }; protected: