mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 11:49:42 +08:00
Compare commits
6 Commits
d6dadec3cc
...
zz
Author | SHA1 | Date | |
---|---|---|---|
c99ba84638 | |||
ad0c4149e6 | |||
fe80b88677 | |||
527c23e30e | |||
6f65684ddb | |||
4ebbea7bc9 |
@ -2,22 +2,22 @@
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux-GCC-Debug",
|
||||
"generator": "Unix Makefiles",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"cmakeExecutable": "/opt/cmake/bin/cmake",
|
||||
"cmakeExecutable": "/zz/cmake-3.29.3/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git", "out" ],
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_arm" ],
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"remoteMachineName": "243120617;172.16.0.232 (username=root, port=22, authentication=Password)",
|
||||
"remoteMachineName": "-1273990714;172.16.0.61 (username=root, port=22, authentication=Password)",
|
||||
"remoteCMakeListsRoot": "/home/pi/SIF0/src",
|
||||
"remoteBuildRoot": "/home/pi/SIF0/out/build_d/${name}",
|
||||
"remoteInstallRoot": "/home/pi/SIF0/out/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"remoteCopyUseCompilerDefaults": false
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
@ -29,6 +29,25 @@
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ]
|
||||
},
|
||||
{
|
||||
"name": "Linux-GCC-R",
|
||||
"generator": "Unix Makefiles",
|
||||
"configurationType": "Release",
|
||||
"cmakeExecutable": "/opt/cmake/bin/cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", ".git", "out" ],
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_arm" ],
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"remoteMachineName": "-1784524891;172.16.0.71 (username=root, port=22, authentication=Password)",
|
||||
"remoteCMakeListsRoot": "/home/pi/SIF0/src_r",
|
||||
"remoteBuildRoot": "/home/pi/SIF0/out/build_r/${name}",
|
||||
"remoteInstallRoot": "/home/pi/SIF0/out/install_r/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete --delete-excluded",
|
||||
"remoteCopyBuildOutput": true,
|
||||
"remoteCopySourcesMethod": "rsync"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(TowerOptoSifAndSpectral)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
35
main.cpp
35
main.cpp
@ -9,7 +9,6 @@
|
||||
#include "MainDataUploader.h"
|
||||
#include "VSMD12XMovementTest.h"
|
||||
using namespace std;
|
||||
#pragma once
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -20,10 +19,13 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////for test
|
||||
MovementTest m_testVSMD12X;
|
||||
//MovementTest m_testVSMD12X;
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//system("gpio mode 1 output");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD>ʼ<EFBFBD><CABC>
|
||||
//qDebug() << "gpio mode 1 output......" << endl;
|
||||
//
|
||||
//ZZ_ATPControl_Serial_Qt test;
|
||||
//test.Initialize(0, "/dev/ttyS1", "2223344");
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////
|
||||
GY39Controller m_ctrlHumitureDetector;
|
||||
@ -54,13 +56,14 @@ int main(int argc, char *argv[])
|
||||
///turn on power supply
|
||||
|
||||
//////add support to dual channel
|
||||
system("gpio mode 1 out");
|
||||
system("gpio mode 4 out");
|
||||
system("gpio mode 5 out");
|
||||
qDebug() << "gpio 1;4;5; ready" << endl;
|
||||
int iRet0 = 0,iRet1 = 0,iRet2 = 0,iRet3 = 0;
|
||||
iRet0 = system("gpio mode 1 out");
|
||||
iRet1 = system("gpio mode 4 out");
|
||||
iRet2 = system("gpio mode 5 out");
|
||||
iRet3 = system("gpio write 1 1");//上电
|
||||
|
||||
system("gpio write 1 1");//<2F>豸<EFBFBD>ϵ<EFBFBD>
|
||||
qDebug() << "gpio write 1 1......" << endl;
|
||||
qDebug() << "gpio 1;4;5; ready"<<" Ret:"<< iRet0<< iRet1<< iRet2<< endl;
|
||||
qDebug() << "gpio write 1 1......" <<" Ret:"<< iRet3<< endl;
|
||||
|
||||
// QString qstrCMD_A, qstrCMD_B, qstrCMD_Temp;
|
||||
// qstrCMD_Temp = QString::fromStdString("4");
|
||||
@ -86,18 +89,21 @@ int main(int argc, char *argv[])
|
||||
m_scConfiggerLoader.GetParams(m_struRuntimeParams, m_struEC, m_struMEC, m_struHumitureDI);
|
||||
|
||||
m_sTimer.SetAcqTimeParams(m_struRuntimeParams.atsParams);
|
||||
m_dfpSaver.SetEnvironmentContex(m_struEC);
|
||||
m_dfpSaver.SetManmadeEnviromentalContext(m_struMEC);
|
||||
|
||||
m_mduUploader.SetContext(m_struEC, m_struMEC);
|
||||
//m_mduUploader.SetContext(m_struEC, m_struMEC);
|
||||
//m_mduUploader.Initialize();
|
||||
m_ctrlHumitureDetector.Initialize(m_struHumitureDI.qstrInterfaceName.toStdString());
|
||||
//////////////////////////////////////////////////////////////////////////prepare
|
||||
m_sTimer.Preheating();
|
||||
//m_sTimer.Preheating();
|
||||
m_ctrlHumitureDetector.GetHumiture_retry(m_fChassisTemp, m_fChassisHum);
|
||||
m_ctrlHumitureDetector.GetHumiture_retry(m_fChassisTemp, m_fChassisHum);
|
||||
|
||||
m_struEC.qstrCaseTemperature= QString("%1").arg(m_fChassisTemp);
|
||||
m_struEC.qstrCaseHumidity = QString("%1").arg(m_fChassisHum);
|
||||
|
||||
m_dfpSaver.SetEnvironmentContex(m_struEC);
|
||||
m_dfpSaver.SetManmadeEnviromentalContext(m_struMEC);
|
||||
m_mduUploader.SetContext(m_struEC, m_struMEC);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
QThread* m_pqDataGrabberThreadHolder = new QThread();
|
||||
QThread* m_pqTimerThreadHolder = new QThread();
|
||||
@ -123,9 +129,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
m_mdgGrabber.Init_Self();
|
||||
m_sTimer.SelfStart();
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////test
|
||||
// DataFileProcessor testdp;
|
||||
// ZZ_SysConfigger test;
|
||||
@ -210,8 +213,6 @@ int main(int argc, char *argv[])
|
||||
// qfCalFile.read((char*)OneFile.fWaveLength, sizeof(double)*OneFile.iPixels);
|
||||
// qfCalFile.read((char*)OneFile.dCal_Gain, sizeof(double)*OneFile.iPixels);
|
||||
// qfCalFile.read((char*)OneFile.dCal_Offset, sizeof(double)*OneFile.iPixels);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
return a.exec();
|
||||
|
@ -102,22 +102,22 @@ void ATPFiberImager::recordDark(QString path)
|
||||
//<2F>ɼ<EFBFBD><C9BC><EFBFBD>֡
|
||||
singleShot(m_DarkData);
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
// QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
// QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_darkSpectral.csv";
|
||||
// std::ofstream outfile(fileName.toStdString().c_str());
|
||||
//
|
||||
// for (int i = 0; i < attribute.iPixels; i++)
|
||||
// {
|
||||
// if (i==0)
|
||||
// {
|
||||
// outfile << m_DarkData.usExposureTimeInMS << std::endl;
|
||||
// }
|
||||
// outfile << attribute.fWaveLengthInNM[i] << "," << m_DarkData.lData[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile.close();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_darkSpectral_dn.csv";
|
||||
std::ofstream outfile(fileName.toStdString().c_str());
|
||||
|
||||
for (int i = 0; i < attribute.iPixels; i++)
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
outfile << m_DarkData.usExposureTimeInMS << std::endl;
|
||||
}
|
||||
outfile << attribute.fWaveLengthInNM[i] << "," << m_DarkData.lData[i] << std::endl;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
|
||||
void ATPFiberImager::recordTarget(int recordTimes, QString path)
|
||||
@ -155,22 +155,22 @@ void ATPFiberImager::recordTarget(int recordTimes, QString path)
|
||||
}
|
||||
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
// QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
// QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_integratingSphereSpectral.csv";
|
||||
// std::ofstream outfile(fileName.toStdString().c_str());
|
||||
//
|
||||
// for (int i = 0; i < attribute.iPixels; i++)
|
||||
// {
|
||||
// if (i==0)
|
||||
// {
|
||||
// outfile << m_IntegratingSphereData.usExposureTimeInMS << std::endl;
|
||||
// }
|
||||
// outfile << attribute.fWaveLengthInNM[i] << "," << m_IntegratingSphereData.lData[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile.close();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_integratingSphereSpectral_dn.csv";
|
||||
std::ofstream outfile(fileName.toStdString().c_str());
|
||||
|
||||
for (int i = 0; i < attribute.iPixels; i++)
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
outfile << m_IntegratingSphereData.usExposureTimeInMS << std::endl;
|
||||
}
|
||||
outfile << attribute.fWaveLengthInNM[i] << "," << m_IntegratingSphereData.lData[i] << std::endl;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
|
||||
void ATPFiberImager::autoExpose()
|
||||
|
@ -113,28 +113,28 @@ void CalibrationAlgorithm::readAndResample_StandardLightFile(QString filePath, i
|
||||
|
||||
|
||||
|
||||
// //<2F><><EFBFBD>ضϱ<D8B6><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QFileInfo fileInfo(filePath);
|
||||
// QString standardLightFileFolder = fileInfo.path();
|
||||
// QString standardLightFileName = fileInfo.fileName();
|
||||
//
|
||||
// QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
// QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
//
|
||||
// QString tmp = standardLightFileFolder + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) +"_"+ standardLightFileName + "_truncation.csv";
|
||||
//
|
||||
// std::ofstream outfile1(tmp.toStdString().c_str());
|
||||
//
|
||||
// for (size_t i = 0; i < endPos - startPos; i++)
|
||||
// {
|
||||
// if (i == 0)
|
||||
// {
|
||||
// outfile1 << m_dStandardLightDataBase << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile1 << m_dStandardLightWavelength[i] << "," << m_dStandardLightData[i] << std::endl;
|
||||
// }
|
||||
// outfile1.close();
|
||||
//<2F><><EFBFBD>ضϱ<D8B6><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QFileInfo fileInfo(filePath);
|
||||
QString standardLightFileFolder = fileInfo.path();
|
||||
QString standardLightFileName = fileInfo.fileName();
|
||||
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
|
||||
QString tmp = standardLightFileFolder + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) +"_"+ standardLightFileName + "_truncation.csv";
|
||||
|
||||
std::ofstream outfile1(tmp.toStdString().c_str());
|
||||
|
||||
for (size_t i = 0; i < endPos - startPos; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
outfile1 << m_dStandardLightDataBase << std::endl;
|
||||
}
|
||||
|
||||
outfile1 << m_dStandardLightWavelength[i] << "," << m_dStandardLightData[i] << std::endl;
|
||||
}
|
||||
outfile1.close();
|
||||
|
||||
|
||||
|
||||
@ -176,19 +176,19 @@ void CalibrationAlgorithm::readAndResample_StandardLightFile(QString filePath, i
|
||||
}
|
||||
|
||||
|
||||
// //<2F><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QString outputName = standardLightFileFolder + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_" + standardLightFileName + "_resample.csv";
|
||||
// std::ofstream outfile2(outputName.toStdString().c_str());
|
||||
// for (size_t i = 0; i < deviceAttribute.iPixels; i++)
|
||||
// {
|
||||
// if (i == 0)
|
||||
// {
|
||||
// outfile2 << m_dStandardLightDataBase << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile2 << deviceAttribute.fWaveLengthInNM[i] << "," << m_dStandardLightDataResampled[i] << std::endl;
|
||||
// }
|
||||
// outfile2.close();
|
||||
//<2F><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QString outputName = standardLightFileFolder + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_" + standardLightFileName + "_resample.csv";
|
||||
std::ofstream outfile2(outputName.toStdString().c_str());
|
||||
for (size_t i = 0; i < deviceAttribute.iPixels; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
outfile2 << m_dStandardLightDataBase << std::endl;
|
||||
}
|
||||
|
||||
outfile2 << deviceAttribute.fWaveLengthInNM[i] << "," << m_dStandardLightDataResampled[i] << std::endl;
|
||||
}
|
||||
outfile2.close();
|
||||
}
|
||||
|
||||
void CalibrationAlgorithm::produceCalfile(QString calFilePath, DeviceAttribute deviceAttribute, DataFrame integratingSphereData, DataFrame darkData)
|
||||
|
@ -123,23 +123,23 @@ void OceanOpticsFiberImager::recordDark(QString path)
|
||||
//<2F>ɼ<EFBFBD><C9BC><EFBFBD>֡
|
||||
singleShot(m_DarkData);
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
// QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
//
|
||||
// QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_darkSpectral.csv";
|
||||
// std::ofstream outfile(fileName.toStdString().c_str());
|
||||
//
|
||||
// for (int i = 0; i < attribute.iPixels; i++)
|
||||
// {
|
||||
// if (i==0)
|
||||
// {
|
||||
// outfile << m_DarkData.usExposureTimeInMS << std::endl;//
|
||||
// }
|
||||
// outfile << attribute.fWaveLengthInNM[i] << "," << m_DarkData.lData[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile.close();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
|
||||
QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_darkSpectral_dn.csv";
|
||||
std::ofstream outfile(fileName.toStdString().c_str());
|
||||
|
||||
for (int i = 0; i < attribute.iPixels; i++)
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
outfile << m_DarkData.usExposureTimeInMS << std::endl;//
|
||||
}
|
||||
outfile << attribute.fWaveLengthInNM[i] << "," << m_DarkData.lData[i] << std::endl;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
|
||||
void OceanOpticsFiberImager::recordTarget(int recordTimes, QString path)
|
||||
@ -177,23 +177,23 @@ void OceanOpticsFiberImager::recordTarget(int recordTimes, QString path)
|
||||
}
|
||||
|
||||
|
||||
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
// QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
// QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
//
|
||||
// QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_integratingSphereSpectral.csv";
|
||||
// std::ofstream outfile(fileName.toStdString().c_str());
|
||||
//
|
||||
// for (int i = 0; i < attribute.iPixels; i++)//
|
||||
// {
|
||||
// if (i==0)
|
||||
// {
|
||||
// outfile << m_IntegratingSphereData.usExposureTimeInMS << std::endl;
|
||||
// }
|
||||
// outfile << attribute.fWaveLengthInNM[i] << "," << m_IntegratingSphereData.lData[i] << std::endl;
|
||||
// }
|
||||
//
|
||||
// outfile.close();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>csv
|
||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||
QString currentTime = curDateTime.toString("yyyy_MM_dd_hh_mm_ss");
|
||||
|
||||
QString fileName = path + "/" + currentTime + "_" + QString::fromStdString(deviceInfo.strSN) + "_integratingSphereSpectral_dn.csv";
|
||||
std::ofstream outfile(fileName.toStdString().c_str());
|
||||
|
||||
for (int i = 0; i < attribute.iPixels; i++)//
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
outfile << m_IntegratingSphereData.usExposureTimeInMS << std::endl;
|
||||
}
|
||||
outfile << attribute.fWaveLengthInNM[i] << "," << m_IntegratingSphereData.lData[i] << std::endl;
|
||||
}
|
||||
|
||||
outfile.close();
|
||||
}
|
||||
|
||||
void OceanOpticsFiberImager::autoExpose()
|
||||
|
@ -7,6 +7,7 @@ CMainDataGrabber::CMainDataGrabber(QObject* parent /*= nullptr*/)
|
||||
|
||||
//m_GrabTimer = new QTimer(this);
|
||||
|
||||
m_iFlagIsWorkingTime = 1;
|
||||
m_iFlagIsCapturing = false;
|
||||
m_iFlagIsCapturing_Signal = false;
|
||||
m_iFlagIsCapturing_Dark = false;
|
||||
@ -459,6 +460,8 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
|
||||
int CMainDataGrabber::OnTimeCounter()
|
||||
{
|
||||
m_iFlagIsWorkingTime = 1;
|
||||
|
||||
bool bRes;
|
||||
QString qstrCMD_A,qstrCMD_B,qstrCMD_Temp;
|
||||
|
||||
@ -504,7 +507,7 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
{
|
||||
if (m_struLinearShutterContext.ucProtocolType == 100)
|
||||
{
|
||||
if (i==0)
|
||||
if (/*i==0*/i%2==0)
|
||||
{
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelA);
|
||||
qstrCMD_A = "gpio write " + qstrCMD_Temp + " 1";
|
||||
@ -520,7 +523,7 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
|
||||
Delay_MSec(500);
|
||||
}
|
||||
if (i==1)
|
||||
else if (/*i==1*/i%2==1)
|
||||
{
|
||||
qstrCMD_Temp = QString::fromStdString(m_vecDSS[0].strChannelA);
|
||||
qstrCMD_A = "gpio write " + qstrCMD_Temp + " 0";
|
||||
@ -630,11 +633,16 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
//vecData[i].push_back();
|
||||
}
|
||||
|
||||
//emit SignalPushOneDataFrame(vecData);
|
||||
m_pmduUploader->SetData(vecData);
|
||||
emit SignalPushOneDataFrame();
|
||||
m_pdfpSaver->SetData(vecData);
|
||||
m_pdfpSaver->WriteDataFile();
|
||||
if (m_iFlagIsWorkingTime)
|
||||
{
|
||||
//emit SignalPushOneDataFrame(vecData);
|
||||
m_pmduUploader->SetData(vecData);
|
||||
emit SignalPushOneDataFrame();
|
||||
m_pdfpSaver->SetData(vecData);
|
||||
qDebug() << "Thread Data Server: WriteDataFile Called";
|
||||
m_pdfpSaver->WriteDataFile();
|
||||
}
|
||||
|
||||
m_iFlagIsCapturing = 0;
|
||||
|
||||
// qDebug() << "-------------------------------------------busy" << QTime::currentTime().toString();
|
||||
@ -679,6 +687,9 @@ int CMainDataGrabber::GrabOnceFinished()
|
||||
|
||||
int CMainDataGrabber::OnZeroHoldCurrent()
|
||||
{
|
||||
///
|
||||
m_iFlagIsWorkingTime = 0;
|
||||
///
|
||||
bool bRes = m_ctrlLS.SetHoldCurrent(0);
|
||||
if (!bRes)
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ private:
|
||||
|
||||
int m_iTotalThreads;
|
||||
|
||||
int m_iFlagIsWorkingTime;
|
||||
int m_iFlagIsCapturing;
|
||||
int m_iFlagIsCapturing_Signal;
|
||||
int m_iFlagIsCapturing_Dark;
|
||||
|
@ -25,10 +25,11 @@ void Scheduler::SetAcqTimeParams(AcqTimeSettings struAcqTime)
|
||||
void Scheduler::Preheating()
|
||||
{
|
||||
qDebug() << "Start Preheating";
|
||||
//QThread::msleep(5000);
|
||||
#ifdef _DEBUG
|
||||
QThread::msleep(5000);
|
||||
#else
|
||||
QThread::msleep(900000);//NEED TO CHANGE BEFOR HAND TO CUSTOM
|
||||
QThread::msleep(900000);//NEED TO CHANGE BEFOR HAND TO CUSTOMER
|
||||
#endif
|
||||
qDebug() << "Preheating Finished";
|
||||
}
|
||||
|
@ -43,14 +43,16 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
|
||||
//connect(this, &ZZ_ATPControl_Serial_Qt::SignalInit_Self, this, &ZZ_ATPControl_Serial_Qt::Init_Self);
|
||||
//emit SignalInit_Self();
|
||||
|
||||
QString qstrPortName = QString::fromStdString(ucPortNumber);
|
||||
qstrInitPortName = QString::fromStdString(ucPortNumber);
|
||||
qstrInitDeviceSN = QString::fromStdString(strDeviceName);
|
||||
|
||||
m_pSerialPort->setPortName(qstrPortName);
|
||||
m_pSerialPort->setPortName(qstrInitPortName);
|
||||
m_pSerialPort->setReadBufferSize(512);
|
||||
bool bRes = m_pSerialPort->setBaudRate(m_iBaudRate);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:setBaudRate Failed.Exit Code:1";
|
||||
qDebug() << "FS Err:setBaudRate Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
//std::cout << "Err.setBaudRate Failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
@ -58,7 +60,8 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
|
||||
bRes = m_pSerialPort->open(QIODevice::ReadWrite);
|
||||
if (!bRes)
|
||||
{
|
||||
qDebug() << "Err:open Failed.Exit Code:2";
|
||||
qDebug() << "FS Err:open Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
//std::cout << "Err.open Failed" << std::endl;
|
||||
return 2;
|
||||
}
|
||||
@ -78,6 +81,7 @@ int ZZ_ATPControl_Serial_Qt::Initialize(bool bIsUSBMode, std::string ucPortNumbe
|
||||
if (szPostion == std::string::npos)
|
||||
{
|
||||
qDebug() << "Err:FS serial number not match.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
@ -102,18 +106,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo &Info)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
m_diDeviceInfo.strPN = qbRecv.data();
|
||||
@ -125,18 +132,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo &Info)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
m_diDeviceInfo.strSN = qbRecv.data();
|
||||
@ -157,18 +167,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
m_daDeviceAttr.iMinIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||
@ -180,18 +193,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256;
|
||||
@ -204,12 +220,14 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
//return 2;
|
||||
}
|
||||
iRes = SingleShot(m_daDeviceAttr.iPixels);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@ -225,18 +243,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
float fWaveLengthCoef[4];
|
||||
@ -269,18 +290,21 @@ int ZZ_ATPControl_Serial_Qt::SetAvgTimes(int iTimes /*= 1*/)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetAvgTimes Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetAvgTimes Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetAvgTimes Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
@ -299,18 +323,21 @@ int ZZ_ATPControl_Serial_Qt::GetExposureTime_Init()
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetExposureTime Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetExposureTime Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetExposureTime Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@ -343,6 +370,7 @@ int ZZ_ATPControl_Serial_Qt::SendCommand(QByteArray qbCommand)
|
||||
if (qi64Write != qbSend.size())
|
||||
{
|
||||
qDebug() << "Err:write Failed.Exit Code:1" << qi64Write;
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -365,6 +393,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData)
|
||||
if (iCounter > 150)
|
||||
{
|
||||
qDebug() << "Err:RecvData Failed,Not Enough Data.Exit Code:1" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iCounter++;
|
||||
@ -373,6 +402,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData)
|
||||
if ((ZZ_U8)qbData[0] != (ZZ_U8)0xaa || (ZZ_U8)qbData[1] != (ZZ_U8)0x55)
|
||||
{
|
||||
qDebug() << "Err:RecvData Failed,Wrong Header.Exit Code:2" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -386,6 +416,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData)
|
||||
if (iCounter > 200)
|
||||
{
|
||||
qDebug() << "Err:RecvData Failed,Incomplete Data.Exit Code:3" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
iCounter++;
|
||||
@ -406,6 +437,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData)
|
||||
if ((ZZ_U8)usCheckSum != ucTemp)
|
||||
{
|
||||
qDebug() << "Err:RecvData Failed,Incorrect Check Sum.Exit Code:4" << "Total Recv:" << qbData.size() << "Check Sum:" << usCheckSum << "Not Equal To" << ucTemp;
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
//qbData.clear();
|
||||
//return 4;
|
||||
return 0;
|
||||
@ -429,6 +461,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData_ShortLag(QByteArray &qbData)
|
||||
if (iCounter > 6)
|
||||
{
|
||||
qDebug() << "Err:RecvData_ShortLag Failed,Not Enough Data.Exit Code:1" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iCounter++;
|
||||
@ -437,6 +470,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData_ShortLag(QByteArray &qbData)
|
||||
if ((ZZ_U8)qbData[0] != (ZZ_U8)0xaa || (ZZ_U8)qbData[1] != (ZZ_U8)0x55)
|
||||
{
|
||||
qDebug() << "Err:RecvData_ShortLag Failed,Wrong Header.Exit Code:2" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -450,6 +484,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData_ShortLag(QByteArray &qbData)
|
||||
if (iCounter > 6)
|
||||
{
|
||||
qDebug() << "Err:RecvData_ShortLag Failed,Incomplete Data.Exit Code:3" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
iCounter++;
|
||||
@ -470,6 +505,7 @@ int ZZ_ATPControl_Serial_Qt::RecvData_ShortLag(QByteArray &qbData)
|
||||
if ((ZZ_U8)usCheckSum != ucTemp)
|
||||
{
|
||||
qDebug() << "Err:RecvData_ShortLag Failed,Incorrect Check Sum.Exit Code:4" << "Total Recv:" << qbData.size() << "Check Sum:" << usCheckSum << "Not Equal To" << ucTemp;
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
//qbData.clear();
|
||||
//return 4;
|
||||
return 0;
|
||||
@ -483,6 +519,7 @@ int ZZ_ATPControl_Serial_Qt::ParseData(QByteArray &qbData)
|
||||
if (qbData.size() < 6)
|
||||
{
|
||||
qDebug() << "Err:ParseData Failed,Not Enough Data.Exit Code:1" << qbData.size();
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
qbData.remove(0, 5);
|
||||
@ -519,6 +556,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -544,6 +582,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -620,6 +659,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
bFlagIsOverMaxExposureTime = true;
|
||||
@ -630,6 +670,7 @@ int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fM
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
@ -660,24 +701,28 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetExposureTime Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetExposureTime Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SetExposureTime Failed.Exit Code:4";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 4;
|
||||
}
|
||||
|
||||
if ((ZZ_U8)qbRecv[0] != 0)
|
||||
{
|
||||
qDebug() << "Err:SetExposureTime Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
/*m_pSerialPort->waitForReadyRead(5000);
|
||||
m_pSerialPort->clear();*/
|
||||
//return 1;
|
||||
@ -735,18 +780,21 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShot Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShot Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShot Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@ -755,6 +803,7 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData)
|
||||
if ((ZZ_U8)qbRecv[0] != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShot Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -794,24 +843,28 @@ int ZZ_ATPControl_Serial_Qt::SingleShot(int &iPixels)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShotP Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShotP Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShot Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ((ZZ_U8)qbRecv[0] != 0)
|
||||
{
|
||||
qDebug() << "Err:SingleShotP Failed.Exit Code:4";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
@ -844,18 +897,21 @@ int ZZ_ATPControl_Serial_Qt::GetDeviceTemperature(float &fTemperature)
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceTemperature Failed.Exit Code:1";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 1;
|
||||
}
|
||||
iRes = RecvData_ShortLag(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceTemperature Failed.Exit Code:2";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 2;
|
||||
}
|
||||
iRes = ParseData(qbRecv);
|
||||
if (iRes != 0)
|
||||
{
|
||||
qDebug() << "Err:GetDeviceTemperature Failed.Exit Code:3";
|
||||
qDebug() << "FS Init Port:" << qstrInitPortName << "FS Init Dev SN :" << qstrInitDeviceSN;
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,8 @@ public:
|
||||
#else //
|
||||
private:
|
||||
#endif
|
||||
//init
|
||||
QString qstrInitPortName,qstrInitDeviceSN;
|
||||
//port
|
||||
int m_iBaudRate;
|
||||
QSerialPort *m_pSerialPort;
|
||||
|
@ -37,9 +37,16 @@ void DataFileProcessor::SetData(std::vector<std::vector<DataFrame>> vecData)
|
||||
|
||||
bool DataFileProcessor::WriteDataFile()
|
||||
{
|
||||
//qDebug() << "start Thread Data Server GenerateFilePath";
|
||||
GenerateFilePath();
|
||||
|
||||
//qDebug() << "start Thread Data Server WriteEnvironmentInfo";
|
||||
WriteEnvironmentInfo();
|
||||
|
||||
//qDebug() << "start Thread Data Server WriteDeviceInfo";
|
||||
WriteDeviceInfo();
|
||||
|
||||
//qDebug() << "start Thread Data Server WriteData";
|
||||
WriteData();
|
||||
return 1;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ bool CVSMD12XControl::InitController()
|
||||
|
||||
bool CVSMD12XControl::GetStatus(MSInfo &stuMotorParam)
|
||||
{
|
||||
std::string strCMD = "cts\n";
|
||||
std::string strCMD = "sts\n";
|
||||
|
||||
if (m_iProtocolType)
|
||||
{
|
||||
@ -1432,7 +1432,7 @@ bool CVSMD12XControl::IsMotionFinished()
|
||||
QThread::msleep(200);
|
||||
//Delay_MSec(200);
|
||||
GetStatus(m_stuMSInfo);
|
||||
ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF;
|
||||
ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x00FFFFFF;
|
||||
ucFlag = ucFlag & 0x10;
|
||||
if (m_stuMSInfo.fVelocity == 0)
|
||||
{
|
||||
@ -1445,15 +1445,21 @@ bool CVSMD12XControl::IsMotionFinished()
|
||||
}
|
||||
if (iCountStopped>=50)
|
||||
{
|
||||
QString str = QString("%1").arg(m_stuMSInfo.uiFlags, 30, 2, QChar('0'));
|
||||
qDebug() <<"Warning.Motion Err,should be stopped already.checking register and retry...";
|
||||
qDebug() <<"motion status:"<<ucFlag<<"all status:"<<QString::number(m_stuMSInfo.uiFlags,2);
|
||||
qDebug() << "velocity:" << m_stuMSInfo.fVelocity;
|
||||
qDebug() << "position:" << m_stuMSInfo.iPosition;
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << str;
|
||||
bFlagIsStopped = true;
|
||||
return false;
|
||||
}
|
||||
if (iCountTotal>1000)
|
||||
{
|
||||
qDebug() << "Err.Motor Hardware Err,should be stopped already";
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << QString::number(m_stuMSInfo.uiFlags, 2);
|
||||
QString str = QString("%1").arg(m_stuMSInfo.uiFlags, 30, 2, QChar('0'));
|
||||
qDebug() << "Warning.Motion Err,should be stopped already.checking register and retry...";
|
||||
qDebug() << "velocity:" << m_stuMSInfo.fVelocity;
|
||||
qDebug() << "position:" << m_stuMSInfo.iPosition;
|
||||
qDebug() << "motion status:" << ucFlag << "all status:" << str;
|
||||
bFlagIsStopped = true;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user