2021-11-25 18:50:24 +08:00
|
|
|
|
#ifndef OCEAN_LIB_LIBRARY_H
|
|
|
|
|
#define OCEAN_LIB_LIBRARY_H
|
|
|
|
|
|
2021-11-26 18:25:26 +08:00
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <ctime>
|
2021-11-25 18:50:24 +08:00
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include "api/SeaBreezeWrapper.h"
|
|
|
|
|
|
|
|
|
|
#include "IrisFiberSpectrometerBase.h"
|
2021-11-26 18:25:26 +08:00
|
|
|
|
//#include "api/seabreezeapi/SeaBreezeAPI.h"
|
2021-11-25 18:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
2021-11-26 18:25:26 +08:00
|
|
|
|
using namespace std;
|
2021-11-25 18:50:24 +08:00
|
|
|
|
|
|
|
|
|
class OceanOptics_lib:public CIrisFSBase
|
|
|
|
|
{
|
2021-12-03 17:33:42 +08:00
|
|
|
|
public:
|
|
|
|
|
OceanOptics_lib();
|
|
|
|
|
virtual ~OceanOptics_lib();
|
2021-11-25 18:50:24 +08:00
|
|
|
|
public:
|
|
|
|
|
//初始化设备
|
|
|
|
|
//此处string为指明连接哪个ocean光谱仪的参数,可自行更换为其他c/c++标准类型
|
|
|
|
|
//0为无错误,不同错误请返回不同值
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int Initialize(bool bIsUSBMode,ZZ_U8 ucPortNumber,std::string strDeviceName);//ok
|
|
|
|
|
int Initialize();//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//关闭设备
|
2021-12-03 17:33:42 +08:00
|
|
|
|
void Close();//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//单次数据采集
|
|
|
|
|
int SingleShot(DataFrame &dfData);
|
|
|
|
|
|
|
|
|
|
//设置曝光时间
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int SetExposureTime(int iExposureTimeInMS);//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//获取曝光时间设置
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int GetExposureTime(int &iExposureTimeInMS);//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//设置目标温度
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int SetDeviceTemperature(float fTemperature);//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//获取温度设置
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int GetDeviceTemperature(float &fTemperature);//ok
|
2021-11-26 18:25:26 +08:00
|
|
|
|
|
|
|
|
|
//获取设备信息
|
|
|
|
|
int GetDeviceInfo(DeviceInfo &Info);//ok
|
|
|
|
|
|
|
|
|
|
//获取设备特征数据
|
2021-12-03 17:33:42 +08:00
|
|
|
|
int GetDeviceAttribute(DeviceAttribute &Attr);//ok
|
2021-11-25 18:50:24 +08:00
|
|
|
|
|
|
|
|
|
//tc
|
2021-12-03 17:33:42 +08:00
|
|
|
|
private:
|
|
|
|
|
int m_iSpectralmeterHandle;
|
|
|
|
|
DeviceInfo m_deviceInfo;
|
|
|
|
|
int m_iExposureTime;
|
|
|
|
|
|
|
|
|
|
bool isSuccess(char* resultStr);
|
|
|
|
|
|
2021-11-25 18:50:24 +08:00
|
|
|
|
static const char* get_error_string(int error);
|
2021-12-03 17:33:42 +08:00
|
|
|
|
string GetDeviceType(int index);
|
2021-11-26 18:25:26 +08:00
|
|
|
|
string GetSerialNumber(int index);
|
|
|
|
|
|
2021-11-25 18:50:24 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //OCEAN_LIB_LIBRARY_H
|