Переглянути джерело

新版中控,与终端停取测试通过。单屏显单终端模式,需后续调整

yc_t 6 роки тому
батько
коміт
1fb8311b5d
34 змінених файлів з 975 додано та 502 видалено
  1. BIN
      PLCLinker/.vs/PLCLinker/v15/.suo
  2. BIN
      PLCLinker/.vs/PLCLinker/v15/Server/sqlite3/storage.ide
  3. 3 3
      PLCLinker/PLCConnector/Form1.cs
  4. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.exe
  5. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.pdb
  6. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.csprojResolveAssemblyReference.cache
  7. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.exe
  8. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.pdb
  9. 1 0
      PLCLinker/PLCS7/PLCS7.cs
  10. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.dll
  11. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.pdb
  12. 1 0
      PLCLinker/PLCS7/obj/Release/PLCS7.csproj.FileListAbsolute.txt
  13. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.dll
  14. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.pdb
  15. 322 235
      PLCLinker/centralController/FormCentralController.Designer.cs
  16. 174 38
      PLCLinker/centralController/FormCentralController.cs
  17. 14 2
      PLCLinker/centralController/FormCentralController.resx
  18. 101 33
      PLCLinker/centralController/Monitor/Monitor.cs
  19. 16 2
      PLCLinker/centralController/Monitor/SystemInitializer.cs
  20. 234 162
      PLCLinker/centralController/Terminal/Terminal.cs
  21. BIN
      PLCLinker/centralController/bin/Release/centralController.exe
  22. BIN
      PLCLinker/centralController/bin/Release/centralController.pdb
  23. 17 1
      PLCLinker/centralController/entity/AbstractMessage.cs
  24. BIN
      PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache
  25. BIN
      PLCLinker/centralController/obj/Release/centralController.csprojResolveAssemblyReference.cache
  26. BIN
      PLCLinker/centralController/obj/Release/centralController.exe
  27. BIN
      PLCLinker/centralController/obj/Release/centralController.pdb
  28. 9 7
      PLCLinker/socketTest/Form1.cs
  29. 28 19
      PLCLinker/socketTest/SocketLinker.cs
  30. BIN
      PLCLinker/socketTest/bin/Release/socketTest.exe
  31. BIN
      PLCLinker/socketTest/bin/Release/socketTest.pdb
  32. BIN
      PLCLinker/socketTest/obj/Release/socketTest.exe
  33. BIN
      PLCLinker/socketTest/obj/Release/socketTest.pdb
  34. 55 0
      resources/Printer.cs

BIN
PLCLinker/.vs/PLCLinker/v15/.suo


BIN
PLCLinker/.vs/PLCLinker/v15/Server/sqlite3/storage.ide


+ 3 - 3
PLCLinker/PLCConnector/Form1.cs

@@ -162,7 +162,7 @@ namespace PLCConnector
                     result = ((MainBlockStru)list[0]).ToString();
                 }
             }
-            catch { MessageBox.Show("异常"); return; }
+            catch { Console.WriteLine("异常"); return; }
             textBox1.Text = result.Replace(",","\r\n");
         }
 
@@ -207,7 +207,7 @@ namespace PLCConnector
                     result = ((MainBlockStru)list[0]).ToString();
                 }
             }
-            catch { MessageBox.Show("异常"); return; }
+            catch { Console.WriteLine("异常"); return; }
             textBox7.Text = result.Replace(",", "\r\n");
         }
 
@@ -252,7 +252,7 @@ namespace PLCConnector
                     result = ((MainBlockStru)list[0]).ToString();
                 }
             }
-            catch { MessageBox.Show("异常"); return; }
+            catch { Console.WriteLine("异常"); return; }
             textBox9.Text = result.Replace(",", "\r\n");
         }
 

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


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


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


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


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


+ 1 - 0
PLCLinker/PLCS7/PLCS7.cs

@@ -377,6 +377,7 @@ namespace PLCS7
                     else if (whoami.Equals(PLCDataType.terminal))
                     {
                         //if (ts.terminalStatus != (short)-1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 2 + offset, BitConverter.GetBytes(BytesRevert(ts.terminalStatus))); }
+                        if (ts.paymentStatus != (short)-1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 28 + offset, BitConverter.GetBytes(BytesRevert(ts.paymentStatus))); }
                         if (ts.btnStatus != (short)-1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 4 + offset, BitConverter.GetBytes(BytesRevert(ts.btnStatus))); }
                         if (ts.cmd != (short)-1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 6 + offset, BitConverter.GetBytes(BytesRevert(ts.cmd))); }
                         if (ts.licenseCodeA != -1) { plc.WriteBytes(DataType.DataBlock, terminalDB, 8 + offset, BitConverter.GetBytes(BytesRevert(ts.licenseCodeA))); }

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


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


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

@@ -5,3 +5,4 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Rele
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.dll
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.pdb
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\bin\Release\PLCS7.xml
+E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.csprojResolveAssemblyReference.cache

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


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


+ 322 - 235
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -29,11 +29,12 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             this.dotNetBarManager1 = new DevComponents.DotNetBar.DotNetBarManager(this.components);
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
             this.dockSite9 = new DevComponents.DotNetBar.DockSite();
-            this.bar2 = new DevComponents.DotNetBar.Bar();
+            this.bar_mainWin = new DevComponents.DotNetBar.Bar();
+            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
             this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
@@ -44,12 +45,11 @@
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
-            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_Test = new DevComponents.DotNetBar.DockContainerItem();
-            this.bar4 = new DevComponents.DotNetBar.Bar();
+            this.bar_bottom = new DevComponents.DotNetBar.Bar();
             this.RecordsMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dataGridViewX1 = new DevComponents.DotNetBar.Controls.DataGridViewX();
             this.parkingRecordsID = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -61,18 +61,21 @@
             this.receiptNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.parkingPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dci_ParkingRecords = new DevComponents.DotNetBar.DockContainerItem();
-            this.bar5 = new DevComponents.DotNetBar.Bar();
+            this.bar_side = new DevComponents.DotNetBar.Bar();
             this.terminalMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dci_terminal = new DevComponents.DotNetBar.DockContainerItem();
             this.dockSite1 = new DevComponents.DotNetBar.DockSite();
             this.dockSite2 = new DevComponents.DotNetBar.DockSite();
-            this.bar3 = new DevComponents.DotNetBar.Bar();
+            this.bar_basicInfo = new DevComponents.DotNetBar.Bar();
             this.basicInfoPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.tlp_basicInfo = new System.Windows.Forms.TableLayoutPanel();
             this.tbx_sysInfo = new DevComponents.DotNetBar.Controls.TextBoxX();
+            this.lbx_freeSpace = new DevComponents.DotNetBar.LabelX();
             this.progressBar1 = new System.Windows.Forms.ProgressBar();
             this.dci_basicInfo = new DevComponents.DotNetBar.DockContainerItem();
-            this.bar6 = new DevComponents.DotNetBar.Bar();
+            this.bar_notification = new DevComponents.DotNetBar.Bar();
             this.warningPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.tbx_notification = new DevComponents.DotNetBar.Controls.TextBoxX();
             this.dci_warning = new DevComponents.DotNetBar.DockContainerItem();
             this.dockSite8 = new DevComponents.DotNetBar.DockSite();
             this.dockSite5 = new DevComponents.DotNetBar.DockSite();
@@ -87,6 +90,13 @@
             this.btn_openFile = new DevComponents.DotNetBar.ButtonItem();
             this.btn_refreshRecords = new DevComponents.DotNetBar.ButtonItem();
             this.btn_exportRecords = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_views = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_parkingSpace = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_numMachine = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_payment = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_test = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_terminals = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_records = new DevComponents.DotNetBar.ButtonItem();
             this.btn_devices = new DevComponents.DotNetBar.ButtonItem();
             this.btn_linkPLC = new DevComponents.DotNetBar.ButtonItem();
             this.dockSite3 = new DevComponents.DotNetBar.DockSite();
@@ -97,27 +107,26 @@
             this.panelDockContainer7 = new DevComponents.DotNetBar.PanelDockContainer();
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
-            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
-            this.tbx_notification = new DevComponents.DotNetBar.Controls.TextBoxX();
             this.dockSite9.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.bar2)).BeginInit();
-            this.bar2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
+            this.bar_mainWin.SuspendLayout();
             this.NumMachineMonitorPanel.SuspendLayout();
             this.testPanel.SuspendLayout();
             this.tableLayoutPanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bar4)).BeginInit();
-            this.bar4.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).BeginInit();
+            this.bar_bottom.SuspendLayout();
             this.RecordsMonitorPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridViewX1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bar5)).BeginInit();
-            this.bar5.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bar_side)).BeginInit();
+            this.bar_side.SuspendLayout();
             this.dockSite2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.bar3)).BeginInit();
-            this.bar3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bar_basicInfo)).BeginInit();
+            this.bar_basicInfo.SuspendLayout();
             this.basicInfoPanel.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.bar6)).BeginInit();
-            this.bar6.SuspendLayout();
+            this.tlp_basicInfo.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bar_notification)).BeginInit();
+            this.bar_notification.SuspendLayout();
             this.warningPanel.SuspendLayout();
             this.dockSite7.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar1)).BeginInit();
@@ -161,58 +170,71 @@
             // dockSite9
             // 
             this.dockSite9.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
-            this.dockSite9.Controls.Add(this.bar2);
-            this.dockSite9.Controls.Add(this.bar4);
-            this.dockSite9.Controls.Add(this.bar5);
+            this.dockSite9.Controls.Add(this.bar_mainWin);
+            this.dockSite9.Controls.Add(this.bar_bottom);
+            this.dockSite9.Controls.Add(this.bar_side);
             this.dockSite9.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dockSite9.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.bar2, 698, 459))),
-                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar5, 213, 459)))}, DevComponents.DotNetBar.eOrientation.Horizontal))),
-            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar4, 871, 181)))}, DevComponents.DotNetBar.eOrientation.Vertical);
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_mainWin, 698, 459))),
+                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_side, 213, 459)))}, DevComponents.DotNetBar.eOrientation.Horizontal))),
+            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_bottom, 871, 181)))}, DevComponents.DotNetBar.eOrientation.Vertical);
             this.dockSite9.Location = new System.Drawing.Point(0, 25);
             this.dockSite9.Name = "dockSite9";
             this.dockSite9.Size = new System.Drawing.Size(871, 643);
             this.dockSite9.TabIndex = 8;
             this.dockSite9.TabStop = false;
             // 
-            // bar2
-            // 
-            this.bar2.AccessibleDescription = "DotNetBar Bar (bar2)";
-            this.bar2.AccessibleName = "DotNetBar Bar";
-            this.bar2.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
-            this.bar2.AlwaysDisplayDockTab = true;
-            this.bar2.CanCustomize = false;
-            this.bar2.CanDockBottom = false;
-            this.bar2.CanDockDocument = true;
-            this.bar2.CanDockLeft = false;
-            this.bar2.CanDockRight = false;
-            this.bar2.CanDockTop = false;
-            this.bar2.CanHide = true;
-            this.bar2.CanUndock = false;
-            this.bar2.Controls.Add(this.NumMachineMonitorPanel);
-            this.bar2.Controls.Add(this.ParkingSpaceMonitorPanel);
-            this.bar2.Controls.Add(this.paymentPanel);
-            this.bar2.Controls.Add(this.testPanel);
-            this.bar2.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
-            this.bar2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bar2.IsMaximized = false;
-            this.bar2.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            // bar_mainWin
+            // 
+            this.bar_mainWin.AccessibleDescription = "DotNetBar Bar (bar_mainWin)";
+            this.bar_mainWin.AccessibleName = "DotNetBar Bar";
+            this.bar_mainWin.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
+            this.bar_mainWin.AlwaysDisplayDockTab = true;
+            this.bar_mainWin.CanCustomize = false;
+            this.bar_mainWin.CanDockBottom = false;
+            this.bar_mainWin.CanDockDocument = true;
+            this.bar_mainWin.CanDockLeft = false;
+            this.bar_mainWin.CanDockRight = false;
+            this.bar_mainWin.CanDockTop = false;
+            this.bar_mainWin.CanHide = true;
+            this.bar_mainWin.CanUndock = false;
+            this.bar_mainWin.Controls.Add(this.ParkingSpaceMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.NumMachineMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.paymentPanel);
+            this.bar_mainWin.Controls.Add(this.testPanel);
+            this.bar_mainWin.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
+            this.bar_mainWin.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bar_mainWin.IsMaximized = false;
+            this.bar_mainWin.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_ParkingSpace,
             this.dci_NumMachine,
             this.dci_payment,
             this.dci_Test});
-            this.bar2.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar2.Location = new System.Drawing.Point(0, 0);
-            this.bar2.Name = "bar2";
-            this.bar2.SelectedDockTab = 1;
-            this.bar2.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.bar2.Size = new System.Drawing.Size(665, 408);
-            this.bar2.Stretch = true;
-            this.bar2.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
-            this.bar2.TabIndex = 0;
-            this.bar2.TabNavigation = true;
-            this.bar2.TabStop = false;
+            this.bar_mainWin.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
+            this.bar_mainWin.Location = new System.Drawing.Point(0, 0);
+            this.bar_mainWin.Name = "bar_mainWin";
+            this.bar_mainWin.SelectedDockTab = 0;
+            this.bar_mainWin.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.bar_mainWin.Size = new System.Drawing.Size(665, 408);
+            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;
+            // 
+            // 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(659, 377);
+            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
+            this.ParkingSpaceMonitorPanel.TabIndex = 9;
             // 
             // NumMachineMonitorPanel
             // 
@@ -253,7 +275,6 @@
             // 
             // testPanel
             // 
-            this.testPanel.Controls.Add(this.tableLayoutPanel2);
             this.testPanel.Controls.Add(this.button1);
             this.testPanel.Controls.Add(this.textBox2);
             this.testPanel.Controls.Add(this.textBox1);
@@ -329,19 +350,6 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
-            // 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(659, 377);
-            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_ParkingSpace
             // 
             this.dci_ParkingSpace.Control = this.ParkingSpaceMonitorPanel;
@@ -366,34 +374,34 @@
             this.dci_Test.Name = "dci_Test";
             this.dci_Test.Text = "测试";
             // 
-            // bar4
-            // 
-            this.bar4.AccessibleDescription = "DotNetBar Bar (bar4)";
-            this.bar4.AccessibleName = "DotNetBar Bar";
-            this.bar4.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
-            this.bar4.AlwaysDisplayDockTab = true;
-            this.bar4.CanDockBottom = false;
-            this.bar4.CanDockDocument = true;
-            this.bar4.CanDockLeft = false;
-            this.bar4.CanDockRight = false;
-            this.bar4.CanDockTop = false;
-            this.bar4.CanHide = true;
-            this.bar4.CanUndock = false;
-            this.bar4.Controls.Add(this.RecordsMonitorPanel);
-            this.bar4.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
-            this.bar4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bar4.IsMaximized = false;
-            this.bar4.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            // bar_bottom
+            // 
+            this.bar_bottom.AccessibleDescription = "DotNetBar Bar (bar_bottom)";
+            this.bar_bottom.AccessibleName = "DotNetBar Bar";
+            this.bar_bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
+            this.bar_bottom.AlwaysDisplayDockTab = true;
+            this.bar_bottom.CanDockBottom = false;
+            this.bar_bottom.CanDockDocument = true;
+            this.bar_bottom.CanDockLeft = false;
+            this.bar_bottom.CanDockRight = false;
+            this.bar_bottom.CanDockTop = false;
+            this.bar_bottom.CanHide = true;
+            this.bar_bottom.CanUndock = false;
+            this.bar_bottom.Controls.Add(this.RecordsMonitorPanel);
+            this.bar_bottom.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
+            this.bar_bottom.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bar_bottom.IsMaximized = false;
+            this.bar_bottom.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_ParkingRecords});
-            this.bar4.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar4.Location = new System.Drawing.Point(0, 411);
-            this.bar4.Name = "bar4";
-            this.bar4.SelectedDockTab = 0;
-            this.bar4.Size = new System.Drawing.Size(871, 232);
-            this.bar4.Stretch = true;
-            this.bar4.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
-            this.bar4.TabIndex = 1;
-            this.bar4.TabStop = false;
+            this.bar_bottom.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
+            this.bar_bottom.Location = new System.Drawing.Point(0, 411);
+            this.bar_bottom.Name = "bar_bottom";
+            this.bar_bottom.SelectedDockTab = 0;
+            this.bar_bottom.Size = new System.Drawing.Size(871, 232);
+            this.bar_bottom.Stretch = true;
+            this.bar_bottom.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
+            this.bar_bottom.TabIndex = 1;
+            this.bar_bottom.TabStop = false;
             // 
             // RecordsMonitorPanel
             // 
@@ -421,14 +429,14 @@
             this.realGetTime,
             this.receiptNum,
             this.parkingPrice});
-            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridViewX1.DefaultCellStyle = dataGridViewCellStyle5;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dataGridViewX1.DefaultCellStyle = dataGridViewCellStyle1;
             this.dataGridViewX1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dataGridViewX1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
             this.dataGridViewX1.Location = new System.Drawing.Point(0, 0);
@@ -513,34 +521,34 @@
             this.dci_ParkingRecords.Name = "dci_ParkingRecords";
             this.dci_ParkingRecords.Text = "进出记录";
             // 
-            // bar5
-            // 
-            this.bar5.AccessibleDescription = "DotNetBar Bar (bar5)";
-            this.bar5.AccessibleName = "DotNetBar Bar";
-            this.bar5.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
-            this.bar5.AlwaysDisplayDockTab = true;
-            this.bar5.CanDockBottom = false;
-            this.bar5.CanDockDocument = true;
-            this.bar5.CanDockLeft = false;
-            this.bar5.CanDockRight = false;
-            this.bar5.CanDockTop = false;
-            this.bar5.CanHide = true;
-            this.bar5.CanUndock = false;
-            this.bar5.Controls.Add(this.terminalMonitorPanel);
-            this.bar5.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
-            this.bar5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bar5.IsMaximized = false;
-            this.bar5.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            // bar_side
+            // 
+            this.bar_side.AccessibleDescription = "DotNetBar Bar (bar_side)";
+            this.bar_side.AccessibleName = "DotNetBar Bar";
+            this.bar_side.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
+            this.bar_side.AlwaysDisplayDockTab = true;
+            this.bar_side.CanDockBottom = false;
+            this.bar_side.CanDockDocument = true;
+            this.bar_side.CanDockLeft = false;
+            this.bar_side.CanDockRight = false;
+            this.bar_side.CanDockTop = false;
+            this.bar_side.CanHide = true;
+            this.bar_side.CanUndock = false;
+            this.bar_side.Controls.Add(this.terminalMonitorPanel);
+            this.bar_side.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
+            this.bar_side.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bar_side.IsMaximized = false;
+            this.bar_side.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_terminal});
-            this.bar5.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar5.Location = new System.Drawing.Point(668, 0);
-            this.bar5.Name = "bar5";
-            this.bar5.SelectedDockTab = 0;
-            this.bar5.Size = new System.Drawing.Size(203, 408);
-            this.bar5.Stretch = true;
-            this.bar5.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
-            this.bar5.TabIndex = 2;
-            this.bar5.TabStop = false;
+            this.bar_side.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
+            this.bar_side.Location = new System.Drawing.Point(668, 0);
+            this.bar_side.Name = "bar_side";
+            this.bar_side.SelectedDockTab = 0;
+            this.bar_side.Size = new System.Drawing.Size(203, 408);
+            this.bar_side.Stretch = true;
+            this.bar_side.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
+            this.bar_side.TabIndex = 2;
+            this.bar_side.TabStop = false;
             // 
             // terminalMonitorPanel
             // 
@@ -551,7 +559,7 @@
             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;
-            this.terminalMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.terminalMonitorPanel.Style.ForeColor.Color = System.Drawing.SystemColors.MenuHighlight;
             this.terminalMonitorPanel.Style.GradientAngle = 90;
             this.terminalMonitorPanel.TabIndex = 0;
             // 
@@ -575,49 +583,49 @@
             // dockSite2
             // 
             this.dockSite2.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
-            this.dockSite2.Controls.Add(this.bar3);
-            this.dockSite2.Controls.Add(this.bar6);
+            this.dockSite2.Controls.Add(this.bar_basicInfo);
+            this.dockSite2.Controls.Add(this.bar_notification);
             this.dockSite2.Dock = System.Windows.Forms.DockStyle.Right;
             this.dockSite2.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
-            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar3, 320, 223))),
-            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar6, 320, 417)))}, DevComponents.DotNetBar.eOrientation.Vertical);
+            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_basicInfo, 320, 315))),
+            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(this.bar_notification, 320, 325)))}, DevComponents.DotNetBar.eOrientation.Vertical);
             this.dockSite2.Location = new System.Drawing.Point(871, 25);
             this.dockSite2.Name = "dockSite2";
             this.dockSite2.Size = new System.Drawing.Size(323, 643);
             this.dockSite2.TabIndex = 1;
             this.dockSite2.TabStop = false;
             // 
-            // bar3
-            // 
-            this.bar3.AccessibleDescription = "DotNetBar Bar (bar3)";
-            this.bar3.AccessibleName = "DotNetBar Bar";
-            this.bar3.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
-            this.bar3.AutoSyncBarCaption = true;
-            this.bar3.CloseSingleTab = true;
-            this.bar3.Controls.Add(this.basicInfoPanel);
-            this.bar3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bar3.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.Caption;
-            this.bar3.IsMaximized = false;
-            this.bar3.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            // bar_basicInfo
+            // 
+            this.bar_basicInfo.AccessibleDescription = "DotNetBar Bar (bar_basicInfo)";
+            this.bar_basicInfo.AccessibleName = "DotNetBar Bar";
+            this.bar_basicInfo.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
+            this.bar_basicInfo.AutoSyncBarCaption = true;
+            this.bar_basicInfo.CloseSingleTab = true;
+            this.bar_basicInfo.Controls.Add(this.basicInfoPanel);
+            this.bar_basicInfo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bar_basicInfo.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.Caption;
+            this.bar_basicInfo.IsMaximized = false;
+            this.bar_basicInfo.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_basicInfo});
-            this.bar3.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar3.Location = new System.Drawing.Point(3, 0);
-            this.bar3.Name = "bar3";
-            this.bar3.Size = new System.Drawing.Size(320, 223);
-            this.bar3.Stretch = true;
-            this.bar3.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
-            this.bar3.TabIndex = 0;
-            this.bar3.TabStop = false;
-            this.bar3.Text = "基本信息";
+            this.bar_basicInfo.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
+            this.bar_basicInfo.Location = new System.Drawing.Point(3, 0);
+            this.bar_basicInfo.Name = "bar_basicInfo";
+            this.bar_basicInfo.Size = new System.Drawing.Size(320, 315);
+            this.bar_basicInfo.Stretch = true;
+            this.bar_basicInfo.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
+            this.bar_basicInfo.TabIndex = 0;
+            this.bar_basicInfo.TabStop = false;
+            this.bar_basicInfo.Text = "基本信息";
             // 
             // basicInfoPanel
             // 
-            this.basicInfoPanel.Controls.Add(this.tbx_sysInfo);
+            this.basicInfoPanel.Controls.Add(this.tlp_basicInfo);
             this.basicInfoPanel.Controls.Add(this.progressBar1);
             this.basicInfoPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.basicInfoPanel.Location = new System.Drawing.Point(3, 23);
             this.basicInfoPanel.Name = "basicInfoPanel";
-            this.basicInfoPanel.Size = new System.Drawing.Size(314, 197);
+            this.basicInfoPanel.Size = new System.Drawing.Size(314, 289);
             this.basicInfoPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
             this.basicInfoPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
             this.basicInfoPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
@@ -625,6 +633,21 @@
             this.basicInfoPanel.Style.GradientAngle = 90;
             this.basicInfoPanel.TabIndex = 21;
             // 
+            // tlp_basicInfo
+            // 
+            this.tlp_basicInfo.ColumnCount = 1;
+            this.tlp_basicInfo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tlp_basicInfo.Controls.Add(this.tbx_sysInfo, 0, 1);
+            this.tlp_basicInfo.Controls.Add(this.lbx_freeSpace, 0, 0);
+            this.tlp_basicInfo.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tlp_basicInfo.Location = new System.Drawing.Point(0, 0);
+            this.tlp_basicInfo.Name = "tlp_basicInfo";
+            this.tlp_basicInfo.RowCount = 2;
+            this.tlp_basicInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
+            this.tlp_basicInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 80F));
+            this.tlp_basicInfo.Size = new System.Drawing.Size(314, 262);
+            this.tlp_basicInfo.TabIndex = 7;
+            // 
             // tbx_sysInfo
             // 
             this.tbx_sysInfo.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
@@ -634,21 +657,38 @@
             this.tbx_sysInfo.Border.Class = "TextBoxBorder";
             this.tbx_sysInfo.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
             this.tbx_sysInfo.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tbx_sysInfo.Location = new System.Drawing.Point(0, 0);
+            this.tbx_sysInfo.Location = new System.Drawing.Point(3, 55);
             this.tbx_sysInfo.Multiline = true;
             this.tbx_sysInfo.Name = "tbx_sysInfo";
             this.tbx_sysInfo.PreventEnterBeep = true;
             this.tbx_sysInfo.ReadOnly = true;
             this.tbx_sysInfo.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.tbx_sysInfo.Size = new System.Drawing.Size(314, 170);
+            this.tbx_sysInfo.Size = new System.Drawing.Size(308, 204);
             this.tbx_sysInfo.TabIndex = 1;
             this.tbx_sysInfo.Text = "sample\r\nsample";
             this.tbx_sysInfo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
+            // lbx_freeSpace
+            // 
+            this.lbx_freeSpace.BackColor = System.Drawing.SystemColors.WindowFrame;
+            // 
+            // 
+            // 
+            this.lbx_freeSpace.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_freeSpace.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lbx_freeSpace.FontBold = true;
+            this.lbx_freeSpace.ForeColor = System.Drawing.SystemColors.ActiveCaption;
+            this.lbx_freeSpace.Location = new System.Drawing.Point(3, 3);
+            this.lbx_freeSpace.Name = "lbx_freeSpace";
+            this.lbx_freeSpace.Size = new System.Drawing.Size(308, 46);
+            this.lbx_freeSpace.TabIndex = 2;
+            this.lbx_freeSpace.Text = "currentFreeSpace";
+            this.lbx_freeSpace.TextAlignment = System.Drawing.StringAlignment.Center;
+            // 
             // progressBar1
             // 
             this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.progressBar1.Location = new System.Drawing.Point(0, 170);
+            this.progressBar1.Location = new System.Drawing.Point(0, 262);
             this.progressBar1.Name = "progressBar1";
             this.progressBar1.Size = new System.Drawing.Size(314, 27);
             this.progressBar1.Step = 20;
@@ -661,28 +701,28 @@
             this.dci_basicInfo.Name = "dci_basicInfo";
             this.dci_basicInfo.Text = "基本信息";
             // 
-            // bar6
-            // 
-            this.bar6.AccessibleDescription = "DotNetBar Bar (bar6)";
-            this.bar6.AccessibleName = "DotNetBar Bar";
-            this.bar6.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
-            this.bar6.AutoSyncBarCaption = true;
-            this.bar6.CloseSingleTab = true;
-            this.bar6.Controls.Add(this.warningPanel);
-            this.bar6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bar6.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.Caption;
-            this.bar6.IsMaximized = false;
-            this.bar6.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            // bar_notification
+            // 
+            this.bar_notification.AccessibleDescription = "DotNetBar Bar (bar_notification)";
+            this.bar_notification.AccessibleName = "DotNetBar Bar";
+            this.bar_notification.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
+            this.bar_notification.AutoSyncBarCaption = true;
+            this.bar_notification.CloseSingleTab = true;
+            this.bar_notification.Controls.Add(this.warningPanel);
+            this.bar_notification.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bar_notification.GrabHandleStyle = DevComponents.DotNetBar.eGrabHandleStyle.Caption;
+            this.bar_notification.IsMaximized = false;
+            this.bar_notification.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.dci_warning});
-            this.bar6.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
-            this.bar6.Location = new System.Drawing.Point(3, 226);
-            this.bar6.Name = "bar6";
-            this.bar6.Size = new System.Drawing.Size(320, 417);
-            this.bar6.Stretch = true;
-            this.bar6.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
-            this.bar6.TabIndex = 1;
-            this.bar6.TabStop = false;
-            this.bar6.Text = "警告与提示";
+            this.bar_notification.LayoutType = DevComponents.DotNetBar.eLayoutType.DockContainer;
+            this.bar_notification.Location = new System.Drawing.Point(3, 318);
+            this.bar_notification.Name = "bar_notification";
+            this.bar_notification.Size = new System.Drawing.Size(320, 325);
+            this.bar_notification.Stretch = true;
+            this.bar_notification.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;
+            this.bar_notification.TabIndex = 1;
+            this.bar_notification.TabStop = false;
+            this.bar_notification.Text = "警告与提示";
             // 
             // warningPanel
             // 
@@ -690,7 +730,7 @@
             this.warningPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.warningPanel.Location = new System.Drawing.Point(3, 23);
             this.warningPanel.Name = "warningPanel";
-            this.warningPanel.Size = new System.Drawing.Size(314, 391);
+            this.warningPanel.Size = new System.Drawing.Size(314, 299);
             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;
@@ -698,6 +738,25 @@
             this.warningPanel.Style.GradientAngle = 90;
             this.warningPanel.TabIndex = 26;
             // 
+            // tbx_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.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.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(314, 299);
+            this.tbx_notification.TabIndex = 0;
+            // 
             // dci_warning
             // 
             this.dci_warning.Control = this.warningPanel;
@@ -756,6 +815,7 @@
             this.bar1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
             this.buttonItem1,
             this.btn_files,
+            this.btn_views,
             this.btn_devices});
             this.bar1.Location = new System.Drawing.Point(0, 0);
             this.bar1.MenuBar = true;
@@ -805,6 +865,7 @@
             // 
             this.btn_openFile.Name = "btn_openFile";
             this.btn_openFile.Text = "打开日志";
+            this.btn_openFile.Click += new System.EventHandler(this.btn_openFile_Click);
             // 
             // btn_refreshRecords
             // 
@@ -818,6 +879,54 @@
             this.btn_exportRecords.Text = "导出最近记录";
             this.btn_exportRecords.Click += new System.EventHandler(this.btn_exportRecords_Click);
             // 
+            // btn_views
+            // 
+            this.btn_views.Name = "btn_views";
+            this.btn_views.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
+            this.btn_parkingSpace,
+            this.btn_numMachine,
+            this.btn_payment,
+            this.btn_test,
+            this.btn_terminals,
+            this.btn_records});
+            this.btn_views.Text = "视图";
+            // 
+            // btn_parkingSpace
+            // 
+            this.btn_parkingSpace.Name = "btn_parkingSpace";
+            this.btn_parkingSpace.Text = "车位视图";
+            this.btn_parkingSpace.Click += new System.EventHandler(this.btn_parkingSpace_Click);
+            // 
+            // btn_numMachine
+            // 
+            this.btn_numMachine.Name = "btn_numMachine";
+            this.btn_numMachine.Text = "号牌机视图";
+            this.btn_numMachine.Click += new System.EventHandler(this.btn_numMachine_Click);
+            // 
+            // btn_payment
+            // 
+            this.btn_payment.Name = "btn_payment";
+            this.btn_payment.Text = "支付视图";
+            this.btn_payment.Click += new System.EventHandler(this.btn_payment_Click);
+            // 
+            // btn_test
+            // 
+            this.btn_test.Name = "btn_test";
+            this.btn_test.Text = "测试";
+            this.btn_test.Click += new System.EventHandler(this.btn_test_Click);
+            // 
+            // btn_terminals
+            // 
+            this.btn_terminals.Name = "btn_terminals";
+            this.btn_terminals.Text = "终端视图";
+            this.btn_terminals.Click += new System.EventHandler(this.btn_terminals_Click);
+            // 
+            // btn_records
+            // 
+            this.btn_records.Name = "btn_records";
+            this.btn_records.Text = "停取记录";
+            this.btn_records.Click += new System.EventHandler(this.btn_records_Click);
+            // 
             // btn_devices
             // 
             this.btn_devices.Name = "btn_devices";
@@ -936,38 +1045,6 @@
             this.panelDockContainer8.Style.GradientAngle = 90;
             this.panelDockContainer8.TabIndex = 37;
             // 
-            // tableLayoutPanel2
-            // 
-            this.tableLayoutPanel2.ColumnCount = 2;
-            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel2.Location = new System.Drawing.Point(343, 108);
-            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
-            this.tableLayoutPanel2.RowCount = 2;
-            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel2.Size = new System.Drawing.Size(200, 100);
-            this.tableLayoutPanel2.TabIndex = 7;
-            // 
-            // tbx_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.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.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(314, 391);
-            this.tbx_notification.TabIndex = 0;
-            // 
             // centralController
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -988,26 +1065,28 @@
             this.Name = "centralController";
             this.Text = "智象停车中控端";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.centralController_FormClosing);
             this.dockSite9.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.bar2)).EndInit();
-            this.bar2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).EndInit();
+            this.bar_mainWin.ResumeLayout(false);
             this.NumMachineMonitorPanel.ResumeLayout(false);
             this.testPanel.ResumeLayout(false);
             this.testPanel.PerformLayout();
             this.tableLayoutPanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bar4)).EndInit();
-            this.bar4.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).EndInit();
+            this.bar_bottom.ResumeLayout(false);
             this.RecordsMonitorPanel.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.dataGridViewX1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bar5)).EndInit();
-            this.bar5.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bar_side)).EndInit();
+            this.bar_side.ResumeLayout(false);
             this.dockSite2.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.bar3)).EndInit();
-            this.bar3.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bar_basicInfo)).EndInit();
+            this.bar_basicInfo.ResumeLayout(false);
             this.basicInfoPanel.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.bar6)).EndInit();
-            this.bar6.ResumeLayout(false);
+            this.tlp_basicInfo.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bar_notification)).EndInit();
+            this.bar_notification.ResumeLayout(false);
             this.warningPanel.ResumeLayout(false);
             this.dockSite7.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar1)).EndInit();
@@ -1038,7 +1117,7 @@
         private DevComponents.DotNetBar.DockContainerItem dockContainerItem2;
         private DevComponents.DotNetBar.Controls.GroupPanel groupPanel5;
         private DevComponents.DotNetBar.DockContainerItem dci_PaymentRecords;
-        private DevComponents.DotNetBar.Bar bar2;
+        private DevComponents.DotNetBar.Bar bar_mainWin;
         private DevComponents.DotNetBar.PanelDockContainer ParkingSpaceMonitorPanel;
         private DevComponents.DotNetBar.PanelDockContainer terminalMonitorPanel;
         private DevComponents.DotNetBar.PanelDockContainer RecordsMonitorPanel;
@@ -1050,7 +1129,7 @@
         private DevComponents.DotNetBar.PanelDockContainer panelDockContainer7;
         private DevComponents.DotNetBar.DockContainerItem dockContainerItem1;
         private DevComponents.DotNetBar.PanelDockContainer panelDockContainer8;
-        private DevComponents.DotNetBar.Bar bar3;
+        private DevComponents.DotNetBar.Bar bar_basicInfo;
         private DevComponents.DotNetBar.PanelDockContainer NumMachineMonitorPanel;
         private DevComponents.DotNetBar.PanelDockContainer panelDockContainer10;
         private DevComponents.DotNetBar.DockContainerItem dci_basicInfo;
@@ -1080,12 +1159,20 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn realGetTime;
         private System.Windows.Forms.DataGridViewTextBoxColumn receiptNum;
         private System.Windows.Forms.DataGridViewTextBoxColumn parkingPrice;
-        private DevComponents.DotNetBar.Bar bar4;
-        private DevComponents.DotNetBar.Bar bar5;
-        private DevComponents.DotNetBar.Bar bar6;
+        private DevComponents.DotNetBar.Bar bar_bottom;
+        private DevComponents.DotNetBar.Bar bar_side;
+        private DevComponents.DotNetBar.Bar bar_notification;
         private DevComponents.DotNetBar.Controls.TextBoxX tbx_sysInfo;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+        private System.Windows.Forms.TableLayoutPanel tlp_basicInfo;
         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;
+        private DevComponents.DotNetBar.ButtonItem btn_test;
+        private DevComponents.DotNetBar.ButtonItem btn_parkingSpace;
+        private DevComponents.DotNetBar.ButtonItem btn_payment;
+        private DevComponents.DotNetBar.ButtonItem btn_terminals;
+        private DevComponents.DotNetBar.ButtonItem btn_records;
     }
 }
 

+ 174 - 38
PLCLinker/centralController/FormCentralController.cs

@@ -39,40 +39,33 @@ namespace centralController
                         dataGridViewX1.Invoke(new Action(() => { RefreshRecords(null, null); }));
                         break;
                     }
-                    Thread.Sleep(200);
+                    Thread.Sleep(300);
                 }
             });
+
+            //定时器,定时更新停车记录
+            System.Windows.Forms.Timer recordsTimer = new System.Windows.Forms.Timer();
+            recordsTimer.Interval = 5000;
+            recordsTimer.Tick += new EventHandler(RefreshRecords);
+            recordsTimer.Start();
+
             //定时器,定时更新提示信息
-            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
-            timer.Interval = 1000;
-            timer.Tick += new EventHandler(UpdateText);
-            timer.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();
+
             UpdateBasicInfo();
             tbx_notification.Text = "";
         }
-        /// <summary>
-        /// 定时更新提示信息
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void UpdateText(object sender, EventArgs e)
-        {
-            tbx_notification.Text = Monitor.Monitor.GetNotification();
-        }
-        /// <summary>
-        /// 结束按钮
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btn_exit_Click(object sender, EventArgs e)
-        {
-            DialogResult result = MessageBox.Show("确定退出系统吗?", "温馨提示", MessageBoxButtons.OKCancel);
-            if (result.Equals(DialogResult.OK))
-            {
-                Monitor.Monitor.ins.Stop();
-                Close();
-            }
-        }
+
+        #region 测试
         /// <summary>
         /// 获取号牌测试
         /// </summary>
@@ -102,6 +95,121 @@ namespace centralController
 
             }
         }
+        #endregion
+
+        #region 系统
+        /// <summary>
+        /// 结束按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_exit_Click(object sender, EventArgs e)
+        {
+            //DialogResult result = MessageBox.Show("确定退出系统吗?", "温馨提示", MessageBoxButtons.OKCancel);
+            //if (result.Equals(DialogResult.OK))
+            //{
+            //    Monitor.Monitor.ins.Stop();
+            //    Close();
+            //}
+            Close();
+        }
+        #endregion
+
+        #region 文件
+        /// <summary>
+        /// 打开日志
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_openFile_Click(object sender, EventArgs e)
+        {
+
+        }
+        /// <summary>
+        /// 刷新停车记录按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_refreshRecords_Click(object sender, EventArgs e)
+        {
+            RefreshRecords(null, null);
+        }
+        /// <summary>
+        /// 导出停车记录按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_exportRecords_Click(object sender, EventArgs e)
+        {
+            Export(dataGridViewX1, Directory.GetCurrentDirectory() + "\\");
+            Console.WriteLine(Directory.GetCurrentDirectory() + "\\");
+        }
+        #endregion
+
+        #region 视图
+        /// <summary>
+        /// 车位视图
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_parkingSpace_Click(object sender, EventArgs e)
+        {
+            if(bar_mainWin.Visible == false) { bar_mainWin.Visible = true; }
+            if (dci_ParkingSpace.Visible == false) { dci_ParkingSpace.Visible = true; }
+        }
+        /// <summary>
+        /// 显示号牌机视图
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_numMachine_Click(object sender, EventArgs e)
+        {
+            if (bar_mainWin.Visible == false) { bar_mainWin.Visible = true; }
+            if (dci_NumMachine.Visible == false) { dci_NumMachine.Visible = true; }
+        }
+        /// <summary>
+        /// 支付视图
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_payment_Click(object sender, EventArgs e)
+        {
+            if (bar_mainWin.Visible == false) { bar_mainWin.Visible = true; }
+            if (dci_payment.Visible == false) { dci_payment.Visible = true; }
+        }
+        /// <summary>
+        /// 显示测试选项卡
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_test_Click(object sender, EventArgs e)
+        {
+            if (bar_mainWin.Visible == false) { bar_mainWin.Visible = true; }
+            if (dci_Test.Visible == false) { dci_Test.Visible = true; }
+        }
+        /// <summary>
+        /// 终端视图
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_terminals_Click(object sender, EventArgs e)
+        {
+            if (bar_side.Visible == false) { bar_side.Visible = true; }
+            if (dci_terminal.Visible == false) { dci_terminal.Visible = true; }
+        }
+        /// <summary>
+        /// 停取记录
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_records_Click(object sender, EventArgs e)
+        {
+            if (bar_bottom.Visible == false) { bar_bottom.Visible = true; }
+            if (dci_ParkingRecords.Visible == false) { dci_ParkingRecords.Visible = true; }
+        }
+        #endregion
+
+        #region 设备
         /// <summary>
         /// 手动连接PLC
         /// </summary>
@@ -114,14 +222,28 @@ namespace centralController
                 Monitor.Monitor.PLC.PLCConnect();
             }
         }
+        #endregion
+
+        /// <summary>
+        /// 定时更新提示信息
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void UpdateText(object sender, EventArgs e)
+        {
+            tbx_notification.Text = Monitor.Monitor.GetNotification();
+        }
         /// <summary>
-        /// 刷新停车记录按钮
+        /// 定时更新时间与空闲车位显示
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void btn_refreshRecords_Click(object sender, EventArgs e)
+        private void UpdateFreeSpace(object sender, EventArgs e)
         {
-            RefreshRecords(null, null);
+            string currentTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string freeSpace = "剩余车位:" + Monitor.Monitor.GetFreeSpaceCount();
+            string bookableSpace = "可预约车位:" + Monitor.Monitor.GetBookableSpaceCount();
+            lbx_freeSpace.Text = currentTime + "\r\n" + freeSpace + "     " + bookableSpace;
         }
         /// <summary>
         /// 刷新停车记录显示
@@ -226,17 +348,12 @@ namespace centralController
             string sysInfo = Monitor.Monitor.GetSysInfo();
             tbx_sysInfo.Text = sysInfo;
         }
+       
         /// <summary>
-        /// 导出停车记录按钮
+        /// 动态调整号牌机界面
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void btn_exportRecords_Click(object sender, EventArgs e)
-        {
-            Export(dataGridViewX1, Directory.GetCurrentDirectory() + "\\");
-            Console.WriteLine(Directory.GetCurrentDirectory() + "\\");
-        }
-
         private void flowLayoutPanel1_Resize(object sender, EventArgs e)
         {
             Control.ControlCollection flpCC = flowLayoutPanel1.Controls;
@@ -263,5 +380,24 @@ namespace centralController
             catch (Exception ex) { Console.WriteLine(ex.Message); }
 
         }
+
+        /// <summary>
+        /// 右上角关闭函数
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void centralController_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            DialogResult result = MessageBox.Show("确定退出系统吗?", "温馨提示", MessageBoxButtons.OKCancel);
+            if (result.Equals(DialogResult.OK))
+            {
+                Monitor.Monitor.ins.Stop();
+            }
+            else
+            {
+                e.Cancel = true;
+            }
+        }
+
     }
 }

+ 14 - 2
PLCLinker/centralController/FormCentralController.resx

@@ -120,8 +120,8 @@
   <metadata name="dotNetBarManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>58</value>
+  <metadata name="bar_mainWin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
   </metadata>
   <metadata name="parkingRecordsID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
@@ -147,4 +147,16 @@
   <metadata name="parkingPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="bar_side.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>58</value>
+  </metadata>
+  <metadata name="bar_basicInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bar_notification.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 101 - 33
PLCLinker/centralController/Monitor/Monitor.cs

@@ -303,13 +303,17 @@ namespace Monitor
             lock (notificationQueue)
             {
                 Queue<string>.Enumerator notiEnumer = notificationQueue.GetEnumerator();
-                while (notiEnumer.MoveNext()) {
+                while (notiEnumer.MoveNext())
+                {
                     notificationStr.Append(notiEnumer.Current);
                 }
             }
             return notificationStr.ToString();
         }
-
+        /// <summary>
+        /// 添加提示信息
+        /// </summary>
+        /// <param name="notification"></param>
         public static void AddNotification(string notification)
         {
             string time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
@@ -325,6 +329,16 @@ namespace Monitor
             }
         }
         /// <summary>
+        /// 清除提示信息
+        /// </summary>
+        public static void ClearNotification()
+        {
+            lock (notificationQueue)
+            {
+                notificationQueue.Clear();
+            }
+        }
+        /// <summary>
         /// 返回系统信息字符串
         /// </summary>
         /// <returns></returns>
@@ -335,7 +349,7 @@ namespace Monitor
             try
             {
                 string endl = "\r\n";
-                info += lng.autoPackSys + " " + lng.centralPort + endl + endl;
+                info += endl + lng.autoPackSys + " " + lng.centralPort + endl + endl;
                 info += lng.version + ":" + SysConst.version() + endl + endl;
 
                 info += lng.hostNmae + ":" + Dns.GetHostName() + endl + endl;
@@ -357,47 +371,51 @@ namespace Monitor
             DateTime yesterday = DateTime.Now - (new TimeSpan(1, 0, 0, 0));
             DateTime twoDaysAgo = DateTime.Now - (new TimeSpan(2, 0, 0, 0));
             List<object[]> result = new List<object[]>();
-            string getParkingRecordsSql = "select parkingRecordsID,userID,numberPlate,parkingSpaceID,realParkTime,realGetTime,receiptNum,parkingPrice from parkingrecords where realParkTime like '" + yesterday.ToString("yyyy-MM-dd") + "' or '" + now.ToString("yyyy-MM-dd") + "' or '" + twoDaysAgo.ToString("yyyy-MM-dd") + "';";
-            //MySqlDataReader reader = localDBOper.Query(getParkingRecordsSql);
+            string getParkingRecordsSql = "select parkingRecordsID,userID,numberPlate,parkingSpaceID,realParkTime,realGetTime,receiptNum,parkingPrice " +
+                "from parkingrecords where realParkTime like '" + now.ToString("yyyy-MM-dd") + "%' or realParkTime like '" + yesterday.ToString("yyyy-MM-dd") + "%' or realParkTime like '" + twoDaysAgo.ToString("yyyy-MM-dd") + "%';";
             lock (localDBOper)
             {
+                MySqlDataReader reader = localDBOper.Query(getParkingRecordsSql);
                 try
                 {
-                    MySqlDataAdapter adapter = localDBOper.Display(getParkingRecordsSql);
-                    DataSet ds = new DataSet();
-                    adapter.Fill(ds);
-                    DataTable dt = ds.Tables[0];
-                    for (int i = 0; i < dt.Rows.Count; i++)
+                    //MySqlDataAdapter adapter = localDBOper.Display(getParkingRecordsSql);
+                    //DataSet ds = new DataSet();
+                    //adapter.Fill(ds);
+                    //DataTable dt = ds.Tables[0];
+                    //for (int i = 0; i < dt.Rows.Count; i++)
+                    //{
+                    //    object[] objArray = new object[10];
+                    //    for (int j = 0; j < dt.Columns.Count; j++)
+                    //    {
+                    //        objArray[j] = dt.Rows[i][j];
+                    //    }
+                    //    result.Add(objArray);
+                    //}
+                    //adapter.Dispose();
+
+
+                    while (reader != null && reader.Read())
                     {
-                        object[] objArray = new object[10];
-                        for (int j = 0; j < dt.Columns.Count; j++)
+                        if (reader.HasRows)
                         {
-                            objArray[j] = dt.Rows[i][j];
+                            object[] temp = new object[reader.FieldCount];
+                            reader.GetValues(temp);
+                            result.Add(temp);
                         }
-                        result.Add(objArray);
                     }
-                    adapter.Dispose();
+                }
+                catch (Exception e) { Console.WriteLine(e.Message); }
+                try
+                {
+                    if (reader != null)
+                    {
+                        reader.Close();
+                        reader.Dispose();
+                    }
                 }
                 catch (Exception e) { Console.WriteLine(e.Message); }
             }
-            //while (reader != null && reader.Read())
-            //{
-            //    if (reader.HasRows)
-            //    {
-            //        object[] temp = new object[reader.FieldCount];
-            //        reader.GetValues(temp);
-            //        result.Add(temp);
-            //    }
-            //}
-            //try
-            //{
-            //    if (reader != null)
-            //    {
-            //        reader.Close();
-            //        reader.Dispose();
-            //    }
-            //}
-            //catch { }
+
             result.Reverse();
             return result;
         }
@@ -410,6 +428,56 @@ namespace Monitor
             return null;
         }
         /// <summary>
+        /// 返回空闲正常车位数
+        /// </summary>
+        /// <returns></returns>
+        public static int GetFreeSpaceCount()
+        {
+            int freeSpaceCount = 0;
+            if (parkingSpaceInfo != null)
+            {
+                foreach (ParkingSpaceStru psStru in parkingSpaceInfo)
+                {
+                    if (psStru.spaceStatus != 1 && psStru.spaceStatus != 3)
+                    {
+                        freeSpaceCount++;
+                    }
+                }
+            }
+            return freeSpaceCount;
+        }
+        /// <summary>
+        /// 返回可预约车位数
+        /// </summary>
+        /// <returns></returns>
+        public static int GetBookableSpaceCount()
+        {
+            int bookableSpaceCount = 0;
+            string bookableSpaceSql = "select currentBookableSpace from garageproperties where garageID = " + garageID + ";";
+            if (localDBOper != null)
+            {
+                MySqlDataReader reader = localDBOper.Query(bookableSpaceSql);
+                if (reader != null)
+                {
+                    try
+                    {
+                        if (reader.Read() && reader.HasRows)
+                        {
+                            bookableSpaceCount = reader.GetInt32("currentBookableSpace");
+                        }
+                    }
+                    catch { }
+                    try
+                    {
+                        reader.Close();
+                        reader.Dispose();
+                    }
+                    catch { }
+                }
+            }
+            return bookableSpaceCount;
+        }
+        /// <summary>
         /// 系统初始化,启动plc监控
         /// </summary>
         public void Start()

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

@@ -34,6 +34,7 @@ namespace Monitor
             mt.StartTiming();
             try
             {
+                Monitor.AddNotification("读取配置文件中...");
                 retryCount = Convert.ToInt32(ConfigurationManager.AppSettings.Get("retryCount"));
                 //数据库
                 remoteDBConnStr = ConfigurationManager.AppSettings.Get("remoteDBConnStr");
@@ -60,12 +61,14 @@ namespace Monitor
             }
             catch (Exception e) { Console.WriteLine("初始化," + e.Message); return; }
 
+            Monitor.AddNotification("初始化PLC连接...");
             initStatus = initStatus && PLCInit(retryCount);
             //PLC初始化结束,进入状态2
             if (!initStatus) { return; }
             else { Monitor.initializeState = 2; }
 
             //初始化数据库对象
+            Monitor.AddNotification("初始化数据库...");
             Monitor.remoteDBOper = new DBOperation(remoteDBConnStr, DBtimeout);
             Monitor.localDBOper = new DBOperation(localDBConnStr, DBtimeout);
             initStatus = initStatus && Monitor.remoteDBOper.InitConnPooling(10);
@@ -75,6 +78,7 @@ namespace Monitor
             else { Monitor.initializeState = 3; }
 
             //初始化web对象
+            Monitor.AddNotification("初始化云端连接...");
             Monitor.webServer = new CentralForWeb();
             initStatus = initStatus && Monitor.webServer.Start(Monitor.webPort);
             //webServer初始化结束,进入状态4
@@ -109,11 +113,14 @@ namespace Monitor
             #endregion
 
             //初始化计费策略
+            Monitor.AddNotification("读取计费策略...");
             PaymentScheme.ins = PaymentScheme.GetCurrentPaymentScheme(1);
             //初始化号牌机对象
+            Monitor.AddNotification("扫描已接入号牌机...");
             Monitor.numMachineLinker = new NumMachineLinker(flpHandle);
             Monitor.numMachineLinker.Start();
             //初始化显示板对象,显示板udp面向无连接
+            Monitor.AddNotification("初始化屏显...");
             Monitor.allInOneMachine = new BroadcastBoard(Monitor.allInOneMachineIP, Monitor.allInOneMachinePort);
             //Monitor.allInOneMachine.UpdateTime();
             //Monitor.allInOneMachine.Play(0, BroadcastBoard.PlayMode.download, "欢迎光临");
@@ -121,8 +128,8 @@ namespace Monitor
             //Monitor.allInOneMachine.Play(2, BroadcastBoard.PlayMode.download, "date");
             //Monitor.allInOneMachine.Play(3, BroadcastBoard.PlayMode.download, "time");
             //Monitor.allInOneMachine.Refresh();
-            Monitor.AddNotification("哈哈哈哈哈");
-            Monitor.AddNotification("啊啊啊啊啊");
+
+            //Monitor.AddNotification("test");
             Terminal.Terminal.Start();
             //系统初始化结束,进入状态5
             if (!initStatus) { return; }
@@ -134,21 +141,28 @@ namespace Monitor
             {
                 case 0:
                     Console.WriteLine("配置文件读写异常");
+                    Monitor.AddNotification("配置文件读写异常");
                     break;
                 case 1:
                     Console.WriteLine("PLC初始化异常");
+                    Monitor.AddNotification("PLC初始化异常");
                     break;
                 case 2:
                     Console.WriteLine("数据库初始化异常");
+                    Monitor.AddNotification("数据库初始化异常");
                     break;
                 case 3:
                     Console.WriteLine("webServer初始化异常");
+                    Monitor.AddNotification("webServer初始化异常");
                     break;
                 case 4:
                     Console.WriteLine("其他异常");
+                    Monitor.AddNotification("其他异常");
                     break;
                 case 5:
                     Console.WriteLine("初始化成功");
+                    Monitor.ClearNotification();
+                    Monitor.AddNotification("初始化成功");
                     break;
             }
         }

+ 234 - 162
PLCLinker/centralController/Terminal/Terminal.cs

@@ -71,14 +71,19 @@ namespace Terminal
                         province = reader.GetString("NumberPlateHeader");
                         //Console.WriteLine(province);
                     }
+                }
+                catch { }
+                try
+                {
                     //if (result!=null && result.Length > 0) { province = (string)result[0]; }
+                    if (reader != null)
+                    {
+                        reader.Close();
+                        reader.Dispose();
+                    }
                 }
                 catch { }
-                //if (reader != null)
-                //{
-                //    reader.Close();
-                //    reader.Dispose();
-                //}
+
             }
             return province + provinceIndex + identityA + identityB;
         }
@@ -102,23 +107,24 @@ namespace Terminal
                 MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(findParkingSpace);
                 if (reader != null)
                 {
-                    while (reader.Read())
+                    try
                     {
-                        if (reader.HasRows)
+                        while (reader.Read())
                         {
-                            recordsIDSet.Add(reader.GetInt32("parkingSpaceID"));
+                            if (reader.HasRows)
+                            {
+                                recordsIDSet.Add(reader.GetInt32("parkingSpaceID"));
+                            }
                         }
                     }
-                }
-                try
-                {
-                    if (reader != null)
+                    catch { }
+                    try
                     {
                         reader.Close();
                         reader.Dispose();
                     }
+                    catch { }
                 }
-                catch { }
             }
             List<string> updateSpaceList = new List<string>();
             List<string> insertSpaceList = new List<string>();
@@ -169,30 +175,32 @@ namespace Terminal
                 {
                     reader = Monitor.Monitor.remoteDBOper.Query(checkVehicleState);
                 }
-                if (reader != null && reader.Read() && reader.HasRows)
+                if (reader != null)
                 {
-                    try
+                    if (reader.Read() && reader.HasRows)
                     {
-                        reader.Close();
-                        reader.Dispose();
-                    }
-                    catch { }
-                    //更新车辆状态
-                    string updateVehicleState = "";
-                    string updateRemoteVehicleState = "";
-                    if (park)
-                    {
-                        if (parkingRecordsID > 0)
+                        //更新车辆状态
+                        string updateVehicleState = "";
+                        string updateRemoteVehicleState = "";
+                        if (park)
                         {
-                            if (parkingSpaceID == 0)
+                            if (parkingRecordsID > 0)
                             {
-                                updateVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + " where numberPlate = '" + lic + "';";
-                                updateRemoteVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",garageID = " + Monitor.Monitor.garageID + "where numberPlate = '" + lic + "';";
+                                if (parkingSpaceID == 0)
+                                {
+                                    updateVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + " where numberPlate = '" + lic + "';";
+                                    updateRemoteVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",garageID = " + Monitor.Monitor.garageID + " where numberPlate = '" + lic + "';";
+                                }
+                                else
+                                {
+                                    updateVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",parkingSpaceID = " + parkingSpaceID + " where numberPlate = '" + lic + "';";
+                                    updateRemoteVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",parkingSpaceID = " + parkingSpaceID + ",garageID = " + Monitor.Monitor.garageID + " where numberPlate = '" + lic + "';";
+                                }
                             }
                             else
                             {
-                                updateVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",parkingSpaceID = " + parkingSpaceID + " where numberPlate = '" + lic + "';";
-                                updateRemoteVehicleState = "update vehicle set vehiclepParkState = " + state + " ,parkingRecordsID = " + parkingRecordsID + ",parkingSpaceID = " + parkingSpaceID + ",garageID = " + Monitor.Monitor.garageID + "where numberPlate = '" + lic + "';";
+                                updateVehicleState = "update vehicle set vehiclepParkState = " + state + " where numberPlate = '" + lic + "';";
+                                updateRemoteVehicleState = updateVehicleState;
                             }
                         }
                         else
@@ -200,56 +208,62 @@ namespace Terminal
                             updateVehicleState = "update vehicle set vehiclepParkState = " + state + " where numberPlate = '" + lic + "';";
                             updateRemoteVehicleState = updateVehicleState;
                         }
-                    }
-                    else
-                    {
-                        updateVehicleState = "update vehicle set vehiclepParkState = " + state + " where numberPlate = '" + lic + "';";
-                        updateRemoteVehicleState = updateVehicleState;
-                    }
-                    List<string> list = new List<string>();
-                    list.Add(updateVehicleState);
-                    if (!remote)
-                    {
-                        Monitor.Monitor.localDBOper.UpdateTransaction(list);
-                    }
-                    else
-                    {
-                        Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
-                    }
-                    
-                }
-                else
-                {
-                    //插入车辆
-                    string insertVehicleWithState = "";
-                    if (park)
-                    {
-                        if (parkingRecordsID > 0)
-                            insertVehicleWithState = "insert into vehicle (numberPlate,vehicleTypeID,vehiclepParkState,parkingRecordsID) values " +
-                        "('" + lic + "',NULL,'" + state + "'," + parkingRecordsID + ");";
+                        List<string> list = new List<string>();
+                        if (!remote)
+                        {
+                            list.Add(updateVehicleState);
+                            Monitor.Monitor.localDBOper.UpdateTransaction(list);
+                        }
                         else
-                            insertVehicleWithState = "insert into vehicle (numberPlate,vehicleTypeID,vehiclepParkState) values " +
-                        "('" + lic + "',NULL,'" + state + "');";
+                        {
+                            list.Add(updateRemoteVehicleState);
+                            Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
+                        }
                     }
                     else
                     {
-                        Log.WriteLog(LogType.process, LogFile.ERROR, "取车无法获得车辆信息");
-                        Console.WriteLine("明显异常,取车发现无车辆");
-                        return;
-                    }
+                        //插入车辆
+                        string insertVehicleWithState = "";
+                        if (park)
+                        {
+                            if (parkingRecordsID > 0)
+                                insertVehicleWithState = "insert into vehicle (numberPlate,vehicleTypeID,vehiclepParkState,parkingRecordsID) values " +
+                            "('" + lic + "',NULL,'" + state + "'," + parkingRecordsID + ");";
+                            else
+                                insertVehicleWithState = "insert into vehicle (numberPlate,vehicleTypeID,vehiclepParkState) values " +
+                            "('" + lic + "',NULL,'" + state + "');";
+                        }
+                        else
+                        {
+                            Log.WriteLog(LogType.process, LogFile.ERROR, "取车无法获得车辆信息");
+                            Console.WriteLine("明显异常,取车发现无车辆");
+                            try
+                            {
+                                reader.Close();
+                                reader.Dispose();
+                            }
+                            catch { }
+                            return;
+                        }
 
-                    List<string> list = new List<string>();
-                    list.Add(insertVehicleWithState);
-                    if (!remote)
-                    {
-                        Monitor.Monitor.localDBOper.Insert(list);
+                        List<string> list = new List<string>();
+                        list.Add(insertVehicleWithState);
+                        if (!remote)
+                        {
+                            Monitor.Monitor.localDBOper.Insert(list);
+                        }
+                        else
+                        {
+                            Monitor.Monitor.remoteDBOper.Insert(list);
+                        }
                     }
-                    else
+                    try
                     {
-                        Monitor.Monitor.remoteDBOper.Insert(list);
+                        reader.Close();
+                        reader.Dispose();
                     }
+                    catch { }
                 }
-                
             }
         }
         /// <summary>
@@ -271,7 +285,99 @@ namespace Terminal
             Monitor.Monitor.PLC.WriteToPLC(tsFromCentral, PLCDataType.central);
             Monitor.Monitor.PLC.WriteToPLC(tsFromTerminal, PLCDataType.terminal);
         }
-
+        /// <summary>
+        /// 验证会员信息
+        /// </summary>
+        /// <param name="ts"></param>
+        /// <param name="userID"></param>
+        /// <param name="license"></param>
+        /// <param name="status"></param>
+        private static void ValidateUserInfo(TerminalStru ts, int userID, string license, out int status)
+        {
+            status = 0;
+            //与云端数据比对
+            string checkNetSql = "select * from user where userID = 1;";
+            MySqlDataReader readerTest = Monitor.Monitor.remoteDBOper.Query(checkNetSql);
+            if (readerTest != null)
+            {
+                if (readerTest.Read() && readerTest.HasRows)
+                {
+                    string userInfoCheckSql = "select * from usercarrelation where userID = '" + userID + "'and numberPlate = '" + license + "';";
+                    MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(userInfoCheckSql);
+                    if (reader != null && reader.Read() && reader.HasRows && userID != 0 && license != "")
+                    {
+                        ts.licVerification = 1;//验证成功
+                        Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
+                        status = 1;
+                        Log.WriteLog(LogType.process, LogFile.INFO, "号牌验证成功");
+                        Monitor.Monitor.AddNotification("注册用户,号牌验证成功");
+                    }
+                    else
+                    {
+                        ts.licVerification = 2;//验证失败
+                        Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
+                        status = 2;
+                        Log.WriteLog(LogType.process, LogFile.WARNING, "号牌验证失败");
+                        Monitor.Monitor.AddNotification("注册用户,号牌验证失败");
+                    }
+                    try
+                    {
+                        reader.Close();
+                        reader.Dispose();
+                    }
+                    catch { }
+                }
+                else
+                {
+                    ts.licVerification = 1;//网络异常,跳过验证
+                    Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
+                    status = 1;
+                    Log.WriteLog(LogType.process, LogFile.ERROR, "网络异常,无法验证号牌");
+                }
+                try
+                {
+                    readerTest.Close();
+                    readerTest.Dispose();
+                }
+                catch { }
+            }
+        }
+        /// <summary>
+        /// 查询停车记录id
+        /// </summary>
+        /// <param name="querySql"></param>
+        /// <param name="recordsID"></param>
+        /// <param name="remote"></param>
+        private static void QueryParkingRecordsID(string querySql, out int recordsID, bool remote)
+        {
+            recordsID = 0;
+            MySqlDataReader reader = null;
+            if (!remote)
+            {
+                reader = Monitor.Monitor.localDBOper.Query(querySql);
+            }
+            else
+            {
+                reader = Monitor.Monitor.remoteDBOper.Query(querySql);
+            }
+            if (reader != null)
+            {
+                try
+                {
+                    if (reader.Read())
+                    {
+                        recordsID = reader.GetInt32("parkingRecordsID");
+                    }
+                }
+                catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "查询停车记录id失败"); ; Console.WriteLine(e.Message); };
+                try
+                {
+                    reader.Close();
+                    reader.Dispose();
+                }
+                catch { }
+            }
+        }
         /// <summary>
         /// 停车流程,收到号牌机启动后操作过程
         /// </summary>
@@ -290,6 +396,7 @@ namespace Terminal
                         if (term.terminalStatus == (short)1)
                         {
                             string license = Monitor.Monitor.numMachineLinker.GetLicensePlate(numMachineLaunch);
+                            Monitor.Monitor.AddNotification("启动" + numMachineLaunch + "号号牌机,号牌:" + license);
                             //未获得号牌,告知PLC终止,告诉终端提示用户重新操作
                             if (license == "")
                             {
@@ -338,46 +445,7 @@ namespace Terminal
                                     int userID = term.licenseCodeA;
                                     string userLicense = GetLicenseFromTerm(term);
                                     //与云端数据比对
-                                    string checkNetSql = "select * from user where userID = 1;";
-                                    MySqlDataReader readerTest = Monitor.Monitor.remoteDBOper.Query(checkNetSql);
-                                    if ( readerTest!= null && readerTest.Read() && readerTest.HasRows)
-                                    {
-                                        try
-                                        {
-                                            readerTest.Close();
-                                            readerTest.Dispose();
-                                        }
-                                        catch { }
-                                        string userInfoCheckSql = "select * from usercarrelation where userID = '" + userID + "'and numberPlate = '" + userLicense + "';";
-                                        MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(userInfoCheckSql);
-                                        if (reader != null && reader.Read() && reader.HasRows && userID != 0 && userLicense != "")
-                                        {
-                                            ts.licVerification = 1;//验证成功
-                                            Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
-                                            numReceivedStatus = 1;
-                                            Log.WriteLog(LogType.process, LogFile.INFO, "号牌验证成功");
-                                        }
-                                        else
-                                        {
-                                            ts.licVerification = 2;//验证失败
-                                            Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
-                                            numReceivedStatus = 2;
-                                            Log.WriteLog(LogType.process, LogFile.WARNING, "号牌验证失败");
-                                        }
-                                        try
-                                        {
-                                            reader.Close();
-                                            reader.Dispose();
-                                        }
-                                        catch { }
-                                    }
-                                    else
-                                    {
-                                        ts.licVerification = 1;//网络异常,跳过验证
-                                        Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
-                                        numReceivedStatus = 1;
-                                        Log.WriteLog(LogType.process, LogFile.ERROR, "网络异常,无法验证号牌");
-                                    }
+                                    ValidateUserInfo(ts, userID, userLicense, out numReceivedStatus);
                                 }
                                 //非注册用户
                                 else if (term.btnStatus == (short)1)
@@ -385,6 +453,7 @@ namespace Terminal
                                     numReceivedStatus = 1;
                                     ts.licVerification = 1;
                                     Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
+
                                 }
                                 //无论是否注册,皆告知PLC,已获取号牌或比对异常、终止流程
                                 MainBlockStru mb = new MainBlockStru
@@ -393,6 +462,7 @@ namespace Terminal
                                 };
                                 Monitor.Monitor.PLC.WriteToPLC(mb, PLCDataType.central);
                                 //号牌获取结果被清零才跳出
+                                Monitor.Monitor.AddNotification("已写入号牌获取结果,等待号牌机启动指令清零");
                                 while (Monitor.Monitor.mainBlockInfo.numMachineLaunch != 0)
                                 {
                                     Thread.Sleep(2000);
@@ -434,8 +504,8 @@ namespace Terminal
                         }
                         //无车位信息则跳出当前循环
                         if (parkingSpaceID == 0) break;
-                        UpdateVehicle(license, 0, 0, true, false,0);
-                        UpdateVehicle(license, 0, 0, true, true,0);
+                        UpdateVehicle(license, 0, 0, true, false, 0);
+                        UpdateVehicle(license, 0, 0, true, true, 0);
                         //插入停车记录
                         string parkingRecordsSql = "";
                         if (term.licenseCodeA != 0)
@@ -452,7 +522,8 @@ namespace Terminal
                         list.Add(parkingRecordsSql);
                         Monitor.Monitor.localDBOper.Insert(list);
                         Monitor.Monitor.remoteDBOper.Insert(list);
-                        Log.WriteLog(LogType.process, LogFile.INFO, "停车记录已插入");
+                        Log.WriteLog(LogType.process, LogFile.INFO, "停车记录已插入," + license + "停在" + parkingSpaceID + ",凭证号:" + term.receiptNum);
+                        Monitor.Monitor.AddNotification("停车记录已插入");
                         ////注册用户记录插入云端
                         //if (term.btnStatus == 0)
                         //{
@@ -460,40 +531,10 @@ namespace Terminal
                         //}
                         //查询记录ID号
                         string findRecordSql = "select parkingRecordsID from parkingrecords where receiptNum = " + term.receiptNum + ";";
-                        MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(findRecordSql);
-                        MySqlDataReader remoteReader = Monitor.Monitor.remoteDBOper.Query(findRecordSql);
                         int parkingRecordsID = 0;
                         int remoteParkingRecordsID = 0;
-                        try
-                        {
-                            if (reader != null && reader.Read())
-                            {
-                                parkingRecordsID = reader.GetInt32("parkingRecordsID");
-                                try
-                                {
-                                    if (reader != null)
-                                    {
-                                        reader.Close();
-                                        reader.Dispose();
-                                    }
-                                }
-                                catch { }
-                            }
-                            if (remoteReader != null && remoteReader.Read())
-                            {
-                                remoteParkingRecordsID = remoteReader.GetInt32("parkingRecordsID");
-                                try
-                                {
-                                    if (remoteReader != null)
-                                    {
-                                        remoteReader.Close();
-                                        remoteReader.Dispose();
-                                    }
-                                }
-                                catch { }
-                            }
-                        }
-                        catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "查询停车记录id失败"); ; Console.WriteLine(e.Message); };
+                        QueryParkingRecordsID(findRecordSql, out parkingRecordsID, false);
+                        QueryParkingRecordsID(findRecordSql, out remoteParkingRecordsID, true);
                         //更新本地车辆表
                         if (parkingRecordsID != 0)
                         {
@@ -506,12 +547,14 @@ namespace Terminal
                         Log.WriteLog(LogType.process, LogFile.INFO, "停车记录表已更新");
                         //更新本地车位
                         UpdateAllParkingSpace();
+                        Monitor.Monitor.AddNotification("停车数据库已更新,等待流程结束状态清零。");
                         while (Monitor.Monitor.mainBlockInfo.processCompleted != 0)
                         {
                             Thread.Sleep(1000);
                         }
                         //中控清除车牌、凭证号、号牌验证等信息
                         ClearTerminal(term.terminalID);
+                        Monitor.Monitor.AddNotification(license + " 停车流程结束");
                     }
                 }
             }
@@ -561,9 +604,9 @@ namespace Terminal
             numberPlate = "";
             realParkTime = "";
             string parkRecordsSql = "select parkingRecordsID,userID,numberPlate,realParkTime from parkingrecords where receiptNum = " + receipt + ";";
+            MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(parkRecordsSql);
             try
             {
-                MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(parkRecordsSql);
                 if (reader != null && reader.Read())
                 {
                     object[] receiver = new object[4];
@@ -581,6 +624,15 @@ namespace Terminal
 
             }
             catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "根据凭证号查询停车记录失败"); Console.WriteLine(e.Message); return false; }
+            try
+            {
+                if (reader != null)
+                {
+                    reader.Close();
+                    reader.Dispose();
+                }
+            }
+            catch { }
             Log.WriteLog(LogType.process, LogFile.INFO, "根据凭证号查询停车记录成功");
             return true;
         }
@@ -658,6 +710,7 @@ namespace Terminal
             //取车状态、凭证号不为空,查询数据库计费
             if (termIndex != -1 && termUsedMap.Count >= termIndex && termUsedMap.TryGetValue(termIndex, out bool value) && !value && fetchState == 1 && receiptNum != 0)
             {
+                Monitor.Monitor.AddNotification("取车流程,准备计算费用");
                 termUsedMap[termIndex] = true;
                 Console.WriteLine("终端编号" + termIndex);
                 Task.Factory.StartNew(() =>
@@ -665,23 +718,27 @@ namespace Terminal
                     int parkingRecordsID = 0;
                     int remoteParkingRecordsID = 0;
                     int userID = 0;
-                    string numberPlate = "";
+                    string license = "";
                     string realParkTime = "";
                     //1.根据凭证号查询停车记录
-                    if (!FindLocalParkingRecord(receiptNum, out parkingRecordsID, out userID, out numberPlate, out realParkTime))
+                    if (!FindLocalParkingRecord(receiptNum, out parkingRecordsID, out userID, out license, out realParkTime))
                     {
                         return;
                     }
                     string remoteParkRecordsSql = "select parkingRecordsID from parkingrecords where receiptNum = " + receiptNum + ";";
+                    MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(remoteParkRecordsSql);
                     try
                     {
-                        MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(remoteParkRecordsSql);
                         if (reader != null && reader.Read())
                         {
                             object[] receiver = new object[1];
                             reader.GetValues(receiver);
                             remoteParkingRecordsID = (int)receiver[0];
                         }
+                    }
+                    catch (Exception e) { Console.WriteLine(e.Message); }
+                    try
+                    {
                         if (reader != null)
                         {
                             reader.Close();
@@ -690,7 +747,7 @@ namespace Terminal
                     }
                     catch (Exception e) { Console.WriteLine(e.Message); }
                     //本地存在号牌,后续操作
-                    if (numberPlate != "")
+                    if (license != "")
                     {
                         //2.根据号牌查询车辆月卡信息与预约记录
                         int orderRecordsID = 0;
@@ -699,10 +756,10 @@ namespace Terminal
                         TimeSpan monthCardTimeLength = new TimeSpan(0);
                         TimeSpan orderTimeLength = new TimeSpan(0);
                         //本地VIP信息
-                        string vipInfoSql = "select orderRecordsID,monthCardType,monthCardTime from vehicle where numberPlate = '" + numberPlate + "';";
+                        string vipInfoSql = "select orderRecordsID,monthCardType,monthCardTime from vehicle where numberPlate = '" + license + "';";
                         try
                         {
-                            MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(vipInfoSql);
+                            reader = Monitor.Monitor.localDBOper.Query(vipInfoSql);
                             if (reader != null && reader.Read())
                             {
                                 object[] receiver = new object[3];
@@ -730,6 +787,10 @@ namespace Terminal
                                 }
                                 Log.WriteLog(LogType.process, LogFile.INFO, "已获取本地预约与月卡信息");
                             }
+                        }
+                        catch (Exception e) { Console.WriteLine(e.Message); }
+                        try
+                        {
                             if (reader != null)
                             {
                                 reader.Close();
@@ -740,7 +801,7 @@ namespace Terminal
                         //云端VIP信息
                         try
                         {
-                            MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(vipInfoSql);
+                            reader = Monitor.Monitor.remoteDBOper.Query(vipInfoSql);
                             if (reader != null && reader.Read())
                             {
                                 object[] receiver = new object[3];
@@ -756,6 +817,10 @@ namespace Terminal
                                 }
                                 Log.WriteLog(LogType.process, LogFile.INFO, "已获取云端预约与月卡信息");
                             }
+                        }
+                        catch (Exception e) { Console.WriteLine(e.Message); }
+                        try
+                        {
                             if (reader != null)
                             {
                                 reader.Close();
@@ -801,23 +866,24 @@ namespace Terminal
                             }
                             catch { Console.WriteLine("error"); }
                         }
+                        Monitor.Monitor.AddNotification("用户类型:" + monthCardType + ",费用:" + fee + ",等待凭证号被清除后更新车辆状态");
                         //4.等待终端获得收费完成信号且将凭证号清除后,清除收费完成信号并将信息写入数据库
                         while (!isClosing && termIndex != -1)
                         {
-                            if (terminalInfo[termIndex - 1].receiptNum == 0)
+                            if (terminalInfo[termIndex - 1].receiptNum == 0 && Monitor.Monitor.mainBlockInfo.processCompleted == 1)
                             {
                                 Log.WriteLog(LogType.process, LogFile.INFO, "检测到凭证号已被清除");
                                 TerminalStru fetchReset = new TerminalStru
                                 {
                                     terminalID = (short)termIndex,
-                                    paymentStatus = (short)0,
+                                    paymentStatus = (short)-1,
                                     licVerification = (short)0,
                                     parkingFee = (short)32767,
                                     userType = (short)0
                                 };
                                 Monitor.Monitor.PLC.WriteToPLC(fetchReset, PLCDataType.central);
                                 //更新停车记录与车辆状态
-                                string updateParkingRecordsSql = "update parkingrecords set parkingRecordsState = 6,realGetTime = '" + currentTime.ToString("yyyy-MM-dd HH:mm:ss") + 
+                                string updateParkingRecordsSql = "update parkingrecords set parkingRecordsState = 6,realGetTime = '" + currentTime.ToString("yyyy-MM-dd HH:mm:ss") +
                                 "',parkingPrice = " + fee + " where receiptNum = '" + receiptNum + "';";
                                 List<string> list = new List<string>();
                                 list.Add(updateParkingRecordsSql);
@@ -825,12 +891,12 @@ namespace Terminal
                                 lock (Monitor.Monitor.localDBOper)
                                 {
                                     Monitor.Monitor.localDBOper.UpdateTransaction(list);
-                                    UpdateVehicle(numberPlate, 0, parkingRecordsID, false, false, 0);
+                                    UpdateVehicle(license, 0, parkingRecordsID, false, false, 0);
                                 }
                                 lock (Monitor.Monitor.remoteDBOper)
                                 {
                                     Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
-                                    UpdateVehicle(numberPlate, 0, remoteParkingRecordsID, false, true, 0);
+                                    UpdateVehicle(license, 0, remoteParkingRecordsID, false, true, 0);
                                 }
                                 break;
                             }
@@ -838,6 +904,7 @@ namespace Terminal
                         }
                     }
                     termUsedMap[termIndex] = false;
+                    Monitor.Monitor.AddNotification(license + " 取车流程结束");
                 });
             }
         }
@@ -996,9 +1063,10 @@ namespace Terminal
             string currentPaymentSchemeQuerySql = "select * from paymentScheme where paymentSchemeID = " + index + ";";
             object[] paramArray = null;
             PaymentScheme scheme = null;
+
+            MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(currentPaymentSchemeQuerySql);
             try
             {
-                MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(currentPaymentSchemeQuerySql);
                 if (reader != null && reader.Read())
                 {
                     scheme = new PaymentScheme();
@@ -1023,13 +1091,17 @@ namespace Terminal
                     scheme.yearCardCharge = (int)paramArray[16];
                     scheme.bookCharge = (int)paramArray[17];
                 }
+            }
+            catch (Exception e) { Console.WriteLine("读取本地计费策略," + e.Message); }
+            try
+            {
                 if (reader != null)
                 {
                     reader.Close();
                     reader.Dispose();
                 }
             }
-            catch (Exception e) { Console.WriteLine("读取本地计费策略," + e.Message); }
+            catch (Exception e) { Console.WriteLine(e.Message); }
             return scheme;
         }
     }

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


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


+ 17 - 1
PLCLinker/centralController/entity/AbstractMessage.cs

@@ -11,17 +11,33 @@ namespace parkMonitor.entity
     }
 
     /// <summary>
-    /// 用户指令类,s停,f取,p预约停
+    /// 用户指令类,p预约停,f预约取
     /// </summary>
     public class MessageUTF8 : AbstractMessage, ICloneable
     {
+        /// <summary>
+        /// 指令类型
+        /// </summary>
         public char cmd { set; get; }
+        /// <summary>
+        /// 号牌
+        /// </summary>
         public string context { set; get; }
+        /// <summary>
+        /// userID
+        /// </summary>
         public string sender { set; get; }
         public string receiver { set; get; }
         public int parkingRecordsID { set; get; }
         public int garageID { get; set; }
+        /// <summary>
+        /// 预约起始时间
+        /// </summary>
         public string bookTime { get; set; }
+        /// <summary>
+        /// 预约时长
+        /// </summary>
+        public int bookLength { get; set; }
 
         public MessageUTF8()
         {

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


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


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


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


+ 9 - 7
PLCLinker/socketTest/Form1.cs

@@ -46,17 +46,19 @@ namespace socketTest
 
         private void button2_Click(object sender, EventArgs e)
         {
-            IPEndPoint remoteIPE = new IPEndPoint(IPAddress.Parse("192.168.1.102"), 7);
+            IPEndPoint remoteIPE = new IPEndPoint(IPAddress.Parse("192.168.111.254"), 8888);
             SocketHandler sh = new SocketHandler(999, remoteIPE);
             sh.StartSend();
             string str = richTextBox1.Text;
-            char[] chars = str.ToCharArray();
-            byte[] bytes = new byte[chars.Length];
-            for(int i = 0; i < chars.Length; i++)
-            {
-                bytes[i] = Convert.ToByte(chars[i]);
+            //char[] chars = str.ToCharArray();
+            byte[] bytes = Encoding.ASCII.GetBytes(str);
+            //for(int i = 0; i < chars.Length; i++)
+            //{
+            //    bytes[i] = Convert.ToByte(chars[i]);
+            //}
+            while (!sh.writeAvailable) {
+                Console.WriteLine("waiting");
             }
-            while (!sh.writeAvailable) { }
             sh.Send(bytes);
             MessageBox.Show("已发送:"+Encoding.ASCII.GetString(bytes));
         }

+ 28 - 19
PLCLinker/socketTest/SocketLinker.cs

@@ -16,12 +16,16 @@ namespace SocketToolbox
         private Socket listener;
         private int listen_port = 9000;
 
+        public SocketLinker()
+        {
+            this.Start();
+        }
         public void Start()
         {
             // Create a TCP/IP socket.
             listener = new Socket(AddressFamily.InterNetwork,
                 SocketType.Stream, ProtocolType.Tcp);
-            IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("192.168.1.100"), listen_port);
+            IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("192.168.111.254"), listen_port);
 
             // Bind the socket to the local endpoint and listen for incoming connections.
             listener.Bind(localEndPoint);
@@ -163,29 +167,35 @@ namespace SocketToolbox
         private void Send()
         {
             receiveBuffer.CopyTo(sendBuffer, 0);
-            try
+            if (writeAvailable)
             {
-                remote.BeginSend(sendBuffer, 0, sendBuffer.Length, 0, new AsyncCallback(SendCallback), null);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine(e.ToString());
-                this.Close();
-                writeAvailable = false;
+                try
+                {
+                    remote.BeginSend(sendBuffer, 0, sendBuffer.Length, 0, new AsyncCallback(SendCallback), null);
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e.ToString());
+                    this.Close();
+                    writeAvailable = false;
+                }
             }
         }
         public void Send(byte[] bs)
         {
             bs.CopyTo(sendBuffer, 0);
-            try
-            {
-                remote.BeginSend(sendBuffer, 0, sendBuffer.Length, 0, new AsyncCallback(SendCallback), null);
-            }
-            catch (Exception e)
+            if (writeAvailable)
             {
-                Console.WriteLine(e.ToString());
-                this.Close();
-                writeAvailable = false;
+                try
+                {
+                    remote.BeginSend(sendBuffer, 0, sendBuffer.Length, 0, new AsyncCallback(SendCallback), null);
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e.ToString());
+                    this.Close();
+                    writeAvailable = false;
+                }
             }
         }
 
@@ -197,7 +207,6 @@ namespace SocketToolbox
                 //获得信息则再次监听
                 if (bytesRead > 0)
                 {
-
                     //Send();
                     connection.BeginReceive(receiveBuffer, 0, BufferSize, 0, new AsyncCallback(ReceiveCallback), null);
                 }
@@ -208,7 +217,7 @@ namespace SocketToolbox
             }
             catch (Exception e)
             {
-                Console.WriteLine("雷达" + id + "掉线\n" + e.ToString());
+                Console.WriteLine("掉线\n" + e.ToString());
                 this.Close();
                 linkAvailable = false;
             }

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


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


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


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


+ 55 - 0
resources/Printer.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.Threading;
+using terminal2.Code;
+
+namespace terminal2.Code
+{
+    public class Printer
+    {
+        private Image img;
+        private PrintDocument document;
+        public Printer(Image _img,PrintDocument _document)
+        {
+            img = _img;
+            document = _document;
+        }
+        public void Print()
+        {
+            float m_pageWidth = 80;//纸张宽度 mm单位
+            float m_pageHeight = 80;//纸张高度 mm单位
+            document.DefaultPageSettings.PaperSize = new PaperSize("newPage70X40", (int)(m_pageWidth / 25.4 * 100), (int)(m_pageHeight / 25.4 * 100));
+            //自定义图片内容整体上间距/左间距
+            document.OriginAtMargins = false;
+            document.DefaultPageSettings.Margins.Top = (int)(0.1 / 25.4 * 100);
+            document.DefaultPageSettings.Margins.Left = (int)(0.1 / 25.4 * 100);
+            document.PrintPage += new PrintPageEventHandler(this.printDocument1_PrintPage);
+            try
+            {
+                document.Print();
+                Thread.Sleep(1000);
+            }
+            catch (Exception)
+            {
+                document.PrintController.OnEndPrint(document, new PrintEventArgs());
+            }
+        }
+        /// <summary>
+        /// 打印事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+        {
+            e.Graphics.DrawImage(img, 46, -40);
+            e.Graphics.DrawString("请妥善保存取车码", new Font("宋体", 9), Brushes.Black, 95, 150);
+            e.Graphics.DrawString(".", new Font("宋体", 9), Brushes.Black, 0, 190);
+        }    
+    }
+
+}