AppGlobalF.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "ITSUtilF.h"
  8. #include "DataTypesF.h"
  9. #include "ITSLogF.h"
  10. #include "VitzroCommF.h"
  11. #include "CDSCodeF.h"
  12. #include "VmsCommInfoF.h"
  13. #include "ResourceMsgF.h"
  14. /*
  15. ******************************************************************************
  16. * Defines
  17. ******************************************************************************
  18. */
  19. #define FORMSHOW(x) if (x) \
  20. { \
  21. try { \
  22. ShowWindow(x->Handle, SW_RESTORE); \
  23. x->BringToFront(); \
  24. } catch(...) {} \
  25. } \
  26. else \
  27. { \
  28. Application->CreateForm(__classid(T##x), &x); \
  29. if (x) x->Show(); \
  30. }
  31. /*
  32. ******************************************************************************
  33. * User Data Types
  34. ******************************************************************************
  35. */
  36. #define STR_DATETIME "YYYY-MM-DD HH:NN:SS"
  37. #define STR_HHNN "YYYY-MM-DD HH:NN"
  38. #define STR_DATEHOUR "YYYY-MM-DD HH"
  39. #define STR_DATE "YYYY-MM-DD"
  40. #define STR_MM "YYYY-MM"
  41. typedef struct
  42. {
  43. String ICON[5];
  44. } FACILITY_ICON;
  45. typedef struct tag_AppConfig
  46. {
  47. String sConfigFile;
  48. bool bAppClose;
  49. long lMainWinHandle; /* Main Window Handle */
  50. String sTitle;
  51. String sProcessId; /* 프로세스 ID */
  52. String sSkinName;
  53. bool bSaveForm;
  54. bool bLoginPrompt;
  55. String sDefUseId;
  56. int nLogLevel;
  57. AnsiString sLogDay;
  58. bool bDebug;
  59. struct
  60. {
  61. bool Window;
  62. bool Enabled;
  63. int TimeOut;
  64. } Alarm;
  65. struct
  66. {
  67. bool Window;
  68. bool Enabled;
  69. int TimeOut;
  70. } Incident;
  71. struct
  72. {
  73. int AlarmValue;
  74. } Temp;
  75. struct
  76. {
  77. bool Enabled;
  78. int IntervalMin;
  79. bool LogoutExit;
  80. } AutoLogout;
  81. struct
  82. {
  83. String RVMS;
  84. String SVMS;
  85. } icon;
  86. FACILITY_ICON vms;
  87. struct
  88. {
  89. TThread *pThread;
  90. DWORD dwThreadId;
  91. unsigned int nHandle;
  92. bool bRunning;
  93. } thr;
  94. struct
  95. {
  96. String sProvider;
  97. String sServerName;
  98. String sUserName;
  99. String sPassword;
  100. bool bSqlLog;
  101. } itsdb;
  102. struct
  103. {
  104. String sMainMap;
  105. String sLinkMap;
  106. } flashmap;
  107. struct
  108. {
  109. String sComModel;
  110. String sDevModel;
  111. } vmscam;
  112. bool bOnlyOneScreen;
  113. bool bTermChildProg;
  114. } APP_CONFIG;
  115. /*
  116. ******************************************************************************
  117. * Global variable definitions
  118. ******************************************************************************
  119. */
  120. extern ST_GISINFO g_GisInfo;
  121. extern ST_SELLINK g_SelLink;
  122. extern String CenterCd; // 지역센터 코드
  123. extern String CenterId; // 지역센터 아이디
  124. extern String CenterName; // 지역센터 명칭
  125. extern int g_nPid; // Application Process ID
  126. extern String g_sAppDir; // Application Directory
  127. extern String g_sAppName; // Program name
  128. extern String g_sCfgDir; // Config File Directory
  129. extern String g_sLogDir; // Program Log Directory
  130. extern String g_sTempDir; // Program Temp Directory
  131. extern String g_sFormsDir; // Program Forms Directory
  132. extern APP_CONFIG g_AppCfg;
  133. extern LOGININFO *g_pLOGIN;
  134. extern LOG_INFO g_LogCfg;
  135. extern TITSLog *ITSLog;
  136. /*
  137. ******************************************************************************
  138. * PlugIn Global variables
  139. ******************************************************************************
  140. */
  141. /*
  142. ******************************************************************************
  143. * Global function definitios
  144. ******************************************************************************
  145. */
  146. bool LoadDefaultConfigInfo(String ACfgFile="");
  147. int UserLogin();
  148. int UserLogout();
  149. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  150. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  151. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  152. void ShowErrorMsg(String ATitle, String AErrMsg);
  153. #include "cxControls.hpp"
  154. #include "cxDropDownEdit.hpp"
  155. TDateTime APP_StrToDateTime(String AStrDateTime);
  156. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  157. String APP_GetCode(TcxComboBox *ACombo);
  158. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  159. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  160. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  161. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  162. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  163. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  164. String ITSUtil_FormatStr(String AStrDateTime, String AFormat);
  165. //----------------------------------------------------------------------------
  166. #define MAX_DISPCOLOR 22
  167. extern TColor g_DispColor[MAX_DISPCOLOR];
  168. void APP_InitDisplayColor();
  169. TColor APP_GetDisplayColor(int ASeq);
  170. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  171. //////////////////////////////////////////////////////////////////////////////////
  172. class TVmsSizeType : public TObject
  173. {
  174. public: // User declarations
  175. String TypeCd;
  176. String TypeNm;
  177. int Width;
  178. int Height;
  179. public: // User declarations
  180. __fastcall TVmsSizeType(String ATypeCd,
  181. String ATypeNm,
  182. int AWidth,
  183. int AHeight)
  184. {
  185. TypeCd = ATypeCd;
  186. TypeNm = ATypeNm;
  187. Width = AWidth;
  188. Height = AHeight;
  189. }
  190. };
  191. //////////////////////////////////////////////////////////////////////////////////
  192. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  193. void APP_FillVmsSizeType(TcxComboBox *cboBox, String AType, bool bAddAll=false);
  194. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
  195. //----------------------------------------------------------------------------
  196. ULONG ProcIDFromWnd(HWND hwnd);
  197. HWND GetWinHandle(ULONG pid);
  198. #endif