diff --git a/main.cpp b/main.cpp index 0a15c4b..feba0c7 100644 --- a/main.cpp +++ b/main.cpp @@ -7,6 +7,7 @@ #include "Scheduler.h" #include "GY39Controller.h" #include "MainDataUploader.h" +#include "VSMD12XMovementTest.h" using namespace std; #pragma once @@ -18,7 +19,9 @@ int main(int argc, char *argv[]) QCoreApplication a(argc, argv); - + //////////////////////////////////////////////////////////////////////////for test + MovementTest m_testVSMD12X; + //////////////////////////////////////////////////////////////////////////// //system("gpio mode 1 output");//������ų�ʼ�� //qDebug() << "gpio mode 1 output......" << endl; ////////////////////////////////////////////////////////////////////////// @@ -88,10 +91,10 @@ int main(int argc, char *argv[]) m_mduUploader.SetContext(m_struEC, m_struMEC); //m_mduUploader.Initialize(); - //m_ctrlHumitureDetector.Initialize(m_struHumitureDI.qstrInterfaceName.toStdString()); + m_ctrlHumitureDetector.Initialize(m_struHumitureDI.qstrInterfaceName.toStdString()); //////////////////////////////////////////////////////////////////////////prepare 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); diff --git a/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp b/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp index 31291d1..a10a29f 100644 --- a/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp +++ b/othersoft/calibration_console/Source_Files/ATPControl_Serial_QT.cpp @@ -679,9 +679,11 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS) if ((ZZ_U8)qbRecv[0] != 0) { qDebug() << "Err:SetExposureTime Failed.Exit Code:1"; + //return 1; } + return 0; } diff --git a/source/CaptureThread/Scheduler.cpp b/source/CaptureThread/Scheduler.cpp index 986ad29..c5e6150 100644 --- a/source/CaptureThread/Scheduler.cpp +++ b/source/CaptureThread/Scheduler.cpp @@ -55,6 +55,10 @@ void Scheduler::StartAsPlanned() int iIntervalInMS = m_struAcqTime.qtInterval.hour() * 3600 * 1000 + m_struAcqTime.qtInterval.minute() * 60 * 1000 + m_struAcqTime.qtInterval.second() * 1000; m_GrabTimer->start(iIntervalInMS); + + QThread::msleep(5000); + qDebug() << "it's time to start work."; + emit SignalGrabOnce(); //this->OnTimeCounter(); //emit &QTimer::timeout; } diff --git a/source/FS/ATPControl_Serial_QT.cpp b/source/FS/ATPControl_Serial_QT.cpp index 12bb950..4ca227a 100644 --- a/source/FS/ATPControl_Serial_QT.cpp +++ b/source/FS/ATPControl_Serial_QT.cpp @@ -320,6 +320,8 @@ int ZZ_ATPControl_Serial_Qt::GetExposureTime_Init() int ZZ_ATPControl_Serial_Qt::SendCommand(QByteArray qbCommand) { + m_pSerialPort->clear(); + int iSize = qbCommand.size() + 3; QByteArray qbSend; qbSend.resize(4); @@ -349,6 +351,7 @@ int ZZ_ATPControl_Serial_Qt::SendCommand(QByteArray qbCommand) int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData) { + qbData.clear(); qbData = m_pSerialPort->readAll(); @@ -675,6 +678,8 @@ int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS) if ((ZZ_U8)qbRecv[0] != 0) { qDebug() << "Err:SetExposureTime Failed.Exit Code:1"; + /*m_pSerialPort->waitForReadyRead(5000); + m_pSerialPort->clear();*/ //return 1; } diff --git a/source/LinearShutter/VSMD12XMovementTest.cpp b/source/LinearShutter/VSMD12XMovementTest.cpp new file mode 100644 index 0000000..7631742 --- /dev/null +++ b/source/LinearShutter/VSMD12XMovementTest.cpp @@ -0,0 +1,21 @@ +#include "VSMD12XMovementTest.h" + +MovementTest::MovementTest() +{ + +} + +MovementTest::~MovementTest() +{ +} + +void MovementTest::TestAsLinearShutter() +{ + PortInfo piTemp; + piTemp.qstrFullPortName = QString::fromStdString(""); + m_ctrlLS.ILMES_InitializeComm(piTemp, 1, 1); + ControllerParams cpTemp; + bool res = m_ctrlLS.ILMES_InitializeParams(cpTemp); + //m_ctrlLS.ILMES_SetPosition(m_struAcqPosSetting.iPosition, m_struAcqPosSetting.iTotalPosition); +} + diff --git a/source/LinearShutter/VSMD12XMovementTest.h b/source/LinearShutter/VSMD12XMovementTest.h new file mode 100644 index 0000000..54b173e --- /dev/null +++ b/source/LinearShutter/VSMD12XMovementTest.h @@ -0,0 +1,11 @@ +#include "VSMD12XControl.h" +class MovementTest +{ +public: + MovementTest(); + ~MovementTest(); +private: + CVSMD12XControl m_ctrlLS; +public: + void TestAsLinearShutter(); +}; \ No newline at end of file