ITS_OPLibF.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. //---------------------------------------------------------------------------
  2. #ifndef ITS_OPLibFH
  3. #define ITS_OPLibFH
  4. //---------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #ifndef __ITS_OPLib_EXPORT__
  7. #pragma comment(lib, "ITS_OPLib.lib")
  8. #endif // #ifndef __ITS_OPLib_EXPORT__
  9. //---------------------------------------------------------------------------
  10. #include <vcl.h>
  11. #include "cxControls.hpp"
  12. #include "cxDropDownEdit.hpp"
  13. //---------------------------------------------------------------------------
  14. //COMMON LIBRARY
  15. #include "CenterCommF.h"
  16. #include "EncryptionF.h"
  17. #include "ITSDbF.h"
  18. #include "ITSLangTransF.h"
  19. #include "ITSLibF.h"
  20. #include "ITSLogF.h"
  21. #include "ITSMapF.h"
  22. #include "ITSNetF.h"
  23. #include "ITSSkinF.h"
  24. #include "ITSUtilF.h"
  25. #include "FilterGrid.hpp"
  26. //#include "UJSExec.hpp"
  27. //MSG
  28. #include "DataTypesF.h"
  29. #include "WindowMsgF.h"
  30. //FRM
  31. #include "FrmResourceF.h"
  32. /*
  33. ******************************************************************************
  34. * Defines
  35. ******************************************************************************
  36. */
  37. #define DBERRMSG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,true)
  38. #define DBERRLOG(v,w,x,y) FDbLog->LogDbError(v,w,x,y,__FILE__, String(__FUNC__), __LINE__,false)
  39. /*
  40. ******************************************************************************
  41. * User Data Types
  42. ******************************************************************************
  43. */
  44. #define STR_DATETIME String("YYYY-MM-DD HH:NN:SS")
  45. #define STR_HHNN String("YYYY-MM-DD HH:NN")
  46. #define STR_DATEHOUR String("YYYY-MM-DD HH")
  47. #define STR_DATE String("YYYY-MM-DD")
  48. #define STR_MM String("YYYY-MM")
  49. #define STR_YY String("YYYY")
  50. typedef enum
  51. {
  52. icon_n = 0,
  53. icon_e,
  54. icon_m,
  55. icon_r,
  56. icon_s,
  57. } facility_icon;
  58. typedef struct
  59. {
  60. String ICON[5];
  61. } FACILITY_ICON;
  62. typedef struct tag_AppConfig
  63. {
  64. String sConfigFile;
  65. bool bAppClose;
  66. long lMainWinHandle; /* Main Window Handle */
  67. String sTitle;
  68. String sProcessId; /* ÇÁ·Î¼¼½º ID */
  69. String sSkinName;
  70. bool bSaveForm;
  71. bool bLoginPrompt;
  72. String sDefUseId;
  73. int nLogLevel;
  74. AnsiString sLogDay;
  75. bool bDebug;
  76. String sAppPath;
  77. String sLang;
  78. struct
  79. {
  80. bool Window;
  81. bool Enabled;
  82. int TimeOut;
  83. } Alarm;
  84. struct
  85. {
  86. bool Window;
  87. bool Enabled;
  88. int TimeOut;
  89. } Incident;
  90. struct
  91. {
  92. int AlarmValue;
  93. } Temp;
  94. struct
  95. {
  96. bool Enabled;
  97. int IntervalMin;
  98. bool LogoutExit;
  99. } AutoLogout;
  100. FACILITY_ICON vms;
  101. FACILITY_ICON vds;
  102. struct
  103. {
  104. TThread *pThread;
  105. DWORD dwThreadId;
  106. unsigned int nHandle;
  107. bool bRunning;
  108. } thr;
  109. struct
  110. {
  111. String sProvider;
  112. String sServerName;
  113. String sUserName;
  114. String sPassword;
  115. String sConnectStr;
  116. bool bSqlLog;
  117. } itsdb;
  118. struct
  119. {
  120. String sProvider;
  121. String sServerName;
  122. String sUserName;
  123. String sPassword;
  124. bool bSqlLog;
  125. } utisdb;
  126. struct
  127. {
  128. String sMainMap;
  129. String sLinkMap;
  130. } flashmap;
  131. struct
  132. {
  133. String sComModel;
  134. String sDevModel;
  135. } vmscam;
  136. struct
  137. {
  138. String saveDir;
  139. String viewer;
  140. String server;
  141. int port;
  142. String user;
  143. String pswd;
  144. String dir;
  145. } blackbox;
  146. struct
  147. {
  148. String SERVER;
  149. int PORT;
  150. String USER;
  151. String PSWD;
  152. bool PASSIVE;
  153. } vmsFtp;
  154. bool bOnlyOneScreen;
  155. bool bTermChildProg;
  156. bool isLoadFromFile;
  157. } APP_CONFIG;
  158. /*
  159. ******************************************************************************
  160. * Global variable definitions
  161. ******************************************************************************
  162. */
  163. extern TITSLog *ITSLog;
  164. extern String g_sMapDir;
  165. extern ST_GISINFO g_GisInfo;
  166. extern ST_SELLINK g_SelLink;
  167. extern APP_CONFIG g_AppCfg;
  168. /*
  169. ******************************************************************************
  170. * Global function prototype
  171. ******************************************************************************
  172. */
  173. #define MAX_DISPCOLOR 20
  174. void APP_InitDisplayColor();
  175. TColor APP_GetDisplayColor(int ASeq);
  176. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  177. void APP_ShowErrorMsg(String ATitle, String AErrMsg);
  178. TDateTime APP_StrToDateTime(String AStrDateTime);
  179. String APP_FillCode(TcxComboBox *ACombo, String ACode);
  180. String APP_GetCode(TcxComboBox *ACombo);
  181. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  182. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  183. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  184. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  185. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  186. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  187. //////////////////////////////////////////////////////////////////////////////////
  188. class TVmsSizeType : public TObject
  189. {
  190. public: // User declarations
  191. String TypeCd;
  192. String TypeNm;
  193. int Width;
  194. int Height;
  195. public: // User declarations
  196. __fastcall TVmsSizeType(String ATypeCd,
  197. String ATypeNm,
  198. int AWidth,
  199. int AHeight)
  200. {
  201. TypeCd = ATypeCd;
  202. TypeNm = ATypeNm;
  203. Width = AWidth;
  204. Height = AHeight;
  205. }
  206. };
  207. //////////////////////////////////////////////////////////////////////////////////
  208. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  209. void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll=false);
  210. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
  211. String APP_FormatStr(String AStrDateTime, String AFormat);
  212. void APP_SetSummaryItemKind(TcxSummaryEventArguments &Arguments,
  213. TcxSummaryEventOutArguments &OutArguments,
  214. int pKind,
  215. bool pCaptionDisplay,
  216. bool pPointDisplay);
  217. bool APP_WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  218. bool APP_IsDirectoryExists(LPCTSTR path);
  219. #endif