Get started on driver view
This commit is contained in:
		@ -26,6 +26,9 @@ public:
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // DriverView
 | 
			
		||||
    void gotoDriverViewScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    touchgfx::Callback<FrontendApplicationBase> transitionCallback;
 | 
			
		||||
    FrontendHeap& frontendHeap;
 | 
			
		||||
@ -36,6 +39,9 @@ protected:
 | 
			
		||||
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // DriverView
 | 
			
		||||
    void gotoDriverViewScreenNoTransitionImpl();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,8 @@
 | 
			
		||||
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
 | 
			
		||||
#include <gui/ami_screen/AMIView.hpp>
 | 
			
		||||
#include <gui/ami_screen/AMIPresenter.hpp>
 | 
			
		||||
#include <gui/driverview_screen/DriverViewView.hpp>
 | 
			
		||||
#include <gui/driverview_screen/DriverViewPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -40,7 +42,8 @@ public:
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::TypeList< MissionSelectView,
 | 
			
		||||
            touchgfx::meta::TypeList< AMIView,
 | 
			
		||||
            touchgfx::meta::Nil >
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewView,
 | 
			
		||||
            touchgfx::meta::Nil > >
 | 
			
		||||
            > GeneratedViewTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -54,7 +57,8 @@ public:
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::TypeList< MissionSelectPresenter,
 | 
			
		||||
            touchgfx::meta::TypeList< AMIPresenter,
 | 
			
		||||
            touchgfx::meta::Nil >
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewPresenter,
 | 
			
		||||
            touchgfx::meta::Nil > >
 | 
			
		||||
            > GeneratedPresenterTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,34 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef TIRETEMPBASE_HPP
 | 
			
		||||
#define TIRETEMPBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
 | 
			
		||||
 | 
			
		||||
class TireTempBase : public touchgfx::Container
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    TireTempBase();
 | 
			
		||||
    virtual ~TireTempBase();
 | 
			
		||||
    virtual void initialize();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box bg;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard value;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // TIRETEMPBASE_HPP
 | 
			
		||||
@ -0,0 +1,57 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef DRIVERVIEWVIEWBASE_HPP
 | 
			
		||||
#define DRIVERVIEWVIEWBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <mvp/View.hpp>
 | 
			
		||||
#include <gui/driverview_screen/DriverViewPresenter.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Image.hpp>
 | 
			
		||||
#include <gui/containers/TireTemp.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Line.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
#include <touchgfx/containers/progress_indicators/LineProgress.hpp>
 | 
			
		||||
 | 
			
		||||
class DriverViewViewBase : public touchgfx::View<DriverViewPresenter>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    DriverViewViewBase();
 | 
			
		||||
    virtual ~DriverViewViewBase();
 | 
			
		||||
    virtual void setupScreen();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box __background;
 | 
			
		||||
    touchgfx::Image logo;
 | 
			
		||||
    TireTemp tireTempRR;
 | 
			
		||||
    TireTemp tireTempFR;
 | 
			
		||||
    TireTemp tireTempRL;
 | 
			
		||||
    TireTemp tireTempFL;
 | 
			
		||||
    touchgfx::Line ttDivVert;
 | 
			
		||||
    touchgfx::PainterRGB565 ttDivVertPainter;
 | 
			
		||||
    touchgfx::Line ttDivHoriz;
 | 
			
		||||
    touchgfx::PainterRGB565 ttDivHorizPainter;
 | 
			
		||||
    touchgfx::LineProgress tsVoltage;
 | 
			
		||||
    touchgfx::PainterRGB565 tsVoltagePainter;
 | 
			
		||||
    touchgfx::LineProgress lvVoltage;
 | 
			
		||||
    touchgfx::PainterRGB565 lvVoltagePainter;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Canvas Buffer Size
 | 
			
		||||
     */
 | 
			
		||||
    static const uint32_t CANVAS_BUFFER_SIZE = 7200;
 | 
			
		||||
    uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // DRIVERVIEWVIEWBASE_HPP
 | 
			
		||||
@ -13,6 +13,8 @@
 | 
			
		||||
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
 | 
			
		||||
#include <gui/ami_screen/AMIView.hpp>
 | 
			
		||||
#include <gui/ami_screen/AMIPresenter.hpp>
 | 
			
		||||
#include <gui/driverview_screen/DriverViewView.hpp>
 | 
			
		||||
#include <gui/driverview_screen/DriverViewPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
using namespace touchgfx;
 | 
			
		||||
 | 
			
		||||
@ -56,3 +58,16 @@ void FrontendApplicationBase::gotoAMIScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<AMIView, AMIPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DriverView
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoDriverViewScreenNoTransition()
 | 
			
		||||
{
 | 
			
		||||
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoDriverViewScreenNoTransitionImpl);
 | 
			
		||||
    pendingScreenTransitionCallback = &transitionCallback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoDriverViewScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<DriverViewView, DriverViewPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,31 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <gui_generated/containers/TireTempBase.hpp>
 | 
			
		||||
#include <touchgfx/Color.hpp>
 | 
			
		||||
#include <texts/TextKeysAndLanguages.hpp>
 | 
			
		||||
 | 
			
		||||
TireTempBase::TireTempBase()
 | 
			
		||||
{
 | 
			
		||||
    setWidth(75);
 | 
			
		||||
    setHeight(75);
 | 
			
		||||
    bg.setPosition(0, 0, 75, 75);
 | 
			
		||||
    bg.setColor(touchgfx::Color::getColorFromRGB(0, 38, 255));
 | 
			
		||||
    add(bg);
 | 
			
		||||
 | 
			
		||||
    value.setPosition(0, 7, 75, 60);
 | 
			
		||||
    value.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    value.setLinespacing(0);
 | 
			
		||||
    value.setTypedText(touchgfx::TypedText(T___SINGLEUSE_20H3));
 | 
			
		||||
    add(value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TireTempBase::~TireTempBase()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TireTempBase::initialize()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,89 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <gui_generated/driverview_screen/DriverViewViewBase.hpp>
 | 
			
		||||
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
 | 
			
		||||
#include <touchgfx/Color.hpp>
 | 
			
		||||
#include <images/BitmapDatabase.hpp>
 | 
			
		||||
 | 
			
		||||
DriverViewViewBase::DriverViewViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
 | 
			
		||||
    
 | 
			
		||||
    __background.setPosition(0, 0, 480, 320);
 | 
			
		||||
    __background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
 | 
			
		||||
    add(__background);
 | 
			
		||||
 | 
			
		||||
    logo.setXY(160, 263);
 | 
			
		||||
    logo.setBitmap(touchgfx::Bitmap(BITMAP_FASTTUBE_LOGO_SMALL_WHITE_ID));
 | 
			
		||||
    add(logo);
 | 
			
		||||
 | 
			
		||||
    tireTempRR.setXY(240, 167);
 | 
			
		||||
    add(tireTempRR);
 | 
			
		||||
 | 
			
		||||
    tireTempFR.setXY(240, 92);
 | 
			
		||||
    add(tireTempFR);
 | 
			
		||||
 | 
			
		||||
    tireTempRL.setXY(165, 167);
 | 
			
		||||
    add(tireTempRL);
 | 
			
		||||
 | 
			
		||||
    tireTempFL.setXY(165, 92);
 | 
			
		||||
    add(tireTempFL);
 | 
			
		||||
 | 
			
		||||
    ttDivVert.setPosition(239, 92, 3, 150);
 | 
			
		||||
    ttDivVertPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    ttDivVert.setPainter(ttDivVertPainter);
 | 
			
		||||
    ttDivVert.setStart(0, 0);
 | 
			
		||||
    ttDivVert.setEnd(0, 320);
 | 
			
		||||
    ttDivVert.setLineWidth(10);
 | 
			
		||||
    ttDivVert.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
 | 
			
		||||
    add(ttDivVert);
 | 
			
		||||
 | 
			
		||||
    ttDivHoriz.setPosition(165, 166, 150, 3);
 | 
			
		||||
    ttDivHorizPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    ttDivHoriz.setPainter(ttDivHorizPainter);
 | 
			
		||||
    ttDivHoriz.setStart(0, 0);
 | 
			
		||||
    ttDivHoriz.setEnd(480, 0);
 | 
			
		||||
    ttDivHoriz.setLineWidth(10);
 | 
			
		||||
    ttDivHoriz.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
 | 
			
		||||
    add(ttDivHoriz);
 | 
			
		||||
 | 
			
		||||
    tsVoltage.setXY(10, 92);
 | 
			
		||||
    tsVoltage.setProgressIndicatorPosition(0, 0, 40, 150);
 | 
			
		||||
    tsVoltage.setRange(0, 100);
 | 
			
		||||
    tsVoltage.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID));
 | 
			
		||||
    tsVoltagePainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0));
 | 
			
		||||
    tsVoltage.setPainter(tsVoltagePainter);
 | 
			
		||||
    tsVoltage.setStart(9, 200);
 | 
			
		||||
    tsVoltage.setEnd(9, 0);
 | 
			
		||||
    tsVoltage.setLineWidth(100);
 | 
			
		||||
    tsVoltage.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING);
 | 
			
		||||
    tsVoltage.setValue(60);
 | 
			
		||||
    add(tsVoltage);
 | 
			
		||||
 | 
			
		||||
    lvVoltage.setXY(88, 92);
 | 
			
		||||
    lvVoltage.setProgressIndicatorPosition(0, 0, 40, 150);
 | 
			
		||||
    lvVoltage.setRange(0, 100);
 | 
			
		||||
    lvVoltage.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID));
 | 
			
		||||
    lvVoltagePainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0));
 | 
			
		||||
    lvVoltage.setPainter(lvVoltagePainter);
 | 
			
		||||
    lvVoltage.setStart(9, 200);
 | 
			
		||||
    lvVoltage.setEnd(9, 0);
 | 
			
		||||
    lvVoltage.setLineWidth(100);
 | 
			
		||||
    lvVoltage.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING);
 | 
			
		||||
    lvVoltage.setValue(80);
 | 
			
		||||
    add(lvVoltage);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DriverViewViewBase::~DriverViewViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::resetBuffer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DriverViewViewBase::setupScreen()
 | 
			
		||||
{
 | 
			
		||||
    tireTempRR.initialize();
 | 
			
		||||
    tireTempFR.initialize();
 | 
			
		||||
    tireTempRL.initialize();
 | 
			
		||||
    tireTempFL.initialize();
 | 
			
		||||
}
 | 
			
		||||
@ -102,10 +102,19 @@ void MissionSelectViewBase::handleKeyEvent(uint8_t key)
 | 
			
		||||
 | 
			
		||||
    if(254 == key)
 | 
			
		||||
    {
 | 
			
		||||
        //DummyChange
 | 
			
		||||
        //DummyChangeAMI
 | 
			
		||||
        //When hardware button 254 clicked change screen to AMI
 | 
			
		||||
        //Go to AMI with no screen transition
 | 
			
		||||
        application().gotoAMIScreenNoTransition();
 | 
			
		||||
    
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(253 == key)
 | 
			
		||||
    {
 | 
			
		||||
        //DummyChangeDriverView
 | 
			
		||||
        //When hardware button 253 clicked change screen to DriverView
 | 
			
		||||
        //Go to DriverView with no screen transition
 | 
			
		||||
        application().gotoDriverViewScreenNoTransition();
 | 
			
		||||
    
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user