增加了shutter切换模块对双通道的支持

This commit is contained in:
xin
2022-05-06 10:15:59 +08:00
committed by xin
parent 2c0462b3fa
commit 2a790361cd

View File

@ -33,6 +33,35 @@ int main(int argc, char *argv[]) {
cout1<<"Position Find Value is "<<m_qsDeviceConfig->value("LINEAR SHUTTER/Position"+str).toLongLong()<<"<br>"<<flush;
cout1<<"Configing The Motor <br>"<<flush;
// m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()
if( m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()=="GPIO")
{
int positionnumber=m_qsDeviceConfig->value("LINEAR SHUTTER/TotalPosition").toInt();
if (str>=positionnumber)
{
cout1<<"ERROR number position"<<flush;
}
int targetpos=m_qsDeviceConfig->value("LINEAR SHUTTER/Position"+str).toLongLong();
for (int ii = 0; ii < positionnumber; ++ii) {
int tempgpio=m_qsDeviceConfig->value("LINEAR SHUTTER/Position"+QString::number(ii)).toInt();
QString com="gpio mode "+QString::number(tempgpio)+" out";
system(com.toStdString().c_str());
com="gpio write "+QString::number(tempgpio)+" 0";
system(com.toStdString().c_str());
}
QThread::sleep(500);
QString com="gpio write "+QString::number(targetpos)+" 1";
system(com.toStdString().c_str());
QThread::sleep(500);
cout1<<"FINISH Change Shutter <br>"<<flush;
return 0;
}
Motercontrol.ILMES_InitializeComm(m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString());
ControllerParams cpTest;
Motercontrol.ILMES_InitializeParams(cpTest);