AppGlobalF.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. struct
  52. {
  53. bool Window;
  54. bool Enabled;
  55. int TimeOut;
  56. } Alarm;
  57. struct
  58. {
  59. bool Window;
  60. bool Enabled;
  61. int TimeOut;
  62. } Incident;
  63. struct
  64. {
  65. int AlarmValue;
  66. } Temp;
  67. struct
  68. {
  69. bool Enabled;
  70. int IntervalMin;
  71. bool LogoutExit;
  72. } AutoLogout;
  73. struct
  74. {
  75. TThread *pThread;
  76. DWORD dwThreadId;
  77. unsigned int nHandle;
  78. bool bRunning;
  79. } thr;
  80. struct
  81. {
  82. String sProvider;
  83. String sServerName;
  84. String sUserName;
  85. String sPassword;
  86. bool bSqlLog;
  87. } itsdb;
  88. struct
  89. {
  90. String sMainMap;
  91. String sLinkMap;
  92. } flashmap;
  93. struct
  94. {
  95. String sComModel;
  96. String sDevModel;
  97. } vmscam;
  98. } APP_CONFIG;
  99. typedef struct
  100. {
  101. bool bInit;
  102. long hDevice; // Device handle
  103. } SAMSUNG_DRIVER;
  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 APP_CONFIG g_AppCfg;
  120. extern LOG_INFO g_LogCfg;
  121. extern TITSLog *ITSLog;
  122. extern SAMSUNG_DRIVER Samsung;
  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. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  141. String APP_GetCode(TcxComboBox *ACombo);
  142. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  143. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  144. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  145. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  146. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  147. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  148. //----------------------------------------------------------------------------
  149. #define MAX_DISPCOLOR 22
  150. extern TColor g_DispColor[MAX_DISPCOLOR];
  151. void APP_InitDisplayColor();
  152. TColor APP_GetDisplayColor(int ASeq);
  153. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  154. //////////////////////////////////////////////////////////////////////////////////
  155. class TVmsSizeType : public TObject
  156. {
  157. public: // User declarations
  158. String TypeCd;
  159. String TypeNm;
  160. int Width;
  161. int Height;
  162. public: // User declarations
  163. __fastcall TVmsSizeType(String ATypeCd,
  164. String ATypeNm,
  165. int AWidth,
  166. int AHeight)
  167. {
  168. TypeCd = ATypeCd;
  169. TypeNm = ATypeNm;
  170. Width = AWidth;
  171. Height = AHeight;
  172. }
  173. };
  174. //////////////////////////////////////////////////////////////////////////////////
  175. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  176. //----------------------------------------------------------------------------
  177. ULONG ProcIDFromWnd(HWND hwnd);
  178. HWND GetWinHandle(ULONG pid);
  179. #endif