AppGlobalF.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //#include "VMSOprMainLibF.h"
  5. //---------------------------------------------------------------------------
  6. #include <map.h>
  7. #include "RestObjectF.h"
  8. #include "ITSUtilF.h"
  9. #include "DataTypesF.h"
  10. #include "ITSLogF.h"
  11. #include "CDSVmsCtlrF.h"
  12. /*
  13. ******************************************************************************
  14. * Defines
  15. ******************************************************************************
  16. */
  17. #define FORMSHOW(x) if (x) \
  18. { \
  19. try { \
  20. ShowWindow(x->Handle, SW_RESTORE); \
  21. x->BringToFront(); \
  22. } catch(...) {} \
  23. } \
  24. else \
  25. { \
  26. Application->CreateForm(__classid(T##x), &x); \
  27. if (x) x->Show(); \
  28. }
  29. /*
  30. ******************************************************************************
  31. * User Data Types
  32. ******************************************************************************
  33. */
  34. #define STR_DATETIME "YYYY-MM-DD HH:NN:SS"
  35. #define STR_HHNN "YYYY-MM-DD HH:NN"
  36. #define STR_DATEHOUR "YYYY-MM-DD HH"
  37. #define STR_DATE "YYYY-MM-DD"
  38. #define STR_MM "YYYY-MM"
  39. typedef enum
  40. {
  41. icon_n = 0,
  42. icon_e,
  43. icon_m,
  44. icon_r,
  45. icon_s,
  46. } facility_icon;
  47. typedef struct
  48. {
  49. String ICON[5];
  50. } FACILITY_ICON;
  51. typedef struct tag_AppConfig
  52. {
  53. String sConfigFile;
  54. bool bAppClose;
  55. long lMainWinHandle; /* Main Window Handle */
  56. String sTitle;
  57. String sProcessId; /* 프로세스 ID */
  58. int nVmsServerPort;
  59. String sSkinName;
  60. bool bSaveForm;
  61. bool bLoginPrompt;
  62. String sDefUseId;
  63. int nLogLevel;
  64. AnsiString sLogDay;
  65. bool bDebug;
  66. String sAppPath;
  67. String sLang;
  68. bool isDispOfflineMsg;
  69. String sUserId;
  70. String sRestApiUri;
  71. struct
  72. {
  73. bool Window;
  74. bool Enabled;
  75. int TimeOut;
  76. } Alarm;
  77. struct
  78. {
  79. bool Window;
  80. bool Enabled;
  81. int TimeOut;
  82. } Incident;
  83. struct
  84. {
  85. int AlarmValue;
  86. } Temp;
  87. struct
  88. {
  89. bool Enabled;
  90. int IntervalMin;
  91. bool LogoutExit;
  92. } AutoLogout;
  93. FACILITY_ICON vms;
  94. FACILITY_ICON vds;
  95. struct
  96. {
  97. TThread *pThread;
  98. DWORD dwThreadId;
  99. unsigned int nHandle;
  100. bool bRunning;
  101. } thr;
  102. struct
  103. {
  104. String sProvider;
  105. String sServerName;
  106. String sUserName;
  107. String sPassword;
  108. bool bSqlLog;
  109. } itsdb;
  110. struct
  111. {
  112. String sProvider;
  113. String sServerName;
  114. String sUserName;
  115. String sPassword;
  116. bool bSqlLog;
  117. } utisdb;
  118. struct
  119. {
  120. String sMainMap;
  121. String sLinkMap;
  122. } flashmap;
  123. struct
  124. {
  125. String sComModel;
  126. String sDevModel;
  127. } vmscam;
  128. struct
  129. {
  130. String saveDir;
  131. String viewer;
  132. String server;
  133. int port;
  134. String user;
  135. String pswd;
  136. String dir;
  137. } blackbox;
  138. struct
  139. {
  140. String SERVER;
  141. int PORT;
  142. String USER;
  143. String PSWD;
  144. bool PASSIVE;
  145. } vmsFtp;
  146. bool bOnlyOneScreen;
  147. bool bTermChildProg;
  148. } APP_CONFIG;
  149. /*
  150. ******************************************************************************
  151. * Global variable definitions
  152. ******************************************************************************
  153. */
  154. extern ST_GISINFO g_GisInfo;
  155. extern ST_SELLINK g_SelLink;
  156. extern String CenterCd; // 지역센터 코드
  157. extern String CenterId; // 지역센터 아이디
  158. extern String CenterName; // 지역센터 명칭
  159. extern int g_nPid; // Application Process ID
  160. extern String g_sAppDir; // Application Directory
  161. extern String g_sAppName; // Program name
  162. extern String g_sCfgDir; // Config File Directory
  163. extern String g_sLogDir; // Program Log Directory
  164. extern String g_sTempDir; // Program Temp Directory
  165. extern String g_sFormsDir; // Program Forms Directory
  166. extern String g_sBlackBox;
  167. extern String g_sLangDir;
  168. extern String g_sImageDir;
  169. extern String g_sVideoDir;
  170. extern String g_sMapDir;
  171. extern APP_CONFIG g_AppCfg;
  172. //extern LOGININFO *g_pLOGIN;
  173. extern LOG_INFO g_LogCfg;
  174. extern TITSLog *ITSLog;
  175. extern TITSLog *FDbLog;
  176. extern bool g_bControlAuth;
  177. /*
  178. ******************************************************************************
  179. * PlugIn Global variables
  180. ******************************************************************************
  181. */
  182. /*
  183. ******************************************************************************
  184. * Global function definitios
  185. ******************************************************************************
  186. */
  187. void ActiveProgram();
  188. bool CheckParamRandKey(String AParam);
  189. bool LoadDefaultConfigInfo(String ACfgFile="");
  190. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  191. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  192. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  193. void ShowErrorMsg(String ATitle, String AErrMsg);
  194. #include "cxControls.hpp"
  195. #include "cxDropDownEdit.hpp"
  196. TDateTime APP_StrToDateTime(String AStrDateTime);
  197. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  198. String APP_GetCode(TcxComboBox *ACombo);
  199. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  200. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  201. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  202. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  203. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  204. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  205. String ITSUtil_FormatStr(String AStrDateTime, String AFormat);
  206. //----------------------------------------------------------------------------
  207. #define MAX_DISPCOLOR 20
  208. extern TColor g_DispColor[MAX_DISPCOLOR];
  209. void APP_InitDisplayColor();
  210. TColor APP_GetDisplayColor(int ASeq);
  211. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  212. //////////////////////////////////////////////////////////////////////////////////
  213. class TVmsSizeType : public TObject
  214. {
  215. public: // User declarations
  216. String TypeCd;
  217. String TypeNm;
  218. int Width;
  219. int Height;
  220. int Rows;
  221. int Cols;
  222. public: // User declarations
  223. __fastcall TVmsSizeType(String ATypeCd,
  224. String ATypeNm,
  225. int AWidth,
  226. int AHeight,
  227. int ARows,
  228. int ACols)
  229. {
  230. TypeCd = ATypeCd;
  231. TypeNm = ATypeNm;
  232. Width = AWidth;
  233. Height = AHeight;
  234. Rows = ARows;
  235. Cols = ACols;
  236. }
  237. };
  238. //////////////////////////////////////////////////////////////////////////////////
  239. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  240. void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll=false);
  241. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
  242. //----------------------------------------------------------------------------
  243. ULONG ProcIDFromWnd(HWND hwnd);
  244. HWND GetWinHandle(ULONG pid);
  245. #endif