Display steering angle, speed & cones in AMI
This commit is contained in:
		@ -10,6 +10,10 @@
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Image.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextArea.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
 | 
			
		||||
#include <touchgfx/containers/Container.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Shape.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
 | 
			
		||||
class AMIViewBase : public touchgfx::View<AMIPresenter>
 | 
			
		||||
{
 | 
			
		||||
@ -28,11 +32,47 @@ protected:
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box __background;
 | 
			
		||||
    touchgfx::Image logo;
 | 
			
		||||
    touchgfx::TextArea title;
 | 
			
		||||
    touchgfx::TextArea currentMission;
 | 
			
		||||
    touchgfx::TextArea textArea1;
 | 
			
		||||
    touchgfx::TextArea textArea2;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard desiredAngle;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard measuredAngle;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard measuredSpeed;
 | 
			
		||||
    touchgfx::TextAreaWithOneWildcard desiredSpeed;
 | 
			
		||||
    touchgfx::TextArea textArea4;
 | 
			
		||||
    touchgfx::TextArea textArea3;
 | 
			
		||||
    touchgfx::Container map;
 | 
			
		||||
    touchgfx::Shape<3> cone0;
 | 
			
		||||
    touchgfx::PainterRGB565 cone0Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone1;
 | 
			
		||||
    touchgfx::PainterRGB565 cone1Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone2;
 | 
			
		||||
    touchgfx::PainterRGB565 cone2Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone3;
 | 
			
		||||
    touchgfx::PainterRGB565 cone3Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone4;
 | 
			
		||||
    touchgfx::PainterRGB565 cone4Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone5;
 | 
			
		||||
    touchgfx::PainterRGB565 cone5Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone6;
 | 
			
		||||
    touchgfx::PainterRGB565 cone6Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone7;
 | 
			
		||||
    touchgfx::PainterRGB565 cone7Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone8;
 | 
			
		||||
    touchgfx::PainterRGB565 cone8Painter;
 | 
			
		||||
    touchgfx::Shape<3> cone9;
 | 
			
		||||
    touchgfx::PainterRGB565 cone9Painter;
 | 
			
		||||
    touchgfx::Shape<3> ft;
 | 
			
		||||
    touchgfx::PainterRGB565 ftPainter;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Canvas Buffer Size
 | 
			
		||||
     */
 | 
			
		||||
    static const uint32_t CANVAS_BUFFER_SIZE = 7200;
 | 
			
		||||
    uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // AMIVIEWBASE_HPP
 | 
			
		||||
 | 
			
		||||
@ -17,9 +17,12 @@ public:
 | 
			
		||||
 | 
			
		||||
    virtual void changeToStartScreen()
 | 
			
		||||
    {
 | 
			
		||||
        gotoDriverViewScreenNoTransition();
 | 
			
		||||
        gotoMissionSelectScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // MissionSelect
 | 
			
		||||
    void gotoMissionSelectScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
@ -37,6 +40,9 @@ protected:
 | 
			
		||||
    FrontendHeap& frontendHeap;
 | 
			
		||||
    Model& model;
 | 
			
		||||
 | 
			
		||||
    // MissionSelect
 | 
			
		||||
    void gotoMissionSelectScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
    // AMI
 | 
			
		||||
    void gotoAMIScreenNoTransitionImpl();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -89,7 +89,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    virtual void gotoStartScreen(FrontendApplication& app)
 | 
			
		||||
    {
 | 
			
		||||
        app.gotoDriverViewScreenNoTransition();
 | 
			
		||||
        app.gotoMissionSelectScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app)
 | 
			
		||||
 | 
			
		||||
@ -2,36 +2,205 @@
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <gui_generated/ami_screen/AMIViewBase.hpp>
 | 
			
		||||
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
 | 
			
		||||
#include <touchgfx/Color.hpp>
 | 
			
		||||
#include <images/BitmapDatabase.hpp>
 | 
			
		||||
#include <texts/TextKeysAndLanguages.hpp>
 | 
			
		||||
 | 
			
		||||
AMIViewBase::AMIViewBase()
 | 
			
		||||
{
 | 
			
		||||
    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, 266);
 | 
			
		||||
    logo.setBitmap(touchgfx::Bitmap(BITMAP_LOGO_DV_SMALL_WHITE_ID));
 | 
			
		||||
    logo.setVisible(false);
 | 
			
		||||
    add(logo);
 | 
			
		||||
 | 
			
		||||
    title.setXY(42, 20);
 | 
			
		||||
    title.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    title.setLinespacing(0);
 | 
			
		||||
    title.setTypedText(touchgfx::TypedText(T___SINGLEUSE_SDGP));
 | 
			
		||||
    add(title);
 | 
			
		||||
 | 
			
		||||
    currentMission.setPosition(0, 130, 480, 49);
 | 
			
		||||
    currentMission.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    currentMission.setPosition(0, 15, 480, 49);
 | 
			
		||||
    currentMission.setColor(touchgfx::Color::getColorFromRGB(197, 14, 31));
 | 
			
		||||
    currentMission.setLinespacing(0);
 | 
			
		||||
    currentMission.setTypedText(touchgfx::TypedText(T_INVALID_HUGE));
 | 
			
		||||
    add(currentMission);
 | 
			
		||||
 | 
			
		||||
    textArea1.setXY(273, 103);
 | 
			
		||||
    textArea1.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    textArea1.setLinespacing(0);
 | 
			
		||||
    textArea1.setTypedText(touchgfx::TypedText(T___SINGLEUSE_3MDX));
 | 
			
		||||
    add(textArea1);
 | 
			
		||||
 | 
			
		||||
    textArea2.setXY(273, 135);
 | 
			
		||||
    textArea2.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    textArea2.setLinespacing(0);
 | 
			
		||||
    textArea2.setTypedText(touchgfx::TypedText(T___SINGLEUSE_JFR7));
 | 
			
		||||
    add(textArea2);
 | 
			
		||||
 | 
			
		||||
    desiredAngle.setPosition(405, 104, 60, 23);
 | 
			
		||||
    desiredAngle.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    desiredAngle.setLinespacing(0);
 | 
			
		||||
    desiredAngle.setTypedText(touchgfx::TypedText(T___SINGLEUSE_232C));
 | 
			
		||||
    add(desiredAngle);
 | 
			
		||||
 | 
			
		||||
    measuredAngle.setPosition(405, 136, 60, 23);
 | 
			
		||||
    measuredAngle.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    measuredAngle.setLinespacing(0);
 | 
			
		||||
    measuredAngle.setTypedText(touchgfx::TypedText(T___SINGLEUSE_LLOZ));
 | 
			
		||||
    add(measuredAngle);
 | 
			
		||||
 | 
			
		||||
    measuredSpeed.setPosition(405, 199, 60, 23);
 | 
			
		||||
    measuredSpeed.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    measuredSpeed.setLinespacing(0);
 | 
			
		||||
    measuredSpeed.setTypedText(touchgfx::TypedText(T___SINGLEUSE_2S21));
 | 
			
		||||
    add(measuredSpeed);
 | 
			
		||||
 | 
			
		||||
    desiredSpeed.setPosition(405, 167, 60, 23);
 | 
			
		||||
    desiredSpeed.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    desiredSpeed.setLinespacing(0);
 | 
			
		||||
    desiredSpeed.setTypedText(touchgfx::TypedText(T___SINGLEUSE_OQ6P));
 | 
			
		||||
    add(desiredSpeed);
 | 
			
		||||
 | 
			
		||||
    textArea4.setXY(273, 198);
 | 
			
		||||
    textArea4.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    textArea4.setLinespacing(0);
 | 
			
		||||
    textArea4.setTypedText(touchgfx::TypedText(T___SINGLEUSE_590R));
 | 
			
		||||
    add(textArea4);
 | 
			
		||||
 | 
			
		||||
    textArea3.setXY(273, 166);
 | 
			
		||||
    textArea3.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    textArea3.setLinespacing(0);
 | 
			
		||||
    textArea3.setTypedText(touchgfx::TypedText(T___SINGLEUSE_Z78U));
 | 
			
		||||
    add(textArea3);
 | 
			
		||||
 | 
			
		||||
    map.setPosition(15, 103, 255, 202);
 | 
			
		||||
    cone0.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone0.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone0.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone0.setAngle(0.0f);
 | 
			
		||||
    cone0Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone0.setPainter(cone0Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone0Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone0.setShape(cone0Points);
 | 
			
		||||
    cone0.setVisible(false);
 | 
			
		||||
    map.add(cone0);
 | 
			
		||||
 | 
			
		||||
    cone1.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone1.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone1.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone1.setAngle(0.0f);
 | 
			
		||||
    cone1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone1.setPainter(cone1Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone1Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone1.setShape(cone1Points);
 | 
			
		||||
    cone1.setVisible(false);
 | 
			
		||||
    map.add(cone1);
 | 
			
		||||
 | 
			
		||||
    cone2.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone2.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone2.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone2.setAngle(0.0f);
 | 
			
		||||
    cone2Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone2.setPainter(cone2Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone2Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone2.setShape(cone2Points);
 | 
			
		||||
    cone2.setVisible(false);
 | 
			
		||||
    map.add(cone2);
 | 
			
		||||
 | 
			
		||||
    cone3.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone3.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone3.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone3.setAngle(0.0f);
 | 
			
		||||
    cone3Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone3.setPainter(cone3Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone3Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone3.setShape(cone3Points);
 | 
			
		||||
    cone3.setVisible(false);
 | 
			
		||||
    map.add(cone3);
 | 
			
		||||
 | 
			
		||||
    cone4.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone4.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone4.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone4.setAngle(0.0f);
 | 
			
		||||
    cone4Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone4.setPainter(cone4Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone4Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone4.setShape(cone4Points);
 | 
			
		||||
    cone4.setVisible(false);
 | 
			
		||||
    map.add(cone4);
 | 
			
		||||
 | 
			
		||||
    cone5.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone5.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone5.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone5.setAngle(0.0f);
 | 
			
		||||
    cone5Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone5.setPainter(cone5Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone5Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone5.setShape(cone5Points);
 | 
			
		||||
    cone5.setVisible(false);
 | 
			
		||||
    map.add(cone5);
 | 
			
		||||
 | 
			
		||||
    cone6.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone6.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone6.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone6.setAngle(0.0f);
 | 
			
		||||
    cone6Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone6.setPainter(cone6Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone6Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone6.setShape(cone6Points);
 | 
			
		||||
    cone6.setVisible(false);
 | 
			
		||||
    map.add(cone6);
 | 
			
		||||
 | 
			
		||||
    cone7.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone7.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone7.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone7.setAngle(0.0f);
 | 
			
		||||
    cone7Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone7.setPainter(cone7Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone7Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone7.setShape(cone7Points);
 | 
			
		||||
    cone7.setVisible(false);
 | 
			
		||||
    map.add(cone7);
 | 
			
		||||
 | 
			
		||||
    cone8.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone8.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone8.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone8.setAngle(0.0f);
 | 
			
		||||
    cone8Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone8.setPainter(cone8Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone8Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone8.setShape(cone8Points);
 | 
			
		||||
    cone8.setVisible(false);
 | 
			
		||||
    map.add(cone8);
 | 
			
		||||
 | 
			
		||||
    cone9.setPosition(0, 0, 10, 10);
 | 
			
		||||
    cone9.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    cone9.setScale(1.0f, 1.0f);
 | 
			
		||||
    cone9.setAngle(0.0f);
 | 
			
		||||
    cone9Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 0));
 | 
			
		||||
    cone9.setPainter(cone9Painter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> cone9Points[3] = { { 0.0f, 0.0f }, { 10.0f, 5.0f }, { 0.0f, 10.0f } };
 | 
			
		||||
    cone9.setShape(cone9Points);
 | 
			
		||||
    cone9.setVisible(false);
 | 
			
		||||
    map.add(cone9);
 | 
			
		||||
 | 
			
		||||
    ft.setPosition(0, 91, 20, 20);
 | 
			
		||||
    ft.setOrigin(0.0f, 0.0f);
 | 
			
		||||
    ft.setScale(1.0f, 1.0f);
 | 
			
		||||
    ft.setAngle(0.0f);
 | 
			
		||||
    ftPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
 | 
			
		||||
    ft.setPainter(ftPainter);
 | 
			
		||||
    const touchgfx::AbstractShape::ShapePoint<float> ftPoints[3] = { { 0.0f, 0.0f }, { 20.0f, 10.0f }, { 0.0f, 20.0f } };
 | 
			
		||||
    ft.setShape(ftPoints);
 | 
			
		||||
    map.add(ft);
 | 
			
		||||
 | 
			
		||||
    add(map);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AMIViewBase::~AMIViewBase()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::resetBuffer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AMIViewBase::setupScreen()
 | 
			
		||||
 | 
			
		||||
@ -38,6 +38,19 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
 | 
			
		||||
 * Screen Transition Declarations
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
// MissionSelect
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoMissionSelectScreenNoTransition()
 | 
			
		||||
{
 | 
			
		||||
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl);
 | 
			
		||||
    pendingScreenTransitionCallback = &transitionCallback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<MissionSelectView, MissionSelectPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AMI
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoAMIScreenNoTransition()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user