Declutter driver view

This commit is contained in:
2023-05-24 01:28:41 +02:00
parent 36ef42acb2
commit 67b19368b0
18 changed files with 213 additions and 585 deletions

View File

@ -11,16 +11,16 @@
#include <touchgfx/containers/Container.hpp>
#include <touchgfx/containers/progress_indicators/LineProgress.hpp>
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
#include <touchgfx/widgets/TextArea.hpp>
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
#include <touchgfx/widgets/canvas/Line.hpp>
#include <gui/containers/Temperature.hpp>
#include <touchgfx/widgets/TextArea.hpp>
#include <touchgfx/containers/scrollers/ScrollWheel.hpp>
#include <gui/containers/DriverViewFieldSelection.hpp>
#include <gui/containers/DriverViewField.hpp>
#include <touchgfx/containers/ListLayout.hpp>
#include <gui/containers/DriverViewStatusItem.hpp>
#include <touchgfx/containers/progress_indicators/BoxProgress.hpp>
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
#include <gui/containers/ErrorPopup.hpp>
class DriverViewViewBase : public touchgfx::View<DriverViewPresenter>
@ -70,32 +70,9 @@ protected:
*/
touchgfx::Box __background;
touchgfx::Container SoC;
touchgfx::LineProgress tsSoC;
touchgfx::PainterRGB565 tsSoCPainter;
touchgfx::LineProgress lvSoC;
touchgfx::PainterRGB565 lvSoCPainter;
touchgfx::TextArea tsSoCLabel;
touchgfx::TextArea lvSoCLabel;
touchgfx::Container drivetrainTemps;
touchgfx::Line batTempDiv;
touchgfx::PainterRGB565 batTempDivPainter;
Temperature batTempR;
Temperature batTempL;
touchgfx::TextArea batTempLabel;
touchgfx::Line dtDiv2;
touchgfx::PainterRGB565 dtDiv2Painter;
touchgfx::Line motorTempDiv;
touchgfx::PainterRGB565 motorTempDivPainter;
Temperature motorTempR;
Temperature motorTempL;
touchgfx::TextArea motorTempLabel;
touchgfx::Line dtDiv1;
touchgfx::PainterRGB565 dtDiv1Painter;
touchgfx::Line invTempDiv;
touchgfx::PainterRGB565 invTempDivPainter;
Temperature invTempR;
Temperature invTempL;
touchgfx::TextArea invTempLabel;
touchgfx::LineProgress soc;
touchgfx::PainterRGB565 socPainter;
touchgfx::TextAreaWithOneWildcard socLabel;
touchgfx::Container brakeTemps;
touchgfx::Line btDivVert;
touchgfx::PainterRGB565 btDivVertPainter;

View File

@ -16,134 +16,28 @@ DriverViewViewBase::DriverViewViewBase() :
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
add(__background);
SoC.setPosition(12, 125, 152, 180);
tsSoC.setXY(0, 25);
tsSoC.setProgressIndicatorPosition(0, 0, 40, 150);
tsSoC.setRange(0, 100);
tsSoC.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID));
tsSoCPainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0));
tsSoC.setPainter(tsSoCPainter);
tsSoC.setStart(9, 150);
tsSoC.setEnd(9, 0);
tsSoC.setLineWidth(100);
tsSoC.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING);
tsSoC.setValue(60);
SoC.add(tsSoC);
SoC.setPosition(12, 277, 456, 33);
soc.setXY(0, 0);
soc.setProgressIndicatorPosition(0, 0, 456, 33);
soc.setRange(0, 100);
soc.setBackground(touchgfx::Bitmap(BITMAP_PROG_HORIZ_BG_ID));
socPainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0));
soc.setPainter(socPainter);
soc.setStart(0, 16);
soc.setEnd(456, 16);
soc.setLineWidth(100);
soc.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING);
soc.setValue(60);
SoC.add(soc);
lvSoC.setXY(95, 25);
lvSoC.setProgressIndicatorPosition(0, 0, 40, 150);
lvSoC.setRange(0, 100);
lvSoC.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID));
lvSoCPainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0));
lvSoC.setPainter(lvSoCPainter);
lvSoC.setStart(9, 150);
lvSoC.setEnd(9, 0);
lvSoC.setLineWidth(100);
lvSoC.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING);
lvSoC.setValue(80);
SoC.add(lvSoC);
tsSoCLabel.setPosition(0, 0, 40, 25);
tsSoCLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
tsSoCLabel.setLinespacing(0);
tsSoCLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_PHFD));
SoC.add(tsSoCLabel);
lvSoCLabel.setPosition(95, 0, 40, 25);
lvSoCLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
lvSoCLabel.setLinespacing(0);
lvSoCLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_4OBM));
SoC.add(lvSoCLabel);
socLabel.setPosition(188, 4, 81, 25);
socLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
socLabel.setLinespacing(0);
socLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_PHFD));
SoC.add(socLabel);
add(SoC);
drivetrainTemps.setPosition(316, 125, 152, 185);
batTempDiv.setPosition(60, 124, 3, 60);
batTempDivPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
batTempDiv.setPainter(batTempDivPainter);
batTempDiv.setStart(0, 0);
batTempDiv.setEnd(0, 320);
batTempDiv.setLineWidth(10);
batTempDiv.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
drivetrainTemps.add(batTempDiv);
batTempR.setXY(63, 124);
drivetrainTemps.add(batTempR);
batTempL.setXY(0, 124);
drivetrainTemps.add(batTempL);
batTempLabel.setPosition(123, 124, 25, 60);
batTempLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
batTempLabel.setLinespacing(0);
batTempLabel.setRotation(touchgfx::TEXT_ROTATE_90);
batTempLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_L1J7));
drivetrainTemps.add(batTempLabel);
dtDiv2.setPosition(0, 122, 123, 2);
dtDiv2Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
dtDiv2.setPainter(dtDiv2Painter);
dtDiv2.setStart(0, 0);
dtDiv2.setEnd(123, 0);
dtDiv2.setLineWidth(10);
dtDiv2.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
drivetrainTemps.add(dtDiv2);
motorTempDiv.setPosition(60, 62, 3, 60);
motorTempDivPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
motorTempDiv.setPainter(motorTempDivPainter);
motorTempDiv.setStart(0, 0);
motorTempDiv.setEnd(0, 320);
motorTempDiv.setLineWidth(10);
motorTempDiv.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
drivetrainTemps.add(motorTempDiv);
motorTempR.setXY(63, 62);
drivetrainTemps.add(motorTempR);
motorTempL.setXY(0, 62);
drivetrainTemps.add(motorTempL);
motorTempLabel.setPosition(123, 62, 25, 60);
motorTempLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
motorTempLabel.setLinespacing(0);
motorTempLabel.setRotation(touchgfx::TEXT_ROTATE_90);
motorTempLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_JN2J));
drivetrainTemps.add(motorTempLabel);
dtDiv1.setPosition(0, 60, 123, 2);
dtDiv1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
dtDiv1.setPainter(dtDiv1Painter);
dtDiv1.setStart(0, 0);
dtDiv1.setEnd(123, 0);
dtDiv1.setLineWidth(10);
dtDiv1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
drivetrainTemps.add(dtDiv1);
invTempDiv.setPosition(60, 0, 3, 60);
invTempDivPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
invTempDiv.setPainter(invTempDivPainter);
invTempDiv.setStart(0, 0);
invTempDiv.setEnd(0, 320);
invTempDiv.setLineWidth(10);
invTempDiv.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
drivetrainTemps.add(invTempDiv);
invTempR.setXY(63, 0);
drivetrainTemps.add(invTempR);
invTempL.setXY(0, 0);
drivetrainTemps.add(invTempL);
invTempLabel.setPosition(123, 0, 25, 60);
invTempLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
invTempLabel.setLinespacing(0);
invTempLabel.setRotation(touchgfx::TEXT_ROTATE_90);
invTempLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_ZP7N));
drivetrainTemps.add(invTempLabel);
add(drivetrainTemps);
brakeTemps.setPosition(164, 125, 152, 150);
btDivVert.setPosition(74, 25, 3, 123);
btDivVertPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
@ -274,12 +168,6 @@ DriverViewViewBase::~DriverViewViewBase()
void DriverViewViewBase::setupScreen()
{
batTempR.initialize();
batTempL.initialize();
motorTempR.initialize();
motorTempL.initialize();
invTempR.initialize();
invTempL.initialize();
brakeTempRR.initialize();
brakeTempFR.initialize();
brakeTempRL.initialize();