130 lines
3.3 KiB
C++
130 lines
3.3 KiB
C++
/*********************************************************************************/
|
|
/********** 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, 15);
|
|
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);
|
|
|
|
lastLine.setWidth(480);
|
|
lastLine.setHeight(2);
|
|
lastLinePainter.setColor(touchgfx::Color::getColorFromRGB(170, 170, 170));
|
|
lastLine.setPainter(lastLinePainter);
|
|
lastLine.setStart(0, 0);
|
|
lastLine.setEnd(480, 0);
|
|
lastLine.setLineWidth(5);
|
|
lastLine.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
|
|
missionList.add(lastLine);
|
|
|
|
add(missionList);
|
|
|
|
logo.setXY(160, 266);
|
|
logo.setBitmap(touchgfx::Bitmap(BITMAP_LOGO_DV_SMALL_WHITE_ID));
|
|
add(logo);
|
|
}
|
|
|
|
MissionSelectViewBase::~MissionSelectViewBase()
|
|
{
|
|
touchgfx::CanvasWidgetRenderer::resetBuffer();
|
|
}
|
|
|
|
void MissionSelectViewBase::setupScreen()
|
|
{
|
|
accel.initialize();
|
|
skidpad.initialize();
|
|
autox.initialize();
|
|
trackdrive.initialize();
|
|
ebs.initialize();
|
|
inspection.initialize();
|
|
manual.initialize();
|
|
}
|
|
|
|
void MissionSelectViewBase::handleKeyEvent(uint8_t key)
|
|
{
|
|
if(23 == key)
|
|
{
|
|
//SelectNextMission
|
|
//When hardware button 23 clicked call virtual function
|
|
//Call incMission
|
|
incMission();
|
|
|
|
}
|
|
|
|
if(24 == key)
|
|
{
|
|
//SelectPrevMission
|
|
//When hardware button 24 clicked call virtual function
|
|
//Call decMission
|
|
decMission();
|
|
|
|
}
|
|
|
|
if(6 == key)
|
|
{
|
|
//ConfirmMission
|
|
//When hardware button 6 clicked call virtual function
|
|
//Call confirmMission
|
|
confirmMission();
|
|
|
|
}
|
|
|
|
if(254 == key)
|
|
{
|
|
//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();
|
|
|
|
}
|
|
|
|
if(252 == key)
|
|
{
|
|
//DummyChangeDebugView
|
|
//When hardware button 252 clicked change screen to DebugView
|
|
//Go to DebugView with no screen transition
|
|
application().gotoDebugViewScreenNoTransition();
|
|
|
|
}
|
|
}
|