359 lines
9.9 KiB
C
359 lines
9.9 KiB
C
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>ļ<EFBFBD>
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include <string>
|
|||
|
|
#include <QTime>
|
|||
|
|
|
|||
|
|
#define MAX_DEVICENUMBER_FS 2
|
|||
|
|
#define MAX_LINEARSHUTTER_POSITION 12
|
|||
|
|
#define ZZ_Enum2String(x) #x
|
|||
|
|
|
|||
|
|
#pragma pack(1)//<2F>ṹ<EFBFBD>尴<EFBFBD><E5B0B4>1<EFBFBD>ֽڶ<D6BD><DAB6><EFBFBD><EFBFBD>洢
|
|||
|
|
|
|||
|
|
namespace ZZ_MISCDEF
|
|||
|
|
{
|
|||
|
|
typedef unsigned char ZZ_U8;
|
|||
|
|
typedef unsigned short int ZZ_U16;
|
|||
|
|
typedef unsigned int ZZ_U32;
|
|||
|
|
typedef int ZZ_S32;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace IRIS
|
|||
|
|
{
|
|||
|
|
//Fiber Spectrometer
|
|||
|
|
namespace FS
|
|||
|
|
{
|
|||
|
|
typedef struct tagDataFrame
|
|||
|
|
{
|
|||
|
|
ZZ_U32 usExposureTimeInMS;
|
|||
|
|
ZZ_S32 lData[4096];
|
|||
|
|
float fTemperature = 0;
|
|||
|
|
double dTimes = 0;
|
|||
|
|
}DataFrame;
|
|||
|
|
|
|||
|
|
typedef struct coeffs//tc<74><63><EFBFBD><EFBFBD>-----------------------
|
|||
|
|
{
|
|||
|
|
ZZ_U32 coeffsCounter;
|
|||
|
|
double coeffs[100];
|
|||
|
|
}coeffsFrame;
|
|||
|
|
|
|||
|
|
typedef struct tagDeviceInfo
|
|||
|
|
{
|
|||
|
|
std::string strPN;
|
|||
|
|
std::string strSN;
|
|||
|
|
}DeviceInfo;
|
|||
|
|
|
|||
|
|
typedef struct tagDeviceAttribute
|
|||
|
|
{
|
|||
|
|
int iPixels;
|
|||
|
|
int iMaxIntegrationTimeInMS;
|
|||
|
|
int iMinIntegrationTimeInMS;
|
|||
|
|
float fWaveLengthInNM[4096];
|
|||
|
|
|
|||
|
|
}DeviceAttribute;
|
|||
|
|
|
|||
|
|
// inline DataFrame GetIndex(DataFrame dfDark, DataFrame dfSignal)
|
|||
|
|
// {
|
|||
|
|
//
|
|||
|
|
// }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
enum DeviceModel
|
|||
|
|
{
|
|||
|
|
OSIFAlpha=0,
|
|||
|
|
OSIFBeta,
|
|||
|
|
ISIF,
|
|||
|
|
IS1,
|
|||
|
|
IS2
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
inline std::string GetDeviceModelName(int iModel)
|
|||
|
|
{
|
|||
|
|
switch (iModel)
|
|||
|
|
{
|
|||
|
|
case DeviceModel::OSIFAlpha: return "OSIFAlpha"; break;
|
|||
|
|
case DeviceModel::OSIFBeta: return "OSIFBeta"; break;
|
|||
|
|
case DeviceModel::ISIF: return "ISIF"; break;
|
|||
|
|
case DeviceModel::IS1: return "IS1"; break;
|
|||
|
|
case DeviceModel::IS2: return "IS2"; break;
|
|||
|
|
default: return "error"; break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
inline int GetIndex(std::string strDeviceModelName)
|
|||
|
|
{
|
|||
|
|
if (strDeviceModelName == "OSIFAlpha")
|
|||
|
|
{
|
|||
|
|
return DeviceModel::OSIFAlpha;
|
|||
|
|
}
|
|||
|
|
else if (strDeviceModelName == "OSIFBeta")
|
|||
|
|
{
|
|||
|
|
return DeviceModel::OSIFBeta;
|
|||
|
|
}
|
|||
|
|
else if (strDeviceModelName == "ISIF")
|
|||
|
|
{
|
|||
|
|
return DeviceModel::ISIF;
|
|||
|
|
}
|
|||
|
|
else if (strDeviceModelName == "IS1")
|
|||
|
|
{
|
|||
|
|
return DeviceModel::IS1;
|
|||
|
|
}
|
|||
|
|
else if (strDeviceModelName == "IS2")
|
|||
|
|
{
|
|||
|
|
return DeviceModel::IS2;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return -1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//ATP????<3F><>???
|
|||
|
|
namespace ATP
|
|||
|
|
{
|
|||
|
|
const int MAX_SPECTRUM_SIZE = 4096;
|
|||
|
|
|
|||
|
|
const int GET_MODULECIRCUIT_TEMP = 0x01;
|
|||
|
|
const int GET_PN_NUMBER = 0x03;
|
|||
|
|
const int GET_SN_NUMBER = 0x04;
|
|||
|
|
const int GET_MANUFACTURE_DATA = 0x06;
|
|||
|
|
const int GET_MANUFACTURE_INFO = 0x09;
|
|||
|
|
const int GET_PIXEL_LENGTH = 0x0a;
|
|||
|
|
const int GET_TEC_TEMP = 0x13;
|
|||
|
|
const int SET_TEC_TEMP = 0x12;
|
|||
|
|
const int GET_OPTICS_TEMP = 0x35;
|
|||
|
|
const int GET_CIRCUITBOARD_TEMP = 0x36;
|
|||
|
|
const int SET_INTEGRATION_TIME = 0x14;
|
|||
|
|
const int GET_INTEGRATION_TIME = 0x41;
|
|||
|
|
const int GET_MAX_INTEGRATION_TIME = 0x42;
|
|||
|
|
const int GET_MIN_INTEGRATION_TIME = 0x43;
|
|||
|
|
const int ASYNC_COLLECT_DARK = 0x23;
|
|||
|
|
const int ASYNC_START_COLLECTION = 0x16;
|
|||
|
|
const int ASYNC_READ_DATA = 0x17;
|
|||
|
|
const int SET_AVERAGE_NUMBER = 0x28;
|
|||
|
|
const int SYNC_GET_DATA = 0x1e;
|
|||
|
|
const int SYNC_GET_DARK = 0x2f;
|
|||
|
|
const int EXTERNAL_TRIGGER_ENABLE = 0x1f;
|
|||
|
|
const int SET_XENON_LAMP_DELAY_TIME = 0x24;
|
|||
|
|
const int GET_WAVELENGTH_CALIBRATION_COEF = 0x55;
|
|||
|
|
const int GET_STAT_LAMPOUT = 0x60;
|
|||
|
|
const int SET_GPIO = 0x61;
|
|||
|
|
//const int SYNCHRONIZATION_GET_DARK = 0x23
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////device
|
|||
|
|
enum Model
|
|||
|
|
{
|
|||
|
|
ATP1010 = 0,
|
|||
|
|
ATP6500
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//???????<3F><>??
|
|||
|
|
typedef struct tagATPDataFrame
|
|||
|
|
{
|
|||
|
|
unsigned short usExposureTime;
|
|||
|
|
ZZ_U16 usData[4096];
|
|||
|
|
float fTemperature;
|
|||
|
|
double dTimes = 0;
|
|||
|
|
}ATPDataFrame;
|
|||
|
|
|
|||
|
|
//?<3F><><EFBFBD><EFBFBD>??????<3F><>??
|
|||
|
|
typedef struct tagATPDeviceInfo
|
|||
|
|
{
|
|||
|
|
std::string strPN;
|
|||
|
|
std::string strSN;
|
|||
|
|
}ATPDeviceInfo;
|
|||
|
|
|
|||
|
|
//?<3F><><EFBFBD><EFBFBD>????<3F><>?<3F><>??
|
|||
|
|
typedef struct tagATPDeviceAttribute
|
|||
|
|
{
|
|||
|
|
int iPixels;
|
|||
|
|
int iMaxIntegrationTime;
|
|||
|
|
int iMinIntegrationTime;
|
|||
|
|
float fWaveLength[4096];
|
|||
|
|
|
|||
|
|
}ATPDeviceAttribute;
|
|||
|
|
//////////////////////////////////////////////////////////////////////////config file
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//????????
|
|||
|
|
namespace ZZ_RUNPARAMS
|
|||
|
|
{
|
|||
|
|
typedef struct tagErrorInfo
|
|||
|
|
{
|
|||
|
|
int iDataTransferErr = -1000;
|
|||
|
|
float fTecTempErr = -1000;
|
|||
|
|
int iShutterErr = -1000;
|
|||
|
|
float fChassisTempErr = -1000;
|
|||
|
|
}ErrInfo;
|
|||
|
|
|
|||
|
|
typedef struct tagFiberSpecContext
|
|||
|
|
{
|
|||
|
|
ZZ_U8 ucDeviceNumber;
|
|||
|
|
ZZ_U8 ucDeviceModel[MAX_DEVICENUMBER_FS];
|
|||
|
|
std::string strInterface[MAX_DEVICENUMBER_FS];
|
|||
|
|
std::string strSN[MAX_DEVICENUMBER_FS];
|
|||
|
|
long lDepth[MAX_DEVICENUMBER_FS];
|
|||
|
|
float fMinFactor[MAX_DEVICENUMBER_FS];
|
|||
|
|
float fMaxFactor[MAX_DEVICENUMBER_FS];
|
|||
|
|
ZZ_U16 usPixels[MAX_DEVICENUMBER_FS];
|
|||
|
|
float fWavelength[MAX_DEVICENUMBER_FS][4096];
|
|||
|
|
}FSContext;
|
|||
|
|
|
|||
|
|
typedef struct tagLinearShutterContext
|
|||
|
|
{
|
|||
|
|
std::string strInterface;
|
|||
|
|
ZZ_U8 ucProtocolType;
|
|||
|
|
ZZ_U8 ucCmdID;
|
|||
|
|
}LSContext;
|
|||
|
|
|
|||
|
|
typedef struct tagAcquisitionTimeSettings
|
|||
|
|
{
|
|||
|
|
QTime qtStartTime;
|
|||
|
|
QTime qtStopTime;
|
|||
|
|
QTime qtInterval;
|
|||
|
|
}AcqTimeSettings;
|
|||
|
|
|
|||
|
|
typedef struct tagAcquisitionPositionSettings
|
|||
|
|
{
|
|||
|
|
int iTotalPosition;
|
|||
|
|
int iPosition[MAX_LINEARSHUTTER_POSITION];
|
|||
|
|
}AcqPosSettings;
|
|||
|
|
|
|||
|
|
typedef struct tagRunTimeGrabberParams
|
|||
|
|
{
|
|||
|
|
LSContext lscParam;
|
|||
|
|
FSContext fscParams;
|
|||
|
|
AcqTimeSettings atsParams;
|
|||
|
|
AcqPosSettings apsParams;
|
|||
|
|
}RunTimeGrabberParams;
|
|||
|
|
|
|||
|
|
typedef struct tagATPCalibrationSettings
|
|||
|
|
{
|
|||
|
|
//Up0 Down1,2,3
|
|||
|
|
QString qsISIF_CalibrationFilePath[4];
|
|||
|
|
QString qsIS1_CalibrationFilePath[4];
|
|||
|
|
}ATPCalibrationSettings;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//?????????????<3F><>??
|
|||
|
|
namespace ZZ_DATAFILE
|
|||
|
|
{
|
|||
|
|
typedef struct tagEnvironmentalContext
|
|||
|
|
{
|
|||
|
|
QString qstrUTCDateTime;
|
|||
|
|
QString qstrLocation;
|
|||
|
|
QString qstrGPS_Longtitude;
|
|||
|
|
QString qstrGPS_Latitude;
|
|||
|
|
QString qstrGPS_Altitude;
|
|||
|
|
QString qstrGPS_North;
|
|||
|
|
QString qstrCaseTemperature;
|
|||
|
|
QString qstrCaseHumidity;
|
|||
|
|
QString qstrDEV_SN;
|
|||
|
|
}EContext;
|
|||
|
|
|
|||
|
|
typedef struct tagManmadeEnviromentalContext
|
|||
|
|
{
|
|||
|
|
QString qstrOriFileName;
|
|||
|
|
QString qstrInstallationTime;
|
|||
|
|
QString qstrISIFCalibrationTime;
|
|||
|
|
QString qstrIS1CalibrationTime;
|
|||
|
|
QString qstrNameOfMaintenanceStaff;
|
|||
|
|
QString qstrPhoneNumberOfMaintenanceStaff;
|
|||
|
|
QString qstrDownloadUserID;
|
|||
|
|
QString qstrDownlaodAddress;
|
|||
|
|
QString qstrHTTPServer;
|
|||
|
|
}MEContext;
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct tagIS1Information
|
|||
|
|
{
|
|||
|
|
QString qstrSN_ATP;
|
|||
|
|
QString qstrSN_IRIS;
|
|||
|
|
|
|||
|
|
QString qstrCalFile_U0;
|
|||
|
|
QString qstrCalFile_D1;
|
|||
|
|
QString qstrCalFile_D2;
|
|||
|
|
QString qstrCalFile_D3;
|
|||
|
|
|
|||
|
|
int iPixelCount;
|
|||
|
|
|
|||
|
|
int iExposureTimeInMS_U0;
|
|||
|
|
int iExposureTimeInMS_D1;
|
|||
|
|
int iExposureTimeInMS_D2;
|
|||
|
|
int iExposureTimeInMS_D3;
|
|||
|
|
|
|||
|
|
float fTemperature_U0;
|
|||
|
|
float fTemperature_D1;
|
|||
|
|
float fTemperature_D2;
|
|||
|
|
float fTemperature_D3;
|
|||
|
|
}IS1Info;
|
|||
|
|
|
|||
|
|
typedef struct tagISIFInformation
|
|||
|
|
{
|
|||
|
|
QString qstrSN_ATP;
|
|||
|
|
QString qstrSN_IRIS;
|
|||
|
|
|
|||
|
|
QString qstrCalFile_U0;
|
|||
|
|
QString qstrCalFile_D1;
|
|||
|
|
QString qstrCalFile_D2;
|
|||
|
|
QString qstrCalFile_D3;
|
|||
|
|
|
|||
|
|
int iPixelCount;
|
|||
|
|
|
|||
|
|
int iExposureTimeInMS_U0;
|
|||
|
|
int iExposureTimeInMS_D1;
|
|||
|
|
int iExposureTimeInMS_D2;
|
|||
|
|
int iExposureTimeInMS_D3;
|
|||
|
|
|
|||
|
|
float fTemperature_U0;
|
|||
|
|
float fTemperature_D1;
|
|||
|
|
float fTemperature_D2;
|
|||
|
|
float fTemperature_D3;
|
|||
|
|
}ISIFInfo;
|
|||
|
|
|
|||
|
|
typedef struct tagATPDataHeader
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
}ATPDataHeader;
|
|||
|
|
|
|||
|
|
typedef struct tagCalibrationFrame
|
|||
|
|
{
|
|||
|
|
ZZ_U32 uiExposureTimeInMS;
|
|||
|
|
float fTemperature;
|
|||
|
|
int iPixels;
|
|||
|
|
float fWaveLength[4096] = { 0 };
|
|||
|
|
double dCal_Gain[4096] = { 0 };
|
|||
|
|
double dCal_Offset[4096] = { 0 };
|
|||
|
|
}CalFrame;
|
|||
|
|
|
|||
|
|
typedef struct tagCalDataFrame
|
|||
|
|
{
|
|||
|
|
ZZ_U32 usExposureTimeInMS;
|
|||
|
|
float fTemperature = 0;
|
|||
|
|
int iPixels;
|
|||
|
|
float fData[4096];
|
|||
|
|
QString qstrGrabDate;
|
|||
|
|
}CalDataFrame;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//misc detector
|
|||
|
|
namespace MISC_DETECTOR
|
|||
|
|
{
|
|||
|
|
typedef struct tagHumitureDeviceInfo
|
|||
|
|
{
|
|||
|
|
QString qstrInterfaceName;
|
|||
|
|
}HumitureDeviceInfo;
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
#pragma pack()//<2F>ָ<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>루<EFBFBD><EBA3A8><EFBFBD><EFBFBD>8<EFBFBD>ֽڣ<D6BD>
|