Add AMI screen

This commit is contained in:
2023-03-07 22:35:12 +01:00
parent d26339e265
commit 81b7a23a34
43 changed files with 1447 additions and 45 deletions

View File

@ -0,0 +1,38 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#ifndef AMIVIEWBASE_HPP
#define AMIVIEWBASE_HPP
#include <gui/common/FrontendApplication.hpp>
#include <mvp/View.hpp>
#include <gui/ami_screen/AMIPresenter.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/widgets/Image.hpp>
#include <touchgfx/widgets/TextArea.hpp>
class AMIViewBase : public touchgfx::View<AMIPresenter>
{
public:
AMIViewBase();
virtual ~AMIViewBase();
virtual void setupScreen();
protected:
FrontendApplication& application() {
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
}
/*
* Member Declarations
*/
touchgfx::Box __background;
touchgfx::Image logo;
touchgfx::TextArea title;
touchgfx::TextArea currentMission;
private:
};
#endif // AMIVIEWBASE_HPP

View File

@ -23,6 +23,9 @@ public:
// MissionSelect
void gotoMissionSelectScreenNoTransition();
// AMI
void gotoAMIScreenNoTransition();
protected:
touchgfx::Callback<FrontendApplicationBase> transitionCallback;
FrontendHeap& frontendHeap;
@ -30,6 +33,9 @@ protected:
// MissionSelect
void gotoMissionSelectScreenNoTransitionImpl();
// AMI
void gotoAMIScreenNoTransitionImpl();
};
#endif // FRONTENDAPPLICATIONBASE_HPP

View File

@ -14,6 +14,8 @@
#include <gui/missionselect_screen/MissionSelectView.hpp>
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
#include <gui/ami_screen/AMIView.hpp>
#include <gui/ami_screen/AMIPresenter.hpp>
/**
@ -37,7 +39,8 @@ public:
* @note All view types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< MissionSelectView,
touchgfx::meta::Nil
touchgfx::meta::TypeList< AMIView,
touchgfx::meta::Nil >
> GeneratedViewTypes;
/**
@ -50,7 +53,8 @@ public:
* @note All presenter types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< MissionSelectPresenter,
touchgfx::meta::Nil
touchgfx::meta::TypeList< AMIPresenter,
touchgfx::meta::Nil >
> GeneratedPresenterTypes;
/**

View File

@ -34,6 +34,10 @@ public:
{
// Override and implement this function in MissionSelect
}
virtual void confirmMission()
{
// Override and implement this function in MissionSelect
}
protected:
FrontendApplication& application() {

View File

@ -0,0 +1,40 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#include <gui_generated/ami_screen/AMIViewBase.hpp>
#include <touchgfx/Color.hpp>
#include <images/BitmapDatabase.hpp>
#include <texts/TextKeysAndLanguages.hpp>
AMIViewBase::AMIViewBase()
{
__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_LOGO_DV_SMALL_WHITE_ID));
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.setLinespacing(0);
currentMission.setTypedText(touchgfx::TypedText(T_INVALID_HUGE));
add(currentMission);
}
AMIViewBase::~AMIViewBase()
{
}
void AMIViewBase::setupScreen()
{
}

View File

@ -11,6 +11,8 @@
#include <platform/driver/lcd/LCD16bpp.hpp>
#include <gui/missionselect_screen/MissionSelectView.hpp>
#include <gui/missionselect_screen/MissionSelectPresenter.hpp>
#include <gui/ami_screen/AMIView.hpp>
#include <gui/ami_screen/AMIPresenter.hpp>
using namespace touchgfx;
@ -41,3 +43,16 @@ void FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl()
{
touchgfx::makeTransition<MissionSelectView, MissionSelectPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}
// AMI
void FrontendApplicationBase::gotoAMIScreenNoTransition()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoAMIScreenNoTransitionImpl);
pendingScreenTransitionCallback = &transitionCallback;
}
void FrontendApplicationBase::gotoAMIScreenNoTransitionImpl()
{
touchgfx::makeTransition<AMIView, AMIPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

View File

@ -38,7 +38,8 @@ MissionSelectViewBase::MissionSelectViewBase()
missionList.add(manual);
lastLine.setPosition(0, 210, 480, 2);
lastLine.setWidth(480);
lastLine.setHeight(2);
lastLinePainter.setColor(touchgfx::Color::getColorFromRGB(170, 170, 170));
lastLine.setPainter(lastLinePainter);
lastLine.setStart(0, 0);
@ -89,4 +90,22 @@ void MissionSelectViewBase::handleKeyEvent(uint8_t key)
decMission();
}
if(6 == key)
{
//ConfirmMission
//When hardware button 6 clicked call virtual function
//Call confirmMission
confirmMission();
}
if(254 == key)
{
//DummyChange
//When hardware button 254 clicked change screen to AMI
//Go to AMI with no screen transition
application().gotoAMIScreenNoTransition();
}
}