358 lines
17 KiB
C++
358 lines
17 KiB
C++
|
|
//#if _MSC_VER >= 1600
|
|||
|
|
//#pragma execution_character_set("utf-8")
|
|||
|
|
//#endif
|
|||
|
|
#include "Confighelp.h"
|
|||
|
|
#include <QSettings>
|
|||
|
|
#include <QTextCodec>
|
|||
|
|
#include <QDir>
|
|||
|
|
ConfigHelp* ConfigHelp::m_ptrConfigHelp = nullptr;
|
|||
|
|
|
|||
|
|
ConfigHelp::ConfigHelp()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ConfigHelp* ConfigHelp::GetInstance()
|
|||
|
|
{
|
|||
|
|
if (nullptr == m_ptrConfigHelp)
|
|||
|
|
{
|
|||
|
|
m_ptrConfigHelp = new ConfigHelp();
|
|||
|
|
}
|
|||
|
|
return m_ptrConfigHelp;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::FreeInstance()
|
|||
|
|
{
|
|||
|
|
if (nullptr != m_ptrConfigHelp)
|
|||
|
|
{
|
|||
|
|
delete m_ptrConfigHelp;
|
|||
|
|
m_ptrConfigHelp = nullptr;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadFileConfig(RawFileParam& outTag)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
outTag.nImageW = sets.value("RawFileInfo/ImageWidth", "640").toInt();
|
|||
|
|
outTag.nImageH = sets.value("RawFileInfo/ImageHeight", "512").toInt();
|
|||
|
|
outTag.nFrameRate = sets.value("RawFileInfo/FrameRate", "25").toInt();
|
|||
|
|
outTag.nParamCount = sets.value("RawFileInfo/ParamCount", "1").toInt();
|
|||
|
|
outTag.nParamStartPos = sets.value("RawFileInfo/ParamStartPos", "513").toInt();
|
|||
|
|
outTag.nPixelType = sets.value("RawFileInfo/PixelType", "0").toInt();
|
|||
|
|
outTag.nPixelOrder = sets.value("RawFileInfo/PixelOrder", "0").toInt();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadDevConfig(DevParam& outTag)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
outTag.tagFileparam.nImageW = sets.value("DevInfo/ImageWidth", "320").toInt();
|
|||
|
|
outTag.tagFileparam.nImageH = sets.value("DevInfo/ImageHeight", "256").toInt();
|
|||
|
|
outTag.tagFileparam.nFrameRate = sets.value("DevInfo/FrameRate", "25").toInt();
|
|||
|
|
outTag.tagFileparam.nParamCount = sets.value("DevInfo/ParamCount", "1").toInt();
|
|||
|
|
outTag.tagFileparam.nParamStartPos = sets.value("Devinfo/ParamStartPos", "257").toInt();
|
|||
|
|
outTag.tagFileparam.nPixelType = sets.value("DevInfo/PixelType", "0").toInt();
|
|||
|
|
outTag.tagFileparam.nPixelOrder = sets.value("DevInfo/PixelOrder", "0").toInt();
|
|||
|
|
outTag.nCardId = sets.value("DevInfo/CardId", "1").toInt();
|
|||
|
|
outTag.nChannel = sets.value("DevInfo/Channel", "1").toInt();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadSetConfig(QString& dir)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
QString strDefalutPath = QDir::currentPath() + QString("/") + QString("recordVideo") + QString("/"); //qApp->applicationDirPath();
|
|||
|
|
dir = sets.value("SetInfo/RecordDir", strDefalutPath).toString();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadSerialSendTime(int& msec)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
msec = sets.value("SetInfo/SerialSendTime", "1").toInt();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//void ConfigHelp::loadAutoSetConfig(QString &filePath,AutoSetInfo &outTag)
|
|||
|
|
//{
|
|||
|
|
// QSettings sets(filePath,QSettings::IniFormat);
|
|||
|
|
// sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
// //EngInfo
|
|||
|
|
// outTag.Eng.Fps = sets.value("EngInfo/u16S2LFps","50").toInt();
|
|||
|
|
// outTag.Eng.Width = sets.value("EngInfo/u16S2LWidth","640").toInt();
|
|||
|
|
// outTag.Eng.Height = sets.value("EngInfo/u16S2LHeight","512").toInt();
|
|||
|
|
// outTag.Eng.SoftVerA = sets.value("EngInfo/u16S2LSoftVerA","1").toInt();
|
|||
|
|
// outTag.Eng.SoftVerX = sets.value("EngInfo/u16S2LSoftVerX","0").toInt();
|
|||
|
|
// outTag.Eng.SoftVerY = sets.value("EngInfo/u16S2LSoftVerY","0").toInt();
|
|||
|
|
// outTag.Eng.SoftYear = sets.value("EngInfo/u16S2LSoftYear","2021").toInt();
|
|||
|
|
// outTag.Eng.SoftMon = sets.value("EngInfo/u16S2LSoftMon","12").toInt();
|
|||
|
|
// outTag.Eng.SoftDay = sets.value("EngInfo/u16S2LSoftDay","25").toInt();
|
|||
|
|
// outTag.Eng.LogicVerA = sets.value("EngInfo/u16S2LLogicVerA","1").toInt();
|
|||
|
|
// outTag.Eng.LogicVerX = sets.value("EngInfo/u16S2LLogicVerX","0").toInt();
|
|||
|
|
// outTag.Eng.LogicVerY = sets.value("EngInfo/u16S2LLogicVerY","0").toInt();
|
|||
|
|
// outTag.Eng.SENIdNum = sets.value("EngInfo/u16S2LSENIdNum","0").toULongLong();
|
|||
|
|
|
|||
|
|
// //SenInfo
|
|||
|
|
// outTag.Sen.AccWkTime = sets.value("SenInfo/u16L2SAccWkTime","100").toInt();
|
|||
|
|
// outTag.Sen.SENIntMode = sets.value("SenInfo/u16S2LSENIntMode","0").toInt();
|
|||
|
|
// outTag.Sen.SENUPCOL = sets.value("SenInfo/u16S2LSENUPCOL","1").toInt();
|
|||
|
|
// outTag.Sen.SENUPROW = sets.value("SenInfo/u16S2LSENUPROW","1").toInt();
|
|||
|
|
// outTag.Sen.OpenWindowSW = sets.value("SenInfo/u16S2LOpenWindowSW","0").toInt();
|
|||
|
|
// outTag.Sen.ADSHIFT = sets.value("SenInfo/u16S2LADSHIFT","12").toInt();
|
|||
|
|
// outTag.Sen.MultSampSw = sets.value("SenInfo/u16S2LMultSampSw","0").toInt();
|
|||
|
|
// outTag.Sen.AspectSw = sets.value("SenInfo/u16S2LAspectSw","0").toInt();
|
|||
|
|
// outTag.Sen.MultSampStPix = sets.value("SenInfo/u16S2LMultSampStPix","3").toInt();
|
|||
|
|
// outTag.Sen.AspectValue = sets.value("SenInfo/u16S2LAspectValue","0").toInt();
|
|||
|
|
// outTag.Sen.MultSampNum = sets.value("SenInfo/u16S2LMultSampNum","1").toInt();
|
|||
|
|
// outTag.Sen.AdSeqType = sets.value("SenInfo/u16S2LAdSeqType","1").toInt();
|
|||
|
|
// outTag.Sen.AdValidSrc = sets.value("SenInfo/u16S2LAdValidSrc","0").toInt();
|
|||
|
|
|
|||
|
|
// //VCoreInfo
|
|||
|
|
// outTag.VCore.SyncMode = sets.value("VCoreInfo/u16S2LSyncMode","0").toInt();
|
|||
|
|
// QString str = sets.value("VCoreInfo/u16L2SIntTime","3000#9000#19000#0#0#0#0#0#0#0#0#0#0#0#0#0").toString();
|
|||
|
|
|
|||
|
|
// QStringList listIntTime = str.split("#");
|
|||
|
|
|
|||
|
|
// int i = 0;
|
|||
|
|
// foreach (QString s, listIntTime) {
|
|||
|
|
// if(!s.isEmpty())
|
|||
|
|
// {
|
|||
|
|
// outTag.VCore.IntTime[i++] = s.toInt();
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// outTag.VCore.ImgMode = sets.value("VCoreInfo/u16S2LImgMode","0").toInt();
|
|||
|
|
// outTag.VCore.LvdsVMode = sets.value("VCoreInfo/u16S2LLvdsVMode","1").toInt();
|
|||
|
|
// outTag.VCore.TestVMode = sets.value("VCoreInfo/u16S2LTestVMode","1").toInt();
|
|||
|
|
// outTag.VCore.TestVScope = sets.value("VCoreInfo/u16S2LTestVScope","2").toInt();
|
|||
|
|
// outTag.VCore.Freeze = sets.value("VCoreInfo/u16S2LFreeze","0").toInt();
|
|||
|
|
// outTag.VCore.CharSw = sets.value("VCoreInfo/u16S2LCharSw","1").toInt();
|
|||
|
|
|
|||
|
|
// //XFilterInfo
|
|||
|
|
// outTag.XFilter.XFilterMode = sets.value("XFilterInfo/u16S2LXFilterMode","1").toInt();
|
|||
|
|
// outTag.XFilter.XFilterPar = sets.value("XFilterInfo/u16S2LXFilterPar","3").toInt();
|
|||
|
|
|
|||
|
|
// //BpInfo
|
|||
|
|
// outTag.Bp.BPThres = sets.value("BpInfo/u16S2LBPThres","25").toInt();
|
|||
|
|
// outTag.Bp.ReplaceMode = sets.value("BpInfo/u16S2LReplaceMode","0").toInt();
|
|||
|
|
// outTag.Bp.ReplaceSw = sets.value("BpInfo/u16S2LReplaceSw","1").toInt();
|
|||
|
|
|
|||
|
|
// //AutoBpInfo
|
|||
|
|
// outTag.AutoBp.AutoBPSw = sets.value("AutoBpInfo/u16S2LAutoBPSw","0").toInt();
|
|||
|
|
// outTag.AutoBp.BPLoopFrms = sets.value("AutoBpInfo/u16S2LBPLoopFrms","8").toInt();
|
|||
|
|
// outTag.AutoBp.NoiseH = sets.value("AutoBpInfo/u16S2LNoiseH","200").toInt();
|
|||
|
|
// outTag.AutoBp.BPDiffTres = sets.value("AutoBpInfo/u16S2LBPDiffTres","20").toInt();
|
|||
|
|
|
|||
|
|
// //GGInfo
|
|||
|
|
// outTag.GG.GGSw = sets.value("GGInfo/u16S2LGGSw","0").toInt();
|
|||
|
|
|
|||
|
|
// //ReStripeInfo
|
|||
|
|
// outTag.ReStripe.ReStripeSw = sets.value("ReStripeInfo/u16S2LReStripeSw","1").toInt();
|
|||
|
|
// outTag.ReStripe.RestripeWinSize = sets.value("ReStripeInfo/u16S2LRestripeWinSize","9").toInt();
|
|||
|
|
// outTag.ReStripe.ReStripeSigmaIndex = sets.value("ReStripeInfo/u16S2LReStripeSigmaIndex","70").toInt();
|
|||
|
|
// outTag.ReStripe.ReStripeThres = sets.value("ReStripeInfo/u16S2LReStripeThres","15").toInt();
|
|||
|
|
// outTag.ReStripe.ReStripeWeight = sets.value("ReStripeInfo/u16S2LReStripeWeight","3700").toInt();
|
|||
|
|
|
|||
|
|
// //NlMeansInfo
|
|||
|
|
// outTag.NlMeans.NlMeansSw = sets.value("NlMeansInfo/u16S2LNlMeansSw","1").toInt();
|
|||
|
|
// outTag.NlMeans.NlMeansThres = sets.value("NlMeansInfo/u16S2LNlMeansThres","2").toInt();
|
|||
|
|
|
|||
|
|
// //DDEInfo
|
|||
|
|
// outTag.DDE.DDEDegree = sets.value("DDEInfo/u16S2LDDEDegree","1").toInt();
|
|||
|
|
// outTag.DDE.DDESw = sets.value("DDEInfo/u16S2LDDESw","1").toInt();
|
|||
|
|
|
|||
|
|
// //IDEInfo
|
|||
|
|
// outTag.IDE.IDESw = sets.value("IDEInfo/u16S2LIDESw","0").toInt();
|
|||
|
|
// outTag.IDE.IDESigmaIndex = sets.value("IDEInfo/u16S2LIDESigmaIndex","25").toInt();
|
|||
|
|
// outTag.IDE.IDEPar = sets.value("IDEInfo/u16S2LIDEPar","0").toInt();
|
|||
|
|
|
|||
|
|
// //BBHEInfo
|
|||
|
|
// outTag.BBHE.LightMode = sets.value("BBHEInfo/u16S2LLightMode","2").toInt();
|
|||
|
|
// outTag.BBHE.Y8Range = sets.value("BBHEInfo/u16S2LY8Range","230").toInt();
|
|||
|
|
// outTag.BBHE.Y8Mean = sets.value("BBHEInfo/u16S2LY8Mean","40").toInt();
|
|||
|
|
// outTag.BBHE.LinePer = sets.value("BBHEInfo/u16S2LLinePer","1").toInt();
|
|||
|
|
// outTag.BBHE.HistPer = sets.value("BBHEInfo/u16S2LHistPer","1").toInt();
|
|||
|
|
// outTag.BBHE.TL = sets.value("BBHEInfo/u16S2LTL","300").toInt();
|
|||
|
|
// outTag.BBHE.TR = sets.value("BBHEInfo/u16S2LTR","100").toInt();
|
|||
|
|
// outTag.BBHE.Contrast = sets.value("BBHEInfo/u16S2LContrast","50").toInt();
|
|||
|
|
// outTag.BBHE.Bright = sets.value("BBHEInfo/u16S2LBright","50").toInt();
|
|||
|
|
// outTag.BBHE.ConLimit = sets.value("BBHEInfo/u16S2LConLimit","6144").toInt();
|
|||
|
|
// outTag.BBHE.RangeChangeSw = sets.value("BBHEInfo/u16L2SRangeChangeSw","1").toInt();
|
|||
|
|
// outTag.BBHE.Y8ABCSw = sets.value("BBHEInfo/u16L2SY8ABCSw","1").toInt();
|
|||
|
|
|
|||
|
|
// //CLAHEInfo
|
|||
|
|
// outTag.CLAHE.CLAHESw = sets.value("CLAHEInfo/u16S2LCLAHESw","0").toInt();
|
|||
|
|
// outTag.CLAHE.CLAHELimit = sets.value("CLAHEInfo/u16S2LCLAHELimit","410").toInt();
|
|||
|
|
|
|||
|
|
// //DehazeInfo
|
|||
|
|
// outTag.Dehaze.DehazeSw = sets.value("DehazeInfo/u16S2LDehazeSw","0").toInt();
|
|||
|
|
// outTag.Dehaze.DehazeSelect = sets.value("DehazeInfo/u16S2LDehazeSelect","1").toInt();
|
|||
|
|
|
|||
|
|
// //PaletteInfo
|
|||
|
|
// outTag.Palette.HotSelect = sets.value("PaletteInfo/u16S2LHotSelect","0").toInt();
|
|||
|
|
// outTag.Palette.Psec = sets.value("PaletteInfo/u16S2LPsec","0").toInt();
|
|||
|
|
|
|||
|
|
// //GeomTransInfo
|
|||
|
|
// outTag.GeomTrans.MirrorMode = sets.value("GeomTransInfo/u16S2LMirrorMode","0").toInt();
|
|||
|
|
// outTag.GeomTrans.ZoomRatio = sets.value("GeomTransInfo/u16S2LZoomRatio","1000").toInt();
|
|||
|
|
// outTag.GeomTrans.Zoom = sets.value("GeomTransInfo/u16S2LZoom","0").toInt();
|
|||
|
|
|
|||
|
|
// //CursorInfo
|
|||
|
|
// outTag.Cursor.CursorType = sets.value("CursorInfo/u16S2LCursorType","0").toInt();
|
|||
|
|
// outTag.Cursor.CursorX = sets.value("CursorInfo/u16S2LCursorX","320").toInt();
|
|||
|
|
// outTag.Cursor.CursorY = sets.value("CursorInfo/u16S2LCursorY","256").toInt();
|
|||
|
|
|
|||
|
|
// //AutoFocusInfo
|
|||
|
|
// outTag.AutoFocus.WinX = sets.value("AutoFocusInfo/u16S2LWinX","320").toInt();
|
|||
|
|
// outTag.AutoFocus.WinY = sets.value("AutoFocusInfo/u16S2LWinY","256").toInt();
|
|||
|
|
// outTag.AutoFocus.WinLen = sets.value("AutoFocusInfo/u16S2LWinLen","256").toInt();
|
|||
|
|
|
|||
|
|
// //SoftStateInfo
|
|||
|
|
// outTag.SoftState.AutoBaseMode = sets.value("SoftStateInfo/u16AutoBaseMode","0").toInt();
|
|||
|
|
// outTag.SoftState.AutoIntMode = sets.value("SoftStateInfo/u16AutoIntMode","1").toInt();
|
|||
|
|
// outTag.SoftState.AutoBCMode = sets.value("SoftStateInfo/u16AutoBCMode","0").toInt();
|
|||
|
|
// outTag.SoftState.ADMax = sets.value("SoftStateInfo/u16ADMax","8000").toInt();
|
|||
|
|
// outTag.SoftState.ADMin = sets.value("SoftStateInfo/u16ADMin","4000").toInt();
|
|||
|
|
// outTag.SoftState.FovFlag1 = sets.value("SoftStateInfo/u16FovFlag1","1500").toInt();
|
|||
|
|
// outTag.SoftState.FovFlag2 = sets.value("SoftStateInfo/u16FovFlag2","2500").toInt();
|
|||
|
|
// outTag.SoftState.SceneType = sets.value("SoftStateInfo/u16SceneType","0").toInt();
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadConfigFilePath(QString& filePath)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
filePath = sets.value("SetInfo/AutoSetConfigFilePath", "./").toString();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadUserConfig(QMap<QString, QString>& map)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
QString str, strIndex, strName, strPassword;
|
|||
|
|
int count = sets.value("User/Users", "0").toInt();
|
|||
|
|
for (int i = 0; i < count; i++)
|
|||
|
|
{
|
|||
|
|
strIndex = "User/" + QString::number(i + 1);
|
|||
|
|
str = sets.value(strIndex, " ").toString();
|
|||
|
|
str.remove(QRegExp("\\s"));
|
|||
|
|
QStringList list1 = str.split(":");
|
|||
|
|
strName = list1[0];
|
|||
|
|
strPassword = list1[1];
|
|||
|
|
map.insert(strName, strPassword);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::loadExpertConfig(QMap<QString, QString>& map)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
QString str, strIndex, strName, strPassword;
|
|||
|
|
int count = sets.value("Expert/Users", "0").toInt();
|
|||
|
|
for (int i = 0; i < count; i++)
|
|||
|
|
{
|
|||
|
|
strIndex = "Expert/" + QString::number(i + 1);
|
|||
|
|
str = sets.value(strIndex, " ").toString();
|
|||
|
|
str.remove(QRegExp("\\s"));
|
|||
|
|
QStringList list1 = str.split(":");
|
|||
|
|
strName = list1[0];
|
|||
|
|
strPassword = list1[1];
|
|||
|
|
map.insert(strName, strPassword);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::LoadDatFilePath(QString& filePath, QString& hexSavePath)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
filePath = sets.value("System/DatFilePath", "").toString();
|
|||
|
|
hexSavePath = sets.value("System/HexFilePath", "").toString();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::writeFileConfig(RawFileParam& inTag)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("RawFileInfo/ImageWidth", QString::number(inTag.nImageW));
|
|||
|
|
sets.setValue("RawFileInfo/ImageHeight", QString::number(inTag.nImageH));
|
|||
|
|
sets.setValue("RawFileInfo/ParamStartPos", QString::number(inTag.nParamStartPos));
|
|||
|
|
sets.setValue("RawFileInfo/ParamCount", QString::number(inTag.nParamCount));
|
|||
|
|
sets.setValue("RawFileInfo/FrameRate", QString::number(inTag.nFrameRate));
|
|||
|
|
sets.setValue("RawFileInfo/PixelType", QString::number(inTag.nPixelType));
|
|||
|
|
sets.setValue("RawFileInfo/PixelOrder", QString::number(inTag.nPixelOrder));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::writeDevConfig(DevParam& inTag)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("DevInfo/CardId", QString::number(inTag.nCardId));
|
|||
|
|
sets.setValue("DevInfo/Channel", QString::number(inTag.nChannel));
|
|||
|
|
sets.setValue("DevInfo/ImageWidth", QString::number(inTag.tagFileparam.nImageW));
|
|||
|
|
sets.setValue("DevInfo/ImageHeight", QString::number(inTag.tagFileparam.nImageH));
|
|||
|
|
sets.setValue("DevInfo/ParamStartPos", QString::number(inTag.tagFileparam.nParamStartPos));
|
|||
|
|
sets.setValue("DevInfo/ParamCount", QString::number(inTag.tagFileparam.nParamCount));
|
|||
|
|
sets.setValue("DevInfo/FrameRate", QString::number(inTag.tagFileparam.nFrameRate));
|
|||
|
|
sets.setValue("DevInfo/PixelType", inTag.tagFileparam.nPixelType);
|
|||
|
|
sets.setValue("DevInfo/PixelOrder", inTag.tagFileparam.nPixelOrder);
|
|||
|
|
QSettings setForCamera("./CameraFile.ini", QSettings::IniFormat);
|
|||
|
|
setForCamera.setValue("ImageFormat/SensorWidth", QString::number(inTag.tagFileparam.nImageW));
|
|||
|
|
setForCamera.setValue("ImageFormat/SensorHeight", QString::number(inTag.tagFileparam.nImageH));
|
|||
|
|
int byteOfPixel;
|
|||
|
|
if (0 == inTag.tagFileparam.nPixelType)
|
|||
|
|
{
|
|||
|
|
byteOfPixel = 2 * 8;
|
|||
|
|
}
|
|||
|
|
else if (1 == inTag.tagFileparam.nPixelType)
|
|||
|
|
{
|
|||
|
|
byteOfPixel = 2 * 8;
|
|||
|
|
}
|
|||
|
|
else if (2 == inTag.tagFileparam.nPixelType)
|
|||
|
|
{
|
|||
|
|
byteOfPixel = 2 * 8;
|
|||
|
|
}
|
|||
|
|
else if (3 == inTag.tagFileparam.nPixelType)
|
|||
|
|
{
|
|||
|
|
byteOfPixel = 1 * 8;
|
|||
|
|
}
|
|||
|
|
setForCamera.setValue("ImageFormat/PixelSize", QString::number(byteOfPixel));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::writeSetConfig(QString& dir)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("SetInfo/RecordDir", dir);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::writeConfigFilePath(QString& dir)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("SetInfo/AutoSetConfigFilePath", dir);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::WriteDatFilePath(QString& filePath, QString& hexSavePath)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("System/DatFilePath", filePath);
|
|||
|
|
sets.setValue("System/HexFilePath", hexSavePath);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::LoadDxFileIndex(int& nDxIndex)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
nDxIndex = sets.value("System/DxIndex", "1").toInt();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ConfigHelp::WriteDxFileIndex(int nDxIndex)
|
|||
|
|
{
|
|||
|
|
QSettings sets("./AppConfig.ini", QSettings::IniFormat);
|
|||
|
|
sets.setIniCodec(QTextCodec::codecForName("gb2312"));
|
|||
|
|
sets.setValue("System/DxIndex", QString::number(nDxIndex));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|