[WIP] SDC screen

This hasn't really been tested yet and sometimes looks weird.
This commit is contained in:
2023-09-30 10:11:42 +02:00
parent 61656942f9
commit 698c6a24c4
26 changed files with 784 additions and 156 deletions

View 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

View 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