From f4527e3eac1011fd944c91a747b6abf751b39c72 Mon Sep 17 00:00:00 2001 From: DucDangAnh Date: Mon, 29 Jun 2020 09:51:56 +0700 Subject: [PATCH] Add Enums.cs. PlateDetector Remove enum PlateType. ApiController Remove enums: LaneDirection, ModePlate --- AIParkingApplication/AIParkingApplication.csproj | 1 + AIParkingApplication/ApiController.cs | 16 ++-------------- AIParkingApplication/Enums.cs | 14 ++++++++++++++ AIParkingApplication/PlateDetector.cs | 6 ------ 4 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 AIParkingApplication/Enums.cs diff --git a/AIParkingApplication/AIParkingApplication.csproj b/AIParkingApplication/AIParkingApplication.csproj index b892ded..6ae5a10 100644 --- a/AIParkingApplication/AIParkingApplication.csproj +++ b/AIParkingApplication/AIParkingApplication.csproj @@ -80,6 +80,7 @@ + UserControl diff --git a/AIParkingApplication/ApiController.cs b/AIParkingApplication/ApiController.cs index 8a047c6..4cd738d 100644 --- a/AIParkingApplication/ApiController.cs +++ b/AIParkingApplication/ApiController.cs @@ -12,18 +12,6 @@ namespace AIParkingApplication private bool isHttpClientDisposabled; private int numberOfRetry; - public enum LaneDirection - { - In, - Out - } - - public enum ModePlate - { - Sqare, - Long - } - public ApiController(string baseAddress, int numberOfRetry = 5) { httpClient = new HttpClient @@ -123,7 +111,7 @@ namespace AIParkingApplication } //Neu Dicrection la Out thi logID la logID lay ve khi check the - public async Task SaveLog(LaneDirection direction, string cardID, string cameraID, ModePlate squareOrLong, string timeInOrOut, string textPlate, Mat plateImage, Mat plateImageResult, Mat PlateFrameImage, Mat FrameImage, string logID = "") + public async Task SaveLog(LaneDirection direction, string cardID, string cameraID, PlateType squareOrLong, string timeInOrOut, string textPlate, Mat plateImage, Mat plateImageResult, Mat PlateFrameImage, Mat FrameImage, string logID = "") { string plateImageBase64 = Convert.ToBase64String(plateImage.ToBytes()); string plateImageResultBase64 = Convert.ToBase64String(plateImageResult.ToBytes()); @@ -138,7 +126,7 @@ namespace AIParkingApplication CardID = cardID, TextPlate = textPlate, CameraID = cameraID, - ModePlate = (squareOrLong == ModePlate.Sqare) ? "1":"0", + ModePlate = (squareOrLong == PlateType.Square) ? "1":"0", TimeVehicleInOrOut = timeInOrOut, PlateImage = plateImageBase64, PlateResultImage = plateImageResultBase64, diff --git a/AIParkingApplication/Enums.cs b/AIParkingApplication/Enums.cs new file mode 100644 index 0000000..fd625e6 --- /dev/null +++ b/AIParkingApplication/Enums.cs @@ -0,0 +1,14 @@ +namespace AIParkingApplication +{ + public enum PlateType + { + Square, + Long + } + + public enum LaneDirection + { + In, + Out + } +} diff --git a/AIParkingApplication/PlateDetector.cs b/AIParkingApplication/PlateDetector.cs index b779581..0d5e4f2 100644 --- a/AIParkingApplication/PlateDetector.cs +++ b/AIParkingApplication/PlateDetector.cs @@ -81,12 +81,6 @@ namespace AIParkingApplication } } - public enum PlateType - { - Square, - Long - } - public static class PlateDetectorConstant { public const string SQUARE_PLATE_WEIGHT_FILENAME = "plate.xml";