Create Mission Select screen

This commit is contained in:
2023-03-06 23:42:01 +01:00
parent 8a2bdc347c
commit 7476e09fed
76 changed files with 46727 additions and 414 deletions

View File

@ -17,19 +17,19 @@ public:
virtual void changeToStartScreen()
{
gotoscreenScreenNoTransition();
gotoMissionSelectScreenNoTransition();
}
// screen
void gotoscreenScreenNoTransition();
// MissionSelect
void gotoMissionSelectScreenNoTransition();
protected:
touchgfx::Callback<FrontendApplicationBase> transitionCallback;
FrontendHeap& frontendHeap;
Model& model;
// screen
void gotoscreenScreenNoTransitionImpl();
// MissionSelect
void gotoMissionSelectScreenNoTransitionImpl();
};
#endif // FRONTENDAPPLICATIONBASE_HPP

View File

@ -12,8 +12,8 @@
#include <gui/common/FrontendApplication.hpp>
#include <gui/model/Model.hpp>
#include <gui/screen_screen/screenView.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
#include <gui/missionselect_screen/MissionSelectView.hpp>
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
/**
@ -36,7 +36,7 @@ public:
* A list of all view types. Must end with meta::Nil.
* @note All view types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< screenView,
typedef touchgfx::meta::TypeList< MissionSelectView,
touchgfx::meta::Nil
> GeneratedViewTypes;
@ -49,7 +49,7 @@ public:
* A list of all presenter types. Must end with meta::Nil.
* @note All presenter types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< screenPresenter,
typedef touchgfx::meta::TypeList< MissionSelectPresenter,
touchgfx::meta::Nil
> GeneratedPresenterTypes;
@ -73,7 +73,7 @@ public:
virtual void gotoStartScreen(FrontendApplication& app)
{
app.gotoscreenScreenNoTransition();
app.gotoMissionSelectScreenNoTransition();
}
protected:
FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app)

View File

@ -0,0 +1,38 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#ifndef MISSIONSELECTELEMENTBASE_HPP
#define MISSIONSELECTELEMENTBASE_HPP
#include <gui/common/FrontendApplication.hpp>
#include <touchgfx/containers/Container.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/widgets/TextArea.hpp>
#include <touchgfx/widgets/canvas/Line.hpp>
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
class MissionSelectElementBase : public touchgfx::Container
{
public:
MissionSelectElementBase();
virtual ~MissionSelectElementBase();
virtual void initialize();
protected:
FrontendApplication& application() {
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
}
/*
* Member Declarations
*/
touchgfx::Box bg;
touchgfx::TextArea text;
touchgfx::Line line1;
touchgfx::PainterRGB565 line1Painter;
private:
};
#endif // MISSIONSELECTELEMENTBASE_HPP

View File

@ -1,22 +1,23 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#ifndef SCREENVIEWBASE_HPP
#define SCREENVIEWBASE_HPP
#ifndef MISSIONSELECTVIEWBASE_HPP
#define MISSIONSELECTVIEWBASE_HPP
#include <gui/common/FrontendApplication.hpp>
#include <mvp/View.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/widgets/TextArea.hpp>
#include <touchgfx/widgets/canvas/Circle.hpp>
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
#include <touchgfx/containers/ListLayout.hpp>
#include <gui/containers/MissionSelectElement.hpp>
#include <touchgfx/widgets/Image.hpp>
class screenViewBase : public touchgfx::View<screenPresenter>
class MissionSelectViewBase : public touchgfx::View<MissionSelectPresenter>
{
public:
screenViewBase();
virtual ~screenViewBase();
MissionSelectViewBase();
virtual ~MissionSelectViewBase();
virtual void setupScreen();
protected:
@ -28,9 +29,16 @@ protected:
* Member Declarations
*/
touchgfx::Box __background;
touchgfx::TextArea textArea1;
touchgfx::Circle circle1;
touchgfx::PainterRGB565 circle1Painter;
touchgfx::TextArea prompt;
touchgfx::ListLayout missionList;
MissionSelectElement accel;
MissionSelectElement skidpad;
MissionSelectElement autox;
MissionSelectElement trackdrive;
MissionSelectElement ebs;
MissionSelectElement inspection;
MissionSelectElement manual;
touchgfx::Image image1;
private:
@ -42,4 +50,4 @@ private:
};
#endif // SCREENVIEWBASE_HPP
#endif // MISSIONSELECTVIEWBASE_HPP

View File

@ -9,8 +9,8 @@
#include <touchgfx/Texts.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <platform/driver/lcd/LCD16bpp.hpp>
#include <gui/screen_screen/screenView.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
#include <gui/missionselect_screen/MissionSelectView.hpp>
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
using namespace touchgfx;
@ -29,15 +29,15 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
* Screen Transition Declarations
*/
// screen
// MissionSelect
void FrontendApplicationBase::gotoscreenScreenNoTransition()
void FrontendApplicationBase::gotoMissionSelectScreenNoTransition()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoscreenScreenNoTransitionImpl);
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoMissionSelectScreenNoTransitionImpl);
pendingScreenTransitionCallback = &transitionCallback;
}
void FrontendApplicationBase::gotoscreenScreenNoTransitionImpl()
void FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl()
{
touchgfx::makeTransition<screenView, screenPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
touchgfx::makeTransition<MissionSelectView, MissionSelectPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

View File

@ -0,0 +1,40 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/containers/MissionSelectElementBase.hpp>
#include <touchgfx/Color.hpp>
#include <texts/TextKeysAndLanguages.hpp>
MissionSelectElementBase::MissionSelectElementBase()
{
setWidth(480);
setHeight(30);
bg.setPosition(0, 0, 480, 30);
bg.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(bg);
text.setPosition(0, 3, 480, 25);
text.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
text.setLinespacing(0);
text.setTypedText(touchgfx::TypedText(T___SINGLEUSE_M5X7));
add(text);
line1.setPosition(0, 0, 480, 2);
line1Painter.setColor(touchgfx::Color::getColorFromRGB(170, 170, 170));
line1.setPainter(line1Painter);
line1.setStart(0, 0);
line1.setEnd(480, 0);
line1.setLineWidth(5);
line1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
add(line1);
}
MissionSelectElementBase::~MissionSelectElementBase()
{
}
void MissionSelectElementBase::initialize()
{
}

View File

@ -0,0 +1,62 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/missionselect_screen/MissionSelectViewBase.hpp>
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#include <touchgfx/Color.hpp>
#include <texts/TextKeysAndLanguages.hpp>
#include <images/BitmapDatabase.hpp>
MissionSelectViewBase::MissionSelectViewBase()
{
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
__background.setPosition(0, 0, 480, 320);
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(__background);
prompt.setXY(41, 0);
prompt.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
prompt.setLinespacing(0);
prompt.setTypedText(touchgfx::TypedText(T___SINGLEUSE_6GPV));
add(prompt);
missionList.setXY(0, 48);
missionList.setDirection(touchgfx::SOUTH);
missionList.add(accel);
missionList.add(skidpad);
missionList.add(autox);
missionList.add(trackdrive);
missionList.add(ebs);
missionList.add(inspection);
missionList.add(manual);
add(missionList);
image1.setXY(160, 263);
image1.setBitmap(touchgfx::Bitmap(BITMAP_FASTTUBE_LOGO_SMALL_WHITE_ID));
add(image1);
}
MissionSelectViewBase::~MissionSelectViewBase()
{
touchgfx::CanvasWidgetRenderer::resetBuffer();
}
void MissionSelectViewBase::setupScreen()
{
accel.initialize();
skidpad.initialize();
autox.initialize();
trackdrive.initialize();
ebs.initialize();
inspection.initialize();
manual.initialize();
}

View File

@ -1,41 +0,0 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/screen_screen/screenViewBase.hpp>
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
#include <touchgfx/Color.hpp>
#include <texts/TextKeysAndLanguages.hpp>
screenViewBase::screenViewBase()
{
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
__background.setPosition(0, 0, 480, 320);
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(__background);
textArea1.setXY(190, 29);
textArea1.setColor(touchgfx::Color::getColorFromRGB(255, 0, 0));
textArea1.setLinespacing(0);
textArea1.setTypedText(touchgfx::TypedText(T___SINGLEUSE_6GPV));
add(textArea1);
circle1.setPosition(97, 120, 80, 80);
circle1.setCenter(40, 40);
circle1.setRadius(40);
circle1.setLineWidth(0);
circle1.setArc(0, 360);
circle1Painter.setColor(touchgfx::Color::getColorFromRGB(3, 255, 226));
circle1.setPainter(circle1Painter);
add(circle1);
}
screenViewBase::~screenViewBase()
{
touchgfx::CanvasWidgetRenderer::resetBuffer();
}
void screenViewBase::setupScreen()
{
}