AppGlobalF.h 4.9 KB

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