mirror of https://github.com/rusefi/car-dash-7.git
removed second screen and added rpm sweep.
This commit is contained in:
parent
c2c86287d9
commit
57539e3c2b
|
@ -22,16 +22,18 @@ extern "C" {
|
|||
#define ALERT_ENABLED 1
|
||||
|
||||
#define LED_NUMBER 24
|
||||
#define PROTECTION_RPM_LED 4
|
||||
#define LED_INVERTED 0
|
||||
|
||||
#define LCD_DEFAULT_BRIGHTNESS 500
|
||||
#define LED_DEFAULT_BRIGHTNESS LCD_DEFAULT_BRIGHTNESS / 50
|
||||
#define LED_DEFAULT_BRIGHTNESS 20
|
||||
|
||||
|
||||
#define RPM_SWEEP 1
|
||||
#define PROTECTION_RPM_LOW 6500
|
||||
#define PROTECTION_RPM_HIGH 7500
|
||||
#define LCD_RPM_HIGH PROTECTION_RPM_HIGH
|
||||
|
||||
#define PROTECTION_RPM_LED 10
|
||||
|
||||
#define PROTECTION_OIL_LOW 40
|
||||
#define PROTECTION_FUEL_LOW 40
|
||||
|
|
|
@ -1819,6 +1819,35 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
}
|
||||
}
|
||||
|
||||
void Update_RPM_Ranges()
|
||||
{
|
||||
Current_Status.RPM_100 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 100);
|
||||
Current_Status.RPM_100 =
|
||||
Current_Status.RPM_100 >= 100 ?
|
||||
100 : Current_Status.RPM_100;
|
||||
Current_Status.RPM_180 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 180);
|
||||
Current_Status.RPM_180 =
|
||||
Current_Status.RPM_180 >= 180 ?
|
||||
810 : Current_Status.RPM_180;
|
||||
Current_Status.RPM_270 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 270);
|
||||
Current_Status.RPM_270 =
|
||||
Current_Status.RPM_270 >= 270 ?
|
||||
270 : Current_Status.RPM_270;
|
||||
Current_Status.RPM_240 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 240);
|
||||
Current_Status.RPM_240 =
|
||||
Current_Status.RPM_240 >= 240 ?
|
||||
240 : Current_Status.RPM_240;
|
||||
Current_Status.RPM_360 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 360);
|
||||
Current_Status.RPM_360 =
|
||||
Current_Status.RPM_360 >= 360 ?
|
||||
360 : Current_Status.RPM_360;
|
||||
}
|
||||
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
|
@ -1943,6 +1972,23 @@ void Start_CAN_Task(void *argument)
|
|||
Current_Status.SPEED_UNIT = Kmh;
|
||||
HAL_GPIO_WritePin(CAN1_SEL0_GPIO_Port, CAN1_SEL0_Pin, SET);
|
||||
|
||||
osDelay(1000);
|
||||
|
||||
if(RPM_SWEEP)
|
||||
{
|
||||
for (int i = 0; i < PROTECTION_RPM_HIGH / 100; ++i) {
|
||||
Current_Status.RPM = i * 100;
|
||||
Update_RPM_Ranges();
|
||||
osDelay(10);
|
||||
}
|
||||
for (int i = PROTECTION_RPM_HIGH / 100; i > 0; --i) {
|
||||
Current_Status.RPM = i * 100;
|
||||
Update_RPM_Ranges();
|
||||
osDelay(10);
|
||||
}
|
||||
}
|
||||
Current_Status.RPM = 0;
|
||||
Update_RPM_Ranges();
|
||||
//Current_Status.RPM = 4500;
|
||||
|
||||
for (;;) {
|
||||
|
@ -2273,33 +2319,9 @@ void Start_CAN_Task(void *argument)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
HAL_GPIO_TogglePin(LED_PJ15_GPIO_Port, LED_PJ15_Pin);
|
||||
|
||||
Current_Status.RPM_100 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 100);
|
||||
Current_Status.RPM_100 =
|
||||
Current_Status.RPM_100 >= 100 ?
|
||||
100 : Current_Status.RPM_100;
|
||||
Current_Status.RPM_180 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 180);
|
||||
Current_Status.RPM_180 =
|
||||
Current_Status.RPM_180 >= 180 ?
|
||||
810 : Current_Status.RPM_180;
|
||||
Current_Status.RPM_270 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 270);
|
||||
Current_Status.RPM_270 =
|
||||
Current_Status.RPM_270 >= 270 ?
|
||||
270 : Current_Status.RPM_270;
|
||||
Current_Status.RPM_240 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 240);
|
||||
Current_Status.RPM_240 =
|
||||
Current_Status.RPM_240 >= 240 ?
|
||||
240 : Current_Status.RPM_240;
|
||||
Current_Status.RPM_360 = mapInt(Current_Status.RPM, 0,
|
||||
LCD_RPM_HIGH, 0, 360);
|
||||
Current_Status.RPM_360 =
|
||||
Current_Status.RPM_360 >= 360 ?
|
||||
360 : Current_Status.RPM_360;
|
||||
HAL_GPIO_TogglePin(LED_PJ15_GPIO_Port, LED_PJ15_Pin);
|
||||
Update_RPM_Ranges();
|
||||
osDelay(1);
|
||||
}
|
||||
else {
|
||||
|
@ -2398,7 +2420,7 @@ void Start_RGB_Task(void *argument)
|
|||
WS2812_Clear(0);
|
||||
uint8_t RPMLED = LED_NUMBER;
|
||||
|
||||
uint16_t lowRange = mapInt(Current_Status.RPM, PROTECTION_RPM_LOW, 0, RPMLED - PROTECTION_RPM_LED, 1);
|
||||
uint16_t lowRange = LED_INVERTED ? mapInt(Current_Status.RPM, PROTECTION_RPM_LOW, 0, 1, RPMLED - PROTECTION_RPM_LED) : mapInt(Current_Status.RPM, PROTECTION_RPM_LOW, 0, RPMLED - PROTECTION_RPM_LED, 1);
|
||||
lowRange = lowRange > RPMLED - PROTECTION_RPM_LED ? RPMLED - PROTECTION_RPM_LED : lowRange;
|
||||
lowRange = lowRange < 1 ? 1 : lowRange;
|
||||
|
||||
|
@ -2417,7 +2439,7 @@ void Start_RGB_Task(void *argument)
|
|||
}
|
||||
|
||||
if (Current_Status.RPM > PROTECTION_RPM_LOW) {
|
||||
uint16_t highRange = mapInt(Current_Status.RPM, PROTECTION_RPM_HIGH, PROTECTION_RPM_LOW, PROTECTION_RPM_LED, 1);
|
||||
uint16_t highRange = LED_INVERTED ? mapInt(Current_Status.RPM, PROTECTION_RPM_HIGH, PROTECTION_RPM_LOW, 1, PROTECTION_RPM_LED) : mapInt(Current_Status.RPM, PROTECTION_RPM_HIGH, PROTECTION_RPM_LOW, PROTECTION_RPM_LED, 1);
|
||||
for (int i = 1; i <= highRange; i++) {
|
||||
WS2812_RGB_t color;
|
||||
color.red = 255;
|
||||
|
|
|
@ -640,125 +640,9 @@
|
|||
},
|
||||
"ArcCapStyle": "Butt",
|
||||
"ArcOnTopOfNeedle": true
|
||||
},
|
||||
{
|
||||
"Type": "FlexButton",
|
||||
"Name": "flexButton1",
|
||||
"X": 859,
|
||||
"Width": 165,
|
||||
"Height": 601,
|
||||
"Alpha": 0,
|
||||
"ButtonTrigger": {
|
||||
"Type": "ClickButtonTrigger"
|
||||
},
|
||||
"ButtonStyles": [
|
||||
{
|
||||
"Type": "BoxWithBorderButtonStyle",
|
||||
"Width": 165,
|
||||
"Height": 601,
|
||||
"LockToFlexButtonSize": true,
|
||||
"BorderSize": 5,
|
||||
"ColorReleased": {
|
||||
"Green": 102,
|
||||
"Blue": 153
|
||||
},
|
||||
"ColorPressed": {
|
||||
"Green": 153,
|
||||
"Blue": 204
|
||||
},
|
||||
"ColorBorderReleased": {
|
||||
"Green": 51,
|
||||
"Blue": 102
|
||||
},
|
||||
"ColorBorderPressed": {
|
||||
"Red": 51,
|
||||
"Green": 102,
|
||||
"Blue": 153
|
||||
}
|
||||
}
|
||||
],
|
||||
"Clickable": true
|
||||
}
|
||||
],
|
||||
"Interactions": [
|
||||
{
|
||||
"InteractionName": "Interaction1",
|
||||
"Trigger": {
|
||||
"Type": "TriggerClicked",
|
||||
"TriggerComponent": "flexButton1"
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionGotoScreen",
|
||||
"ScreenTransitionType": "ScreenTransitionNone",
|
||||
"ActionComponent": "Screen2"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "Screen2",
|
||||
"Components": [
|
||||
{
|
||||
"Type": "Image",
|
||||
"Name": "image1",
|
||||
"X": 12,
|
||||
"Width": 1000,
|
||||
"Height": 600,
|
||||
"RelativeFilename": "basic_bg.png"
|
||||
},
|
||||
{
|
||||
"Type": "FlexButton",
|
||||
"Name": "flexButton1",
|
||||
"Y": -1,
|
||||
"Width": 165,
|
||||
"Height": 601,
|
||||
"Alpha": 0,
|
||||
"ButtonTrigger": {
|
||||
"Type": "ClickButtonTrigger"
|
||||
},
|
||||
"ButtonStyles": [
|
||||
{
|
||||
"Type": "BoxWithBorderButtonStyle",
|
||||
"Width": 165,
|
||||
"Height": 601,
|
||||
"LockToFlexButtonSize": true,
|
||||
"BorderSize": 5,
|
||||
"ColorReleased": {
|
||||
"Green": 102,
|
||||
"Blue": 153
|
||||
},
|
||||
"ColorPressed": {
|
||||
"Green": 153,
|
||||
"Blue": 204
|
||||
},
|
||||
"ColorBorderReleased": {
|
||||
"Green": 51,
|
||||
"Blue": 102
|
||||
},
|
||||
"ColorBorderPressed": {
|
||||
"Red": 51,
|
||||
"Green": 102,
|
||||
"Blue": 153
|
||||
}
|
||||
}
|
||||
],
|
||||
"Clickable": true
|
||||
}
|
||||
],
|
||||
"Interactions": [
|
||||
{
|
||||
"InteractionName": "Interaction1",
|
||||
"Trigger": {
|
||||
"Type": "TriggerClicked",
|
||||
"TriggerComponent": "flexButton1"
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionGotoScreen",
|
||||
"ScreenTransitionType": "ScreenTransitionNone",
|
||||
"ActionComponent": "Screen1"
|
||||
}
|
||||
}
|
||||
]
|
||||
"Interactions": []
|
||||
}
|
||||
],
|
||||
"CustomContainerDefinitions": [],
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"image_configuration": {
|
||||
"images": {
|
||||
"basic_bg.png": {
|
||||
"format": "L8_ARGB8888"
|
||||
},
|
||||
"indBatt.png": {
|
||||
"format": "L8_ARGB8888"
|
||||
},
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
|
@ -3,6 +3,6 @@
|
|||
touchgfx_path := ../Middlewares/ST/touchgfx
|
||||
|
||||
# Location of the TouchGFX Environment
|
||||
touchgfx_env := ../../../../../TouchGFX/4.21.1/env
|
||||
touchgfx_env := ../../../../../../TouchGFX/4.21.1/env
|
||||
# Optional additional compiler flags
|
||||
user_cflags := -DUSE_BPP=16
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<PropertyGroup Label="UserMacros">
|
||||
<UseBPP>16</UseBPP>
|
||||
<TouchGFXReleasePath>..\..\..\Middlewares\ST\touchgfx</TouchGFXReleasePath>
|
||||
<TouchGFXEnvPath>..\..\..\..\..\..\..\TouchGFX\4.21.1\env</TouchGFXEnvPath>
|
||||
<TouchGFXEnvPath>..\..\..\..\..\..\..\..\TouchGFX\4.21.1\env</TouchGFXEnvPath>
|
||||
<ApplicationRoot>..\..</ApplicationRoot>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup/>
|
||||
|
|
|
@ -23,9 +23,6 @@ public:
|
|||
// Screen1
|
||||
void gotoScreen1ScreenNoTransition();
|
||||
|
||||
// Screen2
|
||||
void gotoScreen2ScreenNoTransition();
|
||||
|
||||
protected:
|
||||
touchgfx::Callback<FrontendApplicationBase> transitionCallback;
|
||||
FrontendHeap& frontendHeap;
|
||||
|
@ -33,9 +30,6 @@ protected:
|
|||
|
||||
// Screen1
|
||||
void gotoScreen1ScreenNoTransitionImpl();
|
||||
|
||||
// Screen2
|
||||
void gotoScreen2ScreenNoTransitionImpl();
|
||||
};
|
||||
|
||||
#endif // FRONTENDAPPLICATIONBASE_HPP
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
#include <gui/screen1_screen/Screen1View.hpp>
|
||||
#include <gui/screen1_screen/Screen1Presenter.hpp>
|
||||
#include <gui/screen2_screen/Screen2View.hpp>
|
||||
#include <gui/screen2_screen/Screen2Presenter.hpp>
|
||||
|
||||
|
||||
/**
|
||||
|
@ -39,8 +37,7 @@ public:
|
|||
* @note All view types used in the application MUST be added to this list!
|
||||
*/
|
||||
typedef touchgfx::meta::TypeList< Screen1View,
|
||||
touchgfx::meta::TypeList< Screen2View,
|
||||
touchgfx::meta::Nil >
|
||||
touchgfx::meta::Nil
|
||||
> GeneratedViewTypes;
|
||||
|
||||
/**
|
||||
|
@ -53,8 +50,7 @@ public:
|
|||
* @note All presenter types used in the application MUST be added to this list!
|
||||
*/
|
||||
typedef touchgfx::meta::TypeList< Screen1Presenter,
|
||||
touchgfx::meta::TypeList< Screen2Presenter,
|
||||
touchgfx::meta::Nil >
|
||||
touchgfx::meta::Nil
|
||||
> GeneratedPresenterTypes;
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include <touchgfx/widgets/Image.hpp>
|
||||
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
|
||||
#include <touchgfx/widgets/Gauge.hpp>
|
||||
#include <touchgfx/containers/buttons/Buttons.hpp>
|
||||
#include <touchgfx/mixins/ClickListener.hpp>
|
||||
|
||||
class Screen1ViewBase : public touchgfx::View<Screen1Presenter>
|
||||
{
|
||||
|
@ -67,7 +65,6 @@ protected:
|
|||
touchgfx::TextAreaWithOneWildcard fuelp_label;
|
||||
touchgfx::TextAreaWithOneWildcard fuelp_units;
|
||||
touchgfx::Gauge gauge1;
|
||||
touchgfx::ClickListener< touchgfx::BoxWithBorderButtonStyle< touchgfx::ClickButtonTrigger > > flexButton1;
|
||||
|
||||
/*
|
||||
* Wildcard Buffers
|
||||
|
@ -123,16 +120,6 @@ protected:
|
|||
|
||||
private:
|
||||
|
||||
/*
|
||||
* Callback Declarations
|
||||
*/
|
||||
touchgfx::Callback<Screen1ViewBase, const touchgfx::AbstractButtonContainer&> flexButtonCallback;
|
||||
|
||||
/*
|
||||
* Callback Handler Declarations
|
||||
*/
|
||||
void flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src);
|
||||
|
||||
};
|
||||
|
||||
#endif // SCREEN1VIEWBASE_HPP
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#ifndef SCREEN2VIEWBASE_HPP
|
||||
#define SCREEN2VIEWBASE_HPP
|
||||
|
||||
#include <gui/common/FrontendApplication.hpp>
|
||||
#include <mvp/View.hpp>
|
||||
#include <gui/screen2_screen/Screen2Presenter.hpp>
|
||||
#include <touchgfx/widgets/Box.hpp>
|
||||
#include <touchgfx/widgets/Image.hpp>
|
||||
#include <touchgfx/containers/buttons/Buttons.hpp>
|
||||
#include <touchgfx/mixins/ClickListener.hpp>
|
||||
|
||||
class Screen2ViewBase : public touchgfx::View<Screen2Presenter>
|
||||
{
|
||||
public:
|
||||
Screen2ViewBase();
|
||||
virtual ~Screen2ViewBase();
|
||||
virtual void setupScreen();
|
||||
|
||||
protected:
|
||||
FrontendApplication& application() {
|
||||
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
|
||||
}
|
||||
|
||||
/*
|
||||
* Member Declarations
|
||||
*/
|
||||
touchgfx::Box __background;
|
||||
touchgfx::Image image1;
|
||||
touchgfx::ClickListener< touchgfx::BoxWithBorderButtonStyle< touchgfx::ClickButtonTrigger > > flexButton1;
|
||||
|
||||
private:
|
||||
|
||||
/*
|
||||
* Callback Declarations
|
||||
*/
|
||||
touchgfx::Callback<Screen2ViewBase, const touchgfx::AbstractButtonContainer&> flexButtonCallback;
|
||||
|
||||
/*
|
||||
* Callback Handler Declarations
|
||||
*/
|
||||
void flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src);
|
||||
|
||||
};
|
||||
|
||||
#endif // SCREEN2VIEWBASE_HPP
|
|
@ -11,8 +11,6 @@
|
|||
#include <platform/driver/lcd/LCD16bpp.hpp>
|
||||
#include <gui/screen1_screen/Screen1View.hpp>
|
||||
#include <gui/screen1_screen/Screen1Presenter.hpp>
|
||||
#include <gui/screen2_screen/Screen2View.hpp>
|
||||
#include <gui/screen2_screen/Screen2Presenter.hpp>
|
||||
|
||||
using namespace touchgfx;
|
||||
|
||||
|
@ -43,16 +41,3 @@ void FrontendApplicationBase::gotoScreen1ScreenNoTransitionImpl()
|
|||
{
|
||||
touchgfx::makeTransition<Screen1View, Screen1Presenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
|
||||
}
|
||||
|
||||
// Screen2
|
||||
|
||||
void FrontendApplicationBase::gotoScreen2ScreenNoTransition()
|
||||
{
|
||||
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoScreen2ScreenNoTransitionImpl);
|
||||
pendingScreenTransitionCallback = &transitionCallback;
|
||||
}
|
||||
|
||||
void FrontendApplicationBase::gotoScreen2ScreenNoTransitionImpl()
|
||||
{
|
||||
touchgfx::makeTransition<Screen2View, Screen2Presenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
#include <images/BitmapDatabase.hpp>
|
||||
#include <texts/TextKeysAndLanguages.hpp>
|
||||
|
||||
Screen1ViewBase::Screen1ViewBase() :
|
||||
flexButtonCallback(this, &Screen1ViewBase::flexButtonCallbackHandler)
|
||||
Screen1ViewBase::Screen1ViewBase()
|
||||
{
|
||||
__background.setPosition(0, 0, 1024, 600);
|
||||
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
|
||||
|
@ -286,14 +285,6 @@ Screen1ViewBase::Screen1ViewBase() :
|
|||
gauge1.setMovingNeedleRenderingAlgorithm(touchgfx::TextureMapper::BILINEAR_INTERPOLATION);
|
||||
gauge1.setSteadyNeedleRenderingAlgorithm(touchgfx::TextureMapper::BILINEAR_INTERPOLATION);
|
||||
add(gauge1);
|
||||
|
||||
flexButton1.setBoxWithBorderPosition(0, 0, 165, 601);
|
||||
flexButton1.setBorderSize(5);
|
||||
flexButton1.setBoxWithBorderColors(touchgfx::Color::getColorFromRGB(0, 102, 153), touchgfx::Color::getColorFromRGB(0, 153, 204), touchgfx::Color::getColorFromRGB(0, 51, 102), touchgfx::Color::getColorFromRGB(51, 102, 153));
|
||||
flexButton1.setAlpha(0);
|
||||
flexButton1.setAction(flexButtonCallback);
|
||||
flexButton1.setPosition(859, 0, 165, 601);
|
||||
add(flexButton1);
|
||||
}
|
||||
|
||||
Screen1ViewBase::~Screen1ViewBase()
|
||||
|
@ -305,14 +296,3 @@ void Screen1ViewBase::setupScreen()
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen1ViewBase::flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src)
|
||||
{
|
||||
if (&src == &flexButton1)
|
||||
{
|
||||
//Interaction1
|
||||
//When flexButton1 clicked change screen to Screen2
|
||||
//Go to Screen2 with no screen transition
|
||||
application().gotoScreen2ScreenNoTransition();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
/*********************************************************************************/
|
||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
|
||||
/*********************************************************************************/
|
||||
#include <gui_generated/screen2_screen/Screen2ViewBase.hpp>
|
||||
#include <touchgfx/Color.hpp>
|
||||
#include <images/BitmapDatabase.hpp>
|
||||
|
||||
Screen2ViewBase::Screen2ViewBase() :
|
||||
flexButtonCallback(this, &Screen2ViewBase::flexButtonCallbackHandler)
|
||||
{
|
||||
__background.setPosition(0, 0, 1024, 600);
|
||||
__background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
|
||||
add(__background);
|
||||
|
||||
image1.setXY(12, 0);
|
||||
image1.setBitmap(touchgfx::Bitmap(BITMAP_BASIC_BG_ID));
|
||||
add(image1);
|
||||
|
||||
flexButton1.setBoxWithBorderPosition(0, 0, 165, 601);
|
||||
flexButton1.setBorderSize(5);
|
||||
flexButton1.setBoxWithBorderColors(touchgfx::Color::getColorFromRGB(0, 102, 153), touchgfx::Color::getColorFromRGB(0, 153, 204), touchgfx::Color::getColorFromRGB(0, 51, 102), touchgfx::Color::getColorFromRGB(51, 102, 153));
|
||||
flexButton1.setAlpha(0);
|
||||
flexButton1.setAction(flexButtonCallback);
|
||||
flexButton1.setPosition(0, -1, 165, 601);
|
||||
add(flexButton1);
|
||||
}
|
||||
|
||||
Screen2ViewBase::~Screen2ViewBase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen2ViewBase::setupScreen()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen2ViewBase::flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src)
|
||||
{
|
||||
if (&src == &flexButton1)
|
||||
{
|
||||
//Interaction1
|
||||
//When flexButton1 clicked change screen to Screen1
|
||||
//Go to Screen1 with no screen transition
|
||||
application().gotoScreen1ScreenNoTransition();
|
||||
}
|
||||
}
|
|
@ -6,19 +6,18 @@
|
|||
#include <touchgfx/hal/Types.hpp>
|
||||
#include <touchgfx/Bitmap.hpp>
|
||||
|
||||
const uint16_t BITMAP_BASIC_BG_ID = 0;
|
||||
const uint16_t BITMAP_INDBATT_ID = 1;
|
||||
const uint16_t BITMAP_INDDTC_ID = 2;
|
||||
const uint16_t BITMAP_INDECT_ID = 3;
|
||||
const uint16_t BITMAP_INDFUEL_ID = 4;
|
||||
const uint16_t BITMAP_INDHIGH_ID = 5;
|
||||
const uint16_t BITMAP_INDLEFT_ID = 6;
|
||||
const uint16_t BITMAP_INDLOW_ID = 7;
|
||||
const uint16_t BITMAP_INDOIL_ID = 8;
|
||||
const uint16_t BITMAP_INDPARK_ID = 9;
|
||||
const uint16_t BITMAP_INDRIGHT_ID = 10;
|
||||
const uint16_t BITMAP_NEEDEL_ID = 11;
|
||||
const uint16_t BITMAP_RACE_DASH_FULL_ID = 12;
|
||||
const uint16_t BITMAP_INDBATT_ID = 0;
|
||||
const uint16_t BITMAP_INDDTC_ID = 1;
|
||||
const uint16_t BITMAP_INDECT_ID = 2;
|
||||
const uint16_t BITMAP_INDFUEL_ID = 3;
|
||||
const uint16_t BITMAP_INDHIGH_ID = 4;
|
||||
const uint16_t BITMAP_INDLEFT_ID = 5;
|
||||
const uint16_t BITMAP_INDLOW_ID = 6;
|
||||
const uint16_t BITMAP_INDOIL_ID = 7;
|
||||
const uint16_t BITMAP_INDPARK_ID = 8;
|
||||
const uint16_t BITMAP_INDRIGHT_ID = 9;
|
||||
const uint16_t BITMAP_NEEDEL_ID = 10;
|
||||
const uint16_t BITMAP_RACE_DASH_FULL_ID = 11;
|
||||
|
||||
namespace BitmapDatabase
|
||||
{
|
||||
|
|
|
@ -1,38 +1,35 @@
|
|||
// 4.21.1 0x4ba256c4
|
||||
// 4.21.1 0xda54a2d4
|
||||
// Generated by imageconverter. Please, do not edit!
|
||||
|
||||
#include <images/BitmapDatabase.hpp>
|
||||
#include <touchgfx/Bitmap.hpp>
|
||||
|
||||
extern const unsigned char image_basic_bg[]; // BITMAP_BASIC_BG_ID = 0, Size: 1000x600 pixels
|
||||
extern const unsigned char image_basic_bg_extra_data[];
|
||||
extern const unsigned char image_indbatt[]; // BITMAP_INDBATT_ID = 1, Size: 49x38 pixels
|
||||
extern const unsigned char image_indbatt[]; // BITMAP_INDBATT_ID = 0, Size: 49x38 pixels
|
||||
extern const unsigned char image_indbatt_extra_data[];
|
||||
extern const unsigned char image_inddtc[]; // BITMAP_INDDTC_ID = 2, Size: 75x36 pixels
|
||||
extern const unsigned char image_inddtc[]; // BITMAP_INDDTC_ID = 1, Size: 75x36 pixels
|
||||
extern const unsigned char image_inddtc_extra_data[];
|
||||
extern const unsigned char image_indect[]; // BITMAP_INDECT_ID = 3, Size: 45x40 pixels
|
||||
extern const unsigned char image_indect[]; // BITMAP_INDECT_ID = 2, Size: 45x40 pixels
|
||||
extern const unsigned char image_indect_extra_data[];
|
||||
extern const unsigned char image_indfuel[]; // BITMAP_INDFUEL_ID = 4, Size: 32x40 pixels
|
||||
extern const unsigned char image_indfuel[]; // BITMAP_INDFUEL_ID = 3, Size: 32x40 pixels
|
||||
extern const unsigned char image_indfuel_extra_data[];
|
||||
extern const unsigned char image_indhigh[]; // BITMAP_INDHIGH_ID = 5, Size: 49x28 pixels
|
||||
extern const unsigned char image_indhigh[]; // BITMAP_INDHIGH_ID = 4, Size: 49x28 pixels
|
||||
extern const unsigned char image_indhigh_extra_data[];
|
||||
extern const unsigned char image_indleft[]; // BITMAP_INDLEFT_ID = 6, Size: 65x42 pixels
|
||||
extern const unsigned char image_indleft[]; // BITMAP_INDLEFT_ID = 5, Size: 65x42 pixels
|
||||
extern const unsigned char image_indleft_extra_data[];
|
||||
extern const unsigned char image_indlow[]; // BITMAP_INDLOW_ID = 7, Size: 48x30 pixels
|
||||
extern const unsigned char image_indlow[]; // BITMAP_INDLOW_ID = 6, Size: 48x30 pixels
|
||||
extern const unsigned char image_indlow_extra_data[];
|
||||
extern const unsigned char image_indoil[]; // BITMAP_INDOIL_ID = 8, Size: 67x28 pixels
|
||||
extern const unsigned char image_indoil[]; // BITMAP_INDOIL_ID = 7, Size: 67x28 pixels
|
||||
extern const unsigned char image_indoil_extra_data[];
|
||||
extern const unsigned char image_indpark[]; // BITMAP_INDPARK_ID = 9, Size: 56x41 pixels
|
||||
extern const unsigned char image_indpark[]; // BITMAP_INDPARK_ID = 8, Size: 56x41 pixels
|
||||
extern const unsigned char image_indpark_extra_data[];
|
||||
extern const unsigned char image_indright[]; // BITMAP_INDRIGHT_ID = 10, Size: 65x42 pixels
|
||||
extern const unsigned char image_indright[]; // BITMAP_INDRIGHT_ID = 9, Size: 65x42 pixels
|
||||
extern const unsigned char image_indright_extra_data[];
|
||||
extern const unsigned char image_needel[]; // BITMAP_NEEDEL_ID = 11, Size: 34x290 pixels
|
||||
extern const unsigned char image_needel[]; // BITMAP_NEEDEL_ID = 10, Size: 34x290 pixels
|
||||
extern const unsigned char image_needel_extra_data[];
|
||||
extern const unsigned char image_race_dash_full[]; // BITMAP_RACE_DASH_FULL_ID = 12, Size: 1027x617 pixels
|
||||
extern const unsigned char image_race_dash_full[]; // BITMAP_RACE_DASH_FULL_ID = 11, Size: 1027x617 pixels
|
||||
extern const unsigned char image_race_dash_full_extra_data[];
|
||||
|
||||
const touchgfx::Bitmap::BitmapData bitmap_database[] = {
|
||||
{ image_basic_bg, image_basic_bg_extra_data, 1000, 600, 0, 0, 1000, ((uint8_t)touchgfx::Bitmap::L8) >> 3, 600, ((uint8_t)touchgfx::Bitmap::L8) & 0x7 },
|
||||
{ image_indbatt, image_indbatt_extra_data, 49, 38, 1, 4, 47, ((uint8_t)touchgfx::Bitmap::L8) >> 3, 2, ((uint8_t)touchgfx::Bitmap::L8) & 0x7 },
|
||||
{ image_inddtc, image_inddtc_extra_data, 75, 36, 18, 1, 3, ((uint8_t)touchgfx::Bitmap::L8) >> 3, 14, ((uint8_t)touchgfx::Bitmap::L8) & 0x7 },
|
||||
{ image_indect, image_indect_extra_data, 45, 40, 20, 2, 5, ((uint8_t)touchgfx::Bitmap::L8) >> 3, 32, ((uint8_t)touchgfx::Bitmap::L8) & 0x7 },
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,36 +0,0 @@
|
|||
#ifndef SCREEN2PRESENTER_HPP
|
||||
#define SCREEN2PRESENTER_HPP
|
||||
|
||||
#include <gui/model/ModelListener.hpp>
|
||||
#include <mvp/Presenter.hpp>
|
||||
|
||||
using namespace touchgfx;
|
||||
|
||||
class Screen2View;
|
||||
|
||||
class Screen2Presenter : public touchgfx::Presenter, public ModelListener
|
||||
{
|
||||
public:
|
||||
Screen2Presenter(Screen2View& v);
|
||||
|
||||
/**
|
||||
* The activate function is called automatically when this screen is "switched in"
|
||||
* (ie. made active). Initialization logic can be placed here.
|
||||
*/
|
||||
virtual void activate();
|
||||
|
||||
/**
|
||||
* The deactivate function is called automatically when this screen is "switched out"
|
||||
* (ie. made inactive). Teardown functionality can be placed here.
|
||||
*/
|
||||
virtual void deactivate();
|
||||
|
||||
virtual ~Screen2Presenter() {};
|
||||
|
||||
private:
|
||||
Screen2Presenter();
|
||||
|
||||
Screen2View& view;
|
||||
};
|
||||
|
||||
#endif // SCREEN2PRESENTER_HPP
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef SCREEN2VIEW_HPP
|
||||
#define SCREEN2VIEW_HPP
|
||||
|
||||
#include <gui_generated/screen2_screen/Screen2ViewBase.hpp>
|
||||
#include <gui/screen2_screen/Screen2Presenter.hpp>
|
||||
|
||||
class Screen2View : public Screen2ViewBase
|
||||
{
|
||||
public:
|
||||
Screen2View();
|
||||
virtual ~Screen2View() {}
|
||||
virtual void setupScreen();
|
||||
virtual void tearDownScreen();
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif // SCREEN2VIEW_HPP
|
|
@ -1,18 +0,0 @@
|
|||
#include <gui/screen2_screen/Screen2View.hpp>
|
||||
#include <gui/screen2_screen/Screen2Presenter.hpp>
|
||||
|
||||
Screen2Presenter::Screen2Presenter(Screen2View& v)
|
||||
: view(v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen2Presenter::activate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen2Presenter::deactivate()
|
||||
{
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
#include <gui/screen2_screen/Screen2View.hpp>
|
||||
|
||||
Screen2View::Screen2View()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen2View::setupScreen()
|
||||
{
|
||||
Screen2ViewBase::setupScreen();
|
||||
}
|
||||
|
||||
void Screen2View::tearDownScreen()
|
||||
{
|
||||
Screen2ViewBase::tearDownScreen();
|
||||
}
|
|
@ -24,9 +24,6 @@
|
|||
<ClCompile Include="..\..\gui\src\screen1_screen\Screen1View.cpp"/>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\screen1_screen\Screen1ViewBase.cpp"/>
|
||||
<ClCompile Include="..\..\generated\simulator\src\video\SoftwareMJPEGDecoder.cpp"/>
|
||||
<ClCompile Include="..\..\gui\src\screen2_screen\Screen2Presenter.cpp"/>
|
||||
<ClCompile Include="..\..\gui\src\screen2_screen\Screen2View.cpp"/>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\screen2_screen\Screen2ViewBase.cpp"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(ApplicationRoot)\assets\texts\texts.xlsx"/>
|
||||
|
@ -180,9 +177,6 @@
|
|||
<ClInclude Include="..\..\generated\simulator\include\simulator\video\DirectFrameBufferVideoController.hpp"/>
|
||||
<ClInclude Include="..\..\generated\simulator\include\simulator\video\MJPEGDecoder.hpp"/>
|
||||
<ClInclude Include="..\..\generated\simulator\include\simulator\video\SoftwareMJPEGDecoder.hpp"/>
|
||||
<ClInclude Include="..\..\gui\include\gui\screen2_screen\Screen2Presenter.hpp"/>
|
||||
<ClInclude Include="..\..\gui\include\gui\screen2_screen\Screen2View.hpp"/>
|
||||
<ClInclude Include="..\..\generated\gui_generated\include\gui_generated\screen2_screen\Screen2ViewBase.hpp"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(ApplicationRoot)\generated\simulator\touchgfx.rc"/>
|
||||
|
|
|
@ -184,18 +184,6 @@
|
|||
<Filter Include="Header Files\generated\simulator\include\simulator\video">
|
||||
<UniqueIdentifier>FEAB36D2-6EAE-8E7F-8490-75A102181AFB</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\gui\screen2_screen">
|
||||
<UniqueIdentifier>40D08271-9029-DFC3-B136-5B4B5EDDF908</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\gui\screen2_screen">
|
||||
<UniqueIdentifier>4D931937-7958-6404-32D6-4F0E129184E2</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\generated\gui_generated\screen2_screen">
|
||||
<UniqueIdentifier>02837A87-BD5A-3EFE-9165-421E80CFE38E</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\generated\gui_generated\screen2_screen">
|
||||
<UniqueIdentifier>08170EC0-C333-6F61-A8E1-8FBC9B271942</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(TouchGFXReleasePath)\framework\source\platform\driver\touch\SDL2TouchController.cpp">
|
||||
|
@ -237,15 +225,6 @@
|
|||
<ClCompile Include="..\..\generated\simulator\src\video\SoftwareMJPEGDecoder.cpp">
|
||||
<Filter>Source Files\generated\simulator\video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gui\src\screen2_screen\Screen2Presenter.cpp">
|
||||
<Filter>Source Files\gui\screen2_screen</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\gui\src\screen2_screen\Screen2View.cpp">
|
||||
<Filter>Source Files\gui\screen2_screen</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\gui_generated\src\screen2_screen\Screen2ViewBase.cpp">
|
||||
<Filter>Source Files\generated\gui_generated\screen2_screen</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(ApplicationRoot)\assets\texts\texts.xlsx">
|
||||
|
@ -697,15 +676,6 @@
|
|||
<ClInclude Include="..\..\generated\simulator\include\simulator\video\SoftwareMJPEGDecoder.hpp">
|
||||
<Filter>Header Files\generated\simulator\include\simulator\video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\gui\include\gui\screen2_screen\Screen2Presenter.hpp">
|
||||
<Filter>Header Files\gui\screen2_screen</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\gui\include\gui\screen2_screen\Screen2View.hpp">
|
||||
<Filter>Header Files\gui\screen2_screen</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\gui_generated\include\gui_generated\screen2_screen\Screen2ViewBase.hpp">
|
||||
<Filter>Header Files\generated\gui_generated\screen2_screen</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(ApplicationRoot)\generated\simulator\touchgfx.rc">
|
||||
|
|
Loading…
Reference in New Issue