1、添加配置文件读、写、解析类Configfile(使用libconfig.h++);

2、打开相机时,通过Configfile读取和解析配置文件,并使用;
3、修复一些代码逻辑bug;
This commit is contained in:
tangchao0503
2022-08-01 19:10:25 +08:00
parent fb2c9e1ea4
commit 84882c5edb
6 changed files with 338 additions and 54 deletions

40
Header_Files/configfile.h Normal file
View File

@ -0,0 +1,40 @@
//
// Created by tangchao on 2022/6/28.
//
#ifndef XIMEAIMAGERECORDER_CONFIGFILE_H
#define XIMEAIMAGERECORDER_CONFIGFILE_H
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <libconfig.h++>
using namespace std;
using namespace libconfig;
class Configfile
{
public:
Configfile();
void setConfigfilePath(string configfilePath);
int parseConfigfile();
bool getBin(int &bin);
bool getEffectiveWindow(int &width, int &offsetx, int &height, int &offsety);
bool getGainOffset(float &gain, float &offset);
int createConfigFile();
int updateConfigFile();
private:
string m_configfilePath;
Config cfg;
};
#endif //XIMEAIMAGERECORDER_CONFIGFILE_H