2021-12-03 12:55:05 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <ctime>
|
|
|
|
|
#include "api/SeaBreezeWrapper.h"
|
|
|
|
|
#include "IrisFiberSpectrometerBase.h"
|
2021-12-08 17:48:13 +08:00
|
|
|
|
|
2021-12-03 12:55:05 +08:00
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
class OceanOptics_lib :public CIrisFSBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
OceanOptics_lib();
|
|
|
|
|
virtual ~OceanOptics_lib();
|
|
|
|
|
public:
|
|
|
|
|
//初始化设备
|
|
|
|
|
//此处string为指明连接哪个ocean光谱仪的参数,可自行更换为其他c/c++标准类型
|
2021-12-08 17:48:13 +08:00
|
|
|
|
//0为无错误,不同错误请返回不同值(不能确定:当不成功时SeaBreeze返回的错误代码error不为0 → 不敢将error直接返回)
|
2021-12-13 17:28:29 +08:00
|
|
|
|
int Initialize(bool bIsUSBMode, std::string ucPortNumber, std::string strDeviceName);//ok
|
2021-12-03 12:55:05 +08:00
|
|
|
|
int Initialize();//ok
|
|
|
|
|
|
|
|
|
|
//关闭设备
|
|
|
|
|
void Close();//ok
|
|
|
|
|
|
|
|
|
|
//单次数据采集
|
|
|
|
|
int SingleShot(DataFrame &dfData);
|
|
|
|
|
|
|
|
|
|
//设置曝光时间
|
|
|
|
|
int SetExposureTime(int iExposureTimeInMS);//ok
|
|
|
|
|
|
|
|
|
|
//获取曝光时间设置
|
|
|
|
|
int GetExposureTime(int &iExposureTimeInMS);//ok
|
|
|
|
|
|
|
|
|
|
//设置目标温度
|
|
|
|
|
int SetDeviceTemperature(float fTemperature);//ok
|
|
|
|
|
|
|
|
|
|
//获取温度设置
|
|
|
|
|
int GetDeviceTemperature(float &fTemperature);//ok
|
|
|
|
|
|
|
|
|
|
//获取设备信息
|
|
|
|
|
int GetDeviceInfo(DeviceInfo &Info);//ok
|
|
|
|
|
|
|
|
|
|
//获取设备特征数据
|
|
|
|
|
int GetDeviceAttribute(DeviceAttribute &Attr);//ok
|
|
|
|
|
|
2021-12-08 17:48:13 +08:00
|
|
|
|
//tc
|
|
|
|
|
static const char* get_error_string(int error);
|
2021-12-03 12:55:05 +08:00
|
|
|
|
private:
|
|
|
|
|
int m_iSpectralmeterHandle;
|
|
|
|
|
DeviceInfo m_deviceInfo;
|
|
|
|
|
int m_iExposureTime;
|
|
|
|
|
|
|
|
|
|
bool isSuccess(char* resultStr);
|
|
|
|
|
|
|
|
|
|
string GetDeviceType(int index);
|
|
|
|
|
string GetSerialNumber(int index);
|
|
|
|
|
};
|