Ver Fonte

添加部分Debug日志打印;

scbc.sat2 há 5 anos atrás
pai
commit
8110129b51

+ 12 - 2
SATService/SATService/SATExecutor.cpp

@@ -135,7 +135,6 @@ bool CSATExecutor::Login(std::string user, std::string password, bool bLogin /*=
 	m_stLoginReq.strStorage = "";
 	m_stLoginReq.strConnectTime = "";
 	m_stLoginReq.strExecuteName = "";
-	//m_stLoginReq.strMAC = Global::g_strMacs;//"40:16:7e:23:10:53";
 	if ( Global::g_vtMac.size() )
 		m_stLoginReq.strMAC = Global::g_vtMac[0].szMacAddress; // 取第一个MAC地址;
 	else
@@ -834,6 +833,9 @@ DWORD CSATExecutor::HearbeatThread(LPVOID lpVoid)
 		stHeartbeatReq.strRunnerMac = that->m_stLoginReq.strMAC;
 		stHeartbeatReq.devicelist.assign(that->m_vtDevice.begin(), that->m_vtDevice.end());
 		if ( Heartbeat(url, stHeartbeatReq, stHeartbeatResp) ) {
+#ifdef _DEBUG
+		OutputDebugString("心跳查询成功\n");
+#endif
 			std::vector<SATParameters::STTask>::iterator it = stHeartbeatResp.vtTask.begin();
 			for ( ; it != stHeartbeatResp.vtTask.end(); it++ ) {
 				if (!that->IsTaskExist(*it)) {
@@ -851,10 +853,12 @@ DWORD CSATExecutor::HearbeatThread(LPVOID lpVoid)
 							_case->_strFileName = stScriptUrlResp._strFileName;
 							_case->_strScriptPath = stScriptUrlResp._strScripFile;
 						}
+#ifdef _DEBUG
 						else
 						{
 							OutputDebugString("下载脚本失败\n");
 						}
+#endif
 					}
 
 					that->m_vtTask.push_back(*it);
@@ -960,7 +964,13 @@ DWORD CSATExecutor::ExecuteScriptThread(LPVOID lpVoid)
 
 				// 通知SAT服务器,脚本开始;
 				that->ReportTaskStart(pTask);
-			}		
+			}	
+#ifdef _DEBUG
+			else
+			{
+				OutputDebugString("无任务可执行\n");
+			}
+#endif
 		}
 	} while ( WaitForSingleObject(that->m_hEventExcuteScript, 10000) == WAIT_TIMEOUT );
 

+ 1 - 0
SATService/SATService/SATExecutor.h

@@ -71,6 +71,7 @@ public:
 	bool Login(std::string user, std::string password, bool bLogin = true);
 	// 登出;
 	bool Logout(std::string user, std::string password);
+	const SATParameters::STLoginResp *GetLoginResp() const{ return &m_stLoginResp;};
 	// 更新设备信息;
 	bool UpdateDevice();
 	// 通知SAT任务开始;