update for new CAN dbc (incomplete), add more NamedFields, allow mission select without confirmation, set default mission select state to manual

This commit is contained in:
2025-07-08 13:17:33 +02:00
parent e995c0ad66
commit 91b62c7b5e
23 changed files with 1029 additions and 1349 deletions

View File

@ -12,8 +12,6 @@
#include <touchgfx/widgets/TextArea.hpp>
#include <touchgfx/containers/Container.hpp>
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
#include <touchgfx/widgets/canvas/Shape.hpp>
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
#include <touchgfx/containers/progress_indicators/BoxProgress.hpp>
class AMIViewBase : public touchgfx::View<AMIPresenter>
@ -43,37 +41,14 @@ protected:
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;
touchgfx::Container init;
touchgfx::TextAreaWithOneWildcard asOK;
touchgfx::TextArea textArea8;
touchgfx::TextArea textArea7;
touchgfx::TextAreaWithOneWildcard pressRear;
touchgfx::TextAreaWithOneWildcard pressFront;
touchgfx::TextAreaWithOneWildcard pressB;
touchgfx::TextAreaWithOneWildcard pressA;
touchgfx::TextAreaWithOneWildcard press2;
touchgfx::TextAreaWithOneWildcard press1;
touchgfx::TextArea textArea6;
touchgfx::TextArea textArea5;
touchgfx::BoxProgress progressBar;
@ -82,12 +57,6 @@ protected:
private:
/*
* Canvas Buffer Size
*/
static const uint32_t CANVAS_BUFFER_SIZE = 7200;
uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
};
#endif // AMIVIEWBASE_HPP

View File

@ -52,10 +52,10 @@ protected:
touchgfx::ListLayout missionList;
MissionSelectElement accel;
MissionSelectElement skidpad;
MissionSelectElement autox;
MissionSelectElement trackdrive;
MissionSelectElement ebs;
MissionSelectElement inspection;
MissionSelectElement autox;
MissionSelectElement manual;
touchgfx::Line lastLine;
touchgfx::PainterRGB565 lastLinePainter;

View File

@ -2,15 +2,12 @@
/********** 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);
@ -76,129 +73,6 @@ AMIViewBase::AMIViewBase()
textArea3.setTypedText(touchgfx::TypedText(T___SINGLEUSE_Z78U));
driving.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);
driving.add(map);
add(driving);
init.setPosition(0, 0, 480, 320);
@ -232,17 +106,17 @@ AMIViewBase::AMIViewBase()
pressFront.setTypedText(touchgfx::TypedText(T___SINGLEUSE_CO7A));
init.add(pressFront);
pressB.setPosition(352, 185, 60, 23);
pressB.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
pressB.setLinespacing(0);
pressB.setTypedText(touchgfx::TypedText(T___SINGLEUSE_A0LF));
init.add(pressB);
press2.setPosition(352, 185, 60, 23);
press2.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
press2.setLinespacing(0);
press2.setTypedText(touchgfx::TypedText(T___SINGLEUSE_A0LF));
init.add(press2);
pressA.setPosition(352, 153, 60, 23);
pressA.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
pressA.setLinespacing(0);
pressA.setTypedText(touchgfx::TypedText(T___SINGLEUSE_166C));
init.add(pressA);
press1.setPosition(352, 153, 60, 23);
press1.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
press1.setLinespacing(0);
press1.setTypedText(touchgfx::TypedText(T___SINGLEUSE_166C));
init.add(press1);
textArea6.setXY(68, 184);
textArea6.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
@ -282,7 +156,7 @@ AMIViewBase::AMIViewBase()
AMIViewBase::~AMIViewBase()
{
touchgfx::CanvasWidgetRenderer::resetBuffer();
}
void AMIViewBase::setupScreen()

View File

@ -28,14 +28,14 @@ MissionSelectViewBase::MissionSelectViewBase()
missionList.add(skidpad);
missionList.add(autox);
missionList.add(trackdrive);
missionList.add(ebs);
missionList.add(inspection);
missionList.add(autox);
missionList.add(manual);
lastLine.setWidth(480);
@ -64,10 +64,10 @@ void MissionSelectViewBase::setupScreen()
{
accel.initialize();
skidpad.initialize();
autox.initialize();
trackdrive.initialize();
ebs.initialize();
inspection.initialize();
autox.initialize();
manual.initialize();
}