AppGlobalF.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "ITSUtilF.h"
  8. #include "ITSLogF.h"
  9. //#include "CDSVmsObjTypeF.h"
  10. //#include "FrmLangF.h"
  11. /*
  12. ******************************************************************************
  13. * Defines
  14. ******************************************************************************
  15. */
  16. #define FORMSHOW(x) if (x) \
  17. { \
  18. try { \
  19. ShowWindow(x->Handle, SW_RESTORE); \
  20. x->BringToFront(); \
  21. } catch(...) {} \
  22. } \
  23. else \
  24. { \
  25. Application->CreateForm(__classid(T##x), &x); \
  26. if (x) x->Show(); \
  27. }
  28. typedef enum
  29. {
  30. icon_n = 0,
  31. icon_e,
  32. icon_m,
  33. icon_r,
  34. icon_s,
  35. } facility_icon;
  36. typedef struct
  37. {
  38. String ICON[5];
  39. } FACILITY_ICON;
  40. typedef struct tag_AppConfig
  41. {
  42. String sConfigFile;
  43. bool bAppClose;
  44. long lMainWinHandle; /* Main Window Handle */
  45. String sTitle;
  46. String sProcessId; /* ÇÁ·Î¼¼½º ID */
  47. int nVmsServerPort;
  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. bool isDispOfflineMsg;
  58. struct
  59. {
  60. bool Window;
  61. bool Enabled;
  62. int TimeOut;
  63. } Alarm;
  64. struct
  65. {
  66. bool Window;
  67. bool Enabled;
  68. int TimeOut;
  69. } Incident;
  70. struct
  71. {
  72. int AlarmValue;
  73. } Temp;
  74. struct
  75. {
  76. bool Enabled;
  77. int IntervalMin;
  78. bool LogoutExit;
  79. } AutoLogout;
  80. FACILITY_ICON vms;
  81. FACILITY_ICON vds;
  82. struct
  83. {
  84. TThread *pThread;
  85. DWORD dwThreadId;
  86. unsigned int nHandle;
  87. bool bRunning;
  88. } thr;
  89. struct
  90. {
  91. String sConnectStr;
  92. String sProvider;
  93. String sServerName;
  94. String sUserName;
  95. String sPassword;
  96. bool bSqlLog;
  97. } itsdb;
  98. struct
  99. {
  100. String sProvider;
  101. String sServerName;
  102. String sUserName;
  103. String sPassword;
  104. bool bSqlLog;
  105. } utisdb;
  106. struct
  107. {
  108. String sMainMap;
  109. String sLinkMap;
  110. } flashmap;
  111. struct
  112. {
  113. String sComModel;
  114. String sDevModel;
  115. } vmscam;
  116. struct
  117. {
  118. String saveDir;
  119. String viewer;
  120. String server;
  121. int port;
  122. String user;
  123. String pswd;
  124. String dir;
  125. } blackbox;
  126. struct
  127. {
  128. String SERVER;
  129. int PORT;
  130. String USER;
  131. String PSWD;
  132. bool PASSIVE;
  133. } vmsFtp;
  134. bool bOnlyOneScreen;
  135. bool bTermChildProg;
  136. bool isLoadFromFile;
  137. int cmraViewerResetMin;
  138. int cmraViewerDelaySec;
  139. String MAGIC_ID;
  140. String OPER_ID;
  141. String PRCS_ID;
  142. String PARAM1;
  143. String PARAM2;
  144. String PARAM3;
  145. String PARAM4;
  146. } APP_CONFIG;
  147. #define MAX_CMRA_VIEW_CAMERA 20
  148. #define DEFAULT_PRCS_ID "P08010"
  149. /*
  150. ******************************************************************************
  151. * Global variable definitions
  152. ******************************************************************************
  153. */
  154. extern String g_IniFileDir;
  155. extern String g_IniFileName;
  156. extern int g_nPid; // Application Process ID
  157. extern String g_sAppDir; // Application Directory
  158. extern String g_sAppName; // Program name
  159. extern String g_sCfgDir; // Config File Directory
  160. extern String g_sLogDir; // Program Log Directory
  161. extern String g_sTempDir; // Program Temp Directory
  162. extern String g_sFormsDir; // Program Forms Directory
  163. extern String g_sBlackBox;
  164. extern String g_sLangDir;
  165. extern String g_sImageDir;
  166. extern String g_sVideoDir;
  167. extern String g_sMapDir;
  168. extern APP_CONFIG g_AppCfg;
  169. extern LOG_INFO g_LogCfg;
  170. extern TITSLog *ITSLog;
  171. extern String g_sLang;
  172. extern bool g_bControlAuth;
  173. /*
  174. ******************************************************************************
  175. * PlugIn Global variables
  176. ******************************************************************************
  177. */
  178. /*
  179. ******************************************************************************
  180. * Global function definitios
  181. ******************************************************************************
  182. */
  183. String DbPictTypeToReal(String APictType);
  184. String RealPictTypeToDb(String APictType);
  185. String DbMovieTypeToReal(String APictType);
  186. String RealMovieTypeToDb(String APictType);
  187. bool CheckApplicationParam();
  188. bool ApplicationSingleRun(String AClassName, String ATitle);
  189. bool LoadDefaultConfigInfo(String ACfgFile="");
  190. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  191. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  192. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  193. void ShowErrorMsg(String ATitle, String AErrMsg);
  194. #include "cxControls.hpp"
  195. #include "cxDropDownEdit.hpp"
  196. //----------------------------------------------------------------------------
  197. //////////////////////////////////////////////////////////////////////////////////
  198. class TVmsSizeType : public TObject
  199. {
  200. public: // User declarations
  201. String TypeCd;
  202. String TypeNm;
  203. int Width;
  204. int Height;
  205. int Rows;
  206. int Cols;
  207. bool IsLcs;
  208. int LcsLanes;
  209. public: // User declarations
  210. __fastcall TVmsSizeType(String ATypeCd,
  211. String ATypeNm,
  212. int AWidth,
  213. int AHeight,
  214. int ARows,
  215. int ACols,
  216. bool AIsLcs,
  217. int ALcsLanes)
  218. {
  219. TypeCd = ATypeCd;
  220. TypeNm = ATypeNm;
  221. Width = AWidth;
  222. Height = AHeight;
  223. Rows = ARows;
  224. Cols = ACols;
  225. IsLcs = AIsLcs;
  226. LcsLanes = ALcsLanes;
  227. }
  228. };
  229. //////////////////////////////////////////////////////////////////////////////////
  230. #endif