AppGlobalF.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "HTTPApp.hpp"
  7. #include "RestObjectF.h"
  8. #include "ITSSkinF.h"
  9. #include "ITSLogF.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. String sUserId;
  56. String sRestApiUri;
  57. struct
  58. {
  59. bool Window;
  60. bool Enabled;
  61. int TimeOut;
  62. } Alarm;
  63. struct
  64. {
  65. bool Window;
  66. bool Enabled;
  67. int TimeOut;
  68. } Incident;
  69. struct
  70. {
  71. int AlarmValue;
  72. } Temp;
  73. struct
  74. {
  75. bool Enabled;
  76. int IntervalMin;
  77. bool LogoutExit;
  78. } AutoLogout;
  79. struct
  80. {
  81. TThread *pThread;
  82. DWORD dwThreadId;
  83. unsigned int nHandle;
  84. bool bRunning;
  85. } thr;
  86. struct
  87. {
  88. String sConnectStr;
  89. String sProvider;
  90. String sServerName;
  91. String sUserName;
  92. String sPassword;
  93. bool bSqlLog;
  94. } itsdb;
  95. struct
  96. {
  97. String sMainMap;
  98. String sLinkMap;
  99. } flashmap;
  100. struct
  101. {
  102. String sComModel;
  103. String sDevModel;
  104. } vmscam;
  105. } APP_CONFIG;
  106. /*
  107. ******************************************************************************
  108. * Global variable definitions
  109. ******************************************************************************
  110. */
  111. extern String CenterCd; // 지역센터 코드
  112. extern String CenterId; // 지역센터 아이디
  113. extern String CenterName; // 지역센터 명칭
  114. extern int g_nPid; // Application Process ID
  115. extern String g_sAppDir; // Application Directory
  116. extern String g_sAppName; // Program name
  117. extern String g_sCfgDir; // Config File Directory
  118. extern String g_sLogDir; // Program Log Directory
  119. extern String g_sTempDir; // Program Temp Directory
  120. extern String g_sFormsDir; // Program Forms Directory
  121. extern String g_sLangDir;
  122. extern APP_CONFIG g_AppCfg;
  123. extern LOG_INFO g_LogCfg;
  124. extern TITSLog *ITSLog;
  125. /*
  126. ******************************************************************************
  127. * PlugIn Global variables
  128. ******************************************************************************
  129. */
  130. /*
  131. ******************************************************************************
  132. * Global function definitios
  133. ******************************************************************************
  134. */
  135. void ActiveProgram();
  136. bool CheckParamRandKey(String AParam);
  137. bool LoadDefaultConfigInfo(String ACfgFile="");
  138. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  139. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  140. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  141. void ShowErrorMsg(String ATitle, String AErrMsg);
  142. #include "cxControls.hpp"
  143. #include "cxDropDownEdit.hpp"
  144. //----------------------------------------------------------------------------
  145. #define MAX_DISPCOLOR 22
  146. extern TColor g_DispColor[MAX_DISPCOLOR];
  147. void APP_InitDisplayColor();
  148. TColor APP_GetDisplayColor(int ASeq);
  149. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  150. //----------------------------------------------------------------------------
  151. ULONG ProcIDFromWnd(HWND hwnd);
  152. HWND GetWinHandle(ULONG pid);
  153. #endif