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

This commit is contained in:
xin
2022-05-06 10:40:17 +08:00
committed by xin
parent 00d5e18e47
commit c40c4046fe
2 changed files with 8 additions and 3 deletions

3
.gitignore vendored
View File

@ -16,3 +16,6 @@
/othersoft/calibration_console/build/ /othersoft/calibration_console/build/
/othersoft/shuttercali/project/LocationCali/cmake-build-debug /othersoft/shuttercali/project/LocationCali/cmake-build-debug
/othersoft/calibration_console/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() // m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()
if( m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()=="GPIO") if( m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()=="GPIO")
{ {
//cout1<<"ERROR number position"<<flush;
int positionnumber=m_qsDeviceConfig->value("LINEAR SHUTTER/TotalPosition").toInt(); int positionnumber=m_qsDeviceConfig->value("LINEAR SHUTTER/TotalPosition").toInt();
if (str>=positionnumber) if (str.toInt()>=positionnumber)
{ {
cout1<<"ERROR number position"<<flush; cout1<<"ERROR number position"<<flush;
return 0;
} }
int targetpos=m_qsDeviceConfig->value("LINEAR SHUTTER/Position"+str).toLongLong(); 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()); system(com.toStdString().c_str());
} }
QThread::sleep(500); QThread::msleep(500);
QString com="gpio write "+QString::number(targetpos)+" 1"; QString com="gpio write "+QString::number(targetpos)+" 1";
system(com.toStdString().c_str()); system(com.toStdString().c_str());
QThread::sleep(500); QThread::msleep(500);
cout1<<"FINISH Change Shutter <br>"<<flush; cout1<<"FINISH Change Shutter <br>"<<flush;
return 0; return 0;