Răsfoiți Sursa

#IQRV #comment 去除多余的适配器信息上传的告警

gifur 3 ani în urmă
părinte
comite
7bd3c1658f

+ 0 - 49
Module/mod_HSPScanner/HSPScannerFSM.cpp

@@ -1800,55 +1800,6 @@ ErrorCodeEnum CHSPScannerFSM::OnDevExit()
 	return erroCode;
 }
 
-void CHSPScannerFSM::UploadVendorDllInfo()
-{
-	std::map<std::string, std::string> termInfo;
-	BYTE fileHash[32];
-	int fileSize = 0;
-	CSimpleStringA strDepPath;
-	GetEntityBase()->GetFunction()->GetPath("Dep", strDepPath);
-	CSimpleStringA csDllPath = CSimpleStringA::Format("%s/%s.so", (LPCTSTR)strDepPath, (LPCTSTR)m_csDllName);
-	GetFileSizeAndCalcHashValue(csDllPath, fileSize, fileHash);
-
-	char* strFileHash = new char[128];
-	memset(strFileHash, 0, 128);
-	HexBuf2StrBuf(fileHash, &strFileHash, 32);
-	termInfo["VendorDllName"] = csDllPath.GetData();
-	termInfo["VendorDllFileHash"] = strFileHash;
-	memset(strFileHash, 0, 128);
-	termInfo["VendorDllFileSize"] = _itoa(fileSize, strFileHash, 10);
-
-	if (strlen(m_devCat.szModel) > 1 && strlen(m_devCat.szModel) < 255)
-		termInfo["szModel"] = m_devCat.szModel;
-	if (strlen(m_devCat.szType) > 1 && strlen(m_devCat.szType) < 255)
-		termInfo["szType"] = m_devCat.szType;
-	termInfo["Port"] = m_csPort;
-	termInfo["Baudrate"] = m_csBuadrate;
-
-	std::pair<bool, std::string> strResult;
-	strResult = generateJsonStr(termInfo);
-
-	CSmartPointer<IConfigInfo> spConfigRun;
-	CSimpleStringA csWarnMsg("");
-	int wDay = 99;
-	GetEntityBase()->GetFunction()->OpenConfig(Config_Run, spConfigRun);
-	SYSTEMTIME localTime;
-	GetLocalTime(&localTime);
-	spConfigRun->ReadConfigValueInt("DllInfo", "WarnDay", wDay);
-	spConfigRun->ReadConfigValue("DllInfo", "WarnMsg", csWarnMsg);
-	if ((strResult.first && !strResult.second.empty()) 
-		&&
-		(csWarnMsg.IsNullOrEmpty() || csWarnMsg.Compare(strResult.second.c_str()) || wDay != localTime.wDay))
-	{
-		LogWarn(Severity_Low, Error_Unexpect, HSPScanner_UserErrorCode_UPLOAD_VENDORINFO, strResult.second.c_str());
-		spConfigRun->WriteConfigValueInt("DllInfo", "WarnDay", localTime.wDay);
-		spConfigRun->WriteConfigValue("DllInfo", "WarnMsg", strResult.second.c_str());
-	}
-	if (strFileHash != NULL)
-		delete[] strFileHash;
-	return;
-}
-
 UINT CHSPScannerFSM::UnitTest(LPCTSTR testTag)
 {
 #ifdef TWINKLE_LOCAL_DEBUG

+ 0 - 2
Module/mod_HSPScanner/HSPScannerFSM.h

@@ -384,8 +384,6 @@ public:
 
 	ErrorCodeEnum OnDevExit();
 
-	void UploadVendorDllInfo();
-
 	UINT UnitTest(LPCTSTR testTag);
 
 	bool m_bOpened;

+ 1 - 1
Module/mod_HSPScanner/mod_HSPScanner.h

@@ -81,7 +81,7 @@ public:
 
 	virtual void OnStarted()
 	{
-		if(m_fsm.m_bOpened) { m_fsm.UploadVendorDllInfo(); }
+
 	}
 
 	virtual void OnPrePause(CSmartPointer<ITransactionContext> pTransactionContext)