Forráskód Böngészése

更新配置文件为程序名,同时新增配置信息;

scbc.sat2 5 éve
szülő
commit
84c71dd4a3
2 módosított fájl, 32 hozzáadás és 1 törlés
  1. 23 1
      SATHelper/SATHelper/Global.cpp
  2. 9 0
      SATHelper/SATHelper/Global.h

+ 23 - 1
SATHelper/SATHelper/Global.cpp

@@ -383,7 +383,7 @@ namespace Global
 		Python27Dir();
 
 		TCHAR szConfigpath[MAX_PATH] = { 0 };
-		_stprintf_s(szConfigpath, _T("%sConfig.ini"), Global::g_szCurModuleDir);
+		_stprintf_s(szConfigpath, _T("%s%s.ini"), g_szCurModuleDir, g_szFna);
 		_tcscpy_s(g_szConfig, szConfigpath);
 
 		TCHAR szValue[MAX_PATH] = { 0 };
@@ -410,6 +410,28 @@ namespace Global
 		g_Config.use_signal = szValue;
 		memset(szValue, 0, MAX_PATH);
 
+		// Service;
+		g_Config.bAutoLogin = GetPrivateProfileInt(_T("SATService"), _T("AutoLogin"), 0, szConfigpath);
+
+		GetPrivateProfileString(_T("SATService"), _T("UserName"), NULL, szValue, MAX_PATH, szConfigpath);
+		g_Config.strSATUserName = szValue;
+		memset(szValue, 0, MAX_PATH);
+
+		GetPrivateProfileString(_T("SATService"), _T("Password"), NULL, szValue, MAX_PATH, szConfigpath);
+		g_Config.strSATPassword = szValue;
+		memset(szValue, 0, MAX_PATH);		
+
+		GetPrivateProfileString(_T("SATService"), _T("Actuator"), NULL, szValue, MAX_PATH, szConfigpath);
+		g_Config.strActuator = szValue;
+		memset(szValue, 0, MAX_PATH);
+
+		GetPrivateProfileString(_T("SATService"), _T("ServiceIP"), NULL, szValue, MAX_PATH, szConfigpath);
+		g_Config.strServiceIP = szValue;
+		memset(szValue, 0, MAX_PATH);
+
+		GetPrivateProfileString(_T("SATService"), _T("ServicePort"), NULL, szValue, MAX_PATH, szConfigpath);
+		g_Config.strServicePort = szValue;
+		memset(szValue, 0, MAX_PATH);
 	}
 
 	BOOL GetOrientation(IN Image* pImg)

+ 9 - 0
SATHelper/SATHelper/Global.h

@@ -57,10 +57,19 @@ namespace Global
 {
 	typedef struct __ST_CONFIG__
 	{
+		// ir-device;
 		std::string redratpath;
 		bool bGenerics;
 		std::string signaldir;
 		std::string use_signal;
+
+		// SATService;
+		bool bAutoLogin;
+		std::string strSATUserName;
+		std::string strSATPassword;
+		std::string strActuator;
+		std::string strServiceIP;
+		std::string strServicePort;		
 	}STConfig, * pSTConfig;
 
 	//////////////////////////////////////////////////////////////////////////