Add debug view

This commit is contained in:
2023-03-21 18:37:50 +01:00
parent 629fcb9098
commit ff37c8503d
49 changed files with 1603 additions and 289 deletions

View File

@ -15,6 +15,8 @@
#include <gui/ami_screen/AMIPresenter.hpp>
#include <gui/driverview_screen/DriverViewView.hpp>
#include <gui/driverview_screen/DriverViewPresenter.hpp>
#include <gui/debugview_screen/DebugViewView.hpp>
#include <gui/debugview_screen/DebugViewPresenter.hpp>
using namespace touchgfx;
@ -33,6 +35,19 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
* Screen Transition Declarations
*/
// MissionSelect
void FrontendApplicationBase::gotoMissionSelectScreenNoTransition()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoMissionSelectScreenNoTransitionImpl);
pendingScreenTransitionCallback = &transitionCallback;
}
void FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl()
{
touchgfx::makeTransition<MissionSelectView, MissionSelectPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}
// AMI
void FrontendApplicationBase::gotoAMIScreenNoTransition()
@ -58,3 +73,16 @@ void FrontendApplicationBase::gotoDriverViewScreenNoTransitionImpl()
{
touchgfx::makeTransition<DriverViewView, DriverViewPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}
// DebugView
void FrontendApplicationBase::gotoDebugViewScreenNoTransition()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoDebugViewScreenNoTransitionImpl);
pendingScreenTransitionCallback = &transitionCallback;
}
void FrontendApplicationBase::gotoDebugViewScreenNoTransitionImpl()
{
touchgfx::makeTransition<DebugViewView, DebugViewPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

View File

@ -0,0 +1,33 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/containers/DebugViewItemBase.hpp>
#include <texts/TextKeysAndLanguages.hpp>
#include <touchgfx/Color.hpp>
DebugViewItemBase::DebugViewItemBase()
{
setWidth(240);
setHeight(26);
label.setPosition(5, 0, 105, 25);
label.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
label.setLinespacing(0);
label.setTypedText(touchgfx::TypedText(T_DEBUGVIEWFIELD_TITLE));
add(label);
value.setPosition(110, 0, 125, 25);
value.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
value.setLinespacing(0);
value.setTypedText(touchgfx::TypedText(T_DEFAULTWILDCARD_RIGHTALIGNED));
add(value);
}
DebugViewItemBase::~DebugViewItemBase()
{
}
void DebugViewItemBase::initialize()
{
}

View File

@ -0,0 +1,49 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/containers/DebugViewLineBase.hpp>
#include <touchgfx/Color.hpp>
DebugViewLineBase::DebugViewLineBase()
{
setWidth(480);
setHeight(26);
bg.setPosition(0, 0, 480, 26);
bg.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(bg);
line1.setPosition(240, 0, 1, 26);
line1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
line1.setPainter(line1Painter);
line1.setStart(0, 0);
line1.setEnd(0, 26);
line1.setLineWidth(10);
line1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
add(line1);
line2.setPosition(0, 25, 480, 1);
line2Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
line2.setPainter(line2Painter);
line2.setStart(0, 0);
line2.setEnd(480, 0);
line2.setLineWidth(10);
line2.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
add(line2);
item1.setXY(0, 0);
add(item1);
item2.setXY(240, 0);
add(item2);
}
DebugViewLineBase::~DebugViewLineBase()
{
}
void DebugViewLineBase::initialize()
{
item1.initialize();
item2.initialize();
}

View File

@ -18,7 +18,7 @@ DriverViewFieldBase::DriverViewFieldBase()
title.setPosition(0, 0, 160, 25);
title.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
title.setLinespacing(0);
title.setTypedText(touchgfx::TypedText(T___SINGLEUSE_0FBJ));
title.setTypedText(touchgfx::TypedText(T_DRIVERVIEWFIELD_TITLE));
add(title);
value.setPosition(0, 20, 160, 57);

View File

@ -16,7 +16,7 @@ DriverViewFieldSelectionBase::DriverViewFieldSelectionBase()
name.setPosition(0, 0, 160, 25);
name.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
name.setLinespacing(0);
name.setTypedText(touchgfx::TypedText(T___SINGLEUSE_PNKR));
name.setTypedText(touchgfx::TypedText(T_DRIVERVIEWFIELD_TITLE));
add(name);
line1.setPosition(0, 25, 160, 1);

View File

@ -0,0 +1,62 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/debugview_screen/DebugViewViewBase.hpp>
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#include <touchgfx/Color.hpp>
DebugViewViewBase::DebugViewViewBase() :
updateItemCallback(this, &DebugViewViewBase::updateItemCallbackHandler)
{
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
__background.setPosition(0, 0, 480, 320);
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(__background);
list.setPosition(0, 4, 480, 312);
list.setHorizontal(false);
list.setCircular(true);
list.setEasingEquation(touchgfx::EasingEquations::backEaseOut);
list.setSwipeAcceleration(10);
list.setDragAcceleration(10);
list.setNumberOfItems(1);
list.setPadding(0, 0);
list.setSnapping(false);
list.setDrawableSize(26, 0);
list.setDrawables(listListItems, updateItemCallback);
add(list);
line1.setPosition(0, 3, 480, 1);
line1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
line1.setPainter(line1Painter);
line1.setStart(0, 0);
line1.setEnd(480, 0);
line1.setLineWidth(10);
line1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
add(line1);
}
DebugViewViewBase::~DebugViewViewBase()
{
touchgfx::CanvasWidgetRenderer::resetBuffer();
}
void DebugViewViewBase::setupScreen()
{
list.initialize();
for (int i = 0; i < listListItems.getNumberOfDrawables(); i++)
{
listListItems[i].initialize();
}
}
void DebugViewViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex)
{
if (items == &listListItems)
{
touchgfx::Drawable* d = items->getDrawable(containerIndex);
DebugViewLine* cc = (DebugViewLine*)d;
listUpdateItem(*cc, itemIndex);
}
}

View File

@ -117,4 +117,13 @@ void MissionSelectViewBase::handleKeyEvent(uint8_t key)
application().gotoDriverViewScreenNoTransition();
}
if(252 == key)
{
//DummyChangeDebugView
//When hardware button 252 clicked change screen to DebugView
//Go to DebugView with no screen transition
application().gotoDebugViewScreenNoTransition();
}
}