AppGlobalF.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "DataTypesF.h"
  8. #include "ITSLogF.h"
  9. #include "CDSCodeF.h"
  10. #include "FrmResourceF.h"
  11. /*
  12. ******************************************************************************
  13. * Defines
  14. ******************************************************************************
  15. */
  16. #define DBERRMSG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,true)
  17. #define DBERRLOG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,false)
  18. /*
  19. ******************************************************************************
  20. * User Data Types
  21. ******************************************************************************
  22. */
  23. #define STR_DATETIME String("YYYY-MM-DD HH:NN:SS")
  24. #define STR_HHNN String("YYYY-MM-DD HH:NN")
  25. #define STR_DATEHOUR String("YYYY-MM-DD HH")
  26. #define STR_DATE String("YYYY-MM-DD")
  27. #define STR_MM String("YYYY-MM")
  28. typedef enum
  29. {
  30. icon_n = 0,
  31. icon_e,
  32. icon_m,
  33. icon_r,
  34. icon_s,
  35. } facility_icon;
  36. typedef struct
  37. {
  38. String ICON[5];
  39. } FACILITY_ICON;
  40. typedef struct tag_AppConfig
  41. {
  42. String sConfigFile;
  43. bool bAppClose;
  44. long lMainWinHandle; /* Main Window Handle */
  45. String sTitle;
  46. String sProcessId; /* 프로세스 ID */
  47. String sSkinName;
  48. bool bSaveForm;
  49. bool bLoginPrompt;
  50. String sDefUseId;
  51. int nLogLevel;
  52. AnsiString sLogDay;
  53. bool bDebug;
  54. String sAppPath;
  55. String sLang;
  56. struct
  57. {
  58. bool Window;
  59. bool Enabled;
  60. int TimeOut;
  61. } Alarm;
  62. struct
  63. {
  64. bool Window;
  65. bool Enabled;
  66. int TimeOut;
  67. } Incident;
  68. struct
  69. {
  70. int AlarmValue;
  71. } Temp;
  72. struct
  73. {
  74. bool Enabled;
  75. int IntervalMin;
  76. bool LogoutExit;
  77. } AutoLogout;
  78. FACILITY_ICON vms;
  79. FACILITY_ICON vds;
  80. struct
  81. {
  82. TThread *pThread;
  83. DWORD dwThreadId;
  84. unsigned int nHandle;
  85. bool bRunning;
  86. } thr;
  87. struct
  88. {
  89. String sProvider;
  90. String sServerName;
  91. String sUserName;
  92. String sPassword;
  93. bool bSqlLog;
  94. } itsdb;
  95. struct
  96. {
  97. String sProvider;
  98. String sServerName;
  99. String sUserName;
  100. String sPassword;
  101. bool bSqlLog;
  102. } utisdb;
  103. struct
  104. {
  105. String sMainMap;
  106. String sLinkMap;
  107. } flashmap;
  108. struct
  109. {
  110. String sComModel;
  111. String sDevModel;
  112. } vmscam;
  113. struct
  114. {
  115. String saveDir;
  116. String viewer;
  117. String server;
  118. int port;
  119. String user;
  120. String pswd;
  121. String dir;
  122. } blackbox;
  123. bool bOnlyOneScreen;
  124. bool bTermChildProg;
  125. } APP_CONFIG;
  126. /*
  127. ******************************************************************************
  128. * Global variable definitions
  129. ******************************************************************************
  130. */
  131. extern ST_GISINFO g_GisInfo;
  132. extern ST_SELLINK g_SelLink;
  133. extern String CenterCd; // 지역센터 코드
  134. extern String CenterId; // 지역센터 아이디
  135. extern String CenterName; // 지역센터 명칭
  136. extern int g_nPid; // Application Process ID
  137. extern String g_sAppDir; // Application Directory
  138. extern String g_sAppName; // Program name
  139. extern String g_sCfgDir; // Config File Directory
  140. extern String g_sLogDir; // Program Log Directory
  141. extern String g_sTempDir; // Program Temp Directory
  142. extern String g_sFormsDir; // Program Forms Directory
  143. extern String g_sBlackBox;
  144. extern String g_sLangDir;
  145. extern String g_sImageDir;
  146. extern APP_CONFIG g_AppCfg;
  147. extern LOGININFO *g_pLOGIN;
  148. extern LOG_INFO g_LogCfg;
  149. extern TITSLog *ITSLog;
  150. extern TITSLog *FDbLog;
  151. //extern TLangTrans *LangTrans;
  152. /*
  153. ******************************************************************************
  154. * PlugIn Global variables
  155. ******************************************************************************
  156. */
  157. /*
  158. ******************************************************************************
  159. * Global function definitios
  160. ******************************************************************************
  161. */
  162. bool LoadDefaultConfigInfo(String ACfgFile);
  163. int UserLogin();
  164. int UserLogout();
  165. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  166. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  167. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  168. void ShowErrorMsg(String ATitle, String AErrMsg);
  169. #include "cxControls.hpp"
  170. #include "cxDropDownEdit.hpp"
  171. TDateTime APP_StrToDateTime(String AStrDateTime);
  172. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  173. String APP_GetCode(TcxComboBox *ACombo);
  174. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  175. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  176. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  177. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  178. String ITSUtil_FormatStr(String AStrDateTime, String AFormat);
  179. //----------------------------------------------------------------------------
  180. ULONG ProcIDFromWnd(HWND hwnd);
  181. HWND GetWinHandle(ULONG pid);
  182. #endif