mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-18 19:39:43 +08:00
增加了shutter切换模块对双通道的支持
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user