FrmEmptyCameraF.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "FrmEmptyCameraF.h"
  5. #include "AppGlobalF.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. #pragma link "cxContainer"
  9. #pragma link "cxControls"
  10. #pragma link "cxEdit"
  11. #pragma link "cxGraphics"
  12. #pragma link "cxLabel"
  13. #pragma link "cxLookAndFeelPainters"
  14. #pragma link "cxLookAndFeels"
  15. #pragma link "dxSkinsCore"
  16. #pragma link "dxSkinBlack"
  17. #pragma link "dxSkinBlue"
  18. #pragma resource "*.dfm"
  19. TFrmEmptyCamera *FrmEmptyCamera = NULL;
  20. //---------------------------------------------------------------------------
  21. __fastcall TFrmEmptyCamera::TFrmEmptyCamera(TComponent* Owner, TXCctv *ACctv, bool AAutoPlay)
  22. : TForm(Owner)
  23. {
  24. FPlay = false;
  25. FAutoPlay = AAutoPlay;
  26. FConHandle = 0;
  27. FInstalled = false;
  28. InitCamera(ACctv, FAutoPlay);
  29. }
  30. //---------------------------------------------------------------------------
  31. void __fastcall TFrmEmptyCamera::Connect()
  32. {
  33. }
  34. //---------------------------------------------------------------------------
  35. void __fastcall TFrmEmptyCamera::Disconnect()
  36. {
  37. }
  38. //---------------------------------------------------------------------------
  39. void __fastcall TFrmEmptyCamera::CameraRelease()
  40. {
  41. }
  42. //---------------------------------------------------------------------------
  43. void __fastcall TFrmEmptyCamera::InitCamera(TXCctv *ACctv, bool AAutoPlay/*=true*/)
  44. {
  45. FAutoPlay = AAutoPlay;
  46. if (!ACctv)
  47. {
  48. FId = "";
  49. FGroup = "";
  50. FName = "-Empty-";
  51. FStreamingType = "";
  52. FViewAddress = "";
  53. FFullAddress = "";
  54. PnlCamera->Caption = "-Empty-";
  55. DisplayName(" ");
  56. FInstalled = false;
  57. try
  58. {
  59. String sImageFile = ExtractFilePath(Application->ExeName) + "\\image\\vmscam.bmp";
  60. ImgNoData->Picture->LoadFromFile(sImageFile);
  61. ImgNoData->Align = alClient;
  62. ImgNoData->Visible = true;
  63. DisplayName("-Empty-");
  64. //PnlName->Visible = false;
  65. }
  66. catch(Exception &e)
  67. {
  68. // ImgNoData->Visible = false;
  69. }
  70. }
  71. }
  72. //---------------------------------------------------------------------------
  73. void __fastcall TFrmEmptyCamera::DisplayName(String AName)
  74. {
  75. PnlName->Caption = " " + FName;
  76. PnlName->Visible = true;
  77. PnlName->Refresh();
  78. }
  79. //---------------------------------------------------------------------------
  80. void __fastcall TFrmEmptyCamera::TmrPlayTimer(TObject *Sender)
  81. {
  82. TmrStop->Enabled = false;
  83. TmrPlay->Enabled = false;
  84. }
  85. //---------------------------------------------------------------------------
  86. void __fastcall TFrmEmptyCamera::TmrStopTimer(TObject *Sender)
  87. {
  88. TmrPlay->Enabled = false;
  89. TmrStop->Enabled = false;
  90. }
  91. //---------------------------------------------------------------------------