AIParkingApplicationForm - Fix bug: ReadAccessControlDeviceIPConfiguration

This commit is contained in:
DucDangAnh 2020-07-13 10:34:27 +07:00
parent 5c13a5c5e0
commit 2c559d26b9
2 changed files with 18 additions and 8 deletions

View File

@ -62,28 +62,28 @@
// toolStripMenuItemSwitchLaneInIn
//
this.toolStripMenuItemSwitchLaneInIn.Name = "toolStripMenuItemSwitchLaneInIn";
this.toolStripMenuItemSwitchLaneInIn.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItemSwitchLaneInIn.Size = new System.Drawing.Size(123, 22);
this.toolStripMenuItemSwitchLaneInIn.Text = "Vào - Vào";
this.toolStripMenuItemSwitchLaneInIn.Click += new System.EventHandler(this.toolStripMenuItemSwitchLaneInIn_Click);
//
// toolStripMenuItemSwitchLaneInOut
//
this.toolStripMenuItemSwitchLaneInOut.Name = "toolStripMenuItemSwitchLaneInOut";
this.toolStripMenuItemSwitchLaneInOut.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItemSwitchLaneInOut.Size = new System.Drawing.Size(123, 22);
this.toolStripMenuItemSwitchLaneInOut.Text = "Vào - Ra";
this.toolStripMenuItemSwitchLaneInOut.Click += new System.EventHandler(this.toolStripMenuItemSwitchLaneInOut_Click);
//
// toolStripMenuItemSwitchLaneOutOut
//
this.toolStripMenuItemSwitchLaneOutOut.Name = "toolStripMenuItemSwitchLaneOutOut";
this.toolStripMenuItemSwitchLaneOutOut.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItemSwitchLaneOutOut.Size = new System.Drawing.Size(123, 22);
this.toolStripMenuItemSwitchLaneOutOut.Text = "Ra - Ra";
this.toolStripMenuItemSwitchLaneOutOut.Click += new System.EventHandler(this.toolStripMenuItemSwitchLaneOutOut_Click);
//
// toolStripMenuItemSwitchLaneOutIn
//
this.toolStripMenuItemSwitchLaneOutIn.Name = "toolStripMenuItemSwitchLaneOutIn";
this.toolStripMenuItemSwitchLaneOutIn.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItemSwitchLaneOutIn.Size = new System.Drawing.Size(123, 22);
this.toolStripMenuItemSwitchLaneOutIn.Text = "Ra - Vào";
this.toolStripMenuItemSwitchLaneOutIn.Click += new System.EventHandler(this.toolStripMenuItemSwitchLaneOutIn_Click);
//
@ -100,6 +100,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "AIParking - Phần mềm quản lý bãi đỗ xe";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AIParkingApplicationForm_FormClosing);
this.Load += new System.EventHandler(this.AIParkingApplicationForm_Load);
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();
this.ResumeLayout(false);

View File

@ -27,7 +27,13 @@ namespace AIParkingApplication
this.configOnWeb = configOnWeb;
ReadAccessControlDeviceIPConfiguration();
if (string.IsNullOrEmpty(doorAccessControlDeviceIP))
{
MessageBox.Show("Kiểm tra lại cấu hình IP thiết bị mở cửa! (C3200)", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
c3Device = new C3DeviceController(doorAccessControlDeviceIP);
sidebar = new Sidebar(apiController)
{
Location = new Point(0, 0)
@ -51,7 +57,7 @@ namespace AIParkingApplication
return;
}
InitAllLanes();
}
private void InitAllLanes()
@ -200,10 +206,8 @@ namespace AIParkingApplication
}
catch (Exception ex)
{
MessageBox.Show("Kiểm tra lại cấu hình IP thiết bị mở cửa! (C3200)");
Console.WriteLine($"{DateTime.Now.GetTimeFormatted()}\tReadAccessControlDeviceIPConfiguration\t{ex.Message}");
Application.Exit();
return;
doorAccessControlDeviceIP = string.Empty;
}
}
@ -211,5 +215,10 @@ namespace AIParkingApplication
{
Application.Exit();
}
private void AIParkingApplicationForm_Load(object sender, EventArgs e)
{
InitAllLanes();
}
}
}