From fd96643412edc3033c81f3e7d78d6aa6ff1e33c0 Mon Sep 17 00:00:00 2001 From: DucDangAnh Date: Mon, 20 Jul 2020 14:39:16 +0700 Subject: [PATCH] Add ConfigurationForm. AIParkingApplicationForm - add ConfigurationForm --- .../AIParkingApplication.csproj | 9 + .../AIParkingApplicationForm.Designer.cs | 20 +- .../AIParkingApplicationForm.cs | 6 + .../ConfigurationForm.Designer.cs | 188 ++++++++++++++++++ AIParkingApplication/ConfigurationForm.cs | 18 ++ AIParkingApplication/ConfigurationForm.resx | 120 +++++++++++ 6 files changed, 356 insertions(+), 5 deletions(-) create mode 100644 AIParkingApplication/ConfigurationForm.Designer.cs create mode 100644 AIParkingApplication/ConfigurationForm.cs create mode 100644 AIParkingApplication/ConfigurationForm.resx diff --git a/AIParkingApplication/AIParkingApplication.csproj b/AIParkingApplication/AIParkingApplication.csproj index 14cc15e..bca9e23 100644 --- a/AIParkingApplication/AIParkingApplication.csproj +++ b/AIParkingApplication/AIParkingApplication.csproj @@ -127,6 +127,12 @@ + + Form + + + ConfigurationForm.cs + @@ -177,6 +183,9 @@ AIParkingApplicationForm.cs + + ConfigurationForm.cs + LaneIn.cs diff --git a/AIParkingApplication/AIParkingApplicationForm.Designer.cs b/AIParkingApplication/AIParkingApplicationForm.Designer.cs index e518972..4b840a2 100644 --- a/AIParkingApplication/AIParkingApplicationForm.Designer.cs +++ b/AIParkingApplication/AIParkingApplicationForm.Designer.cs @@ -35,13 +35,15 @@ this.toolStripMenuItemSwitchLaneInOut = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemSwitchLaneOutOut = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemSwitchLaneOutIn = new System.Windows.Forms.ToolStripMenuItem(); + this.setupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip.SuspendLayout(); this.SuspendLayout(); // // menuStrip // this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItemSwitchLane}); + this.toolStripMenuItemSwitchLane, + this.setupToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; this.menuStrip.Size = new System.Drawing.Size(1366, 24); @@ -62,31 +64,38 @@ // toolStripMenuItemSwitchLaneInIn // this.toolStripMenuItemSwitchLaneInIn.Name = "toolStripMenuItemSwitchLaneInIn"; - this.toolStripMenuItemSwitchLaneInIn.Size = new System.Drawing.Size(123, 22); + this.toolStripMenuItemSwitchLaneInIn.Size = new System.Drawing.Size(180, 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(123, 22); + this.toolStripMenuItemSwitchLaneInOut.Size = new System.Drawing.Size(180, 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(123, 22); + this.toolStripMenuItemSwitchLaneOutOut.Size = new System.Drawing.Size(180, 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(123, 22); + this.toolStripMenuItemSwitchLaneOutIn.Size = new System.Drawing.Size(180, 22); this.toolStripMenuItemSwitchLaneOutIn.Text = "Ra - Vào"; this.toolStripMenuItemSwitchLaneOutIn.Click += new System.EventHandler(this.toolStripMenuItemSwitchLaneOutIn_Click); // + // setupToolStripMenuItem + // + this.setupToolStripMenuItem.Name = "setupToolStripMenuItem"; + this.setupToolStripMenuItem.Size = new System.Drawing.Size(56, 20); + this.setupToolStripMenuItem.Text = "Cài đặt"; + this.setupToolStripMenuItem.Click += new System.EventHandler(this.setupToolStripMenuItem_Click); + // // AIParkingApplicationForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -116,6 +125,7 @@ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSwitchLaneInOut; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSwitchLaneOutOut; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSwitchLaneOutIn; + private System.Windows.Forms.ToolStripMenuItem setupToolStripMenuItem; } } diff --git a/AIParkingApplication/AIParkingApplicationForm.cs b/AIParkingApplication/AIParkingApplicationForm.cs index 9842ee7..350d707 100644 --- a/AIParkingApplication/AIParkingApplicationForm.cs +++ b/AIParkingApplication/AIParkingApplicationForm.cs @@ -304,5 +304,11 @@ namespace AIParkingApplication appLogger.Log(LogLevel.Info, $"Đóng ứng dụng"); Application.Exit(); } + + private void setupToolStripMenuItem_Click(object sender, EventArgs e) + { + var configurationForm = new ConfigurationForm(); + configurationForm.ShowDialog(this); + } } } diff --git a/AIParkingApplication/ConfigurationForm.Designer.cs b/AIParkingApplication/ConfigurationForm.Designer.cs new file mode 100644 index 0000000..8cbdbd0 --- /dev/null +++ b/AIParkingApplication/ConfigurationForm.Designer.cs @@ -0,0 +1,188 @@ +namespace AIParkingApplication +{ + partial class ConfigurationForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtDoorDeviceControlAccessIPStatus = new System.Windows.Forms.Label(); + this.btnCheckDoorDeviceControlAccessIP = new System.Windows.Forms.Button(); + this.btnClose = new System.Windows.Forms.Button(); + this.btnSaveSettings = new System.Windows.Forms.Button(); + this.chkAllowChangeROIRect = new System.Windows.Forms.CheckBox(); + this.chkAllowAutoDoorOut = new System.Windows.Forms.CheckBox(); + this.chkAllowAutoDoorIn = new System.Windows.Forms.CheckBox(); + this.lblAllowChangeROIRect = new System.Windows.Forms.Label(); + this.lblAllowAutoOpenDoorIn = new System.Windows.Forms.Label(); + this.txtDoorDeviceControlAccessIP = new System.Windows.Forms.TextBox(); + this.lblDoorDeviceControlAccessIP = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // txtDoorDeviceControlAccessIPStatus + // + this.txtDoorDeviceControlAccessIPStatus.AutoSize = true; + this.txtDoorDeviceControlAccessIPStatus.Location = new System.Drawing.Point(412, 9); + this.txtDoorDeviceControlAccessIPStatus.Name = "txtDoorDeviceControlAccessIPStatus"; + this.txtDoorDeviceControlAccessIPStatus.Size = new System.Drawing.Size(58, 13); + this.txtDoorDeviceControlAccessIPStatus.TabIndex = 17; + this.txtDoorDeviceControlAccessIPStatus.Text = "Trạng thái:"; + // + // btnCheckDoorDeviceControlAccessIP + // + this.btnCheckDoorDeviceControlAccessIP.Location = new System.Drawing.Point(330, 3); + this.btnCheckDoorDeviceControlAccessIP.Name = "btnCheckDoorDeviceControlAccessIP"; + this.btnCheckDoorDeviceControlAccessIP.Size = new System.Drawing.Size(75, 24); + this.btnCheckDoorDeviceControlAccessIP.TabIndex = 2; + this.btnCheckDoorDeviceControlAccessIP.Text = "Kiểm tra"; + this.btnCheckDoorDeviceControlAccessIP.UseVisualStyleBackColor = true; + // + // btnClose + // + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.Location = new System.Drawing.Point(528, 228); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(106, 41); + this.btnClose.TabIndex = 7; + this.btnClose.Text = "Đóng"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // btnSaveSettings + // + this.btnSaveSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnSaveSettings.Location = new System.Drawing.Point(416, 228); + this.btnSaveSettings.Name = "btnSaveSettings"; + this.btnSaveSettings.Size = new System.Drawing.Size(106, 41); + this.btnSaveSettings.TabIndex = 6; + this.btnSaveSettings.Text = "Lưu"; + this.btnSaveSettings.UseVisualStyleBackColor = true; + // + // chkAllowChangeROIRect + // + this.chkAllowChangeROIRect.AutoSize = true; + this.chkAllowChangeROIRect.Location = new System.Drawing.Point(252, 67); + this.chkAllowChangeROIRect.Name = "chkAllowChangeROIRect"; + this.chkAllowChangeROIRect.Size = new System.Drawing.Size(72, 17); + this.chkAllowChangeROIRect.TabIndex = 5; + this.chkAllowChangeROIRect.Text = "Cho phép"; + this.chkAllowChangeROIRect.UseVisualStyleBackColor = true; + // + // chkAllowAutoDoorOut + // + this.chkAllowAutoDoorOut.AutoSize = true; + this.chkAllowAutoDoorOut.Location = new System.Drawing.Point(252, 37); + this.chkAllowAutoDoorOut.Name = "chkAllowAutoDoorOut"; + this.chkAllowAutoDoorOut.Size = new System.Drawing.Size(57, 17); + this.chkAllowAutoDoorOut.TabIndex = 4; + this.chkAllowAutoDoorOut.Text = "Cửa ra"; + this.chkAllowAutoDoorOut.UseVisualStyleBackColor = true; + // + // chkAllowAutoDoorIn + // + this.chkAllowAutoDoorIn.AutoSize = true; + this.chkAllowAutoDoorIn.Location = new System.Drawing.Point(141, 37); + this.chkAllowAutoDoorIn.Name = "chkAllowAutoDoorIn"; + this.chkAllowAutoDoorIn.Size = new System.Drawing.Size(66, 17); + this.chkAllowAutoDoorIn.TabIndex = 3; + this.chkAllowAutoDoorIn.Text = "Cửa vào"; + this.chkAllowAutoDoorIn.UseVisualStyleBackColor = true; + // + // lblAllowChangeROIRect + // + this.lblAllowChangeROIRect.AutoSize = true; + this.lblAllowChangeROIRect.Location = new System.Drawing.Point(11, 68); + this.lblAllowChangeROIRect.Name = "lblAllowChangeROIRect"; + this.lblAllowChangeROIRect.Size = new System.Drawing.Size(211, 13); + this.lblAllowChangeROIRect.TabIndex = 9; + this.lblAllowChangeROIRect.Text = "Cho phép thay đổi vùng nhận diện biển số:"; + // + // lblAllowAutoOpenDoorIn + // + this.lblAllowAutoOpenDoorIn.AutoSize = true; + this.lblAllowAutoOpenDoorIn.Location = new System.Drawing.Point(11, 39); + this.lblAllowAutoOpenDoorIn.Name = "lblAllowAutoOpenDoorIn"; + this.lblAllowAutoOpenDoorIn.Size = new System.Drawing.Size(89, 13); + this.lblAllowAutoOpenDoorIn.TabIndex = 10; + this.lblAllowAutoOpenDoorIn.Text = "Tự động mở cửa:"; + // + // txtDoorDeviceControlAccessIP + // + this.txtDoorDeviceControlAccessIP.Location = new System.Drawing.Point(141, 5); + this.txtDoorDeviceControlAccessIP.Name = "txtDoorDeviceControlAccessIP"; + this.txtDoorDeviceControlAccessIP.Size = new System.Drawing.Size(183, 20); + this.txtDoorDeviceControlAccessIP.TabIndex = 1; + // + // lblDoorDeviceControlAccessIP + // + this.lblDoorDeviceControlAccessIP.AutoSize = true; + this.lblDoorDeviceControlAccessIP.Location = new System.Drawing.Point(12, 9); + this.lblDoorDeviceControlAccessIP.Name = "lblDoorDeviceControlAccessIP"; + this.lblDoorDeviceControlAccessIP.Size = new System.Drawing.Size(96, 13); + this.lblDoorDeviceControlAccessIP.TabIndex = 7; + this.lblDoorDeviceControlAccessIP.Text = "IP Thiết bị mở cửa:"; + // + // ConfigurationForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(646, 281); + this.Controls.Add(this.txtDoorDeviceControlAccessIPStatus); + this.Controls.Add(this.btnCheckDoorDeviceControlAccessIP); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnSaveSettings); + this.Controls.Add(this.chkAllowChangeROIRect); + this.Controls.Add(this.chkAllowAutoDoorOut); + this.Controls.Add(this.chkAllowAutoDoorIn); + this.Controls.Add(this.lblAllowChangeROIRect); + this.Controls.Add(this.lblAllowAutoOpenDoorIn); + this.Controls.Add(this.txtDoorDeviceControlAccessIP); + this.Controls.Add(this.lblDoorDeviceControlAccessIP); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximumSize = new System.Drawing.Size(662, 320); + this.MinimumSize = new System.Drawing.Size(662, 320); + this.Name = "ConfigurationForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Cấu hình ứng dụng"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label txtDoorDeviceControlAccessIPStatus; + private System.Windows.Forms.Button btnCheckDoorDeviceControlAccessIP; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnSaveSettings; + private System.Windows.Forms.CheckBox chkAllowChangeROIRect; + private System.Windows.Forms.CheckBox chkAllowAutoDoorOut; + private System.Windows.Forms.CheckBox chkAllowAutoDoorIn; + private System.Windows.Forms.Label lblAllowChangeROIRect; + private System.Windows.Forms.Label lblAllowAutoOpenDoorIn; + private System.Windows.Forms.TextBox txtDoorDeviceControlAccessIP; + private System.Windows.Forms.Label lblDoorDeviceControlAccessIP; + } +} \ No newline at end of file diff --git a/AIParkingApplication/ConfigurationForm.cs b/AIParkingApplication/ConfigurationForm.cs new file mode 100644 index 0000000..1ae6e0e --- /dev/null +++ b/AIParkingApplication/ConfigurationForm.cs @@ -0,0 +1,18 @@ +using System; +using System.Windows.Forms; + +namespace AIParkingApplication +{ + public partial class ConfigurationForm : Form + { + public ConfigurationForm() + { + InitializeComponent(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/AIParkingApplication/ConfigurationForm.resx b/AIParkingApplication/ConfigurationForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/AIParkingApplication/ConfigurationForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file