Allow changing displayed fields in DriverView
This commit is contained in:
parent
c8ee51a78f
commit
0d7cc03e02
|
@ -351,6 +351,7 @@ TouchGFX/generated/fonts/src/UnmappedDataFont.cpp \
|
|||
TouchGFX/generated/gui_generated/src/ami_screen/AMIViewBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/common/FrontendApplicationBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/containers/DriverViewFieldBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/containers/DriverViewFieldSelectionBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/containers/MissionSelectElementBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/containers/TireTempBase.cpp \
|
||||
TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp \
|
||||
|
@ -372,6 +373,7 @@ TouchGFX/gui/src/ami_screen/AMIView.cpp \
|
|||
TouchGFX/gui/src/common/DataField.cpp \
|
||||
TouchGFX/gui/src/common/FrontendApplication.cpp \
|
||||
TouchGFX/gui/src/containers/DriverViewField.cpp \
|
||||
TouchGFX/gui/src/containers/DriverViewFieldSelection.cpp \
|
||||
TouchGFX/gui/src/containers/MissionSelectElement.cpp \
|
||||
TouchGFX/gui/src/containers/TireTemp.cpp \
|
||||
TouchGFX/gui/src/driverview_screen/DriverViewPresenter.cpp \
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
#define TOUCHGFX_BYTE_POOL_SIZE (4096)
|
||||
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
// Redefine here so it doesn't get overwritten on code generation
|
||||
#define TOUCHGFX_STACK_SIZE (8160)
|
||||
#define TOUCHGFX_BYTE_POOL_SIZE (8192)
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
|
|
|
@ -128,6 +128,9 @@
|
|||
</Text>
|
||||
</TextGroup>
|
||||
<TextGroup Id="Unsorted">
|
||||
<Text Id="__SingleUse_PNKR" Alignment="Center" TypographyId="Chinat_Small">
|
||||
<Translation Language="GB">????</Translation>
|
||||
</Text>
|
||||
<Text Id="__SingleUse_0FBJ" Alignment="Center" TypographyId="Chinat_Small">
|
||||
<Translation Language="GB">FIELD</Translation>
|
||||
</Text>
|
||||
|
|
|
@ -17,12 +17,9 @@ public:
|
|||
|
||||
virtual void changeToStartScreen()
|
||||
{
|
||||
gotoMissionSelectScreenNoTransition();
|
||||
gotoDriverViewScreenNoTransition();
|
||||
}
|
||||
|
||||
// MissionSelect
|
||||
void gotoMissionSelectScreenNoTransition();
|
||||
|
||||
// AMI
|
||||
void gotoAMIScreenNoTransition();
|
||||
|
||||
|
@ -34,9 +31,6 @@ protected:
|
|||
FrontendHeap& frontendHeap;
|
||||
Model& model;
|
||||
|
||||
// MissionSelect
|
||||
void gotoMissionSelectScreenNoTransitionImpl();
|
||||
|
||||
// AMI
|
||||
void gotoAMIScreenNoTransitionImpl();
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
virtual void gotoStartScreen(FrontendApplication& app)
|
||||
{
|
||||
app.gotoMissionSelectScreenNoTransition();
|
||||
app.gotoDriverViewScreenNoTransition();
|
||||
}
|
||||
protected:
|
||||
FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app)
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#ifndef DRIVERVIEWFIELDSELECTIONBASE_HPP
|
||||
#define DRIVERVIEWFIELDSELECTIONBASE_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 DriverViewFieldSelectionBase : public touchgfx::Container
|
||||
{
|
||||
public:
|
||||
DriverViewFieldSelectionBase();
|
||||
virtual ~DriverViewFieldSelectionBase();
|
||||
virtual void initialize();
|
||||
|
||||
protected:
|
||||
FrontendApplication& application() {
|
||||
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
|
||||
}
|
||||
|
||||
/*
|
||||
* Member Declarations
|
||||
*/
|
||||
touchgfx::Box bg;
|
||||
touchgfx::TextArea name;
|
||||
touchgfx::Line line1;
|
||||
touchgfx::PainterRGB565 line1Painter;
|
||||
touchgfx::Line line2;
|
||||
touchgfx::PainterRGB565 line2Painter;
|
||||
touchgfx::Line line2_1;
|
||||
touchgfx::PainterRGB565 line2_1Painter;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // DRIVERVIEWFIELDSELECTIONBASE_HPP
|
|
@ -15,6 +15,8 @@
|
|||
#include <touchgfx/containers/progress_indicators/LineProgress.hpp>
|
||||
#include <touchgfx/widgets/TextArea.hpp>
|
||||
#include <gui/containers/DriverViewField.hpp>
|
||||
#include <touchgfx/containers/scrollers/ScrollWheel.hpp>
|
||||
#include <gui/containers/DriverViewFieldSelection.hpp>
|
||||
|
||||
class DriverViewViewBase : public touchgfx::View<DriverViewPresenter>
|
||||
{
|
||||
|
@ -23,6 +25,36 @@ public:
|
|||
virtual ~DriverViewViewBase();
|
||||
virtual void setupScreen();
|
||||
|
||||
virtual void fieldTypeSelectionUpdateItem(DriverViewFieldSelection& item, int16_t itemIndex)
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
virtual void handleKeyEvent(uint8_t key);
|
||||
|
||||
/*
|
||||
* Virtual Action Handlers
|
||||
*/
|
||||
virtual void selectPrevField()
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
virtual void selectNextField()
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
virtual void selectPrevFieldType()
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
virtual void selectNextFieldType()
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
virtual void confirmFieldType()
|
||||
{
|
||||
// Override and implement this function in DriverView
|
||||
}
|
||||
|
||||
protected:
|
||||
FrontendApplication& application() {
|
||||
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
|
||||
|
@ -51,6 +83,8 @@ protected:
|
|||
DriverViewField field1;
|
||||
DriverViewField field2;
|
||||
DriverViewField field3;
|
||||
touchgfx::ScrollWheel fieldTypeSelection;
|
||||
touchgfx::DrawableListItems<DriverViewFieldSelection, 11> fieldTypeSelectionListItems;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -60,6 +94,16 @@ private:
|
|||
static const uint32_t CANVAS_BUFFER_SIZE = 7200;
|
||||
uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
|
||||
|
||||
/*
|
||||
* Callback Declarations
|
||||
*/
|
||||
touchgfx::Callback<DriverViewViewBase, touchgfx::DrawableListItemsInterface*, int16_t, int16_t> updateItemCallback;
|
||||
|
||||
/*
|
||||
* Callback Handler Declarations
|
||||
*/
|
||||
void updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex);
|
||||
|
||||
};
|
||||
|
||||
#endif // DRIVERVIEWVIEWBASE_HPP
|
||||
|
|
|
@ -33,19 +33,6 @@ FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
|
|||
* Screen Transition Declarations
|
||||
*/
|
||||
|
||||
// MissionSelect
|
||||
|
||||
void FrontendApplicationBase::gotoMissionSelectScreenNoTransition()
|
||||
{
|
||||
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoMissionSelectScreenNoTransitionImpl);
|
||||
pendingScreenTransitionCallback = &transitionCallback;
|
||||
}
|
||||
|
||||
void FrontendApplicationBase::gotoMissionSelectScreenNoTransitionImpl()
|
||||
{
|
||||
touchgfx::makeTransition<MissionSelectView, MissionSelectPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
|
||||
}
|
||||
|
||||
// AMI
|
||||
|
||||
void FrontendApplicationBase::gotoAMIScreenNoTransition()
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#include <gui_generated/containers/DriverViewFieldSelectionBase.hpp>
|
||||
#include <touchgfx/Color.hpp>
|
||||
#include <texts/TextKeysAndLanguages.hpp>
|
||||
|
||||
DriverViewFieldSelectionBase::DriverViewFieldSelectionBase()
|
||||
{
|
||||
setWidth(160);
|
||||
setHeight(26);
|
||||
bg.setPosition(0, 0, 160, 25);
|
||||
bg.setColor(touchgfx::Color::getColorFromRGB(34, 34, 34));
|
||||
add(bg);
|
||||
|
||||
name.setPosition(0, 0, 160, 25);
|
||||
name.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
|
||||
name.setLinespacing(0);
|
||||
name.setTypedText(touchgfx::TypedText(T___SINGLEUSE_PNKR));
|
||||
add(name);
|
||||
|
||||
line1.setPosition(0, 25, 160, 1);
|
||||
line1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
|
||||
line1.setPainter(line1Painter);
|
||||
line1.setStart(0, 0);
|
||||
line1.setEnd(160, 0);
|
||||
line1.setLineWidth(10);
|
||||
line1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
|
||||
add(line1);
|
||||
|
||||
line2.setPosition(0, 0, 1, 26);
|
||||
line2Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
|
||||
line2.setPainter(line2Painter);
|
||||
line2.setStart(0, 0);
|
||||
line2.setEnd(0, 26);
|
||||
line2.setLineWidth(10);
|
||||
line2.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
|
||||
add(line2);
|
||||
|
||||
line2_1.setPosition(159, 0, 1, 26);
|
||||
line2_1Painter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255));
|
||||
line2_1.setPainter(line2_1Painter);
|
||||
line2_1.setStart(0, 0);
|
||||
line2_1.setEnd(0, 26);
|
||||
line2_1.setLineWidth(10);
|
||||
line2_1.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING);
|
||||
add(line2_1);
|
||||
}
|
||||
|
||||
DriverViewFieldSelectionBase::~DriverViewFieldSelectionBase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DriverViewFieldSelectionBase::initialize()
|
||||
{
|
||||
|
||||
}
|
|
@ -7,7 +7,8 @@
|
|||
#include <images/BitmapDatabase.hpp>
|
||||
#include <texts/TextKeysAndLanguages.hpp>
|
||||
|
||||
DriverViewViewBase::DriverViewViewBase()
|
||||
DriverViewViewBase::DriverViewViewBase() :
|
||||
updateItemCallback(this, &DriverViewViewBase::updateItemCallbackHandler)
|
||||
{
|
||||
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
|
||||
|
||||
|
@ -101,6 +102,20 @@ DriverViewViewBase::DriverViewViewBase()
|
|||
|
||||
field3.setXY(320, 0);
|
||||
add(field3);
|
||||
|
||||
fieldTypeSelection.setPosition(0, 80, 160, 240);
|
||||
fieldTypeSelection.setHorizontal(false);
|
||||
fieldTypeSelection.setCircular(true);
|
||||
fieldTypeSelection.setEasingEquation(touchgfx::EasingEquations::backEaseOut);
|
||||
fieldTypeSelection.setSwipeAcceleration(10);
|
||||
fieldTypeSelection.setDragAcceleration(10);
|
||||
fieldTypeSelection.setNumberOfItems(1);
|
||||
fieldTypeSelection.setSelectedItemOffset(94);
|
||||
fieldTypeSelection.setDrawableSize(26, 0);
|
||||
fieldTypeSelection.setDrawables(fieldTypeSelectionListItems, updateItemCallback);
|
||||
fieldTypeSelection.animateToItem(0, 0);
|
||||
fieldTypeSelection.setVisible(false);
|
||||
add(fieldTypeSelection);
|
||||
}
|
||||
|
||||
DriverViewViewBase::~DriverViewViewBase()
|
||||
|
@ -117,4 +132,67 @@ void DriverViewViewBase::setupScreen()
|
|||
field1.initialize();
|
||||
field2.initialize();
|
||||
field3.initialize();
|
||||
fieldTypeSelection.initialize();
|
||||
for (int i = 0; i < fieldTypeSelectionListItems.getNumberOfDrawables(); i++)
|
||||
{
|
||||
fieldTypeSelectionListItems[i].initialize();
|
||||
}
|
||||
}
|
||||
|
||||
void DriverViewViewBase::handleKeyEvent(uint8_t key)
|
||||
{
|
||||
if(22 == key)
|
||||
{
|
||||
//SelectPreviousField
|
||||
//When hardware button 22 clicked call virtual function
|
||||
//Call selectPrevField
|
||||
selectPrevField();
|
||||
|
||||
}
|
||||
|
||||
if(21 == key)
|
||||
{
|
||||
//SelectNextField
|
||||
//When hardware button 21 clicked call virtual function
|
||||
//Call selectNextField
|
||||
selectNextField();
|
||||
|
||||
}
|
||||
|
||||
if(24 == key)
|
||||
{
|
||||
//SelectPreviousFieldType
|
||||
//When hardware button 24 clicked call virtual function
|
||||
//Call selectPrevFieldType
|
||||
selectPrevFieldType();
|
||||
|
||||
}
|
||||
|
||||
if(23 == key)
|
||||
{
|
||||
//SelectNextFieldType
|
||||
//When hardware button 23 clicked call virtual function
|
||||
//Call selectNextFieldType
|
||||
selectNextFieldType();
|
||||
|
||||
}
|
||||
|
||||
if(6 == key)
|
||||
{
|
||||
//ConfirmFieldType
|
||||
//When hardware button 6 clicked call virtual function
|
||||
//Call confirmFieldType
|
||||
confirmFieldType();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void DriverViewViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex)
|
||||
{
|
||||
if (items == &fieldTypeSelectionListItems)
|
||||
{
|
||||
touchgfx::Drawable* d = items->getDrawable(containerIndex);
|
||||
DriverViewFieldSelection* cc = (DriverViewFieldSelection*)d;
|
||||
fieldTypeSelectionUpdateItem(*cc, itemIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"remap":"yes","language":"GB","language_index":0,"indices":[["252","T_FIELD_BBAL"],["209","T_FIELD_TSVOLTVEH"],["202","T_FIELD_TSVOLTBAT"],["228","T_FIELD_LVSOC"],["246","T_FIELD_TSSOC"],["262","T_FIELD_MAXCELLTEMP"],["267","T_FIELD_TIREFL"],["272","T_FIELD_TIREFR"],["277","T_FIELD_TIRERL"],["282","T_FIELD_TIRERR"],["257","T_FIELD_LAPCOUNT"],["146","T_FIELD_INICHKSTATE"],["216","T_FIELD_ERR"],["296","T_FIELD_SDC"],["162","T_FIELD_INVRREADY"],["154","T_FIELD_INVLREADY"],["178","T_FIELD_R2DPROGRESS"],["170","T_FIELD_ACTIVEMISSION"],["138","T_FIELD_ASSTATE"],["194","T_FIELD_TSSTATE"],["136","T_NUMBERWILDCARD"],["136","T_DEFAULTWILDCARD"],["292","T_FIELD_TSCURRENT"],["287","T_FIELD_MINCELLVOLT"],["234","T_FIELD_SPEED"],["95","T_INSPECTION_HUGE"],["127","T_EBS_HUGE"],["106","T_TRACKDRIVE_HUGE"],["117","T_AUTOX_HUGE"],["186","T_SKIDPAD_HUGE"],["82","T_ACCEL_HUGE"],["34","T_INVALID_HUGE"],["67","T_MANUAL"],["95","T_INSPECTION"],["127","T_EBS"],["106","T_TRACKDRIVE"],["117","T_AUTOX"],["186","T_SKIDPAD"],["82","T_ACCEL"],["222","T___SINGLEUSE_0FBJ"],["300","T___SINGLEUSE_4OBM"],["293","T___SINGLEUSE_PHFD"],["240","T___SINGLEUSE_H6UX"],["136","T___SINGLEUSE_20H3"],["17","T___SINGLEUSE_SDGP"],["51","T___SINGLEUSE_M5X7"],["0","T___SINGLEUSE_6GPV"]]}
|
||||
{"remap":"yes","language":"GB","language_index":0,"indices":[["257","T_FIELD_BBAL"],["209","T_FIELD_TSVOLTVEH"],["202","T_FIELD_TSVOLTBAT"],["228","T_FIELD_LVSOC"],["246","T_FIELD_TSSOC"],["267","T_FIELD_MAXCELLTEMP"],["272","T_FIELD_TIREFL"],["277","T_FIELD_TIREFR"],["282","T_FIELD_TIRERL"],["287","T_FIELD_TIRERR"],["262","T_FIELD_LAPCOUNT"],["146","T_FIELD_INICHKSTATE"],["216","T_FIELD_ERR"],["301","T_FIELD_SDC"],["162","T_FIELD_INVRREADY"],["154","T_FIELD_INVLREADY"],["178","T_FIELD_R2DPROGRESS"],["170","T_FIELD_ACTIVEMISSION"],["138","T_FIELD_ASSTATE"],["194","T_FIELD_TSSTATE"],["136","T_NUMBERWILDCARD"],["136","T_DEFAULTWILDCARD"],["297","T_FIELD_TSCURRENT"],["292","T_FIELD_MINCELLVOLT"],["234","T_FIELD_SPEED"],["95","T_INSPECTION_HUGE"],["127","T_EBS_HUGE"],["106","T_TRACKDRIVE_HUGE"],["117","T_AUTOX_HUGE"],["186","T_SKIDPAD_HUGE"],["82","T_ACCEL_HUGE"],["34","T_INVALID_HUGE"],["67","T_MANUAL"],["95","T_INSPECTION"],["127","T_EBS"],["106","T_TRACKDRIVE"],["117","T_AUTOX"],["186","T_SKIDPAD"],["82","T_ACCEL"],["252","T___SINGLEUSE_PNKR"],["222","T___SINGLEUSE_0FBJ"],["305","T___SINGLEUSE_4OBM"],["298","T___SINGLEUSE_PHFD"],["240","T___SINGLEUSE_H6UX"],["136","T___SINGLEUSE_20H3"],["17","T___SINGLEUSE_SDGP"],["51","T___SINGLEUSE_M5X7"],["0","T___SINGLEUSE_6GPV"]]}
|
|
@ -1 +1 @@
|
|||
{"languages":["GB"],"textids":["T_FIELD_BBAL","T_FIELD_TSVOLTVEH","T_FIELD_TSVOLTBAT","T_FIELD_LVSOC","T_FIELD_TSSOC","T_FIELD_MAXCELLTEMP","T_FIELD_TIREFL","T_FIELD_TIREFR","T_FIELD_TIRERL","T_FIELD_TIRERR","T_FIELD_LAPCOUNT","T_FIELD_INICHKSTATE","T_FIELD_ERR","T_FIELD_SDC","T_FIELD_INVRREADY","T_FIELD_INVLREADY","T_FIELD_R2DPROGRESS","T_FIELD_ACTIVEMISSION","T_FIELD_ASSTATE","T_FIELD_TSSTATE","T_NUMBERWILDCARD","T_DEFAULTWILDCARD","T_FIELD_TSCURRENT","T_FIELD_MINCELLVOLT","T_FIELD_SPEED","T_INSPECTION_HUGE","T_EBS_HUGE","T_TRACKDRIVE_HUGE","T_AUTOX_HUGE","T_SKIDPAD_HUGE","T_ACCEL_HUGE","T_INVALID_HUGE","T_MANUAL","T_INSPECTION","T_EBS","T_TRACKDRIVE","T_AUTOX","T_SKIDPAD","T_ACCEL","T___SINGLEUSE_0FBJ","T___SINGLEUSE_4OBM","T___SINGLEUSE_PHFD","T___SINGLEUSE_H6UX","T___SINGLEUSE_20H3","T___SINGLEUSE_SDGP","T___SINGLEUSE_M5X7","T___SINGLEUSE_6GPV"]}
|
||||
{"languages":["GB"],"textids":["T_FIELD_BBAL","T_FIELD_TSVOLTVEH","T_FIELD_TSVOLTBAT","T_FIELD_LVSOC","T_FIELD_TSSOC","T_FIELD_MAXCELLTEMP","T_FIELD_TIREFL","T_FIELD_TIREFR","T_FIELD_TIRERL","T_FIELD_TIRERR","T_FIELD_LAPCOUNT","T_FIELD_INICHKSTATE","T_FIELD_ERR","T_FIELD_SDC","T_FIELD_INVRREADY","T_FIELD_INVLREADY","T_FIELD_R2DPROGRESS","T_FIELD_ACTIVEMISSION","T_FIELD_ASSTATE","T_FIELD_TSSTATE","T_NUMBERWILDCARD","T_DEFAULTWILDCARD","T_FIELD_TSCURRENT","T_FIELD_MINCELLVOLT","T_FIELD_SPEED","T_INSPECTION_HUGE","T_EBS_HUGE","T_TRACKDRIVE_HUGE","T_AUTOX_HUGE","T_SKIDPAD_HUGE","T_ACCEL_HUGE","T_INVALID_HUGE","T_MANUAL","T_INSPECTION","T_EBS","T_TRACKDRIVE","T_AUTOX","T_SKIDPAD","T_ACCEL","T___SINGLEUSE_PNKR","T___SINGLEUSE_0FBJ","T___SINGLEUSE_4OBM","T___SINGLEUSE_PHFD","T___SINGLEUSE_H6UX","T___SINGLEUSE_20H3","T___SINGLEUSE_SDGP","T___SINGLEUSE_M5X7","T___SINGLEUSE_6GPV"]}
|
|
@ -1 +1 @@
|
|||
{"remap":"yes","languages":["Gb"],"characters":[67,104,111,111,115,101,32,97,32,109,105,115,115,105,111,110,0,67,117,114,114,101,110,116,32,77,105,115,115,105,111,110,58,0,73,110,118,97,108,105,100,32,77,105,115,115,105,111,110,33,0,73,110,118,97,108,105,100,32,77,105,115,115,105,111,110,0,77,97,110,117,97,108,32,68,114,105,118,105,110,103,0,65,99,99,101,108,101,114,97,116,105,111,110,0,73,110,115,112,101,99,116,105,111,110,0,84,114,97,99,107,100,114,105,118,101,0,65,117,116,111,99,114,111,115,115,0,69,66,83,32,84,101,115,116,0,2,0,65,83,83,84,65,84,69,0,73,67,83,84,65,84,69,0,73,78,86,76,82,68,89,0,73,78,86,82,82,68,89,0,77,73,83,83,73,79,78,0,82,50,68,80,82,79,71,0,83,107,105,100,112,97,100,0,84,83,83,84,65,84,69,0,84,83,86,66,65,84,0,84,83,86,86,69,72,0,69,82,82,79,82,0,70,73,69,76,68,0,76,86,83,79,67,0,83,80,69,69,68,0,84,73,82,69,83,0,84,83,83,79,67,0,66,66,65,76,0,76,65,80,83,0,84,77,65,88,0,84,84,70,76,0,84,84,70,82,0,84,84,82,76,0,84,84,82,82,0,86,77,73,78,0,73,84,83,0,83,68,67,0,76,86,0]}
|
||||
{"remap":"yes","languages":["Gb"],"characters":[67,104,111,111,115,101,32,97,32,109,105,115,115,105,111,110,0,67,117,114,114,101,110,116,32,77,105,115,115,105,111,110,58,0,73,110,118,97,108,105,100,32,77,105,115,115,105,111,110,33,0,73,110,118,97,108,105,100,32,77,105,115,115,105,111,110,0,77,97,110,117,97,108,32,68,114,105,118,105,110,103,0,65,99,99,101,108,101,114,97,116,105,111,110,0,73,110,115,112,101,99,116,105,111,110,0,84,114,97,99,107,100,114,105,118,101,0,65,117,116,111,99,114,111,115,115,0,69,66,83,32,84,101,115,116,0,2,0,65,83,83,84,65,84,69,0,73,67,83,84,65,84,69,0,73,78,86,76,82,68,89,0,73,78,86,82,82,68,89,0,77,73,83,83,73,79,78,0,82,50,68,80,82,79,71,0,83,107,105,100,112,97,100,0,84,83,83,84,65,84,69,0,84,83,86,66,65,84,0,84,83,86,86,69,72,0,69,82,82,79,82,0,70,73,69,76,68,0,76,86,83,79,67,0,83,80,69,69,68,0,84,73,82,69,83,0,84,83,83,79,67,0,63,63,63,63,0,66,66,65,76,0,76,65,80,83,0,84,77,65,88,0,84,84,70,76,0,84,84,70,82,0,84,84,82,76,0,84,84,82,82,0,86,77,73,78,0,73,84,83,0,83,68,67,0,76,86,0]}
|
|
@ -1 +1 @@
|
|||
{"databases":{"DEFAULT":[[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[4,"CENTER","LTR"],[0,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[4,"CENTER","LTR"],[1,"LEFT","LTR"],[2,"CENTER","LTR"],[1,"LEFT","LTR"]]},"database_list":["DEFAULT"],"fonts":{"getFont_verdana_20_4bpp":0,"getFont_CHINN____30_4bpp":1,"getFont_CHINN____20_4bpp":2,"getFont_CHINN____40_4bpp":3,"getFont_lucon_TTF_50_4bpp":4},"generate_font_format":"0"}
|
||||
{"databases":{"DEFAULT":[[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[4,"CENTER","LTR"],[0,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[3,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[2,"CENTER","LTR"],[4,"CENTER","LTR"],[1,"LEFT","LTR"],[2,"CENTER","LTR"],[1,"LEFT","LTR"]]},"database_list":["DEFAULT"],"fonts":{"getFont_verdana_20_4bpp":0,"getFont_CHINN____30_4bpp":1,"getFont_CHINN____20_4bpp":2,"getFont_CHINN____40_4bpp":3,"getFont_lucon_TTF_50_4bpp":4},"generate_font_format":"0"}
|
|
@ -51,6 +51,7 @@ enum TEXTS
|
|||
T_AUTOX,
|
||||
T_SKIDPAD,
|
||||
T_ACCEL,
|
||||
T___SINGLEUSE_PNKR,
|
||||
T___SINGLEUSE_0FBJ,
|
||||
T___SINGLEUSE_4OBM,
|
||||
T___SINGLEUSE_PHFD,
|
||||
|
|
|
@ -10,20 +10,20 @@ KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE;
|
|||
// Remap all strings
|
||||
TEXT_LOCATION_FLASH_PRAGMA
|
||||
KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE = {
|
||||
252, // T_FIELD_BBAL: "BBAL"
|
||||
257, // T_FIELD_BBAL: "BBAL"
|
||||
209, // T_FIELD_TSVOLTVEH: "TSVVEH"
|
||||
202, // T_FIELD_TSVOLTBAT: "TSVBAT"
|
||||
228, // T_FIELD_LVSOC: "LVSOC"
|
||||
246, // T_FIELD_TSSOC: "TSSOC"
|
||||
262, // T_FIELD_MAXCELLTEMP: "TMAX"
|
||||
267, // T_FIELD_TIREFL: "TTFL"
|
||||
272, // T_FIELD_TIREFR: "TTFR"
|
||||
277, // T_FIELD_TIRERL: "TTRL"
|
||||
282, // T_FIELD_TIRERR: "TTRR"
|
||||
257, // T_FIELD_LAPCOUNT: "LAPS"
|
||||
267, // T_FIELD_MAXCELLTEMP: "TMAX"
|
||||
272, // T_FIELD_TIREFL: "TTFL"
|
||||
277, // T_FIELD_TIREFR: "TTFR"
|
||||
282, // T_FIELD_TIRERL: "TTRL"
|
||||
287, // T_FIELD_TIRERR: "TTRR"
|
||||
262, // T_FIELD_LAPCOUNT: "LAPS"
|
||||
146, // T_FIELD_INICHKSTATE: "ICSTATE"
|
||||
216, // T_FIELD_ERR: "ERROR"
|
||||
296, // T_FIELD_SDC: "SDC"
|
||||
301, // T_FIELD_SDC: "SDC"
|
||||
162, // T_FIELD_INVRREADY: "INVRRDY"
|
||||
154, // T_FIELD_INVLREADY: "INVLRDY"
|
||||
178, // T_FIELD_R2DPROGRESS: "R2DPROG"
|
||||
|
@ -32,8 +32,8 @@ KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE = {
|
|||
194, // T_FIELD_TSSTATE: "TSSTATE"
|
||||
136, // T_NUMBERWILDCARD: "<>"
|
||||
136, // T_DEFAULTWILDCARD: "<>"
|
||||
292, // T_FIELD_TSCURRENT: "ITS"
|
||||
287, // T_FIELD_MINCELLVOLT: "VMIN"
|
||||
297, // T_FIELD_TSCURRENT: "ITS"
|
||||
292, // T_FIELD_MINCELLVOLT: "VMIN"
|
||||
234, // T_FIELD_SPEED: "SPEED"
|
||||
95, // T_INSPECTION_HUGE: "Inspection"
|
||||
127, // T_EBS_HUGE: "EBS Test"
|
||||
|
@ -49,9 +49,10 @@ KEEP extern const uint32_t indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE = {
|
|||
117, // T_AUTOX: "Autocross"
|
||||
186, // T_SKIDPAD: "Skidpad"
|
||||
82, // T_ACCEL: "Acceleration"
|
||||
252, // T___SINGLEUSE_PNKR: "????"
|
||||
222, // T___SINGLEUSE_0FBJ: "FIELD"
|
||||
300, // T___SINGLEUSE_4OBM: "LV"
|
||||
293, // T___SINGLEUSE_PHFD: "TS"
|
||||
305, // T___SINGLEUSE_4OBM: "LV"
|
||||
298, // T___SINGLEUSE_PHFD: "TS"
|
||||
240, // T___SINGLEUSE_H6UX: "TIRES"
|
||||
136, // T___SINGLEUSE_20H3: "<>"
|
||||
17, // T___SINGLEUSE_SDGP: "Current Mission:"
|
||||
|
|
|
@ -87,17 +87,18 @@ KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCA
|
|||
0x53, 0x50, 0x45, 0x45, 0x44, 0x0, // @234 "SPEED"
|
||||
0x54, 0x49, 0x52, 0x45, 0x53, 0x0, // @240 "TIRES"
|
||||
0x54, 0x53, 0x53, 0x4f, 0x43, 0x0, // @246 "TSSOC"
|
||||
0x42, 0x42, 0x41, 0x4c, 0x0, // @252 "BBAL"
|
||||
0x4c, 0x41, 0x50, 0x53, 0x0, // @257 "LAPS"
|
||||
0x54, 0x4d, 0x41, 0x58, 0x0, // @262 "TMAX"
|
||||
0x54, 0x54, 0x46, 0x4c, 0x0, // @267 "TTFL"
|
||||
0x54, 0x54, 0x46, 0x52, 0x0, // @272 "TTFR"
|
||||
0x54, 0x54, 0x52, 0x4c, 0x0, // @277 "TTRL"
|
||||
0x54, 0x54, 0x52, 0x52, 0x0, // @282 "TTRR"
|
||||
0x56, 0x4d, 0x49, 0x4e, 0x0, // @287 "VMIN"
|
||||
0x49, 0x54, 0x53, 0x0, // @292 "ITS"
|
||||
0x53, 0x44, 0x43, 0x0, // @296 "SDC"
|
||||
0x4c, 0x56, 0x0 // @300 "LV"
|
||||
0x3f, 0x3f, 0x3f, 0x3f, 0x0, // @252 "????"
|
||||
0x42, 0x42, 0x41, 0x4c, 0x0, // @257 "BBAL"
|
||||
0x4c, 0x41, 0x50, 0x53, 0x0, // @262 "LAPS"
|
||||
0x54, 0x4d, 0x41, 0x58, 0x0, // @267 "TMAX"
|
||||
0x54, 0x54, 0x46, 0x4c, 0x0, // @272 "TTFL"
|
||||
0x54, 0x54, 0x46, 0x52, 0x0, // @277 "TTFR"
|
||||
0x54, 0x54, 0x52, 0x4c, 0x0, // @282 "TTRL"
|
||||
0x54, 0x54, 0x52, 0x52, 0x0, // @287 "TTRR"
|
||||
0x56, 0x4d, 0x49, 0x4e, 0x0, // @292 "VMIN"
|
||||
0x49, 0x54, 0x53, 0x0, // @297 "ITS"
|
||||
0x53, 0x44, 0x43, 0x0, // @301 "SDC"
|
||||
0x4c, 0x56, 0x0 // @305 "LV"
|
||||
};
|
||||
|
||||
TEXT_LOCATION_FLASH_PRAGMA
|
||||
|
|
|
@ -67,6 +67,7 @@ const touchgfx::TypedText::TypedTextData typedText_database_DEFAULT[] TEXT_LOCAT
|
|||
{ 2, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 2, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 2, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 2, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 4, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 1, touchgfx::LEFT, touchgfx::TEXT_DIRECTION_LTR },
|
||||
{ 2, touchgfx::CENTER, touchgfx::TEXT_DIRECTION_LTR },
|
||||
|
|
|
@ -19,6 +19,8 @@ public:
|
|||
void setValue(const char *str);
|
||||
void setValue(int boolValue);
|
||||
|
||||
void setSelected(int selected);
|
||||
|
||||
protected:
|
||||
private:
|
||||
Unicode::UnicodeChar valueBuffer[16];
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef DRIVERVIEWFIELDSELECTION_HPP
|
||||
#define DRIVERVIEWFIELDSELECTION_HPP
|
||||
|
||||
#include "touchgfx/TypedText.hpp"
|
||||
#include <gui_generated/containers/DriverViewFieldSelectionBase.hpp>
|
||||
|
||||
class DriverViewFieldSelection : public DriverViewFieldSelectionBase {
|
||||
public:
|
||||
DriverViewFieldSelection();
|
||||
virtual ~DriverViewFieldSelection() {}
|
||||
|
||||
virtual void initialize();
|
||||
|
||||
void setName(const touchgfx::TypedText &name);
|
||||
void setSelected(int selected);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif // DRIVERVIEWFIELDSELECTION_HPP
|
|
@ -2,6 +2,8 @@
|
|||
#define DRIVERVIEWVIEW_HPP
|
||||
|
||||
#include "gui/common/DataField.hpp"
|
||||
#include "gui/containers/DriverViewFieldSelection.hpp"
|
||||
#include "touchgfx/containers/scrollers/DrawableList.hpp"
|
||||
#include "vehicle.h"
|
||||
#include <gui/driverview_screen/DriverViewPresenter.hpp>
|
||||
#include <gui_generated/driverview_screen/DriverViewViewBase.hpp>
|
||||
|
@ -13,6 +15,9 @@ public:
|
|||
virtual void setupScreen();
|
||||
virtual void tearDownScreen();
|
||||
|
||||
void fieldTypeSelectionUpdateItem(DriverViewFieldSelection &item,
|
||||
int16_t itemIndex) override;
|
||||
|
||||
void setFieldType(size_t i, const DataFieldDescription &desc);
|
||||
void setFieldValue(size_t i, float value);
|
||||
void setFieldValue(size_t i, const char *value);
|
||||
|
@ -21,9 +26,25 @@ public:
|
|||
void setTireTemps(const TireTemps &temps);
|
||||
void setTSSoC(uint8_t soc);
|
||||
|
||||
void selectPrevField() override;
|
||||
void selectNextField() override;
|
||||
void selectPrevFieldType() override;
|
||||
void selectNextFieldType() override;
|
||||
void confirmFieldType() override;
|
||||
|
||||
static constexpr size_t NUM_FIELDS = 3;
|
||||
|
||||
protected:
|
||||
private:
|
||||
DriverViewField &getField(size_t i);
|
||||
DriverViewFieldSelection *getFieldType(size_t i);
|
||||
|
||||
void updateSelectedField(size_t select);
|
||||
void updateSelectedFieldType(size_t select);
|
||||
|
||||
size_t selectedField;
|
||||
size_t selectedFieldType;
|
||||
DataFieldType fieldTypes[NUM_FIELDS];
|
||||
};
|
||||
|
||||
#endif // DRIVERVIEWVIEW_HPP
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "gui/common/DataField.hpp"
|
||||
#include "texts/TextKeysAndLanguages.hpp"
|
||||
#include "touchgfx/Color.hpp"
|
||||
#include "touchgfx/Unicode.hpp"
|
||||
#include <gui/containers/DriverViewField.hpp>
|
||||
|
||||
|
@ -43,6 +44,12 @@ void DriverViewField::setValue(int boolValue) {
|
|||
updateValueBuffer();
|
||||
}
|
||||
|
||||
void DriverViewField::setSelected(int selected) {
|
||||
uint8_t v = selected ? 0x44 : 0x00;
|
||||
box.setColor(touchgfx::Color::getColorFromRGB(v, v, v));
|
||||
box.invalidate();
|
||||
}
|
||||
|
||||
void DriverViewField::updateValueBuffer() {
|
||||
switch (fieldKind) {
|
||||
case DataFieldKind::Numeric: {
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#include "touchgfx/Color.hpp"
|
||||
#include <gui/containers/DriverViewFieldSelection.hpp>
|
||||
|
||||
DriverViewFieldSelection::DriverViewFieldSelection() {}
|
||||
|
||||
void DriverViewFieldSelection::initialize() {
|
||||
DriverViewFieldSelectionBase::initialize();
|
||||
}
|
||||
|
||||
void DriverViewFieldSelection::setName(const touchgfx::TypedText &name) {
|
||||
this->name.setTypedText(name);
|
||||
}
|
||||
|
||||
void DriverViewFieldSelection::setSelected(int selected) {
|
||||
int val = selected ? 0x66 : 0x22;
|
||||
bg.setColor(touchgfx::Color::getColorFromRGB(val, val, val));
|
||||
}
|
|
@ -21,17 +21,17 @@ void DriverViewPresenter::vehicleStateUpdated() {
|
|||
|
||||
for (size_t i = 0; i < 3; i++) {
|
||||
DataFieldType field = fields[i];
|
||||
void *val = dataFieldDescs[field].getValue();
|
||||
switch (dataFieldDescs[field].kind) {
|
||||
case DataFieldKind::Numeric:
|
||||
view.setFieldValue(i, *((float *)val));
|
||||
break;
|
||||
case DataFieldKind::Bool:
|
||||
view.setFieldValue(i, *((int *)val));
|
||||
break;
|
||||
case DataFieldKind::Text:
|
||||
view.setFieldValue(i, (const char *)val);
|
||||
break;
|
||||
}
|
||||
// void *val = dataFieldDescs[field].getValue();
|
||||
// switch (dataFieldDescs[field].kind) {
|
||||
// case DataFieldKind::Numeric:
|
||||
// view.setFieldValue(i, *((float *)val));
|
||||
// break;
|
||||
// case DataFieldKind::Bool:
|
||||
// view.setFieldValue(i, *((int *)val));
|
||||
// break;
|
||||
// case DataFieldKind::Text:
|
||||
// view.setFieldValue(i, (const char *)val);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,27 @@
|
|||
#include "gui/common/DataField.hpp"
|
||||
#include "gui/containers/DriverViewField.hpp"
|
||||
#include "texts/TextKeysAndLanguages.hpp"
|
||||
#include <gui/driverview_screen/DriverViewView.hpp>
|
||||
|
||||
DriverViewView::DriverViewView() {}
|
||||
DriverViewView::DriverViewView()
|
||||
: fieldTypes{DF_MinCellVolt, DF_Speed, DF_TSCurrent} {}
|
||||
|
||||
void DriverViewView::setupScreen() {
|
||||
DriverViewViewBase::setupScreen();
|
||||
field1.setType(dataFieldDescs[DF_MinCellVolt]);
|
||||
field2.setType(dataFieldDescs[DF_Speed]);
|
||||
field3.setType(dataFieldDescs[DF_TSCurrent]);
|
||||
for (size_t i = 0; i < NUM_FIELDS; i++) {
|
||||
getField(i).setType(dataFieldDescs[fieldTypes[i]]);
|
||||
}
|
||||
fieldTypeSelection.setNumberOfItems(DataFieldType_COUNT);
|
||||
}
|
||||
|
||||
void DriverViewView::tearDownScreen() { DriverViewViewBase::tearDownScreen(); }
|
||||
|
||||
void DriverViewView::fieldTypeSelectionUpdateItem(
|
||||
DriverViewFieldSelection &item, int16_t itemIndex) {
|
||||
item.setName(dataFieldDescs[itemIndex].title);
|
||||
item.setSelected(itemIndex == selectedFieldType);
|
||||
}
|
||||
|
||||
void DriverViewView::setFieldType(size_t i, const DataFieldDescription &desc) {
|
||||
getField(i).setType(desc);
|
||||
}
|
||||
|
@ -41,6 +50,59 @@ void DriverViewView::setTSSoC(uint8_t soc) {
|
|||
tsSoC.invalidate();
|
||||
}
|
||||
|
||||
void DriverViewView::selectNextField() {
|
||||
if (!fieldTypeSelection.isVisible()) {
|
||||
fieldTypeSelection.setVisible(true);
|
||||
updateSelectedField(0);
|
||||
} else {
|
||||
updateSelectedField((selectedField + 1) % NUM_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
void DriverViewView::selectPrevField() {
|
||||
if (!fieldTypeSelection.isVisible()) {
|
||||
fieldTypeSelection.setVisible(true);
|
||||
updateSelectedField(NUM_FIELDS - 1);
|
||||
} else {
|
||||
if (selectedField == 0) {
|
||||
updateSelectedField(NUM_FIELDS - 1);
|
||||
} else {
|
||||
updateSelectedField(selectedField - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DriverViewView::selectNextFieldType() {
|
||||
if (!fieldTypeSelection.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateSelectedFieldType((selectedFieldType + 1) % DataFieldType_COUNT);
|
||||
}
|
||||
|
||||
void DriverViewView::selectPrevFieldType() {
|
||||
if (!fieldTypeSelection.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedFieldType == 0) {
|
||||
updateSelectedFieldType(DataFieldType_COUNT - 1);
|
||||
} else {
|
||||
updateSelectedFieldType(selectedFieldType - 1);
|
||||
}
|
||||
}
|
||||
|
||||
void DriverViewView::confirmFieldType() {
|
||||
if (!fieldTypeSelection.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DriverViewField &field = getField(selectedField);
|
||||
field.setType(dataFieldDescs[selectedFieldType]);
|
||||
field.setSelected(false);
|
||||
fieldTypeSelection.setVisible(false);
|
||||
}
|
||||
|
||||
DriverViewField &DriverViewView::getField(size_t i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
|
@ -51,3 +113,29 @@ DriverViewField &DriverViewView::getField(size_t i) {
|
|||
return field3;
|
||||
}
|
||||
}
|
||||
|
||||
DriverViewFieldSelection *DriverViewView::getFieldType(size_t i) {
|
||||
return static_cast<DriverViewFieldSelection *>(
|
||||
fieldTypeSelectionListItems.getDrawable(i));
|
||||
}
|
||||
|
||||
void DriverViewView::updateSelectedField(size_t selected) {
|
||||
getField(selectedField).setSelected(false);
|
||||
DriverViewField &field = getField(selected);
|
||||
field.setSelected(true);
|
||||
fieldTypeSelection.moveTo(field.getX(), fieldTypeSelection.getY());
|
||||
fieldTypeSelection.invalidate();
|
||||
selectedField = selected;
|
||||
|
||||
updateSelectedFieldType(fieldTypes[selectedField]);
|
||||
}
|
||||
|
||||
void DriverViewView::updateSelectedFieldType(size_t selected) {
|
||||
size_t previousSelected = selectedFieldType;
|
||||
selectedFieldType = selected;
|
||||
// Trigger update of the background
|
||||
fieldTypeSelection.itemChanged(previousSelected);
|
||||
fieldTypeSelection.itemChanged(selectedFieldType);
|
||||
|
||||
fieldTypeSelection.animateToItem(selectedFieldType, 0);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
<ClCompile Include="..\..\gui\src\containers\DriverViewField.cpp"/>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\containers\DriverViewFieldBase.cpp"/>
|
||||
<ClCompile Include="..\..\gui\src\common\DataField.cpp"/>
|
||||
<ClCompile Include="..\..\gui\src\containers\DriverViewFieldSelection.cpp"/>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\containers\DriverViewFieldSelectionBase.cpp"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(ApplicationRoot)\assets\texts\texts.xml"/>
|
||||
|
@ -203,6 +205,8 @@
|
|||
<ClInclude Include="..\..\gui\include\gui\containers\DriverViewField.hpp"/>
|
||||
<ClInclude Include="..\..\generated\gui_generated\include\gui_generated\containers\DriverViewFieldBase.hpp"/>
|
||||
<ClInclude Include="..\..\gui\include\gui\common\DataField.hpp"/>
|
||||
<ClInclude Include="..\..\gui\include\gui\containers\DriverViewFieldSelection.hpp"/>
|
||||
<ClInclude Include="..\..\generated\gui_generated\include\gui_generated\containers\DriverViewFieldSelectionBase.hpp"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(ApplicationRoot)\generated\simulator\touchgfx.rc"/>
|
||||
|
|
|
@ -300,6 +300,12 @@
|
|||
<ClCompile Include="..\..\gui\src\common\DataField.cpp">
|
||||
<Filter>Source Files\gui\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gui\src\containers\DriverViewFieldSelection.cpp">
|
||||
<Filter>Source Files\gui\containers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\containers\DriverViewFieldSelectionBase.cpp">
|
||||
<Filter>Source Files\generated\gui_generated\containers</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(ApplicationRoot)\assets\texts\texts.xml">
|
||||
|
@ -790,6 +796,12 @@
|
|||
<ClInclude Include="..\..\gui\include\gui\common\DataField.hpp">
|
||||
<Filter>Header Files\gui\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\gui\include\gui\containers\DriverViewFieldSelection.hpp">
|
||||
<Filter>Header Files\gui\containers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\gui_generated\include\gui_generated\containers\DriverViewFieldSelectionBase.hpp">
|
||||
<Filter>Header Files\generated\gui_generated\containers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(ApplicationRoot)\generated\simulator\touchgfx.rc">
|
||||
|
|
|
@ -403,9 +403,81 @@
|
|||
"Width": 160,
|
||||
"Height": 80,
|
||||
"CustomContainerDefinitionName": "DriverViewField"
|
||||
},
|
||||
{
|
||||
"Type": "ScrollWheel",
|
||||
"Name": "fieldTypeSelection",
|
||||
"Y": 80,
|
||||
"Width": 160,
|
||||
"Height": 240,
|
||||
"Visible": false,
|
||||
"SelectedItemOffset": 94,
|
||||
"IsCircular": true,
|
||||
"ItemTemplateName": "DriverViewFieldSelection",
|
||||
"NumberofItems": 1,
|
||||
"Easing": "Back",
|
||||
"EasingOption": "Out",
|
||||
"SwipeAcceleration": 1.0,
|
||||
"DragAcceleration": 1.0
|
||||
}
|
||||
],
|
||||
"Interactions": []
|
||||
"Interactions": [
|
||||
{
|
||||
"InteractionName": "SelectPreviousField",
|
||||
"Trigger": {
|
||||
"Type": "TriggerPhysicalButtonClicked",
|
||||
"ButtonKey": 22
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
"FunctionName": "selectPrevField"
|
||||
}
|
||||
},
|
||||
{
|
||||
"InteractionName": "SelectNextField",
|
||||
"Trigger": {
|
||||
"Type": "TriggerPhysicalButtonClicked",
|
||||
"ButtonKey": 21
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
"FunctionName": "selectNextField"
|
||||
}
|
||||
},
|
||||
{
|
||||
"InteractionName": "SelectPreviousFieldType",
|
||||
"Trigger": {
|
||||
"Type": "TriggerPhysicalButtonClicked",
|
||||
"ButtonKey": 24
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
"FunctionName": "selectPrevFieldType"
|
||||
}
|
||||
},
|
||||
{
|
||||
"InteractionName": "SelectNextFieldType",
|
||||
"Trigger": {
|
||||
"Type": "TriggerPhysicalButtonClicked",
|
||||
"ButtonKey": 23
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
"FunctionName": "selectNextFieldType"
|
||||
}
|
||||
},
|
||||
{
|
||||
"InteractionName": "ConfirmFieldType",
|
||||
"Trigger": {
|
||||
"Type": "TriggerPhysicalButtonClicked",
|
||||
"ButtonKey": 6
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
"FunctionName": "confirmFieldType"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"CustomContainerDefinitions": [
|
||||
|
@ -537,6 +609,84 @@
|
|||
}
|
||||
],
|
||||
"Interactions": []
|
||||
},
|
||||
{
|
||||
"Name": "DriverViewFieldSelection",
|
||||
"X": 100,
|
||||
"Y": 227,
|
||||
"Width": 160,
|
||||
"Height": 26,
|
||||
"Components": [
|
||||
{
|
||||
"Type": "Box",
|
||||
"Name": "bg",
|
||||
"Width": 160,
|
||||
"Height": 25,
|
||||
"Color": {
|
||||
"Red": 34,
|
||||
"Green": 34,
|
||||
"Blue": 34
|
||||
}
|
||||
},
|
||||
{
|
||||
"Type": "TextArea",
|
||||
"Name": "name",
|
||||
"Width": 160,
|
||||
"Height": 25,
|
||||
"TextId": "__SingleUse_PNKR",
|
||||
"TextRotation": "0",
|
||||
"Color": {
|
||||
"Red": 255,
|
||||
"Green": 255,
|
||||
"Blue": 255
|
||||
}
|
||||
},
|
||||
{
|
||||
"Type": "Line",
|
||||
"Name": "line1",
|
||||
"Y": 25,
|
||||
"Width": 160,
|
||||
"Height": 1,
|
||||
"Color": {
|
||||
"Red": 255,
|
||||
"Green": 255,
|
||||
"Blue": 255
|
||||
},
|
||||
"EndX": 160.0,
|
||||
"LineWidth": 10.0,
|
||||
"LineEndingStyle": "Round"
|
||||
},
|
||||
{
|
||||
"Type": "Line",
|
||||
"Name": "line2",
|
||||
"Width": 1,
|
||||
"Height": 26,
|
||||
"Color": {
|
||||
"Red": 255,
|
||||
"Green": 255,
|
||||
"Blue": 255
|
||||
},
|
||||
"EndY": 26.0,
|
||||
"LineWidth": 10.0,
|
||||
"LineEndingStyle": "Round"
|
||||
},
|
||||
{
|
||||
"Type": "Line",
|
||||
"Name": "line2_1",
|
||||
"X": 159,
|
||||
"Width": 1,
|
||||
"Height": 26,
|
||||
"Color": {
|
||||
"Red": 255,
|
||||
"Green": 255,
|
||||
"Blue": 255
|
||||
},
|
||||
"EndY": 26.0,
|
||||
"LineWidth": 10.0,
|
||||
"LineEndingStyle": "Round"
|
||||
}
|
||||
],
|
||||
"Interactions": []
|
||||
}
|
||||
],
|
||||
"Name": "MyApplication",
|
||||
|
@ -545,7 +695,7 @@
|
|||
"Height": 480
|
||||
},
|
||||
"SelectedColorDepth": 16,
|
||||
"StartupScreenName": "MissionSelect",
|
||||
"StartupScreenName": "DriverView",
|
||||
"SelectedStartupLanguage": "GB",
|
||||
"TouchGfxPath": "../Middlewares/ST/touchgfx",
|
||||
"UIPath": ".",
|
||||
|
|
Loading…
Reference in New Issue