mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-18 19:39:43 +08:00
更改install
This commit is contained in:
@ -7,22 +7,84 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <QTextStream>
|
||||
#include <QSettings>
|
||||
|
||||
QTextStream cout1(stdout, QIODevice::WriteOnly);
|
||||
void logout(QString str){
|
||||
std::cout<<str.toStdString()<<"<br>";
|
||||
std::fflush(stdout);
|
||||
cout1<<str<<"<br>"<<flush;
|
||||
|
||||
// std::fflush(stdout);
|
||||
}
|
||||
vector<int> FindFeng(vector<int > point1ist, vector<float> valuelist);
|
||||
vector<int> DengJianJu(int position, int distanc, int times = 10);
|
||||
vector <float> PingHua(vector <float> value, int step = 2);
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
if (argc!=3)
|
||||
{
|
||||
logout("Some Thing error Please check the input <br> 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"<<"<br>"<<flush;
|
||||
|
||||
QString m_qstrDeviceConfigFilePath;
|
||||
|
||||
#ifdef WIN32
|
||||
m_qstrDeviceConfigFilePath = ("D:\\03MyGit\\linux\\movingliner\\DeviceSettings.ini");
|
||||
#else
|
||||
m_qstrDeviceConfigFilePath = ("/home/data/Setting/DeviceSettings.ini");
|
||||
#endif
|
||||
QSettings *m_qsDeviceConfig;
|
||||
m_qsDeviceConfig = new QSettings(m_qstrDeviceConfigFilePath, QSettings::IniFormat);
|
||||
int numberofsensor=m_qsDeviceConfig->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();
|
||||
|
Reference in New Issue
Block a user