mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2026-05-02 19:13:47 +08:00
提交 增加gpio配置
This commit is contained in:
@ -27,7 +27,12 @@
|
||||
//////////////////////////////////////////////////////////////////////////load device settings
|
||||
using namespace ZZ_MISCDEF;
|
||||
QMetaEnum enumDeviceModel = QMetaEnum::fromType<ConfiggerDeviceModel>();
|
||||
|
||||
// 先检查物理文件是否存在
|
||||
QFile configFile(m_qstrDeviceConfigFilePath);
|
||||
if (!configFile.exists()) {
|
||||
qDebug()<< "Device config file does not exist.Please check File in path:" << m_qstrDeviceConfigFilePath;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (m_qsDeviceConfig!=NULL)
|
||||
{
|
||||
delete m_qsDeviceConfig;
|
||||
@ -77,10 +82,26 @@
|
||||
m_struAcqPosition.iPosition[i] = iPosition;
|
||||
}
|
||||
|
||||
//判断 LINEAR SHUTTER 部分的配置项是否存在
|
||||
|
||||
m_struLSContext.usCmdID = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/DCID")).toInt();
|
||||
m_struLSContext.ucProtocolType = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Type")).toInt();
|
||||
m_struLSContext.strInterface = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Port")).toString().toStdString();
|
||||
m_struLSContext.usGPIOChannelAPin="null";
|
||||
m_struLSContext.usGPIOChannelBPin="null";
|
||||
if (m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelA")).toString().toStdString()!=""&& m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelB")).toString().toStdString()!="") {
|
||||
|
||||
m_struLSContext.usGPIOChannelAPin = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelA")).toString().toStdString();
|
||||
m_struLSContext.usGPIOChannelBPin = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/GPIO_ChannelB")).toString().toStdString();
|
||||
}else {
|
||||
m_qsDeviceConfig->setValue("LINEAR SHUTTER/GPIO_ChannelA",QString(QString::number(m_struLSContext.usCmdID).toStdString()[0]) );
|
||||
m_qsDeviceConfig->setValue("LINEAR SHUTTER/GPIO_ChannelB",QString(QString::number(m_struLSContext.usCmdID).toStdString()[1]) );
|
||||
//保存更改
|
||||
m_qsDeviceConfig->sync();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////humiture
|
||||
m_struHumitureDeviceInfo.qstrInterfaceName = m_qsDeviceConfig->value(QString("HUMITURE/Port")).toString();
|
||||
|
||||
Reference in New Issue
Block a user