Add Enums.cs. PlateDetector Remove enum PlateType. ApiController Remove enums: LaneDirection, ModePlate

This commit is contained in:
DucDangAnh 2020-06-29 09:51:56 +07:00
parent 454251898d
commit f4527e3eac
4 changed files with 17 additions and 20 deletions

View File

@ -80,6 +80,7 @@
<Compile Include="AppConstant.cs" /> <Compile Include="AppConstant.cs" />
<Compile Include="C3DeviceController.cs" /> <Compile Include="C3DeviceController.cs" />
<Compile Include="Camera.cs" /> <Compile Include="Camera.cs" />
<Compile Include="Enums.cs" />
<Compile Include="ILane.cs" /> <Compile Include="ILane.cs" />
<Compile Include="LaneIn.cs"> <Compile Include="LaneIn.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>

View File

@ -12,18 +12,6 @@ namespace AIParkingApplication
private bool isHttpClientDisposabled; private bool isHttpClientDisposabled;
private int numberOfRetry; private int numberOfRetry;
public enum LaneDirection
{
In,
Out
}
public enum ModePlate
{
Sqare,
Long
}
public ApiController(string baseAddress, int numberOfRetry = 5) public ApiController(string baseAddress, int numberOfRetry = 5)
{ {
httpClient = new HttpClient httpClient = new HttpClient
@ -123,7 +111,7 @@ namespace AIParkingApplication
} }
//Neu Dicrection la Out thi logID la logID lay ve khi check the //Neu Dicrection la Out thi logID la logID lay ve khi check the
public async Task<SaveLogRespone> 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<SaveLogRespone> 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 plateImageBase64 = Convert.ToBase64String(plateImage.ToBytes());
string plateImageResultBase64 = Convert.ToBase64String(plateImageResult.ToBytes()); string plateImageResultBase64 = Convert.ToBase64String(plateImageResult.ToBytes());
@ -138,7 +126,7 @@ namespace AIParkingApplication
CardID = cardID, CardID = cardID,
TextPlate = textPlate, TextPlate = textPlate,
CameraID = cameraID, CameraID = cameraID,
ModePlate = (squareOrLong == ModePlate.Sqare) ? "1":"0", ModePlate = (squareOrLong == PlateType.Square) ? "1":"0",
TimeVehicleInOrOut = timeInOrOut, TimeVehicleInOrOut = timeInOrOut,
PlateImage = plateImageBase64, PlateImage = plateImageBase64,
PlateResultImage = plateImageResultBase64, PlateResultImage = plateImageResultBase64,

View File

@ -0,0 +1,14 @@
namespace AIParkingApplication
{
public enum PlateType
{
Square,
Long
}
public enum LaneDirection
{
In,
Out
}
}

View File

@ -81,12 +81,6 @@ namespace AIParkingApplication
} }
} }
public enum PlateType
{
Square,
Long
}
public static class PlateDetectorConstant public static class PlateDetectorConstant
{ {
public const string SQUARE_PLATE_WEIGHT_FILENAME = "plate.xml"; public const string SQUARE_PLATE_WEIGHT_FILENAME = "plate.xml";