LaneIn - Formload Event: Connect and check door access control connection .
This commit is contained in:
parent
1eee458212
commit
d756d36082
1
AIParkingApplication/LaneIn.Designer.cs
generated
1
AIParkingApplication/LaneIn.Designer.cs
generated
|
@ -201,6 +201,7 @@
|
||||||
this.Margin = new System.Windows.Forms.Padding(0);
|
this.Margin = new System.Windows.Forms.Padding(0);
|
||||||
this.Name = "LaneIn";
|
this.Name = "LaneIn";
|
||||||
this.Size = new System.Drawing.Size(442, 692);
|
this.Size = new System.Drawing.Size(442, 692);
|
||||||
|
this.Load += new System.EventHandler(this.LaneIn_Load);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImage)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImage)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateVideo)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateVideo)).EndInit();
|
||||||
this.grbPlateCamera.ResumeLayout(false);
|
this.grbPlateCamera.ResumeLayout(false);
|
||||||
|
|
|
@ -51,11 +51,6 @@ namespace AIParkingApplication
|
||||||
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
overviewCamera.OnOpenVideoStreamFailed += OverviewCamera_OnOpenVideoStreamFailed;
|
||||||
|
|
||||||
plateProcessor = new PlateProcessor(this.isSupportSquarePlate, this.isSupportLongPlate);
|
plateProcessor = new PlateProcessor(this.isSupportSquarePlate, this.isSupportLongPlate);
|
||||||
|
|
||||||
if (!this.c3Device.Connect().HasError)
|
|
||||||
{
|
|
||||||
_ = this.c3Device.GetLogToReceiveNewCard();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void C3Device_OnNewCardReceived(int doorId, string cardNumber)
|
private async void C3Device_OnNewCardReceived(int doorId, string cardNumber)
|
||||||
|
@ -164,7 +159,7 @@ namespace AIParkingApplication
|
||||||
lblStatusInfo.Invoke(new Action(() =>
|
lblStatusInfo.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
lblStatusInfo.BackColor = Color.Red;
|
lblStatusInfo.BackColor = Color.Red;
|
||||||
lblStatusInfo.Text = "KHÔNG THỂ KẾT NỐI TỚI THIẾT BỊ MỞ CỬA";
|
lblStatusInfo.Text = "KHÔNG THỂ MỞ CỬA";
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,5 +264,26 @@ namespace AIParkingApplication
|
||||||
Console.WriteLine($"{Util.GetCurrentMethodName()}\texMessage: {ex.Message}");
|
Console.WriteLine($"{Util.GetCurrentMethodName()}\texMessage: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ConnectToDoorAccessControl()
|
||||||
|
{
|
||||||
|
if (!this.c3Device.Connect().HasError)
|
||||||
|
{
|
||||||
|
_ = this.c3Device.GetLogToReceiveNewCard();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblStatusInfo.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
lblStatusInfo.BackColor = Color.Purple;
|
||||||
|
lblStatusInfo.Text = "KHÔNG THỂ KẾT NỐI TỚI C3200";
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LaneIn_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ConnectToDoorAccessControl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user