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.
50 lines
1.6 KiB
50 lines
1.6 KiB
4 years ago
|
#ifndef XMLGRAPHSTATEREADER_H
|
||
|
#define XMLGRAPHSTATEREADER_H
|
||
|
#include <QObject>
|
||
|
#include <QtXml>
|
||
|
|
||
|
#include "model/csm/dto/CommandControl.h"
|
||
|
#include "logger/Logger.h"
|
||
|
#include "model/csm/type/Node.h"
|
||
|
#include "model/csm/type/Graph.h"
|
||
|
|
||
|
class XmlGraphStateReader
|
||
|
{
|
||
|
private:
|
||
|
QDomDocument _xmlDoc;
|
||
|
QString _xmlAddress;
|
||
|
QDomElement _root;
|
||
|
//gragh nodes
|
||
|
QDomElement _state;
|
||
|
QList<QDomElement> _commonDestinations;
|
||
|
QList<QDomElement> _specificStates;
|
||
|
|
||
|
inline void handleError(ESeverityLevel::eSeverityLevel severityLevel,
|
||
|
ELogID::eLogID logID,
|
||
|
QString logText,
|
||
|
bool emitThrow = true) const;
|
||
|
|
||
|
public:
|
||
|
XmlGraphStateReader(QString address);
|
||
|
//Graph
|
||
|
QDomElement getState();
|
||
|
QList<QDomElement> getCommonDestinations();
|
||
|
QList<QDomElement> getSpeciticStates();
|
||
|
|
||
|
static QList<QDomElement> getStateDestination(QDomElement state);
|
||
|
static void addEdge(QDomElement state,
|
||
|
QList<QDomElement> commonDestinations,
|
||
|
Graph* stateGraph);
|
||
|
static void initGraph(Graph* stateGraph,
|
||
|
QList<QDomElement> states,
|
||
|
QList<QDomElement> commonDestinations);
|
||
|
static void addSpeciticEdge(QDomElement state, QList<QDomElement> desinations,
|
||
|
Graph* stateGraph);
|
||
|
|
||
|
static void addCommonEdge(QDomElement state,
|
||
|
QList<QDomElement> commonDestinations,
|
||
|
Graph* stateGraph);
|
||
|
};
|
||
|
|
||
|
#endif //XMLGRAPHSTATEREADER_H
|