|
@@ -336,14 +336,11 @@ bool CSATExecutor::IsDeviceExist(std::string strDevName)
|
|
|
return bExist;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-bool CSATExecutor::Login(std::string user, std::string password, std::string actuator, bool bLogin /*= true*/)
|
|
|
+bool CSATExecutor::Login(bool bLogin /* = true */)
|
|
|
{
|
|
|
std::string url = GLOBAL::g_stSATConfig.szExecuteServer;
|
|
|
url.append("/ajaxInteractiveManage!executeLogin.action");
|
|
|
// 填充数据;
|
|
|
- m_stLoginReq.strUserName = user;
|
|
|
- m_stLoginReq.strPassword = password;
|
|
|
m_stLoginReq.strStatus = bLogin ? "0" : "1"; // 0表示登录;
|
|
|
m_stLoginReq.strDeleteStatus = "";
|
|
|
m_stLoginReq.strIP = GLOBAL::g_strIPAddress;
|
|
@@ -355,8 +352,6 @@ bool CSATExecutor::Login(std::string user, std::string password, std::string act
|
|
|
m_stLoginReq.strConnectTime = "";
|
|
|
m_stLoginReq.strDisconnectTime = CTime::GetCurrentTime().Format(_T("%Y-%m-%d %H:%M:%S"));
|
|
|
}
|
|
|
- // 执行器名称;
|
|
|
- m_stLoginReq.strExecuteName = m_strActuatorName = actuator;
|
|
|
// 执行器PC物理地址;
|
|
|
m_stLoginReq.strMAC = GLOBAL::g_strMacs;
|
|
|
m_stLoginReq.strCPU = "";
|
|
@@ -372,9 +367,20 @@ bool CSATExecutor::Login(std::string user, std::string password, std::string act
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+bool CSATExecutor::Login(std::string user, std::string password, std::string actuator, bool bLogin /*= true*/)
|
|
|
+{
|
|
|
+ // 填充数据;
|
|
|
+ m_stLoginReq.strUserName = user;
|
|
|
+ m_stLoginReq.strPassword = password;
|
|
|
+ // 执行器名称;
|
|
|
+ m_stLoginReq.strExecuteName = m_strActuatorName = actuator;
|
|
|
+
|
|
|
+ return Login(bLogin);
|
|
|
+}
|
|
|
+
|
|
|
bool CSATExecutor::Logout(std::string user, std::string password)
|
|
|
{
|
|
|
- return Login(user, password, false);
|
|
|
+ return Login(user, password, m_strActuatorName, false);
|
|
|
}
|
|
|
|
|
|
bool CSATExecutor::UpdateDevice()
|
|
@@ -1252,7 +1258,8 @@ DWORD CSATExecutor::HearbeatThread(LPVOID lpVoid)
|
|
|
}
|
|
|
|
|
|
// 没有登录成功,不查询;
|
|
|
- if ( !that->m_bLogin ) continue;
|
|
|
+ if ( !that->m_bLogin )
|
|
|
+ continue;
|
|
|
// 更新设备;
|
|
|
that->UpdateDevice();
|
|
|
// 脚本保存目录;
|
|
@@ -1309,6 +1316,10 @@ DWORD CSATExecutor::HearbeatThread(LPVOID lpVoid)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ // 心跳失败:登录一次;
|
|
|
+ that->Login(true);
|
|
|
+ }
|
|
|
|
|
|
} while ( WaitForSingleObject(that->m_hEventHearbeat, 10000) == WAIT_TIMEOUT );
|
|
|
|