Files
RRJServer/LibServer/cficontroller/cficontroller.h
2026-01-28 13:19:52 +03:00

54 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef CFICONTROLLER_H
#define CFICONTROLLER_H
#include <QObject>
#include <QMutex>
#include <QLocale>
#include "updatecontroller.h"
#include "cfiobject.h"
class CfiController : public QObject
{
Q_OBJECT
public:
explicit CfiController(UpdateController* updateController, QObject *parent = nullptr);
~CfiController();
public:
void lockAccessToCfiXML();
void unLockAccessToCfiXML();
//Распарсивание файла CfiList.xml
bool parsingCfiXML(QMap<int, CfiObject>& mapCfiObjects);
//Слияние (обновление) с новыми данными
bool updateCfiXML(const QByteArray& array);
//Для теста
//void test();
signals:
private:
Vector3dDouble getXYZfromElement(QDomElement element);
Vector2dDouble getXYfromElement(QDomElement element);
double roundDoubleVal(double value, int cntNumAfterPoint);
bool parsingCfiXML_DOM(QDomDocument& domDoc, QMap<int, CfiObject>& mapCfiObjects);
bool merge2map(QMap<int, CfiObject>& mapCfiObjects_orig, QMap<int, CfiObject>& mapCfiObjects_new);
bool saveNewCfiListFile(QMap<int, CfiObject>& mapCfiObjects);
private:
UpdateController* updateController;
QMutex mtxAccess;
//QList<CfiObject> listCfiObjects;
QLocale* germanLocale;
};
#endif // CFICONTROLLER_H