|  | @@ -145,6 +145,7 @@ DWORD CSATDevices::WorkThread(LPVOID lpVoid)
 | 
	
		
			
				|  |  |  		// 获取当前设备列表;
 | 
	
		
			
				|  |  |  		GetCurrentDevices(vtDevices);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		AutoThreadSection ats(&s_ThreadSection);
 | 
	
		
			
				|  |  |  		// 遍历设备列表是否有下线设备;
 | 
	
		
			
				|  |  |  		std::vector<SATDEV::STDevice>::iterator it = s_vtDevices.begin();
 | 
	
		
			
				|  |  |  		for ( ;it != s_vtDevices.end(); ) {
 | 
	
	
		
			
				|  | @@ -223,6 +224,9 @@ DWORD CSATDevices::WorkThread(LPVOID lpVoid)
 | 
	
		
			
				|  |  |  			else
 | 
	
		
			
				|  |  |  				it++;
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 保存全部设备状态;
 | 
	
		
			
				|  |  | +		SaveAllDevicesStatus2Config();
 | 
	
		
			
				|  |  |  	} while (WaitForSingleObject(that->m_hEvent, 2500) == WAIT_TIMEOUT);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	printf("end thread\n");
 | 
	
	
		
			
				|  | @@ -338,7 +342,7 @@ bool CSATDevices::IsDevicesOffline(SATDEV::STDevice &stDevice, std::vector<SATDE
 | 
	
		
			
				|  |  |  	}	
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// 将设备状态保存到配置文件中;
 | 
	
		
			
				|  |  | -	SaveDeviceStatus2Config(stDevice);
 | 
	
		
			
				|  |  | +	//SaveDeviceStatus2Config(stDevice);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	return bOffline;
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -459,4 +463,17 @@ void CSATDevices::SaveDeviceStatus2Config(SATDEV::STDevice &stDevice)
 | 
	
		
			
				|  |  |  		WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Offline"), szIniPath);
 | 
	
		
			
				|  |  |  	else if ( stDevice.nStatus == SATDEV::Dropline )
 | 
	
		
			
				|  |  |  		WritePrivateProfileString(_T("ADBSTATUS"), stDevice.strName.c_str(), _T("Dropline"), szIniPath);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +void CSATDevices::SaveAllDevicesStatus2Config()
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	// 先清空段内容;
 | 
	
		
			
				|  |  | +	TCHAR szIniPath[MAX_PATH] = {0};
 | 
	
		
			
				|  |  | +	_stprintf_s(szIniPath, _T("%s%s"), GLOBAL::g_szPython27Dir, "Lib\\site-packages\\ssat_sdk\\config\\resource_run.cfg");
 | 
	
		
			
				|  |  | +	WritePrivateProfileString(_T("ADBSTATUS"), NULL, NULL, szIniPath);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	std::vector<SATDEV::STDevice>::iterator it = s_vtDevices.begin();
 | 
	
		
			
				|  |  | +	for ( ; it != s_vtDevices.end(); it++ ) {
 | 
	
		
			
				|  |  | +		SaveDeviceStatus2Config(*it);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 |