AppGlobalF.h 5.0 KB

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