Преглед изворни кода

将支付方案移至model,合并空闲车位计数与提示信息函数,调整接口。号牌机读取时长debug

yc_t пре 6 година
родитељ
комит
bffe3f63bc
50 измењених фајлова са 811 додато и 645 уклоњено
  1. 2 2
      PLCLinker/PLCConnector/Form1.cs
  2. BIN
      PLCLinker/PLCConnector/PLC/PLCS7.dll
  3. 11 1
      PLCLinker/PLCConnector/PLC/PLCS7.xml
  4. 72 32
      PLCLinker/PLCLinker/Program.cs
  5. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.exe
  6. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.pdb
  7. BIN
      PLCLinker/PLCLinker/bin/Release/PLCS7.dll
  8. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.csprojResolveAssemblyReference.cache
  9. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.exe
  10. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.pdb
  11. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.dll
  12. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.pdb
  13. 10 4
      PLCLinker/PLCS7/entity.cs
  14. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.dll
  15. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.pdb
  16. 2 1
      PLCLinker/centralController/App.config
  17. 98 88
      PLCLinker/centralController/FormCentralController.Designer.cs
  18. 7 6
      PLCLinker/centralController/FormCentralController.cs
  19. 2 2
      PLCLinker/centralController/FormPLCConf.cs
  20. 1 1
      PLCLinker/centralController/Form_paymentScheme.Designer.cs
  21. 3 2
      PLCLinker/centralController/Form_paymentScheme.cs
  22. 0 0
      PLCLinker/centralController/FormPaymentScheme.resx
  23. 51 56
      PLCLinker/centralController/FormRecordsManager.Designer.cs
  24. 3 3
      PLCLinker/centralController/FormRecordsManager.cs
  25. 0 7
      PLCLinker/centralController/Monitor/IMonitor.cs
  26. 40 44
      PLCLinker/centralController/Monitor/Monitor.cs
  27. 16 15
      PLCLinker/centralController/Monitor/SystemInitializer.cs
  28. 49 63
      PLCLinker/centralController/NumMachine/NumMachine.cs
  29. 191 307
      PLCLinker/centralController/Terminal/Terminal.cs
  30. BIN
      PLCLinker/centralController/bin/Release/centralController.exe
  31. 2 1
      PLCLinker/centralController/bin/Release/centralController.exe.config
  32. BIN
      PLCLinker/centralController/bin/Release/centralController.pdb
  33. 6 5
      PLCLinker/centralController/centralController.csproj
  34. 31 0
      PLCLinker/centralController/model/MainModel.cs
  35. 189 0
      PLCLinker/centralController/model/PaymentScheme.cs
  36. 1 1
      PLCLinker/centralController/model/SysConst.cs
  37. 1 1
      PLCLinker/centralController/obj/Release/centralController.csproj.CoreCompileInputs.cache
  38. 1 1
      PLCLinker/centralController/obj/Release/centralController.csproj.FileListAbsolute.txt
  39. BIN
      PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache
  40. BIN
      PLCLinker/centralController/obj/Release/centralController.csprojResolveAssemblyReference.cache
  41. BIN
      PLCLinker/centralController/obj/Release/centralController.exe
  42. BIN
      PLCLinker/centralController/obj/Release/centralController.pdb
  43. BIN
      PLCLinker/centralController/sdk/PLC/PLCS7.dll
  44. 11 1
      PLCLinker/centralController/sdk/PLC/PLCS7.xml
  45. BIN
      PLCLinker/socketTest/bin/Release/socketTest.exe
  46. BIN
      PLCLinker/socketTest/bin/Release/socketTest.pdb
  47. BIN
      PLCLinker/socketTest/obj/Release/socketTest.exe
  48. BIN
      PLCLinker/socketTest/obj/Release/socketTest.pdb
  49. BIN
      resources/PLCS7.dll
  50. 11 1
      resources/PLCS7.xml

+ 2 - 2
PLCLinker/PLCConnector/Form1.cs

@@ -342,11 +342,11 @@ namespace PLCConnector
             short ground = ((TerminalStru)list[0]).groundStatus;
             if (ground == (short)1)
             {
-                pl.WriteAccordingToOffset(PLCDataType.terminal, 36, (short)0);
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 40, (short)0);
             }
             else
             {
-                pl.WriteAccordingToOffset(PLCDataType.terminal, 36, (short)1);
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 40, (short)1);
             }
         }
         /// <summary>

BIN
PLCLinker/PLCConnector/PLC/PLCS7.dll


+ 11 - 1
PLCLinker/PLCConnector/PLC/PLCS7.xml

@@ -148,7 +148,7 @@
         </member>
         <member name="F:PLCS7.TerminalStru.btnStatus">
             <summary>
-            按钮状态,0缺省,1非注册,2注册
+            按钮状态,0缺省,1非注册,2注册,3预约
             </summary>
         </member>
         <member name="F:PLCS7.TerminalStru.cmd">
@@ -201,6 +201,16 @@
             用户类型,0-1普通-2月卡-3季卡-4年卡VIP
             </summary>
         </member>
+        <member name="F:PLCS7.TerminalStru.coordX">
+            <summary>
+            X坐标
+            </summary>
+        </member>
+        <member name="F:PLCS7.TerminalStru.coordY">
+            <summary>
+            Y坐标
+            </summary>
+        </member>
         <member name="F:PLCS7.TerminalStru.groundStatus">
             <summary>
             地感信号

+ 72 - 32
PLCLinker/PLCLinker/Program.cs

@@ -7,6 +7,7 @@ using System.Net;
 using System.Net.Sockets;
 using System.Reflection;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading;
 using System.Threading.Tasks;
 
@@ -14,40 +15,44 @@ namespace PLCTest
 {
     class Program
     {
+        //public static int haha = int.Parse("123456");
         static void Main(string[] args)
         {
-            PLCLinker pl = new PLCLinker(CpuType.S71500, "192.168.10.60", 0, 1, 18, 41, 20, 1, 200);
-            Random rnd = new Random();
-            Task t = Task.Factory.StartNew(() =>
-            {
-                try
-                {
-                    while (true)
-                    {
-                        //parkingSpaceDBTest(pl, rnd);
-                        terminalDBTest(pl, rnd);
-                        //if (!pl.isConnected) { pl.PLCConnect(); }
-                        //else
-                        //{
-                        //    //读终端块数据
-                        //    List<object> tList = pl.ReadFromPLC(PLCDataType.terminal, 1);
-                        //    foreach (var term in tList)
-                        //    {
-                        //        Console.WriteLine(((TerminalStru)term).ToString());
-                        //    }
-                        //    pl.WriteAccordingToOffset(PLCDataType.terminal, 6, (short)rnd.Next(1, 100));
-                        //    pl.WriteAccordingToOffset(PLCDataType.terminal, 8, (short)rnd.Next(1, 100));
-                        //    pl.WriteAccordingToOffset(PLCDataType.terminal, 10, (short)rnd.Next(1, 100));
-                        //    pl.WriteAccordingToOffset(PLCDataType.terminal, 12, (short)rnd.Next(1, 100));
-                        //    pl.WriteAccordingToOffset(PLCDataType.terminal, 14, (short)rnd.Next(1, 100));
-                        //}
-                        Thread.Sleep(500);
-                    }
-                }
-                catch (Exception e) { Console.WriteLine("test:" + e.Message); }
-            });
-            t.Wait();
-
+            #region PLC
+            //PLCLinker pl = new PLCLinker(CpuType.S71500, "192.168.10.60", 0, 1, 18, 41, 20, 1, 200);
+            //Random rnd = new Random();
+            //Task t = Task.Factory.StartNew(() =>
+            //{
+            //    try
+            //    {
+            //        while (true)
+            //        {
+            //            //parkingSpaceDBTest(pl, rnd);
+            //            terminalDBTest(pl, rnd);
+            //            #region ...
+            //            //if (!pl.isConnected) { pl.PLCConnect(); }
+            //            //else
+            //            //{
+            //            //    //读终端块数据
+            //            //    List<object> tList = pl.ReadFromPLC(PLCDataType.terminal, 1);
+            //            //    foreach (var term in tList)
+            //            //    {
+            //            //        Console.WriteLine(((TerminalStru)term).ToString());
+            //            //    }
+            //            //    pl.WriteAccordingToOffset(PLCDataType.terminal, 6, (short)rnd.Next(1, 100));
+            //            //    pl.WriteAccordingToOffset(PLCDataType.terminal, 8, (short)rnd.Next(1, 100));
+            //            //    pl.WriteAccordingToOffset(PLCDataType.terminal, 10, (short)rnd.Next(1, 100));
+            //            //    pl.WriteAccordingToOffset(PLCDataType.terminal, 12, (short)rnd.Next(1, 100));
+            //            //    pl.WriteAccordingToOffset(PLCDataType.terminal, 14, (short)rnd.Next(1, 100));
+            //            //}
+            //            #endregion
+            //            Thread.Sleep(500);
+            //        }
+            //    }
+            //    catch (Exception e) { Console.WriteLine("test:" + e.Message); }
+            //});
+            //t.Wait();
+            #region ...
             //try
             //{
             //    TcpClient client = new TcpClient();
@@ -68,6 +73,24 @@ namespace PLCTest
             //    AbstractPLCLinker plc = instance as AbstractPLCLinker;
             //    Console.WriteLine(plc.isConnected);
             //}
+            #endregion
+            #endregion
+            //string strs = "1933939Ben";
+            //Regex regNum = new Regex(@"[0-9]+");
+            //Regex regChar = new Regex(@"[^0-9]+");
+            //string[] result = new string[2];
+            //result[0] = regChar.Replace(strs, "");
+            //result[1] = regNum.Replace(strs, "");
+            //Console.WriteLine(result[0]+","+result[1]);
+            //Task.Factory.StartNew(() =>
+            //{
+            //    PrintWord("a", 100);
+            //});
+            //Task.Factory.StartNew(() =>
+            //{
+            //    PrintWord("bbb", 300);
+            //});
+            //Console.WriteLine(haha);
             Console.ReadLine();
         }
         public static void parkingSpaceDBTest(AbstractPLCLinker pl, Random rnd)
@@ -129,5 +152,22 @@ namespace PLCTest
                 //pl.WriteToPLC(tsTerminal, PLCDataType.terminal);
             }
         }
+
+        public static void PrintWord(string word, int delay)
+        {
+            Task.Factory.StartNew(() =>
+            {
+                for (int i = 0; i < 1000; i++)
+                {
+                    Console.WriteLine(word + "--" + i);
+                    Console.WriteLine(word + "--" + i);
+                    Console.WriteLine(word + "--" + i);
+                    Thread.Sleep(delay);
+                    Console.WriteLine(word + "--" + i);
+                    Console.WriteLine(word + "--" + i);
+                    //Thread.Sleep(delay);
+                }
+            }).Wait();
+        }
     }
 }

BIN
PLCLinker/PLCLinker/bin/Release/PLCLinker.exe


BIN
PLCLinker/PLCLinker/bin/Release/PLCLinker.pdb


BIN
PLCLinker/PLCLinker/bin/Release/PLCS7.dll


BIN
PLCLinker/PLCLinker/obj/Release/PLCLinker.csprojResolveAssemblyReference.cache


BIN
PLCLinker/PLCLinker/obj/Release/PLCLinker.exe


BIN
PLCLinker/PLCLinker/obj/Release/PLCLinker.pdb


BIN
PLCLinker/PLCS7/bin/Release/PLCS7.dll


BIN
PLCLinker/PLCS7/bin/Release/PLCS7.pdb


+ 10 - 4
PLCLinker/PLCS7/entity.cs

@@ -20,7 +20,7 @@ namespace PLCS7
         /// </summary>
         public short terminalStatus;//终端写入
         /// <summary>
-        /// 按钮状态,0缺省,1非注册,2注册
+        /// 按钮状态,0缺省,1非注册,2注册,3预约
         /// </summary>
         public short btnStatus;//终端写入
         /// <summary>
@@ -64,17 +64,23 @@ namespace PLCS7
         /// </summary>
         public short userType;//中控写入,34
         /// <summary>
-        /// 地感信号
+        /// X坐标
         /// </summary>
-        public short groundStatus;
         public short coordX;//PLC
+        /// <summary>
+        /// Y坐标
+        /// </summary>
         public short coordY;//PLC
+        /// <summary>
+        /// 地感信号
+        /// </summary>
+        public short groundStatus;
 
         public override string ToString()
         {
             return "[终端id(0):" + terminalID + ",终端状态(2):" + terminalStatus + ",按钮状态(4):" + btnStatus + ",终端指令(6):" + cmd + ",用户id(8):" + licenseCodeA + ","
                 + licenseCodeB + "," + licenseCodeC + "," + licenseCodeD + ",凭证号(24):" + receiptNum + ",支付状态(28):" + paymentStatus
-                + ",号牌验证(30):" + licVerification + ",停车费用(32):" + parkingFee + ",用户类型(34):" + userType + ",地感信号(36):" + groundStatus +",X坐标(38):"+coordX+",Y坐标(40):"+coordY+"]";
+                + ",号牌验证(30):" + licVerification + ",停车费用(32):" + parkingFee + ",用户类型(34):" + userType  +",X坐标(36):"+coordX+",Y坐标(38):"+coordY + ",地感信号(40):" + groundStatus + "]";
         }
 
         public override bool Equals(object obj)

BIN
PLCLinker/PLCS7/obj/Release/PLCS7.dll


BIN
PLCLinker/PLCS7/obj/Release/PLCS7.pdb


+ 2 - 1
PLCLinker/centralController/App.config

@@ -8,7 +8,8 @@
     <!--数据库信息-->
     <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark;CharSet=utf8;Allow Zero Datetime=true;"/>-->
     <!--<add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <!--<add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
+    <add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="localDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_local;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="DBtimeout" value="3"/>
     <!--号牌机信息-->

+ 98 - 88
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -35,17 +35,18 @@
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
             this.dockSite_mainView = new DevComponents.DotNetBar.DockSite();
             this.bar_mainWin = new DevComponents.DotNetBar.Bar();
-            this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
-            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.testPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
             this.button1 = new System.Windows.Forms.Button();
             this.textBox2 = new System.Windows.Forms.TextBox();
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
+            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
@@ -121,10 +122,10 @@
             this.dockSite_mainView.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
             this.bar_mainWin.SuspendLayout();
-            this.NumMachineMonitorPanel.SuspendLayout();
             this.testPanel.SuspendLayout();
             this.tableLayoutPanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+            this.NumMachineMonitorPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).BeginInit();
             this.bar_bottom.SuspendLayout();
             this.RecordsMonitorPanel.SuspendLayout();
@@ -186,12 +187,12 @@
             this.dockSite_mainView.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dockSite_mainView.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
             ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
-                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_mainWin, 524, 331))),
-                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_side, 344, 331)))}, DevComponents.DotNetBar.eOrientation.Horizontal))),
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_mainWin, 524, 324))),
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_side, 344, 324)))}, DevComponents.DotNetBar.eOrientation.Horizontal))),
             ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_bottom, 871, 181)))}, DevComponents.DotNetBar.eOrientation.Vertical);
-            this.dockSite_mainView.Location = new System.Drawing.Point(0, 114);
+            this.dockSite_mainView.Location = new System.Drawing.Point(0, 127);
             this.dockSite_mainView.Name = "dockSite_mainView";
-            this.dockSite_mainView.Size = new System.Drawing.Size(871, 554);
+            this.dockSite_mainView.Size = new System.Drawing.Size(871, 541);
             this.dockSite_mainView.TabIndex = 8;
             this.dockSite_mainView.TabStop = false;
             // 
@@ -208,10 +209,10 @@
             this.bar_mainWin.CanDockRight = false;
             this.bar_mainWin.CanDockTop = false;
             this.bar_mainWin.CanHide = true;
-            this.bar_mainWin.Controls.Add(this.NumMachineMonitorPanel);
             this.bar_mainWin.Controls.Add(this.testPanel);
-            this.bar_mainWin.Controls.Add(this.ParkingSpaceMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.NumMachineMonitorPanel);
             this.bar_mainWin.Controls.Add(this.paymentPanel);
+            this.bar_mainWin.Controls.Add(this.ParkingSpaceMonitorPanel);
             this.bar_mainWin.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
             this.bar_mainWin.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bar_mainWin.IsMaximized = false;
@@ -223,67 +224,18 @@
             this.bar_mainWin.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
             this.bar_mainWin.Location = new System.Drawing.Point(0, 0);
             this.bar_mainWin.Name = "bar_mainWin";
-            this.bar_mainWin.SelectedDockTab = 0;
+            this.bar_mainWin.SelectedDockTab = 3;
             this.bar_mainWin.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.bar_mainWin.Size = new System.Drawing.Size(524, 331);
+            this.bar_mainWin.Size = new System.Drawing.Size(524, 324);
             this.bar_mainWin.Stretch = true;
             this.bar_mainWin.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_mainWin.TabIndex = 0;
             this.bar_mainWin.TabNavigation = true;
             this.bar_mainWin.TabStop = false;
             // 
-            // NumMachineMonitorPanel
-            // 
-            this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
-            this.NumMachineMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.NumMachineMonitorPanel.Location = new System.Drawing.Point(3, 28);
-            this.NumMachineMonitorPanel.Name = "NumMachineMonitorPanel";
-            this.NumMachineMonitorPanel.Size = new System.Drawing.Size(518, 300);
-            this.NumMachineMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.NumMachineMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.NumMachineMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.NumMachineMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.NumMachineMonitorPanel.Style.GradientAngle = 90;
-            this.NumMachineMonitorPanel.TabIndex = 0;
-            // 
-            // flowLayoutPanel1
-            // 
-            this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
-            this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
-            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
-            this.flowLayoutPanel1.Size = new System.Drawing.Size(518, 300);
-            this.flowLayoutPanel1.TabIndex = 1;
-            this.flowLayoutPanel1.Resize += new System.EventHandler(this.flowLayoutPanel1_Resize);
-            // 
-            // paymentPanel
-            // 
-            this.paymentPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.paymentPanel.Location = new System.Drawing.Point(3, 28);
-            this.paymentPanel.Name = "paymentPanel";
-            this.paymentPanel.Size = new System.Drawing.Size(518, 300);
-            this.paymentPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.paymentPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.paymentPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.paymentPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.paymentPanel.Style.GradientAngle = 90;
-            this.paymentPanel.TabIndex = 24;
-            // 
-            // ParkingSpaceMonitorPanel
-            // 
-            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
-            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
-            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(518, 300);
-            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
-            this.ParkingSpaceMonitorPanel.TabIndex = 9;
-            // 
             // testPanel
             // 
+            this.testPanel.Controls.Add(this.dateTimePicker1);
             this.testPanel.Controls.Add(this.button1);
             this.testPanel.Controls.Add(this.textBox2);
             this.testPanel.Controls.Add(this.textBox1);
@@ -291,7 +243,7 @@
             this.testPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.testPanel.Location = new System.Drawing.Point(3, 28);
             this.testPanel.Name = "testPanel";
-            this.testPanel.Size = new System.Drawing.Size(518, 300);
+            this.testPanel.Size = new System.Drawing.Size(518, 293);
             this.testPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
             this.testPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
             this.testPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
@@ -299,6 +251,13 @@
             this.testPanel.Style.GradientAngle = 90;
             this.testPanel.TabIndex = 38;
             // 
+            // dateTimePicker1
+            // 
+            this.dateTimePicker1.Location = new System.Drawing.Point(257, 108);
+            this.dateTimePicker1.Name = "dateTimePicker1";
+            this.dateTimePicker1.Size = new System.Drawing.Size(200, 21);
+            this.dateTimePicker1.TabIndex = 7;
+            // 
             // button1
             // 
             this.button1.Location = new System.Drawing.Point(151, 43);
@@ -359,6 +318,56 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
+            // paymentPanel
+            // 
+            this.paymentPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.paymentPanel.Location = new System.Drawing.Point(3, 28);
+            this.paymentPanel.Name = "paymentPanel";
+            this.paymentPanel.Size = new System.Drawing.Size(518, 293);
+            this.paymentPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.paymentPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.paymentPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.paymentPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.paymentPanel.Style.GradientAngle = 90;
+            this.paymentPanel.TabIndex = 24;
+            // 
+            // ParkingSpaceMonitorPanel
+            // 
+            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
+            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
+            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(518, 293);
+            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
+            this.ParkingSpaceMonitorPanel.TabIndex = 9;
+            // 
+            // NumMachineMonitorPanel
+            // 
+            this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
+            this.NumMachineMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.NumMachineMonitorPanel.Location = new System.Drawing.Point(3, 28);
+            this.NumMachineMonitorPanel.Name = "NumMachineMonitorPanel";
+            this.NumMachineMonitorPanel.Size = new System.Drawing.Size(518, 293);
+            this.NumMachineMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.NumMachineMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.NumMachineMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.NumMachineMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.NumMachineMonitorPanel.Style.GradientAngle = 90;
+            this.NumMachineMonitorPanel.TabIndex = 0;
+            // 
+            // flowLayoutPanel1
+            // 
+            this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
+            this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+            this.flowLayoutPanel1.Size = new System.Drawing.Size(518, 293);
+            this.flowLayoutPanel1.TabIndex = 1;
+            this.flowLayoutPanel1.Resize += new System.EventHandler(this.flowLayoutPanel1_Resize);
+            // 
             // dci_NumMachine
             // 
             this.dci_NumMachine.Control = this.NumMachineMonitorPanel;
@@ -404,10 +413,10 @@
             this.bar_bottom.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_ParkingRecords});
             this.bar_bottom.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar_bottom.Location = new System.Drawing.Point(0, 334);
+            this.bar_bottom.Location = new System.Drawing.Point(0, 327);
             this.bar_bottom.Name = "bar_bottom";
             this.bar_bottom.SelectedDockTab = 0;
-            this.bar_bottom.Size = new System.Drawing.Size(871, 220);
+            this.bar_bottom.Size = new System.Drawing.Size(871, 214);
             this.bar_bottom.Stretch = true;
             this.bar_bottom.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_bottom.TabIndex = 1;
@@ -419,7 +428,7 @@
             this.RecordsMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.RecordsMonitorPanel.Location = new System.Drawing.Point(3, 28);
             this.RecordsMonitorPanel.Name = "RecordsMonitorPanel";
-            this.RecordsMonitorPanel.Size = new System.Drawing.Size(865, 189);
+            this.RecordsMonitorPanel.Size = new System.Drawing.Size(865, 183);
             this.RecordsMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
             this.RecordsMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
             this.RecordsMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
@@ -453,7 +462,7 @@
             this.dgvx_parkingRecords.Location = new System.Drawing.Point(0, 0);
             this.dgvx_parkingRecords.Name = "dgvx_parkingRecords";
             this.dgvx_parkingRecords.RowTemplate.Height = 23;
-            this.dgvx_parkingRecords.Size = new System.Drawing.Size(865, 189);
+            this.dgvx_parkingRecords.Size = new System.Drawing.Size(865, 183);
             this.dgvx_parkingRecords.TabIndex = 0;
             // 
             // parkingRecordsID
@@ -554,7 +563,7 @@
             this.bar_side.Location = new System.Drawing.Point(527, 0);
             this.bar_side.Name = "bar_side";
             this.bar_side.SelectedDockTab = 0;
-            this.bar_side.Size = new System.Drawing.Size(344, 331);
+            this.bar_side.Size = new System.Drawing.Size(344, 324);
             this.bar_side.Stretch = true;
             this.bar_side.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_side.TabIndex = 2;
@@ -565,7 +574,7 @@
             this.terminalMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.terminalMonitorPanel.Location = new System.Drawing.Point(3, 28);
             this.terminalMonitorPanel.Name = "terminalMonitorPanel";
-            this.terminalMonitorPanel.Size = new System.Drawing.Size(338, 300);
+            this.terminalMonitorPanel.Size = new System.Drawing.Size(338, 293);
             this.terminalMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
             this.terminalMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
             this.terminalMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
@@ -598,10 +607,10 @@
             this.dockSite_notification.Controls.Add(this.bar_notification);
             this.dockSite_notification.Dock = System.Windows.Forms.DockStyle.Right;
             this.dockSite_notification.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
-            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_notification, 320, 554)))}, DevComponents.DotNetBar.eOrientation.Vertical);
-            this.dockSite_notification.Location = new System.Drawing.Point(871, 114);
+            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_notification, 320, 541)))}, DevComponents.DotNetBar.eOrientation.Vertical);
+            this.dockSite_notification.Location = new System.Drawing.Point(871, 127);
             this.dockSite_notification.Name = "dockSite_notification";
-            this.dockSite_notification.Size = new System.Drawing.Size(323, 554);
+            this.dockSite_notification.Size = new System.Drawing.Size(323, 541);
             this.dockSite_notification.TabIndex = 1;
             this.dockSite_notification.TabStop = false;
             // 
@@ -621,7 +630,7 @@
             this.bar_notification.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
             this.bar_notification.Location = new System.Drawing.Point(3, 0);
             this.bar_notification.Name = "bar_notification";
-            this.bar_notification.Size = new System.Drawing.Size(320, 554);
+            this.bar_notification.Size = new System.Drawing.Size(320, 541);
             this.bar_notification.Stretch = true;
             this.bar_notification.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_notification.TabIndex = 1;
@@ -635,7 +644,7 @@
             this.warningPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.warningPanel.Location = new System.Drawing.Point(3, 23);
             this.warningPanel.Name = "warningPanel";
-            this.warningPanel.Size = new System.Drawing.Size(314, 528);
+            this.warningPanel.Size = new System.Drawing.Size(314, 515);
             this.warningPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
             this.warningPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
             this.warningPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
@@ -661,13 +670,13 @@
             this.tbx_notification.PreventEnterBeep = true;
             this.tbx_notification.ReadOnly = true;
             this.tbx_notification.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.tbx_notification.Size = new System.Drawing.Size(314, 507);
+            this.tbx_notification.Size = new System.Drawing.Size(314, 494);
             this.tbx_notification.TabIndex = 0;
             // 
             // progressBar1
             // 
             this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.progressBar1.Location = new System.Drawing.Point(0, 507);
+            this.progressBar1.Location = new System.Drawing.Point(0, 494);
             this.progressBar1.Name = "progressBar1";
             this.progressBar1.Size = new System.Drawing.Size(314, 21);
             this.progressBar1.Step = 20;
@@ -718,7 +727,7 @@
             this.dockSite_menu.Dock = System.Windows.Forms.DockStyle.Top;
             this.dockSite_menu.Location = new System.Drawing.Point(0, 0);
             this.dockSite_menu.Name = "dockSite_menu";
-            this.dockSite_menu.Size = new System.Drawing.Size(1194, 114);
+            this.dockSite_menu.Size = new System.Drawing.Size(1194, 127);
             this.dockSite_menu.TabIndex = 6;
             this.dockSite_menu.TabStop = false;
             // 
@@ -728,7 +737,6 @@
             this.bar_Menu.AccessibleName = "DotNetBar Bar";
             this.bar_Menu.AccessibleRole = System.Windows.Forms.AccessibleRole.MenuBar;
             this.bar_Menu.DockSide = DevComponents.DotNetBar.eDockSide.Top;
-            this.bar_Menu.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.bar_Menu.IsMaximized = false;
             this.bar_Menu.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.btn_system,
@@ -739,7 +747,7 @@
             this.bar_Menu.Location = new System.Drawing.Point(0, 0);
             this.bar_Menu.MenuBar = true;
             this.bar_Menu.Name = "bar_Menu";
-            this.bar_Menu.Size = new System.Drawing.Size(1194, 24);
+            this.bar_Menu.Size = new System.Drawing.Size(1194, 32);
             this.bar_Menu.Stretch = true;
             this.bar_Menu.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_Menu.TabIndex = 0;
@@ -913,10 +921,11 @@
             this.bar_shortcut.AccessibleRole = System.Windows.Forms.AccessibleRole.MenuBar;
             this.bar_shortcut.AutoHide = true;
             this.bar_shortcut.AutoHideAnimationTime = 300;
+            this.bar_shortcut.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
             this.bar_shortcut.Controls.Add(this.panel_freeSpace);
             this.bar_shortcut.DockLine = 1;
             this.bar_shortcut.DockSide = DevComponents.DotNetBar.eDockSide.Top;
-            this.bar_shortcut.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.bar_shortcut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bar_shortcut.IsMaximized = false;
             this.bar_shortcut.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.shortcut_login,
@@ -924,10 +933,10 @@
             this.shortcut_sysInfo,
             this.shortcut_about,
             this.shortcut_close});
-            this.bar_shortcut.Location = new System.Drawing.Point(0, 25);
+            this.bar_shortcut.Location = new System.Drawing.Point(0, 33);
             this.bar_shortcut.MenuBar = true;
             this.bar_shortcut.Name = "bar_shortcut";
-            this.bar_shortcut.Size = new System.Drawing.Size(1194, 88);
+            this.bar_shortcut.Size = new System.Drawing.Size(1194, 93);
             this.bar_shortcut.Stretch = true;
             this.bar_shortcut.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_shortcut.TabIndex = 1;
@@ -940,12 +949,12 @@
             this.panel_freeSpace.Dock = System.Windows.Forms.DockStyle.Right;
             this.panel_freeSpace.Location = new System.Drawing.Point(874, 0);
             this.panel_freeSpace.Name = "panel_freeSpace";
-            this.panel_freeSpace.Size = new System.Drawing.Size(320, 88);
+            this.panel_freeSpace.Size = new System.Drawing.Size(320, 93);
             this.panel_freeSpace.TabIndex = 3;
             // 
             // lbx_freeSpace
             // 
-            this.lbx_freeSpace.BackColor = System.Drawing.SystemColors.WindowFrame;
+            this.lbx_freeSpace.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
             // 
             // 
             // 
@@ -953,10 +962,10 @@
             this.lbx_freeSpace.Dock = System.Windows.Forms.DockStyle.Fill;
             this.lbx_freeSpace.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lbx_freeSpace.FontBold = true;
-            this.lbx_freeSpace.ForeColor = System.Drawing.SystemColors.ActiveCaption;
+            this.lbx_freeSpace.ForeColor = System.Drawing.Color.Tomato;
             this.lbx_freeSpace.Location = new System.Drawing.Point(0, 0);
             this.lbx_freeSpace.Name = "lbx_freeSpace";
-            this.lbx_freeSpace.Size = new System.Drawing.Size(320, 88);
+            this.lbx_freeSpace.Size = new System.Drawing.Size(320, 93);
             this.lbx_freeSpace.TabIndex = 2;
             this.lbx_freeSpace.Text = "currentFreeSpace";
             this.lbx_freeSpace.TextAlignment = System.Drawing.StringAlignment.Center;
@@ -1149,11 +1158,11 @@
             this.dockSite_mainView.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).EndInit();
             this.bar_mainWin.ResumeLayout(false);
-            this.NumMachineMonitorPanel.ResumeLayout(false);
             this.testPanel.ResumeLayout(false);
             this.testPanel.PerformLayout();
             this.tableLayoutPanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+            this.NumMachineMonitorPanel.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).EndInit();
             this.bar_bottom.ResumeLayout(false);
             this.RecordsMonitorPanel.ResumeLayout(false);
@@ -1262,6 +1271,7 @@
         private DevComponents.DotNetBar.ButtonItem shortcut_sysInfo;
         private DevComponents.DotNetBar.ButtonItem shortcut_about;
         private DevComponents.DotNetBar.ButtonItem btn_advertUpdate;
+        private System.Windows.Forms.DateTimePicker dateTimePicker1;
     }
 }
 

+ 7 - 6
PLCLinker/centralController/FormCentralController.cs

@@ -25,8 +25,9 @@ namespace centralController
             if (Monitor.Monitor.ins == null)
             {
                 Monitor.Monitor.ins = new Monitor.Monitor(flowLayoutPanel1.Handle);
-                Monitor.Monitor.ins.Start();
             }
+            Monitor.Monitor.ins.Start();
+
             //进度条测试
             Task.Factory.StartNew(() =>
             {
@@ -153,7 +154,7 @@ namespace centralController
         /// <param name="e"></param>
         private void btn_setScheme_Click(object sender, EventArgs e)
         {
-            Form_paymentScheme form_PaymentScheme = new Form_paymentScheme();
+            FormPaymentScheme form_PaymentScheme = new FormPaymentScheme();
             form_PaymentScheme.ShowDialog();
         }
         /// <summary>
@@ -279,7 +280,7 @@ namespace centralController
         /// <param name="e"></param>
         private void UpdateText(object sender, EventArgs e)
         {
-            tbx_notification.Text = Monitor.Monitor.GetNotification();
+            tbx_notification.Text = Monitor.Monitor.ins.GetNotification();
             tbx_notification.ScrollToCaret();
         }
         /// <summary>
@@ -290,8 +291,8 @@ namespace centralController
         private void UpdateFreeSpace(object sender, EventArgs e)
         {
             string currentTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-            string freeSpace = "剩余车位:" + Monitor.Monitor.GetFreeSpaceCount();
-            string bookableSpace = "可预约车位:" + Monitor.Monitor.GetBookableSpaceCount();
+            string freeSpace = "剩余车位:" + Monitor.Monitor.ins.GetFreeSpaceCount(0);
+            string bookableSpace = "可预约车位:" + Monitor.Monitor.ins.GetFreeSpaceCount(2);
             lbx_freeSpace.Text = currentTime + "\r\n" + freeSpace + "     " + bookableSpace;
         }
         /// <summary>
@@ -413,7 +414,7 @@ namespace centralController
                     {
                         tlpCC[0].Width = (int)(flpCC[i].Width * 0.95);
                         tlpCC[0].Height = (int)(flpCC[i].Height * 0.79);
-                        tlpCC[1].Width = (int)(flpCC[i].Width*0.95);
+                        tlpCC[1].Width = (int)(flpCC[i].Width * 0.95);
                         tlpCC[1].Height = (int)(flpCC[i].Height * 0.20);
                     }
                 }

+ 2 - 2
PLCLinker/centralController/FormPLCConf.cs

@@ -333,11 +333,11 @@ namespace PLCConnector
             short ground = ((TerminalStru)list[0]).groundStatus;
             if (ground == (short)1)
             {
-                pl.WriteAccordingToOffset(PLCDataType.terminal, 36, (short)0);
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 40, (short)0);
             }
             else
             {
-                pl.WriteAccordingToOffset(PLCDataType.terminal, 36, (short)1);
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 40, (short)1);
             }
         }
         /// <summary>

+ 1 - 1
PLCLinker/centralController/Form_paymentScheme.Designer.cs

@@ -1,6 +1,6 @@
 namespace centralController
 {
-    partial class Form_paymentScheme
+    partial class FormPaymentScheme
     {
         /// <summary>
         /// Required designer variable.

+ 3 - 2
PLCLinker/centralController/Form_paymentScheme.cs

@@ -5,15 +5,16 @@ using System.Data;
 using System.Drawing;
 using System.Text;
 using System.Windows.Forms;
+using centralController.model;
 using DevComponents.DotNetBar;
 using DevComponents.DotNetBar.Controls;
 using Terminal;
 
 namespace centralController
 {
-    public partial class Form_paymentScheme : DevComponents.DotNetBar.OfficeForm
+    public partial class FormPaymentScheme : DevComponents.DotNetBar.OfficeForm
     {
-        public Form_paymentScheme()
+        public FormPaymentScheme()
         {
             InitializeComponent();
         }

PLCLinker/centralController/Form_paymentScheme.resx → PLCLinker/centralController/FormPaymentScheme.resx


+ 51 - 56
PLCLinker/centralController/FormRecordsManager.Designer.cs

@@ -42,18 +42,18 @@
             this.receiptNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.parkingPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
-            this.mtb_endDate = new System.Windows.Forms.MaskedTextBox();
             this.lbx_startDate = new DevComponents.DotNetBar.LabelX();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
-            this.mtb_startDate = new System.Windows.Forms.MaskedTextBox();
             this.btnx_parkingRecordSearch = new DevComponents.DotNetBar.ButtonX();
             this.btnx_export = new DevComponents.DotNetBar.ButtonX();
+            this.labelX2 = new DevComponents.DotNetBar.LabelX();
+            this.tb_license = new System.Windows.Forms.TextBox();
             this.sti_parkingRecords = new DevComponents.DotNetBar.SuperTabItem();
             this.superTabControlPanel3 = new DevComponents.DotNetBar.SuperTabControlPanel();
             this.sti_dailySummary = new DevComponents.DotNetBar.SuperTabItem();
             this.sti_carRecords = new DevComponents.DotNetBar.SuperTabItem();
-            this.labelX2 = new DevComponents.DotNetBar.LabelX();
-            this.tb_license = new System.Windows.Forms.TextBox();
+            this.dtp_startDate = new System.Windows.Forms.DateTimePicker();
+            this.dtp_endDate = new System.Windows.Forms.DateTimePicker();
             ((System.ComponentModel.ISupportInitialize)(this.stc_recordManager)).BeginInit();
             this.stc_recordManager.SuspendLayout();
             this.superTabControlPanel1.SuspendLayout();
@@ -232,16 +232,17 @@
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
-            this.tableLayoutPanel1.Controls.Add(this.mtb_endDate, 3, 0);
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 83F));
+            this.tableLayoutPanel1.Controls.Add(this.dtp_endDate, 3, 0);
             this.tableLayoutPanel1.Controls.Add(this.lbx_startDate, 0, 0);
             this.tableLayoutPanel1.Controls.Add(this.labelX1, 2, 0);
-            this.tableLayoutPanel1.Controls.Add(this.mtb_startDate, 1, 0);
             this.tableLayoutPanel1.Controls.Add(this.btnx_parkingRecordSearch, 6, 0);
             this.tableLayoutPanel1.Controls.Add(this.btnx_export, 7, 0);
             this.tableLayoutPanel1.Controls.Add(this.labelX2, 4, 0);
             this.tableLayoutPanel1.Controls.Add(this.tb_license, 5, 0);
+            this.tableLayoutPanel1.Controls.Add(this.dtp_startDate, 1, 0);
             this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tableLayoutPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
             this.tableLayoutPanel1.RowCount = 1;
@@ -249,19 +250,6 @@
             this.tableLayoutPanel1.Size = new System.Drawing.Size(844, 63);
             this.tableLayoutPanel1.TabIndex = 2;
             // 
-            // mtb_endDate
-            // 
-            this.mtb_endDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-            this.mtb_endDate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mtb_endDate.Location = new System.Drawing.Point(316, 17);
-            this.mtb_endDate.Mask = "0000年00月00日";
-            this.mtb_endDate.Name = "mtb_endDate";
-            this.mtb_endDate.ShortcutsEnabled = false;
-            this.mtb_endDate.Size = new System.Drawing.Size(137, 29);
-            this.mtb_endDate.TabIndex = 6;
-            this.mtb_endDate.Text = "20181020";
-            this.mtb_endDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
             // lbx_startDate
             // 
             // 
@@ -284,32 +272,19 @@
             this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
             this.labelX1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.labelX1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.labelX1.Location = new System.Drawing.Point(231, 3);
+            this.labelX1.Location = new System.Drawing.Point(230, 3);
             this.labelX1.Name = "labelX1";
             this.labelX1.Size = new System.Drawing.Size(79, 57);
             this.labelX1.TabIndex = 4;
             this.labelX1.Text = "截止日期:";
             // 
-            // mtb_startDate
-            // 
-            this.mtb_startDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-            this.mtb_startDate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mtb_startDate.Location = new System.Drawing.Point(88, 17);
-            this.mtb_startDate.Mask = "0000年00月00日";
-            this.mtb_startDate.Name = "mtb_startDate";
-            this.mtb_startDate.ShortcutsEnabled = false;
-            this.mtb_startDate.Size = new System.Drawing.Size(137, 29);
-            this.mtb_startDate.TabIndex = 5;
-            this.mtb_startDate.Text = "20180920";
-            this.mtb_startDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
             // btnx_parkingRecordSearch
             // 
             this.btnx_parkingRecordSearch.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
             this.btnx_parkingRecordSearch.Anchor = System.Windows.Forms.AnchorStyles.Left;
             this.btnx_parkingRecordSearch.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
             this.btnx_parkingRecordSearch.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnx_parkingRecordSearch.Location = new System.Drawing.Point(686, 14);
+            this.btnx_parkingRecordSearch.Location = new System.Drawing.Point(683, 14);
             this.btnx_parkingRecordSearch.Name = "btnx_parkingRecordSearch";
             this.btnx_parkingRecordSearch.Size = new System.Drawing.Size(74, 35);
             this.btnx_parkingRecordSearch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -323,7 +298,7 @@
             this.btnx_export.Anchor = System.Windows.Forms.AnchorStyles.Left;
             this.btnx_export.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
             this.btnx_export.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnx_export.Location = new System.Drawing.Point(766, 14);
+            this.btnx_export.Location = new System.Drawing.Point(763, 14);
             this.btnx_export.Name = "btnx_export";
             this.btnx_export.Size = new System.Drawing.Size(75, 35);
             this.btnx_export.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -331,6 +306,28 @@
             this.btnx_export.Text = "导出";
             this.btnx_export.Click += new System.EventHandler(this.btnx_parkingRecrodExport_Click);
             // 
+            // labelX2
+            // 
+            // 
+            // 
+            // 
+            this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.labelX2.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.labelX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.labelX2.Location = new System.Drawing.Point(457, 3);
+            this.labelX2.Name = "labelX2";
+            this.labelX2.Size = new System.Drawing.Size(79, 57);
+            this.labelX2.TabIndex = 9;
+            this.labelX2.Text = "车辆号牌:";
+            // 
+            // tb_license
+            // 
+            this.tb_license.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.tb_license.Location = new System.Drawing.Point(542, 18);
+            this.tb_license.Name = "tb_license";
+            this.tb_license.Size = new System.Drawing.Size(135, 26);
+            this.tb_license.TabIndex = 10;
+            // 
             // sti_parkingRecords
             // 
             this.sti_parkingRecords.AttachedControl = this.superTabControlPanel1;
@@ -360,27 +357,25 @@
             this.sti_carRecords.Name = "sti_carRecords";
             this.sti_carRecords.Text = "车辆停取记录";
             // 
-            // labelX2
-            // 
+            // dtp_startDate
             // 
+            this.dtp_startDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.dtp_startDate.CalendarFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dtp_startDate.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dtp_startDate.Location = new System.Drawing.Point(88, 18);
+            this.dtp_startDate.Name = "dtp_startDate";
+            this.dtp_startDate.Size = new System.Drawing.Size(136, 26);
+            this.dtp_startDate.TabIndex = 11;
             // 
+            // dtp_endDate
             // 
-            this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.labelX2.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.labelX2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.labelX2.Location = new System.Drawing.Point(459, 3);
-            this.labelX2.Name = "labelX2";
-            this.labelX2.Size = new System.Drawing.Size(79, 57);
-            this.labelX2.TabIndex = 9;
-            this.labelX2.Text = "车辆号牌:";
-            // 
-            // tb_license
-            // 
-            this.tb_license.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-            this.tb_license.Location = new System.Drawing.Point(544, 21);
-            this.tb_license.Name = "tb_license";
-            this.tb_license.Size = new System.Drawing.Size(136, 21);
-            this.tb_license.TabIndex = 10;
+            this.dtp_endDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+            this.dtp_endDate.CalendarFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dtp_endDate.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dtp_endDate.Location = new System.Drawing.Point(315, 18);
+            this.dtp_endDate.Name = "dtp_endDate";
+            this.dtp_endDate.Size = new System.Drawing.Size(136, 26);
+            this.dtp_endDate.TabIndex = 12;
             // 
             // FormRecordsManager
             // 
@@ -419,8 +414,6 @@
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
         private DevComponents.DotNetBar.LabelX lbx_startDate;
         private DevComponents.DotNetBar.LabelX labelX1;
-        private System.Windows.Forms.MaskedTextBox mtb_endDate;
-        private System.Windows.Forms.MaskedTextBox mtb_startDate;
         private DevComponents.DotNetBar.ButtonX btnx_parkingRecordSearch;
         private DevComponents.DotNetBar.ButtonX btnx_export;
         private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel3;
@@ -428,5 +421,7 @@
         private DevComponents.DotNetBar.SuperTabItem sti_carRecords;
         private DevComponents.DotNetBar.LabelX labelX2;
         private System.Windows.Forms.TextBox tb_license;
+        private System.Windows.Forms.DateTimePicker dtp_endDate;
+        private System.Windows.Forms.DateTimePicker dtp_startDate;
     }
 }

+ 3 - 3
PLCLinker/centralController/FormRecordsManager.cs

@@ -27,14 +27,14 @@ namespace centralController
             string license="";
             try
             {
-                start = DateTime.Parse(mtb_startDate.Text);
-                end = DateTime.Parse(mtb_endDate.Text);
+                start = DateTime.Parse(dtp_startDate.Text);
+                end = DateTime.Parse(dtp_endDate.Text);
                 license = tb_license.Text;
             }
             catch { MessageBox.Show("日期输入异常,请重新输入");return; }
 
             dgvx_parkingRecords.Rows.Clear();
-            List<object[]> list = Monitor.Monitor.GetParkingRecords(license,start.ToString("yyyy-MM-dd"), end.ToString("yyyy-MM-dd"));
+            List<object[]> list = Monitor.Monitor.GetParkingRecords(license,start.ToString("yyyy-MM-dd"), end.AddDays(1).ToString("yyyy-MM-dd"));
             List<object[]>.Enumerator listEnumer = list.GetEnumerator();
             while (listEnumer.MoveNext())
             {

+ 0 - 7
PLCLinker/centralController/Monitor/IMonitor.cs

@@ -4,13 +4,6 @@ namespace Monitor
 {
 	public interface IMonitor
 	{
-		void DisplayPLCInfo();
-
-		void DisplayTerminalState();
-
-		void DisplayLicensePlate();
-
-		void DisplayImage();
 
         void Start();
 

+ 40 - 44
PLCLinker/centralController/Monitor/Monitor.cs

@@ -64,7 +64,7 @@ namespace Monitor
         /// <summary>
         /// 号牌机操作句柄
         /// </summary>
-        public static INumMachineLinker numMachineLinker;
+        public static NumMachineLinker numMachineLinker;
         public static IntPtr flpHandle;
         /// <summary>
         /// 本地web操作句柄
@@ -76,6 +76,7 @@ namespace Monitor
         /// </summary>
         public static string advertPath { get; set; }
         public static AdvertManager advertMgr;
+
         /// <summary>
         /// 系统初始化器句柄
         /// </summary>
@@ -104,7 +105,7 @@ namespace Monitor
                 {
                     if (PLC.isConnected)
                     {
-                        if (disconnected) {disconnected = false; AddNotification("PLC已重新连接连接"); }
+                        if (disconnected) {disconnected = false; SetNotification("PLC已重新连接连接"); }
                         linkCount = 0;
                         List<object> received = PLC.ReadFromPLC(PLCDataType.terminal, 0);
                         //首先获取所有终端信息
@@ -178,7 +179,7 @@ namespace Monitor
                         if (linkCount == 1)
                         {
                             disconnected = true;
-                            AddNotification("PLC掉线,请检查连接");
+                            SetNotification("PLC掉线,请检查连接");
                         }
                     }
                 }
@@ -293,31 +294,11 @@ namespace Monitor
             parkingSpaceInfo = new List<ParkingSpaceStru>();
             mainBlockInfo = new MainBlockStru();
         }
-
-        public void DisplayPLCInfo()
-        {
-
-        }
-
-        public void DisplayTerminalState()
-        {
-
-        }
-
-        public void DisplayLicensePlate()
-        {
-
-        }
-
-        public void DisplayImage()
-        {
-
-        }
         /// <summary>
         /// 获取提示信息
         /// </summary>
         /// <returns></returns>
-        public static string GetNotification()
+        public string GetNotification()
         {
             StringBuilder notificationStr = new StringBuilder();
             lock (notificationQueue)
@@ -334,28 +315,29 @@ namespace Monitor
         /// 添加提示信息
         /// </summary>
         /// <param name="notification"></param>
-        public static void AddNotification(string notification)
+        public static void SetNotification(string notification)
         {
-            string time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
-            string notificationStr = time + notification + "\r\n";
-            lock (notificationQueue)
+            if (notification == "clear")
             {
-                int count = notificationQueue.Count;
-                if (count >= MAXLINES)
+                lock (notificationQueue)
                 {
-                    notificationQueue.Dequeue();
+                    notificationQueue.Clear();
                 }
-                notificationQueue.Enqueue(notificationStr);
+                return;
             }
-        }
-        /// <summary>
-        /// 清除提示信息
-        /// </summary>
-        public static void ClearNotification()
-        {
-            lock (notificationQueue)
+            else
             {
-                notificationQueue.Clear();
+                string time = DateTime.Now + "\r\n";
+                string notificationStr = time + notification + "\r\n";
+                lock (notificationQueue)
+                {
+                    int count = notificationQueue.Count;
+                    if (count >= MAXLINES)
+                    {
+                        notificationQueue.Dequeue();
+                    }
+                    notificationQueue.Enqueue(notificationStr);
+                }
             }
         }
         /// <summary>
@@ -463,10 +445,12 @@ namespace Monitor
         /// <summary>
         /// 返回空闲正常车位数
         /// </summary>
+        /// <param name="state">状态:0.空闲与保留,1.空闲,2.保留</param>
         /// <returns></returns>
-        public static int GetFreeSpaceCount()
+        public int GetFreeSpaceCount(int state)
         {
             int freeSpaceCount = 0;
+            int reservedSpaceCount = 0;
             if (parkingSpaceInfo != null)
             {
                 foreach (ParkingSpaceStru psStru in parkingSpaceInfo)
@@ -474,16 +458,28 @@ namespace Monitor
                     if (psStru.spaceStatus != 1 && psStru.spaceStatus != 3)
                     {
                         freeSpaceCount++;
+                        if (psStru.spaceStatus == 2)
+                            reservedSpaceCount++;
                     }
                 }
             }
-            return freeSpaceCount;
+            switch (state)
+            {
+                case 0:
+                    return freeSpaceCount;
+                case 1:
+                    return freeSpaceCount - reservedSpaceCount;
+                case 2:
+                    return reservedSpaceCount;
+                default:
+                    return freeSpaceCount;
+            }
         }
         /// <summary>
-        /// 返回可预约车位数
+        /// 暂未使用,查询本地数据库返回可预约车位数
         /// </summary>
         /// <returns></returns>
-        public static int GetBookableSpaceCount()
+        public int GetBookableSpaceCount()
         {
             int bookableSpaceCount = 0;
             string bookableSpaceSql = "select currentBookableSpace from garageproperties where garageID = " + garageID + ";";

+ 16 - 15
PLCLinker/centralController/Monitor/SystemInitializer.cs

@@ -6,6 +6,7 @@ using System.Text;
 using System.Threading.Tasks;
 using BroadcastModule;
 using centralController.advert;
+using centralController.model;
 using db;
 using MySql.Data.MySqlClient;
 using NumMachine;
@@ -35,7 +36,7 @@ namespace Monitor
             mt.StartTiming();
             try
             {
-                Monitor.AddNotification("读取配置文件中...");
+                Monitor.SetNotification("读取配置文件中...");
                 retryCount = Convert.ToInt32(ConfigurationManager.AppSettings.Get("retryCount"));
                 //数据库
                 remoteDBConnStr = ConfigurationManager.AppSettings.Get("remoteDBConnStr");
@@ -64,14 +65,14 @@ namespace Monitor
             }
             catch (Exception e) { Console.WriteLine("初始化," + e.Message); return; }
 
-            Monitor.AddNotification("初始化PLC连接...");
+            Monitor.SetNotification("初始化PLC连接...");
             initStatus = initStatus && PLCInit(retryCount);
             //PLC初始化结束,进入状态2
-            if (!initStatus) { Monitor.AddNotification("PLC连接失败,请检查设备"); return; }
+            if (!initStatus) { Monitor.SetNotification("PLC连接失败,请检查设备"); return; }
             else { Monitor.initializeState = 2; }
 
             //初始化数据库对象
-            Monitor.AddNotification("初始化数据库...");
+            Monitor.SetNotification("初始化数据库...");
             Monitor.remoteDBOper = new DBOperation(remoteDBConnStr, DBtimeout);
             Monitor.localDBOper = new DBOperation(localDBConnStr, DBtimeout);
             initStatus = initStatus && Monitor.remoteDBOper.InitConnPooling(10);
@@ -81,7 +82,7 @@ namespace Monitor
             else { Monitor.initializeState = 3; }
 
             //初始化web对象
-            Monitor.AddNotification("初始化云端连接...");
+            Monitor.SetNotification("初始化云端连接...");
             Monitor.webServer = new CentralForWeb();
             initStatus = initStatus && Monitor.webServer.Start(Monitor.webPort);
             //webServer初始化结束,进入状态4
@@ -116,14 +117,14 @@ namespace Monitor
             #endregion
 
             //初始化计费策略
-            Monitor.AddNotification("读取计费策略...");
+            Monitor.SetNotification("读取计费策略...");
             PaymentScheme.ins = PaymentScheme.GetCurrentPaymentScheme(1);
             //初始化号牌机对象
-            Monitor.AddNotification("扫描已接入号牌机...");
+            Monitor.SetNotification("扫描已接入号牌机...");
             Monitor.numMachineLinker = new NumMachineLinker(flpHandle);
             Monitor.numMachineLinker.Start();
             //初始化显示板对象,显示板udp面向无连接
-            Monitor.AddNotification("初始化屏显...");
+            Monitor.SetNotification("初始化屏显...");
             Monitor.allInOneMachine = new BroadcastBoard(Monitor.allInOneMachineIP, Monitor.allInOneMachinePort);
             //Monitor.allInOneMachine.UpdateTime();
             //Monitor.allInOneMachine.Play(0, BroadcastBoard.PlayMode.download, "欢迎光临");
@@ -146,28 +147,28 @@ namespace Monitor
             {
                 case 0:
                     Console.WriteLine("配置文件读写异常");
-                    Monitor.AddNotification("配置文件读写异常");
+                    Monitor.SetNotification("配置文件读写异常");
                     break;
                 case 1:
                     Console.WriteLine("PLC初始化异常");
-                    Monitor.AddNotification("PLC初始化异常");
+                    Monitor.SetNotification("PLC初始化异常");
                     break;
                 case 2:
                     Console.WriteLine("数据库初始化异常");
-                    Monitor.AddNotification("数据库初始化异常");
+                    Monitor.SetNotification("数据库初始化异常");
                     break;
                 case 3:
                     Console.WriteLine("webServer初始化异常");
-                    Monitor.AddNotification("webServer初始化异常");
+                    Monitor.SetNotification("webServer初始化异常");
                     break;
                 case 4:
                     Console.WriteLine("其他异常");
-                    Monitor.AddNotification("其他异常");
+                    Monitor.SetNotification("其他异常");
                     break;
                 case 5:
                     Console.WriteLine("初始化成功");
-                    Monitor.ClearNotification();
-                    Monitor.AddNotification("初始化成功");
+                    Monitor.SetNotification("clear");
+                    Monitor.SetNotification("初始化成功");
                     break;
             }
         }

+ 49 - 63
PLCLinker/centralController/NumMachine/NumMachine.cs

@@ -94,26 +94,6 @@ namespace NumMachine
         /// </summary>
         public delegate void Begin_Read();
 
-        private void FormSiemens_Load(object sender, EventArgs e)
-        {
-            //Thread thread = new Thread(new ThreadStart(DateTimeInfo));
-            //thread.IsBackground = true;
-            //thread.Start(); //显示当前时间            
-
-            //VzClientSDK.VzLPRClient_Setup();
-
-            //hwndMain = this.Handle;
-            //m_sAppPath = System.IO.Directory.GetCurrentDirectory();
-            //this.ShowInTaskbar = false;
-            //this.Opacity = 0;
-
-        }
-
-        private void FormSiemens_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            Stop();
-        }
-
         private void DateTimeInfo()
         {
             try
@@ -167,6 +147,7 @@ namespace NumMachine
         {
 
         }
+
         private void Run()
         {
             try
@@ -660,7 +641,7 @@ namespace NumMachine
                                     int columns = (int)(flp.Controls.Count * 1.0 / rows + 1);
                                     //tlp.Width = (int)(flp.Width * 1.0 / (columns * 1.05));
                                     //tlp.Height = (int)(flp.Height * 1.0 / (rows * 1.05));
-                                    
+
                                     for (int i = 0; i < flpCC.Count; i++)
                                     {
                                         flpCC[i].Width = (int)(flp.Width * 1.0 / (columns * 1.1));
@@ -807,39 +788,39 @@ namespace NumMachine
         /// </summary>
         public AbstractMessage GetMessage()
         {
-            lock (LicBuffer)
-            {
-                //准备输出的数据中存在非法Node,且LicBuffer可出队产生一个合法Node,则替换该非法Node
-                if (!NodeValidation(nmMsg.aNode))
-                {
-                    for (int i = 0; i < LicBuffer.Count; i++)
-                    {
-                        NumberMachineNode n = LicBuffer.Dequeue();
-                        if (NodeValidation(n))
-                        {
-                            if (nmMsg.aNode != null && nmMsg.aNode.ip != null)
-                            {
-                                LicBuffer.Enqueue((NumberMachineNode)nmMsg.aNode.Clone());
-                            }
-                            nmMsg.aNode = n;
-                            break;
-                        }
-                        else
-                        {
-                            LicBuffer.Enqueue(n);
-                        }
-                    }
-                    //遍历licBuffer后仍不合法,则丢入队列,将node置为null
-                    if (!NodeValidation(nmMsg.aNode))
-                    {
-                        if (nmMsg.aNode != null && nmMsg.aNode.ip != null)
-                        {
-                            LicBuffer.Enqueue((NumberMachineNode)nmMsg.aNode.Clone());
-                        }
-                        nmMsg.aNode = null;
-                    }
-                }
-            }
+            //lock (LicBuffer)
+            //{
+            //    //准备输出的数据中存在非法Node,且LicBuffer可出队产生一个合法Node,则替换该非法Node
+            //    if (!NodeValidation(nmMsg.aNode))
+            //    {
+            //        for (int i = 0; i < LicBuffer.Count; i++)
+            //        {
+            //            NumberMachineNode n = LicBuffer.Dequeue();
+            //            if (NodeValidation(n))
+            //            {
+            //                if (nmMsg.aNode != null && nmMsg.aNode.ip != null)
+            //                {
+            //                    LicBuffer.Enqueue((NumberMachineNode)nmMsg.aNode.Clone());
+            //                }
+            //                nmMsg.aNode = n;
+            //                break;
+            //            }
+            //            else
+            //            {
+            //                LicBuffer.Enqueue(n);
+            //            }
+            //        }
+            //        //遍历licBuffer后仍不合法,则丢入队列,将node置为null
+            //        if (!NodeValidation(nmMsg.aNode))
+            //        {
+            //            if (nmMsg.aNode != null && nmMsg.aNode.ip != null)
+            //            {
+            //                LicBuffer.Enqueue((NumberMachineNode)nmMsg.aNode.Clone());
+            //            }
+            //            nmMsg.aNode = null;
+            //        }
+            //    }
+            //}
             return nmMsg;
         }
 
@@ -915,18 +896,23 @@ namespace NumMachine
         public string GetLicensePlate(int id)
         {
             string license = "";
-            //将相应计数器归零,启动号牌记录
-            lock (idCountMap)
+            Task.Factory.StartNew(() =>
             {
-                if (idCountMap.ContainsKey(id))
+                //将相应计数器归零,启动号牌记录
+                lock (idCountMap)
                 {
-                    idCountMap[id] = 0;
+                    if (idCountMap.ContainsKey(id))
+                    {
+                        while (idCountMap[id] < FILTERINGNUMBER)
+                        {
+                            Thread.Sleep(500);
+                        }
+                        idCountMap[id] = 0;
+                    }
                 }
-            }
-            Task.Factory.StartNew(() =>
-            {
+
                 NumberMachineNode node = null;
-                int timeLimit = 8;
+                int timeLimit = FILTERINGNUMBER+2;
                 while (node == null && timeLimit-- > 0)
                 {
                     lock (LicBuffer)
@@ -948,7 +934,7 @@ namespace NumMachine
                             }
                         }
                     }
-                    Thread.Sleep(1000);
+                    Thread.Sleep(REFRESHINGTIME);
                     if (timeLimit == 0) { Console.WriteLine("本次未找到号牌"); }
                 }
             }).Wait();

Разлика између датотеке није приказан због своје велике величине
+ 191 - 307
PLCLinker/centralController/Terminal/Terminal.cs


BIN
PLCLinker/centralController/bin/Release/centralController.exe


+ 2 - 1
PLCLinker/centralController/bin/Release/centralController.exe.config

@@ -8,7 +8,8 @@
     <!--数据库信息-->
     <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark;CharSet=utf8;Allow Zero Datetime=true;"/>-->
     <!--<add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <!--<add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
+    <add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="localDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_local;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="DBtimeout" value="3"/>
     <!--号牌机信息-->

BIN
PLCLinker/centralController/bin/Release/centralController.pdb


+ 6 - 5
PLCLinker/centralController/centralController.csproj

@@ -150,17 +150,18 @@
     <Compile Include="FormSysInfo.Designer.cs">
       <DependentUpon>FormSysInfo.cs</DependentUpon>
     </Compile>
-    <Compile Include="Form_paymentScheme.cs">
+    <Compile Include="FormPaymentScheme.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="Form_paymentScheme.Designer.cs">
-      <DependentUpon>Form_paymentScheme.cs</DependentUpon>
+    <Compile Include="FormPaymentScheme.Designer.cs">
+      <DependentUpon>FormPaymentScheme.cs</DependentUpon>
     </Compile>
     <Compile Include="language\Language.cs" />
     <Compile Include="LOG\log.cs" />
     <Compile Include="LOG\LogManager.cs" />
     <Compile Include="LOG\LogTest.cs" />
     <Compile Include="model\MainModel.cs" />
+    <Compile Include="model\PaymentScheme.cs" />
     <Compile Include="model\SysConst.cs" />
     <Compile Include="FormPLCConf.cs">
       <SubType>Form</SubType>
@@ -220,8 +221,8 @@
     <EmbeddedResource Include="FormSysInfo.resx">
       <DependentUpon>FormSysInfo.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Form_paymentScheme.resx">
-      <DependentUpon>Form_paymentScheme.cs</DependentUpon>
+    <EmbeddedResource Include="FormPaymentScheme.resx">
+      <DependentUpon>FormPaymentScheme.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="FormCentralController.resx">
       <DependentUpon>FormCentralController.cs</DependentUpon>

+ 31 - 0
PLCLinker/centralController/model/MainModel.cs

@@ -5,6 +5,37 @@ using System.Text;
 using System.Threading.Tasks;
 
 namespace parkMonitor.model {
+    public enum HandleType {
+        /// <summary>
+        /// PLC句柄
+        /// </summary>
+        PLC,
+        /// <summary>
+        /// 远端数据库
+        /// </summary>
+        remoteDB,
+        /// <summary>
+        /// 本地数据库
+        /// </summary>
+        localDB,
+        /// <summary>
+        /// 屏显
+        /// </summary>
+        allInOneMachine,
+        /// <summary>
+        /// 号牌机
+        /// </summary>
+        numMachine,
+        /// <summary>
+        /// 本地web接口
+        /// </summary>
+        webServer,
+        /// <summary>
+        /// 广告管理器
+        /// </summary>
+        advertManager,
+    }
+
 	public enum DeviceType {
 		/// <summary>未知</summary>
 		Unknown,

Разлика између датотеке није приказан због своје велике величине
+ 189 - 0
PLCLinker/centralController/model/PaymentScheme.cs


+ 1 - 1
PLCLinker/centralController/model/SysConst.cs

@@ -18,7 +18,7 @@ namespace parkMonitor.model {
 
 		/// <summary>版本号</summary>
 		public static string version() {
-			return "1.0.0";
+			return "2.0.0";
 		}
 
 		/// <summary>内嵌资源路径</summary>

+ 1 - 1
PLCLinker/centralController/obj/Release/centralController.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-389c91d0da495e04be995bea1260c3d22fe027f3
+bdf3534b2e97a64f40b4607852bf58a95837cff9

+ 1 - 1
PLCLinker/centralController/obj/Release/centralController.csproj.FileListAbsolute.txt

@@ -24,7 +24,6 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralControl
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormNumberMachinePreview.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormRecordsManager.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormSysInfo.resources
-E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.Form_paymentScheme.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.centralController.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\PLCConnector.FormPLCConf.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.Properties.Resources.resources
@@ -32,3 +31,4 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralControl
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.csproj.CoreCompileInputs.cache
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.exe
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.pdb
+E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormPaymentScheme.resources

BIN
PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache


BIN
PLCLinker/centralController/obj/Release/centralController.csprojResolveAssemblyReference.cache


BIN
PLCLinker/centralController/obj/Release/centralController.exe


BIN
PLCLinker/centralController/obj/Release/centralController.pdb


BIN
PLCLinker/centralController/sdk/PLC/PLCS7.dll


+ 11 - 1
PLCLinker/centralController/sdk/PLC/PLCS7.xml

@@ -148,7 +148,7 @@
         </member>
         <member name="F:PLCS7.TerminalStru.btnStatus">
             <summary>
-            按钮状态,0缺省,1非注册,2注册
+            按钮状态,0缺省,1非注册,2注册,3预约
             </summary>
         </member>
         <member name="F:PLCS7.TerminalStru.cmd">
@@ -201,6 +201,16 @@
             用户类型,0-1普通-2月卡-3季卡-4年卡VIP
             </summary>
         </member>
+        <member name="F:PLCS7.TerminalStru.coordX">
+            <summary>
+            X坐标
+            </summary>
+        </member>
+        <member name="F:PLCS7.TerminalStru.coordY">
+            <summary>
+            Y坐标
+            </summary>
+        </member>
         <member name="F:PLCS7.TerminalStru.groundStatus">
             <summary>
             地感信号

BIN
PLCLinker/socketTest/bin/Release/socketTest.exe


BIN
PLCLinker/socketTest/bin/Release/socketTest.pdb


BIN
PLCLinker/socketTest/obj/Release/socketTest.exe


BIN
PLCLinker/socketTest/obj/Release/socketTest.pdb


BIN
resources/PLCS7.dll


+ 11 - 1
resources/PLCS7.xml

@@ -148,7 +148,7 @@
         </member>
         <member name="F:PLCS7.TerminalStru.btnStatus">
             <summary>
-            按钮状态,0缺省,1非注册,2注册
+            按钮状态,0缺省,1非注册,2注册,3预约
             </summary>
         </member>
         <member name="F:PLCS7.TerminalStru.cmd">
@@ -201,6 +201,16 @@
             用户类型,0-1普通-2月卡-3季卡-4年卡VIP
             </summary>
         </member>
+        <member name="F:PLCS7.TerminalStru.coordX">
+            <summary>
+            X坐标
+            </summary>
+        </member>
+        <member name="F:PLCS7.TerminalStru.coordY">
+            <summary>
+            Y坐标
+            </summary>
+        </member>
         <member name="F:PLCS7.TerminalStru.groundStatus">
             <summary>
             地感信号