Browse Source

回调执行Go结果处理。

JeffWang 3 năm trước cách đây
mục cha
commit
6e5708d9e3

+ 58 - 0
Source/OGCAssistTool/OGCAssistTool/PageDebug.cpp

@@ -5,6 +5,7 @@
 #include "OGCAssistTool.h"
 #include "OGCAssistTool.h"
 #include "PageDebug.h"
 #include "PageDebug.h"
 #include "Injection.h"
 #include "Injection.h"
+#include "CharEncoding.h"
 
 
 // 注入;
 // 注入;
 extern CInjection g_Injection;
 extern CInjection g_Injection;
@@ -144,6 +145,63 @@ BOOL CPageDebug::ConnectProc(DATAHEADER *pHeader, MSG_INFO *pMsg)
 
 
 BOOL CPageDebug::GoProc(DATAHEADER *pHeader, MSG_INFO *pMsg)
 BOOL CPageDebug::GoProc(DATAHEADER *pHeader, MSG_INFO *pMsg)
 {
 {
+	if ( !pHeader || !pMsg )
+		return FALSE;
+
+	// 获取时间;
+	DWORD dwElapsed = _tstol((TCHAR*)pMsg->byData);
+	// 获取Config.dat第七行;
+	TCHAR szConfigPath[MAX_PATH] = {0};
+	_stprintf_s(szConfigPath, _T("%s\\Config.dat"), GLOBAL::g_config.szOGCToolPath);
+	if ( PathFileExists(szConfigPath) )
+	{
+		CFile file;
+		CFileException excep;
+		if ( file.Open(szConfigPath, CFile::modeRead, &excep) )
+		{
+			DWORD dwRead = 0;
+			DWORD dwCount = 0;
+			string strData;
+			char szRead[MAX_PATH] = {0};
+			DWORD dwLen = file.GetLength();
+			while ( dwCount < dwLen )
+			{
+				dwRead = file.Read(szRead, MAX_PATH);
+				strData.append(szRead, dwRead);
+				dwCount += dwRead;
+			}
+
+			file.Close();
+
+			// 获取第七行;
+			int nPos=0;
+			int nIndex = 0;
+			while ( (nPos=strData.find('\r\n')) != std::string::npos )
+			{
+				if ( nIndex++ == 6 )
+				{
+					strData = strData.substr(0, nPos);
+					break;
+				}
+				strData = strData.substr(nPos+2);				
+			}
+
+			// 输出的文件cvs路径;
+			CString strSN;
+			m_pDlg->GetDlgItemText(EDIT_SN, strSN);
+			TCHAR szOutDataPath[MAX_PATH] = {0};
+			_stprintf_s(szOutDataPath, _T("%s\\Output_%s_%s\\%s\\sRGB_32Patterns_.csv"), GLOBAL::g_config.szOGCToolPath, CharEncoding::ASCII2UNICODE(strData.c_str()), CTime::GetCurrentTime().Format("%Y%m%d").GetString(), strSN.GetString());
+			if ( PathFileExists(szOutDataPath) )
+			{
+				// 文件存在,按行读取;
+				std::string strFileData = GLOBAL::GetFileData(szOutDataPath);
+				if ( strFileData.size() )
+				{
+
+				}
+			}
+		}
+	}
 
 
 	return FALSE;
 	return FALSE;
 }
 }

+ 6 - 0
Source/OGCAssistTool/OGCAssistTool/PipeService.cpp

@@ -532,6 +532,12 @@ void CIOCPPipe::RecvProcess(PER_PIPE_CONTEXT* pPipeContext, PER_IO_CONTEXT* pIoC
 				{
 				{
 					// 执行失败;
 					// 执行失败;
 				}
 				}
+
+				// 发送第一个请求:回调处理;
+				if ( lpOnGoCallback )
+				{
+					lpOnGoCallback(&header, &msg_info);
+				}
 			}
 			}
 			break;
 			break;
 		case C2S_COMMUNICATION_ERROR:
 		case C2S_COMMUNICATION_ERROR: