Compare commits
No commits in common. "a717b356f0967b6a075ea4c592294c9d460eb70d" and "2a2c1439b308fb8467327c9c7ca466abf2be17d2" have entirely different histories.
a717b356f0
...
2a2c1439b3
|
@ -8,19 +8,13 @@ EndProject
|
|||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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|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.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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -36,28 +36,6 @@
|
|||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</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>
|
||||
<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>
|
||||
|
@ -159,9 +137,6 @@
|
|||
<EmbeddedResource Include="StatusBar.resx">
|
||||
<DependentUpon>StatusBar.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="engine.bat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
|
|
|
@ -57,7 +57,6 @@ namespace AIParkingApplication
|
|||
Mat videoFrame = new Mat();
|
||||
while (true)
|
||||
{
|
||||
//Thread.Sleep(5);
|
||||
Thread.Sleep(50); //Stream Thread Sleep
|
||||
//Thread.Sleep(40); //Video Thread Sleep
|
||||
|
||||
|
|
4
AIParkingApplication/LaneIn.Designer.cs
generated
4
AIParkingApplication/LaneIn.Designer.cs
generated
|
@ -52,7 +52,6 @@
|
|||
//
|
||||
// pictureBoxPlateImage
|
||||
//
|
||||
this.pictureBoxPlateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23);
|
||||
this.pictureBoxPlateImage.Name = "pictureBoxPlateImage";
|
||||
this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -62,7 +61,6 @@
|
|||
//
|
||||
// pictureBoxPlateVideo
|
||||
//
|
||||
this.pictureBoxPlateVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23);
|
||||
this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo";
|
||||
this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -85,7 +83,6 @@
|
|||
//
|
||||
// pictureBoxOverviewImage
|
||||
//
|
||||
this.pictureBoxOverviewImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24);
|
||||
this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage";
|
||||
this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -95,7 +92,6 @@
|
|||
//
|
||||
// pictureBoxOverviewVideo
|
||||
//
|
||||
this.pictureBoxOverviewVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24);
|
||||
this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo";
|
||||
this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200);
|
||||
|
|
26
AIParkingApplication/LaneOut.Designer.cs
generated
26
AIParkingApplication/LaneOut.Designer.cs
generated
|
@ -33,7 +33,6 @@
|
|||
this.pictureBoxPlateImageIn = new System.Windows.Forms.PictureBox();
|
||||
this.grbCardInformation = new System.Windows.Forms.GroupBox();
|
||||
this.lblCardType = new System.Windows.Forms.Label();
|
||||
this.lblCardTimeOut = new System.Windows.Forms.Label();
|
||||
this.lblCardTime = new System.Windows.Forms.Label();
|
||||
this.lblMoneyAmount = new System.Windows.Forms.Label();
|
||||
this.lblPlateString = new System.Windows.Forms.Label();
|
||||
|
@ -46,6 +45,7 @@
|
|||
this.grbOverviewCamera = new System.Windows.Forms.GroupBox();
|
||||
this.lblLaneLabel = new System.Windows.Forms.Label();
|
||||
this.lblStatusInfo = new System.Windows.Forms.Label();
|
||||
this.lblCardTimeOut = new System.Windows.Forms.Label();
|
||||
this.grbPlateRefernce.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxOverviewImageIn)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxPlateImageIn)).BeginInit();
|
||||
|
@ -73,7 +73,6 @@
|
|||
// pictureBoxOverviewImageIn
|
||||
//
|
||||
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.Name = "pictureBoxOverviewImageIn";
|
||||
this.pictureBoxOverviewImageIn.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -84,7 +83,6 @@
|
|||
// pictureBoxPlateImageIn
|
||||
//
|
||||
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.Name = "pictureBoxPlateImageIn";
|
||||
this.pictureBoxPlateImageIn.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -118,15 +116,6 @@
|
|||
this.lblCardType.TabIndex = 0;
|
||||
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
|
||||
//
|
||||
this.lblCardTime.AutoSize = true;
|
||||
|
@ -165,7 +154,6 @@
|
|||
//
|
||||
// pictureBoxPlateImage
|
||||
//
|
||||
this.pictureBoxPlateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxPlateImage.Location = new System.Drawing.Point(226, 23);
|
||||
this.pictureBoxPlateImage.Name = "pictureBoxPlateImage";
|
||||
this.pictureBoxPlateImage.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -175,7 +163,6 @@
|
|||
//
|
||||
// pictureBoxPlateVideo
|
||||
//
|
||||
this.pictureBoxPlateVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxPlateVideo.Location = new System.Drawing.Point(15, 23);
|
||||
this.pictureBoxPlateVideo.Name = "pictureBoxPlateVideo";
|
||||
this.pictureBoxPlateVideo.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -198,7 +185,6 @@
|
|||
//
|
||||
// pictureBoxOverviewImage
|
||||
//
|
||||
this.pictureBoxOverviewImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxOverviewImage.Location = new System.Drawing.Point(226, 24);
|
||||
this.pictureBoxOverviewImage.Name = "pictureBoxOverviewImage";
|
||||
this.pictureBoxOverviewImage.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -208,7 +194,6 @@
|
|||
//
|
||||
// pictureBoxOverviewVideo
|
||||
//
|
||||
this.pictureBoxOverviewVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxOverviewVideo.Location = new System.Drawing.Point(15, 24);
|
||||
this.pictureBoxOverviewVideo.Name = "pictureBoxOverviewVideo";
|
||||
this.pictureBoxOverviewVideo.Size = new System.Drawing.Size(200, 200);
|
||||
|
@ -255,6 +240,15 @@
|
|||
this.lblStatusInfo.Text = "XIN CHÀO";
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
|
|
@ -126,6 +126,12 @@
|
|||
<metadata name="pictureBoxPlateImageIn.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</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">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
83
AIParkingApplication/Statistic.Designer.cs
generated
83
AIParkingApplication/Statistic.Designer.cs
generated
|
@ -34,19 +34,12 @@
|
|||
this.lblVehicleTotalOut = new System.Windows.Forms.Label();
|
||||
this.lblVehicleTotalIn = new System.Windows.Forms.Label();
|
||||
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.lblAuthorization = new System.Windows.Forms.Label();
|
||||
this.lblUsername = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.grbVehicleStatistics.SuspendLayout();
|
||||
this.tlpStatisticTable.SuspendLayout();
|
||||
this.grbLoginInfo.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -113,16 +106,9 @@
|
|||
//
|
||||
this.tlpStatisticTable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tlpStatisticTable.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
|
||||
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.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.Name = "tlpStatisticTable";
|
||||
this.tlpStatisticTable.RowCount = 3;
|
||||
|
@ -132,66 +118,6 @@
|
|||
this.tlpStatisticTable.Size = new System.Drawing.Size(180, 100);
|
||||
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
|
||||
//
|
||||
this.grbLoginInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
|
@ -256,9 +182,8 @@
|
|||
this.Controls.Add(this.grbVehicleStatistics);
|
||||
this.Name = "Statistic";
|
||||
this.Size = new System.Drawing.Size(193, 292);
|
||||
this.Load += new System.EventHandler(this.Statistic_Load);
|
||||
this.grbVehicleStatistics.ResumeLayout(false);
|
||||
this.tlpStatisticTable.ResumeLayout(false);
|
||||
this.tlpStatisticTable.PerformLayout();
|
||||
this.grbLoginInfo.ResumeLayout(false);
|
||||
this.grbLoginInfo.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
@ -278,11 +203,5 @@
|
|||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label lblVehicleTotalOut;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,38 +7,80 @@ namespace AIParkingApplication
|
|||
{
|
||||
public partial class Statistic : UserControl
|
||||
{
|
||||
private readonly Thread statisticsThread;
|
||||
private readonly Thread thrStatistics;
|
||||
private readonly TimeSpan updateInterval;
|
||||
private ParkInfo parkInfo;
|
||||
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)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.apiController = apiController;
|
||||
this.updateInterval = updateInterval;
|
||||
statisticsThread = new Thread(new ThreadStart(GetStatistic)) { IsBackground = true };
|
||||
statisticsThread.Start();
|
||||
thrStatistics = new Thread(new ThreadStart(GetStatistic)) { IsBackground = true };
|
||||
thrStatistics.Start();
|
||||
}
|
||||
|
||||
private void GetStatistic()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
GetDataUpdate();
|
||||
GetDataFromServer();
|
||||
ShowInfo();
|
||||
Thread.Sleep(updateInterval);
|
||||
}
|
||||
}
|
||||
|
||||
private async void GetDataUpdate()
|
||||
async void GetDataFromServer()
|
||||
{
|
||||
ParkInfo parkInfo = await apiController.GetStatisticInfo();
|
||||
if (parkInfo != null)
|
||||
parkInfo = await apiController.GetStatisticInfo();
|
||||
}
|
||||
|
||||
private void ShowInfo()
|
||||
{
|
||||
if (parkInfo == null)
|
||||
{
|
||||
lblSoLuongXeMay.UpdateLabel(parkInfo.NumberOfMoto.ToString());
|
||||
lblSoLuongOto.UpdateLabel(parkInfo.NumberOfCar.ToString());
|
||||
lblVehicleTotalIn.UpdateLabel(parkInfo.TotalIn);
|
||||
lblVehicleTotalOut.UpdateLabel(parkInfo.TotalOut);
|
||||
return;
|
||||
}
|
||||
lblSoLuongXeMay.UpdateLabel(parkInfo.NumberOfMoto.ToString());
|
||||
lblSoLuongOto.UpdateLabel(parkInfo.NumberOfCar.ToString());
|
||||
lblVehicleTotalIn.UpdateLabel(parkInfo.TotalIn);
|
||||
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
|
||||
|
|
134
AIParkingApplication/StatusBar.Designer.cs
generated
134
AIParkingApplication/StatusBar.Designer.cs
generated
|
@ -29,125 +29,97 @@
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.lblPingTimeServer = new System.Windows.Forms.Label();
|
||||
this.lblPingServer = new System.Windows.Forms.Label();
|
||||
this.lblDateTime = new System.Windows.Forms.Label();
|
||||
this.lblPingDoorAccessControlDevice = new System.Windows.Forms.Label();
|
||||
this.lblPingTimeToDoorAccessControl = 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.lblPingC3200 = new System.Windows.Forms.Label();
|
||||
this.lblPingTimeC3 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblPingTimeServer
|
||||
//
|
||||
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(211, 0);
|
||||
this.lblPingTimeServer.Location = new System.Drawing.Point(181, 2);
|
||||
this.lblPingTimeServer.Name = "lblPingTimeServer";
|
||||
this.lblPingTimeServer.Size = new System.Drawing.Size(65, 24);
|
||||
this.lblPingTimeServer.Size = new System.Drawing.Size(75, 23);
|
||||
this.lblPingTimeServer.TabIndex = 0;
|
||||
this.lblPingTimeServer.Text = "1ms";
|
||||
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
|
||||
//
|
||||
this.lblDateTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lblDateTime.AutoSize = true;
|
||||
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(1207, 0);
|
||||
this.lblDateTime.Location = new System.Drawing.Point(597, 4);
|
||||
this.lblDateTime.Name = "lblDateTime";
|
||||
this.lblDateTime.Size = new System.Drawing.Size(140, 24);
|
||||
this.lblDateTime.Size = new System.Drawing.Size(140, 18);
|
||||
this.lblDateTime.TabIndex = 2;
|
||||
this.lblDateTime.Text = "17/06/2020 16:54:43";
|
||||
this.lblDateTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblPingDoorAccessControlDevice
|
||||
// lblPingC3200
|
||||
//
|
||||
this.lblPingDoorAccessControlDevice.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.lblPingDoorAccessControlDevice.Name = "lblPingDoorAccessControlDevice";
|
||||
this.lblPingDoorAccessControlDevice.Size = new System.Drawing.Size(114, 24);
|
||||
this.lblPingDoorAccessControlDevice.TabIndex = 3;
|
||||
this.lblPingDoorAccessControlDevice.Text = "Thiết bị mở cửa:";
|
||||
this.lblPingDoorAccessControlDevice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lblPingC3200.AutoSize = true;
|
||||
this.lblPingC3200.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblPingC3200.Location = new System.Drawing.Point(308, 4);
|
||||
this.lblPingC3200.Name = "lblPingC3200";
|
||||
this.lblPingC3200.Size = new System.Drawing.Size(109, 18);
|
||||
this.lblPingC3200.TabIndex = 3;
|
||||
this.lblPingC3200.Text = "Thiết bị mở cửa";
|
||||
//
|
||||
// lblPingTimeToDoorAccessControl
|
||||
// lblPingTimeC3
|
||||
//
|
||||
this.lblPingTimeToDoorAccessControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblPingTimeToDoorAccessControl.Location = new System.Drawing.Point(437, 0);
|
||||
this.lblPingTimeToDoorAccessControl.Name = "lblPingTimeToDoorAccessControl";
|
||||
this.lblPingTimeToDoorAccessControl.Size = new System.Drawing.Size(71, 24);
|
||||
this.lblPingTimeToDoorAccessControl.TabIndex = 3;
|
||||
this.lblPingTimeToDoorAccessControl.Text = "500ms";
|
||||
this.lblPingTimeToDoorAccessControl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lblPingTimeC3.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.lblPingTimeC3.Name = "lblPingTimeC3";
|
||||
this.lblPingTimeC3.Size = new System.Drawing.Size(75, 23);
|
||||
this.lblPingTimeC3.TabIndex = 3;
|
||||
this.lblPingTimeC3.Text = "500ms";
|
||||
this.lblPingTimeC3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblConnectionStatus
|
||||
// label1
|
||||
//
|
||||
this.lblConnectionStatus.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.lblConnectionStatus.Name = "lblConnectionStatus";
|
||||
this.lblConnectionStatus.Size = new System.Drawing.Size(125, 24);
|
||||
this.lblConnectionStatus.TabIndex = 1;
|
||||
this.lblConnectionStatus.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;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(3, 4);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(125, 18);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Trạng thái kết nối:";
|
||||
//
|
||||
// StatusBar
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.lblEngineStatus);
|
||||
this.Controls.Add(this.lblPingTimeToDoorAccessControl);
|
||||
this.Controls.Add(this.lblEngine);
|
||||
this.Controls.Add(this.lblPingDoorAccessControlDevice);
|
||||
this.Controls.Add(this.lblPingTimeC3);
|
||||
this.Controls.Add(this.lblPingC3200);
|
||||
this.Controls.Add(this.lblDateTime);
|
||||
this.Controls.Add(this.lblServer);
|
||||
this.Controls.Add(this.lblConnectionStatus);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.lblPingServer);
|
||||
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.Size = new System.Drawing.Size(1350, 24);
|
||||
this.Size = new System.Drawing.Size(740, 25);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblPingTimeServer;
|
||||
private System.Windows.Forms.Label lblPingServer;
|
||||
private System.Windows.Forms.Label lblDateTime;
|
||||
private System.Windows.Forms.Label lblPingDoorAccessControlDevice;
|
||||
private System.Windows.Forms.Label lblPingTimeToDoorAccessControl;
|
||||
private System.Windows.Forms.Label lblConnectionStatus;
|
||||
private System.Windows.Forms.Label lblServer;
|
||||
private System.Windows.Forms.Label lblEngine;
|
||||
private System.Windows.Forms.Label lblEngineStatus;
|
||||
private System.Windows.Forms.Label lblPingC3200;
|
||||
private System.Windows.Forms.Label lblPingTimeC3;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
@ -32,21 +31,10 @@ namespace AIParkingApplication
|
|||
lblDateTime.UpdateLabel(DateTime.Now.GetTimeFormatted());
|
||||
|
||||
PingResult pingDoorAccessControlResult = GetPingStatus(doorAccessControlDeviceIP);
|
||||
lblPingTimeToDoorAccessControl.UpdateLabel($"{pingDoorAccessControlResult.ReplyTime} ms", pingDoorAccessControlResult.BackColor, pingDoorAccessControlResult.ForeColor);
|
||||
lblPingTimeC3.UpdateLabel($"{pingDoorAccessControlResult.ReplyTime} ms", pingDoorAccessControlResult.BackColor, pingDoorAccessControlResult.ForeColor);
|
||||
|
||||
PingResult pingWebServerResult = GetPingStatus(webServerIP);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -128,26 +128,6 @@ namespace AIParkingApplication
|
|||
{
|
||||
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
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
@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
|
Loading…
Reference in New Issue
Block a user