2022-08-01 19:10:25 +08:00
|
|
|
//
|
|
|
|
// Created by tangchao on 2022/6/28.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef XIMEAIMAGERECORDER_CONFIGFILE_H
|
|
|
|
#define XIMEAIMAGERECORDER_CONFIGFILE_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <iomanip>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <libconfig.h++>
|
|
|
|
|
2022-08-15 17:36:19 +08:00
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QString>
|
|
|
|
|
2022-08-01 19:10:25 +08:00
|
|
|
using namespace std;
|
|
|
|
using namespace libconfig;
|
|
|
|
|
|
|
|
class Configfile
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
Configfile();
|
|
|
|
void setConfigfilePath(string configfilePath);
|
2022-08-15 17:36:19 +08:00
|
|
|
bool isConfigfileExist();
|
|
|
|
bool parseConfigfile();
|
2022-08-01 19:10:25 +08:00
|
|
|
|
|
|
|
bool getBin(int &bin);
|
|
|
|
bool getEffectiveWindow(int &width, int &offsetx, int &height, int &offsety);
|
2022-08-15 17:36:19 +08:00
|
|
|
bool getEffectiveWindowRoi(int &width, int &offsetx);
|
2022-08-01 19:10:25 +08:00
|
|
|
bool getGainOffset(float &gain, float &offset);
|
|
|
|
|
2022-08-15 17:36:19 +08:00
|
|
|
bool createConfigFile();
|
|
|
|
bool updateConfigFile();
|
2022-08-01 19:10:25 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
string m_configfilePath;
|
|
|
|
Config cfg;
|
|
|
|
};
|
|
|
|
#endif //XIMEAIMAGERECORDER_CONFIGFILE_H
|