Compare commits

..

No commits in common. "d9c7da60b52b608ba20c2c50d1f4134266ac61c0" and "7f61711e61f880f9debe990b3b8ebb886446f6a8" have entirely different histories.

5 changed files with 26 additions and 15 deletions

View File

@ -36,12 +36,12 @@ namespace AIParkingApplication
MessageBox.Show("Cấu hình API Plate Recognize lỗi!", "Cấu hình API Engine lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
laneIn = new LaneIn(1, this.configOnWeb.CameraData1.Id.ToString(), this.configOnWeb.CameraData1.StreamUrl, this.configOnWeb.CameraData2.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneIn = new LaneIn(1, this.configOnWeb.CameraData1.StreamUrl, this.configOnWeb.CameraData2.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneIn.BorderStyle = BorderStyle.FixedSingle;
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, menuStrip.Height);
Controls.Add(laneIn);
laneOut = new LaneOut(2, this.configOnWeb.CameraData3.Id.ToString(), this.configOnWeb.CameraData3.StreamUrl, this.configOnWeb.CameraData4.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneOut = new LaneOut(2, this.configOnWeb.CameraData3.StreamUrl, this.configOnWeb.CameraData4.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneOut.BorderStyle = BorderStyle.FixedSingle;
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, menuStrip.Height);
Controls.Add(laneOut);
@ -62,6 +62,25 @@ namespace AIParkingApplication
private void toolStripMenuItemSwitchLaneInIn_Click(object sender, EventArgs e)
{
laneIn.Stop();
laneOut.Stop();
laneIn.Hide();
laneOut.Hide();
LaneIn laneIn1, laneIn2;
laneIn1 = new LaneIn(1, this.configOnWeb.CameraData1.StreamUrl, this.configOnWeb.CameraData2.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneIn1.BorderStyle = BorderStyle.FixedSingle;
laneIn1.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, menuStrip.Height);
Controls.Add(laneIn1);
laneIn2 = new LaneIn(2, this.configOnWeb.CameraData1.StreamUrl, this.configOnWeb.CameraData2.StreamUrl, c3Device, this.apiController, engineApiController, true, false, true);
laneIn2.BorderStyle = BorderStyle.FixedSingle;
laneIn2.Location = new System.Drawing.Point(laneIn1.Location.X + laneIn1.Width + 20, menuStrip.Height);
Controls.Add(laneIn2);
laneIn1.Start();
laneIn2.Start();
this.MinimumSize = new System.Drawing.Size(500, 768);
this.Width = 500;
}
private void AIParkingApplicationForm_FormClosing(object sender, FormClosingEventArgs e)

View File

@ -4,7 +4,5 @@
{
void Start();
void Stop();
void Hide();
void Show();
}
}

View File

@ -14,7 +14,6 @@ namespace AIParkingApplication
private Camera plateCamera;
private PlateProcessor plateProcessor;
private int doorId;
private string cameraId;
private bool isSupportSquarePlate;
private bool isSupportLongPlate;
private bool isAutoOpenDoor;
@ -23,7 +22,6 @@ namespace AIParkingApplication
private ApiController apiController;
public LaneIn(int doorId,
string cameraId,
string plateStream,
string overviewStream,
IDoorControlAccess doorControlAccess,
@ -36,7 +34,6 @@ namespace AIParkingApplication
{
InitializeComponent();
this.doorId = doorId;
this.cameraId = cameraId;
this.isSupportSquarePlate = isSupportSquarePlate;
this.isSupportLongPlate = isSupportLongPlate;
this.isAutoOpenDoor = isAutoOpenDoor;
@ -81,7 +78,7 @@ namespace AIParkingApplication
var cardInformation = await apiController.GetCardInformation(cardNumber);
var saveLogResult = await apiController.SaveLog(LaneDirection.In, cardInformation.CardRealID.ToString(), cameraId, result.PlateType, DateTime.Now.GetTimeFormatted(), result.PlateString, result.PlateImage, result.PlateImage, result.PlateImage, overviewVideoFrame);
var saveLogResult = await apiController.SaveLog(LaneDirection.In, cardInformation.CardRealID.ToString(), "1", result.PlateType, DateTime.Now.GetTimeFormatted(), result.PlateString, result.PlateImage, result.PlateImage, result.PlateImage, overviewVideoFrame);
ShowCardInfoOnUI(cardNumber, result.PlateString, cardInformation.CardType, DateTime.Now.GetTimeFormatted());

View File

@ -14,7 +14,6 @@ namespace AIParkingApplication
private Camera plateCamera;
private PlateProcessor plateProcessor;
private int doorId;
private string cameraId;
private bool isSupportSquarePlate;
private bool isSupportLongPlate;
private bool isAutoOpenDoor;
@ -24,7 +23,6 @@ namespace AIParkingApplication
private Printer printer;
public LaneOut(int doorId,
string cameraId,
string plateStream,
string overviewStream,
IDoorControlAccess doorControlAccess,
@ -37,7 +35,6 @@ namespace AIParkingApplication
{
InitializeComponent();
this.doorId = doorId;
this.cameraId = cameraId;
this.isSupportSquarePlate = isSupportSquarePlate;
this.isSupportLongPlate = isSupportLongPlate;
this.isAutoOpenDoor = isAutoOpenDoor;
@ -90,7 +87,7 @@ namespace AIParkingApplication
var cardInformation = await apiController.GetCardInformation(cardNumber);
var saveLogResult = await apiController.SaveLog(LaneDirection.Out, cardInformation.CardRealID.ToString(), cameraId, result.PlateType, DateTime.Now.GetTimeFormatted(), result.PlateString, result.PlateImage, result.PlateImage, result.PlateImage, overviewVideoFrame, cardInformation.LogID.ToString());
var saveLogResult = await apiController.SaveLog(LaneDirection.Out, cardInformation.CardRealID.ToString(), "1", result.PlateType, DateTime.Now.GetTimeFormatted(), result.PlateString, result.PlateImage, result.PlateImage, result.PlateImage, overviewVideoFrame, cardInformation.LogID.ToString());
ShowCardInfoOnUI(cardNumber, result.PlateString, cardInformation.PlateString, cardInformation.CardType, cardInformation.TimeIn, DateTime.Now.GetTimeFormatted(), saveLogResult.Cost);

View File

@ -18,7 +18,7 @@ namespace AIParkingApplication
}
txtUsername.Focus();
lblLoginStatus.Text = string.Empty;
AcceptButton = btnLogin;
this.AcceptButton = btnLogin;
}
private async void Login()
@ -77,12 +77,12 @@ namespace AIParkingApplication
}
}
private void btnLogin_Click(object sender, EventArgs e)
private void btnLogin_Click(object sender, System.EventArgs e)
{
Login();
}
private void btnExit_Click(object sender, EventArgs e)
private void btnExit_Click(object sender, System.EventArgs e)
{
if (DialogResult.OK == MessageBox.Show("AIParking - Bạn muốn thoát ứng dụng?", "Cảnh báo!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
{