From 714de8a00a3d9a81bf76d7c38a1b1e5cb8751d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=AB=8B=E6=96=B0?= Date: Fri, 14 Jan 2022 14:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shuttercali/project/LocationCali/main.cpp | 70 +++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/othersoft/shuttercali/project/LocationCali/main.cpp b/othersoft/shuttercali/project/LocationCali/main.cpp index 213ec5d..0353a36 100644 --- a/othersoft/shuttercali/project/LocationCali/main.cpp +++ b/othersoft/shuttercali/project/LocationCali/main.cpp @@ -7,22 +7,84 @@ #include #include #include +#include + QTextStream cout1(stdout, QIODevice::WriteOnly); void logout(QString str){ - std::cout<"; - std::fflush(stdout); + cout1<"< FindFeng(vector point1ist, vector valuelist); vector DengJianJu(int position, int distanc, int times = 10); vector PingHua(vector value, int step = 2); int main(int argc, char* argv[]) { + + if (argc!=3) + { + logout("Some Thing error Please check the input
The Correct Should Be application sensor numberofposition"); + logout("Senor: OSIFAlpha QEPRO"); + logout("Senor: OSIFBeta QE65"); + logout("Senor: ISIF ATP6500"); + logout("Senor: IS1 ATP1010"); + logout("Senor: IS2 ATP5020"); + + return 0; + } + int bandsnumber=1024; + QString SensorTypestr(argv[1]); + QString PositionNumberstr(argv[2]); + int PositionNumber=PositionNumberstr.toInt(); QCoreApplication aaaaa(argc, argv); - cout1<<"Welcom to use the Auto Locate Application"<<"
"<value("[DEVICE INFO]/TotalSpectrometer").toInt(); + + + logout("Welcom to use the Auto Locate Application"); string hdrPath = "/home/data/test.csv"; std::ofstream outfile(hdrPath.c_str()); logout("Init Senser :QE"); - SensorBase* aa = new SensorQExPRO(QE65PRO_QE); + SensorBase* aa= nullptr; + if (SensorTypestr=="OSIFAlpha") + { + aa = new SensorQExPRO(QE65PRO_QE); + } else if (SensorTypestr=="OSIFBeta") + { + aa = new SensorQExPRO(QE65PRO_QE); + + } + if(aa== nullptr) + { + QString portname=""; + for (int i = 0; i < numberofsensor; ++i) { + QString key="FS"+QString::number(i+1)+"/Model"; + if (m_qsDeviceConfig->value(key).toString()==SensorTypestr) + { + QString portstr=m_qsDeviceConfig->value("FS"+QString::number(i+1)+"/Port").toString(); + QStringList strlist=portstr.split('/'); + portname=strlist.at(strlist.length()-1); + } + } + if (portname=="") + { + logout("Can not find the sensor"+SensorTypestr); + return 1; + } + aa=new SensorOptoSky(ATP6500,portname); + } + + + //SensorBase* aa = new SensorOptoSky(ATP6500,"ttyUSB0"); aa->initSensor();