Init Commit
This commit is contained in:
commit
30473ed1dd
261
.gitignore
vendored
Normal file
261
.gitignore
vendored
Normal file
|
@ -0,0 +1,261 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
#*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
#**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
#!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
25
AIParkingApplication.sln
Normal file
25
AIParkingApplication.sln
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30104.148
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIParkingApplication", "AIParkingApplication\AIParkingApplication.csproj", "{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E59F5B80-E86A-481E-891C-00ECDB489D8E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
89
AIParkingApplication/AIParkingApplication.csproj
Normal file
89
AIParkingApplication/AIParkingApplication.csproj
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AAB88B46-4AAC-4BE6-8847-E7E4C37AEB6D}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>AIParkingApplication</RootNamespace>
|
||||
<AssemblyName>AIParkingApplication</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ActionResult.cs" />
|
||||
<Compile Include="AIParkingApplicationForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AIParkingApplicationForm.Designer.cs">
|
||||
<DependentUpon>AIParkingApplicationForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AppConstant.cs" />
|
||||
<Compile Include="C3DeviceController.cs" />
|
||||
<Compile Include="Camera.cs" />
|
||||
<Compile Include="Lane.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Util.cs" />
|
||||
<EmbeddedResource Include="AIParkingApplicationForm.resx">
|
||||
<DependentUpon>AIParkingApplicationForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
48
AIParkingApplication/AIParkingApplicationForm.Designer.cs
generated
Normal file
48
AIParkingApplication/AIParkingApplicationForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,48 @@
|
|||
namespace AIParkingApplication
|
||||
{
|
||||
partial class AIParkingApplicationForm
|
||||
{
|
||||
/// <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.SuspendLayout();
|
||||
//
|
||||
// AIParkingApplicationForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1350, 729);
|
||||
this.MinimumSize = new System.Drawing.Size(1366, 768);
|
||||
this.Name = "AIParkingApplicationForm";
|
||||
this.Text = "AIParking Application";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
20
AIParkingApplication/AIParkingApplicationForm.cs
Normal file
20
AIParkingApplication/AIParkingApplicationForm.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AIParkingApplication
|
||||
{
|
||||
public partial class AIParkingApplicationForm : Form
|
||||
{
|
||||
public AIParkingApplicationForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
AIParkingApplication/AIParkingApplicationForm.resx
Normal file
120
AIParkingApplication/AIParkingApplicationForm.resx
Normal 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>
|
9
AIParkingApplication/ActionResult.cs
Normal file
9
AIParkingApplication/ActionResult.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace AIParkingApplication
|
||||
{
|
||||
public class ActionResult
|
||||
{
|
||||
public bool HasError { get; set; }
|
||||
public string Message { get; set; }
|
||||
public object Data { get; set; }
|
||||
}
|
||||
}
|
6
AIParkingApplication/App.config
Normal file
6
AIParkingApplication/App.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
||||
</startup>
|
||||
</configuration>
|
11
AIParkingApplication/AppConstant.cs
Normal file
11
AIParkingApplication/AppConstant.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace AIParkingApplication
|
||||
{
|
||||
public static class AppConstant
|
||||
{
|
||||
#region Application Messages
|
||||
public const string APPLICATION_IS_RUNNNING = "AIParkingApplication: Ứng dụng đã chạy!";
|
||||
public const string ERROR_TITLE = "Lỗi";
|
||||
public const string DATETIME_FORMAT = "HH:mm:ss dd/MM/yyyy";
|
||||
#endregion
|
||||
}
|
||||
}
|
253
AIParkingApplication/C3DeviceController.cs
Normal file
253
AIParkingApplication/C3DeviceController.cs
Normal file
|
@ -0,0 +1,253 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace AIParkingApplication
|
||||
{
|
||||
public delegate void C3EventHandler(ActionResult actionResult);
|
||||
public delegate void C3RTLogEventHandler(ActionResult actionResult, int doorId, string cardNumber);
|
||||
|
||||
public class C3DeviceController
|
||||
{
|
||||
public string IPAddress { get; }
|
||||
private int port;
|
||||
private IntPtr oneTimeConnectedParamHandler;
|
||||
private string connectionString;
|
||||
private bool isReconnected;
|
||||
public event C3EventHandler OnConnected;
|
||||
public event C3EventHandler OnConnectFailed;
|
||||
public event C3EventHandler OnReconnect;
|
||||
public event C3EventHandler OnDoorOpenned;
|
||||
public event C3EventHandler OnDoorOpenFailed;
|
||||
public event C3EventHandler OnPingFailed;
|
||||
public event C3EventHandler OnDisconnected;
|
||||
public event C3RTLogEventHandler OnGetRTLog;
|
||||
public event C3EventHandler OnGetRTLogFailed;
|
||||
private int reconnectCounter;
|
||||
|
||||
public C3DeviceController(string ipAddress, int port = C3Constant.DEFAULT_C3_PORT)
|
||||
{
|
||||
IPAddress = ipAddress;
|
||||
this.port = port;
|
||||
connectionString = $"protocol=TCP,ipaddress={this.IPAddress},port={this.port},timeout=2000,passwd=";
|
||||
oneTimeConnectedParamHandler = IntPtr.Zero;
|
||||
isReconnected = true;
|
||||
reconnectCounter = 0;
|
||||
}
|
||||
|
||||
~C3DeviceController()
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
[DllImport(C3Constant.PLCOMMPRO_DLL, EntryPoint = C3Constant.ENTRY_POINT_CONNECT)]
|
||||
public static extern IntPtr Connect(string Parameters);
|
||||
|
||||
[DllImport(C3Constant.PLCOMMPRO_DLL, EntryPoint = C3Constant.ENTRY_POINT_PULL_LAST_ERROR)]
|
||||
public static extern int PullLastError();
|
||||
|
||||
[DllImport(C3Constant.PLCOMMPRO_DLL, EntryPoint = C3Constant.ENTRY_POINT_DISCONNECT)]
|
||||
public static extern void Disconnect(IntPtr h);
|
||||
|
||||
[DllImport(C3Constant.PLCOMMPRO_DLL, EntryPoint = C3Constant.ENTRY_POINT_CONTROL_DEVICE)]
|
||||
public static extern int ControlDevice(IntPtr h, int operationid, int param1, int param2, int param3, int param4, string options);
|
||||
|
||||
[DllImport(C3Constant.PLCOMMPRO_DLL, EntryPoint = C3Constant.ENTRY_POINT_GET_RT_LOG)]
|
||||
public static extern int GetRTLog(IntPtr h, ref byte buffer, int buffersize);
|
||||
|
||||
public ActionResult Connect()
|
||||
{
|
||||
if (Util.IsPingable(IPAddress))
|
||||
{
|
||||
oneTimeConnectedParamHandler = Connect(connectionString);
|
||||
if (oneTimeConnectedParamHandler != IntPtr.Zero)
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = false,
|
||||
Message = string.Format(C3Constant.CONNECTED_SUCCESSFULLY, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnConnected?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.FAILED_TO_CONNECT, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress, PullLastError())
|
||||
};
|
||||
OnConnectFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.FAILED_TO_PING, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnPingFailed?.Invoke(result);
|
||||
OnConnectFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult OpenDoor(int doorId)
|
||||
{
|
||||
if (oneTimeConnectedParamHandler != IntPtr.Zero)
|
||||
{
|
||||
int controlDeviceResult = ControlDevice(oneTimeConnectedParamHandler, 1, doorId, 1, 1, 0, "");
|
||||
if (controlDeviceResult >= 0)
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = false,
|
||||
Message = string.Format(C3Constant.OPENNED_DOOR_SUCCESSFULLY, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnDoorOpenned?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.FAILED_TO_OPEN_DOOR, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnDoorOpenFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.NOT_CONNECTTED, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnDoorOpenFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult GetRTLog(out int doorId, out string cardNumber)
|
||||
{
|
||||
doorId = C3Constant.DEFAULT_DOOR_ID;
|
||||
cardNumber = C3Constant.DEFAULT_CARD_NUMBER;
|
||||
|
||||
if (!Util.IsPingable(IPAddress))
|
||||
{
|
||||
isReconnected = false;
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.FAILED_TO_PING, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnPingFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
int buffersize = 256;
|
||||
byte[] buffer = new byte[buffersize];
|
||||
int resultRTLog = GetRTLog(oneTimeConnectedParamHandler, ref buffer[0], buffersize);
|
||||
|
||||
if (resultRTLog >= 0)
|
||||
{
|
||||
string bufferString = Encoding.Default.GetString(buffer);
|
||||
string[] data = bufferString.Split(',');
|
||||
|
||||
reconnectCounter = 0;
|
||||
cardNumber = data[2];
|
||||
int.TryParse(data[3], out doorId);
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = false
|
||||
};
|
||||
OnGetRTLog?.Invoke(result, doorId, cardNumber);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
reconnectCounter += 1;
|
||||
if (!isReconnected && reconnectCounter >= C3Constant.MAX_TIME_GET_LOG_BEFORE_RECONNECT)
|
||||
{
|
||||
ActionResult reconnectResult = Connect();
|
||||
if (!reconnectResult.HasError)
|
||||
{
|
||||
isReconnected = true;
|
||||
reconnectCounter = 0;
|
||||
reconnectResult.Message = string.Format(C3Constant.RECONNECTED_SUCCESSFULLY, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress);
|
||||
}
|
||||
OnReconnect?.Invoke(reconnectResult);
|
||||
return reconnectResult;
|
||||
}
|
||||
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.FAILED_TO_READ_LOG, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnGetRTLogFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
doorId = C3Constant.DEFAULT_DOOR_ID;
|
||||
cardNumber = C3Constant.DEFAULT_CARD_NUMBER;
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = true,
|
||||
Message = string.Format(C3Constant.WRONG_FORMAT_DATA, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress, ex.Message)
|
||||
};
|
||||
OnGetRTLogFailed?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Disconnect()
|
||||
{
|
||||
Disconnect(oneTimeConnectedParamHandler);
|
||||
oneTimeConnectedParamHandler = IntPtr.Zero;
|
||||
var result = new ActionResult
|
||||
{
|
||||
HasError = false,
|
||||
Message = string.Format(C3Constant.DISCONNECTED_SUCCESSFULLY, DateTime.Now.ToString(AppConstant.DATETIME_FORMAT), IPAddress)
|
||||
};
|
||||
OnDisconnected?.Invoke(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static class C3Constant
|
||||
{
|
||||
#region DLL Entry Point
|
||||
public const string PLCOMMPRO_DLL = "plcommpro.dll";
|
||||
public const string ENTRY_POINT_CONNECT = "Connect";
|
||||
public const string ENTRY_POINT_PULL_LAST_ERROR = "PullLastError";
|
||||
public const string ENTRY_POINT_DISCONNECT = "Disconnect";
|
||||
public const string ENTRY_POINT_CONTROL_DEVICE = "ControlDevice";
|
||||
public const string ENTRY_POINT_GET_RT_LOG = "GetRTLog";
|
||||
#endregion
|
||||
|
||||
public const int DEFAULT_C3_PORT = 4370;
|
||||
public const string CONNECTED_SUCCESSFULLY = "{0}\t{1}\tKết nối thành công hệ thống đóng mở cửa";
|
||||
public const string FAILED_TO_CONNECT = "{0}\t{1}\tKhông thể kết nối tới thiết bị C3\tError Code: {2}";
|
||||
public const string NOT_CONNECTTED = "{0}\t{1}\tChưa kết nối tới thiết bị C3";
|
||||
public const string FAILED_TO_PING = "{0}\t{1}\tKhông thể PING tới thiết bị C3";
|
||||
public const string DISCONNECTED_SUCCESSFULLY = "{0}\t{1}\tĐã ngắt kết nối thành công tới thiết bị C3";
|
||||
public const string OPENNED_DOOR_SUCCESSFULLY = "{0}\t{1}\tMở cửa thành công!";
|
||||
public const string FAILED_TO_OPEN_DOOR = "{0}\t{1}\tKhông thể mở cửa!";
|
||||
public const string WRONG_FORMAT_DATA = "{0}\t{1}\tĐịnh dạng dữ liệu đọc từ thiết bị sai!\tErrorMessage:{2}";
|
||||
public const string FAILED_TO_READ_LOG = "{0}\t{1}\tKhông đọc được dữ liệu RTLog từ thiết bị C3";
|
||||
public const string RECONNECTED_SUCCESSFULLY = "{0}\t{1}\tĐã kết nối lại tới thiết bị C3";
|
||||
public const string DEFAULT_CARD_NUMBER = "0";
|
||||
public const int DEFAULT_DOOR_ID = 0;
|
||||
public const string DATETIME_FORMAT = "HH:mm:ss dd/MM/yyyy";
|
||||
public const int MAX_TIME_GET_LOG_BEFORE_RECONNECT = 5;
|
||||
}
|
||||
}
|
35
AIParkingApplication/Camera.cs
Normal file
35
AIParkingApplication/Camera.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIParkingApplication
|
||||
{
|
||||
public class Camera
|
||||
{
|
||||
private string videoStream;
|
||||
private CameraType cameraType;
|
||||
public Camera(CameraType cameraType, string videoStream)
|
||||
{
|
||||
this.cameraType = cameraType;
|
||||
this.videoStream = videoStream;
|
||||
}
|
||||
|
||||
public void CaptureFrame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ShowFrame()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public enum CameraType
|
||||
{
|
||||
Vehicle,
|
||||
Plate
|
||||
}
|
||||
}
|
22
AIParkingApplication/Lane.cs
Normal file
22
AIParkingApplication/Lane.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
namespace AIParkingApplication
|
||||
{
|
||||
public class Lane
|
||||
{
|
||||
private LaneType laneType;
|
||||
private string vehicleVideoStream;
|
||||
private string plateVideoStream;
|
||||
|
||||
public Lane(LaneType laneType, string vehicleVideoStream, string plateVideoStream)
|
||||
{
|
||||
this.laneType = laneType;
|
||||
this.vehicleVideoStream = vehicleVideoStream;
|
||||
this.plateVideoStream = plateVideoStream;
|
||||
}
|
||||
}
|
||||
|
||||
public enum LaneType
|
||||
{
|
||||
IN,
|
||||
OUT
|
||||
}
|
||||
}
|
36
AIParkingApplication/Program.cs
Normal file
36
AIParkingApplication/Program.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AIParkingApplication
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
using (Mutex mutex = new Mutex(true, "AIParkingApplication", out bool isAppCreatedNew))
|
||||
{
|
||||
if (isAppCreatedNew)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new AIParkingApplicationForm());
|
||||
}
|
||||
else
|
||||
{
|
||||
Process currentProcess = Process.GetCurrentProcess();
|
||||
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
|
||||
{
|
||||
if (process.Id != currentProcess.Id)
|
||||
{
|
||||
MessageBox.Show(AppConstant.APPLICATION_IS_RUNNNING, AppConstant.ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
36
AIParkingApplication/Properties/AssemblyInfo.cs
Normal file
36
AIParkingApplication/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AIParkingApplication")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AIParkingApplication")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("aab88b46-4aac-4be6-8847-e7e4c37aeb6d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
AIParkingApplication/Properties/Resources.Designer.cs
generated
Normal file
71
AIParkingApplication/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AIParkingApplication.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AIParkingApplication.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
AIParkingApplication/Properties/Resources.resx
Normal file
117
AIParkingApplication/Properties/Resources.resx
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
AIParkingApplication/Properties/Settings.Designer.cs
generated
Normal file
30
AIParkingApplication/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AIParkingApplication.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
AIParkingApplication/Properties/Settings.settings
Normal file
7
AIParkingApplication/Properties/Settings.settings
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
43
AIParkingApplication/Util.cs
Normal file
43
AIParkingApplication/Util.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIParkingApplication
|
||||
{
|
||||
public static class Util
|
||||
{
|
||||
public static bool IsPingable(string destinationIPAddress, int timeOut = UtilConstant.PING_TIMEOUT_MS)
|
||||
{
|
||||
var pingTask = Task.Factory.StartNew(async () =>
|
||||
{
|
||||
bool isPingable = false;
|
||||
Ping pinger = new Ping();
|
||||
try
|
||||
{
|
||||
PingReply reply = await pinger.SendPingAsync(destinationIPAddress, timeOut);
|
||||
isPingable = reply.Status == IPStatus.Success;
|
||||
if (!isPingable)
|
||||
{
|
||||
// Logging
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isPingable = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
pinger.Dispose();
|
||||
}
|
||||
return isPingable;
|
||||
});
|
||||
|
||||
return pingTask.Result.Result;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UtilConstant
|
||||
{
|
||||
public const int PING_TIMEOUT_MS = 500;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user