[WIP] SDC screen
This hasn't really been tested yet and sometimes looks weird.
This commit is contained in:
39
TouchGFX/gui/include/gui/sdc_screen/SDCPresenter.hpp
Normal file
39
TouchGFX/gui/include/gui/sdc_screen/SDCPresenter.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef SDCPRESENTER_HPP
|
||||
#define SDCPRESENTER_HPP
|
||||
|
||||
#include <gui/model/ModelListener.hpp>
|
||||
#include <mvp/Presenter.hpp>
|
||||
|
||||
using namespace touchgfx;
|
||||
|
||||
class SDCView;
|
||||
|
||||
class SDCPresenter : public touchgfx::Presenter, public ModelListener {
|
||||
public:
|
||||
SDCPresenter(SDCView &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() override;
|
||||
|
||||
/**
|
||||
* The deactivate function is called automatically when this screen is
|
||||
* "switched out" (ie. made inactive). Teardown functionality can be placed
|
||||
* here.
|
||||
*/
|
||||
virtual void deactivate() override;
|
||||
|
||||
virtual ~SDCPresenter() {}
|
||||
|
||||
void vehicleStateUpdated() override;
|
||||
void nextScreen() override;
|
||||
|
||||
private:
|
||||
SDCPresenter();
|
||||
|
||||
SDCView &view;
|
||||
};
|
||||
|
||||
#endif // SDCPRESENTER_HPP
|
||||
33
TouchGFX/gui/include/gui/sdc_screen/SDCView.hpp
Normal file
33
TouchGFX/gui/include/gui/sdc_screen/SDCView.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
#ifndef SDCVIEW_HPP
|
||||
#define SDCVIEW_HPP
|
||||
|
||||
#include "gui/containers/DriverViewStatusItem.hpp"
|
||||
#include "touchgfx/Color.hpp"
|
||||
#include "touchgfx/hal/Types.hpp"
|
||||
#include <gui/sdc_screen/SDCPresenter.hpp>
|
||||
#include <gui_generated/sdc_screen/SDCViewBase.hpp>
|
||||
|
||||
class SDCView : public SDCViewBase {
|
||||
public:
|
||||
SDCView();
|
||||
virtual ~SDCView() {}
|
||||
virtual void setupScreen();
|
||||
virtual void tearDownScreen();
|
||||
|
||||
void setPDUClosed(bool closed);
|
||||
void setInertiaClosed(bool closed);
|
||||
void setIMDClosed(bool closed);
|
||||
void setAMSClosed(bool closed);
|
||||
void setSDCLClosed(bool closed);
|
||||
void setHVBClosed(bool closed);
|
||||
void setTSMSClosed(bool closed);
|
||||
void setAccClosed(bool closed);
|
||||
|
||||
protected:
|
||||
inline touchgfx::colortype getColor(bool closed) {
|
||||
return closed ? DriverViewStatusItem::COLOR_OK
|
||||
: DriverViewStatusItem::COLOR_ERROR;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SDCVIEW_HPP
|
||||
Reference in New Issue
Block a user