VMS0500MF.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. //---------------------------------------------------------------------------
  2. #ifndef VMS0500MFH
  3. #define VMS0500MFH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <DB.hpp>
  10. #include <Menus.hpp>
  11. #include <ExtCtrls.hpp>
  12. #include <ADODB.hpp>
  13. #include <ImgList.hpp>
  14. #include <Graphics.hpp>
  15. #include <ComCtrls.hpp>
  16. //---------------------------------------------------------------------------
  17. #include "VitzroCommF.h"
  18. #include "DataTypesF.h"
  19. #include "WindowMsgF.h"
  20. #include "CDSVmsCtlrF.h"
  21. //---------------------------------------------------------------------------
  22. #include "cxContainer.hpp"
  23. #include "cxControls.hpp"
  24. #include "cxEdit.hpp"
  25. #include "cxGraphics.hpp"
  26. #include "cxGroupBox.hpp"
  27. #include "cxLabel.hpp"
  28. #include "cxLookAndFeelPainters.hpp"
  29. #include "cxLookAndFeels.hpp"
  30. #include "cxPC.hpp"
  31. #include "cxPCdxBarPopupMenu.hpp"
  32. #include "cxSplitter.hpp"
  33. #include "dxSkinBlack.hpp"
  34. #include "dxSkinBlue.hpp"
  35. #include "dxSkinCaramel.hpp"
  36. #include "dxSkinCoffee.hpp"
  37. #include "dxSkinDarkRoom.hpp"
  38. #include "dxSkinDarkSide.hpp"
  39. #include "dxSkinFoggy.hpp"
  40. #include "dxSkinGlassOceans.hpp"
  41. #include "dxSkiniMaginary.hpp"
  42. #include "dxSkinLilian.hpp"
  43. #include "dxSkinLiquidSky.hpp"
  44. #include "dxSkinLondonLiquidSky.hpp"
  45. #include "dxSkinMcSkin.hpp"
  46. #include "dxSkinMoneyTwins.hpp"
  47. #include "dxSkinOffice2007Black.hpp"
  48. #include "dxSkinOffice2007Blue.hpp"
  49. #include "dxSkinOffice2007Green.hpp"
  50. #include "dxSkinOffice2007Pink.hpp"
  51. #include "dxSkinOffice2007Silver.hpp"
  52. #include "dxSkinOffice2010Black.hpp"
  53. #include "dxSkinOffice2010Blue.hpp"
  54. #include "dxSkinOffice2010Silver.hpp"
  55. #include "dxSkinsCore.hpp"
  56. #include "dxSkinscxPCPainter.hpp"
  57. #include "dxSkinSeven.hpp"
  58. #include "dxSkinSharp.hpp"
  59. #include "dxSkinSilver.hpp"
  60. #include "dxSkinStardust.hpp"
  61. #include "cxClasses.hpp"
  62. #include "cxCustomData.hpp"
  63. #include "cxData.hpp"
  64. #include "cxDataStorage.hpp"
  65. #include "cxFilter.hpp"
  66. #include "cxGrid.hpp"
  67. #include "cxGridCustomTableView.hpp"
  68. #include "cxGridCustomView.hpp"
  69. #include "cxGridLevel.hpp"
  70. #include "cxGridTableView.hpp"
  71. #include "cxStyles.hpp"
  72. #include "cxTextEdit.hpp"
  73. #include "cxGridCardView.hpp"
  74. #include "cxGridCustomLayoutView.hpp"
  75. #include "cxCheckBox.hpp"
  76. #include "cxDropDownEdit.hpp"
  77. #include "cxImage.hpp"
  78. #include "cxButtons.hpp"
  79. #include "cxCalc.hpp"
  80. #include "cxGridBandedTableView.hpp"
  81. #include "FRAME_VmsStateListF.h"
  82. #include "FRAME_VmsStateF.h"
  83. #include "FRAME_VmsMsgListF.h"
  84. #include "ImageBtn.h"
  85. #include "cxMaskEdit.hpp"
  86. #include "cxRadioGroup.hpp"
  87. #include "cxSpinEdit.hpp"
  88. #include "cxTimeEdit.hpp"
  89. #include <OleCtrls.hpp>
  90. #include <SHDocVw.hpp>
  91. //---------------------------------------------------------------------------
  92. #include "FrmSamsungPlayer1F.h"
  93. #include "IdBaseComponent.hpp"
  94. #include "IdComponent.hpp"
  95. #include "IdIcmpClient.hpp"
  96. #include "IdRawBase.hpp"
  97. #include "IdRawClient.hpp"
  98. #include "XNSSDKDEVICELib_OCX.h"
  99. #include "XNSSDKWINDOWLib_OCX.h"
  100. //---------------------------------------------------------------------------
  101. #define USE_FORM 0
  102. class TVMS0500M : public TForm
  103. {
  104. __published: // IDE-managed Components
  105. TTimer *TmrShow;
  106. TPanel *PnlCenter;
  107. TPanel *PnlRight;
  108. TPanel *PnlLeft;
  109. TPanel *PnlRTop;
  110. TcxGroupBox *GrpList;
  111. TcxGroupBox *cxGroupBox1;
  112. TcxGroupBox *cxGroupBox2;
  113. TcxPageControl *PgControl;
  114. TcxTabSheet *cxTabSheet3;
  115. TcxTabSheet *cxTabSheet1;
  116. TcxTabSheet *cxTabSheet2;
  117. TImageList *ImageList1;
  118. TcxButton *BtnAllClear;
  119. TcxButton *BtnReverse;
  120. TcxButton *BtnAllSelect;
  121. TPanel *PnlVms;
  122. TPanel *Panel2;
  123. TcxRadioButton *RdbOn;
  124. TcxRadioButton *RdbOff;
  125. TcxRadioButton *RdbReset;
  126. TcxButton *BtnControl;
  127. TcxTimeEdit *cxTimeOn;
  128. TcxTimeEdit *cxTimeOff;
  129. TImage *ImgDesc11;
  130. TImage *ImgDesc01;
  131. TcxButton *BtnOnOffSet;
  132. TImage *ImgDesc40;
  133. TLabel *Label5;
  134. TImage *ImgDesc41;
  135. TLabel *Label8;
  136. TLabel *Label13;
  137. TImage *ImgDesc42;
  138. TLabel *Label2;
  139. TImage *ImgDesc43;
  140. TLabel *Label15;
  141. TImage *ImgDesc44;
  142. TImage *ImgDesc61;
  143. TImage *ImgDesc62;
  144. TLabel *Label6;
  145. TLabel *Label4;
  146. TLabel *Label16;
  147. TLabel *Label7;
  148. TLabel *Label9;
  149. TLabel *Label10;
  150. TLabel *Label11;
  151. TLabel *Label12;
  152. TLabel *Label17;
  153. TcxSpinEdit *Se03;
  154. TcxSpinEdit *Se04;
  155. TcxSpinEdit *Se02;
  156. TcxSpinEdit *Se05;
  157. TcxSpinEdit *Se01;
  158. TcxSpinEdit *Se06;
  159. TcxSpinEdit *Se07;
  160. TLabel *Label1;
  161. TLabel *Label14;
  162. TcxButton *BtnConfig;
  163. TcxTabSheet *cxTabSheet4;
  164. TcxRadioButton *RdbAuto;
  165. TcxRadioButton *RdbFix;
  166. TcxRadioButton *RdbBase;
  167. TcxButton *BtnModeControl;
  168. TLabel *Label18;
  169. TcxRadioButton *RdbLuminance;
  170. TcxSpinEdit *SeLuminance;
  171. TLabel *Label19;
  172. TcxPageControl *PgCam;
  173. TcxTabSheet *TabRtsp;
  174. TPanel *PnlCamera;
  175. TLabel *Label3;
  176. TcxButton *BtnWebCamUrl;
  177. TcxButton *BtnDefaultMsg;
  178. TcxButton *BtnBlankDisplay;
  179. TPanel *PnlVmsCam;
  180. TPanel *PnlCamConrtol;
  181. TcxButton *BtnImageSave;
  182. TPanel *PnlPTZ;
  183. TImageBtn *BtnUpLeft;
  184. TImageBtn *BtnUp;
  185. TImageBtn *BtnUpRight;
  186. TImageBtn *BtnLeft;
  187. TImageBtn *BtnHome;
  188. TImageBtn *BtnRight;
  189. TImageBtn *BtnDownLeft;
  190. TImageBtn *BtnDown;
  191. TImageBtn *BtnDownRight;
  192. TImageBtn *BtnZoomIn;
  193. TImageBtn *BtnZoomOut;
  194. TImageBtn *BtnFocusIn;
  195. TImageBtn *BtnFocusOut;
  196. TLabel *Label20;
  197. TTrackBar *PTZSpeed;
  198. TcxTabSheet *cxTabSheet5;
  199. TcxButton *BtnParamSetting;
  200. TImage *ImgDesc57;
  201. TLabel *Label21;
  202. TcxTimeEdit *cxDisplayTimeOn;
  203. TcxTimeEdit *cxDisplayTimeOff;
  204. TImage *ImgDesc53;
  205. TLabel *Label23;
  206. TImage *ImgDesc54;
  207. TLabel *Label24;
  208. TLabel *Label25;
  209. TImage *ImgDesc52;
  210. TLabel *Label26;
  211. TImage *ImgDesc56;
  212. TLabel *Label27;
  213. TImage *ImgDesc51;
  214. TLabel *Label28;
  215. TLabel *Label29;
  216. TLabel *Label30;
  217. TLabel *Label31;
  218. TLabel *Label32;
  219. TcxSpinEdit *SeModRate;
  220. TcxSpinEdit *SeModCycle;
  221. TcxSpinEdit *SeLumDay;
  222. TcxSpinEdit *SeMsgTime;
  223. TcxSpinEdit *SeLumNight;
  224. TLabel *Label33;
  225. TcxSpinEdit *SeCommErrTime;
  226. TcxSpinEdit *SeSlotCommErr;
  227. TcxSpinEdit *SeSlotPowerErr;
  228. TcxButton *BtnDefMsgDownload;
  229. TcxTabSheet *cxTabSheet6;
  230. TGroupBox *GroupBox1;
  231. TImage *ImgDesc59;
  232. TLabel *Label22;
  233. TcxSpinEdit *SeFormCycleTime;
  234. TLabel *Label34;
  235. TcxButton *BtnDisplayTimeSet;
  236. TcxButton *BtnMsgImmediateDownload;
  237. TTimer *TmrCommand;
  238. TLabel *Label35;
  239. TLabel *Label36;
  240. TLabel *Label37;
  241. TLabel *Label38;
  242. TFRAMEVmsStateList *FRAMEVmsStateList1;
  243. TcxTabSheet *TabPing;
  244. TcxGrid *CxPing;
  245. TcxGridBandedTableView *TvPing;
  246. TcxGridBandedColumn *ColumnSel;
  247. TcxGridBandedColumn *Col01;
  248. TcxGridBandedColumn *Col02;
  249. TcxGridBandedColumn *Col03;
  250. TcxGridBandedColumn *Col04;
  251. TcxGridBandedColumn *Col05;
  252. TcxGridBandedColumn *Col06;
  253. TcxGridBandedColumn *Col07;
  254. TcxGridBandedColumn *Col08;
  255. TcxGridBandedColumn *Col09;
  256. TcxGridBandedColumn *Col10;
  257. TcxGridBandedColumn *Col11;
  258. TcxGridBandedColumn *Col12;
  259. TcxGridBandedColumn *Col99;
  260. TcxGridLevel *GlPing;
  261. TPanel *PnlPing;
  262. TcxButton *BtnAllSelect0;
  263. TcxButton *BtnAllClear0;
  264. TcxButton *BtnReverse0;
  265. TImage *ImgDesc99;
  266. TLabel *Label39;
  267. TcxSpinEdit *EdPingTimeout;
  268. TLabel *Label40;
  269. TcxButton *BtnNwkPing;
  270. TcxButton *BtnNwkPingClear;
  271. TIdIcmpClient *IdIcmpClient1;
  272. TcxSpinEdit *EdPingPort;
  273. TLabel *Label41;
  274. TLabel *Label42;
  275. TImage *ImgDesc98;
  276. TPanel *PnlSamsung;
  277. TXnsSdkDevice *XnsSdkDevice1;
  278. TXnsSdkWindow *XnsSdkWindow1;
  279. TcxLabel *LblErrMsg;
  280. void __fastcall FormShow(TObject *Sender);
  281. void __fastcall TmrShowTimer(TObject *Sender);
  282. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  283. void __fastcall FormActivate(TObject *Sender);
  284. void __fastcall FormDeactivate(TObject *Sender);
  285. void __fastcall BtnAllSelectClick(TObject *Sender);
  286. void __fastcall FRAMEVmsStateList1TvListCellDblClick(TcxCustomGridTableView *Sender,
  287. TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
  288. TShiftState AShift, bool &AHandled);
  289. void __fastcall Se01PropertiesChange(TObject *Sender);
  290. void __fastcall BtnConfigClick(TObject *Sender);
  291. void __fastcall BtnControlClick(TObject *Sender);
  292. void __fastcall BtnOnOffSetClick(TObject *Sender);
  293. void __fastcall BtnModeControlClick(TObject *Sender);
  294. void __fastcall BtnWebCamUrlClick(TObject *Sender);
  295. void __fastcall BtnDefaultMsgClick(TObject *Sender);
  296. void __fastcall BtnUpLeftMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
  297. int X, int Y);
  298. void __fastcall BtnUpLeftMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift,
  299. int X, int Y);
  300. void __fastcall BtnParamSettingClick(TObject *Sender);
  301. void __fastcall BtnDefMsgDownloadClick(TObject *Sender);
  302. void __fastcall BtnDisplayTimeSetClick(TObject *Sender);
  303. void __fastcall BtnMsgImmediateDownloadClick(TObject *Sender);
  304. void __fastcall TmrCommandTimer(TObject *Sender);
  305. void __fastcall PgControlPageChanging(TObject *Sender, TcxTabSheet *NewPage,
  306. bool &AllowChange);
  307. void __fastcall BtnNwkPingClick(TObject *Sender);
  308. void __fastcall BtnNwkPingClearClick(TObject *Sender);
  309. void __fastcall Col04CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
  310. TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
  311. void __fastcall IdIcmpClient1Reply(TComponent *ASender, const TReplyStatus *AReplyStatus);
  312. void __fastcall Col08CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
  313. TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone);
  314. void __fastcall TvPingCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  315. TMouseButton AButton, TShiftState AShift,
  316. bool &AHandled);
  317. void __fastcall XnsSdkDevice1ConnectFailed(TObject *Sender, long nWidth, long nHeight);
  318. void __fastcall XnsSdkDevice1DeviceStatusChanged(TObject *Sender, long nDeviceID,
  319. long nErrorCode, long nDeviceStatus, long nHddCondition);
  320. private: // User declarations
  321. void __fastcall CommClose();
  322. public:
  323. #if !USE_FORM
  324. long m_hDevice; // Device handle
  325. long m_lDeviceId; // Device handle
  326. long m_hMediaSource; // Media stream ID
  327. long m_nControlId; // Control ID
  328. bool m_bIsMediaPlay; // Media play or stop
  329. bool FInitialize;
  330. String FStrmAddr;
  331. String FId;
  332. String FLoc;
  333. WideString FDefModel;
  334. WideString FModelName;
  335. WideString FIpAddress;
  336. int FPort;
  337. WideString FConnId;
  338. WideString FConnPass;
  339. String FCaption;
  340. #endif
  341. void __fastcall ErrorMsg(String AErrMsg);
  342. bool __fastcall SetupWebCamera();
  343. void __fastcall WebCamPlay();
  344. void __fastcall WebCamStop();
  345. void __fastcall ReleaseWebCamera();
  346. bool __fastcall ConnectWebCamera();
  347. bool __fastcall OpenWebCamera();
  348. void __fastcall DisconnectWebCamera();
  349. void __fastcall CloseWebCamera();
  350. int __fastcall CameraControl(int ACommand, int ASpeed);
  351. int __fastcall Play(String AId,
  352. String ALoc,
  353. String AIpAddress,
  354. int APort,
  355. String AConnId,
  356. String AConnPass,
  357. String AComModel,
  358. String ADevModel);
  359. public:
  360. TForm *FPalyerForm;
  361. TVmsCtlr *FSelVmsObj;
  362. TStringList *FVmsIds;
  363. String FTitle;
  364. long FRtspHandle;
  365. TcxTabSheet *FCtrlTab;
  366. bool FInitPlayer;
  367. #if USE_FORM
  368. TFrmSamsungPlayer1 *FPlayer;
  369. #endif
  370. public: // User declarations
  371. __fastcall TVMS0500M(TComponent* Owner);
  372. bool FHtmlCompleted;
  373. void *fJSExec;
  374. bool __fastcall ExecScript(String AScript);
  375. String FCamUrl;
  376. void __fastcall OpenUrl(bool AOpen);
  377. void __fastcall LoadLocalSkin();
  378. void __fastcall DisplayInfo();
  379. void __fastcall ClearCheckList();
  380. int __fastcall GetSelListItems(bool ACommCheck=true);
  381. void __fastcall ActivateForm(bool AActivate);
  382. bool __fastcall UpdateVmsParam(String AVmsNmbr, void *pData);
  383. bool __fastcall UpdateVmsParam2(String AVmsNmbr, void *pData);
  384. void __fastcall ShowVmsWebCam(String AVmsNo);
  385. void __fastcall controlCamera(int ACommand);
  386. int FPingType;
  387. bool FPingTimeout;
  388. void __fastcall PingNetwork(String AIp, int APort);
  389. void __fastcall UpdatePingList();
  390. void __fastcall RefreshPingList(bool AInit=false);
  391. void __fastcall OnVmsSelectMessage(TMessage &Msg);
  392. void __fastcall OnMainFormMessage(TMessage &Msg);
  393. void __fastcall OnVmsStateRefreshMessage(TMessage &Msg);
  394. void __fastcall OnVmsFormRefreshMessage(TMessage &Msg);
  395. BEGIN_MESSAGE_MAP
  396. MESSAGE_HANDLER(WM_VMS_SELECT, TMessage, OnVmsSelectMessage)
  397. MESSAGE_HANDLER(WM_MAINFORM, TMessage, OnMainFormMessage)
  398. MESSAGE_HANDLER(WM_VMS_STATE_REFRESH, TMessage, OnVmsStateRefreshMessage)
  399. MESSAGE_HANDLER(WM_VMS_FORM_REFRESH, TMessage, OnVmsFormRefreshMessage)
  400. END_MESSAGE_MAP(TForm)
  401. };
  402. //---------------------------------------------------------------------------
  403. extern PACKAGE TVMS0500M *VMS0500M;
  404. //---------------------------------------------------------------------------
  405. #endif