소스 검색

提交代码

yi eason 3 년 전
부모
커밋
0a0451849b

+ 8 - 1
CarLocalMeter/App.config

@@ -5,7 +5,7 @@
     </startup>
 	<appSettings>
 		<!--ping服务器的地址-->
-		<add key="ServiceIp" value="jgwzjl.jiugang.comx"/>
+		<add key="ServiceIp" value="jgwzjl.jiugang.com"/>
 		
 		<add key="ServiceUrl" value="http://10.104.4.130:9004/v1" />
 		<!--<add key="ServiceUrl" value="http://10.99.81.20/icore.icp.web/pass/systemBase/v1"/>-->
@@ -115,5 +115,12 @@
 		<!--Redis配置-->
 		<add key="redisIp" value="127.0.0.1" />
 		<add key="redisPort" value="6379" />
+
+		<!--0关闭plc,1打开plc-->
+		<add key="plcStart" value="0"/>
+		<!--道闸的点位-->
+		<add key="dz" value="80"/>
+		<!--道闸的开启值,因为程序不清楚车子是否已经完全脱离了道闸,所以一般是红地感线圈或者红外进行判断在PLC中做自动关闭的操作,所以程序这块只要做打开操作即可-->
+		<add key="dzValue" value="1"/>
 	</appSettings>
 </configuration>

+ 28 - 1
CarLocalMeter/OptionCls/PlcCls.cs

@@ -124,6 +124,7 @@ namespace CarLocalMeter
 
         }
 
+        bool bFlag = false;
         #region 数据采集
         private List<int> lWeight = new List<int>();
 
@@ -183,7 +184,33 @@ namespace CarLocalMeter
                         }
                     }
 
-                    
+                    #region
+                    /*
+                    try 
+                    {
+                        if (CacleCls.weight < 500)
+                        {
+                            if (!bFlag) 
+                            {
+                                //实际上红绿灯是自动控制的,所以没影响
+                                //DataCollectWrite();
+                            }
+                            bFlag = true;
+                        }
+                        else 
+                        {
+                            if (bFlag) 
+                            { 
+                                
+                            }
+                            bFlag = false;
+                        }
+                    } catch(Exception ex) 
+                    { 
+                        
+                    }
+                    //*/
+                    #endregion
 
                     Thread.Sleep(AppConfigCache.sleepTime);
                     //读取到db之后,则需要将这个db值写入到缓存中

+ 14 - 0
CarLocalMeter/PbCls/AppConfigCache.cs

@@ -314,5 +314,19 @@ namespace CarLocalMeter
         /// </summary>
         public static string ledIp = ConfigurationManager.AppSettings["ledIp"].ToString();
         
+        /// <summary>
+        /// plc是否打开 0关闭,1打开
+        /// </summary>
+        public static string plcStart = ConfigurationManager.AppSettings["plcStart"].ToString();
+
+        /// <summary>
+        /// 道闸点位值
+        /// </summary>
+        public static ushort dz = Convert.ToUInt16(ConfigurationManager.AppSettings["dz"].ToString());
+
+        /// <summary>
+        /// 道闸的开  由于程序无法判断车子是否完全离开,所以程序不能关闭道闸,需要plc那边接个红外或者地感线圈进行判断
+        /// </summary>
+        public static ushort dzValue = Convert.ToUInt16(ConfigurationManager.AppSettings["dzValue"].ToString());
     }
 }

+ 33 - 15
CarLocalMeter/frmMain.Designer.cs

@@ -61,6 +61,7 @@ namespace CarLocalMeter
             this.ultraTabSharedControlsPage2 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
             this.plCaptionMain = new System.Windows.Forms.Panel();
             this.panel11 = new System.Windows.Forms.Panel();
+            this.btnOpenDz = new System.Windows.Forms.Button();
             this.cbJg = new System.Windows.Forms.CheckBox();
             this.btnExport = new System.Windows.Forms.Button();
             this.btnSave = new System.Windows.Forms.Button();
@@ -282,7 +283,7 @@ namespace CarLocalMeter
             this.plImgShow.Location = new System.Drawing.Point(286, 320);
             this.plImgShow.Margin = new System.Windows.Forms.Padding(2);
             this.plImgShow.Name = "plImgShow";
-            this.plImgShow.Size = new System.Drawing.Size(900, 500);
+            this.plImgShow.Size = new System.Drawing.Size(216, 500);
             this.plImgShow.TabIndex = 43;
             this.plImgShow.Visible = false;
             // 
@@ -293,7 +294,7 @@ namespace CarLocalMeter
             this.pictureShow.Location = new System.Drawing.Point(0, 0);
             this.pictureShow.Margin = new System.Windows.Forms.Padding(2);
             this.pictureShow.Name = "pictureShow";
-            this.pictureShow.Size = new System.Drawing.Size(900, 500);
+            this.pictureShow.Size = new System.Drawing.Size(216, 500);
             this.pictureShow.TabIndex = 2;
             this.pictureShow.TabStop = false;
             this.pictureShow.DoubleClick += new System.EventHandler(this.pictureShow_DoubleClick);
@@ -352,6 +353,7 @@ namespace CarLocalMeter
             // 
             // panel11
             // 
+            this.panel11.Controls.Add(this.btnOpenDz);
             this.panel11.Controls.Add(this.cbJg);
             this.panel11.Controls.Add(this.btnExport);
             this.panel11.Controls.Add(this.btnSave);
@@ -365,12 +367,27 @@ namespace CarLocalMeter
             this.panel11.Size = new System.Drawing.Size(855, 228);
             this.panel11.TabIndex = 7;
             // 
+            // btnOpenDz
+            // 
+            this.btnOpenDz.BackColor = System.Drawing.Color.DodgerBlue;
+            this.btnOpenDz.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btnOpenDz.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)), true);
+            this.btnOpenDz.ForeColor = System.Drawing.Color.White;
+            this.btnOpenDz.Location = new System.Drawing.Point(374, 176);
+            this.btnOpenDz.Margin = new System.Windows.Forms.Padding(4);
+            this.btnOpenDz.Name = "btnOpenDz";
+            this.btnOpenDz.Size = new System.Drawing.Size(100, 40);
+            this.btnOpenDz.TabIndex = 14;
+            this.btnOpenDz.Text = "打开道闸";
+            this.btnOpenDz.UseVisualStyleBackColor = false;
+            this.btnOpenDz.Click += new System.EventHandler(this.btnOpenDz_Click);
+            // 
             // cbJg
             // 
             this.cbJg.AutoSize = true;
             this.cbJg.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.cbJg.ForeColor = System.Drawing.Color.Red;
-            this.cbJg.Location = new System.Drawing.Point(726, 184);
+            this.cbJg.Location = new System.Drawing.Point(19, 184);
             this.cbJg.Name = "cbJg";
             this.cbJg.Size = new System.Drawing.Size(70, 24);
             this.cbJg.TabIndex = 13;
@@ -385,7 +402,7 @@ namespace CarLocalMeter
             this.btnExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnExport.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)), true);
             this.btnExport.ForeColor = System.Drawing.Color.White;
-            this.btnExport.Location = new System.Drawing.Point(488, 176);
+            this.btnExport.Location = new System.Drawing.Point(663, 176);
             this.btnExport.Margin = new System.Windows.Forms.Padding(4);
             this.btnExport.Name = "btnExport";
             this.btnExport.Size = new System.Drawing.Size(138, 40);
@@ -400,10 +417,10 @@ namespace CarLocalMeter
             this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnSave.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)), true);
             this.btnSave.ForeColor = System.Drawing.Color.White;
-            this.btnSave.Location = new System.Drawing.Point(65, 176);
+            this.btnSave.Location = new System.Drawing.Point(97, 176);
             this.btnSave.Margin = new System.Windows.Forms.Padding(4);
             this.btnSave.Name = "btnSave";
-            this.btnSave.Size = new System.Drawing.Size(138, 40);
+            this.btnSave.Size = new System.Drawing.Size(100, 40);
             this.btnSave.TabIndex = 11;
             this.btnSave.Text = "保存";
             this.btnSave.UseVisualStyleBackColor = false;
@@ -415,10 +432,10 @@ namespace CarLocalMeter
             this.btnOpenVoice.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnOpenVoice.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)), true);
             this.btnOpenVoice.ForeColor = System.Drawing.Color.White;
-            this.btnOpenVoice.Location = new System.Drawing.Point(278, 176);
+            this.btnOpenVoice.Location = new System.Drawing.Point(237, 176);
             this.btnOpenVoice.Margin = new System.Windows.Forms.Padding(4);
             this.btnOpenVoice.Name = "btnOpenVoice";
-            this.btnOpenVoice.Size = new System.Drawing.Size(138, 40);
+            this.btnOpenVoice.Size = new System.Drawing.Size(100, 40);
             this.btnOpenVoice.TabIndex = 10;
             this.btnOpenVoice.Text = "打开对讲";
             this.btnOpenVoice.UseVisualStyleBackColor = false;
@@ -834,7 +851,7 @@ namespace CarLocalMeter
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 90F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 222F));
             this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F));
-            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 63F));
+            this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 65F));
             this.tableLayoutPanel7.Controls.Add(this.label1, 5, 0);
             this.tableLayoutPanel7.Controls.Add(this.txtCarNo, 4, 0);
             this.tableLayoutPanel7.Controls.Add(this.cbCarNo, 3, 0);
@@ -858,7 +875,7 @@ namespace CarLocalMeter
             this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.Color.Blue;
-            this.label1.Location = new System.Drawing.Point(742, 1);
+            this.label1.Location = new System.Drawing.Point(740, 1);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(42, 36);
@@ -870,7 +887,7 @@ namespace CarLocalMeter
             // 
             this.txtCarNo.Dock = System.Windows.Forms.DockStyle.Fill;
             this.txtCarNo.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtCarNo.Location = new System.Drawing.Point(518, 3);
+            this.txtCarNo.Location = new System.Drawing.Point(516, 3);
             this.txtCarNo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtCarNo.Name = "txtCarNo";
             this.txtCarNo.Size = new System.Drawing.Size(216, 32);
@@ -918,7 +935,7 @@ namespace CarLocalMeter
             "琼",
             "京",
             "津"});
-            this.cbCarNo.Location = new System.Drawing.Point(427, 3);
+            this.cbCarNo.Location = new System.Drawing.Point(425, 3);
             this.cbCarNo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cbCarNo.Name = "cbCarNo";
             this.cbCarNo.Size = new System.Drawing.Size(84, 31);
@@ -935,7 +952,7 @@ namespace CarLocalMeter
             this.lbPointName.Location = new System.Drawing.Point(86, 1);
             this.lbPointName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lbPointName.Name = "lbPointName";
-            this.lbPointName.Size = new System.Drawing.Size(272, 36);
+            this.lbPointName.Size = new System.Drawing.Size(270, 36);
             this.lbPointName.TabIndex = 3;
             this.lbPointName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
@@ -961,7 +978,7 @@ namespace CarLocalMeter
             this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Blue;
-            this.label2.Location = new System.Drawing.Point(367, 1);
+            this.label2.Location = new System.Drawing.Point(365, 1);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(52, 36);
@@ -972,7 +989,7 @@ namespace CarLocalMeter
             // pbLineOn
             // 
             this.pbLineOn.Image = ((System.Drawing.Image)(resources.GetObject("pbLineOn.Image")));
-            this.pbLineOn.Location = new System.Drawing.Point(792, 4);
+            this.pbLineOn.Location = new System.Drawing.Point(790, 4);
             this.pbLineOn.Name = "pbLineOn";
             this.pbLineOn.Size = new System.Drawing.Size(39, 30);
             this.pbLineOn.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -1089,6 +1106,7 @@ namespace CarLocalMeter
         private System.Windows.Forms.Label lbPntName;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.PictureBox pbLineOn;
+        private System.Windows.Forms.Button btnOpenDz;
     }
 }
 

+ 21 - 3
CarLocalMeter/frmMain.cs

@@ -100,7 +100,6 @@ namespace CarLocalMeter
         int iPic = 0;
 
 
-
         private void frmMain_Load(object sender, EventArgs e)
         {
             CacleCls.updateRfidInfoTime = DateTime.Now;
@@ -160,12 +159,13 @@ namespace CarLocalMeter
                 ce.RealPlay(pb, i);
             }
 
+            if (AppConfigCache.plcStart == "1") plc.Start();
+
             //*
             ping.start();
             upload.start();
             mx.start();
             rfid.Start();
-            //plc.Start();
             imgControl.Start();
             carCls.Login(AppConfigCache.voiceCarNoIp, AppConfigCache.voiceCarNoPort, AppConfigCache.voiceCarNoUid, AppConfigCache.voiceCarNoPwd);
             //*/
@@ -818,6 +818,12 @@ namespace CarLocalMeter
                     _ = BeginInvoke(new Action(() => { shotImageScreen(strGuid); }));
 
                     BindTable();
+
+                    //只需要控制plc即可,其他的不管
+                    if (AppConfigCache.plcStart == "1")
+                    {
+                        plc.DataCollectWrite(AppConfigCache.dz, AppConfigCache.dzValue);
+                    }
                 }
                 #endregion
             }
@@ -961,7 +967,19 @@ namespace CarLocalMeter
 
         private void txtCarNo_KeyDown(object sender, KeyEventArgs e)
         {
-            if(e.KeyCode==Keys.Enter) label3.Focus();
+            if (e.KeyCode == Keys.Enter) label3.Focus();
+        }
+
+        private void btnOpenDz_Click(object sender, EventArgs e)
+        {
+            if (AppConfigCache.plcStart == "1")
+            {
+                plc.DataCollectWrite(AppConfigCache.dz, AppConfigCache.dzValue);
+            }
+            else
+            {
+                MessageBox.Show("当前PLC处于未连接状态,请先配置连接再操作");
+            }
         }
 
         /// <summary>

+ 10 - 0
HnstMeteringSystem.sln

@@ -46,6 +46,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemCollect", "SystemColl
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarLocalMeter", "CarLocalMeter\CarLocalMeter.csproj", "{1A70F24F-2219-453B-A1F1-B31F72048324}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailLocalMeter", "RailLocalMeter\RailLocalMeter.csproj", "{D3B9BA93-8860-444C-AE3C-E0C940518E68}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -228,6 +230,14 @@ Global
 		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|Any CPU.Build.0 = Release|Any CPU
 		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|x86.ActiveCfg = Release|Any CPU
 		{1A70F24F-2219-453B-A1F1-B31F72048324}.Release|x86.Build.0 = Release|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Debug|x86.Build.0 = Debug|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Release|x86.ActiveCfg = Release|Any CPU
+		{D3B9BA93-8860-444C-AE3C-E0C940518E68}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 6 - 0
RailLocalMeter/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 22 - 0
RailLocalMeter/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace RailLocalMeter
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new frmMain());
+        }
+    }
+}

+ 36 - 0
RailLocalMeter/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("RailLocalMeter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("RailLocalMeter")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("d3b9ba93-8860-444c-ae3c-e0c940518e68")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 70 - 0
RailLocalMeter/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace RailLocalMeter.Properties
+{
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [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>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </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("RailLocalMeter.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
RailLocalMeter/Properties/Resources.resx

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

+ 29 - 0
RailLocalMeter/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <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 RailLocalMeter.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 - 0
RailLocalMeter/Properties/Settings.settings

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

+ 80 - 0
RailLocalMeter/RailLocalMeter.csproj

@@ -0,0 +1,80 @@
+<?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>{D3B9BA93-8860-444C-AE3C-E0C940518E68}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>RailLocalMeter</RootNamespace>
+    <AssemblyName>RailLocalMeter</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</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="frmMain.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="frmMain.Designer.cs">
+      <DependentUpon>frmMain.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <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>

+ 41 - 0
RailLocalMeter/frmMain.Designer.cs

@@ -0,0 +1,41 @@
+
+namespace RailLocalMeter
+{
+    partial class frmMain
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Text = "Form1";
+        }
+
+        #endregion
+    }
+}
+

+ 20 - 0
RailLocalMeter/frmMain.cs

@@ -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 RailLocalMeter
+{
+    public partial class frmMain : Form
+    {
+        public frmMain()
+        {
+            InitializeComponent();
+        }
+    }
+}