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); MessageBox.Show("Cấu hình API Plate Recognize lỗi!", "Cấu hình API Engine lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; 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.BorderStyle = BorderStyle.FixedSingle;
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, menuStrip.Height); laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, menuStrip.Height);
Controls.Add(laneIn); 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.BorderStyle = BorderStyle.FixedSingle;
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, menuStrip.Height); laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, menuStrip.Height);
Controls.Add(laneOut); Controls.Add(laneOut);
@ -62,6 +62,25 @@ namespace AIParkingApplication
private void toolStripMenuItemSwitchLaneInIn_Click(object sender, EventArgs e) 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) private void AIParkingApplicationForm_FormClosing(object sender, FormClosingEventArgs e)

View File

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

View File

@ -14,7 +14,6 @@ namespace AIParkingApplication
private Camera plateCamera; private Camera plateCamera;
private PlateProcessor plateProcessor; private PlateProcessor plateProcessor;
private int doorId; private int doorId;
private string cameraId;
private bool isSupportSquarePlate; private bool isSupportSquarePlate;
private bool isSupportLongPlate; private bool isSupportLongPlate;
private bool isAutoOpenDoor; private bool isAutoOpenDoor;
@ -23,7 +22,6 @@ namespace AIParkingApplication
private ApiController apiController; private ApiController apiController;
public LaneIn(int doorId, public LaneIn(int doorId,
string cameraId,
string plateStream, string plateStream,
string overviewStream, string overviewStream,
IDoorControlAccess doorControlAccess, IDoorControlAccess doorControlAccess,
@ -36,7 +34,6 @@ namespace AIParkingApplication
{ {
InitializeComponent(); InitializeComponent();
this.doorId = doorId; this.doorId = doorId;
this.cameraId = cameraId;
this.isSupportSquarePlate = isSupportSquarePlate; this.isSupportSquarePlate = isSupportSquarePlate;
this.isSupportLongPlate = isSupportLongPlate; this.isSupportLongPlate = isSupportLongPlate;
this.isAutoOpenDoor = isAutoOpenDoor; this.isAutoOpenDoor = isAutoOpenDoor;
@ -81,7 +78,7 @@ namespace AIParkingApplication
var cardInformation = await apiController.GetCardInformation(cardNumber); 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()); ShowCardInfoOnUI(cardNumber, result.PlateString, cardInformation.CardType, DateTime.Now.GetTimeFormatted());

View File

@ -14,7 +14,6 @@ namespace AIParkingApplication
private Camera plateCamera; private Camera plateCamera;
private PlateProcessor plateProcessor; private PlateProcessor plateProcessor;
private int doorId; private int doorId;
private string cameraId;
private bool isSupportSquarePlate; private bool isSupportSquarePlate;
private bool isSupportLongPlate; private bool isSupportLongPlate;
private bool isAutoOpenDoor; private bool isAutoOpenDoor;
@ -24,7 +23,6 @@ namespace AIParkingApplication
private Printer printer; private Printer printer;
public LaneOut(int doorId, public LaneOut(int doorId,
string cameraId,
string plateStream, string plateStream,
string overviewStream, string overviewStream,
IDoorControlAccess doorControlAccess, IDoorControlAccess doorControlAccess,
@ -37,7 +35,6 @@ namespace AIParkingApplication
{ {
InitializeComponent(); InitializeComponent();
this.doorId = doorId; this.doorId = doorId;
this.cameraId = cameraId;
this.isSupportSquarePlate = isSupportSquarePlate; this.isSupportSquarePlate = isSupportSquarePlate;
this.isSupportLongPlate = isSupportLongPlate; this.isSupportLongPlate = isSupportLongPlate;
this.isAutoOpenDoor = isAutoOpenDoor; this.isAutoOpenDoor = isAutoOpenDoor;
@ -90,7 +87,7 @@ namespace AIParkingApplication
var cardInformation = await apiController.GetCardInformation(cardNumber); 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); 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(); txtUsername.Focus();
lblLoginStatus.Text = string.Empty; lblLoginStatus.Text = string.Empty;
AcceptButton = btnLogin; this.AcceptButton = btnLogin;
} }
private async void Login() 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(); 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)) if (DialogResult.OK == MessageBox.Show("AIParking - Bạn muốn thoát ứng dụng?", "Cảnh báo!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
{ {