31 lines
711 B
C
31 lines
711 B
C
|
#pragma once
|
||
|
|
||
|
#include <thread>
|
||
|
#include "BlockingQueue.h"
|
||
|
#include "Displaydef.h"
|
||
|
#include "LCDDisplay.h"
|
||
|
|
||
|
class DisplayCenter
|
||
|
{
|
||
|
public:
|
||
|
DisplayCenter();
|
||
|
~DisplayCenter();
|
||
|
void PutMsg(DisType distype,int pagenum,ClearScreen clearscreen);
|
||
|
void ResetMsgQueue();
|
||
|
void set_language(LCDDisplay::Language language);
|
||
|
DisType getcurdistype();
|
||
|
private:
|
||
|
struct MsgPair{
|
||
|
DisType distype;
|
||
|
ClearScreen clearscree;
|
||
|
unsigned int pagenum;
|
||
|
std::string infomsg;
|
||
|
};
|
||
|
void runloop();
|
||
|
private:
|
||
|
BlockingQueue<MsgPair> m_msgs;
|
||
|
std::shared_ptr<std::thread> m_showthread;
|
||
|
std::shared_ptr<LCDDisplay> m_lcd;
|
||
|
volatile DisType m_distype;
|
||
|
bool brun;
|
||
|
};
|