Browse Source

预约功能debug,解决netty通信报错问题,预约用户停车功能debug,完善提示信息并显示为不同颜色,添加终端状态显示

yc_t 6 năm trước cách đây
mục cha
commit
a9b545cc8c
38 tập tin đã thay đổi với 820 bổ sung285 xóa
  1. 1 1
      NettyCommunication/NettyTest/NettyTest.csproj
  2. 73 51
      NettyCommunication/NettyTest/Program.cs
  3. BIN
      NettyCommunication/NettyTest/nettyCommunication.dll
  4. 1 1
      NettyCommunication/NettyTest/serversettings.json
  5. 73 16
      PLCLinker/PLCLinker/Program.cs
  6. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.exe
  7. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.pdb
  8. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.exe
  9. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.pdb
  10. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.dll
  11. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.pdb
  12. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.dll
  13. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.pdb
  14. 268 96
      PLCLinker/centralController/FormCentralController.Designer.cs
  15. 183 14
      PLCLinker/centralController/FormCentralController.cs
  16. 4 1
      PLCLinker/centralController/FormCentralController.resx
  17. 52 36
      PLCLinker/centralController/Monitor/Monitor.cs
  18. 27 15
      PLCLinker/centralController/Monitor/SystemInitializer.cs
  19. 20 0
      PLCLinker/centralController/Properties/Resources.Designer.cs
  20. 12 6
      PLCLinker/centralController/Properties/Resources.resx
  21. 20 21
      PLCLinker/centralController/Terminal/Terminal.cs
  22. 3 3
      PLCLinker/centralController/WebServer/CentralForWebSocketServer.cs
  23. 29 22
      PLCLinker/centralController/WebServer/WebServer.cs
  24. 3 0
      PLCLinker/centralController/centralController.csproj
  25. 14 0
      PLCLinker/centralController/model/MainModel.cs
  26. 36 0
      PLCLinker/centralController/model/TermModel.cs
  27. BIN
      PLCLinker/centralController/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
  28. BIN
      PLCLinker/centralController/obj/Release/centralController.Properties.Resources.resources
  29. 1 1
      PLCLinker/centralController/obj/Release/centralController.csproj.CoreCompileInputs.cache
  30. BIN
      PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache
  31. BIN
      PLCLinker/centralController/sdk/dotNetty/nettyCommunication.dll
  32. BIN
      PLCLinker/socketTest/bin/Release/socketTest.exe
  33. BIN
      PLCLinker/socketTest/bin/Release/socketTest.pdb
  34. 0 1
      PLCLinker/socketTest/obj/Release/socketTest.csproj.FileListAbsolute.txt
  35. BIN
      PLCLinker/socketTest/obj/Release/socketTest.csprojResolveAssemblyReference.cache
  36. BIN
      PLCLinker/socketTest/obj/Release/socketTest.exe
  37. BIN
      PLCLinker/socketTest/obj/Release/socketTest.pdb
  38. BIN
      nettyCommunication.dll

+ 1 - 1
NettyCommunication/NettyTest/NettyTest.csproj

@@ -78,7 +78,7 @@
       <HintPath>..\nettyCommunication\bin\Debug\Microsoft.Extensions.Primitives.dll</HintPath>
     </Reference>
     <Reference Include="nettyCommunication">
-      <HintPath>..\nettyCommunication\bin\Debug\nettyCommunication.dll</HintPath>
+      <HintPath>..\..\nettyCommunication.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 73 - 51
NettyCommunication/NettyTest/Program.cs

@@ -13,75 +13,97 @@ namespace nettyCommunication
 {
     class Program
     {
+        private static Communication comm = null;
+        private static Thread receiveMsg = null;
+        private static bool connected { get; set; }
         static void Main(string[] args)
         {
-            //连接并初始化,
-            try
+            //持续进行连接尝试
+            Task.Factory.StartNew(() =>
             {
-                Connections.Connection();
-            }
-            catch (Exception)
-            {
-                Console.WriteLine("服务没有开启,请检查服务器");
-                // Console.WriteLine(e.ToString());
-            }
-
-            Communication comm = new Communication();
-
-            MessageUTF8 message = new MessageUTF8();
-            message.cmd = "w";
-            message.garageID = 4;
-
-            MessageUTF8 messageTemp = null;
-
-            while (true)
-            {
-
-                try
+                //初始化后与web持续连接
+                while (true)
                 {
-                    MessageUTF8 ms = (MessageUTF8)comm.ReceiveMessage();
-
-                    if (ms != null)
+                    try
                     {
-
-                        if (messageTemp != ms)
-                        {
-                            Console.WriteLine(ms.context);
-                        }
-
-                        messageTemp = ms;
+                        Connections.close();
+                        Connections.Connection();
+                        connected = true;
+                        comm = new Communication();
+                        break;
                     }
-                    else
+                    catch (Exception)
                     {
-                        Console.WriteLine("服务器没有发送消息对象,消息对象为空");
+                        connected = false;
+                        Console.WriteLine("服务没有开启,请检查服务器");
                     }
-
-                    //string contxt = Console.ReadLine();
-                    message.context = "ddddddddddddd";
-                    message.cmd = "S";
-                    message.parkingRecordsID = 1;
-                    //comm.SendMessage(message);//消息
+                    Thread.Sleep(200);
+                }
+                //持续判断连接状态并重连
+                while (true)
+                {
+                    Console.WriteLine(Connections.isAlive() + ", " + receiveMsg.ThreadState.ToString());
                     if (Connections.isAlive())
                     {
-                        comm.SendMessage(message);//消息
+                        if (!connected)
+                        {
+                            comm = new Communication();
+                        }
+                        connected = true;
+                        if (receiveMsg.ThreadState == ThreadState.Aborted)
+                        {
+                            try
+                            {
+                                receiveMsg.Start();
+                            }
+                            catch (Exception ex) { Console.WriteLine(ex.Message); }
+                        }
                     }
                     else
                     {
+                        connected = false;
+                        try
+                        {
+                            if (receiveMsg.ThreadState == ThreadState.WaitSleepJoin)
+                            {
+                                receiveMsg.Interrupt();
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                            Console.WriteLine("连接断开,终止消息接收线程");
+                        }
                         Console.WriteLine(" 连接关闭,需要重新连接注册");
+                        try
+                        {
+                            Connections.close();
+                            Connections.Connection();
+                        }
+                        catch (Exception)
+                        {
+                            Console.WriteLine("服务没有开启,请检查服务器");
+                        }
                     }
-
-
-                    Thread.Sleep(2000);
+                    Thread.Sleep(200);
                 }
-                catch
+            });
+            //持续接收消息
+            receiveMsg = new Thread(() =>
+            {
+                while (true)
                 {
-
+                    try
+                    {               
+                        if (connected && comm != null)
+                        {
+                            MessageUTF8 msg = ((MessageUTF8)comm.ReceiveMessage());
+                        }
+                    }
+                    catch { Console.WriteLine("线程已中断"); }
                 }
-
-            }
-
-
-
+            });
+            receiveMsg.Start();
+            Console.ReadLine();
         }
 
         //public static async Task sendMessage(IChannelHandlerContext ctx,object message)

BIN
NettyCommunication/NettyTest/nettyCommunication.dll


+ 1 - 1
NettyCommunication/NettyTest/serversettings.json

@@ -1,7 +1,7 @@
 {
 
   "ssl": "false",
-  "host": "127.0.0.1",
+  "host": "192.168.10.139",
   "garageID":"10",
   "port": "9000",
   "size": "1024"

+ 73 - 16
PLCLinker/PLCLinker/Program.cs

@@ -1,6 +1,7 @@
 using PLCS7;
 using S7.Net;
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using System.Net;
@@ -19,6 +20,60 @@ namespace PLCTest
         static int count = 0;
         static void Main(string[] args)
         {
+            // tcp测试
+            BlockingCollection<int> bq = new BlockingCollection<int>();
+            bool connected = false;
+            Thread receiveMsg=null;
+            Task.Factory.StartNew(() =>
+            {
+                while (true)
+                {
+                    if (!connected)
+                    {
+                        connected = true;
+                        if (receiveMsg.ThreadState == ThreadState.Aborted)
+                        {
+                            try
+                            {
+                                receiveMsg.Start();
+                            }
+                            catch (Exception ex) { Console.WriteLine(ex.Message); }
+                        }
+                    }
+                    else
+                    {
+                        connected = false;
+                        try
+                        {
+                            if (receiveMsg.ThreadState == ThreadState.WaitSleepJoin)
+                            {
+                                receiveMsg.Interrupt();
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                            Console.WriteLine("连接断开,终止消息接收线程");
+                        }
+                    }
+                    Thread.Sleep(50);
+                }
+            });
+            //持续接收消息
+            receiveMsg = new Thread(() =>
+            {
+                while (true)
+                {
+                    try
+                    {
+                        bq.Take();
+                        Thread.Sleep(100);
+                    }
+                    catch { Console.WriteLine("线程已中断"); }
+                }
+            });
+            receiveMsg.Start();
+            Console.ReadLine();
+
             #region PLC
             //PLCLinker pl = new PLCLinker(CpuType.S71500, "192.168.10.60", 0, 1, 18, 41, 20, 1, 200);
             //Random rnd = new Random();
@@ -84,22 +139,24 @@ namespace PLCTest
             //result[1] = regNum.Replace(strs, "");
             //Console.WriteLine(result[0] + "," + result[1]);
 
-            int[] arr = { 13, 2, 812, 21, 55, 251,713,29,68 };
-            for (int i = 0; i < arr.Length; i++)
-            {
-                //Console.WriteLine(i);
-                Task.Factory.StartNew(() =>
-                {
-                    int temp = count;
-                    count++;
-                    try
-                    {
-                        Thread.Sleep(arr[temp]);
-                        Console.Write(arr[temp] + ",");
-                    }
-                    catch (Exception e) { Console.WriteLine(temp + "," + e.Message); }
-                });
-            }
+            ////休眠排序法
+            //int[] arr = { 13, 2, 812, 21, 55, 251,713,29,68 };
+            //for (int i = 0; i < arr.Length; i++)
+            //{
+            //    //Console.WriteLine(i);
+            //    Task.Factory.StartNew(() =>
+            //    {
+            //        int temp = count;
+            //        count++;
+            //        try
+            //        {
+            //            Thread.Sleep(arr[temp]);
+            //            Console.Write(arr[temp] + ",");
+            //        }
+            //        catch (Exception e) { Console.WriteLine(temp + "," + e.Message); }
+            //    });
+            //}
+
             //Task.Factory.StartNew(() =>
             //{
             //    //PrintWord("a", 1000);

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


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


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


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


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


+ 268 - 96
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -35,11 +35,13 @@
             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.groupPanel2 = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.pictureBox4 = new System.Windows.Forms.PictureBox();
+            this.pictureBox5 = new System.Windows.Forms.PictureBox();
+            this.groupPanel1 = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
+            this.pictureBox3 = new System.Windows.Forms.PictureBox();
             this.button2 = new System.Windows.Forms.Button();
             this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
             this.button1 = new System.Windows.Forms.Button();
@@ -48,6 +50,10 @@
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
+            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.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
@@ -72,7 +78,7 @@
             this.dockSite_notification = new DevComponents.DotNetBar.DockSite();
             this.bar_notification = new DevComponents.DotNetBar.Bar();
             this.warningPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.tbx_notification = new DevComponents.DotNetBar.Controls.TextBoxX();
+            this.rtb_notification = new System.Windows.Forms.RichTextBox();
             this.progressBar1 = new System.Windows.Forms.ProgressBar();
             this.dci_warning = new DevComponents.DotNetBar.DockContainerItem();
             this.dockSite8 = new DevComponents.DotNetBar.DockSite();
@@ -121,19 +127,27 @@
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
             this.controlContainerItem1 = new DevComponents.DotNetBar.ControlContainerItem();
+            this.flp_Term = new System.Windows.Forms.FlowLayoutPanel();
             this.dockSite_mainView.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
             this.bar_mainWin.SuspendLayout();
-            this.NumMachineMonitorPanel.SuspendLayout();
             this.testPanel.SuspendLayout();
+            this.groupPanel2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
+            this.groupPanel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
             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();
             ((System.ComponentModel.ISupportInitialize)(this.dgvx_parkingRecords)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.bar_side)).BeginInit();
             this.bar_side.SuspendLayout();
+            this.terminalMonitorPanel.SuspendLayout();
             this.dockSite_notification.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_notification)).BeginInit();
             this.bar_notification.SuspendLayout();
@@ -189,12 +203,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, 621, 326))),
-                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_side, 259, 326)))}, DevComponents.DotNetBar.eOrientation.Horizontal))),
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_mainWin, 503, 326))),
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_side, 360, 326)))}, 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, 121);
             this.dockSite_mainView.Name = "dockSite_mainView";
-            this.dockSite_mainView.Size = new System.Drawing.Size(883, 547);
+            this.dockSite_mainView.Size = new System.Drawing.Size(866, 547);
             this.dockSite_mainView.TabIndex = 8;
             this.dockSite_mainView.TabStop = false;
             // 
@@ -228,65 +242,17 @@
             this.bar_mainWin.Name = "bar_mainWin";
             this.bar_mainWin.SelectedDockTab = 0;
             this.bar_mainWin.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.bar_mainWin.Size = new System.Drawing.Size(621, 326);
+            this.bar_mainWin.Size = new System.Drawing.Size(503, 326);
             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(615, 295);
-            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(615, 295);
-            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(615, 295);
-            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(615, 295);
-            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.groupPanel2);
+            this.testPanel.Controls.Add(this.groupPanel1);
             this.testPanel.Controls.Add(this.button2);
             this.testPanel.Controls.Add(this.dateTimePicker1);
             this.testPanel.Controls.Add(this.button1);
@@ -296,7 +262,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(615, 295);
+            this.testPanel.Size = new System.Drawing.Size(497, 295);
             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;
@@ -304,6 +270,144 @@
             this.testPanel.Style.GradientAngle = 90;
             this.testPanel.TabIndex = 38;
             // 
+            // groupPanel2
+            // 
+            this.groupPanel2.BackColor = System.Drawing.SystemColors.Highlight;
+            this.groupPanel2.CanvasColor = System.Drawing.SystemColors.Control;
+            this.groupPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.groupPanel2.ColorTable = DevComponents.DotNetBar.Controls.ePanelColorTable.Green;
+            this.groupPanel2.Controls.Add(this.pictureBox4);
+            this.groupPanel2.Controls.Add(this.pictureBox5);
+            this.groupPanel2.DisabledBackColor = System.Drawing.Color.Empty;
+            this.groupPanel2.Location = new System.Drawing.Point(387, 72);
+            this.groupPanel2.Name = "groupPanel2";
+            this.groupPanel2.Size = new System.Drawing.Size(110, 115);
+            // 
+            // 
+            // 
+            this.groupPanel2.Style.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(195)))), ((int)(((byte)(217)))), ((int)(((byte)(185)))));
+            this.groupPanel2.Style.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(191)))), ((int)(((byte)(139)))));
+            this.groupPanel2.Style.BackColorGradientAngle = 90;
+            this.groupPanel2.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel2.Style.BorderBottomWidth = 1;
+            this.groupPanel2.Style.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(114)))), ((int)(((byte)(164)))), ((int)(((byte)(90)))));
+            this.groupPanel2.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel2.Style.BorderLeftWidth = 1;
+            this.groupPanel2.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel2.Style.BorderRightWidth = 1;
+            this.groupPanel2.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel2.Style.BorderTopWidth = 1;
+            this.groupPanel2.Style.CornerDiameter = 4;
+            this.groupPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.groupPanel2.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.groupPanel2.Style.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(74)))), ((int)(((byte)(31)))));
+            this.groupPanel2.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.groupPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.groupPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.groupPanel2.TabIndex = 15;
+            this.groupPanel2.Text = "地面车位2";
+            // 
+            // pictureBox4
+            // 
+            this.pictureBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.pictureBox4.Image = global::centralController.Properties.Resources.car;
+            this.pictureBox4.InitialImage = null;
+            this.pictureBox4.Location = new System.Drawing.Point(25, 48);
+            this.pictureBox4.Name = "pictureBox4";
+            this.pictureBox4.Size = new System.Drawing.Size(57, 43);
+            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox4.TabIndex = 0;
+            this.pictureBox4.TabStop = false;
+            // 
+            // pictureBox5
+            // 
+            this.pictureBox5.Anchor = System.Windows.Forms.AnchorStyles.Top;
+            this.pictureBox5.Image = global::centralController.Properties.Resources.numMachine;
+            this.pictureBox5.InitialImage = null;
+            this.pictureBox5.Location = new System.Drawing.Point(30, 1);
+            this.pictureBox5.Name = "pictureBox5";
+            this.pictureBox5.Size = new System.Drawing.Size(50, 29);
+            this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox5.TabIndex = 14;
+            this.pictureBox5.TabStop = false;
+            // 
+            // groupPanel1
+            // 
+            this.groupPanel1.BackColor = System.Drawing.SystemColors.AppWorkspace;
+            this.groupPanel1.CanvasColor = System.Drawing.SystemColors.Control;
+            this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.groupPanel1.ColorTable = DevComponents.DotNetBar.Controls.ePanelColorTable.Red;
+            this.groupPanel1.Controls.Add(this.pictureBox2);
+            this.groupPanel1.Controls.Add(this.pictureBox3);
+            this.groupPanel1.DisabledBackColor = System.Drawing.Color.Empty;
+            this.groupPanel1.Location = new System.Drawing.Point(241, 128);
+            this.groupPanel1.Name = "groupPanel1";
+            this.groupPanel1.Size = new System.Drawing.Size(105, 107);
+            // 
+            // 
+            // 
+            this.groupPanel1.Style.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(191)))), ((int)(((byte)(191)))));
+            this.groupPanel1.Style.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(150)))), ((int)(((byte)(150)))));
+            this.groupPanel1.Style.BackColorGradientAngle = 90;
+            this.groupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel1.Style.BorderBottomWidth = 1;
+            this.groupPanel1.Style.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(55)))), ((int)(((byte)(52)))));
+            this.groupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel1.Style.BorderLeftWidth = 1;
+            this.groupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel1.Style.BorderRightWidth = 1;
+            this.groupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.groupPanel1.Style.BorderTopWidth = 1;
+            this.groupPanel1.Style.CornerDiameter = 4;
+            this.groupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.groupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.groupPanel1.Style.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(99)))), ((int)(((byte)(36)))), ((int)(((byte)(35)))));
+            this.groupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.groupPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.groupPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.groupPanel1.TabIndex = 13;
+            this.groupPanel1.Text = "地面车位2";
+            // 
+            // pictureBox2
+            // 
+            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.pictureBox2.Image = global::centralController.Properties.Resources.car;
+            this.pictureBox2.InitialImage = null;
+            this.pictureBox2.Location = new System.Drawing.Point(23, 45);
+            this.pictureBox2.Name = "pictureBox2";
+            this.pictureBox2.Size = new System.Drawing.Size(56, 43);
+            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox2.TabIndex = 0;
+            this.pictureBox2.TabStop = false;
+            // 
+            // pictureBox3
+            // 
+            this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.pictureBox3.Cursor = System.Windows.Forms.Cursors.Default;
+            this.pictureBox3.Image = global::centralController.Properties.Resources.numMachine;
+            this.pictureBox3.InitialImage = null;
+            this.pictureBox3.Location = new System.Drawing.Point(27, 1);
+            this.pictureBox3.Name = "pictureBox3";
+            this.pictureBox3.Size = new System.Drawing.Size(50, 29);
+            this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox3.TabIndex = 14;
+            this.pictureBox3.TabStop = false;
+            // 
             // button2
             // 
             this.button2.Location = new System.Drawing.Point(271, 44);
@@ -316,7 +420,7 @@
             // 
             // dateTimePicker1
             // 
-            this.dateTimePicker1.Location = new System.Drawing.Point(257, 108);
+            this.dateTimePicker1.Location = new System.Drawing.Point(375, 13);
             this.dateTimePicker1.Name = "dateTimePicker1";
             this.dateTimePicker1.Size = new System.Drawing.Size(200, 21);
             this.dateTimePicker1.TabIndex = 7;
@@ -381,6 +485,56 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
+            // 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(497, 295);
+            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(497, 295);
+            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(497, 295);
+            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(497, 295);
+            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;
+            // 
             // dci_NumMachine
             // 
             this.dci_NumMachine.Control = this.NumMachineMonitorPanel;
@@ -429,7 +583,7 @@
             this.bar_bottom.Location = new System.Drawing.Point(0, 329);
             this.bar_bottom.Name = "bar_bottom";
             this.bar_bottom.SelectedDockTab = 0;
-            this.bar_bottom.Size = new System.Drawing.Size(883, 218);
+            this.bar_bottom.Size = new System.Drawing.Size(866, 218);
             this.bar_bottom.Stretch = true;
             this.bar_bottom.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_bottom.TabIndex = 1;
@@ -441,7 +595,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(877, 187);
+            this.RecordsMonitorPanel.Size = new System.Drawing.Size(860, 187);
             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;
@@ -476,7 +630,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(877, 187);
+            this.dgvx_parkingRecords.Size = new System.Drawing.Size(860, 187);
             this.dgvx_parkingRecords.TabIndex = 0;
             // 
             // parkingRecordsID
@@ -579,10 +733,10 @@
             this.bar_side.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_terminal});
             this.bar_side.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar_side.Location = new System.Drawing.Point(624, 0);
+            this.bar_side.Location = new System.Drawing.Point(506, 0);
             this.bar_side.Name = "bar_side";
             this.bar_side.SelectedDockTab = 0;
-            this.bar_side.Size = new System.Drawing.Size(259, 326);
+            this.bar_side.Size = new System.Drawing.Size(360, 326);
             this.bar_side.Stretch = true;
             this.bar_side.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_side.TabIndex = 2;
@@ -590,10 +744,11 @@
             // 
             // terminalMonitorPanel
             // 
+            this.terminalMonitorPanel.Controls.Add(this.flp_Term);
             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(253, 295);
+            this.terminalMonitorPanel.Size = new System.Drawing.Size(354, 295);
             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;
@@ -626,10 +781,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, 308, 547)))}, DevComponents.DotNetBar.eOrientation.Vertical);
-            this.dockSite_notification.Location = new System.Drawing.Point(883, 121);
+            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_notification, 325, 547)))}, DevComponents.DotNetBar.eOrientation.Vertical);
+            this.dockSite_notification.Location = new System.Drawing.Point(866, 121);
             this.dockSite_notification.Name = "dockSite_notification";
-            this.dockSite_notification.Size = new System.Drawing.Size(311, 547);
+            this.dockSite_notification.Size = new System.Drawing.Size(328, 547);
             this.dockSite_notification.TabIndex = 1;
             this.dockSite_notification.TabStop = false;
             // 
@@ -649,7 +804,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(308, 547);
+            this.bar_notification.Size = new System.Drawing.Size(325, 547);
             this.bar_notification.Stretch = true;
             this.bar_notification.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
             this.bar_notification.TabIndex = 1;
@@ -658,12 +813,12 @@
             // 
             // warningPanel
             // 
-            this.warningPanel.Controls.Add(this.tbx_notification);
+            this.warningPanel.Controls.Add(this.rtb_notification);
             this.warningPanel.Controls.Add(this.progressBar1);
             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(302, 521);
+            this.warningPanel.Size = new System.Drawing.Size(319, 521);
             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;
@@ -671,33 +826,26 @@
             this.warningPanel.Style.GradientAngle = 90;
             this.warningPanel.TabIndex = 26;
             // 
-            // tbx_notification
+            // rtb_notification
             // 
-            this.tbx_notification.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            // 
-            // 
-            // 
-            this.tbx_notification.Border.Class = "TextBoxBorder";
-            this.tbx_notification.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.tbx_notification.DisabledBackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            this.tbx_notification.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tbx_notification.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.tbx_notification.ForeColor = System.Drawing.Color.Black;
-            this.tbx_notification.Location = new System.Drawing.Point(0, 0);
-            this.tbx_notification.Multiline = true;
-            this.tbx_notification.Name = "tbx_notification";
-            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(302, 500);
-            this.tbx_notification.TabIndex = 0;
+            this.rtb_notification.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            this.rtb_notification.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.rtb_notification.Cursor = System.Windows.Forms.Cursors.Arrow;
+            this.rtb_notification.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.rtb_notification.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.rtb_notification.Location = new System.Drawing.Point(0, 0);
+            this.rtb_notification.Name = "rtb_notification";
+            this.rtb_notification.ReadOnly = true;
+            this.rtb_notification.Size = new System.Drawing.Size(319, 500);
+            this.rtb_notification.TabIndex = 1;
+            this.rtb_notification.Text = "";
             // 
             // progressBar1
             // 
             this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.progressBar1.Location = new System.Drawing.Point(0, 500);
             this.progressBar1.Name = "progressBar1";
-            this.progressBar1.Size = new System.Drawing.Size(302, 21);
+            this.progressBar1.Size = new System.Drawing.Size(319, 21);
             this.progressBar1.Step = 20;
             this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
             this.progressBar1.TabIndex = 0;
@@ -1153,6 +1301,16 @@
             this.controlContainerItem1.MenuVisibility = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
             this.controlContainerItem1.Name = "controlContainerItem1";
             // 
+            // flp_Term
+            // 
+            this.flp_Term.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            this.flp_Term.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.flp_Term.Location = new System.Drawing.Point(0, 0);
+            this.flp_Term.Name = "flp_Term";
+            this.flp_Term.Padding = new System.Windows.Forms.Padding(5);
+            this.flp_Term.Size = new System.Drawing.Size(354, 295);
+            this.flp_Term.TabIndex = 0;
+            // 
             // centralController
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1178,17 +1336,24 @@
             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.groupPanel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
+            this.groupPanel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
             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);
             ((System.ComponentModel.ISupportInitialize)(this.dgvx_parkingRecords)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.bar_side)).EndInit();
             this.bar_side.ResumeLayout(false);
+            this.terminalMonitorPanel.ResumeLayout(false);
             this.dockSite_notification.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_notification)).EndInit();
             this.bar_notification.ResumeLayout(false);
@@ -1239,7 +1404,6 @@
         private DevComponents.DotNetBar.ButtonItem btn_exportRecords;
         private DevComponents.DotNetBar.Bar bar_bottom;
         private DevComponents.DotNetBar.Bar bar_notification;
-        public DevComponents.DotNetBar.Controls.TextBoxX tbx_notification;
         private DevComponents.DotNetBar.LabelX lbx_freeSpace;
         private DevComponents.DotNetBar.ButtonItem btn_views;
         private DevComponents.DotNetBar.ButtonItem btn_numMachine;
@@ -1294,6 +1458,14 @@
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
         private System.Windows.Forms.PictureBox pictureBox1;
         private DevComponents.DotNetBar.LabelX labelX1;
+        private System.Windows.Forms.RichTextBox rtb_notification;
+        private System.Windows.Forms.PictureBox pictureBox2;
+        private DevComponents.DotNetBar.Controls.GroupPanel groupPanel1;
+        private DevComponents.DotNetBar.Controls.GroupPanel groupPanel2;
+        private System.Windows.Forms.PictureBox pictureBox4;
+        private System.Windows.Forms.PictureBox pictureBox5;
+        private System.Windows.Forms.PictureBox pictureBox3;
+        private System.Windows.Forms.FlowLayoutPanel flp_Term;
     }
 }
 

+ 183 - 14
PLCLinker/centralController/FormCentralController.cs

@@ -1,9 +1,13 @@
-using DevComponents.DotNetBar.Controls;
+using centralController.model;
+using DevComponents.DotNetBar.Controls;
 using nettyCommunication;
+using parkMonitor.model;
 using PLC_Communication;
 using PLCConnector;
+using PLCS7;
 using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.IO;
 using System.Net;
 using System.Runtime.InteropServices;
@@ -17,16 +21,19 @@ namespace centralController
 {
     public partial class centralController : Form
     {
+        private List<TermModel> TermDispList;
+        private bool closing = false;
         /// <summary>
         /// 窗体初始化
         /// </summary>
         public centralController()
         {
             InitializeComponent();
+            TermDispList = new List<TermModel>();
 
             if (Monitor.Monitor.ins == null)
             {
-                Monitor.Monitor.ins = new Monitor.Monitor(flowLayoutPanel1.Handle);
+                Monitor.Monitor.ins = new Monitor.Monitor(this, flowLayoutPanel1.Handle);
             }
             Monitor.Monitor.ins.Start();
 
@@ -56,20 +63,140 @@ namespace centralController
             recordsTimer.Tick += new EventHandler(RefreshRecords);
             recordsTimer.Start();
 
-            //定时器,定时更新提示信息
-            System.Windows.Forms.Timer NoteTimer = new System.Windows.Forms.Timer();
-            NoteTimer.Interval = 1000;
-            NoteTimer.Tick += new EventHandler(UpdateText);
-            NoteTimer.Start();
+            ////定时器,定时更新提示信息
+            //System.Windows.Forms.Timer NoteTimer = new System.Windows.Forms.Timer();
+            //NoteTimer.Interval = 1000;
+            //NoteTimer.Tick += new EventHandler(UpdateText);
+            //NoteTimer.Start();
 
             //定时器,定时更新系统时间与剩余车位数
             System.Windows.Forms.Timer freeSpaceTimer = new System.Windows.Forms.Timer();
             freeSpaceTimer.Interval = 1000;
             freeSpaceTimer.Tick += new EventHandler(UpdateFreeSpace);
             freeSpaceTimer.Start();
-            tbx_notification.Text = "";
+            rtb_notification.Text = "";
+
+            Task.Factory.StartNew(() =>
+            {
+                while (!closing)
+                {
+                    List<TerminalStru> tList = Terminal.Terminal.terminalInfo;
+                    for (int i = 0; i < tList.Count; i++)
+                    {
+                        TerminalStru ts = tList[i];
+                        this.Invoke(new Action(() =>
+                        {
+                            bool updated = false;
+                            for (int j = 0; j < TermDispList.Count; j++)
+                            {
+                                if (ts.terminalID == TermDispList[j].id)
+                                {
+                                    UpdateTermGP(TermDispList[j], ts.terminalID,
+                                        ts.terminalStatus == (short)1 ? true : false,
+                                        ts.cmd == ts.terminalStatus ? true : false,
+                                        ts.groundStatus == (short)1 ? true : false,
+                                        ts.numMachineLaunch == (short)1 ? true : false);
+                                    updated = true;
+                                    break;
+                                }
+                            }
+                            if (!updated)
+                                InitTermGP(ts.terminalID,
+                                            ts.terminalStatus == (short)1 ? true : false,
+                                            ts.cmd == ts.terminalStatus ? true : false,
+                                            ts.groundStatus == (short)1 ? true : false,
+                                            ts.numMachineLaunch == (short)1 ? true : false);
+                        }));
+                    }
+                    Thread.Sleep(5000);
+                }
+            });
         }
+        private void InitTermGP(int id, bool park, bool launched, bool groundSensor, bool numMachine)
+        {
+            GroupPanel gpTerm = new GroupPanel();
+            PictureBox pbCar = new PictureBox();
+            PictureBox pbNum = new PictureBox();
+
+            pbNum.Dock = DockStyle.Top;
+            //pbNum.Anchor = AnchorStyles.Top;
+            pbNum.Image = Properties.Resources.numMachine;
+            pbNum.Location = new Point(27, 1);
+            pbNum.Name = "term" + id + "pbNum";
+            pbNum.Size = new Size(50, 29);
+            pbNum.SizeMode = PictureBoxSizeMode.Zoom;
+            pbNum.TabStop = false;
+
+            pbCar.Dock = DockStyle.Bottom;
+            //pbCar.Anchor = ((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right);
+            pbCar.Image = Properties.Resources.car;
+            pbCar.Location = new Point(23, 45);
+            pbCar.Name = "term" + id + "pbCar";
+            pbCar.Size = new Size(56, 43);
+            pbCar.SizeMode = PictureBoxSizeMode.Zoom;
+
+            gpTerm.BackColor = SystemColors.AppWorkspace;
+            gpTerm.CanvasColor = SystemColors.Control;
+            gpTerm.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            gpTerm.ColorTable = ePanelColorTable.Red;
+            gpTerm.Controls.Add(pbCar);
+            gpTerm.Controls.Add(pbNum);
+            gpTerm.DisabledBackColor = Color.Empty;
+            gpTerm.Name = "term" + id + "gp";
+            gpTerm.Size = new Size(105, 112);
 
+            gpTerm.Style.BackColor = Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(191)))), ((int)(((byte)(191)))));
+            gpTerm.Style.BackColor2 = Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(150)))), ((int)(((byte)(150)))));
+            gpTerm.Style.BackColorGradientAngle = 90;
+            gpTerm.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            gpTerm.Style.BorderBottomWidth = 1;
+            gpTerm.Style.BorderColor = Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(55)))), ((int)(((byte)(52)))));
+            gpTerm.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            gpTerm.Style.BorderLeftWidth = 1;
+            gpTerm.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            gpTerm.Style.BorderRightWidth = 1;
+            gpTerm.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            gpTerm.Style.BorderTopWidth = 1;
+            gpTerm.Style.CornerDiameter = 4;
+            gpTerm.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            gpTerm.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            gpTerm.Style.TextColor = Color.FromArgb(((int)(((byte)(99)))), ((int)(((byte)(36)))), ((int)(((byte)(35)))));
+            gpTerm.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            gpTerm.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            gpTerm.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            gpTerm.Text = "地面车位" + id;
+            TermModel tm = new TermModel(gpTerm, pbNum, pbCar);
+            UpdateTermGP(tm, id, park, launched, groundSensor, numMachine);
+            TermDispList.Add(tm);
+            flp_Term.Controls.Add(gpTerm);
+        }
+        private void UpdateTermGP(TermModel tm, int id, bool park, bool launched, bool groundSensor, bool numMachine)
+        {
+            tm.UpdateStatus(id, park, launched, groundSensor, numMachine);
+            if (tm.gp != null)
+            {
+                //停取状态
+                if (park)
+                    tm.gp.ColorTable = ePanelColorTable.Red;
+                else
+                    tm.gp.ColorTable = ePanelColorTable.Green;
+                //启动/空闲
+                if (launched)
+                    tm.gp.BackColor = SystemColors.Highlight;
+                else
+                    tm.gp.BackColor = SystemColors.AppWorkspace;
+                //地感
+                if (groundSensor && tm.pbCar != null)
+                    tm.pbCar.Visible = true;
+                else
+                    tm.pbCar.Visible = false;
+                //号牌机
+                if (numMachine && tm.pbNum != null)
+                    tm.pbNum.Visible = true;
+                else
+                    tm.pbNum.Visible = false;
+            }
+        }
         #region 测试
         /// <summary>
         /// 获取号牌测试
@@ -292,15 +419,51 @@ namespace centralController
         #endregion
 
         /// <summary>
-        /// 定时更新提示信息
+        /// 更新提示信息
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void UpdateText(object sender, EventArgs e)
+        public void UpdateText(string str, TextColor tc)
         {
-            tbx_notification.Text = Monitor.Monitor.ins.GetNotification();
-            tbx_notification.ScrollToCaret();
+            if (str == "clear")
+            {
+                rtb_notification.Clear();
+            }
+            else
+            {
+                string appendingText = str;
+                rtb_notification.AppendText(appendingText);
+                string currentTxt = rtb_notification.Text;
+                string temp = currentTxt.Substring(0, currentTxt.Length - appendingText.Length + 2);
+                int index = temp.LastIndexOf("\n", temp.Length);
+                //rtb_notification.Select(index < 0 ? 0 : index, appendingText.Length - 1);
+                rtb_notification.Select(index < 0 ? 0 : index, appendingText.Length - 2);
+                //Console.WriteLine("******************");
+                //Console.WriteLine("选中 "+rtb_notification.SelectedText);
+                //Console.WriteLine("******************");
+                //rtb_notification.SelectionFont = new Font(rtb_notification.SelectionFont, FontStyle.Bold);
+                switch (tc)
+                {
+                    case TextColor.Log:
+                        rtb_notification.SelectionColor = Color.Gray;
+                        break;
+                    case TextColor.Info:
+                        rtb_notification.SelectionColor = Color.Black;
+                        break;
+                    case TextColor.Warning:
+                        rtb_notification.SelectionColor = Color.Orange;
+                        break;
+                    case TextColor.Error:
+                        rtb_notification.SelectionColor = Color.Red;
+                        break;
+                }
+                rtb_notification.Select(index + appendingText.Length - 1, 0);
+            }
+
+            //rtb_notification.Text = Monitor.Monitor.ins.GetNotification();
+            //rtb_notification.ScrollToCaret();
         }
+
         /// <summary>
         /// 定时更新时间与空闲车位显示
         /// </summary>
@@ -452,7 +615,7 @@ namespace centralController
             if (result.Equals(DialogResult.OK))
             {
                 Monitor.Monitor.ins.Stop();
-
+                closing = true;
             }
             else
             {
@@ -483,7 +646,13 @@ namespace centralController
 
         private void shortcut_close_Click(object sender, EventArgs e)
         {
-            Close();
+            DialogResult result = MessageBox.Show("确定退出系统吗?", "温馨提示", MessageBoxButtons.OKCancel);
+            if (result.Equals(DialogResult.OK))
+            {
+                Monitor.Monitor.ins.Stop();
+                closing = true;
+                Close();
+            }
         }
         #endregion
 

+ 4 - 1
PLCLinker/centralController/FormCentralController.resx

@@ -151,11 +151,14 @@
     <value>True</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>25</value>
+    <value>37</value>
   </metadata>
   <metadata name="bar_notification.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="rtb_notification.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 52 - 36
PLCLinker/centralController/Monitor/Monitor.cs

@@ -18,6 +18,7 @@ using System.Net;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 
 namespace Monitor
 {
@@ -77,6 +78,7 @@ namespace Monitor
         /// </summary>
         public static string advertPath { get; set; }
         public static AdvertManager advertMgr;
+        public static centralController.centralController mainWin { get; set; }
 
         /// <summary>
         /// 系统初始化器句柄
@@ -106,7 +108,7 @@ namespace Monitor
                 {
                     if (PLC.isConnected)
                     {
-                        if (disconnected) {disconnected = false; SetNotification("PLC已重新连接"); }
+                        if (disconnected) {disconnected = false; SetNotification("PLC已重新连接",TextColor.Info); }
                         linkCount = 0;
                         List<object> received = PLC.ReadFromPLC(PLCDataType.terminal, 0);
                         //首先获取所有终端信息
@@ -183,7 +185,7 @@ namespace Monitor
                         if (linkCount == 1)
                         {
                             disconnected = true;
-                            SetNotification("PLC掉线,请检查连接");
+                            SetNotification("PLC掉线,请检查连接",TextColor.Warning);
                         }
                     }
                 }
@@ -292,46 +294,53 @@ namespace Monitor
         }
 
         //************************************ 公有方法 **********************************
-        public Monitor(IntPtr flpHandle)
+        public Monitor(centralController.centralController mainWin, IntPtr flpHandle)
         {
+            Monitor.mainWin = mainWin;
             Monitor.flpHandle = flpHandle;
             parkingSpaceInfo = new List<ParkingSpaceStru>();
             mainBlockInfo = new MainBlockStru();
         }
-        /// <summary>
-        /// 获取提示信息
-        /// </summary>
-        /// <returns></returns>
-        public string GetNotification()
-        {
-            StringBuilder notificationStr = new StringBuilder();
-            lock (notificationQueue)
-            {
-                string[] strs = notificationQueue.ToArray();
-                Array.Reverse(strs);
-                for (int i = 0; i < strs.Length; i++)
-                {
-                    notificationStr.Append(strs[i]);
-                }
-                //Queue<string>.Enumerator notiEnumer = notificationQueue.GetEnumerator();
-                //while (notiEnumer.MoveNext())
-                //{
-                //    notificationStr.Append(notiEnumer.Current);
-                //}
-            }
-            return notificationStr.ToString();
-        }
+        ///// <summary>
+        ///// 获取提示信息
+        ///// </summary>
+        ///// <returns></returns>
+        //public string GetNotification()
+        //{
+        //    StringBuilder notificationStr = new StringBuilder();
+        //    lock (notificationQueue)
+        //    {
+        //        string[] strs = notificationQueue.ToArray();
+        //        Array.Reverse(strs);
+        //        for (int i = 0; i < strs.Length; i++)
+        //        {
+        //            notificationStr.Append(strs[i]);
+        //        }
+        //        //Queue<string>.Enumerator notiEnumer = notificationQueue.GetEnumerator();
+        //        //while (notiEnumer.MoveNext())
+        //        //{
+        //        //    notificationStr.Append(notiEnumer.Current);
+        //        //}
+        //    }
+        //    return notificationStr.ToString();
+        //}
         /// <summary>
         /// 添加提示信息
         /// </summary>
         /// <param name="notification"></param>
-        public static void SetNotification(string notification)
+        public static void SetNotification(string notification, TextColor textColor=TextColor.Log)
         {
             if (notification == "clear")
             {
-                lock (notificationQueue)
+                //lock (notificationQueue)
+                //{
+                //    notificationQueue.Clear();
+                //}
+                if (mainWin != null)
                 {
-                    notificationQueue.Clear();
+                    mainWin.Invoke(new Action(() => {
+                        mainWin.UpdateText(notification, textColor);
+                    }));
                 }
                 return;
             }
@@ -339,16 +348,23 @@ namespace Monitor
             {
                 string time = DateTime.Now + "\r\n";
                 string notificationStr = time + notification + "\r\n";
-                lock (notificationQueue)
+                //lock (notificationQueue)
+                //{
+                //    int count = notificationQueue.Count;
+                //    if (count >= MAXLINES)
+                //    {
+                //        notificationQueue.Dequeue();
+                //    }
+                //    notificationQueue.Enqueue(notificationStr);
+                //}
+                if (mainWin != null)
                 {
-                    int count = notificationQueue.Count;
-                    if (count >= MAXLINES)
-                    {
-                        notificationQueue.Dequeue();
-                    }
-                    notificationQueue.Enqueue(notificationStr);
+                    mainWin.Invoke(new Action(() => {
+                        mainWin.UpdateText(notificationStr, textColor);
+                    }));
                 }
             }
+            
         }
         /// <summary>
         /// 返回系统信息字符串

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

@@ -38,7 +38,7 @@ namespace Monitor
             mt.StartTiming();
             try
             {
-                Monitor.SetNotification("读取配置文件中...");
+                Monitor.SetNotification("读取配置文件中...",parkMonitor.model.TextColor.Log);
                 retryCount = Convert.ToInt32(ConfigurationManager.AppSettings.Get("retryCount"));
                 //数据库
                 remoteDBConnStr = ConfigurationManager.AppSettings.Get("remoteDBConnStr");
@@ -67,14 +67,14 @@ namespace Monitor
             }
             catch (Exception e) { Console.WriteLine("初始化," + e.Message); return; }
 
-            Monitor.SetNotification("初始化PLC连接...");
+            Monitor.SetNotification("初始化PLC连接...",parkMonitor.model.TextColor.Log);
             initStatus = initStatus && PLCInit(retryCount);
             //PLC初始化结束,进入状态2
-            if (!initStatus) { Monitor.SetNotification("PLC连接失败,请检查设备"); return; }
+            if (!initStatus) { Monitor.SetNotification("PLC连接失败,请检查设备",parkMonitor.model.TextColor.Error); return; }
             else { Monitor.initializeState = 2; }
 
             //初始化数据库对象
-            Monitor.SetNotification("初始化数据库...");
+            Monitor.SetNotification("初始化数据库...",parkMonitor.model.TextColor.Log);
             Monitor.remoteDBOper = new DBOperation(remoteDBConnStr, DBtimeout);
             Monitor.localDBOper = new DBOperation(localDBConnStr, DBtimeout);
             initStatus = initStatus && Monitor.remoteDBOper.InitConnPooling(10);
@@ -84,7 +84,7 @@ namespace Monitor
             else { Monitor.initializeState = 3; }
 
             //初始化web对象
-            Monitor.SetNotification("初始化云端连接...");
+            Monitor.SetNotification("初始化云端连接...",parkMonitor.model.TextColor.Log);
             //Monitor.webServer = new CentralForWeb();
             Monitor.webServer = new MyWebServer();
             initStatus = initStatus && Monitor.webServer.Start(Monitor.webPort);
@@ -120,14 +120,14 @@ namespace Monitor
             #endregion
 
             //初始化计费策略
-            Monitor.SetNotification("读取计费策略...");
+            Monitor.SetNotification("读取计费策略...",parkMonitor.model.TextColor.Log);
             PaymentScheme.ins = PaymentScheme.GetCurrentPaymentScheme(1);
             //初始化号牌机对象
-            Monitor.SetNotification("扫描已接入号牌机...");
+            Monitor.SetNotification("扫描已接入号牌机...",parkMonitor.model.TextColor.Log);
             Monitor.numMachineLinker = new NumMachineLinker(flpHandle);
             Monitor.numMachineLinker.Start();
             //初始化显示板对象,显示板udp面向无连接
-            Monitor.SetNotification("初始化屏显...");
+            Monitor.SetNotification("初始化屏显...",parkMonitor.model.TextColor.Log);
             //BroadcastLinker.Start();
             //Monitor.allInOneMachine = BroadcastLinker.ins;//new BroadcastBoard(Monitor.allInOneMachineIP, Monitor.allInOneMachinePort);
             //初始化广告实例
@@ -145,31 +145,43 @@ namespace Monitor
             {
                 case 0:
                     Console.WriteLine("配置文件读写异常");
-                    Monitor.SetNotification("配置文件读写异常");
+                    Monitor.SetNotification("配置文件读写异常",parkMonitor.model.TextColor.Error);
                     break;
                 case 1:
                     Console.WriteLine("PLC初始化异常");
-                    Monitor.SetNotification("PLC初始化异常");
+                    Monitor.SetNotification("PLC初始化异常",parkMonitor.model.TextColor.Error);
                     break;
                 case 2:
                     Console.WriteLine("数据库初始化异常");
-                    Monitor.SetNotification("数据库初始化异常");
+                    Monitor.SetNotification("数据库初始化异常",parkMonitor.model.TextColor.Error);
                     break;
                 case 3:
                     Console.WriteLine("webServer初始化异常");
-                    Monitor.SetNotification("webServer初始化异常");
+                    Monitor.SetNotification("webServer初始化异常",parkMonitor.model.TextColor.Error);
                     break;
                 case 4:
                     Console.WriteLine("其他异常");
-                    Monitor.SetNotification("其他异常");
+                    Monitor.SetNotification("其他异常",parkMonitor.model.TextColor.Error);
                     break;
                 case 5:
                     Console.WriteLine("初始化成功");
                     Monitor.SetNotification("clear");
-                    Monitor.SetNotification("初始化成功");
+                    Monitor.SetNotification("初始化成功",parkMonitor.model.TextColor.Log);
                     break;
             }
-
+            //Monitor.SetNotification("aaaaaaaaaaaaaaaa", parkMonitor.model.TextColor.Info);
+            //Monitor.SetNotification("bbbbbbbbbbbbbbbb", parkMonitor.model.TextColor.Log);
+            //Monitor.SetNotification("cccccccccccccccc", parkMonitor.model.TextColor.Warning);
+            //Monitor.SetNotification("dddddddddddddddd", parkMonitor.model.TextColor.Error);
+            //Task.Factory.StartNew(()=>
+            //{
+            //    int count = 30;
+            //    while (count-- > 0)
+            //    {
+            //        Monitor.SetNotification("cccccccccccccccc", parkMonitor.model.TextColor.Warning);
+            //        Thread.Sleep(1500);
+            //    }
+            //});
         }
         /// <summary>
         /// PLC初始化与连接

+ 20 - 0
PLCLinker/centralController/Properties/Resources.Designer.cs

@@ -70,6 +70,16 @@ namespace centralController.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap car {
+            get {
+                object obj = ResourceManager.GetObject("car", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
@@ -110,6 +120,16 @@ namespace centralController.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap numMachine {
+            get {
+                object obj = ResourceManager.GetObject("numMachine", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 12 - 6
PLCLinker/centralController/Properties/Resources.resx

@@ -118,6 +118,9 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\resource\image\menu\about.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
   <data name="sysExplain" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\resource\image\menu\sysExplain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
@@ -130,19 +133,22 @@
   <data name="close" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\resource\image\menu\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
-  <data name="pc" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\resource\image\map\pc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  <data name="sysExplain1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\resource\image\menu\sysExplain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
   <data name="openFile" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\resource\image\menu\openFile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
-  <data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\resource\image\menu\about.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  <data name="pc" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\resource\image\map\pc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
   <data name="circulate2" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\resource\image\map\circulate2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
-  <data name="sysExplain1" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\resource\image\menu\sysExplain.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  <data name="numMachine" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\resource\image\map\numMachine.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="car" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\resource\image\map\car.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
 </root>

+ 20 - 21
PLCLinker/centralController/Terminal/Terminal.cs

@@ -319,7 +319,7 @@ namespace Terminal
                         Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
                         status = 1;
                         Log.WriteLog(LogType.process, LogFile.INFO, "号牌验证成功");
-                        Monitor.Monitor.SetNotification("注册用户,号牌验证成功");
+                        Monitor.Monitor.SetNotification("注册用户,号牌验证成功",parkMonitor.model.TextColor.Info);
                     }
                     else
                     {
@@ -327,7 +327,7 @@ namespace Terminal
                         Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
                         status = 2;
                         Log.WriteLog(LogType.process, LogFile.WARNING, "号牌验证失败");
-                        Monitor.Monitor.SetNotification("注册用户,号牌验证失败");
+                        Monitor.Monitor.SetNotification("注册用户,号牌验证失败",parkMonitor.model.TextColor.Error);
                     }
                     try
                     {
@@ -424,7 +424,7 @@ namespace Terminal
                         if (!idLicMap.ContainsKey(terminalInfo[i].terminalID))
                         {
                             license = Monitor.Monitor.numMachineLinker.GetLicensePlate(terminalInfo[i].terminalID);
-                            Monitor.Monitor.SetNotification("启动" + terminalInfo[i].terminalID + "号号牌机,号牌:" + license);
+                            Monitor.Monitor.SetNotification("启动" + terminalInfo[i].terminalID + "号号牌机,号牌:" + license,parkMonitor.model.TextColor.Info);
                         }
                         else
                         {
@@ -481,7 +481,7 @@ namespace Terminal
                                 userType = -1
                             };
                             //注册用户
-                            if (term.btnStatus == (short)2)
+                            if (term.btnStatus == (short)2 || term.btnStatus == (short)3)
                             {
                                 int userID = term.licenseCodeA;
                                 string userLicense = GetLicenseFromTerm(term);
@@ -493,7 +493,7 @@ namespace Terminal
                                 }
                             }
                             //非注册用户
-                            else if (term.btnStatus == (short)1)
+                            else if (term.btnStatus == (short)1 || term.btnStatus == (short)4)
                             {
                                 numReceivedStatus = 1;
                                 ts.licVerification = 1;
@@ -509,14 +509,14 @@ namespace Terminal
                             };
                             Monitor.Monitor.PLC.WriteToPLC(mb, PLCDataType.central);
                             //号牌获取结果被清零才跳出
-                            Monitor.Monitor.SetNotification("已写入号牌获取结果,等待号牌机启动指令清零");
+                            Monitor.Monitor.SetNotification("已写入号牌获取结果,等待号牌机启动指令清零",parkMonitor.model.TextColor.Info);
                         }
                         int countdown = 5;
                         while (countdown-- > 0)
                         {
                             if (term.numMachineLaunch == 0)
                             {
-                                Monitor.Monitor.SetNotification("号牌机启动指令已被清零"); break;
+                                Monitor.Monitor.SetNotification("号牌机启动指令已被清零",parkMonitor.model.TextColor.Info); break;
                             }
                             else
                                 Thread.Sleep(1000);
@@ -547,7 +547,6 @@ namespace Terminal
                 //等待完成信号
                 while (Monitor.Monitor.mainBlockInfo.processCompleted != 1)
                 {
-                    Thread.Sleep(200);
                     if (Monitor.Monitor.mainBlockInfo.processStopped == 1)
                         return;
                     Thread.Sleep(200);
@@ -572,7 +571,7 @@ namespace Terminal
                     if (parkingSpaceID == 0 || term.receiptNum == 0)
                     {
                         try { idLicMap.Remove(currentTerm); } catch { }
-                        Monitor.Monitor.SetNotification("无车位或凭证号");
+                        Monitor.Monitor.SetNotification("无车位或凭证号",parkMonitor.model.TextColor.Warning);
                         return;
                     }
                     UpdateVehicle(license, 0, 0, true, false, 0);
@@ -594,7 +593,7 @@ namespace Terminal
                     Monitor.Monitor.localDBOper.Insert(list);
                     Monitor.Monitor.remoteDBOper.Insert(list);
                     Log.WriteLog(LogType.process, LogFile.INFO, "停车记录已插入," + license + "停在" + parkingSpaceID + ",凭证号:" + term.receiptNum);
-                    Monitor.Monitor.SetNotification("停车记录已插入");
+                    Monitor.Monitor.SetNotification("停车记录已插入",parkMonitor.model.TextColor.Info);
                     ////注册用户记录插入云端
                     //if (term.btnStatus == 0)
                     //{
@@ -626,7 +625,7 @@ namespace Terminal
                     //中控清除车牌、凭证号、号牌验证等信息
                     ClearTerminal(term.terminalID);
                     try { idLicMap.Remove(currentTerm); } catch { }
-                    Monitor.Monitor.SetNotification(license + " 数据库已更新,停车流程结束");
+                    Monitor.Monitor.SetNotification(license + " 数据库已更新,停车流程结束",parkMonitor.model.TextColor.Info);
                 }
             }
         }
@@ -667,7 +666,7 @@ namespace Terminal
                 {
                     license = Monitor.Monitor.numMachineLinker.GetLicensePlate(terminalInfo[index].terminalID);
                 }
-                Monitor.Monitor.SetNotification(terminalInfo[index].terminalID + "号车位收到地感,拍到" + license);
+                Monitor.Monitor.SetNotification(terminalInfo[index].terminalID + "号车位收到地感,拍到" + license,parkMonitor.model.TextColor.Log);
                 if (license != "")
                 {
                     //map中加入或更新号牌,供完成时写入数据库用
@@ -682,7 +681,7 @@ namespace Terminal
                     if (Monitor.Monitor.webServer.ReservedCarCheck(license))
                     {
                         registered = 3;
-                        Monitor.Monitor.SetNotification("预约车辆入场");
+                        Monitor.Monitor.SetNotification("预约车辆入场",parkMonitor.model.TextColor.Info);
                     }
                     #region 通过数据库查询是否预约车,方法待定
                     //int vehicleState = -1;
@@ -724,7 +723,7 @@ namespace Terminal
                         receiptNum = -1
                     };
                     Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.terminal);
-                    Monitor.Monitor.SetNotification("指令写入PLC:"+ts.btnStatus);
+                    Monitor.Monitor.SetNotification("指令写入PLC:"+ts.btnStatus,parkMonitor.model.TextColor.Log);
                     Thread.Sleep(1000);
                 }
                 else
@@ -805,7 +804,7 @@ namespace Terminal
                 else
                 {
                     Log.WriteLog(LogType.process, LogFile.ERROR, "根据凭证号查询停车记录失败");
-                    Monitor.Monitor.SetNotification("取车流程, 根据凭证号查询停车记录失败");
+                    Monitor.Monitor.SetNotification("取车流程, 根据凭证号查询停车记录失败",parkMonitor.model.TextColor.Error);
                     result = false;
                 }
                 //if (reader != null)
@@ -1033,7 +1032,7 @@ namespace Terminal
                 if (termIndex != -1 && termUsedMap.Count >= termIndex && termUsedMap.TryGetValue(termIndex, out bool value) && !value && ts.cmd == 2 && receiptNum != 0)
                 {
                     //fetchState = Monitor.Monitor.mainBlockInfo.fetchingRunning;
-                    Monitor.Monitor.SetNotification(termIndex + "号终端准备计算费用");
+                    Monitor.Monitor.SetNotification(termIndex + "号终端准备计算费用",parkMonitor.model.TextColor.Log);
                     termUsedMap[termIndex] = true;
                     Console.WriteLine("终端编号" + termIndex);
 
@@ -1100,7 +1099,7 @@ namespace Terminal
                         }
                         catch { Console.WriteLine("error"); }
                     }
-                    Monitor.Monitor.SetNotification("用户类型:" + (monthCardType+1) + ",费用:" + fee + ",等待凭证号被清除且流程结束后更新车辆状态");
+                    Monitor.Monitor.SetNotification("用户类型:" + (monthCardType+1) + ",费用:" + fee + ",等待凭证号被清除且流程结束后更新车辆状态",parkMonitor.model.TextColor.Log);
                     FetchInfo fetchInfo = new FetchInfo(license, parkingRecordsID, remoteParkingRecordsID, fee, receiptNum);
                     if (!fetchMap.ContainsKey(termIndex))
                         fetchMap.Add(termIndex, fetchInfo);
@@ -1137,7 +1136,7 @@ namespace Terminal
                         {
                             count++;
                             if (count == 1)
-                                Monitor.Monitor.SetNotification("等待凭证号清除");
+                                Monitor.Monitor.SetNotification("等待凭证号清除",parkMonitor.model.TextColor.Log);
                             if (count > 10000)//避免int型数据溢出
                                 count = 2;
                             Thread.Sleep(200);
@@ -1159,7 +1158,7 @@ namespace Terminal
                         }
                         else
                         {
-                            Monitor.Monitor.SetNotification("未查询到该取车终端存在计费操作");
+                            Monitor.Monitor.SetNotification("未查询到该取车终端存在计费操作",parkMonitor.model.TextColor.Error);
                             return;
                         }
                         //TerminalStru fetchReset = new TerminalStru
@@ -1188,10 +1187,10 @@ namespace Terminal
                             Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
                             UpdateVehicle(fi.license, 0, fi.remoteParkingRecordsID, false, true, 0);
                         }
-                        Monitor.Monitor.SetNotification(fi.license + " 取车流程结束");
+                        Monitor.Monitor.SetNotification(fi.license + " 取车流程结束",parkMonitor.model.TextColor.Info);
                         break;
                     }
-                    Thread.Sleep(1000);
+                    Thread.Sleep(300);
                 }
                 termUsedMap[termIndex] = false;
                 fetchMap.Remove(termIndex);

+ 3 - 3
PLCLinker/centralController/WebServer/CentralForWebSocketServer.cs

@@ -149,15 +149,15 @@ namespace centralController.WebServer
                                 bool result = Monitor.Monitor.advertMgr.UpdateAdvert(out adAlert);
                                 if (!result)
                                 {
-                                    Monitor.Monitor.SetNotification("广告更新失败,请尝试手动更新");
+                                    Monitor.Monitor.SetNotification("广告更新失败,请尝试手动更新",parkMonitor.model.TextColor.Error);
                                 }
                                 else
                                 {
-                                    Monitor.Monitor.SetNotification("广告更新成功\n" + adAlert);
+                                    Monitor.Monitor.SetNotification("广告更新成功\n" + adAlert,parkMonitor.model.TextColor.Info);
                                 }
                                 break;
                             default:
-                                Monitor.Monitor.SetNotification("接收到无法识别的指令");
+                                Monitor.Monitor.SetNotification("接收到无法识别的指令",parkMonitor.model.TextColor.Warning);
                                 break;
                         }
                     }

+ 29 - 22
PLCLinker/centralController/WebServer/WebServer.cs

@@ -76,9 +76,9 @@ namespace centralController.WebServer
             vehicleInsertList.Add(vehicleInsertSql);
             if (localDB)
             {
-                if (!Monitor.Monitor.localDBOper.UpdateTransaction(vehicleUpdateList))
+                if (!Monitor.Monitor.localDBOper.Insert(vehicleInsertList))
                 {
-                    if (!Monitor.Monitor.localDBOper.Insert(vehicleInsertList))
+                    if (!Monitor.Monitor.localDBOper.UpdateTransaction(vehicleUpdateList))
                         return false;
                     else
                         return true;
@@ -87,9 +87,9 @@ namespace centralController.WebServer
             }
             else
             {
-                if (!Monitor.Monitor.remoteDBOper.UpdateTransaction(vehicleUpdateList))
+                if (!Monitor.Monitor.remoteDBOper.Insert(vehicleInsertList))
                 {
-                    if (!Monitor.Monitor.remoteDBOper.Insert(vehicleInsertList))
+                    if (!Monitor.Monitor.remoteDBOper.UpdateTransaction(vehicleUpdateList))
                         return false;
                     else
                         return true;
@@ -162,6 +162,7 @@ namespace centralController.WebServer
         /// <returns></returns>
         private bool ReserveDBOperation(bool localDB, string userID, bool parking, string license, string orderTime, int orderLength)
         {
+            UpdateVehicleState(localDB, parking ? 4 : 5, 0, license);
             //预约记录插入db
             InsertOrderRecord(localDB, userID, parking, license, orderTime, orderLength);
             //查询预约记录id号
@@ -228,6 +229,7 @@ namespace centralController.WebServer
                                 //回复预约失败给web
                                 returnMsg.cmd = "FAILED";
                                 comm.SendMessage(returnMsg);
+                                Monitor.Monitor.SetNotification("车辆" + msg.context + "预约停车,已无可预约车位",parkMonitor.model.TextColor.Warning);
                             }
                             else
                             {
@@ -241,6 +243,7 @@ namespace centralController.WebServer
                                 //回复成功给web
                                 returnMsg.cmd = "0";
                                 comm.SendMessage(returnMsg);
+                                Monitor.Monitor.SetNotification("车辆" + msg.context + "预约停车,操作成功",parkMonitor.model.TextColor.Log);
                             }
                         }
                         break;
@@ -258,7 +261,7 @@ namespace centralController.WebServer
                         break;
                     //连接断开消息
                     case "DISCONNECT":
-                        Monitor.Monitor.SetNotification("收到连接断开提示消息");
+                        Monitor.Monitor.SetNotification("收到连接断开提示消息",parkMonitor.model.TextColor.Warning);
                         break;
                     //更新广告
                     case "ADVERT":
@@ -266,15 +269,15 @@ namespace centralController.WebServer
                         bool result = Monitor.Monitor.advertMgr.UpdateAdvert(out adAlert);
                         if (!result)
                         {
-                            Monitor.Monitor.SetNotification("广告更新失败,请尝试手动更新");
+                            Monitor.Monitor.SetNotification("广告更新失败,请尝试手动更新",parkMonitor.model.TextColor.Warning);
                         }
                         else
                         {
-                            Monitor.Monitor.SetNotification("广告更新成功\n" + adAlert);
+                            Monitor.Monitor.SetNotification("广告更新成功\n" + adAlert,parkMonitor.model.TextColor.Log);
                         }
                         break;
                     default:
-                        Monitor.Monitor.SetNotification("接收到无法识别的指令");
+                        Monitor.Monitor.SetNotification("接收到无法识别的指令",parkMonitor.model.TextColor.Warning);
                         break;
                 }
             }
@@ -298,12 +301,12 @@ namespace centralController.WebServer
                         licenseReceived = -1
                     };
                     Monitor.Monitor.PLC.WriteToPLC(mb, PLCDataType.central);
-                    Monitor.Monitor.SetNotification(mb.bookParkCmd+","+mb.bookFetchCmd+"预约停车指令写入PLC");
+                    Monitor.Monitor.SetNotification(mb.bookParkCmd + "," + mb.bookFetchCmd + "预约停车指令写入PLC",parkMonitor.model.TextColor.Log);
                     break;
                 }
                 if (countdown == 2)
                 {
-                    Monitor.Monitor.SetNotification("未能获取预约指令位0状态,尝试手动清除");
+                    Monitor.Monitor.SetNotification("未能获取预约指令位0状态,尝试手动清除",parkMonitor.model.TextColor.Warning);
                     MainBlockStru mb = new MainBlockStru
                     {
                         centralHearbeat = -1,
@@ -334,7 +337,7 @@ namespace centralController.WebServer
                             DateTime startTime = DateTime.Parse(msg.bookTime);
                             TimeSpan ts = DateTime.Now - startTime;
                             //达到预约启动时间,放入已预约队列
-                            Console.WriteLine("当前时间差:"+ts.TotalMinutes+",指令类型:"+msg.cmd);
+                            Console.WriteLine("当前时间差:" + ts.TotalMinutes + ",指令类型:" + msg.cmd);
                             if (ts.TotalMinutes >= 0)
                             {
                                 Console.WriteLine();
@@ -342,12 +345,9 @@ namespace centralController.WebServer
                                 if (msg.cmd == "RESERVE")
                                 {
                                     SendBookCmd(true, 1);
-                                    Monitor.Monitor.SetNotification("通知PLC减少可预约车位");
-                                }
-                                lock (reservedLock)
-                                {
-                                    reservedQueue.Enqueue(msg);
+                                    Monitor.Monitor.SetNotification("通知PLC减少可预约车位",parkMonitor.model.TextColor.Log);
                                 }
+                                reservedQueue.Enqueue(msg);
                             }
                             //还未达到启动时间
                             else
@@ -370,13 +370,17 @@ namespace centralController.WebServer
                             //预约超时
                             if (ts.TotalMinutes > msg.bookLength * 60)
                             {
-                                Monitor.Monitor.SetNotification("预约已超时");
+                                Monitor.Monitor.SetNotification(msg.context+" 预约已超时",parkMonitor.model.TextColor.Warning);
                                 //通知PLC将可预约车位数恢复一个
                                 SendBookCmd(true, 2);
                                 //恢复车辆状态
                                 UpdateVehicleState(true, 0, 0, msg.context);
                                 UpdateVehicleState(false, 0, 0, msg.context);
                             }
+                            else
+                            {
+                                reservedQueue.Enqueue(msg);
+                            }
                         }
                         catch { }
                     }
@@ -406,6 +410,7 @@ namespace centralController.WebServer
                 {
                     try
                     {
+                        Connections.close();
                         Connections.Connection();
                         connected = true;
                         comm = new Communication();
@@ -421,7 +426,8 @@ namespace centralController.WebServer
                 //持续判断连接状态并重连
                 while (!isClosing)
                 {
-                    Console.WriteLine(Connections.isAlive() + ", " + receiveMsg.ThreadState.ToString());
+                    if(receiveMsg!=null)
+                        Console.WriteLine(Connections.isAlive() + ", " + receiveMsg.ThreadState.ToString());
                     if (Connections.isAlive())
                     {
                         if (!connected)
@@ -429,7 +435,7 @@ namespace centralController.WebServer
                             comm = new Communication();
                         }
                         connected = true;
-                        if (receiveMsg.ThreadState == ThreadState.Aborted)
+                        if (receiveMsg!=null && receiveMsg.ThreadState == ThreadState.Aborted)
                         {
                             try
                             {
@@ -443,18 +449,19 @@ namespace centralController.WebServer
                         connected = false;
                         try
                         {
-                            if (receiveMsg.ThreadState == ThreadState.WaitSleepJoin)
+                            if (receiveMsg!=null && receiveMsg.ThreadState == ThreadState.WaitSleepJoin)
                             {
                                 receiveMsg.Interrupt();
                             }
                         }
                         catch (Exception ex)
                         {
-                            Monitor.Monitor.SetNotification("连接断开,终止消息接收线程");
+                            Monitor.Monitor.SetNotification("连接断开,终止消息接收线程",parkMonitor.model.TextColor.Log);
                         }
                         Console.WriteLine(" 连接关闭,需要重新连接注册");
                         try
                         {
+                            Connections.close();
                             Connections.Connection();
                         }
                         catch (Exception)
@@ -479,7 +486,7 @@ namespace centralController.WebServer
                             {
                                 MsgHandling(msg);
                             }
-                            Monitor.Monitor.SetNotification(msg.context);
+                            //Monitor.Monitor.SetNotification(msg.context);
                         }
                     }
                     catch { Console.WriteLine("线程已中断"); }

+ 3 - 0
PLCLinker/centralController/centralController.csproj

@@ -235,6 +235,7 @@
     <Compile Include="FormPLCConf.Designer.cs">
       <DependentUpon>FormPLCConf.cs</DependentUpon>
     </Compile>
+    <Compile Include="model\TermModel.cs" />
     <Compile Include="Monitor\SystemInitializer.cs" />
     <Compile Include="FormCentralController.cs">
       <SubType>Form</SubType>
@@ -337,6 +338,8 @@
     <None Include="resource\image\menu\about.png" />
     <None Include="resource\image\menu\openFile.png" />
     <None Include="resource\image\menu\sysExplain.png" />
+    <None Include="resource\image\map\numMachine.png" />
+    <None Include="resource\image\map\car.png" />
     <Content Include="sdk\broadcast\broadcastDLL.dll" />
     <Content Include="sdk\log4net\log4net.dll" />
     <Content Include="sdk\mysql\MySql.Data.dll" />

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

@@ -109,4 +109,18 @@ namespace parkMonitor.model {
 		/// <summary>错误</summary>
 		Error
 	}
+
+    /// <summary>
+    /// 提示信息颜色
+    /// </summary>
+    public enum TextColor {
+        /// <summary>日志,灰色</summary>
+        Log,
+        /// <summary>提示,白色</summary>
+        Info,
+        /// <summary>警告,黄色</summary>
+        Warning,
+        /// <summary>错误,红色</summary>
+        Error
+    }
 }

+ 36 - 0
PLCLinker/centralController/model/TermModel.cs

@@ -0,0 +1,36 @@
+using DevComponents.DotNetBar.Controls;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace centralController.model
+{
+    class TermModel
+    {
+        public int id;
+        public bool park;
+        public bool launched;
+        public bool groundSensor;
+        public bool numMachine;
+        public GroupPanel gp;
+        public PictureBox pbNum;
+        public PictureBox pbCar;
+        public TermModel(GroupPanel gp, PictureBox pbNum, PictureBox pbCar)
+        {
+            this.gp = gp;
+            this.pbNum = pbNum;
+            this.pbCar = pbCar;
+        }
+        public void UpdateStatus(int id, bool park, bool launched, bool groundSensor, bool numMachine)
+        {
+            this.id = id;
+            this.park = park;
+            this.launched = launched;
+            this.groundSensor = groundSensor;
+            this.numMachine = numMachine;
+        }
+    }
+}

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


BIN
PLCLinker/centralController/obj/Release/centralController.Properties.Resources.resources


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

@@ -1 +1 @@
-b765a9853fe9be65dc4200d15edb77f06784ded1
+f9b13c3d54a451bab9dae4aa07ecc7010b7042bd

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


BIN
PLCLinker/centralController/sdk/dotNetty/nettyCommunication.dll


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


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


+ 0 - 1
PLCLinker/socketTest/obj/Release/socketTest.csproj.FileListAbsolute.txt

@@ -1,7 +1,6 @@
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\bin\Release\socketTest.exe.config
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\bin\Release\socketTest.exe
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\bin\Release\socketTest.pdb
-E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\obj\Release\socketTest.csprojResolveAssemblyReference.cache
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\obj\Release\socketTest.Form1.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\obj\Release\socketTest.Properties.Resources.resources
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\socketTest\obj\Release\socketTest.csproj.GenerateResource.Cache

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


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


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


BIN
nettyCommunication.dll