LaneOut - Add FormLoad Event.

This commit is contained in:
DucDangAnh 2020-07-07 17:21:09 +07:00
parent a00d77133f
commit cc6df6ac2b
2 changed files with 13 additions and 10 deletions

View File

@ -267,6 +267,7 @@
this.Controls.Add(this.grbPlateRefernce);
this.Name = "LaneOut";
this.Size = new System.Drawing.Size(680, 692);
this.Load += new System.EventHandler(this.LaneOut_Load);
this.grbPlateRefernce.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxOverviewImageIn)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImageIn)).EndInit();

View File

@ -43,15 +43,7 @@ namespace AIParkingApplication
plateCamera = new Camera(plateStream);
this.apiController = apiController;
this.doorControlAccess = doorControlAccess;
this.doorControlAccess.OnNewCardReceived += C3Device_OnNewCardReceived;
printer = new Printer();
plateCamera.OnVideoFrameReceived += PlateCameraOnVideoFrameReceived;
plateCamera.OnOpenVideoStreamFailed += PlateCamera_OnOpenVideoStreamFailed;
overviewCamera.OnVideoFrameReceived += OverviewCameraOnVideoFrameReceived;
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
plateProcessor = new PlateProcessor(engineApiController, this.isSupportSquarePlate, this.isSupportLongPlate);
}
@ -244,9 +236,9 @@ namespace AIParkingApplication
private void ConnectToDoorAccessControl()
{
if (!this.doorControlAccess.Connect().HasError)
if (!doorControlAccess.Connect().HasError)
{
_ = this.doorControlAccess.GetLogToReceiveNewCard();
_ = doorControlAccess.GetLogToReceiveNewCard();
}
else
{
@ -258,5 +250,15 @@ namespace AIParkingApplication
{
ConnectToDoorAccessControl();
}
private void LaneOut_Load(object sender, EventArgs e)
{
doorControlAccess.OnNewCardReceived += C3Device_OnNewCardReceived;
plateCamera.OnVideoFrameReceived += PlateCameraOnVideoFrameReceived;
plateCamera.OnOpenVideoStreamFailed += PlateCamera_OnOpenVideoStreamFailed;
overviewCamera.OnVideoFrameReceived += OverviewCameraOnVideoFrameReceived;
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
}
}
}