Compare commits

..

4 Commits

12 changed files with 262 additions and 124 deletions

View File

@ -8,13 +8,19 @@ EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|Any CPU.Build.0 = Debug|Any CPU {AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|x64.ActiveCfg = Debug|x64
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Debug|x64.Build.0 = Debug|x64
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|Any CPU.ActiveCfg = Release|Any CPU {AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|Any CPU.Build.0 = Release|Any CPU {AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|Any CPU.Build.0 = Release|Any CPU
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|x64.ActiveCfg = Release|x64
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -36,6 +36,28 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -137,6 +159,9 @@
<EmbeddedResource Include="StatusBar.resx"> <EmbeddedResource Include="StatusBar.resx">
<DependentUpon>StatusBar.cs</DependentUpon> <DependentUpon>StatusBar.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="engine.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>

View File

@ -57,6 +57,7 @@ namespace AIParkingApplication
Mat videoFrame = new Mat(); Mat videoFrame = new Mat();
while (true) while (true)
{ {
//Thread.Sleep(5);
Thread.Sleep(50); //Stream Thread Sleep Thread.Sleep(50); //Stream Thread Sleep
//Thread.Sleep(40); //Video Thread Sleep //Thread.Sleep(40); //Video Thread Sleep

View File

@ -52,6 +52,7 @@
// //
// pictureBoxPlateImage // pictureBoxPlateImage
// //
this.pictureBoxPlateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23); this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23);
this.pictureBoxPlateImage.Name = "pictureBoxPlateImage"; this.pictureBoxPlateImage.Name = "pictureBoxPlateImage";
this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200); this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200);
@ -61,6 +62,7 @@
// //
// pictureBoxPlateVideo // pictureBoxPlateVideo
// //
this.pictureBoxPlateVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23); this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23);
this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo"; this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo";
this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200); this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200);
@ -83,6 +85,7 @@
// //
// pictureBoxOverviewImage // pictureBoxOverviewImage
// //
this.pictureBoxOverviewImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24); this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24);
this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage"; this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage";
this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200); this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200);
@ -92,6 +95,7 @@
// //
// pictureBoxOverviewVideo // pictureBoxOverviewVideo
// //
this.pictureBoxOverviewVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24); this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24);
this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo"; this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo";
this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200); this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200);

View File

@ -33,6 +33,7 @@
this.pictureBoxPlateImageIn = new System.Windows.Forms.PictureBox(); this.pictureBoxPlateImageIn = new System.Windows.Forms.PictureBox();
this.grbCardInformation = new System.Windows.Forms.GroupBox(); this.grbCardInformation = new System.Windows.Forms.GroupBox();
this.lblCardType = new System.Windows.Forms.Label(); this.lblCardType = new System.Windows.Forms.Label();
this.lblCardTimeOut = new System.Windows.Forms.Label();
this.lblCardTime = new System.Windows.Forms.Label(); this.lblCardTime = new System.Windows.Forms.Label();
this.lblMoneyAmount = new System.Windows.Forms.Label(); this.lblMoneyAmount = new System.Windows.Forms.Label();
this.lblPlateString = new System.Windows.Forms.Label(); this.lblPlateString = new System.Windows.Forms.Label();
@ -45,7 +46,6 @@
this.grbOverviewCamera = new System.Windows.Forms.GroupBox(); this.grbOverviewCamera = new System.Windows.Forms.GroupBox();
this.lblLaneLabel = new System.Windows.Forms.Label(); this.lblLaneLabel = new System.Windows.Forms.Label();
this.lblStatusInfo = new System.Windows.Forms.Label(); this.lblStatusInfo = new System.Windows.Forms.Label();
this.lblCardTimeOut = new System.Windows.Forms.Label();
this.grbPlateRefernce.SuspendLayout(); this.grbPlateRefernce.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxOverviewImageIn)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxOverviewImageIn)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImageIn)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImageIn)).BeginInit();
@ -73,6 +73,7 @@
// pictureBoxOverviewImageIn // pictureBoxOverviewImageIn
// //
this.pictureBoxOverviewImageIn.Anchor = System.Windows.Forms.AnchorStyles.Left; this.pictureBoxOverviewImageIn.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.pictureBoxOverviewImageIn.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxOverviewImageIn.Location = new System.Drawing.Point(13, 270); this.pictureBoxOverviewImageIn.Location = new System.Drawing.Point(13, 270);
this.pictureBoxOverviewImageIn.Name = "pictureBoxOverviewImageIn"; this.pictureBoxOverviewImageIn.Name = "pictureBoxOverviewImageIn";
this.pictureBoxOverviewImageIn.Size = new System.Drawing.Size(200, 200); this.pictureBoxOverviewImageIn.Size = new System.Drawing.Size(200, 200);
@ -83,6 +84,7 @@
// pictureBoxPlateImageIn // pictureBoxPlateImageIn
// //
this.pictureBoxPlateImageIn.Anchor = System.Windows.Forms.AnchorStyles.Left; this.pictureBoxPlateImageIn.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.pictureBoxPlateImageIn.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxPlateImageIn.Location = new System.Drawing.Point(13, 23); this.pictureBoxPlateImageIn.Location = new System.Drawing.Point(13, 23);
this.pictureBoxPlateImageIn.Name = "pictureBoxPlateImageIn"; this.pictureBoxPlateImageIn.Name = "pictureBoxPlateImageIn";
this.pictureBoxPlateImageIn.Size = new System.Drawing.Size(200, 200); this.pictureBoxPlateImageIn.Size = new System.Drawing.Size(200, 200);
@ -116,6 +118,15 @@
this.lblCardType.TabIndex = 0; this.lblCardType.TabIndex = 0;
this.lblCardType.Text = "Loại thẻ:"; this.lblCardType.Text = "Loại thẻ:";
// //
// lblCardTimeOut
//
this.lblCardTimeOut.AutoSize = true;
this.lblCardTimeOut.Location = new System.Drawing.Point(462, 64);
this.lblCardTimeOut.Name = "lblCardTimeOut";
this.lblCardTimeOut.Size = new System.Drawing.Size(31, 18);
this.lblCardTimeOut.TabIndex = 0;
this.lblCardTimeOut.Text = "Ra:";
//
// lblCardTime // lblCardTime
// //
this.lblCardTime.AutoSize = true; this.lblCardTime.AutoSize = true;
@ -154,6 +165,7 @@
// //
// pictureBoxPlateImage // pictureBoxPlateImage
// //
this.pictureBoxPlateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23); this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23);
this.pictureBoxPlateImage.Name = "pictureBoxPlateImage"; this.pictureBoxPlateImage.Name = "pictureBoxPlateImage";
this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200); this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200);
@ -163,6 +175,7 @@
// //
// pictureBoxPlateVideo // pictureBoxPlateVideo
// //
this.pictureBoxPlateVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23); this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23);
this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo"; this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo";
this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200); this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200);
@ -185,6 +198,7 @@
// //
// pictureBoxOverviewImage // pictureBoxOverviewImage
// //
this.pictureBoxOverviewImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24); this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24);
this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage"; this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage";
this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200); this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200);
@ -194,6 +208,7 @@
// //
// pictureBoxOverviewVideo // pictureBoxOverviewVideo
// //
this.pictureBoxOverviewVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24); this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24);
this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo"; this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo";
this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200); this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200);
@ -240,15 +255,6 @@
this.lblStatusInfo.Text = "XIN CHÀO"; this.lblStatusInfo.Text = "XIN CHÀO";
this.lblStatusInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblStatusInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblCardTimeOut
//
this.lblCardTimeOut.AutoSize = true;
this.lblCardTimeOut.Location = new System.Drawing.Point(462, 64);
this.lblCardTimeOut.Name = "lblCardTimeOut";
this.lblCardTimeOut.Size = new System.Drawing.Size(31, 18);
this.lblCardTimeOut.TabIndex = 0;
this.lblCardTimeOut.Text = "Ra:";
//
// LaneOut // LaneOut
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -126,12 +126,6 @@
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="pictureBoxOverviewImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="grbCardInformation.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="grbCardInformation.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>

View File

@ -34,12 +34,19 @@
this.lblVehicleTotalOut = new System.Windows.Forms.Label(); this.lblVehicleTotalOut = new System.Windows.Forms.Label();
this.lblVehicleTotalIn = new System.Windows.Forms.Label(); this.lblVehicleTotalIn = new System.Windows.Forms.Label();
this.tlpStatisticTable = new System.Windows.Forms.TableLayoutPanel(); this.tlpStatisticTable = new System.Windows.Forms.TableLayoutPanel();
this.lblLoaiXe = new System.Windows.Forms.Label();
this.lblSoLuong = new System.Windows.Forms.Label();
this.lblXeMay = new System.Windows.Forms.Label();
this.lblSoLuongXeMay = new System.Windows.Forms.Label();
this.lblOto = new System.Windows.Forms.Label();
this.lblSoLuongOto = new System.Windows.Forms.Label();
this.grbLoginInfo = new System.Windows.Forms.GroupBox(); this.grbLoginInfo = new System.Windows.Forms.GroupBox();
this.lblAuthorization = new System.Windows.Forms.Label(); this.lblAuthorization = new System.Windows.Forms.Label();
this.lblUsername = new System.Windows.Forms.Label(); this.lblUsername = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.grbVehicleStatistics.SuspendLayout(); this.grbVehicleStatistics.SuspendLayout();
this.tlpStatisticTable.SuspendLayout();
this.grbLoginInfo.SuspendLayout(); this.grbLoginInfo.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -106,9 +113,16 @@
// //
this.tlpStatisticTable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.tlpStatisticTable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.tlpStatisticTable.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tlpStatisticTable.ColumnCount = 2; this.tlpStatisticTable.ColumnCount = 2;
this.tlpStatisticTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tlpStatisticTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tlpStatisticTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tlpStatisticTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tlpStatisticTable.Controls.Add(this.lblLoaiXe, 0, 0);
this.tlpStatisticTable.Controls.Add(this.lblSoLuong, 1, 0);
this.tlpStatisticTable.Controls.Add(this.lblXeMay, 0, 1);
this.tlpStatisticTable.Controls.Add(this.lblSoLuongXeMay, 1, 1);
this.tlpStatisticTable.Controls.Add(this.lblOto, 0, 2);
this.tlpStatisticTable.Controls.Add(this.lblSoLuongOto, 1, 2);
this.tlpStatisticTable.Location = new System.Drawing.Point(6, 22); this.tlpStatisticTable.Location = new System.Drawing.Point(6, 22);
this.tlpStatisticTable.Name = "tlpStatisticTable"; this.tlpStatisticTable.Name = "tlpStatisticTable";
this.tlpStatisticTable.RowCount = 3; this.tlpStatisticTable.RowCount = 3;
@ -118,6 +132,66 @@
this.tlpStatisticTable.Size = new System.Drawing.Size(180, 100); this.tlpStatisticTable.Size = new System.Drawing.Size(180, 100);
this.tlpStatisticTable.TabIndex = 0; this.tlpStatisticTable.TabIndex = 0;
// //
// lblLoaiXe
//
this.lblLoaiXe.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblLoaiXe.AutoSize = true;
this.lblLoaiXe.Location = new System.Drawing.Point(17, 8);
this.lblLoaiXe.Name = "lblLoaiXe";
this.lblLoaiXe.Size = new System.Drawing.Size(55, 18);
this.lblLoaiXe.TabIndex = 0;
this.lblLoaiXe.Text = "Loại xe";
//
// lblSoLuong
//
this.lblSoLuong.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblSoLuong.AutoSize = true;
this.lblSoLuong.Location = new System.Drawing.Point(101, 8);
this.lblSoLuong.Name = "lblSoLuong";
this.lblSoLuong.Size = new System.Drawing.Size(67, 18);
this.lblSoLuong.TabIndex = 0;
this.lblSoLuong.Text = "Số lượng";
//
// lblXeMay
//
this.lblXeMay.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblXeMay.AutoSize = true;
this.lblXeMay.Location = new System.Drawing.Point(16, 41);
this.lblXeMay.Name = "lblXeMay";
this.lblXeMay.Size = new System.Drawing.Size(58, 18);
this.lblXeMay.TabIndex = 0;
this.lblXeMay.Text = "Xe máy";
//
// lblSoLuongXeMay
//
this.lblSoLuongXeMay.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblSoLuongXeMay.AutoSize = true;
this.lblSoLuongXeMay.Location = new System.Drawing.Point(126, 41);
this.lblSoLuongXeMay.Name = "lblSoLuongXeMay";
this.lblSoLuongXeMay.Size = new System.Drawing.Size(16, 18);
this.lblSoLuongXeMay.TabIndex = 0;
this.lblSoLuongXeMay.Text = "0";
//
// lblOto
//
this.lblOto.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblOto.AutoSize = true;
this.lblOto.Location = new System.Drawing.Point(28, 74);
this.lblOto.Name = "lblOto";
this.lblOto.Size = new System.Drawing.Size(33, 18);
this.lblOto.TabIndex = 0;
this.lblOto.Text = "Ôtô";
//
// lblSoLuongOto
//
this.lblSoLuongOto.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lblSoLuongOto.AutoSize = true;
this.lblSoLuongOto.Location = new System.Drawing.Point(126, 74);
this.lblSoLuongOto.Name = "lblSoLuongOto";
this.lblSoLuongOto.Size = new System.Drawing.Size(16, 18);
this.lblSoLuongOto.TabIndex = 0;
this.lblSoLuongOto.Text = "0";
//
// grbLoginInfo // grbLoginInfo
// //
this.grbLoginInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.grbLoginInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -182,8 +256,9 @@
this.Controls.Add(this.grbVehicleStatistics); this.Controls.Add(this.grbVehicleStatistics);
this.Name = "Statistic"; this.Name = "Statistic";
this.Size = new System.Drawing.Size(193, 292); this.Size = new System.Drawing.Size(193, 292);
this.Load += new System.EventHandler(this.Statistic_Load);
this.grbVehicleStatistics.ResumeLayout(false); this.grbVehicleStatistics.ResumeLayout(false);
this.tlpStatisticTable.ResumeLayout(false);
this.tlpStatisticTable.PerformLayout();
this.grbLoginInfo.ResumeLayout(false); this.grbLoginInfo.ResumeLayout(false);
this.grbLoginInfo.PerformLayout(); this.grbLoginInfo.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -203,5 +278,11 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblVehicleTotalOut; private System.Windows.Forms.Label lblVehicleTotalOut;
private System.Windows.Forms.Label lblVehicleTotalIn; private System.Windows.Forms.Label lblVehicleTotalIn;
private System.Windows.Forms.Label lblLoaiXe;
private System.Windows.Forms.Label lblSoLuong;
private System.Windows.Forms.Label lblXeMay;
private System.Windows.Forms.Label lblSoLuongXeMay;
private System.Windows.Forms.Label lblOto;
private System.Windows.Forms.Label lblSoLuongOto;
} }
} }

View File

@ -7,80 +7,38 @@ namespace AIParkingApplication
{ {
public partial class Statistic : UserControl public partial class Statistic : UserControl
{ {
private readonly Thread thrStatistics; private readonly Thread statisticsThread;
private readonly TimeSpan updateInterval; private readonly TimeSpan updateInterval;
private ParkInfo parkInfo;
private ApiController apiController; private ApiController apiController;
private Label lblLoaiXe;
private Label lblXeMay;
private Label lblOto;
private Label lblSoLuong;
private Label lblSoLuongXeMay;
private Label lblSoLuongOto;
public Statistic(ApiController apiController, TimeSpan updateInterval) public Statistic(ApiController apiController, TimeSpan updateInterval)
{ {
InitializeComponent(); InitializeComponent();
this.apiController = apiController; this.apiController = apiController;
this.updateInterval = updateInterval; this.updateInterval = updateInterval;
thrStatistics = new Thread(new ThreadStart(GetStatistic)) { IsBackground = true }; statisticsThread = new Thread(new ThreadStart(GetStatistic)) { IsBackground = true };
thrStatistics.Start(); statisticsThread.Start();
} }
private void GetStatistic() private void GetStatistic()
{ {
while (true) while (true)
{ {
GetDataFromServer(); GetDataUpdate();
ShowInfo();
Thread.Sleep(updateInterval); Thread.Sleep(updateInterval);
} }
} }
async void GetDataFromServer() private async void GetDataUpdate()
{ {
parkInfo = await apiController.GetStatisticInfo(); ParkInfo parkInfo = await apiController.GetStatisticInfo();
} if (parkInfo != null)
private void ShowInfo()
{ {
if (parkInfo == null)
{
return;
}
lblSoLuongXeMay.UpdateLabel(parkInfo.NumberOfMoto.ToString()); lblSoLuongXeMay.UpdateLabel(parkInfo.NumberOfMoto.ToString());
lblSoLuongOto.UpdateLabel(parkInfo.NumberOfCar.ToString()); lblSoLuongOto.UpdateLabel(parkInfo.NumberOfCar.ToString());
lblVehicleTotalIn.UpdateLabel(parkInfo.TotalIn); lblVehicleTotalIn.UpdateLabel(parkInfo.TotalIn);
lblVehicleTotalOut.UpdateLabel(parkInfo.TotalOut); lblVehicleTotalOut.UpdateLabel(parkInfo.TotalOut);
} }
private void Statistic_Load(object sender, EventArgs e)
{
tlpStatisticTable.BorderStyle = BorderStyle.FixedSingle;
tlpStatisticTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
System.Drawing.Font labelFont = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
lblLoaiXe = new Label() { Text = "Loại xe", Font = labelFont };
lblXeMay = new Label() { Text = "Xe máy", Font = labelFont };
lblOto = new Label() { Text = "Ô tô", Font = labelFont };
lblSoLuong = new Label() { Text = "Số Lượng", Font = labelFont };
lblSoLuongXeMay = new Label() { Text = "0", Font = labelFont };
lblSoLuongOto = new Label() { Text = "0", Font = labelFont };
lblLoaiXe.Anchor = AnchorStyles.None;
lblXeMay.Anchor = AnchorStyles.None;
lblOto.Anchor = AnchorStyles.None;
lblSoLuong.Anchor = AnchorStyles.None;
lblSoLuongXeMay.Anchor = AnchorStyles.None;
lblSoLuongOto.Anchor = AnchorStyles.None;
tlpStatisticTable.Controls.Add(lblLoaiXe, 0, 0);
tlpStatisticTable.Controls.Add(lblXeMay, 0, 1);
tlpStatisticTable.Controls.Add(lblOto, 0, 2);
tlpStatisticTable.Controls.Add(lblSoLuong, 1, 0);
tlpStatisticTable.Controls.Add(lblSoLuongXeMay, 1, 1);
tlpStatisticTable.Controls.Add(lblSoLuongOto, 1, 2);
} }
public class ParkInfo public class ParkInfo

View File

@ -29,97 +29,125 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.lblPingTimeServer = new System.Windows.Forms.Label(); this.lblPingTimeServer = new System.Windows.Forms.Label();
this.lblPingServer = new System.Windows.Forms.Label();
this.lblDateTime = new System.Windows.Forms.Label(); this.lblDateTime = new System.Windows.Forms.Label();
this.lblPingC3200 = new System.Windows.Forms.Label(); this.lblPingDoorAccessControlDevice = new System.Windows.Forms.Label();
this.lblPingTimeC3 = new System.Windows.Forms.Label(); this.lblPingTimeToDoorAccessControl = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.lblConnectionStatus = new System.Windows.Forms.Label();
this.lblServer = new System.Windows.Forms.Label();
this.lblEngine = new System.Windows.Forms.Label();
this.lblEngineStatus = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// lblPingTimeServer // lblPingTimeServer
// //
this.lblPingTimeServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblPingTimeServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPingTimeServer.Location = new System.Drawing.Point(181, 2); this.lblPingTimeServer.Location = new System.Drawing.Point(211, 0);
this.lblPingTimeServer.Name = "lblPingTimeServer"; this.lblPingTimeServer.Name = "lblPingTimeServer";
this.lblPingTimeServer.Size = new System.Drawing.Size(75, 23); this.lblPingTimeServer.Size = new System.Drawing.Size(65, 24);
this.lblPingTimeServer.TabIndex = 0; this.lblPingTimeServer.TabIndex = 0;
this.lblPingTimeServer.Text = "1ms"; this.lblPingTimeServer.Text = "1ms";
this.lblPingTimeServer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblPingTimeServer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblPingServer
//
this.lblPingServer.AutoSize = true;
this.lblPingServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPingServer.Location = new System.Drawing.Point(128, 4);
this.lblPingServer.Name = "lblPingServer";
this.lblPingServer.Size = new System.Drawing.Size(51, 18);
this.lblPingServer.TabIndex = 1;
this.lblPingServer.Text = "Server";
//
// lblDateTime // lblDateTime
// //
this.lblDateTime.AutoSize = true; this.lblDateTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblDateTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblDateTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDateTime.Location = new System.Drawing.Point(597, 4); this.lblDateTime.Location = new System.Drawing.Point(1207, 0);
this.lblDateTime.Name = "lblDateTime"; this.lblDateTime.Name = "lblDateTime";
this.lblDateTime.Size = new System.Drawing.Size(140, 18); this.lblDateTime.Size = new System.Drawing.Size(140, 24);
this.lblDateTime.TabIndex = 2; this.lblDateTime.TabIndex = 2;
this.lblDateTime.Text = "17/06/2020 16:54:43"; this.lblDateTime.Text = "17/06/2020 16:54:43";
this.lblDateTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblPingC3200 // lblPingDoorAccessControlDevice
// //
this.lblPingC3200.AutoSize = true; this.lblPingDoorAccessControlDevice.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPingC3200.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblPingDoorAccessControlDevice.Location = new System.Drawing.Point(316, 0);
this.lblPingC3200.Location = new System.Drawing.Point(308, 4); this.lblPingDoorAccessControlDevice.Name = "lblPingDoorAccessControlDevice";
this.lblPingC3200.Name = "lblPingC3200"; this.lblPingDoorAccessControlDevice.Size = new System.Drawing.Size(114, 24);
this.lblPingC3200.Size = new System.Drawing.Size(109, 18); this.lblPingDoorAccessControlDevice.TabIndex = 3;
this.lblPingC3200.TabIndex = 3; this.lblPingDoorAccessControlDevice.Text = "Thiết bị mở cửa:";
this.lblPingC3200.Text = "Thiết bị mở cửa"; this.lblPingDoorAccessControlDevice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// lblPingTimeC3 // lblPingTimeToDoorAccessControl
// //
this.lblPingTimeC3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblPingTimeToDoorAccessControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPingTimeC3.Location = new System.Drawing.Point(436, 2); this.lblPingTimeToDoorAccessControl.Location = new System.Drawing.Point(437, 0);
this.lblPingTimeC3.Name = "lblPingTimeC3"; this.lblPingTimeToDoorAccessControl.Name = "lblPingTimeToDoorAccessControl";
this.lblPingTimeC3.Size = new System.Drawing.Size(75, 23); this.lblPingTimeToDoorAccessControl.Size = new System.Drawing.Size(71, 24);
this.lblPingTimeC3.TabIndex = 3; this.lblPingTimeToDoorAccessControl.TabIndex = 3;
this.lblPingTimeC3.Text = "500ms"; this.lblPingTimeToDoorAccessControl.Text = "500ms";
this.lblPingTimeC3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblPingTimeToDoorAccessControl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// label1 // lblConnectionStatus
// //
this.label1.AutoSize = true; this.lblConnectionStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblConnectionStatus.Location = new System.Drawing.Point(0, 0);
this.label1.Location = new System.Drawing.Point(3, 4); this.lblConnectionStatus.Name = "lblConnectionStatus";
this.label1.Name = "label1"; this.lblConnectionStatus.Size = new System.Drawing.Size(125, 24);
this.label1.Size = new System.Drawing.Size(125, 18); this.lblConnectionStatus.TabIndex = 1;
this.label1.TabIndex = 1; this.lblConnectionStatus.Text = "Trạng thái kết nối";
this.label1.Text = "Trạng thái kết nối:"; this.lblConnectionStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblServer
//
this.lblServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblServer.Location = new System.Drawing.Point(142, 0);
this.lblServer.Name = "lblServer";
this.lblServer.Size = new System.Drawing.Size(63, 24);
this.lblServer.TabIndex = 1;
this.lblServer.Text = "Server";
this.lblServer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblEngine
//
this.lblEngine.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblEngine.Location = new System.Drawing.Point(570, 0);
this.lblEngine.Name = "lblEngine";
this.lblEngine.Size = new System.Drawing.Size(65, 24);
this.lblEngine.TabIndex = 3;
this.lblEngine.Text = "Engine:";
this.lblEngine.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblEngineStatus
//
this.lblEngineStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblEngineStatus.Location = new System.Drawing.Point(641, 0);
this.lblEngineStatus.Name = "lblEngineStatus";
this.lblEngineStatus.Size = new System.Drawing.Size(169, 24);
this.lblEngineStatus.TabIndex = 3;
this.lblEngineStatus.Text = "ĐANG HOẠT ĐỘNG";
this.lblEngineStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// StatusBar // StatusBar
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.lblPingTimeC3); this.Controls.Add(this.lblEngineStatus);
this.Controls.Add(this.lblPingC3200); this.Controls.Add(this.lblPingTimeToDoorAccessControl);
this.Controls.Add(this.lblEngine);
this.Controls.Add(this.lblPingDoorAccessControlDevice);
this.Controls.Add(this.lblDateTime); this.Controls.Add(this.lblDateTime);
this.Controls.Add(this.label1); this.Controls.Add(this.lblServer);
this.Controls.Add(this.lblPingServer); this.Controls.Add(this.lblConnectionStatus);
this.Controls.Add(this.lblPingTimeServer); this.Controls.Add(this.lblPingTimeServer);
this.Margin = new System.Windows.Forms.Padding(0);
this.MaximumSize = new System.Drawing.Size(1350, 24);
this.Name = "StatusBar"; this.Name = "StatusBar";
this.Size = new System.Drawing.Size(740, 25); this.Size = new System.Drawing.Size(1350, 24);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.Label lblPingTimeServer; private System.Windows.Forms.Label lblPingTimeServer;
private System.Windows.Forms.Label lblPingServer;
private System.Windows.Forms.Label lblDateTime; private System.Windows.Forms.Label lblDateTime;
private System.Windows.Forms.Label lblPingC3200; private System.Windows.Forms.Label lblPingDoorAccessControlDevice;
private System.Windows.Forms.Label lblPingTimeC3; private System.Windows.Forms.Label lblPingTimeToDoorAccessControl;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lblConnectionStatus;
private System.Windows.Forms.Label lblServer;
private System.Windows.Forms.Label lblEngine;
private System.Windows.Forms.Label lblEngineStatus;
} }
} }

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
@ -31,10 +32,21 @@ namespace AIParkingApplication
lblDateTime.UpdateLabel(DateTime.Now.GetTimeFormatted()); lblDateTime.UpdateLabel(DateTime.Now.GetTimeFormatted());
PingResult pingDoorAccessControlResult = GetPingStatus(doorAccessControlDeviceIP); PingResult pingDoorAccessControlResult = GetPingStatus(doorAccessControlDeviceIP);
lblPingTimeC3.UpdateLabel($"{pingDoorAccessControlResult.ReplyTime} ms", pingDoorAccessControlResult.BackColor, pingDoorAccessControlResult.ForeColor); lblPingTimeToDoorAccessControl.UpdateLabel($"{pingDoorAccessControlResult.ReplyTime} ms", pingDoorAccessControlResult.BackColor, pingDoorAccessControlResult.ForeColor);
PingResult pingWebServerResult = GetPingStatus(webServerIP); PingResult pingWebServerResult = GetPingStatus(webServerIP);
lblPingTimeServer.UpdateLabel($"{pingWebServerResult.ReplyTime} ms", pingWebServerResult.BackColor, pingWebServerResult.ForeColor); lblPingTimeServer.UpdateLabel($"{pingWebServerResult.ReplyTime} ms", pingWebServerResult.BackColor, pingWebServerResult.ForeColor);
if (Process.GetProcessesByName("tmux").Length == 0)
{
string engineBatFilePath = Application.StartupPath + @"\engine.bat";
Util.ExecuteCommand(engineBatFilePath);
lblEngineStatus.UpdateLabel("DỪNG HOẠT ĐỘNG", Color.Red);
}
else
{
lblEngineStatus.UpdateLabel("ĐANG HOẠT ĐỘNG", Color.Green);
}
} }
Thread.Sleep(updateInterval); Thread.Sleep(updateInterval);
} }

View File

@ -128,6 +128,26 @@ namespace AIParkingApplication
{ {
return dateTime.ToString(AppConstant.DATETIME_FORMAT); return dateTime.ToString(AppConstant.DATETIME_FORMAT);
} }
public static void ExecuteCommand(string command)
{
var processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = false;
processInfo.RedirectStandardError = true;
processInfo.RedirectStandardOutput = true;
using (var process = Process.Start(processInfo))
{
process.OutputDataReceived += (object sender, DataReceivedEventArgs e) => Console.WriteLine("Engine Output >>" + e.Data);
process.BeginOutputReadLine();
process.ErrorDataReceived += (object sender, DataReceivedEventArgs e) => Console.WriteLine("Engine Error >>" + e.Data);
process.BeginErrorReadLine();
//process.WaitForExit();
//Console.WriteLine("ExitCode: {0}", process.ExitCode);
//process.Close();
}
}
} }
public class PlateRequestEngineModel public class PlateRequestEngineModel

View File

@ -0,0 +1,3 @@
@echo off
wsl bash -c "cd ~/AIParking_Engine_deploy && tmux new-session -d -s "engine" gunicorn app:app -b 0.0.0.0:8080 --workers=2"
exit