AppGlobalF.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "ITSSkinF.h"
  8. #include "ITSLogF.h"
  9. #include "FrmResourceF.h"
  10. /*
  11. ******************************************************************************
  12. * Defines
  13. ******************************************************************************
  14. */
  15. #define SAFE_DELETE(p) {if (p != NULL) { delete p; p = NULL; }}
  16. #define FORMSHOW(x) if (x) \
  17. { \
  18. try { \
  19. ShowWindow(x->Handle, SW_RESTORE); \
  20. x->BringToFront(); \
  21. } catch(...) {} \
  22. } \
  23. else \
  24. { \
  25. Application->CreateForm(__classid(T##x), &x); \
  26. if (x) x->Show(); \
  27. }
  28. /*
  29. ******************************************************************************
  30. * User Data Types
  31. ******************************************************************************
  32. */
  33. #define STR_DATETIME "YYYY-MM-DD HH:NN:SS"
  34. #define STR_HHNN "YYYY-MM-DD HH:NN"
  35. #define STR_DATEHOUR "YYYY-MM-DD HH"
  36. #define STR_DATE "YYYY-MM-DD"
  37. #define STR_MM "YYYY-MM"
  38. typedef struct tag_AppConfig
  39. {
  40. String sConfigFile;
  41. bool bAppClose;
  42. long lMainWinHandle; /* Main Window Handle */
  43. String sTitle;
  44. String sProcessId; /* 프로세스 ID */
  45. String sSkinName;
  46. bool bSaveForm;
  47. bool bLoginPrompt;
  48. String sDefUseId;
  49. int nLogLevel;
  50. AnsiString sLogDay;
  51. bool bDebug;
  52. String sAppPath;
  53. String sLang;
  54. String sEmptyImg;
  55. struct
  56. {
  57. bool Window;
  58. bool Enabled;
  59. int TimeOut;
  60. } Alarm;
  61. struct
  62. {
  63. bool Window;
  64. bool Enabled;
  65. int TimeOut;
  66. } Incident;
  67. struct
  68. {
  69. int AlarmValue;
  70. } Temp;
  71. struct
  72. {
  73. bool Enabled;
  74. int IntervalMin;
  75. bool LogoutExit;
  76. } AutoLogout;
  77. struct
  78. {
  79. TThread *pThread;
  80. DWORD dwThreadId;
  81. unsigned int nHandle;
  82. bool bRunning;
  83. } thr;
  84. struct
  85. {
  86. String sConnectStr;
  87. String sProvider;
  88. String sServerName;
  89. String sUserName;
  90. String sPassword;
  91. bool bSqlLog;
  92. } itsdb;
  93. struct
  94. {
  95. String sMainMap;
  96. String sLinkMap;
  97. } flashmap;
  98. struct
  99. {
  100. String sComModel;
  101. String sDevModel;
  102. } vmscam;
  103. } APP_CONFIG;
  104. /*
  105. ******************************************************************************
  106. * Global variable definitions
  107. ******************************************************************************
  108. */
  109. extern String CenterCd; // 지역센터 코드
  110. extern String CenterId; // 지역센터 아이디
  111. extern String CenterName; // 지역센터 명칭
  112. extern int g_nPid; // Application Process ID
  113. extern String g_sAppDir; // Application Directory
  114. extern String g_sAppName; // Program name
  115. extern String g_sCfgDir; // Config File Directory
  116. extern String g_sLogDir; // Program Log Directory
  117. extern String g_sTempDir; // Program Temp Directory
  118. extern String g_sFormsDir; // Program Forms Directory
  119. extern String g_sLangDir;
  120. extern APP_CONFIG g_AppCfg;
  121. extern LOG_INFO g_LogCfg;
  122. extern TITSLog *ITSLog;
  123. /*
  124. ******************************************************************************
  125. * PlugIn Global variables
  126. ******************************************************************************
  127. */
  128. /*
  129. ******************************************************************************
  130. * Global function definitios
  131. ******************************************************************************
  132. */
  133. bool LoadDefaultConfigInfo(String ACfgFile="");
  134. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  135. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  136. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  137. void ShowErrorMsg(String ATitle, String AErrMsg);
  138. #include "cxControls.hpp"
  139. #include "cxDropDownEdit.hpp"
  140. //----------------------------------------------------------------------------
  141. #define MAX_DISPCOLOR 22
  142. extern TColor g_DispColor[MAX_DISPCOLOR];
  143. void APP_InitDisplayColor();
  144. TColor APP_GetDisplayColor(int ASeq);
  145. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  146. //----------------------------------------------------------------------------
  147. ULONG ProcIDFromWnd(HWND hwnd);
  148. HWND GetWinHandle(ULONG pid);
  149. #endif