mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 03:49:42 +08:00
光纤光谱仪基类
This commit is contained in:
@ -13,7 +13,7 @@ file(GLOB_RECURSE HDR_LIST "source/*.h")
|
|||||||
file(GLOB_RECURSE SRC_LIST "source/*.cpp")
|
file(GLOB_RECURSE SRC_LIST "source/*.cpp")
|
||||||
|
|
||||||
include_directories("source")
|
include_directories("source")
|
||||||
include_directories("source/ATP")
|
include_directories("source/FS")
|
||||||
include_directories("source/Logger")
|
include_directories("source/Logger")
|
||||||
include_directories("source/ZZ_SDK")
|
include_directories("source/ZZ_SDK")
|
||||||
include_directories("source/Settings")
|
include_directories("source/Settings")
|
||||||
|
1
config/config.json
Normal file
1
config/config.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"BeginTime":"16:43","IntervalTime":"10","EndTime":"16:45","Location":"beijing","GPS_Longtitude":"117","GPS_Latitude":"118","GPS_Altitude":"50","GPS_North":"on","InstallationTime":"2021-11-18","ISIFCalibrationTime":"2021-11-26","IS1CalibrationTime":"2021-11-19","NameOfMaintenanceStaff":"renlixin","PhoneNumberOfMaintenanceStaff":"110110110","DownloadUserID":"newuser","DownlaodAddress":"http:\/\/www.iris-rs.cn","SIFUpCalFile":"dat1","SIFDownCalFile1":"dat2","SIFDownCalFile2":"dat2","SIFDownCalFile3":"dat3","IS1UpCalFile":"dat1","IS1DownCalFile1":"sdaf","IS1DownCalFile2":"dat2","IS1DownCalFile3":"asdf","HTTPServer":"192.168.2.1"}
|
4
main.cpp
4
main.cpp
@ -29,9 +29,7 @@ int main(int argc, char *argv[])
|
|||||||
m_test.moveToThread(m_pqDataGrabberThreadHolder);
|
m_test.moveToThread(m_pqDataGrabberThreadHolder);
|
||||||
m_pqDataGrabberThreadHolder->start();
|
m_pqDataGrabberThreadHolder->start();
|
||||||
|
|
||||||
|
m_test.StartGrabCall();
|
||||||
m_test.StartGrab();
|
|
||||||
|
|
||||||
//QThread::msleep(5000);
|
//QThread::msleep(5000);
|
||||||
|
|
||||||
//m_test.StopTestGrab();
|
//m_test.StopTestGrab();
|
||||||
|
@ -18,14 +18,14 @@ ZZ_ATPControl_Serial_Qt::~ZZ_ATPControl_Serial_Qt()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::SetBaudRate(int iBaud)
|
// int ZZ_ATPControl_Serial_Qt::SetBaudRate(int iBaud)
|
||||||
{
|
// {
|
||||||
m_iBaudRate = iBaud;
|
// m_iBaudRate = iBaud;
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::ATPInitialize(ZZ_U8 ucPortNumber)
|
int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, ZZ_U8 ucPortNumber, std::string strDeviceName)
|
||||||
{
|
{
|
||||||
QString qstrPortName = QString("COM%1").arg(ucPortNumber);
|
QString qstrPortName = QString("COM%1").arg(ucPortNumber);
|
||||||
|
|
||||||
@ -50,13 +50,11 @@ int ZZ_ATPControl_Serial_Qt::ATPInitialize(ZZ_U8 ucPortNumber)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::ATPClose()
|
void ZZ_ATPControl_Serial_Qt::Close()
|
||||||
{
|
{
|
||||||
m_pSerialPort->close();
|
m_pSerialPort->close();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
int ZZ_ATPControl_Serial_Qt::GetDeviceInfo()
|
int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo &Info)
|
||||||
{
|
{
|
||||||
QByteArray qbSend, qbRecv;
|
QByteArray qbSend, qbRecv;
|
||||||
|
|
||||||
@ -81,7 +79,7 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo()
|
|||||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
m_adiDeviceInfo.strPN = qbRecv.data();
|
m_diDeviceInfo.strPN = qbRecv.data();
|
||||||
|
|
||||||
qbSend.clear();
|
qbSend.clear();
|
||||||
qbRecv.clear();
|
qbRecv.clear();
|
||||||
@ -104,13 +102,14 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo()
|
|||||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
m_adiDeviceInfo.strSN = qbRecv.data();
|
m_diDeviceInfo.strSN = qbRecv.data();
|
||||||
|
|
||||||
|
|
||||||
|
Info = m_diDeviceInfo;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute()
|
int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||||
{
|
{
|
||||||
QByteArray qbSend, qbRecv;
|
QByteArray qbSend, qbRecv;
|
||||||
|
|
||||||
@ -135,7 +134,7 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute()
|
|||||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
m_adaDeviceAttr.iMinIntegrationTime = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
m_daDeviceAttr.iMinIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||||
|
|
||||||
qbSend.clear();
|
qbSend.clear();
|
||||||
qbRecv.clear();
|
qbRecv.clear();
|
||||||
@ -158,16 +157,16 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute()
|
|||||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
m_adaDeviceAttr.iMaxIntegrationTime = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||||
|
|
||||||
|
|
||||||
iRes = SetExposureTime(m_adaDeviceAttr.iMinIntegrationTime);
|
iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS);
|
||||||
if (iRes != 0)
|
if (iRes != 0)
|
||||||
{
|
{
|
||||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2";
|
qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2";
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
iRes = SingleShot(m_adaDeviceAttr.iPixels);
|
iRes = SingleShot(m_daDeviceAttr.iPixels);
|
||||||
if (iRes != 0)
|
if (iRes != 0)
|
||||||
{
|
{
|
||||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3";
|
qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3";
|
||||||
@ -201,10 +200,18 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute()
|
|||||||
}
|
}
|
||||||
float fWaveLengthCoef[4];
|
float fWaveLengthCoef[4];
|
||||||
memcpy(fWaveLengthCoef, qbRecv.data()+16, 4 * sizeof(float));
|
memcpy(fWaveLengthCoef, qbRecv.data()+16, 4 * sizeof(float));
|
||||||
for (int i=0;i< m_adaDeviceAttr.iPixels;i++)
|
for (int i=0;i< m_daDeviceAttr.iPixels;i++)
|
||||||
{
|
{
|
||||||
m_adaDeviceAttr.fWaveLength[i] = fWaveLengthCoef[0] * i*i*i + fWaveLengthCoef[1] * i*i + fWaveLengthCoef[2] * i + fWaveLengthCoef[3];
|
m_daDeviceAttr.fWaveLengthInNM[i] = fWaveLengthCoef[0] * i*i*i + fWaveLengthCoef[1] * i*i + fWaveLengthCoef[2] * i + fWaveLengthCoef[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Attr = m_daDeviceAttr;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ZZ_ATPControl_Serial_Qt::SetDeviceTemperature(float fTemperature)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +347,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
|||||||
|
|
||||||
while (!bFlagIsAutoExposureOK && !bFlagIsAutoExposureFailed)
|
while (!bFlagIsAutoExposureOK && !bFlagIsAutoExposureFailed)
|
||||||
{
|
{
|
||||||
ATPDataFrame dfTemp;
|
DataFrame dfTemp;
|
||||||
|
|
||||||
if (iRepeatCount++ > 30)
|
if (iRepeatCount++ > 30)
|
||||||
{
|
{
|
||||||
@ -349,7 +356,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fExposureTime = (float)m_adaDeviceAttr.iMinIntegrationTime;
|
fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS;
|
||||||
fTempExposureTime = fExposureTime;
|
fTempExposureTime = fExposureTime;
|
||||||
|
|
||||||
iRes = SingleShot(dfTemp);
|
iRes = SingleShot(dfTemp);
|
||||||
@ -359,10 +366,10 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapSort(dfTemp.usData, m_adaDeviceAttr.iPixels);
|
HeapSort(dfTemp.usData, m_daDeviceAttr.iPixels);
|
||||||
|
|
||||||
double dSum = 0;
|
double dSum = 0;
|
||||||
int iCount = m_adaDeviceAttr.iPixels / 100;
|
int iCount = m_daDeviceAttr.iPixels / 100;
|
||||||
for (int i = 0; i < iCount; i++)
|
for (int i = 0; i < iCount; i++)
|
||||||
{
|
{
|
||||||
dSum += dfTemp.usData[i];
|
dSum += dfTemp.usData[i];
|
||||||
@ -449,11 +456,11 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::SetExtShutter(int iShutterUP0, int iShutterDOWN1, int iShutterDOWN2, int iShutterDOWN3)
|
// int ZZ_ATPControl_Serial_Qt::SetExtShutter(int iShutterUP0, int iShutterDOWN1, int iShutterDOWN2, int iShutterDOWN3)
|
||||||
{
|
// {
|
||||||
qDebug() << "stub code not implemented";
|
// qDebug() << "stub code not implemented";
|
||||||
return -1;
|
// return -1;
|
||||||
}
|
// }
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
|
int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
|
||||||
{
|
{
|
||||||
@ -476,7 +483,22 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::SingleShot(ATPDataFrame &dfData)
|
int ZZ_ATPControl_Serial_Qt::GetExposureTime(int &iExposureTimeInMS)
|
||||||
|
{
|
||||||
|
QByteArray qbSend, qbRecv;
|
||||||
|
qbSend.clear();
|
||||||
|
qbRecv.clear();
|
||||||
|
qbSend.append(GET_INTEGRATION_TIME);
|
||||||
|
qbSend.resize(3);
|
||||||
|
qbSend[1] = 0x00;
|
||||||
|
qbSend[2] = 0x01;
|
||||||
|
SendCommand(qbSend);
|
||||||
|
RecvData(qbRecv);
|
||||||
|
ParseData(qbRecv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData)
|
||||||
{
|
{
|
||||||
QByteArray qbSend, qbRecv;
|
QByteArray qbSend, qbRecv;
|
||||||
qbSend.clear();
|
qbSend.clear();
|
||||||
@ -530,10 +552,25 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(int &iPixels)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_ATPControl_Serial_Qt::SingleShotDark(ATPDataFrame &dfData)
|
// int ZZ_ATPControl_Serial_Qt::SingleShotDark(ATPDataFrame &dfData)
|
||||||
|
// {
|
||||||
|
// SetExtShutter(0,0,0,0);
|
||||||
|
// SingleShot(dfData);
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
|
||||||
|
int ZZ_ATPControl_Serial_Qt::GetDeviceTemperature(float &fTemperature)
|
||||||
{
|
{
|
||||||
SetExtShutter(0,0,0,0);
|
QByteArray qbSend, qbRecv;
|
||||||
SingleShot(dfData);
|
qbSend.clear();
|
||||||
|
qbRecv.clear();
|
||||||
|
qbSend.append(GET_TEC_TEMP);
|
||||||
|
qbSend.resize(3);
|
||||||
|
qbSend[1] = 0x00;
|
||||||
|
qbSend[2] = 0x01;
|
||||||
|
SendCommand(qbSend);
|
||||||
|
RecvData(qbRecv);
|
||||||
|
ParseData(qbRecv);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -4,12 +4,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "ZZ_Types.h"
|
#include "ZZ_Types.h"
|
||||||
|
#include "IrisFiberSpectrometerBase.h"
|
||||||
|
|
||||||
using namespace ZZ_MISCDEF;
|
using namespace ZZ_MISCDEF;
|
||||||
using namespace ZZ_MISCDEF::ATP;
|
using namespace ZZ_MISCDEF::ATP;
|
||||||
|
using namespace ZZ_MISCDEF::IRIS::FS;
|
||||||
|
|
||||||
class QSerialPort;
|
class ZZ_ATPControl_Serial_Qt:public CIrisFSBase
|
||||||
|
|
||||||
class ZZ_ATPControl_Serial_Qt//:public QObject
|
|
||||||
{
|
{
|
||||||
//Q_OBJECT
|
//Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -18,34 +19,42 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//设置波特率
|
//设置波特率
|
||||||
int SetBaudRate(int iBaud);
|
//int SetBaudRate(int iBaud);
|
||||||
|
|
||||||
|
|
||||||
//初始化设备
|
//初始化设备
|
||||||
int ATPInitialize( ZZ_U8 ucPortNumber);
|
int Initialize(bool bIsUSBMode, ZZ_U8 ucPortNumber, std::string strDeviceName);
|
||||||
//关闭设备
|
//关闭设备
|
||||||
int ATPClose();
|
void Close();
|
||||||
|
|
||||||
|
|
||||||
//单次测试采集 用以确认设备像素数
|
//单次测试采集 用以确认设备像素数
|
||||||
int SingleShot(int &iPixels);
|
int SingleShot(int &iPixels);
|
||||||
//单次数据采集
|
|
||||||
int SingleShot(ATPDataFrame &dfData);
|
|
||||||
//单次暗背景采集
|
|
||||||
int SingleShotDark(ATPDataFrame &dfData);
|
|
||||||
int SingleShotDeducted(ATPDataFrame &dfData);
|
|
||||||
|
|
||||||
|
//单次数据采集
|
||||||
|
int SingleShot(DataFrame &dfData);
|
||||||
|
|
||||||
|
//单次暗背景采集
|
||||||
|
//int SingleShotDark(ATPDataFrame &dfData);
|
||||||
|
|
||||||
|
//int SingleShotDeducted(ATPDataFrame &dfData);
|
||||||
//设置曝光时间
|
//设置曝光时间
|
||||||
int SetExposureTime(int iExposureTimeInMS);
|
int SetExposureTime(int iExposureTimeInMS);
|
||||||
|
|
||||||
//获取曝光时间设置
|
//获取曝光时间设置
|
||||||
int GetExposureTime(int &iExposureTimeInMS);
|
int GetExposureTime(int &iExposureTimeInMS);
|
||||||
|
|
||||||
//int GetWaveLength(float *pfWaveLength);
|
//int GetWaveLength(float *pfWaveLength);
|
||||||
|
|
||||||
//获取设备信息
|
//获取设备信息
|
||||||
int GetDeviceInfo();
|
int GetDeviceInfo(DeviceInfo &Info);
|
||||||
|
|
||||||
//获取设备特征数据
|
//获取设备特征数据
|
||||||
int GetDeviceAttribute();
|
int GetDeviceAttribute(DeviceAttribute &Attr);
|
||||||
int GetDeviceListInfo(); //use type name to enum
|
|
||||||
|
//int GetDeviceListInfo(); //use type name to enum
|
||||||
|
|
||||||
|
//设置温度
|
||||||
|
int SetDeviceTemperature(float fTemperature);
|
||||||
|
|
||||||
|
//获取温度
|
||||||
int GetDeviceTemperature(float &fTemperature);
|
int GetDeviceTemperature(float &fTemperature);
|
||||||
|
|
||||||
//自动曝光
|
//自动曝光
|
||||||
@ -61,11 +70,11 @@ private:
|
|||||||
QSerialPort *m_pSerialPort;
|
QSerialPort *m_pSerialPort;
|
||||||
|
|
||||||
//ATP
|
//ATP
|
||||||
ATPDeviceInfo m_adiDeviceInfo;
|
DeviceInfo m_diDeviceInfo;
|
||||||
ATPDeviceAttribute m_adaDeviceAttr;
|
DeviceAttribute m_daDeviceAttr;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////shutter control stub code s
|
//////////////////////////////////////////////////////////////////////////shutter control stub code s
|
||||||
int SetExtShutter(int iShutterUP0, int iShutterDOWN1,int iShutterDOWN2,int iShutterDOWN3); //0:close 1:open
|
//int SetExtShutter(int iShutterUP0, int iShutterDOWN1,int iShutterDOWN2,int iShutterDOWN3); //0:close 1:open
|
||||||
//////////////////////////////////////////////////////////////////////////shutter control stub code e
|
//////////////////////////////////////////////////////////////////////////shutter control stub code e
|
||||||
int SendCommand(QByteArray qbCommand);
|
int SendCommand(QByteArray qbCommand);
|
||||||
int RecvData(QByteArray &qbData);
|
int RecvData(QByteArray &qbData);
|
42
source/FS/IrisFiberSpectrometerBase.h
Normal file
42
source/FS/IrisFiberSpectrometerBase.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#include <string>
|
||||||
|
#include "ZZ_Types.h"
|
||||||
|
#pragma once
|
||||||
|
using namespace ZZ_MISCDEF;
|
||||||
|
using namespace ZZ_MISCDEF::IRIS::FS;
|
||||||
|
|
||||||
|
class CIrisFSBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//CIrisFSBase();
|
||||||
|
//virtual ~CIrisFSBase()= 0;
|
||||||
|
public:
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD>豸
|
||||||
|
//<2F>˴<EFBFBD>stringΪָ<CEAA><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD>ocean<61><6E><EFBFBD><EFBFBD><EFBFBD>ǵIJ<C7B5><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><D0B8><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>c/c++<2B><><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
||||||
|
//0Ϊ<30><EFBFBD><DEB4><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>뷵<EFBFBD>ز<EFBFBD>ֵͬ
|
||||||
|
virtual int Initialize(bool bIsUSBMode,ZZ_U8 ucPortNumber,std::string strDeviceName) = 0;
|
||||||
|
|
||||||
|
//<2F>ر<EFBFBD><D8B1>豸
|
||||||
|
virtual void Close() = 0;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲɼ<DDB2>
|
||||||
|
virtual int SingleShot(DataFrame &dfData) = 0;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||||
|
virtual int SetExposureTime(int iExposureTimeInMS) = 0;
|
||||||
|
|
||||||
|
//<2F><>ȡ<EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
virtual int GetExposureTime(int &iExposureTimeInMS) = 0;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>¶<EFBFBD>
|
||||||
|
virtual int SetDeviceTemperature(float fTemperature) = 0;
|
||||||
|
|
||||||
|
//<2F><>ȡ<EFBFBD>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
virtual int GetDeviceTemperature(float &fTemperature) = 0;
|
||||||
|
|
||||||
|
//<2F><>ȡ<EFBFBD>豸<EFBFBD><E8B1B8>Ϣ
|
||||||
|
virtual int GetDeviceInfo(DeviceInfo &Info) = 0;
|
||||||
|
|
||||||
|
//<2F><>ȡ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
virtual int GetDeviceAttribute(DeviceAttribute &Attr) = 0;
|
||||||
|
|
||||||
|
};
|
@ -10,6 +10,39 @@ namespace ZZ_MISCDEF
|
|||||||
typedef unsigned short int ZZ_U16;
|
typedef unsigned short int ZZ_U16;
|
||||||
typedef unsigned long int ZZ_U32;
|
typedef unsigned long int ZZ_U32;
|
||||||
|
|
||||||
|
|
||||||
|
namespace IRIS
|
||||||
|
{
|
||||||
|
//Fiber Spectrometer
|
||||||
|
namespace FS
|
||||||
|
{
|
||||||
|
typedef struct tagDataFrame
|
||||||
|
{
|
||||||
|
ZZ_U16 usExposureTimeInMS;
|
||||||
|
ZZ_U16 usData[4096];
|
||||||
|
float fTemperature;
|
||||||
|
double dTimes = 0;
|
||||||
|
}DataFrame;
|
||||||
|
|
||||||
|
typedef struct tagDeviceInfo
|
||||||
|
{
|
||||||
|
std::string strPN;
|
||||||
|
std::string strSN;
|
||||||
|
}DeviceInfo;
|
||||||
|
|
||||||
|
typedef struct tagDeviceAttribute
|
||||||
|
{
|
||||||
|
int iPixels;
|
||||||
|
int iMaxIntegrationTimeInMS;
|
||||||
|
int iMinIntegrationTimeInMS;
|
||||||
|
float fWaveLengthInNM[4096];
|
||||||
|
|
||||||
|
}DeviceAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//ATPÖ¸ÁîתÒë
|
//ATPÖ¸ÁîתÒë
|
||||||
namespace ATP
|
namespace ATP
|
||||||
{
|
{
|
@ -3,8 +3,8 @@
|
|||||||
ZZ_SysConfigger::ZZ_SysConfigger(QObject *parent /*= nullptr*/)
|
ZZ_SysConfigger::ZZ_SysConfigger(QObject *parent /*= nullptr*/)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
m_qstrFilePath = QCoreApplication::applicationDirPath() + "home/data/Settings/DeviceSettings.ini";
|
m_qstrFilePath = QCoreApplication::applicationDirPath() + "/home/data/Settings/DeviceSettings.ini";
|
||||||
m_qstrJSONConfigFilePath = QCoreApplication::applicationDirPath() + "/home/data/Settings/config.json";
|
m_qstrJSONConfigFilePath = "E:/WorkSpace/TowerOptoSifAndSpectral/config/config.json";
|
||||||
#else
|
#else
|
||||||
m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json");
|
m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json");
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
@ -69,17 +69,26 @@
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "ss");
|
||||||
|
if (!m_struAcqTime.qtInterval.isValid())
|
||||||
|
{
|
||||||
|
qDebug() << "Invalid IntervalTime";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#else
|
||||||
m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "mm");
|
m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "mm");
|
||||||
if (!m_struAcqTime.qtInterval.isValid())
|
if (!m_struAcqTime.qtInterval.isValid())
|
||||||
{
|
{
|
||||||
qDebug() << "Invalid BeginTime";
|
qDebug() << "Invalid IntervalTime";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_struAcqTime.qtStopTime = QTime::fromString(m_qjoJObj.value("EndTime").toString(), "hh:mm");
|
m_struAcqTime.qtStopTime = QTime::fromString(m_qjoJObj.value("EndTime").toString(), "hh:mm");
|
||||||
if (!m_struAcqTime.qtStopTime.isValid())
|
if (!m_struAcqTime.qtStopTime.isValid())
|
||||||
{
|
{
|
||||||
qDebug() << "Invalid BeginTime";
|
qDebug() << "Invalid EndTime";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ ZZ_DataGrabberThread::ZZ_DataGrabberThread(QObject* parent /*= nullptr*/)
|
|||||||
{
|
{
|
||||||
m_GrabTimer = new QTimer(this);
|
m_GrabTimer = new QTimer(this);
|
||||||
m_bFlagIsCollecting = false;
|
m_bFlagIsCollecting = false;
|
||||||
|
|
||||||
InitThreadStatus();
|
InitThreadStatus();
|
||||||
SetupSignals();
|
SetupSignals();
|
||||||
StartGrabberThread();
|
StartGrabberThread();
|
||||||
@ -19,15 +20,17 @@ ZZ_DataGrabberThread::~ZZ_DataGrabberThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZZ_DataGrabberThread::SetGrabTimer(AcqTimeSettings struAcqTime)
|
void ZZ_DataGrabberThread::SetGrabTimer(AcqTimeSettings struAcqTimer)
|
||||||
{
|
{
|
||||||
m_struAcqTime = struAcqTime;
|
m_struAcqTime = struAcqTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZZ_DataGrabberThread::SetupSignals()
|
int ZZ_DataGrabberThread::SetupSignals()
|
||||||
{
|
{
|
||||||
connect(m_GrabTimer, &QTimer::timeout, this, &ZZ_DataGrabberThread::OnTimeCounter);
|
connect(m_GrabTimer, &QTimer::timeout, this, &ZZ_DataGrabberThread::OnTimeCounter);
|
||||||
|
|
||||||
|
connect(this, &ZZ_DataGrabberThread::SignalStartGrab, this, &ZZ_DataGrabberThread::StartGrab);
|
||||||
|
|
||||||
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcISIFCtrlThread, &ZZ_iSIFControlThread::StartTestAcquisition);
|
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcISIFCtrlThread, &ZZ_iSIFControlThread::StartTestAcquisition);
|
||||||
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcIS1CtrlThread, &ZZ_IS1ControlThread::StartTestAcquisition);
|
connect(this, &ZZ_DataGrabberThread::SignalStartGrabOnce, &m_tcIS1CtrlThread, &ZZ_IS1ControlThread::StartTestAcquisition);
|
||||||
|
|
||||||
@ -43,6 +46,12 @@ int ZZ_DataGrabberThread::SetupSignals()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ZZ_DataGrabberThread::StartGrabCall()
|
||||||
|
{
|
||||||
|
emit SignalStartGrab();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int ZZ_DataGrabberThread::StartGrab()
|
int ZZ_DataGrabberThread::StartGrab()
|
||||||
{
|
{
|
||||||
m_GrabTimer->start(1000);
|
m_GrabTimer->start(1000);
|
||||||
|
@ -30,10 +30,10 @@ private:
|
|||||||
QTimer *m_GrabTimer;
|
QTimer *m_GrabTimer;
|
||||||
AcqTimeSettings m_struAcqTime;
|
AcqTimeSettings m_struAcqTime;
|
||||||
public:
|
public:
|
||||||
void SetGrabTimer(AcqTimeSettings struAcqTime);
|
void SetGrabTimer(AcqTimeSettings struAcqTimer);
|
||||||
|
|
||||||
int SetupSignals();
|
int SetupSignals();
|
||||||
int StartGrab();
|
int StartGrabCall();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int OnTimeCounter();
|
int OnTimeCounter();
|
||||||
@ -44,8 +44,10 @@ public slots:
|
|||||||
int TestGrabOnce();
|
int TestGrabOnce();
|
||||||
int TestStopGrab();
|
int TestStopGrab();
|
||||||
int HandleThreadEvent(int iThreadID, int iFlagStatus);
|
int HandleThreadEvent(int iThreadID, int iFlagStatus);
|
||||||
|
int StartGrab();
|
||||||
signals:
|
signals:
|
||||||
void SignalStartGrabOnce();
|
void SignalStartGrabOnce();
|
||||||
void SignalStopGrab();
|
void SignalStopGrab();
|
||||||
void SignalGrabOnceFinished();
|
void SignalGrabOnceFinished();
|
||||||
|
void SignalStartGrab();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user