增加了shutter切换模块对双通道的支持 修改错误

This commit is contained in:
xin
2022-05-06 10:40:17 +08:00
parent 54e89bb81f
commit 37e998dcce
2 changed files with 8 additions and 3 deletions

3
.gitignore vendored
View File

@ -16,3 +16,6 @@
/othersoft/calibration_console/build/
/othersoft/shuttercali/project/LocationCali/cmake-build-debug
/othersoft/calibration_console/cmake-build-debug/
/othersoft/movingliner/cmake-build-debug/
/othersoft/movingliner/cmake-build-debug-toweris2/
/othersoft/movingliner/cmake-build-release/

View File

@ -35,10 +35,12 @@ int main(int argc, char *argv[]) {
// m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()
if( m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()=="GPIO")
{
//cout1<<"ERROR number position"<<flush;
int positionnumber=m_qsDeviceConfig->value("LINEAR SHUTTER/TotalPosition").toInt();
if (str>=positionnumber)
if (str.toInt()>=positionnumber)
{
cout1<<"ERROR number position"<<flush;
return 0;
}
int targetpos=m_qsDeviceConfig->value("LINEAR SHUTTER/Position"+str).toLongLong();
@ -51,10 +53,10 @@ int main(int argc, char *argv[]) {
system(com.toStdString().c_str());
}
QThread::sleep(500);
QThread::msleep(500);
QString com="gpio write "+QString::number(targetpos)+" 1";
system(com.toStdString().c_str());
QThread::sleep(500);
QThread::msleep(500);
cout1<<"FINISH Change Shutter <br>"<<flush;
return 0;