AppGlobalF.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "DataTypesF.h"
  8. #include "ITSLogF.h"
  9. #include "CDSCodeF.h"
  10. #include "FrmResourceF.h"
  11. /*
  12. ******************************************************************************
  13. * Defines
  14. ******************************************************************************
  15. */
  16. #define DBERRMSG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,true)
  17. #define DBERRLOG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,false)
  18. /*
  19. ******************************************************************************
  20. * User Data Types
  21. ******************************************************************************
  22. */
  23. #define STR_DATETIME String("YYYY-MM-DD HH:NN:SS")
  24. #define STR_HHNN String("YYYY-MM-DD HH:NN")
  25. #define STR_DATEHOUR String("YYYY-MM-DD HH")
  26. #define STR_DATE String("YYYY-MM-DD")
  27. #define STR_MM String("YYYY-MM")
  28. #define STR_YY String("YYYY")
  29. typedef enum
  30. {
  31. icon_n = 0,
  32. icon_e,
  33. icon_m,
  34. icon_r,
  35. icon_s,
  36. } facility_icon;
  37. typedef struct
  38. {
  39. String ICON[5];
  40. } FACILITY_ICON;
  41. typedef struct tag_AppConfig
  42. {
  43. String sConfigFile;
  44. bool bAppClose;
  45. long lMainWinHandle; /* Main Window Handle */
  46. String sTitle;
  47. String sProcessId; /* 프로세스 ID */
  48. String sSkinName;
  49. bool bSaveForm;
  50. bool bLoginPrompt;
  51. String sDefUseId;
  52. int nLogLevel;
  53. AnsiString sLogDay;
  54. bool bDebug;
  55. String sAppPath;
  56. String sLang;
  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. FACILITY_ICON vms;
  80. FACILITY_ICON vds;
  81. struct
  82. {
  83. TThread *pThread;
  84. DWORD dwThreadId;
  85. unsigned int nHandle;
  86. bool bRunning;
  87. } thr;
  88. struct
  89. {
  90. String sProvider;
  91. String sServerName;
  92. String sUserName;
  93. String sPassword;
  94. String sConnectStr;
  95. bool bSqlLog;
  96. } itsdb;
  97. struct
  98. {
  99. String sProvider;
  100. String sServerName;
  101. String sUserName;
  102. String sPassword;
  103. bool bSqlLog;
  104. } utisdb;
  105. struct
  106. {
  107. String sMainMap;
  108. String sLinkMap;
  109. } flashmap;
  110. struct
  111. {
  112. String sComModel;
  113. String sDevModel;
  114. } vmscam;
  115. struct
  116. {
  117. String saveDir;
  118. String viewer;
  119. String server;
  120. int port;
  121. String user;
  122. String pswd;
  123. String dir;
  124. } blackbox;
  125. struct
  126. {
  127. String SERVER;
  128. int PORT;
  129. String USER;
  130. String PSWD;
  131. bool PASSIVE;
  132. } vmsFtp;
  133. bool bOnlyOneScreen;
  134. bool bTermChildProg;
  135. } APP_CONFIG;
  136. /*
  137. ******************************************************************************
  138. * Global variable definitions
  139. ******************************************************************************
  140. */
  141. extern ST_GISINFO g_GisInfo;
  142. extern ST_SELLINK g_SelLink;
  143. extern String CenterCd; // 지역센터 코드
  144. extern String CenterId; // 지역센터 아이디
  145. extern String CenterName; // 지역센터 명칭
  146. extern int g_nPid; // Application Process ID
  147. extern String g_sAppDir; // Application Directory
  148. extern String g_sAppName; // Program name
  149. extern String g_sCfgDir; // Config File Directory
  150. extern String g_sLogDir; // Program Log Directory
  151. extern String g_sTempDir; // Program Temp Directory
  152. extern String g_sFormsDir; // Program Forms Directory
  153. extern String g_sBlackBox;
  154. extern String g_sLangDir;
  155. extern String g_sImageDir;
  156. extern String g_sVideoDir;
  157. extern String g_sMapDir;
  158. extern APP_CONFIG g_AppCfg;
  159. extern LOGININFO *g_pLOGIN;
  160. extern LOG_INFO g_LogCfg;
  161. extern TITSLog *ITSLog;
  162. extern TITSLog *FDbLog;
  163. //extern TLangTrans *LangTrans;
  164. /*
  165. ******************************************************************************
  166. * PlugIn Global variables
  167. ******************************************************************************
  168. */
  169. /*
  170. ******************************************************************************
  171. * Global function definitios
  172. ******************************************************************************
  173. */
  174. bool LoadDefaultConfigInfo(String ACfgFile);
  175. int UserLogin();
  176. int UserLogout();
  177. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  178. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  179. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  180. void ShowErrorMsg(String ATitle, String AErrMsg);
  181. #include "cxControls.hpp"
  182. #include "cxDropDownEdit.hpp"
  183. TDateTime APP_StrToDateTime(String AStrDateTime);
  184. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  185. String APP_GetCode(TcxComboBox *ACombo);
  186. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  187. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  188. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  189. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  190. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  191. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  192. String ITSUtil_FormatStr(String AStrDateTime, String AFormat);
  193. //----------------------------------------------------------------------------
  194. #define MAX_DISPCOLOR 20
  195. extern TColor g_DispColor[MAX_DISPCOLOR];
  196. void APP_InitDisplayColor();
  197. TColor APP_GetDisplayColor(int ASeq);
  198. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  199. //////////////////////////////////////////////////////////////////////////////////
  200. class TVmsSizeType : public TObject
  201. {
  202. public: // User declarations
  203. String TypeCd;
  204. String TypeNm;
  205. int Width;
  206. int Height;
  207. public: // User declarations
  208. __fastcall TVmsSizeType(String ATypeCd,
  209. String ATypeNm,
  210. int AWidth,
  211. int AHeight)
  212. {
  213. TypeCd = ATypeCd;
  214. TypeNm = ATypeNm;
  215. Width = AWidth;
  216. Height = AHeight;
  217. }
  218. };
  219. //////////////////////////////////////////////////////////////////////////////////
  220. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  221. void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll=false);
  222. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
  223. void APP_SetSummaryItemKind(TcxSummaryEventArguments &Arguments,
  224. TcxSummaryEventOutArguments &OutArguments,
  225. int pKind,
  226. bool pCaptionDisplay,
  227. bool pPointDisplay);
  228. //----------------------------------------------------------------------------
  229. ULONG ProcIDFromWnd(HWND hwnd);
  230. HWND GetWinHandle(ULONG pid);
  231. #endif