Add ConfigurationForm. AIParkingApplicationForm - add ConfigurationForm

This commit is contained in:
DucDangAnh 2020-07-20 14:39:16 +07:00
parent 1418b1077e
commit fd96643412
6 changed files with 356 additions and 5 deletions

View File

@ -127,6 +127,12 @@
<Compile Include="AppConstant.cs" />
<Compile Include="C3DeviceController.cs" />
<Compile Include="Camera.cs" />
<Compile Include="ConfigurationForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ConfigurationForm.Designer.cs">
<DependentUpon>ConfigurationForm.cs</DependentUpon>
</Compile>
<Compile Include="EngineApiController.cs" />
<Compile Include="Enums.cs" />
<Compile Include="ExtensitionMethods.cs" />
@ -177,6 +183,9 @@
<EmbeddedResource Include="AIParkingApplicationForm.resx">
<DependentUpon>AIParkingApplicationForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ConfigurationForm.resx">
<DependentUpon>ConfigurationForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LaneIn.resx">
<DependentUpon>LaneIn.cs</DependentUpon>
</EmbeddedResource>

View File

@ -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;
}
}

View File

@ -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);
}
}
}

View File

@ -0,0 +1,188 @@
namespace AIParkingApplication
{
partial class ConfigurationForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>