Skip to content

Commit

Permalink
misc: UI: Adjustment, new screen
Browse files Browse the repository at this point in the history
  • Loading branch information
qqq89513 committed Jan 10, 2021
1 parent 4e74019 commit 0630d47
Show file tree
Hide file tree
Showing 35 changed files with 7,493 additions and 2,993 deletions.
2 changes: 1 addition & 1 deletion Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int main(void)
printf("[Info] TouchGFX initialized.\r\n");

MX_USB_DEVICE_Init();
HAL_Delay(300);
HAL_Delay(500);
printf("[Info] USB DEVICE initialized.\r\n");

printf("[Info] Entering while(1)...\r\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern "C" {


#define AUDIO_OUT_PACKET (uint16_t)(((USBD_AUDIO_FREQ * 2U * 2U) / 1000U))
#define AUDIO_DEFAULT_VOLUME 70U
#define AUDIO_DEFAULT_VOLUME 0U

/* Number of sub-packets in the audio transfer buffer. You can modify this value but always make sure
that it is an even number and higher than 3 */
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 128 additions & 28 deletions TouchGFX/equalizer.touchgfx
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,44 @@
"Type": "ClickButtonTrigger"
},
"ButtonStyles": [
{
"Type": "IconButtonStyle",
"X": 0,
"Y": 0,
"IconReleased": "__designer\\Dark_Icons_Settings_48.png",
"IconPressed": "__designer\\Dark_Icons_Settings_48.png"
},
{
"Type": "BoxWithBorderButtonStyle",
"X": 0,
"Y": 0,
"Width": 50,
"Height": 50,
"LockToFlexButtonSize": true,
"BorderSize": 5,
"LockToFlexButtonSize": false,
"BorderSize": 0,
"ColorReleased": {
"Red": 0,
"Green": 102,
"Blue": 153
"Green": 0,
"Blue": 0
},
"ColorPressed": {
"Red": 0,
"Green": 153,
"Blue": 204
"Red": 132,
"Green": 212,
"Blue": 239
},
"ColorBorderReleased": {
"Red": 0,
"Green": 51,
"Blue": 102
"Green": 0,
"Blue": 0
},
"ColorBorderPressed": {
"Red": 51,
"Green": 102,
"Blue": 153
"Red": 0,
"Green": 0,
"Blue": 0
}
}
],
"Name": "btn_test",
"Name": "btn_config",
"X": 0,
"Y": 222,
"Width": 50,
Expand Down Expand Up @@ -104,23 +111,22 @@
{
"Type": "Slider",
"IsHorizontalSlider": true,
"BackgroundUnselected": "__designer\\Blue_Slider_Horizontal_Small_slider_horizontal_small_round_back.png",
"BackgroundSelected": "__designer\\Blue_Slider_Horizontal_Small_slider_horizontal_small_round_fill.png",
"Indicator": "__designer\\Blue_Slider_Horizontal_Small_Indicators_slider_horizontal_small_round_knob.png",
"BackgroundX": 3,
"BackgroundY": 7,
"IndicatorPos": 0,
"IndicatorMax": 125,
"IndicatorMin": 0,
"BackgroundUnselected": "__designer\\Dark_Slider_Horizontal_Small_slider_horizontal_small_round_fill.png",
"BackgroundSelected": "__designer\\Dark_Slider_Horizontal_Small_slider_horizontal_small_round_back.png",
"Indicator": "__designer\\Dark_Icons_Sound_32.png",
"BackgroundX": 0,
"BackgroundY": 0,
"IndicatorPos": 5,
"IndicatorMax": 157,
"IndicatorMin": 11,
"ValueMax": 100,
"ValueMin": 0,
"InitValue": 0,
"Style": "Style13",
"InitValue": 100,
"Name": "slider1",
"X": 301,
"Y": 239,
"Width": 179,
"Height": 34,
"X": 144,
"Y": 232,
"Width": 193,
"Height": 40,
"Visible": true,
"LockPosition": false,
"Draggable": false,
Expand Down Expand Up @@ -201,10 +207,104 @@
"Moveable": false
}
],
"Interactions": [],
"Interactions": [
{
"InteractionName": "Interaction_btn_config_onclick",
"HasCompletedTrigger": false,
"Trigger": {
"Type": "TriggerClicked",
"TriggerComponent": "btn_config"
},
"Action": {
"Type": "ActionGotoScreen",
"ScreenTransitionType": "ScreenTransitionWipe",
"ScreenTransitionDirection": "East",
"ActionComponent": "screen_config"
}
}
],
"Name": "screen",
"OverrideDefaultBufferSize": false,
"CanvasBufferSize": 7200
},
{
"Components": [
{
"Type": "FlexButton",
"Alpha": 255,
"ButtonTrigger": {
"Type": "ClickButtonTrigger"
},
"ButtonStyles": [
{
"Type": "IconButtonStyle",
"X": 0,
"Y": 3,
"IconReleased": "__designer\\Dark_Icons_Refresh_48.png",
"IconPressed": "__designer\\Dark_Icons_Refresh_48.png"
},
{
"Type": "BoxWithBorderButtonStyle",
"X": 0,
"Y": 0,
"Width": 50,
"Height": 50,
"LockToFlexButtonSize": false,
"BorderSize": 0,
"ColorReleased": {
"Red": 0,
"Green": 0,
"Blue": 0
},
"ColorPressed": {
"Red": 132,
"Green": 212,
"Blue": 239
},
"ColorBorderReleased": {
"Red": 0,
"Green": 0,
"Blue": 0
},
"ColorBorderPressed": {
"Red": 0,
"Green": 0,
"Blue": 0
}
}
],
"Name": "btn_back",
"X": 0,
"Y": 223,
"Width": 50,
"Height": 49,
"Visible": true,
"LockPosition": false,
"Draggable": false,
"Clickable": false,
"Fadeable": false,
"Moveable": false
}
],
"Interactions": [
{
"InteractionName": "Interaction_btn_back_onclick",
"HasCompletedTrigger": false,
"Trigger": {
"Type": "TriggerClicked",
"TriggerComponent": "btn_back"
},
"Action": {
"Type": "ActionGotoScreen",
"ScreenTransitionType": "ScreenTransitionSlide",
"ScreenTransitionDirection": "East",
"ActionComponent": "screen"
}
}
],
"Name": "screen_config",
"OverrideDefaultBufferSize": false,
"CanvasBufferSize": 0
}
],
"CustomContainerDefinitions": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ class FrontendApplicationBase : public touchgfx::MVPApplication
// screen
void gotoscreenScreenNoTransition();

void gotoscreenScreenSlideTransitionEast();

// screen_config
void gotoscreen_configScreenWipeTransitionEast();

protected:
touchgfx::Callback<FrontendApplicationBase> transitionCallback;
FrontendHeap& frontendHeap;
Model& model;

// screen
void gotoscreenScreenNoTransitionImpl();

void gotoscreenScreenSlideTransitionEastImpl();

// screen_config
void gotoscreen_configScreenWipeTransitionEastImpl();
};

#endif // FRONTENDAPPLICATIONBASE_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
#include <mvp/MVPHeap.hpp>

#include <touchgfx/transitions/NoTransition.hpp>
#include <touchgfx/transitions/WipeTransition.hpp>
#include <touchgfx/transitions/SlideTransition.hpp>

#include <gui/common/FrontendApplication.hpp>
#include <gui/model/Model.hpp>

#include <gui/screen_screen/screenView.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
#include <gui/screen_config_screen/screen_configView.hpp>
#include <gui/screen_config_screen/screen_configPresenter.hpp>


/**
Expand All @@ -37,7 +42,8 @@ class FrontendHeapBase : public touchgfx::MVPHeap
* @note All view types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< screenView,
touchgfx::meta::Nil
touchgfx::meta::TypeList< screen_configView,
touchgfx::meta::Nil >
> GeneratedViewTypes;

/**
Expand All @@ -50,7 +56,8 @@ class FrontendHeapBase : public touchgfx::MVPHeap
* @note All presenter types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< screenPresenter,
touchgfx::meta::Nil
touchgfx::meta::TypeList< screen_configPresenter,
touchgfx::meta::Nil >
> GeneratedPresenterTypes;

/**
Expand All @@ -63,7 +70,9 @@ class FrontendHeapBase : public touchgfx::MVPHeap
* @note All transition types used in the application MUST be added to this list!
*/
typedef touchgfx::meta::TypeList< touchgfx::NoTransition,
touchgfx::meta::Nil
touchgfx::meta::TypeList< WipeTransition<EAST>,
touchgfx::meta::TypeList< SlideTransition<EAST>,
touchgfx::meta::Nil > >
> GeneratedTransitionTypes;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*********************************************************************************/
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
/*********************************************************************************/
#ifndef SCREEN_CONFIGVIEWBASE_HPP
#define SCREEN_CONFIGVIEWBASE_HPP

#include <gui/common/FrontendApplication.hpp>
#include <mvp/View.hpp>
#include <gui/screen_config_screen/screen_configPresenter.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/containers/buttons/Buttons.hpp>

class screen_configViewBase : public touchgfx::View<screen_configPresenter>
{
public:
screen_configViewBase();
virtual ~screen_configViewBase() {}
virtual void setupScreen();

protected:
FrontendApplication& application() {
return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
}

/*
* Member Declarations
*/
touchgfx::Box __background;
touchgfx::IconButtonStyle< touchgfx::BoxWithBorderButtonStyle< touchgfx::ClickButtonTrigger > > btn_back;

private:

/*
* Callback Declarations
*/
touchgfx::Callback<screen_configViewBase, const touchgfx::AbstractButtonContainer&> flexButtonCallback;

/*
* Callback Handler Declarations
*/
void flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src);

};

#endif // SCREEN_CONFIGVIEWBASE_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class screenViewBase : public touchgfx::View<screenPresenter>
* Member Declarations
*/
touchgfx::Box __background;
touchgfx::BoxWithBorderButtonStyle< touchgfx::ClickButtonTrigger > btn_test;
touchgfx::IconButtonStyle< touchgfx::BoxWithBorderButtonStyle< touchgfx::ClickButtonTrigger > > btn_config;
touchgfx::GraphWrapAndOverwrite<400> graph_t;
touchgfx::GraphElementHistogram graph_tHistogram1;
touchgfx::Slider slider1;
Expand All @@ -42,6 +42,16 @@ class screenViewBase : public touchgfx::View<screenPresenter>

private:

/*
* Callback Declarations
*/
touchgfx::Callback<screenViewBase, const touchgfx::AbstractButtonContainer&> flexButtonCallback;

/*
* Callback Handler Declarations
*/
void flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer& src);

/*
* Canvas Buffer Size
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <platform/driver/lcd/LCD16bpp.hpp>
#include <gui/screen_screen/screenView.hpp>
#include <gui/screen_screen/screenPresenter.hpp>
#include <gui/screen_config_screen/screen_configView.hpp>
#include <gui/screen_config_screen/screen_configPresenter.hpp>

using namespace touchgfx;

Expand Down Expand Up @@ -40,3 +42,27 @@ void FrontendApplicationBase::gotoscreenScreenNoTransitionImpl()
{
touchgfx::makeTransition<screenView, screenPresenter, touchgfx::NoTransition, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

void FrontendApplicationBase::gotoscreenScreenSlideTransitionEast()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoscreenScreenSlideTransitionEastImpl);
pendingScreenTransitionCallback = &transitionCallback;
}

void FrontendApplicationBase::gotoscreenScreenSlideTransitionEastImpl()
{
touchgfx::makeTransition<screenView, screenPresenter, touchgfx::SlideTransition<EAST>, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

// screen_config

void FrontendApplicationBase::gotoscreen_configScreenWipeTransitionEast()
{
transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoscreen_configScreenWipeTransitionEastImpl);
pendingScreenTransitionCallback = &transitionCallback;
}

void FrontendApplicationBase::gotoscreen_configScreenWipeTransitionEastImpl()
{
touchgfx::makeTransition<screen_configView, screen_configPresenter, touchgfx::WipeTransition<EAST>, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}
Loading

0 comments on commit 0630d47

Please sign in to comment.