AppGlobalF.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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 sConnectStr;
  86. String sProvider;
  87. String sServerName;
  88. String sUserName;
  89. String sPassword;
  90. bool bSqlLog;
  91. } itsdb;
  92. struct
  93. {
  94. String sMainMap;
  95. String sLinkMap;
  96. } flashmap;
  97. struct
  98. {
  99. String sComModel;
  100. String sDevModel;
  101. } vmscam;
  102. } APP_CONFIG;
  103. /*
  104. ******************************************************************************
  105. * Global variable definitions
  106. ******************************************************************************
  107. */
  108. extern String CenterCd; // 지역센터 코드
  109. extern String CenterId; // 지역센터 아이디
  110. extern String CenterName; // 지역센터 명칭
  111. extern int g_nPid; // Application Process ID
  112. extern String g_sAppDir; // Application Directory
  113. extern String g_sAppName; // Program name
  114. extern String g_sCfgDir; // Config File Directory
  115. extern String g_sLogDir; // Program Log Directory
  116. extern String g_sTempDir; // Program Temp Directory
  117. extern String g_sFormsDir; // Program Forms Directory
  118. extern String g_sLangDir;
  119. extern APP_CONFIG g_AppCfg;
  120. extern LOG_INFO g_LogCfg;
  121. extern TITSLog *ITSLog;
  122. /*
  123. ******************************************************************************
  124. * PlugIn Global variables
  125. ******************************************************************************
  126. */
  127. /*
  128. ******************************************************************************
  129. * Global function definitios
  130. ******************************************************************************
  131. */
  132. bool LoadDefaultConfigInfo(String ACfgFile="");
  133. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  134. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  135. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  136. void ShowErrorMsg(String ATitle, String AErrMsg);
  137. #include "cxControls.hpp"
  138. #include "cxDropDownEdit.hpp"
  139. //----------------------------------------------------------------------------
  140. #define MAX_DISPCOLOR 22
  141. extern TColor g_DispColor[MAX_DISPCOLOR];
  142. void APP_InitDisplayColor();
  143. TColor APP_GetDisplayColor(int ASeq);
  144. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  145. //----------------------------------------------------------------------------
  146. ULONG ProcIDFromWnd(HWND hwnd);
  147. HWND GetWinHandle(ULONG pid);
  148. #endif