AppGlobalF.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. /*
  100. ******************************************************************************
  101. * Global variable definitions
  102. ******************************************************************************
  103. */
  104. extern String CenterCd; // 지역센터 코드
  105. extern String CenterId; // 지역센터 아이디
  106. extern String CenterName; // 지역센터 명칭
  107. extern int g_nPid; // Application Process ID
  108. extern String g_sAppDir; // Application Directory
  109. extern String g_sAppName; // Program name
  110. extern String g_sCfgDir; // Config File Directory
  111. extern String g_sLogDir; // Program Log Directory
  112. extern String g_sTempDir; // Program Temp Directory
  113. extern String g_sFormsDir; // Program Forms Directory
  114. extern APP_CONFIG g_AppCfg;
  115. extern LOG_INFO g_LogCfg;
  116. extern TITSLog *ITSLog;
  117. /*
  118. ******************************************************************************
  119. * PlugIn Global variables
  120. ******************************************************************************
  121. */
  122. /*
  123. ******************************************************************************
  124. * Global function definitios
  125. ******************************************************************************
  126. */
  127. bool LoadDefaultConfigInfo(String ACfgFile="");
  128. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  129. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  130. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  131. void ShowErrorMsg(String ATitle, String AErrMsg);
  132. #include "cxControls.hpp"
  133. #include "cxDropDownEdit.hpp"
  134. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  135. String APP_GetCode(TcxComboBox *ACombo);
  136. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  137. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  138. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  139. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  140. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  141. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  142. //----------------------------------------------------------------------------
  143. #define MAX_DISPCOLOR 22
  144. extern TColor g_DispColor[MAX_DISPCOLOR];
  145. void APP_InitDisplayColor();
  146. TColor APP_GetDisplayColor(int ASeq);
  147. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  148. //////////////////////////////////////////////////////////////////////////////////
  149. class TVmsSizeType : public TObject
  150. {
  151. public: // User declarations
  152. String TypeCd;
  153. String TypeNm;
  154. int Width;
  155. int Height;
  156. public: // User declarations
  157. __fastcall TVmsSizeType(String ATypeCd,
  158. String ATypeNm,
  159. int AWidth,
  160. int AHeight)
  161. {
  162. TypeCd = ATypeCd;
  163. TypeNm = ATypeNm;
  164. Width = AWidth;
  165. Height = AHeight;
  166. }
  167. };
  168. //////////////////////////////////////////////////////////////////////////////////
  169. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  170. //----------------------------------------------------------------------------
  171. ULONG ProcIDFromWnd(HWND hwnd);
  172. HWND GetWinHandle(ULONG pid);
  173. #endif