You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.1 KiB
78 lines
2.1 KiB
#ifndef CSMCORE_H
|
|
#define CSMCORE_H
|
|
|
|
#include <QObject>
|
|
#include <QtXml>
|
|
#include <QMouseEvent>
|
|
|
|
#include "model/csm/utils/XmlConsoleConfigReader.h"
|
|
#include "model/csm/utils/XmlGraphStateReader.h"
|
|
#include "model/csm/core/consoleComponent/ConsoleButton.h"
|
|
//#include "model/csm/dto/CommandTuple.h"
|
|
#include "config/Configuration.h"
|
|
#include "model/csm/core/Hid.h"
|
|
|
|
/*****************************************************************************/
|
|
/**
|
|
* @brief this is the core of console management system. this class mange aonsole and trackball as
|
|
* a part of user interface.
|
|
* @author Mohammad Mohsen Talaie
|
|
* @details
|
|
* @date 12 jan 20214
|
|
*/
|
|
/*****************************************************************************/
|
|
class ConsoleCore : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
QString _configPath;
|
|
QList<ConsoleButton*> _btnList;
|
|
QString _probType;
|
|
|
|
EConsole::eConsoleState _currentState;
|
|
XmlConsoleConfigReader* _consoleConfigReader;
|
|
XmlGraphStateReader* _graphStateReader;
|
|
Graph _consoleStateGraph;
|
|
|
|
Hid* _hidHandler;
|
|
|
|
Graph getConsoleStateGraph() const;
|
|
|
|
void readConfigFile();
|
|
void setConsoleStateGraph(const Graph& csmStateGraph);
|
|
void connectToConsoleButton(const ConsoleButton* consoleButton);
|
|
|
|
void checkMicro();
|
|
void blink();
|
|
|
|
public:
|
|
ConsoleCore();
|
|
|
|
void setCurrentConsoleState(const EConsole::eConsoleState& csmState, const QString& probType);
|
|
|
|
void init();
|
|
void newInterrupt(const EConsole::eCsmInterruptType& interrupt, const QString& value);
|
|
|
|
void setProbType(const QString& prbType);
|
|
QString getProbType() const;
|
|
|
|
EConsole::eConsoleState getCurrentState() const;
|
|
|
|
void selfTest();
|
|
|
|
signals:
|
|
void sendChangeStateToButton(const EConsole::eConsoleState& csmState, const QString& probType);
|
|
void sendCommandToCsmModule(const CommandControl_t& commands);
|
|
void sendInterruptToTrackball(const EConsole::eCsmInterruptType& interrupt,
|
|
const QString& value);
|
|
//uncrustify off
|
|
public slots:
|
|
//uncrustify on
|
|
void recieveButtonCommand(const QList<CommandControl_t>& commands,
|
|
const quint8& fCode);
|
|
void recieveButtonLongPressCommand(const QList<CommandControl_t>& commands,
|
|
const quint8& fCode);
|
|
};
|
|
|
|
#endif //CSMCORE_H
|
|
|