mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-18 19:39:43 +08:00
添加了 ATP控制类头文件等描述信息
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
||||
################################################################################
|
||||
|
||||
/build
|
||||
/.vs
|
||||
|
@ -1,11 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
|
||||
project(TowerOptoSifAndSpectral)
|
||||
|
||||
set(QT Core Network WebSockets SerialPort)
|
||||
|
||||
find_package(Qt5 REQUIRED ${QT})
|
||||
include_directories(./source/test)
|
||||
|
||||
|
||||
file(GLOB_RECURSE HDR_LIST "source/*.h")
|
||||
file(GLOB_RECURSE SRC_LIST "source/*.cpp")
|
||||
|
||||
|
||||
include_directories("source/ATP")
|
||||
|
||||
add_executable( TowerOptoSifAndSpectral
|
||||
main.cpp
|
||||
./source/test/test.cpp
|
||||
./source/test/test.h
|
||||
${HDR_LIST}
|
||||
${SRC_LIST}
|
||||
)
|
||||
qt5_use_modules(TowerOptoSifAndSpectral ${QT})
|
||||
|
||||
|
||||
|
||||
#Qt5_DIR("C:\Qt\Qt5.9.0")
|
||||
#include_directories("C:/Qt/Qt5.9.0/5.9/msvc2017_64/include")
|
21
main.cpp
21
main.cpp
@ -1,10 +1,19 @@
|
||||
#include<iostream>
|
||||
#include<QString>
|
||||
#include "test.h"
|
||||
int main()
|
||||
#include <QDebug>
|
||||
#include "ATPControl_Serial_QT.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout << "hello";
|
||||
int a=10;
|
||||
QString ss;
|
||||
std::cin >> a;
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
QString qstrTest="This is a test message";
|
||||
qDebug() << qstrTest;
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
11
source/ATP/ATPControl_Serial_QT.cpp
Normal file
11
source/ATP/ATPControl_Serial_QT.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "ATPControl_Serial_QT.h"
|
||||
|
||||
ZZ_ATPControl_Serial_Qt::ZZ_ATPControl_Serial_Qt()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ZZ_ATPControl_Serial_Qt::~ZZ_ATPControl_Serial_Qt()
|
||||
{
|
||||
|
||||
}
|
31
source/ATP/ATPControl_Serial_QT.h
Normal file
31
source/ATP/ATPControl_Serial_QT.h
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "ZZ_Types.h"
|
||||
using namespace ZZ_MISCDEF;
|
||||
using namespace ZZ_MISCDEF::ATP;
|
||||
|
||||
class ZZ_ATPControl_Serial_Qt
|
||||
{
|
||||
public:
|
||||
ZZ_ATPControl_Serial_Qt();
|
||||
virtual ~ZZ_ATPControl_Serial_Qt();
|
||||
|
||||
public:
|
||||
int ATPInitialize( ZZ_U8 usIndex);
|
||||
int ATPClose();
|
||||
|
||||
int SingleShot(ATPDataFrame &dfData);
|
||||
int SingleShotDark(ATPDataFrame &dfData);
|
||||
int SingleShotDeducted(ATPDataFrame &dfData);
|
||||
|
||||
int SetExposureTime(int iExposureTimeInMS);
|
||||
|
||||
int GetWaveLength(float *pfWaveLength);
|
||||
int GetAttribute();
|
||||
int GetDeviceListInfo(); //use type name to enum
|
||||
int GetDeviceTemperature(float &fTemperature);
|
||||
|
||||
int PerformAutoExposure(float fMinScaleFactor, float fMaxScaleFactor, float &fPredictedExposureTime);
|
||||
|
||||
private:
|
||||
int SendCommand();
|
||||
};
|
57
source/ATP/ZZ_Types.h
Normal file
57
source/ATP/ZZ_Types.h
Normal file
@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
namespace ZZ_MISCDEF
|
||||
{
|
||||
typedef unsigned char ZZ_U8;
|
||||
typedef unsigned short int ZZ_U16;
|
||||
typedef unsigned long int ZZ_U32;
|
||||
|
||||
|
||||
namespace ATP
|
||||
{
|
||||
const int MAX_SPECTRUM_SIZE = 4096;
|
||||
|
||||
const int GET_MODEBOARD_TEMP = 0x01;
|
||||
const int GET_PN_NUMBER = 0x03;
|
||||
const int GET_SN_NUMBER = 0x04;
|
||||
const int GET_MANUFACTURE_DATA = 0x06;
|
||||
const int GET_MANUFACTOR_INFO = 0x09;
|
||||
const int GET_PIXEL_LENGTH = 0x0a;
|
||||
const int GET_TEC_TEMP = 0x13;
|
||||
const int SET_TEC_TEMP = 0x12;
|
||||
const int GET_OPTICFLAT_TEMP = 0x35;
|
||||
const int GET_CIRCUIT_BOARD_TEMP = 0x36;
|
||||
const int SET_INTEGRAL_TIME = 0x14;
|
||||
const int GET_INTEGRAL_TIME = 0x41;
|
||||
const int GET_MAX_INTEGRAL_TIME = 0x42;
|
||||
const int GET_MIN_INTEGRAL_TIME = 0x43;
|
||||
const int ASYNCHRONOUS_COLLECT_DARK = 0x23;
|
||||
const int ASYNCHRONOUS_START_COLLECTION = 0x16;
|
||||
const int ASYNCHRONOUS_READ_DATA = 0x17;
|
||||
const int SET_AVERAGE_NUMBER = 0x28;
|
||||
const int SYNCHRONIZATION_GET_DATA = 0x1e;
|
||||
const int SYNCHRONIZATION_GET_DARK = 0x2f;
|
||||
const int EXTERNAL_TRIGGER_ENABLE = 0x1f;
|
||||
const int SET_XENON_LAMP_DELAY_TIME = 0x24;
|
||||
const int GET_WAVELENGTH_CALIBRATION_COFF = 0x55;
|
||||
const int GET_STAT_OF_LAMPOUT = 0x60;
|
||||
const int SET_GPIO = 0x61;
|
||||
//const int SYNCHRONIZATION_GET_DARK = 0x23
|
||||
|
||||
enum Model
|
||||
{
|
||||
ATP1010 = 0,
|
||||
ATP6500
|
||||
};
|
||||
|
||||
typedef struct tagATPDataFrame
|
||||
{
|
||||
unsigned short usExposureTime;
|
||||
int iData[4096];
|
||||
float fTemperature;
|
||||
double dTimes = 0;
|
||||
}ATPDataFrame;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user