Initial commit
This commit is contained in:
		| @@ -0,0 +1,30 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #ifndef FRONTENDAPPLICATIONBASE_HPP | ||||
| #define FRONTENDAPPLICATIONBASE_HPP | ||||
|  | ||||
| #include <mvp/MVPApplication.hpp> | ||||
| #include <gui/model/Model.hpp> | ||||
|  | ||||
| class FrontendHeap; | ||||
|  | ||||
| class FrontendApplicationBase : public touchgfx::MVPApplication | ||||
| { | ||||
| public: | ||||
|     FrontendApplicationBase(Model& m, FrontendHeap& heap); | ||||
|     virtual ~FrontendApplicationBase() { } | ||||
|  | ||||
|     // Terminal | ||||
|     void gotoTerminalScreenNoTransition(); | ||||
|  | ||||
| protected: | ||||
|     touchgfx::Callback<FrontendApplicationBase> transitionCallback; | ||||
|     FrontendHeap& frontendHeap; | ||||
|     Model& model; | ||||
|  | ||||
|     // Terminal | ||||
|     void gotoTerminalScreenNoTransitionImpl(); | ||||
| }; | ||||
|  | ||||
| #endif // FRONTENDAPPLICATIONBASE_HPP | ||||
| @@ -0,0 +1,87 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #ifndef FRONTENDHEAPBASE_HPP | ||||
| #define FRONTENDHEAPBASE_HPP | ||||
|  | ||||
| #include <common/Meta.hpp> | ||||
| #include <common/Partition.hpp> | ||||
| #include <mvp/MVPHeap.hpp> | ||||
|  | ||||
| #include <touchgfx/transitions/NoTransition.hpp> | ||||
| #include <gui/common/FrontendApplication.hpp> | ||||
| #include <gui/model/Model.hpp> | ||||
|  | ||||
| #include <gui/terminal_screen/TerminalView.hpp> | ||||
| #include <gui/terminal_screen/TerminalPresenter.hpp> | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * This class provides the memory that shall be used for memory allocations | ||||
|  * in the frontend. A single instance of the FrontendHeap is allocated once (in heap | ||||
|  * memory), and all other frontend objects such as views, presenters and data model are | ||||
|  * allocated within the scope of this FrontendHeap. As such, the RAM usage of the entire | ||||
|  * user interface is sizeof(FrontendHeap). | ||||
|  * | ||||
|  * @note The FrontendHeap reserves memory for the most memory-consuming presenter and | ||||
|  * view only. The largest of these classes are determined at compile-time using template | ||||
|  * magic. As such, it is important to add all presenters, views and transitions to the | ||||
|  * type lists in this class. | ||||
|  * | ||||
|  */ | ||||
| class FrontendHeapBase : public touchgfx::MVPHeap | ||||
| { | ||||
| public: | ||||
|     /** | ||||
|      * A list of all view types. Must end with meta::Nil. | ||||
|      * @note All view types used in the application MUST be added to this list! | ||||
|      */ | ||||
|     typedef touchgfx::meta::TypeList< TerminalView, | ||||
|             touchgfx::meta::Nil | ||||
|             > GeneratedViewTypes; | ||||
|  | ||||
|     /** | ||||
|      * Determine (compile time) the View type of largest size. | ||||
|      */ | ||||
|     typedef touchgfx::meta::select_type_maxsize< GeneratedViewTypes >::type MaxGeneratedViewType; | ||||
|  | ||||
|     /** | ||||
|      * A list of all presenter types. Must end with meta::Nil. | ||||
|      * @note All presenter types used in the application MUST be added to this list! | ||||
|      */ | ||||
|     typedef touchgfx::meta::TypeList< TerminalPresenter, | ||||
|             touchgfx::meta::Nil | ||||
|             > GeneratedPresenterTypes; | ||||
|  | ||||
|     /** | ||||
|      * Determine (compile time) the Presenter type of largest size. | ||||
|      */ | ||||
|     typedef touchgfx::meta::select_type_maxsize< GeneratedPresenterTypes >::type MaxGeneratedPresenterType; | ||||
|  | ||||
|     /** | ||||
|      * A list of all transition types. Must end with meta::Nil. | ||||
|      * @note All transition types used in the application MUST be added to this list! | ||||
|      */ | ||||
|     typedef touchgfx::meta::TypeList< touchgfx::NoTransition, | ||||
|             touchgfx::meta::Nil | ||||
|             > GeneratedTransitionTypes; | ||||
|  | ||||
|     /** | ||||
|      * Determine (compile time) the Transition type of largest size. | ||||
|      */ | ||||
|     typedef touchgfx::meta::select_type_maxsize< GeneratedTransitionTypes >::type MaxGeneratedTransitionType; | ||||
|  | ||||
|     virtual void gotoStartScreen(FrontendApplication& app) | ||||
|     { | ||||
|         app.gotoTerminalScreenNoTransition(); | ||||
|     } | ||||
| protected: | ||||
|     FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app) | ||||
|         : MVPHeap(presenters, views, transitions, app) | ||||
|     { | ||||
|  | ||||
|     } | ||||
|  | ||||
| }; | ||||
|  | ||||
| #endif // FRONTENDHEAPBASE_HPP | ||||
| @@ -0,0 +1,11 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #ifndef SIMCONSTANTS_HPP | ||||
| #define SIMCONSTANTS_HPP | ||||
|  | ||||
| static unsigned short SIM_WIDTH = 480; | ||||
| static unsigned short SIM_HEIGHT = 272; | ||||
| #define SIM_TITLE "STM32F746G_DISCO" | ||||
|  | ||||
| #endif // SIMCONSTANTS_HPP | ||||
| @@ -0,0 +1,66 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #ifndef TERMINALVIEWBASE_HPP | ||||
| #define TERMINALVIEWBASE_HPP | ||||
|  | ||||
| #include <gui/common/FrontendApplication.hpp> | ||||
| #include <mvp/View.hpp> | ||||
| #include <gui/terminal_screen/TerminalPresenter.hpp> | ||||
| #include <touchgfx/widgets/Box.hpp> | ||||
| #include <touchgfx/widgets/ButtonWithIcon.hpp> | ||||
| #include <touchgfx/containers/ScrollableContainer.hpp> | ||||
| #include <touchgfx/widgets/TextAreaWithWildcard.hpp> | ||||
| #include <touchgfx/EasingEquations.hpp> | ||||
| #include <touchgfx/mixins/MoveAnimator.hpp> | ||||
|  | ||||
| class TerminalViewBase : public touchgfx::View<TerminalPresenter> | ||||
| { | ||||
| public: | ||||
|     TerminalViewBase(); | ||||
|     virtual ~TerminalViewBase() {} | ||||
|     virtual void setupScreen(); | ||||
|     virtual void handleKeyEvent(uint8_t key); | ||||
|  | ||||
|     /* | ||||
|      * Virtual Action Handlers | ||||
|      */ | ||||
|     virtual void onButtonClearLogTextClicked() | ||||
|     { | ||||
|         // Override and implement this function in Terminal | ||||
|     } | ||||
|  | ||||
| protected: | ||||
|     FrontendApplication& application() { | ||||
|         return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance()); | ||||
|     } | ||||
|  | ||||
|     /* | ||||
|      * Member Declarations | ||||
|      */ | ||||
|     touchgfx::Box __background; | ||||
|     touchgfx::ButtonWithIcon buttonClearLogText_; | ||||
|     touchgfx::ScrollableContainer scrollableTextArea_; | ||||
|     touchgfx::MoveAnimator< touchgfx::TextAreaWithOneWildcard > logText_; | ||||
|  | ||||
|     /* | ||||
|      * Wildcard Buffers | ||||
|      */ | ||||
|     static const uint16_t LOGTEXT__SIZE = 2048; | ||||
|     touchgfx::Unicode::UnicodeChar logText_Buffer[LOGTEXT__SIZE]; | ||||
|  | ||||
| private: | ||||
|  | ||||
|     /* | ||||
|      * Callback Declarations | ||||
|      */ | ||||
|     touchgfx::Callback<TerminalViewBase, const touchgfx::AbstractButton&> buttonCallback; | ||||
|  | ||||
|     /* | ||||
|      * Callback Handler Declarations | ||||
|      */ | ||||
|     void buttonCallbackHandler(const touchgfx::AbstractButton& src); | ||||
|  | ||||
| }; | ||||
|  | ||||
| #endif // TERMINALVIEWBASE_HPP | ||||
| @@ -0,0 +1,43 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #include <new> | ||||
| #include <gui_generated/common/FrontendApplicationBase.hpp> | ||||
| #include <gui/common/FrontendHeap.hpp> | ||||
| #include <touchgfx/transitions/NoTransition.hpp> | ||||
| #include <texts/TextKeysAndLanguages.hpp> | ||||
| #include <touchgfx/Texts.hpp> | ||||
| #include <touchgfx/hal/HAL.hpp> | ||||
| #include <platform/driver/lcd/LCD16bpp.hpp> | ||||
| #include <gui/terminal_screen/TerminalView.hpp> | ||||
| #include <gui/terminal_screen/TerminalPresenter.hpp> | ||||
|  | ||||
| using namespace touchgfx; | ||||
|  | ||||
| FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap) | ||||
|     : touchgfx::MVPApplication(), | ||||
|       transitionCallback(), | ||||
|       frontendHeap(heap), | ||||
|       model(m) | ||||
| { | ||||
|     touchgfx::HAL::getInstance()->setDisplayOrientation(touchgfx::ORIENTATION_LANDSCAPE); | ||||
|     touchgfx::Texts::setLanguage(GB); | ||||
|     reinterpret_cast<touchgfx::LCD16bpp&>(touchgfx::HAL::lcd()).enableTextureMapperAll(); | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Screen Transition Declarations | ||||
|  */ | ||||
|  | ||||
| // Terminal | ||||
|  | ||||
| void FrontendApplicationBase::gotoTerminalScreenNoTransition() | ||||
| { | ||||
|     transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoTerminalScreenNoTransitionImpl); | ||||
|     pendingScreenTransitionCallback = &transitionCallback; | ||||
| } | ||||
|  | ||||
| void FrontendApplicationBase::gotoTerminalScreenNoTransitionImpl() | ||||
| { | ||||
|     touchgfx::makeTransition<TerminalView, TerminalPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model); | ||||
| } | ||||
| @@ -0,0 +1,64 @@ | ||||
| /*********************************************************************************/ | ||||
| /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ | ||||
| /*********************************************************************************/ | ||||
| #include <gui_generated/terminal_screen/TerminalViewBase.hpp> | ||||
| #include <touchgfx/Color.hpp> | ||||
| #include "BitmapDatabase.hpp" | ||||
| #include <texts/TextKeysAndLanguages.hpp> | ||||
|  | ||||
| TerminalViewBase::TerminalViewBase() : | ||||
|     buttonCallback(this, &TerminalViewBase::buttonCallbackHandler) | ||||
| { | ||||
|  | ||||
|     __background.setPosition(0, 0, 480, 272); | ||||
|     __background.setColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0)); | ||||
|  | ||||
|     buttonClearLogText_.setXY(1, 6); | ||||
|     buttonClearLogText_.setBitmaps(touchgfx::Bitmap(BITMAP_DARK_BUTTONS_ROUND_EDGE_ICON_BUTTON_ID), touchgfx::Bitmap(BITMAP_DARK_BUTTONS_ROUND_EDGE_ICON_BUTTON_PRESSED_ID), touchgfx::Bitmap(BITMAP_DARK_ICONS_TRASH_32_ROTATED_ID), touchgfx::Bitmap(BITMAP_DARK_ICONS_TRASH_32_ROTATED_ID)); | ||||
|     buttonClearLogText_.setIconXY(17, 14); | ||||
|     buttonClearLogText_.setAction(buttonCallback); | ||||
|  | ||||
|     scrollableTextArea_.setPosition(61, 6, 414, 260); | ||||
|     scrollableTextArea_.setScrollbarsColor(touchgfx::Color::getColorFrom24BitRGB(0, 0, 0)); | ||||
|  | ||||
|     logText_.setPosition(0, 129, 414, 130); | ||||
|     logText_.setColor(touchgfx::Color::getColorFrom24BitRGB(171, 171, 171)); | ||||
|     logText_.setLinespacing(0); | ||||
|     logText_.setRotation(touchgfx::TEXT_ROTATE_180); | ||||
|     Unicode::snprintf(logText_Buffer, LOGTEXT__SIZE, "%s", touchgfx::TypedText(T_SINGLEUSEID2).getText()); | ||||
|     logText_.setWildcard(logText_Buffer); | ||||
|     logText_.setTypedText(touchgfx::TypedText(T_SINGLEUSEID1)); | ||||
|     scrollableTextArea_.add(logText_); | ||||
|  | ||||
|     add(__background); | ||||
|     add(buttonClearLogText_); | ||||
|     add(scrollableTextArea_); | ||||
| } | ||||
|  | ||||
| void TerminalViewBase::setupScreen() | ||||
| { | ||||
|  | ||||
| } | ||||
|  | ||||
| //Handles when a key is pressed | ||||
| void TerminalViewBase::handleKeyEvent(uint8_t key) | ||||
| { | ||||
|     if(0 == key) | ||||
|     { | ||||
|         //Interaction1 | ||||
|         //When hardware button 0 clicked move logText_ | ||||
|         //Set position x:0 and y:0 on logText_ | ||||
|         logText_.moveTo(0,0); | ||||
|     } | ||||
| } | ||||
|  | ||||
| void TerminalViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src) | ||||
| { | ||||
|     if (&src == &buttonClearLogText_) | ||||
|     { | ||||
|         //ButtonClearLogTextClicked | ||||
|         //When buttonClearLogText_ clicked call virtual function | ||||
|         //Call onButtonClearLogTextClicked | ||||
|         onButtonClearLogTextClicked(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user