diff --git a/AIParkingApplication/C3DeviceController.cs b/AIParkingApplication/C3DeviceController.cs index 10d72df..23fe276 100644 --- a/AIParkingApplication/C3DeviceController.cs +++ b/AIParkingApplication/C3DeviceController.cs @@ -1,7 +1,6 @@ using System; using System.Runtime.InteropServices; using System.Text; -using System.Threading; using System.Threading.Tasks; namespace AIParkingApplication diff --git a/AIParkingApplication/LaneIn.cs b/AIParkingApplication/LaneIn.cs index f8390f4..b1da451 100644 --- a/AIParkingApplication/LaneIn.cs +++ b/AIParkingApplication/LaneIn.cs @@ -12,6 +12,7 @@ namespace AIParkingApplication private Camera overviewCamera; private Camera plateCamera; private PlateProcessor plateProcessor; + private int doorId; private bool isSupportSquarePlate; private bool isSupportLongPlate; private bool isAutoOpenDoor; @@ -19,7 +20,8 @@ namespace AIParkingApplication private bool isRetryModeUntilOk; //TODO: Test mode private C3DeviceController c3Device; - public LaneIn(string plateStream, + public LaneIn(int doorId, + string plateStream, string overviewStream, C3DeviceController c3Device, bool isSupportSquarePlate = true, @@ -29,6 +31,7 @@ namespace AIParkingApplication bool isRetryModeUntilOk = false) { InitializeComponent(); + this.doorId = doorId; this.isSupportSquarePlate = isSupportSquarePlate; this.isSupportLongPlate = isSupportLongPlate; this.isAutoOpenDoor = isAutoOpenDoor; @@ -57,10 +60,15 @@ namespace AIParkingApplication private void C3Device_OnNewCardReceived(int doorId, string cardNumber) { + //Request To Capture And Process Frame. CaptureAllCamera(); + //Request Card Info if (isAutoOpenDoor) { - c3Device.OpenDoor(doorId); + if (this.doorId == doorId) + { + c3Device.OpenDoor(doorId); + } } }