Add debug view
This commit is contained in:
		@ -17,25 +17,37 @@ public:
 | 
			
		||||
 | 
			
		||||
    virtual void changeToStartScreen()
 | 
			
		||||
    {
 | 
			
		||||
        gotoDriverViewScreenNoTransition();
 | 
			
		||||
        gotoMissionSelectScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // MissionSelect
 | 
			
		||||
    void gotoMissionSelectScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // DriverView
 | 
			
		||||
    void gotoDriverViewScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // DebugView
 | 
			
		||||
    void gotoDebugViewScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    touchgfx::Callback<FrontendApplicationBase> transitionCallback;
 | 
			
		||||
    FrontendHeap& frontendHeap;
 | 
			
		||||
    Model& model;
 | 
			
		||||
 | 
			
		||||
    // MissionSelect
 | 
			
		||||
    void gotoMissionSelectScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // DriverView
 | 
			
		||||
    void gotoDriverViewScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // DebugView
 | 
			
		||||
    void gotoDebugViewScreenNoTransitionImpl();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,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>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -43,7 +45,8 @@ public:
 | 
			
		||||
    typedef touchgfx::meta::TypeList< MissionSelectView,
 | 
			
		||||
            touchgfx::meta::TypeList< AMIView,
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewView,
 | 
			
		||||
            touchgfx::meta::Nil > >
 | 
			
		||||
            touchgfx::meta::TypeList< DebugViewView,
 | 
			
		||||
            touchgfx::meta::Nil > > >
 | 
			
		||||
            > GeneratedViewTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -58,7 +61,8 @@ public:
 | 
			
		||||
    typedef touchgfx::meta::TypeList< MissionSelectPresenter,
 | 
			
		||||
            touchgfx::meta::TypeList< AMIPresenter,
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewPresenter,
 | 
			
		||||
            touchgfx::meta::Nil > >
 | 
			
		||||
            touchgfx::meta::TypeList< DebugViewPresenter,
 | 
			
		||||
            touchgfx::meta::Nil > > >
 | 
			
		||||
            > GeneratedPresenterTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -81,7 +85,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    virtual void gotoStartScreen(FrontendApplication& app)
 | 
			
		||||
    {
 | 
			
		||||
        app.gotoDriverViewScreenNoTransition();
 | 
			
		||||
        app.gotoMissionSelectScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app)
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,33 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef DEBUGVIEWITEMBASE_HPP
 | 
			
		||||
#define DEBUGVIEWITEMBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
 | 
			
		||||
 | 
			
		||||
class DebugViewItemBase : public touchgfx::Container
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    DebugViewItemBase();
 | 
			
		||||
    virtual ~DebugViewItemBase();
 | 
			
		||||
    virtual void initialize();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard label;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard value;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // DEBUGVIEWITEMBASE_HPP
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef DEBUGVIEWLINEBASE_HPP
 | 
			
		||||
#define DEBUGVIEWLINEBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Line.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
#include <gui/containers/DebugViewItem.hpp>
 | 
			
		||||
 | 
			
		||||
class DebugViewLineBase : public touchgfx::Container
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    DebugViewLineBase();
 | 
			
		||||
    virtual ~DebugViewLineBase();
 | 
			
		||||
    virtual void initialize();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box bg;
 | 
			
		||||
    touchgfx::Line line1;
 | 
			
		||||
    touchgfx::PainterRGB565 line1Painter;
 | 
			
		||||
    touchgfx::Line line2;
 | 
			
		||||
    touchgfx::PainterRGB565 line2Painter;
 | 
			
		||||
    DebugViewItem item1;
 | 
			
		||||
    DebugViewItem item2;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // DEBUGVIEWLINEBASE_HPP
 | 
			
		||||
@ -7,7 +7,6 @@
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/BoxWithBorder.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextArea.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
 | 
			
		||||
 | 
			
		||||
class DriverViewFieldBase : public touchgfx::Container
 | 
			
		||||
@ -26,7 +25,7 @@ protected:
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::BoxWithBorder box;
 | 
			
		||||
    touchgfx::TextArea title;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard title;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard value;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextArea.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Line.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,7 @@ protected:
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box bg;
 | 
			
		||||
    touchgfx::TextArea name;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard name;
 | 
			
		||||
    touchgfx::Line line1;
 | 
			
		||||
    touchgfx::PainterRGB565 line1Painter;
 | 
			
		||||
    touchgfx::Line line2;
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,62 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef DEBUGVIEWVIEWBASE_HPP
 | 
			
		||||
#define DEBUGVIEWVIEWBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <mvp/View.hpp>
 | 
			
		||||
#include <gui/debugview_screen/DebugViewPresenter.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/containers/scrollers/ScrollList.hpp>
 | 
			
		||||
#include <gui/containers/DebugViewLine.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Line.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
 | 
			
		||||
class DebugViewViewBase : public touchgfx::View<DebugViewPresenter>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    DebugViewViewBase();
 | 
			
		||||
    virtual ~DebugViewViewBase();
 | 
			
		||||
    virtual void setupScreen();
 | 
			
		||||
 | 
			
		||||
    virtual void listUpdateItem(DebugViewLine& item, int16_t itemIndex)
 | 
			
		||||
    {
 | 
			
		||||
        // Override and implement this function in DebugView
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box __background;
 | 
			
		||||
    touchgfx::ScrollList list;
 | 
			
		||||
    touchgfx::DrawableListItems<DebugViewLine, 13> listListItems;
 | 
			
		||||
    touchgfx::Line line1;
 | 
			
		||||
    touchgfx::PainterRGB565 line1Painter;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Canvas Buffer Size
 | 
			
		||||
     */
 | 
			
		||||
    static const uint32_t CANVAS_BUFFER_SIZE = 7200;
 | 
			
		||||
    uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Callback Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Callback<DebugViewViewBase, touchgfx::DrawableListItemsInterface*, int16_t, int16_t> updateItemCallback;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Callback Handler Declarations
 | 
			
		||||
     */
 | 
			
		||||
    void updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex);
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // DEBUGVIEWVIEWBASE_HPP
 | 
			
		||||
@ -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 >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AMI
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoAMIScreenNoTransition()
 | 
			
		||||
@ -58,3 +73,16 @@ void FrontendApplicationBase::gotoDriverViewScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<DriverViewView, DriverViewPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DebugView
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoDebugViewScreenNoTransition()
 | 
			
		||||
{
 | 
			
		||||
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoDebugViewScreenNoTransitionImpl);
 | 
			
		||||
    pendingScreenTransitionCallback = &transitionCallback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoDebugViewScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<DebugViewView, DebugViewPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -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();
 | 
			
		||||
}
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -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();
 | 
			
		||||
    
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user