46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include <appconfigStruct.h>
|
|
#include <sqlAppData.h>
|
|
#include <unordered_map>
|
|
class appConfig
|
|
{
|
|
public:
|
|
|
|
sqlManager _sqlManager;//储存产品信息用
|
|
appConfig()
|
|
{
|
|
parsingGlobalData();//解析全局参数
|
|
parsingProductData(productDataPath);//解析产品配置
|
|
parsePartNumberWithIndex();
|
|
_sqlManager.initialization(this);
|
|
|
|
}
|
|
void parsePartNumberWithIndex()
|
|
{
|
|
for (int index = 0 ;index < productDatas.size(); index++)
|
|
{
|
|
for (auto partNum : productDatas[index].partNumberList)
|
|
{
|
|
partNumberWithIndex.insert(std::make_pair(partNum, index));
|
|
}
|
|
}
|
|
}
|
|
std::unordered_map<std::string, int> partNumberWithIndex;
|
|
switchProductWidgetDataPtr _switchProductWidgetDataPtr;
|
|
|
|
std::string softwareTile;//软件标题
|
|
std::string imgSavePath;//原图存储路径
|
|
std::string oriImgSavePath;//原图存储路径
|
|
std::string resImgSavePath;//结果图存储路径
|
|
std::string handleAiModelPath;//模型路径
|
|
std::string productDataPath;//机型数据路径
|
|
void parsingGlobalData();
|
|
|
|
triggerStruct _triggerStruct;
|
|
std::vector< cameraStruct> _cameraStructs;
|
|
sqlConfigStruct _sqlConfigStruct;
|
|
|
|
std::mutex productDatasMutex;
|
|
std::vector<productDataStruct>productDatas;
|
|
void parsingProductData(std::string path);
|
|
};
|
|
#pragma once |