Browse Source

车位状态显示调试完成,待持续测试

yct 6 years ago
parent
commit
12abd17454

+ 17 - 10
PLCLinker/App_gedian.txt

@@ -1,25 +1,30 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
-    </startup>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
+  </startup>
   <appSettings>
     <add key="retryCount" value="3"/>
     <add key="defaultLic" value="鄂ZZZZZZ"/>
+    <!--停车位显示相关配置-->
+    <add key="floors" value="13"/>
+    <add key="rows" value="2"/>
+    <add key="spacesInRow" value="8"/>
     <!--数据库信息-->
-    <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <!--<add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=3306;uid=root;pooling=true;max pool size=1024;pwd=;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
-    <!--<add key="remoteDBConnStr" value="Data Source=192.168.0.106;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
+    <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
+    <add key="remoteDBConnStr" value="Data Source=192.168.0.152;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <!--<add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
+    <!--<add key="remoteDBConnStr" value="Data Source=192.168.10.106;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
     <add key="localDBConnStr" value="Data Source=127.0.0.1;port=3306;uid=root;pooling=true;max pool size=1024;pwd=;database=zxpark_local;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="DBtimeout" value="3"/>
     <!--号牌机信息-->
     <add key="192.168.0.51" value="2"/>
     <add key="192.168.0.50" value="1"/>
-    <add key="filterRatio" value="0.7"/>
+    <add key="filterRatio" value="0.6"/>
     <!--PLC基本配置-->
     <!--<add key="PLC_ip_address" value="192.168.0.10" />-->
     <add key="plcIpAddress" value="192.168.0.1" />
+    <!--<add key="plcIpAddress" value="192.168.2.178" />-->
     <add key="plcRack" value="0" />
     <add key="plcSlot" value="1" />
     <!--PLCdb块,分别对应终端、中控、车位-->
@@ -28,12 +33,14 @@
     <add key="plcParkingSpaceCount" value="200" />
     <add key="plcRefreshInterval" value="200"/>
     <!--显示屏信息-->
+    <!--<add key="allInOneMachineIP" value="192.168.10.90"/>
+    <add key="allInOneMachinePort" value="8888"/>-->
     <add key="allInOneMachineIP" value="192.168.0.189"/>
     <add key="allInOneMachinePort" value="10001"/>
     <!--中控webServer端口,deprecated-->
     <add key="webPort" value="9000"/>
     <!--车库信息-->
-    <add key="garageID" value="6"/>
+    <add key="garageID" value="7"/>
     <!--日志写入地址配置文件-->
     <add key="LogAddress" value="c:\\c#workspace\\LogDemo\\LoggerTest" />
     <!--广告存放路径-->

+ 6 - 6
PLCLinker/centralController/App.config

@@ -7,15 +7,15 @@
     <add key="retryCount" value="3"/>
     <add key="defaultLic" value="鄂ZZZZZZ"/>
     <!--停车位显示相关配置-->
-    <add key="floors" value="12"/>
+    <add key="floors" value="13"/>
     <add key="rows" value="2"/>
     <add key="spacesInRow" value="8"/>
     <!--数据库信息-->
     <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <!--<add key="remoteDBConnStr" value="Data Source=192.168.0.152;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <add key="remoteDBConnStr" value="Data Source=192.168.0.152;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <!--<add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
     <!--<add key="remoteDBConnStr" value="Data Source=192.168.10.106;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="localDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_local;CharSet=utf8;Allow Zero Datetime=true;"/>
+    <add key="localDBConnStr" value="Data Source=127.0.0.1;port=3306;uid=root;pooling=true;max pool size=1024;pwd=;database=zxpark_local;CharSet=utf8;Allow Zero Datetime=true;"/>
     <add key="DBtimeout" value="3"/>
     <!--号牌机信息-->
     <add key="192.168.0.51" value="2"/>
@@ -23,8 +23,8 @@
     <add key="filterRatio" value="0.6"/>
     <!--PLC基本配置-->
     <!--<add key="PLC_ip_address" value="192.168.0.10" />-->
-    <!--<add key="plcIpAddress" value="192.168.0.1" />-->
-    <add key="plcIpAddress" value="192.168.2.178" />
+    <add key="plcIpAddress" value="192.168.0.1" />
+    <!--<add key="plcIpAddress" value="192.168.2.178" />-->
     <add key="plcRack" value="0" />
     <add key="plcSlot" value="1" />
     <!--PLCdb块,分别对应终端、中控、车位-->

+ 221 - 222
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -37,6 +37,7 @@
             this.dockSite_mainView = new DevComponents.DotNetBar.DockSite();
             this.bar_mainWin = new DevComponents.DotNetBar.Bar();
             this.testPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.button4 = new System.Windows.Forms.Button();
             this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
             this.label1 = new System.Windows.Forms.Label();
             this.button3 = new System.Windows.Forms.Button();
@@ -54,19 +55,17 @@
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
+            this.pdc_devStatus = new DevComponents.DotNetBar.PanelDockContainer();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+            this.lbx_webStatus = new DevComponents.DotNetBar.LabelX();
+            this.lbx_PLCStatus = new DevComponents.DotNetBar.LabelX();
+            this.lbx_PLC = new DevComponents.DotNetBar.LabelX();
+            this.lbx_web = new DevComponents.DotNetBar.LabelX();
             this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
             this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dgvx_payment = new DevComponents.DotNetBar.Controls.DataGridViewX();
-            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.tlp_paymentFilter = new System.Windows.Forms.TableLayoutPanel();
             this.dtp_paymentEndDate = new System.Windows.Forms.DateTimePicker();
             this.lbx_paymentStartDate = new DevComponents.DotNetBar.LabelX();
@@ -76,13 +75,6 @@
             this.tb_paymentLicense = new System.Windows.Forms.TextBox();
             this.dtp_paymentStartDate = new System.Windows.Forms.DateTimePicker();
             this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.pdc_devStatus = new DevComponents.DotNetBar.PanelDockContainer();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
-            this.lbx_webStatus = new DevComponents.DotNetBar.LabelX();
-            this.lbx_PLCStatus = new DevComponents.DotNetBar.LabelX();
-            this.lbx_PLC = new DevComponents.DotNetBar.LabelX();
-            this.lbx_web = new DevComponents.DotNetBar.LabelX();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
@@ -161,7 +153,15 @@
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
             this.controlContainerItem1 = new DevComponents.DotNetBar.ControlContainerItem();
-            this.button4 = new System.Windows.Forms.Button();
+            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dockSite_mainView.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
             this.bar_mainWin.SuspendLayout();
@@ -175,13 +175,13 @@
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
             this.tableLayoutPanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+            this.pdc_devStatus.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.tableLayoutPanel2.SuspendLayout();
             this.NumMachineMonitorPanel.SuspendLayout();
             this.paymentPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvx_payment)).BeginInit();
             this.tlp_paymentFilter.SuspendLayout();
-            this.pdc_devStatus.SuspendLayout();
-            this.panel1.SuspendLayout();
-            this.tableLayoutPanel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).BeginInit();
             this.bar_bottom.SuspendLayout();
             this.RecordsMonitorPanel.SuspendLayout();
@@ -267,11 +267,11 @@
             this.bar_mainWin.CanDockRight = false;
             this.bar_mainWin.CanDockTop = false;
             this.bar_mainWin.CanHide = true;
-            this.bar_mainWin.Controls.Add(this.testPanel);
-            this.bar_mainWin.Controls.Add(this.pdc_devStatus);
             this.bar_mainWin.Controls.Add(this.NumMachineMonitorPanel);
-            this.bar_mainWin.Controls.Add(this.paymentPanel);
+            this.bar_mainWin.Controls.Add(this.pdc_devStatus);
+            this.bar_mainWin.Controls.Add(this.testPanel);
             this.bar_mainWin.Controls.Add(this.ParkingSpaceMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.paymentPanel);
             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;
@@ -284,7 +284,7 @@
             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 = 3;
+            this.bar_mainWin.SelectedDockTab = 0;
             this.bar_mainWin.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
             this.bar_mainWin.Size = new System.Drawing.Size(730, 418);
             this.bar_mainWin.Stretch = true;
@@ -317,6 +317,16 @@
             this.testPanel.Style.GradientAngle = 90;
             this.testPanel.TabIndex = 38;
             // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(325, 85);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.TabIndex = 18;
+            this.button4.Text = "tlp测试";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
             // tableLayoutPanel3
             // 
             this.tableLayoutPanel3.ColumnCount = 2;
@@ -570,6 +580,110 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
+            // pdc_devStatus
+            // 
+            this.pdc_devStatus.CanvasColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            this.pdc_devStatus.Controls.Add(this.panel1);
+            this.pdc_devStatus.DisabledBackColor = System.Drawing.Color.Empty;
+            this.pdc_devStatus.Location = new System.Drawing.Point(3, 28);
+            this.pdc_devStatus.Name = "pdc_devStatus";
+            this.pdc_devStatus.Size = new System.Drawing.Size(724, 387);
+            this.pdc_devStatus.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.pdc_devStatus.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.pdc_devStatus.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.pdc_devStatus.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.pdc_devStatus.Style.GradientAngle = 90;
+            this.pdc_devStatus.TabIndex = 43;
+            // 
+            // panel1
+            // 
+            this.panel1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            this.panel1.Controls.Add(this.tableLayoutPanel2);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(724, 387);
+            this.panel1.TabIndex = 2;
+            // 
+            // tableLayoutPanel2
+            // 
+            this.tableLayoutPanel2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            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.Controls.Add(this.lbx_webStatus, 1, 1);
+            this.tableLayoutPanel2.Controls.Add(this.lbx_PLCStatus, 1, 0);
+            this.tableLayoutPanel2.Controls.Add(this.lbx_PLC, 0, 0);
+            this.tableLayoutPanel2.Controls.Add(this.lbx_web, 0, 1);
+            this.tableLayoutPanel2.Location = new System.Drawing.Point(12, 12);
+            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+            this.tableLayoutPanel2.RowCount = 3;
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
+            this.tableLayoutPanel2.Size = new System.Drawing.Size(179, 121);
+            this.tableLayoutPanel2.TabIndex = 1;
+            // 
+            // lbx_webStatus
+            // 
+            this.lbx_webStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
+            this.lbx_webStatus.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            // 
+            // 
+            // 
+            this.lbx_webStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_webStatus.Location = new System.Drawing.Point(112, 43);
+            this.lbx_webStatus.Name = "lbx_webStatus";
+            this.lbx_webStatus.Size = new System.Drawing.Size(43, 34);
+            this.lbx_webStatus.Symbol = "";
+            this.lbx_webStatus.SymbolColor = System.Drawing.Color.Crimson;
+            this.lbx_webStatus.SymbolSize = 25F;
+            this.lbx_webStatus.TabIndex = 3;
+            // 
+            // lbx_PLCStatus
+            // 
+            this.lbx_PLCStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
+            this.lbx_PLCStatus.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            // 
+            // 
+            // 
+            this.lbx_PLCStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_PLCStatus.Location = new System.Drawing.Point(112, 3);
+            this.lbx_PLCStatus.Name = "lbx_PLCStatus";
+            this.lbx_PLCStatus.Size = new System.Drawing.Size(44, 34);
+            this.lbx_PLCStatus.Symbol = "";
+            this.lbx_PLCStatus.SymbolColor = System.Drawing.Color.Crimson;
+            this.lbx_PLCStatus.SymbolSize = 25F;
+            this.lbx_PLCStatus.TabIndex = 2;
+            // 
+            // lbx_PLC
+            // 
+            // 
+            // 
+            // 
+            this.lbx_PLC.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_PLC.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lbx_PLC.Location = new System.Drawing.Point(3, 3);
+            this.lbx_PLC.Name = "lbx_PLC";
+            this.lbx_PLC.Size = new System.Drawing.Size(83, 34);
+            this.lbx_PLC.TabIndex = 0;
+            this.lbx_PLC.Text = "PLC";
+            this.lbx_PLC.TextAlignment = System.Drawing.StringAlignment.Center;
+            // 
+            // lbx_web
+            // 
+            // 
+            // 
+            // 
+            this.lbx_web.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_web.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lbx_web.Location = new System.Drawing.Point(3, 43);
+            this.lbx_web.Name = "lbx_web";
+            this.lbx_web.Size = new System.Drawing.Size(83, 34);
+            this.lbx_web.TabIndex = 1;
+            this.lbx_web.Text = "web服务器";
+            this.lbx_web.TextAlignment = System.Drawing.StringAlignment.Center;
+            // 
             // NumMachineMonitorPanel
             // 
             this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
@@ -642,83 +756,6 @@
             this.dgvx_payment.TabIndex = 4;
             this.dgvx_payment.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvx_payment_CellEndEdit);
             // 
-            // dataGridViewTextBoxColumn1
-            // 
-            this.dataGridViewTextBoxColumn1.HeaderText = "停车记录ID";
-            this.dataGridViewTextBoxColumn1.MaxInputLength = 11;
-            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
-            this.dataGridViewTextBoxColumn1.ReadOnly = true;
-            this.dataGridViewTextBoxColumn1.Visible = false;
-            this.dataGridViewTextBoxColumn1.Width = 90;
-            // 
-            // dataGridViewTextBoxColumn2
-            // 
-            this.dataGridViewTextBoxColumn2.HeaderText = "用户ID";
-            this.dataGridViewTextBoxColumn2.MaxInputLength = 8;
-            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
-            this.dataGridViewTextBoxColumn2.ReadOnly = true;
-            this.dataGridViewTextBoxColumn2.Width = 70;
-            // 
-            // dataGridViewTextBoxColumn3
-            // 
-            this.dataGridViewTextBoxColumn3.HeaderText = "号牌";
-            this.dataGridViewTextBoxColumn3.MaxInputLength = 9;
-            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
-            this.dataGridViewTextBoxColumn3.ReadOnly = true;
-            this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn3.Width = 80;
-            // 
-            // dataGridViewTextBoxColumn4
-            // 
-            this.dataGridViewTextBoxColumn4.HeaderText = "车位编号";
-            this.dataGridViewTextBoxColumn4.MaxInputLength = 4;
-            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
-            this.dataGridViewTextBoxColumn4.ReadOnly = true;
-            this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn4.Visible = false;
-            this.dataGridViewTextBoxColumn4.Width = 80;
-            // 
-            // dataGridViewTextBoxColumn5
-            // 
-            this.dataGridViewTextBoxColumn5.HeaderText = "实际停入时间";
-            this.dataGridViewTextBoxColumn5.MaxInputLength = 50;
-            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
-            this.dataGridViewTextBoxColumn5.ReadOnly = true;
-            this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn5.Width = 140;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.HeaderText = "实际取出时间";
-            this.dataGridViewTextBoxColumn6.MaxInputLength = 50;
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.ReadOnly = true;
-            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn6.Width = 140;
-            // 
-            // dataGridViewTextBoxColumn7
-            // 
-            this.dataGridViewTextBoxColumn7.HeaderText = "凭证号";
-            this.dataGridViewTextBoxColumn7.MaxInputLength = 8;
-            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
-            this.dataGridViewTextBoxColumn7.ReadOnly = true;
-            this.dataGridViewTextBoxColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn7.Width = 90;
-            // 
-            // dataGridViewTextBoxColumn8
-            // 
-            this.dataGridViewTextBoxColumn8.HeaderText = "停车费用";
-            this.dataGridViewTextBoxColumn8.MaxInputLength = 11;
-            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
-            this.dataGridViewTextBoxColumn8.Width = 80;
-            // 
-            // dataGridViewTextBoxColumn9
-            // 
-            this.dataGridViewTextBoxColumn9.HeaderText = "收费状态";
-            this.dataGridViewTextBoxColumn9.MaxInputLength = 11;
-            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
-            this.dataGridViewTextBoxColumn9.Width = 80;
-            // 
             // tlp_paymentFilter
             // 
             this.tlp_paymentFilter.ColumnCount = 7;
@@ -728,7 +765,7 @@
             this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
             this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
             this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33332F));
-            this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 89F));
+            this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 91F));
             this.tlp_paymentFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
             this.tlp_paymentFilter.Controls.Add(this.dtp_paymentEndDate, 3, 0);
             this.tlp_paymentFilter.Controls.Add(this.lbx_paymentStartDate, 0, 0);
@@ -790,7 +827,7 @@
             this.btnx_paymentSearch.Anchor = System.Windows.Forms.AnchorStyles.Left;
             this.btnx_paymentSearch.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
             this.btnx_paymentSearch.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnx_paymentSearch.Location = new System.Drawing.Point(636, 15);
+            this.btnx_paymentSearch.Location = new System.Drawing.Point(635, 15);
             this.btnx_paymentSearch.Name = "btnx_paymentSearch";
             this.btnx_paymentSearch.Size = new System.Drawing.Size(74, 35);
             this.btnx_paymentSearch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -817,7 +854,7 @@
             this.tb_paymentLicense.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.tb_paymentLicense.Location = new System.Drawing.Point(510, 20);
             this.tb_paymentLicense.Name = "tb_paymentLicense";
-            this.tb_paymentLicense.Size = new System.Drawing.Size(120, 26);
+            this.tb_paymentLicense.Size = new System.Drawing.Size(119, 26);
             this.tb_paymentLicense.TabIndex = 10;
             // 
             // dtp_paymentStartDate
@@ -843,110 +880,6 @@
             this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
             this.ParkingSpaceMonitorPanel.TabIndex = 9;
             // 
-            // pdc_devStatus
-            // 
-            this.pdc_devStatus.CanvasColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            this.pdc_devStatus.Controls.Add(this.panel1);
-            this.pdc_devStatus.DisabledBackColor = System.Drawing.Color.Empty;
-            this.pdc_devStatus.Location = new System.Drawing.Point(3, 28);
-            this.pdc_devStatus.Name = "pdc_devStatus";
-            this.pdc_devStatus.Size = new System.Drawing.Size(724, 387);
-            this.pdc_devStatus.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.pdc_devStatus.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.pdc_devStatus.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.pdc_devStatus.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.pdc_devStatus.Style.GradientAngle = 90;
-            this.pdc_devStatus.TabIndex = 43;
-            // 
-            // panel1
-            // 
-            this.panel1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            this.panel1.Controls.Add(this.tableLayoutPanel2);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(724, 387);
-            this.panel1.TabIndex = 2;
-            // 
-            // tableLayoutPanel2
-            // 
-            this.tableLayoutPanel2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            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.Controls.Add(this.lbx_webStatus, 1, 1);
-            this.tableLayoutPanel2.Controls.Add(this.lbx_PLCStatus, 1, 0);
-            this.tableLayoutPanel2.Controls.Add(this.lbx_PLC, 0, 0);
-            this.tableLayoutPanel2.Controls.Add(this.lbx_web, 0, 1);
-            this.tableLayoutPanel2.Location = new System.Drawing.Point(12, 12);
-            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
-            this.tableLayoutPanel2.RowCount = 3;
-            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
-            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
-            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
-            this.tableLayoutPanel2.Size = new System.Drawing.Size(179, 121);
-            this.tableLayoutPanel2.TabIndex = 1;
-            // 
-            // lbx_webStatus
-            // 
-            this.lbx_webStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
-            this.lbx_webStatus.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            // 
-            // 
-            // 
-            this.lbx_webStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.lbx_webStatus.Location = new System.Drawing.Point(112, 43);
-            this.lbx_webStatus.Name = "lbx_webStatus";
-            this.lbx_webStatus.Size = new System.Drawing.Size(43, 34);
-            this.lbx_webStatus.Symbol = "";
-            this.lbx_webStatus.SymbolColor = System.Drawing.Color.Crimson;
-            this.lbx_webStatus.SymbolSize = 25F;
-            this.lbx_webStatus.TabIndex = 3;
-            // 
-            // lbx_PLCStatus
-            // 
-            this.lbx_PLCStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
-            this.lbx_PLCStatus.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            // 
-            // 
-            // 
-            this.lbx_PLCStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.lbx_PLCStatus.Location = new System.Drawing.Point(112, 3);
-            this.lbx_PLCStatus.Name = "lbx_PLCStatus";
-            this.lbx_PLCStatus.Size = new System.Drawing.Size(44, 34);
-            this.lbx_PLCStatus.Symbol = "";
-            this.lbx_PLCStatus.SymbolColor = System.Drawing.Color.Crimson;
-            this.lbx_PLCStatus.SymbolSize = 25F;
-            this.lbx_PLCStatus.TabIndex = 2;
-            // 
-            // lbx_PLC
-            // 
-            // 
-            // 
-            // 
-            this.lbx_PLC.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.lbx_PLC.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.lbx_PLC.Location = new System.Drawing.Point(3, 3);
-            this.lbx_PLC.Name = "lbx_PLC";
-            this.lbx_PLC.Size = new System.Drawing.Size(83, 34);
-            this.lbx_PLC.TabIndex = 0;
-            this.lbx_PLC.Text = "PLC";
-            this.lbx_PLC.TextAlignment = System.Drawing.StringAlignment.Center;
-            // 
-            // lbx_web
-            // 
-            // 
-            // 
-            // 
-            this.lbx_web.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
-            this.lbx_web.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.lbx_web.Location = new System.Drawing.Point(3, 43);
-            this.lbx_web.Name = "lbx_web";
-            this.lbx_web.Size = new System.Drawing.Size(83, 34);
-            this.lbx_web.TabIndex = 1;
-            this.lbx_web.Text = "web服务器";
-            this.lbx_web.TextAlignment = System.Drawing.StringAlignment.Center;
-            // 
             // dci_NumMachine
             // 
             this.dci_NumMachine.Control = this.NumMachineMonitorPanel;
@@ -1767,15 +1700,81 @@
             this.controlContainerItem1.MenuVisibility = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
             this.controlContainerItem1.Name = "controlContainerItem1";
             // 
-            // button4
+            // dataGridViewTextBoxColumn1
             // 
-            this.button4.Location = new System.Drawing.Point(325, 85);
-            this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(75, 23);
-            this.button4.TabIndex = 18;
-            this.button4.Text = "tlp测试";
-            this.button4.UseVisualStyleBackColor = true;
-            this.button4.Click += new System.EventHandler(this.button4_Click);
+            this.dataGridViewTextBoxColumn1.HeaderText = "停车记录ID";
+            this.dataGridViewTextBoxColumn1.MaxInputLength = 11;
+            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.ReadOnly = true;
+            this.dataGridViewTextBoxColumn1.Visible = false;
+            this.dataGridViewTextBoxColumn1.Width = 90;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.HeaderText = "用户ID";
+            this.dataGridViewTextBoxColumn2.MaxInputLength = 8;
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.ReadOnly = true;
+            this.dataGridViewTextBoxColumn2.Width = 70;
+            // 
+            // dataGridViewTextBoxColumn3
+            // 
+            this.dataGridViewTextBoxColumn3.HeaderText = "号牌";
+            this.dataGridViewTextBoxColumn3.MaxInputLength = 9;
+            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.ReadOnly = true;
+            this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn3.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn4
+            // 
+            this.dataGridViewTextBoxColumn4.HeaderText = "车位编号";
+            this.dataGridViewTextBoxColumn4.MaxInputLength = 4;
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.ReadOnly = true;
+            this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn4.Visible = false;
+            this.dataGridViewTextBoxColumn4.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn5
+            // 
+            this.dataGridViewTextBoxColumn5.HeaderText = "实际停入时间";
+            this.dataGridViewTextBoxColumn5.MaxInputLength = 50;
+            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
+            this.dataGridViewTextBoxColumn5.ReadOnly = true;
+            this.dataGridViewTextBoxColumn5.Width = 140;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.HeaderText = "实际取出时间";
+            this.dataGridViewTextBoxColumn6.MaxInputLength = 50;
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn6.Width = 140;
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.HeaderText = "凭证号";
+            this.dataGridViewTextBoxColumn7.MaxInputLength = 8;
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.ReadOnly = true;
+            this.dataGridViewTextBoxColumn7.Width = 90;
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.HeaderText = "停车费用";
+            this.dataGridViewTextBoxColumn8.MaxInputLength = 11;
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.dataGridViewTextBoxColumn8.Width = 80;
+            // 
+            // dataGridViewTextBoxColumn9
+            // 
+            this.dataGridViewTextBoxColumn9.HeaderText = "收费状态";
+            this.dataGridViewTextBoxColumn9.MaxInputLength = 11;
+            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
+            this.dataGridViewTextBoxColumn9.Width = 80;
             // 
             // centralController
             // 
@@ -1814,14 +1813,14 @@
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
             this.tableLayoutPanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+            this.pdc_devStatus.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            this.tableLayoutPanel2.ResumeLayout(false);
             this.NumMachineMonitorPanel.ResumeLayout(false);
             this.paymentPanel.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.dgvx_payment)).EndInit();
             this.tlp_paymentFilter.ResumeLayout(false);
             this.tlp_paymentFilter.PerformLayout();
-            this.pdc_devStatus.ResumeLayout(false);
-            this.panel1.ResumeLayout(false);
-            this.tableLayoutPanel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).EndInit();
             this.bar_bottom.ResumeLayout(false);
             this.RecordsMonitorPanel.ResumeLayout(false);
@@ -1962,6 +1961,9 @@
         private System.Windows.Forms.TextBox tb_paymentLicense;
         private System.Windows.Forms.DateTimePicker dtp_paymentStartDate;
         private DevComponents.DotNetBar.Controls.DataGridViewX dgvx_payment;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button button4;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
@@ -1971,9 +1973,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Button button4;
     }
 }
 

+ 97 - 38
PLCLinker/centralController/FormCentralController.cs

@@ -24,6 +24,7 @@ namespace centralController
     public partial class centralController : Form
     {
         private List<TermModel> TermDispList;
+        private Dictionary<int, ParkingSpaceStru> idPssMap;
         private bool closing = false;
         /// <summary>
         /// 窗体初始化
@@ -33,6 +34,7 @@ namespace centralController
             InitializeComponent();
 
             TermDispList = new List<TermModel>();
+            idPssMap = new Dictionary<int, ParkingSpaceStru>();
 
             if (Monitor.Monitor.ins == null)
             {
@@ -275,59 +277,116 @@ namespace centralController
         /// </summary>
         private void UpdateParkingSpaceView()
         {
+            bool needUpdate = false;
             while (!closing)
             {
                 List<ParkingSpaceStru> psList = Monitor.Monitor.parkingSpaceInfo;
+                if (psList.Count <= 0)
+                {
+                    Thread.Sleep(10000);
+                    continue;
+                }
+                //更新映射表
+                if (idPssMap.Count != psList.Count)
+                {
+                    idPssMap.Clear();
+                    for (int i = 0; i < psList.Count; i++)
+                    {
+                        idPssMap.Add(psList[i].parkingSpace, psList[i]);
+                    }
+                }
+
                 TableLayoutPanel tlp = new TableLayoutPanel();
                 tlp.Name = "tlp_ParkingSpace";
                 tlp.ColumnCount = Monitor.Monitor.rows;
+                tlp.RowCount = 1;
+                tlp.Dock = DockStyle.Fill;
+                tlp.AutoScroll = true;
+                tlp.BackColor = SystemColors.GradientActiveCaption;
                 this.Invoke(new Action(() =>
                 {
                     //List<TableLayoutPanel> tlpList = new List<TableLayoutPanel>();
                     int blockSize = Monitor.Monitor.spacesInRow * Monitor.Monitor.floors * Monitor.Monitor.rows;
-                    for (int i = 0; i < Monitor.Monitor.rows; i++)
+                    int offset = (Monitor.Monitor.rows + 1 - ((blockSize / Monitor.Monitor.spacesInRow) % Monitor.Monitor.rows)) * Monitor.Monitor.spacesInRow;
+                    //创建控件
+                    if (ParkingSpaceMonitorPanel.Controls.Count == 0 || needUpdate)
                     {
-                        TableLayoutPanel temp = new TableLayoutPanel();
-                        temp.Name = "tlp_ParkingSpaceSection" + (i + 1).ToString();
-                        temp.RowCount = Monitor.Monitor.spacesInRow;
-                        temp.ColumnCount = Monitor.Monitor.floors;
-                            
-                        for (int j = Math.Max(psList.Count, blockSize) - 1; j >= 0; j--)
+                        for (int i = 0; i < Monitor.Monitor.rows; i++)
                         {
-                            Label lb = new Label();
-                            lb.Anchor = (((((AnchorStyles.Top | AnchorStyles.Bottom)| AnchorStyles.Left)| AnchorStyles.Right)));
-                            lb.AutoSize = true;
-                            lb.Location = new Point(10, 10);
-                            lb.Margin = new Padding(10);
-                            lb.Name = "lb_parkingSpace"+j;
-                            lb.TextAlign = ContentAlignment.MiddleCenter;
-                            if (j > psList.Count - 1)
+                            TableLayoutPanel temp = new TableLayoutPanel();
+                            temp.Name = "tlp_ParkingSpaceSection" + (i + 1).ToString();
+                            temp.RowCount = Monitor.Monitor.floors;
+                            temp.ColumnCount = Monitor.Monitor.spacesInRow;
+                            temp.Dock = DockStyle.Fill;
+                            temp.AutoSize = true;
+                            temp.BackColor = SystemColors.GradientActiveCaption;
+                            temp.Margin = new Padding(5, 2, 5, 2);
+                            for (int j = Math.Max(psList.Count, blockSize) - 1; j >= 0; j--)
                             {
-                                lb.Text = "";
-                                temp.Controls.Add(lb);
+                                Label lb = new Label();
+                                lb.Anchor = (AnchorStyles.Top | AnchorStyles.Left);
+                                lb.AutoSize = true;
+                                lb.Location = new Point(10, 10);
+                                lb.Margin = new Padding(3,10,3,10);
+                                lb.Padding = new Padding(5);
+                                lb.Name = "lb_parkingSpace" + j;
+                                lb.TextAlign = ContentAlignment.MiddleCenter;
+                                if (((j + offset) / Monitor.Monitor.spacesInRow) % Monitor.Monitor.rows == i)
+                                {
+                                    if (j > psList.Count - 1)
+                                    {
+                                        lb.Text = "#####";
+                                        temp.Controls.Add(lb);
+                                        lb.BackColor = GetPSColor(-1);
+                                    }
+                                    else
+                                    {
+                                        lb.Text = "车位" + psList[j].parkingSpace;
+                                        lb.BackColor = GetPSColor(psList[j].spaceStatus);
+                                        temp.Controls.Add(lb);
+                                    }
+                                }
                             }
-                            else
+                            tlp.Controls.Add(temp);
+                            //tlpList.Add(temp);
+                        }
+                        ParkingSpaceMonitorPanel.Controls.Clear();
+                        ParkingSpaceMonitorPanel.Controls.Add(tlp);
+                        needUpdate = false;
+                    }
+                    //更新控件
+                    else
+                    {
+                        Control.ControlCollection psCC = ParkingSpaceMonitorPanel.Controls;
+                        foreach (Control segment in psCC)
+                        {
+                            Control.ControlCollection segmentCC = segment.Controls;
+                            foreach (Control space in segmentCC)
                             {
-                                if ((j / Monitor.Monitor.spacesInRow) % Monitor.Monitor.rows == i)
+                                if (space.GetType() == typeof(Label))
                                 {
-                                    lb.Text = "车位" + psList[j].parkingSpace;
-                                    lb.BackColor = GetPSColor(psList[j].spaceStatus);
-                                    temp.Controls.Add(lb);
-                                    //int row = Monitor.Monitor.floors - 1 - j / (Monitor.Monitor.spacesInRow * Monitor.Monitor.rows);
-                                    //int column = (j % (Monitor.Monitor.spacesInRow * Monitor.Monitor.rows)) % Monitor.Monitor.spacesInRow;
-                                    //Control ctl = temp.GetControlFromPosition(column, row);
-
-                                    //ctl.Controls.Add();
+                                    int index = -1;
+                                    int.TryParse(space.Text.Substring(2), out index);
+                                    if (idPssMap.ContainsKey(index))
+                                    {
+                                        space.BackColor = GetPSColor(idPssMap[index].spaceStatus);
+                                    }
+                                    else
+                                    {
+                                        needUpdate = true;
+                                        break;
+                                    }
                                 }
                             }
+                            if (needUpdate)
+                            {
+                                break;
+                            }
                         }
-                        tlp.Controls.Add(temp);
-                        //tlpList.Add(temp);
                     }
-                    ParkingSpaceMonitorPanel.Controls.Clear();
-                    ParkingSpaceMonitorPanel.Controls.Add(tlp);
                 }));
                 Thread.Sleep(5000);
+
             }
         }
 
@@ -335,12 +394,12 @@ namespace centralController
         {
             switch (status)
             {
-                case 0:return Color.White;
-                case 1:return Color.Yellow;
-                case 2:return Color.SkyBlue;
-                case 3:return Color.Blue;
-                case 4:return Color.Red;
-                default:return Color.Violet;
+                case 0: return Color.White;
+                case 1: return Color.Yellow;
+                case 2: return Color.SkyBlue;
+                case 3: return Color.Blue;
+                case 4: return Color.Red;
+                default: return Color.Violet;
             }
         }
 
@@ -397,7 +456,7 @@ namespace centralController
             int id = Monitor.Monitor.numMachineLinker.GetLicenseID(license);
             textBox2.Text = "终端" + id.ToString();
         }
-        
+
         /// <summary>
         /// tableLayoutPanel测试
         /// </summary>

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


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

@@ -1 +1 @@
-e54dca5ae57e19841adc9305edf5acb99320d11d
+1894c814d0c0ce0d40c4a43d30ae54298a837fad

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