|
@@ -123,59 +123,65 @@ SATParameters::STCase* CSATExecutor::ExecuteFreeCaseScript(SATParameters::STTask
|
|
|
return pCase;
|
|
|
}
|
|
|
|
|
|
-bool CSATExecutor::Login()
|
|
|
+bool CSATExecutor::Login(std::string user, std::string password, bool bLogin /*= true*/)
|
|
|
{
|
|
|
-#ifdef _DEBUG
|
|
|
std::string url = Global::g_stSATConfig.szExecuteServer;
|
|
|
url.append("/ajaxInteractiveManage!executeLogin.action");
|
|
|
// 示例值;
|
|
|
- m_stLoginReq.strUserName = "superAdmin";
|
|
|
- m_stLoginReq.strStatus = "0"; // 0表示登录;
|
|
|
+ m_stLoginReq.strUserName = user;
|
|
|
+ m_stLoginReq.strStatus = bLogin ? "0" : "1"; // 0表示登录;
|
|
|
m_stLoginReq.strDeleteStatus = "";
|
|
|
- m_stLoginReq.strIP = "10.118.158.175";
|
|
|
+ m_stLoginReq.strIP = Global::GetLocalAddress();//"10.118.158.175";
|
|
|
m_stLoginReq.strStorage = "";
|
|
|
m_stLoginReq.strConnectTime = "";
|
|
|
m_stLoginReq.strExecuteName = "";
|
|
|
- m_stLoginReq.strMAC = "40:16:7e:23:10:53";
|
|
|
+ //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
|
|
|
+ m_stLoginReq.strMAC = "";
|
|
|
m_stLoginReq.strDisconnectTime = "";
|
|
|
- m_stLoginReq.strPassword = "123456";
|
|
|
+ m_stLoginReq.strPassword = password;
|
|
|
m_stLoginReq.strCPU = "";
|
|
|
|
|
|
if ( ::Login(url, m_stLoginReq, m_stLoginResp) )
|
|
|
{
|
|
|
+#ifdef _DEBUG
|
|
|
+ OutputDebugString("登录成功\n");
|
|
|
+#endif
|
|
|
m_bLogin = TRUE;
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- return false;
|
|
|
-#else
|
|
|
-
|
|
|
+#ifdef _DEBUG
|
|
|
+ OutputDebugString("登录失败\n");
|
|
|
#endif
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
-void CSATExecutor::Logout()
|
|
|
+bool CSATExecutor::Logout(std::string user, std::string password)
|
|
|
{
|
|
|
-
|
|
|
+ return Login(user, password, false);
|
|
|
}
|
|
|
|
|
|
bool CSATExecutor::UpdateDevice()
|
|
|
{
|
|
|
-#ifdef _DEBUG
|
|
|
SATParameters::STDevice stDevice;
|
|
|
- stDevice.strStatus = "0";
|
|
|
+ stDevice.strStatus = "0"; // 0表示设备空闲; 1表示设备忙碌
|
|
|
stDevice.strDeviceSerial = "192.168.1.119:5555";
|
|
|
- stDevice.strHardwareVersion = "MS6488";
|
|
|
- stDevice.strManu = "MStar";
|
|
|
+ stDevice.strHardwareVersion = "SATHardwareVersion";
|
|
|
+ stDevice.strManu = "SATManu";
|
|
|
stDevice.strDeviceMac = "";
|
|
|
stDevice.strLastJobStartTime = "";
|
|
|
stDevice.strLastTimeBreak = "";
|
|
|
stDevice.strComments = "";
|
|
|
stDevice.strCPU = "";
|
|
|
- stDevice.strSoftwareVersion = "1522659174";
|
|
|
+ stDevice.strSoftwareVersion = "0123456789";
|
|
|
stDevice.strPhoneNumber = "";
|
|
|
stDevice.strLastJobFinishTime = "";
|
|
|
stDevice.strMemory = "";
|
|
|
- stDevice.strModel = "Generic Linux on tcl_ms6488_cn_64_n";
|
|
|
+ stDevice.strModel = "SATModel";
|
|
|
stDevice.strLastJob = "";
|
|
|
stDevice.strLastTimeConnected = "2019-12-16 10:16:01";
|
|
|
stDevice.strElectric = "";
|
|
@@ -186,11 +192,15 @@ bool CSATExecutor::UpdateDevice()
|
|
|
url.append("/ajaxInteractiveManage!updateDeviceMessage.action");
|
|
|
|
|
|
stUpdateDeviceReq.strStatus = "0";
|
|
|
- stUpdateDeviceReq.strUserName = "superAdmin";
|
|
|
+ stUpdateDeviceReq.strUserName = m_stLoginReq.strUserName;
|
|
|
stUpdateDeviceReq.strIP = "10.118.158.175";
|
|
|
stUpdateDeviceReq.strStorage = "228092536KB";
|
|
|
stUpdateDeviceReq.strRunnerName = "SAT-Admin";
|
|
|
- stUpdateDeviceReq.strMAC = "40:16:7e:23:10:53";
|
|
|
+ //stUpdateDeviceReq.strMAC = "40:16:7e:23:10:53";
|
|
|
+ if ( Global::g_vtMac.size() )
|
|
|
+ stUpdateDeviceReq.strMAC = Global::g_vtMac[0].szMacAddress; // 取第一个MAC地址;
|
|
|
+ else
|
|
|
+ stUpdateDeviceReq.strMAC = "";
|
|
|
stUpdateDeviceReq.strReportType = "1";
|
|
|
stUpdateDeviceReq.strStartTime = "2019-12-16 19:15:30";
|
|
|
stUpdateDeviceReq.strMemory = "8938544KB";
|
|
@@ -204,9 +214,6 @@ bool CSATExecutor::UpdateDevice()
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
-#else
|
|
|
-
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
bool CSATExecutor::NotifyTaskStart(SATParameters::STTask* pTask)
|