LaneIn - Add DoorId field.

This commit is contained in:
DucDangAnh 2020-06-24 11:30:04 +07:00
parent 4ca1cc1bd6
commit 3f22ddceb1
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AIParkingApplication namespace AIParkingApplication

View File

@ -12,6 +12,7 @@ namespace AIParkingApplication
private Camera overviewCamera; private Camera overviewCamera;
private Camera plateCamera; private Camera plateCamera;
private PlateProcessor plateProcessor; private PlateProcessor plateProcessor;
private int doorId;
private bool isSupportSquarePlate; private bool isSupportSquarePlate;
private bool isSupportLongPlate; private bool isSupportLongPlate;
private bool isAutoOpenDoor; private bool isAutoOpenDoor;
@ -19,7 +20,8 @@ namespace AIParkingApplication
private bool isRetryModeUntilOk; //TODO: Test mode private bool isRetryModeUntilOk; //TODO: Test mode
private C3DeviceController c3Device; private C3DeviceController c3Device;
public LaneIn(string plateStream, public LaneIn(int doorId,
string plateStream,
string overviewStream, string overviewStream,
C3DeviceController c3Device, C3DeviceController c3Device,
bool isSupportSquarePlate = true, bool isSupportSquarePlate = true,
@ -29,6 +31,7 @@ namespace AIParkingApplication
bool isRetryModeUntilOk = false) bool isRetryModeUntilOk = false)
{ {
InitializeComponent(); InitializeComponent();
this.doorId = doorId;
this.isSupportSquarePlate = isSupportSquarePlate; this.isSupportSquarePlate = isSupportSquarePlate;
this.isSupportLongPlate = isSupportLongPlate; this.isSupportLongPlate = isSupportLongPlate;
this.isAutoOpenDoor = isAutoOpenDoor; this.isAutoOpenDoor = isAutoOpenDoor;
@ -57,12 +60,17 @@ namespace AIParkingApplication
private void C3Device_OnNewCardReceived(int doorId, string cardNumber) private void C3Device_OnNewCardReceived(int doorId, string cardNumber)
{ {
//Request To Capture And Process Frame.
CaptureAllCamera(); CaptureAllCamera();
//Request Card Info
if (isAutoOpenDoor) if (isAutoOpenDoor)
{
if (this.doorId == doorId)
{ {
c3Device.OpenDoor(doorId); c3Device.OpenDoor(doorId);
} }
} }
}
private void PlateCamera_OnOpenVideoStreamFailed(Mat videoFrame) private void PlateCamera_OnOpenVideoStreamFailed(Mat videoFrame)
{ {