完成框架目录和模块重构;新增核心、单例、工具、加密及框架 SDK;统一任务、相机和 RPC 接口,并增加离线检测、相机标定、备份恢复、版本管理、崩溃守护和心跳监控功能。
87 lines
1.9 KiB
C++
87 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include <euiSingletonGlobal.h>
|
|
|
|
#include <nlohmannJson.hpp>
|
|
#include <QMutex>
|
|
#include <QString>
|
|
#include <QVariant>
|
|
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
enum systemConfigInt {
|
|
dayShiftTimeStartHour,
|
|
dayShiftTimeStartMin,
|
|
nightShiftTimeStartHour,
|
|
nightShiftTimeStartMin,
|
|
jsonRpcServerPort,
|
|
jsonRpcSocketPort,
|
|
jsonRpcAutoUploaderIntervalSeconds,
|
|
detDataWatcherPollingIntervalSeconds,
|
|
detDataWatcherTimeoutAlarmSeconds,
|
|
detDataWatcherRetentionDays,
|
|
backendInitTimeoutSeconds,
|
|
backendReleaseTimeoutSeconds,
|
|
imageSaveShutdownWaitSeconds,
|
|
imageSaveJpegQuality,
|
|
};
|
|
|
|
enum systemConfigBool {
|
|
frontEndImageViewUseOpengl,
|
|
jsonRpcServerEnabled,
|
|
jsonRpcSocketEnabled,
|
|
jsonRpcAutoUploaderEnabled,
|
|
};
|
|
|
|
enum systemConfigString {
|
|
jsonRpcConnectionIp,
|
|
};
|
|
|
|
enum class systemConfigType {
|
|
Int,
|
|
Bool,
|
|
String,
|
|
};
|
|
|
|
struct systemConfigData {
|
|
systemConfigType type;
|
|
int enumValue;
|
|
QString tableName;
|
|
QString keyName;
|
|
QVariant defaultValue;
|
|
QVariant value;
|
|
};
|
|
|
|
class EUI_SERVICE_API systemConfig {
|
|
public:
|
|
systemConfig();
|
|
systemConfig(const systemConfig&) = delete;
|
|
systemConfig& operator=(const systemConfig&) = delete;
|
|
~systemConfig();
|
|
|
|
int get(systemConfigInt key);
|
|
bool get(systemConfigBool key);
|
|
QString get(systemConfigString key);
|
|
|
|
bool set(systemConfigInt key, const int& value);
|
|
bool set(systemConfigBool key, const bool& value);
|
|
bool set(systemConfigString key, const QString& value);
|
|
std::vector<systemConfigData> getAllDatas();
|
|
|
|
QVariant get(const QString& group, const QString& name,
|
|
const QVariant& defaultValue = QVariant());
|
|
bool set(const QString& group, const QString& name,
|
|
const QVariant& value);
|
|
|
|
private:
|
|
bool load();
|
|
bool save() const;
|
|
|
|
nlohmann::ordered_json m_root;
|
|
QString m_configPath;
|
|
QMutex m_mutex;
|
|
};
|
|
|
|
EUI_SERVICE_API systemConfig& appSystemConfig();
|