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:
@ -7,7 +7,7 @@
|
|||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
VERSION=2.2.2
|
VERSION=2.2.5
|
||||||
sh install.sh
|
sh install.sh
|
||||||
|
|
||||||
thispwd=$(pwd)
|
thispwd=$(pwd)
|
||||||
|
|||||||
@ -141,11 +141,16 @@ int CMainDataGrabber::InitLS()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DSSOne.strChannelA = qstrChannel.toStdString()[0];
|
DSSOne.strChannelA =qstrChannel.toStdString()[0];
|
||||||
DSSOne.strChannelB = qstrChannel.toStdString()[1];
|
DSSOne.strChannelB = qstrChannel.toStdString()[1];
|
||||||
DSSOne.iChannelA = 1;
|
DSSOne.iChannelA = 1;
|
||||||
DSSOne.iChannelB = 1;
|
DSSOne.iChannelB = 1;
|
||||||
}
|
}
|
||||||
|
if (m_struLinearShutterContext.usGPIOChannelAPin!="null"&& m_struLinearShutterContext.usGPIOChannelBPin!="null") {
|
||||||
|
DSSOne.strChannelA = m_struLinearShutterContext.usGPIOChannelAPin;
|
||||||
|
DSSOne.strChannelB = m_struLinearShutterContext.usGPIOChannelBPin;
|
||||||
|
}
|
||||||
|
qDebug()<< "Debugging GPIO Init Finished. Channel A Pin:"<< QString::fromStdString(DSSOne.strChannelA) << " Channel B Pin:"<< QString::fromStdString(DSSOne.strChannelB);
|
||||||
|
|
||||||
m_vecDSS.push_back(DSSOne);
|
m_vecDSS.push_back(DSSOne);
|
||||||
|
|
||||||
|
|||||||
@ -215,6 +215,8 @@ namespace ZZ_MISCDEF
|
|||||||
std::string strInterface;
|
std::string strInterface;
|
||||||
ZZ_U8 ucProtocolType;
|
ZZ_U8 ucProtocolType;
|
||||||
ZZ_U16 usCmdID;
|
ZZ_U16 usCmdID;
|
||||||
|
std::string usGPIOChannelAPin;
|
||||||
|
std::string usGPIOChannelBPin;
|
||||||
}LSContext;
|
}LSContext;
|
||||||
|
|
||||||
typedef struct tagAcquisitionTimeSettings
|
typedef struct tagAcquisitionTimeSettings
|
||||||
|
|||||||
@ -27,7 +27,12 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////load device settings
|
//////////////////////////////////////////////////////////////////////////load device settings
|
||||||
using namespace ZZ_MISCDEF;
|
using namespace ZZ_MISCDEF;
|
||||||
QMetaEnum enumDeviceModel = QMetaEnum::fromType<ConfiggerDeviceModel>();
|
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)
|
if (m_qsDeviceConfig!=NULL)
|
||||||
{
|
{
|
||||||
delete m_qsDeviceConfig;
|
delete m_qsDeviceConfig;
|
||||||
@ -77,10 +82,26 @@
|
|||||||
m_struAcqPosition.iPosition[i] = iPosition;
|
m_struAcqPosition.iPosition[i] = iPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断 LINEAR SHUTTER 部分的配置项是否存在
|
||||||
|
|
||||||
m_struLSContext.usCmdID = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/DCID")).toInt();
|
m_struLSContext.usCmdID = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/DCID")).toInt();
|
||||||
m_struLSContext.ucProtocolType = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Type")).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.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
|
//////////////////////////////////////////////////////////////////////////humiture
|
||||||
m_struHumitureDeviceInfo.qstrInterfaceName = m_qsDeviceConfig->value(QString("HUMITURE/Port")).toString();
|
m_struHumitureDeviceInfo.qstrInterfaceName = m_qsDeviceConfig->value(QString("HUMITURE/Port")).toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user