83 lines
2.2 KiB
C++
83 lines
2.2 KiB
C++
//
|
|
// Created by tangchao on 2023/3/25.
|
|
//
|
|
|
|
#ifndef XIMEAIMAGERECORDER_CONFIGFILE_H
|
|
#define XIMEAIMAGERECORDER_CONFIGFILE_H
|
|
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <cstdlib>
|
|
#include <libconfig.h++>
|
|
#include <string>
|
|
|
|
#include <QFileInfo>
|
|
#include <QString>
|
|
#include <QCoreApplication>
|
|
#include <QDir>
|
|
|
|
#include "utility_tc.h"
|
|
|
|
using namespace std;
|
|
using namespace libconfig;
|
|
|
|
class Configfile
|
|
{
|
|
|
|
public:
|
|
Configfile();
|
|
void setConfigfilePath(string configfilePath);
|
|
bool isConfigfileExist();
|
|
bool parseConfigfile();
|
|
|
|
bool getSN(string& SN);
|
|
|
|
bool getPositionRestriction(int& max, int& min);
|
|
bool getTuningStepSize(int& coarse, int& fine);
|
|
bool getFitParams(float& fa, float& fb);
|
|
bool getAutoFocusRange(int& max, int& min);
|
|
|
|
bool getXMotorParm(float& StepAnglemar, float& Lead, int& SubdivisionMultiples, float& ScaleFactor, float& MaxRange);
|
|
bool getYMotorParm(float& StepAnglemar, float& Lead, int& SubdivisionMultiples, float& ScaleFactor, float& MaxRange);
|
|
bool setMaxRange(float maxRange, QString x_y);
|
|
bool writeConfig2File();
|
|
|
|
bool createConfigFile();
|
|
bool updateConfigFile();
|
|
|
|
private:
|
|
string m_configfilePath;
|
|
Config cfg;
|
|
};
|
|
|
|
class CorningConfigfile
|
|
{
|
|
public:
|
|
CorningConfigfile();
|
|
void setConfigfilePath(string configfilePath);
|
|
bool isConfigfileExist();
|
|
bool parseConfigfile();
|
|
|
|
bool getSpectralBin(int& spectralBin);
|
|
bool getspatialBin(int& spatialBin);
|
|
bool getEffectiveWindow(int& width, int& offsetx, int& height, int& offsety);
|
|
bool getEffectiveWindowRoi(int& width, int& offsetx);
|
|
bool getWindowOffsety_HeightOfSpectral(int& offsety, int& height, string spectralBinString);//spectralBinString = "bin1"»òÕß¡±bin2¡°
|
|
bool getGainOffset(float& gain, float& offset);
|
|
bool getGainOffsetOfSpectralBin1(float& gain, float& offset);
|
|
bool getSN(QString& SN);
|
|
|
|
bool getBufferPolicy(int& bufferPolicy);
|
|
bool getAcqBufferSize(int& acqBufferSize);
|
|
|
|
bool getPushFlowParam(int& flowSwitch, int& rgbHeight, int& framerateVideo);
|
|
|
|
bool createConfigFile();
|
|
bool updateConfigFile();
|
|
|
|
private:
|
|
string m_configfilePath;
|
|
Config cfg;
|
|
};
|
|
#endif //XIMEAIMAGERECORDER_CONFIGFILE_H
|