|
@@ -457,44 +457,6 @@ ErrorCodeEnum CGpioEntity::Initial()
|
|
|
m_adapterInfo.strPort = csPort;
|
|
|
m_adapterInfo.strBaudrate = csBaudrate;
|
|
|
m_adapterInfo.strPortNum = csPortNum; //Just load from Config
|
|
|
- BOOL nSwitchFlag(FALSE);
|
|
|
- BOOL useOld = TRUE;
|
|
|
- CSmartPointer<IConfigInfo> spConfigCenter;
|
|
|
- eErrDev = spEntityFunction->OpenConfig(Config_CenterSetting, spConfigCenter);
|
|
|
- if (eErrDev == Error_Succeed) {
|
|
|
- int nValue(0);
|
|
|
- spConfigCenter->ReadConfigValueInt(GetEntityName(), "PortNumChoiceSwitch", nValue);
|
|
|
- if (nValue != 0) {
|
|
|
- nSwitchFlag = TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
-#if defined(RVC_OS_WIN)
|
|
|
- if (nSwitchFlag && !csPortNum.IsNullOrEmpty()) {
|
|
|
- if (csPortNum.Compare("3") == 0) { m_bNewVersion = FALSE; useOld = FALSE; }
|
|
|
- else if (csPortNum.Compare("4") == 0) { m_bNewVersion = TRUE; useOld = FALSE; }
|
|
|
- }
|
|
|
- if (useOld) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("[%s],[%s],[%s]", m_adapterInfo.strVendor.GetData()
|
|
|
- , m_adapterInfo.strVersion.GetData(), m_adapterInfo.strBatch.GetData());
|
|
|
- //Gpio.keba.1.1 , Gpio.Hyosung.1.1, Gpio.kxd.1.1 均为 老设备,2024-9-11发现现有生产有2249台
|
|
|
- if (!_stricmp(m_adapterInfo.strVendor, "Hyosung") || !_stricmp(m_adapterInfo.strVendor, "Keba") || !_stricmp(m_adapterInfo.strVendor, "Kxd")) {
|
|
|
- if (m_adapterInfo.strVersion == "1" && m_adapterInfo.strBatch == "1") {
|
|
|
- m_bNewVersion = FALSE;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-#endif //RVC_OS_WIN
|
|
|
- bool theSameFlag = false;
|
|
|
- if ((m_bNewVersion && csPortNum.Compare("4") == 0) || (!m_bNewVersion && csPortNum.Compare("3") == 0)) { theSameFlag = true; }
|
|
|
- //是否符合切换要求 扩展引脚 配置的PortNum 集中配置切换标记 旧逻辑
|
|
|
- LogWarn(Severity_Low, Error_Debug, GPIO_UserErrorCode_PortNumOldVersion
|
|
|
- , CSimpleStringA::Format(",%s,%s,%s,%s,%s"
|
|
|
- , theSameFlag ? "True" : "False"
|
|
|
- , m_bNewVersion ? "True" : "False"
|
|
|
- , csPortNum.GetData()
|
|
|
- , nSwitchFlag ? "True" : "False"
|
|
|
- , useOld ? "True" : "False"));
|
|
|
-
|
|
|
m_hDevHelper.SetAdapterName(GetEntityName());
|
|
|
eErrDev = m_hDevHelper.LoadUp(dllName);
|
|
|
if (eErrDev != Error_Succeed) {
|
|
@@ -511,7 +473,8 @@ ErrorCodeEnum CGpioEntity::Initial()
|
|
|
initParam.dir[2] = false;
|
|
|
initParam.dir[3] = false;
|
|
|
initParam.dwPortNum = 3;
|
|
|
- if (m_bNewVersion) {
|
|
|
+ if (m_adapterInfo.GetPortNumInt() == 4) {
|
|
|
+ m_bNewVersion = TRUE;
|
|
|
initParam.dwPortNum = 4;
|
|
|
initParam.dir[3] = true;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("New available 4 port num");
|