[WIP] SDC screen
This hasn't really been tested yet and sometimes looks weird.
This commit is contained in:
		@ -35,6 +35,9 @@ public:
 | 
			
		||||
    // VehicleConfig
 | 
			
		||||
    void gotoVehicleConfigScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // SDC
 | 
			
		||||
    void gotoSDCScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    touchgfx::Callback<FrontendApplicationBase> transitionCallback;
 | 
			
		||||
    FrontendHeap& frontendHeap;
 | 
			
		||||
@ -54,6 +57,9 @@ protected:
 | 
			
		||||
 | 
			
		||||
    // VehicleConfig
 | 
			
		||||
    void gotoVehicleConfigScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // SDC
 | 
			
		||||
    void gotoSDCScreenNoTransitionImpl();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
 | 
			
		||||
@ -22,6 +22,8 @@
 | 
			
		||||
#include <gui/debugview_screen/DebugViewPresenter.hpp>
 | 
			
		||||
#include <gui/vehicleconfig_screen/VehicleConfigView.hpp>
 | 
			
		||||
#include <gui/vehicleconfig_screen/VehicleConfigPresenter.hpp>
 | 
			
		||||
#include <gui/sdc_screen/SDCView.hpp>
 | 
			
		||||
#include <gui/sdc_screen/SDCPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -49,7 +51,8 @@ public:
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewView,
 | 
			
		||||
            touchgfx::meta::TypeList< DebugViewView,
 | 
			
		||||
            touchgfx::meta::TypeList< VehicleConfigView,
 | 
			
		||||
            touchgfx::meta::Nil > > > >
 | 
			
		||||
            touchgfx::meta::TypeList< SDCView,
 | 
			
		||||
            touchgfx::meta::Nil > > > > >
 | 
			
		||||
            > GeneratedViewTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -66,7 +69,8 @@ public:
 | 
			
		||||
            touchgfx::meta::TypeList< DriverViewPresenter,
 | 
			
		||||
            touchgfx::meta::TypeList< DebugViewPresenter,
 | 
			
		||||
            touchgfx::meta::TypeList< VehicleConfigPresenter,
 | 
			
		||||
            touchgfx::meta::Nil > > > >
 | 
			
		||||
            touchgfx::meta::TypeList< SDCPresenter,
 | 
			
		||||
            touchgfx::meta::Nil > > > > >
 | 
			
		||||
            > GeneratedPresenterTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,56 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef SDCVIEWBASE_HPP
 | 
			
		||||
#define SDCVIEWBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <mvp/View.hpp>
 | 
			
		||||
#include <gui/sdc_screen/SDCPresenter.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextArea.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Line.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
 | 
			
		||||
class SDCViewBase : public touchgfx::View<SDCPresenter>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    SDCViewBase();
 | 
			
		||||
    virtual ~SDCViewBase();
 | 
			
		||||
    virtual void setupScreen();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box __background;
 | 
			
		||||
    touchgfx::TextArea pdu;
 | 
			
		||||
    touchgfx::TextArea inertia;
 | 
			
		||||
    touchgfx::TextArea sdcl;
 | 
			
		||||
    touchgfx::TextArea hvb;
 | 
			
		||||
    touchgfx::TextArea tsms;
 | 
			
		||||
    touchgfx::TextArea acc;
 | 
			
		||||
    touchgfx::TextArea imd;
 | 
			
		||||
    touchgfx::TextArea ams;
 | 
			
		||||
    touchgfx::Line line1;
 | 
			
		||||
    touchgfx::PainterRGB565 line1Painter;
 | 
			
		||||
    touchgfx::Line line2;
 | 
			
		||||
    touchgfx::PainterRGB565 line2Painter;
 | 
			
		||||
    touchgfx::Line line3;
 | 
			
		||||
    touchgfx::PainterRGB565 line3Painter;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Canvas Buffer Size
 | 
			
		||||
     */
 | 
			
		||||
    static const uint32_t CANVAS_BUFFER_SIZE = 7200;
 | 
			
		||||
    uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // SDCVIEWBASE_HPP
 | 
			
		||||
@ -19,6 +19,8 @@
 | 
			
		||||
#include <gui/debugview_screen/DebugViewPresenter.hpp>
 | 
			
		||||
#include <gui/vehicleconfig_screen/VehicleConfigView.hpp>
 | 
			
		||||
#include <gui/vehicleconfig_screen/VehicleConfigPresenter.hpp>
 | 
			
		||||
#include <gui/sdc_screen/SDCView.hpp>
 | 
			
		||||
#include <gui/sdc_screen/SDCPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
using namespace touchgfx;
 | 
			
		||||
 | 
			
		||||
@ -102,3 +104,16 @@ void FrontendApplicationBase::gotoVehicleConfigScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<VehicleConfigView, VehicleConfigPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SDC
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoSDCScreenNoTransition()
 | 
			
		||||
{
 | 
			
		||||
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplicationBase::gotoSDCScreenNoTransitionImpl);
 | 
			
		||||
    pendingScreenTransitionCallback = &transitionCallback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoSDCScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<SDCView, SDCPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -135,4 +135,13 @@ void MissionSelectViewBase::handleKeyEvent(uint8_t key)
 | 
			
		||||
        application().gotoVehicleConfigScreenNoTransition();
 | 
			
		||||
    
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(250 == key)
 | 
			
		||||
    {
 | 
			
		||||
        //DummyChangeSDCView
 | 
			
		||||
        //When hardware button 250 clicked change screen to SDC
 | 
			
		||||
        //Go to SDC with no screen transition
 | 
			
		||||
        application().gotoSDCScreenNoTransition();
 | 
			
		||||
    
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										101
									
								
								TouchGFX/generated/gui_generated/src/sdc_screen/SDCViewBase.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								TouchGFX/generated/gui_generated/src/sdc_screen/SDCViewBase.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,101 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <gui_generated/sdc_screen/SDCViewBase.hpp>
 | 
			
		||||
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
 | 
			
		||||
#include <touchgfx/Color.hpp>
 | 
			
		||||
#include <texts/TextKeysAndLanguages.hpp>
 | 
			
		||||
 | 
			
		||||
SDCViewBase::SDCViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
 | 
			
		||||
    
 | 
			
		||||
    __background.setPosition(0, 0, 480, 320);
 | 
			
		||||
    __background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
 | 
			
		||||
    add(__background);
 | 
			
		||||
 | 
			
		||||
    pdu.setXY(15, 40);
 | 
			
		||||
    pdu.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    pdu.setLinespacing(0);
 | 
			
		||||
    pdu.setTypedText(touchgfx::TypedText(T___SINGLEUSE_YRU7));
 | 
			
		||||
    add(pdu);
 | 
			
		||||
 | 
			
		||||
    inertia.setXY(128, 40);
 | 
			
		||||
    inertia.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    inertia.setLinespacing(0);
 | 
			
		||||
    inertia.setTypedText(touchgfx::TypedText(T___SINGLEUSE_43KA));
 | 
			
		||||
    add(inertia);
 | 
			
		||||
 | 
			
		||||
    sdcl.setPosition(363, 217, 102, 72);
 | 
			
		||||
    sdcl.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    sdcl.setLinespacing(0);
 | 
			
		||||
    sdcl.setTypedText(touchgfx::TypedText(T___SINGLEUSE_QNHI));
 | 
			
		||||
    add(sdcl);
 | 
			
		||||
 | 
			
		||||
    hvb.setXY(240, 241);
 | 
			
		||||
    hvb.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    hvb.setLinespacing(0);
 | 
			
		||||
    hvb.setTypedText(touchgfx::TypedText(T___SINGLEUSE_KI1B));
 | 
			
		||||
    add(hvb);
 | 
			
		||||
 | 
			
		||||
    tsms.setXY(120, 265);
 | 
			
		||||
    tsms.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    tsms.setLinespacing(0);
 | 
			
		||||
    tsms.setTypedText(touchgfx::TypedText(T___SINGLEUSE_XC1X));
 | 
			
		||||
    add(tsms);
 | 
			
		||||
 | 
			
		||||
    acc.setXY(15, 265);
 | 
			
		||||
    acc.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    acc.setLinespacing(0);
 | 
			
		||||
    acc.setTypedText(touchgfx::TypedText(T___SINGLEUSE_V38H));
 | 
			
		||||
    add(acc);
 | 
			
		||||
 | 
			
		||||
    imd.setXY(291, 40);
 | 
			
		||||
    imd.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    imd.setLinespacing(0);
 | 
			
		||||
    imd.setTypedText(touchgfx::TypedText(T___SINGLEUSE_N50J));
 | 
			
		||||
    add(imd);
 | 
			
		||||
 | 
			
		||||
    ams.setXY(404, 40);
 | 
			
		||||
    ams.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    ams.setLinespacing(0);
 | 
			
		||||
    ams.setTypedText(touchgfx::TypedText(T___SINGLEUSE_XFW7));
 | 
			
		||||
    add(ams);
 | 
			
		||||
 | 
			
		||||
    line1.setPosition(15, 122, 450, 10);
 | 
			
		||||
    line1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    line1.setPainter(line1Painter);
 | 
			
		||||
    line1.setStart(5, 5);
 | 
			
		||||
    line1.setEnd(450, 5);
 | 
			
		||||
    line1.setLineWidth(10);
 | 
			
		||||
    line1.setLineEndingStyle(touchgfx::Line::SQUARE_CAP_ENDING);
 | 
			
		||||
    add(line1);
 | 
			
		||||
 | 
			
		||||
    line2.setPosition(15, 193, 450, 10);
 | 
			
		||||
    line2Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    line2.setPainter(line2Painter);
 | 
			
		||||
    line2.setStart(10, 5);
 | 
			
		||||
    line2.setEnd(450, 5);
 | 
			
		||||
    line2.setLineWidth(10);
 | 
			
		||||
    line2.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
 | 
			
		||||
    add(line2);
 | 
			
		||||
 | 
			
		||||
    line3.setPosition(455, 122, 10, 81);
 | 
			
		||||
    line3Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    line3.setPainter(line3Painter);
 | 
			
		||||
    line3.setStart(5, 5);
 | 
			
		||||
    line3.setEnd(5, 100);
 | 
			
		||||
    line3.setLineWidth(10);
 | 
			
		||||
    line3.setLineEndingStyle(touchgfx::Line::SQUARE_CAP_ENDING);
 | 
			
		||||
    add(line3);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SDCViewBase::~SDCViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::resetBuffer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SDCViewBase::setupScreen()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user