浏览代码

终端块稳定性微调,提示微调,增加系统配置功能

yc_t 6 年之前
父节点
当前提交
4c72ffa52c

+ 13 - 0
PLCLinker/PLCConnector/Form1.Designer.cs

@@ -59,6 +59,7 @@
             this.button9 = new System.Windows.Forms.Button();
             this.button10 = new System.Windows.Forms.Button();
             this.button11 = new System.Windows.Forms.Button();
+            this.btn_input = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -369,11 +370,22 @@
             this.button11.UseVisualStyleBackColor = true;
             this.button11.Click += new System.EventHandler(this.button11_Click);
             // 
+            // btn_input
+            // 
+            this.btn_input.Location = new System.Drawing.Point(35, 372);
+            this.btn_input.Name = "btn_input";
+            this.btn_input.Size = new System.Drawing.Size(75, 23);
+            this.btn_input.TabIndex = 18;
+            this.btn_input.Text = "自动写入";
+            this.btn_input.UseVisualStyleBackColor = true;
+            this.btn_input.Click += new System.EventHandler(this.btn_input_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(803, 527);
+            this.Controls.Add(this.btn_input);
             this.Controls.Add(this.button11);
             this.Controls.Add(this.button10);
             this.Controls.Add(this.button9);
@@ -433,6 +445,7 @@
         private System.Windows.Forms.Button button9;
         private System.Windows.Forms.Button button10;
         private System.Windows.Forms.Button button11;
+        private System.Windows.Forms.Button btn_input;
     }
 }
 

+ 54 - 6
PLCLinker/PLCConnector/Form1.cs

@@ -8,6 +8,7 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -286,16 +287,16 @@ namespace PLCConnector
 
         private void btn_refresh_Click(object sender, EventArgs e)
         {
-            Timer timer1 = new Timer();
-            timer1.Interval = 1000;
+            System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer();
+            timer1.Interval = 400;
             timer1.Tick += new EventHandler(button2_Click);
             timer1.Start();
-            Timer timer2 = new Timer();
-            timer2.Interval = 1000;
+            System.Windows.Forms.Timer timer2 = new System.Windows.Forms.Timer();
+            timer2.Interval = 400;
             timer2.Tick += new EventHandler(button3_Click);
             timer2.Start();
-            Timer timer3 = new Timer();
-            timer3.Interval = 1000;
+            System.Windows.Forms.Timer timer3 = new System.Windows.Forms.Timer();
+            timer3.Interval = 400;
             timer3.Tick += new EventHandler(button4_Click);
             timer3.Start();
         }
@@ -420,5 +421,52 @@ namespace PLCConnector
                 pl.WriteAccordingToOffset(PLCDataType.terminal, 2, (short)1);
             }
         }
+
+        private void btn_input_Click(object sender, EventArgs e)
+        {
+            Random rnd = new Random();
+            //启动心跳进程
+            Task.Factory.StartNew(() =>
+            {
+                TerminalStru ts = new TerminalStru
+                {
+                    terminalID = (short)1,
+                    paymentStatus = 1,
+                    parkingFee = 2,
+                    userType = 3,
+                    licVerification = (short)4
+                };
+                TerminalStru ts2 = new TerminalStru
+                {
+                    terminalID = (short)1,
+                };
+                bool flip = false;
+                while (true)
+                {
+                    if (pl.isConnected)
+                    {
+                        flip = !flip;
+                        MainBlockStru mbs = new MainBlockStru();
+                        List<object> list = pl.ReadFromPLC(PLCDataType.central, 0);
+                        if (list.Count != 0)
+                        {
+                            mbs = (MainBlockStru)list[0];
+                            mbs.centralHearbeat = (short)rnd.Next(100, 999);
+                            mbs.licenseReceived = (short)-1;
+                            mbs.bookParkCmd = (short)-1;
+                            mbs.bookFetchCmd = (short)-1;
+                            pl.WriteToPLC(mbs, PLCDataType.central);
+                        }
+                        if (flip)
+                            pl.WriteToPLC(ts, PLCDataType.central);
+                        else
+                            pl.WriteToPLC(ts2, PLCDataType.central);
+
+
+                    }
+                    Thread.Sleep(350);
+                }
+            });
+        }
     }
 }

二进制
PLCLinker/PLCConnector/PLC/PLCS7.dll


+ 4 - 3
PLCLinker/centralController/App.config

@@ -5,11 +5,12 @@
     </startup>
   <appSettings>
     <add key="retryCount" value="3"/>
+    <add key="defaultLic" value="鄂ZZZZZZ"/>
     <!--数据库信息-->
     <!--<add key="remoteDBConnStr" value="Data Source=59.175.148.85;port=3306;uid=root;pooling=true;max pool size=1024;pwd=x5;database=zxpark;CharSet=utf8;Allow Zero Datetime=true;"/>-->
     <!--<add key="remoteDBConnStr" value="Data Source=192.168.111.61;port=3306;uid=remote;pooling=true;max pool size=1024;pwd=x5;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <!--<add key="remoteDBConnStr" value="Data Source=127.0.0.1;port=20000;uid=root;pooling=true;max pool size=1024;pwd=yct;database=zxpark_cloud_2;CharSet=utf8;Allow Zero Datetime=true;"/>-->
-    <add key="remoteDBConnStr" value="Data Source=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=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.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="DBtimeout" value="3"/>
     <!--号牌机信息-->
@@ -29,7 +30,7 @@
     <!--显示屏信息-->
     <add key="allInOneMachineIP" value="192.168.10.90"/>
     <add key="allInOneMachinePort" value="8888"/>
-    <!--中控webServer端口-->
+    <!--中控webServer端口,deprecated-->
     <add key="webPort" value="9000"/>
     <!--车库信息-->
     <add key="garageID" value="2"/>

+ 138 - 129
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -35,6 +35,13 @@
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
             this.dockSite_mainView = new DevComponents.DotNetBar.DockSite();
             this.bar_mainWin = new DevComponents.DotNetBar.Bar();
+            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();
@@ -58,6 +65,7 @@
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_Test = new DevComponents.DotNetBar.DockContainerItem();
+            this.dci_devStatus = new DevComponents.DotNetBar.DockContainerItem();
             this.bar_bottom = new DevComponents.DotNetBar.Bar();
             this.RecordsMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dgvx_parkingRecords = new DevComponents.DotNetBar.Controls.DataGridViewX();
@@ -97,6 +105,7 @@
             this.btn_recordManagement = new DevComponents.DotNetBar.ButtonItem();
             this.btn_exportRecords = new DevComponents.DotNetBar.ButtonItem();
             this.btn_setScheme = new DevComponents.DotNetBar.ButtonItem();
+            this.btn_config = 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();
@@ -129,17 +138,12 @@
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
             this.controlContainerItem1 = new DevComponents.DotNetBar.ControlContainerItem();
-            this.dci_devStatus = new DevComponents.DotNetBar.DockContainerItem();
-            this.pdc_devStatus = new DevComponents.DotNetBar.PanelDockContainer();
-            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
-            this.lbx_PLC = new DevComponents.DotNetBar.LabelX();
-            this.lbx_web = new DevComponents.DotNetBar.LabelX();
-            this.lbx_PLCStatus = new DevComponents.DotNetBar.LabelX();
-            this.lbx_webStatus = new DevComponents.DotNetBar.LabelX();
-            this.panel1 = new System.Windows.Forms.Panel();
             this.dockSite_mainView.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
             this.bar_mainWin.SuspendLayout();
+            this.pdc_devStatus.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.tableLayoutPanel2.SuspendLayout();
             this.NumMachineMonitorPanel.SuspendLayout();
             this.testPanel.SuspendLayout();
             this.groupPanel2.SuspendLayout();
@@ -166,9 +170,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.bar_shortcut)).BeginInit();
             this.bar_shortcut.SuspendLayout();
             this.panel_freeSpace.SuspendLayout();
-            this.pdc_devStatus.SuspendLayout();
-            this.tableLayoutPanel2.SuspendLayout();
-            this.panel1.SuspendLayout();
             this.SuspendLayout();
             // 
             // dotNetBarManager1
@@ -237,11 +238,11 @@
             this.bar_mainWin.CanDockRight = false;
             this.bar_mainWin.CanDockTop = false;
             this.bar_mainWin.CanHide = true;
-            this.bar_mainWin.Controls.Add(this.pdc_devStatus);
-            this.bar_mainWin.Controls.Add(this.paymentPanel);
+            this.bar_mainWin.Controls.Add(this.testPanel);
             this.bar_mainWin.Controls.Add(this.NumMachineMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.paymentPanel);
             this.bar_mainWin.Controls.Add(this.ParkingSpaceMonitorPanel);
-            this.bar_mainWin.Controls.Add(this.testPanel);
+            this.bar_mainWin.Controls.Add(this.pdc_devStatus);
             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;
@@ -254,7 +255,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 = 4;
+            this.bar_mainWin.SelectedDockTab = 3;
             this.bar_mainWin.SingleLineColor = System.Drawing.SystemColors.ControlDarkDark;
             this.bar_mainWin.Size = new System.Drawing.Size(503, 326);
             this.bar_mainWin.Stretch = true;
@@ -263,6 +264,110 @@
             this.bar_mainWin.TabNavigation = true;
             this.bar_mainWin.TabStop = false;
             // 
+            // 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(497, 295);
+            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(497, 295);
+            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);
@@ -573,6 +678,12 @@
             this.dci_Test.Name = "dci_Test";
             this.dci_Test.Text = "测试";
             // 
+            // dci_devStatus
+            // 
+            this.dci_devStatus.Control = this.pdc_devStatus;
+            this.dci_devStatus.Name = "dci_devStatus";
+            this.dci_devStatus.Text = "设备状态监控";
+            // 
             // bar_bottom
             // 
             this.bar_bottom.AccessibleDescription = "DotNetBar Bar (bar_bottom)";
@@ -979,7 +1090,8 @@
             this.btn_advertUpdate,
             this.btn_recordManagement,
             this.btn_exportRecords,
-            this.btn_setScheme});
+            this.btn_setScheme,
+            this.btn_config});
             this.btn_files.Text = "文件";
             // 
             // btn_openFile
@@ -1012,6 +1124,12 @@
             this.btn_setScheme.Text = "收费策略";
             this.btn_setScheme.Click += new System.EventHandler(this.btn_setScheme_Click);
             // 
+            // btn_config
+            // 
+            this.btn_config.Name = "btn_config";
+            this.btn_config.Text = "系统配置";
+            this.btn_config.Click += new System.EventHandler(this.btn_config_Click);
+            // 
             // btn_views
             // 
             this.btn_views.Name = "btn_views";
@@ -1332,116 +1450,6 @@
             this.controlContainerItem1.MenuVisibility = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
             this.controlContainerItem1.Name = "controlContainerItem1";
             // 
-            // dci_devStatus
-            // 
-            this.dci_devStatus.Control = this.pdc_devStatus;
-            this.dci_devStatus.Name = "dci_devStatus";
-            this.dci_devStatus.Text = "设备状态监控";
-            // 
-            // 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(497, 295);
-            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;
-            // 
-            // 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_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;
-            // 
-            // 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_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;
-            // 
-            // 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(497, 295);
-            this.panel1.TabIndex = 2;
-            // 
             // centralController
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1467,6 +1475,9 @@
             this.dockSite_mainView.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).EndInit();
             this.bar_mainWin.ResumeLayout(false);
+            this.pdc_devStatus.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            this.tableLayoutPanel2.ResumeLayout(false);
             this.NumMachineMonitorPanel.ResumeLayout(false);
             this.testPanel.ResumeLayout(false);
             this.testPanel.PerformLayout();
@@ -1494,9 +1505,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.bar_shortcut)).EndInit();
             this.bar_shortcut.ResumeLayout(false);
             this.panel_freeSpace.ResumeLayout(false);
-            this.pdc_devStatus.ResumeLayout(false);
-            this.tableLayoutPanel2.ResumeLayout(false);
-            this.panel1.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -1609,6 +1617,7 @@
         private DevComponents.DotNetBar.LabelX lbx_webStatus;
         private DevComponents.DotNetBar.LabelX lbx_PLCStatus;
         private System.Windows.Forms.Panel panel1;
+        private DevComponents.DotNetBar.ButtonItem btn_config;
     }
 }
 

+ 11 - 2
PLCLinker/centralController/FormCentralController.cs

@@ -84,7 +84,6 @@ namespace centralController
             });
         }
 
-
         /// <summary>
         /// 实时更新所有车位显示
         /// </summary>
@@ -375,6 +374,16 @@ namespace centralController
                 }
             });
         }
+        /// <summary>
+        /// 系统配置
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_config_Click(object sender, EventArgs e)
+        {
+            FormSysConfig formSysConfig = new FormSysConfig();
+            formSysConfig.ShowDialog();
+        }
         #endregion
 
         #region 视图
@@ -756,8 +765,8 @@ namespace centralController
         {
             Close();
         }
-        #endregion
 
+        #endregion
 
     }
 }

+ 461 - 0
PLCLinker/centralController/FormSysConfig.Designer.cs

@@ -0,0 +1,461 @@
+namespace centralController
+{
+    partial class FormSysConfig
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.gp_numMachineConfig = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.btnx_nmRatioConfirm = new DevComponents.DotNetBar.ButtonX();
+            this.sld_nmfilterRatio = new DevComponents.DotNetBar.Controls.Slider();
+            this.tb_nmId = new System.Windows.Forms.TextBox();
+            this.btnx_nmIdAlter = new DevComponents.DotNetBar.ButtonX();
+            this.btnx_nmSearch = new DevComponents.DotNetBar.ButtonX();
+            this.lbx_nmId = new DevComponents.DotNetBar.LabelX();
+            this.lbx_nmIP = new DevComponents.DotNetBar.LabelX();
+            this.cb_nmIP = new System.Windows.Forms.ComboBox();
+            this.gp_PLCConf = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.gp_AllInOneMachineConf = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.gp_restConf = new DevComponents.DotNetBar.Controls.GroupPanel();
+            this.tb_garageID = new System.Windows.Forms.TextBox();
+            this.btnx_alterGarageId = new DevComponents.DotNetBar.ButtonX();
+            this.tb_defaultLic = new System.Windows.Forms.TextBox();
+            this.btnx_alterDefaultLic = new DevComponents.DotNetBar.ButtonX();
+            this.lbx_logAddress = new DevComponents.DotNetBar.LabelX();
+            this.lbx_advertAddress = new DevComponents.DotNetBar.LabelX();
+            this.btnx_alterLogAddress = new DevComponents.DotNetBar.ButtonX();
+            this.lbx_garageId = new DevComponents.DotNetBar.LabelX();
+            this.lbx_defaultLic = new DevComponents.DotNetBar.LabelX();
+            this.gp_numMachineConfig.SuspendLayout();
+            this.gp_restConf.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // gp_numMachineConfig
+            // 
+            this.gp_numMachineConfig.CanvasColor = System.Drawing.SystemColors.Control;
+            this.gp_numMachineConfig.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.gp_numMachineConfig.Controls.Add(this.btnx_nmRatioConfirm);
+            this.gp_numMachineConfig.Controls.Add(this.sld_nmfilterRatio);
+            this.gp_numMachineConfig.Controls.Add(this.tb_nmId);
+            this.gp_numMachineConfig.Controls.Add(this.btnx_nmIdAlter);
+            this.gp_numMachineConfig.Controls.Add(this.btnx_nmSearch);
+            this.gp_numMachineConfig.Controls.Add(this.lbx_nmId);
+            this.gp_numMachineConfig.Controls.Add(this.lbx_nmIP);
+            this.gp_numMachineConfig.Controls.Add(this.cb_nmIP);
+            this.gp_numMachineConfig.DisabledBackColor = System.Drawing.Color.Empty;
+            this.gp_numMachineConfig.Location = new System.Drawing.Point(12, 12);
+            this.gp_numMachineConfig.Name = "gp_numMachineConfig";
+            this.gp_numMachineConfig.Size = new System.Drawing.Size(271, 221);
+            // 
+            // 
+            // 
+            this.gp_numMachineConfig.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+            this.gp_numMachineConfig.Style.BackColorGradientAngle = 90;
+            this.gp_numMachineConfig.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+            this.gp_numMachineConfig.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_numMachineConfig.Style.BorderBottomWidth = 1;
+            this.gp_numMachineConfig.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+            this.gp_numMachineConfig.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_numMachineConfig.Style.BorderLeftWidth = 1;
+            this.gp_numMachineConfig.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_numMachineConfig.Style.BorderRightWidth = 1;
+            this.gp_numMachineConfig.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_numMachineConfig.Style.BorderTopWidth = 1;
+            this.gp_numMachineConfig.Style.CornerDiameter = 4;
+            this.gp_numMachineConfig.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.gp_numMachineConfig.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.gp_numMachineConfig.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+            this.gp_numMachineConfig.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.gp_numMachineConfig.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.gp_numMachineConfig.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.gp_numMachineConfig.TabIndex = 0;
+            this.gp_numMachineConfig.Text = "号牌机配置";
+            // 
+            // btnx_nmRatioConfirm
+            // 
+            this.btnx_nmRatioConfirm.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_nmRatioConfirm.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_nmRatioConfirm.Location = new System.Drawing.Point(86, 158);
+            this.btnx_nmRatioConfirm.Name = "btnx_nmRatioConfirm";
+            this.btnx_nmRatioConfirm.Size = new System.Drawing.Size(75, 23);
+            this.btnx_nmRatioConfirm.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_nmRatioConfirm.TabIndex = 7;
+            this.btnx_nmRatioConfirm.Text = "修改比例";
+            this.btnx_nmRatioConfirm.Click += new System.EventHandler(this.btnx_nmRatioConfirm_Click);
+            // 
+            // sld_nmfilterRatio
+            // 
+            // 
+            // 
+            // 
+            this.sld_nmfilterRatio.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.sld_nmfilterRatio.LabelWidth = 120;
+            this.sld_nmfilterRatio.Location = new System.Drawing.Point(5, 122);
+            this.sld_nmfilterRatio.Name = "sld_nmfilterRatio";
+            this.sld_nmfilterRatio.Size = new System.Drawing.Size(238, 30);
+            this.sld_nmfilterRatio.Step = 10;
+            this.sld_nmfilterRatio.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.sld_nmfilterRatio.TabIndex = 6;
+            this.sld_nmfilterRatio.Text = "号牌筛选比例(%)";
+            this.sld_nmfilterRatio.Value = 70;
+            this.sld_nmfilterRatio.ValueChanged += new System.EventHandler(this.sld_nmfilterRatio_ValueChanged);
+            // 
+            // tb_nmId
+            // 
+            this.tb_nmId.Location = new System.Drawing.Point(171, 52);
+            this.tb_nmId.Name = "tb_nmId";
+            this.tb_nmId.Size = new System.Drawing.Size(67, 21);
+            this.tb_nmId.TabIndex = 5;
+            // 
+            // btnx_nmIdAlter
+            // 
+            this.btnx_nmIdAlter.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_nmIdAlter.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_nmIdAlter.Location = new System.Drawing.Point(168, 84);
+            this.btnx_nmIdAlter.Name = "btnx_nmIdAlter";
+            this.btnx_nmIdAlter.Size = new System.Drawing.Size(75, 23);
+            this.btnx_nmIdAlter.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_nmIdAlter.TabIndex = 4;
+            this.btnx_nmIdAlter.Text = "修改编号";
+            this.btnx_nmIdAlter.Click += new System.EventHandler(this.btnx_nmIdAlter_Click);
+            // 
+            // btnx_nmSearch
+            // 
+            this.btnx_nmSearch.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_nmSearch.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_nmSearch.Location = new System.Drawing.Point(41, 84);
+            this.btnx_nmSearch.Name = "btnx_nmSearch";
+            this.btnx_nmSearch.Size = new System.Drawing.Size(75, 23);
+            this.btnx_nmSearch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_nmSearch.TabIndex = 3;
+            this.btnx_nmSearch.Text = "查询编号";
+            this.btnx_nmSearch.Click += new System.EventHandler(this.btnx_nmSearch_Click);
+            // 
+            // lbx_nmId
+            // 
+            // 
+            // 
+            // 
+            this.lbx_nmId.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_nmId.Location = new System.Drawing.Point(171, 19);
+            this.lbx_nmId.Name = "lbx_nmId";
+            this.lbx_nmId.Size = new System.Drawing.Size(67, 23);
+            this.lbx_nmId.TabIndex = 2;
+            this.lbx_nmId.Text = "号牌机编号";
+            // 
+            // lbx_nmIP
+            // 
+            // 
+            // 
+            // 
+            this.lbx_nmIP.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_nmIP.Location = new System.Drawing.Point(41, 19);
+            this.lbx_nmIP.Name = "lbx_nmIP";
+            this.lbx_nmIP.Size = new System.Drawing.Size(59, 23);
+            this.lbx_nmIP.TabIndex = 1;
+            this.lbx_nmIP.Text = "号牌机IP";
+            // 
+            // cb_nmIP
+            // 
+            this.cb_nmIP.FormattingEnabled = true;
+            this.cb_nmIP.Location = new System.Drawing.Point(16, 52);
+            this.cb_nmIP.Name = "cb_nmIP";
+            this.cb_nmIP.Size = new System.Drawing.Size(134, 20);
+            this.cb_nmIP.TabIndex = 0;
+            this.cb_nmIP.DropDown += new System.EventHandler(this.cb_nmIP_DropDown);
+            // 
+            // gp_PLCConf
+            // 
+            this.gp_PLCConf.CanvasColor = System.Drawing.SystemColors.Control;
+            this.gp_PLCConf.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.gp_PLCConf.DisabledBackColor = System.Drawing.Color.Empty;
+            this.gp_PLCConf.Location = new System.Drawing.Point(12, 255);
+            this.gp_PLCConf.Name = "gp_PLCConf";
+            this.gp_PLCConf.Size = new System.Drawing.Size(269, 236);
+            // 
+            // 
+            // 
+            this.gp_PLCConf.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+            this.gp_PLCConf.Style.BackColorGradientAngle = 90;
+            this.gp_PLCConf.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+            this.gp_PLCConf.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_PLCConf.Style.BorderBottomWidth = 1;
+            this.gp_PLCConf.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+            this.gp_PLCConf.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_PLCConf.Style.BorderLeftWidth = 1;
+            this.gp_PLCConf.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_PLCConf.Style.BorderRightWidth = 1;
+            this.gp_PLCConf.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_PLCConf.Style.BorderTopWidth = 1;
+            this.gp_PLCConf.Style.CornerDiameter = 4;
+            this.gp_PLCConf.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.gp_PLCConf.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.gp_PLCConf.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+            this.gp_PLCConf.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.gp_PLCConf.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.gp_PLCConf.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.gp_PLCConf.TabIndex = 1;
+            this.gp_PLCConf.Text = "PLC配置";
+            // 
+            // gp_AllInOneMachineConf
+            // 
+            this.gp_AllInOneMachineConf.CanvasColor = System.Drawing.SystemColors.Control;
+            this.gp_AllInOneMachineConf.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.gp_AllInOneMachineConf.DisabledBackColor = System.Drawing.Color.Empty;
+            this.gp_AllInOneMachineConf.Location = new System.Drawing.Point(311, 12);
+            this.gp_AllInOneMachineConf.Name = "gp_AllInOneMachineConf";
+            this.gp_AllInOneMachineConf.Size = new System.Drawing.Size(347, 138);
+            // 
+            // 
+            // 
+            this.gp_AllInOneMachineConf.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+            this.gp_AllInOneMachineConf.Style.BackColorGradientAngle = 90;
+            this.gp_AllInOneMachineConf.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+            this.gp_AllInOneMachineConf.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_AllInOneMachineConf.Style.BorderBottomWidth = 1;
+            this.gp_AllInOneMachineConf.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+            this.gp_AllInOneMachineConf.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_AllInOneMachineConf.Style.BorderLeftWidth = 1;
+            this.gp_AllInOneMachineConf.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_AllInOneMachineConf.Style.BorderRightWidth = 1;
+            this.gp_AllInOneMachineConf.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_AllInOneMachineConf.Style.BorderTopWidth = 1;
+            this.gp_AllInOneMachineConf.Style.CornerDiameter = 4;
+            this.gp_AllInOneMachineConf.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.gp_AllInOneMachineConf.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.gp_AllInOneMachineConf.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+            this.gp_AllInOneMachineConf.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.gp_AllInOneMachineConf.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.gp_AllInOneMachineConf.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.gp_AllInOneMachineConf.TabIndex = 2;
+            this.gp_AllInOneMachineConf.Text = "LED屏显配置";
+            // 
+            // gp_restConf
+            // 
+            this.gp_restConf.CanvasColor = System.Drawing.SystemColors.Control;
+            this.gp_restConf.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+            this.gp_restConf.Controls.Add(this.lbx_defaultLic);
+            this.gp_restConf.Controls.Add(this.lbx_garageId);
+            this.gp_restConf.Controls.Add(this.btnx_alterLogAddress);
+            this.gp_restConf.Controls.Add(this.lbx_advertAddress);
+            this.gp_restConf.Controls.Add(this.lbx_logAddress);
+            this.gp_restConf.Controls.Add(this.btnx_alterDefaultLic);
+            this.gp_restConf.Controls.Add(this.tb_defaultLic);
+            this.gp_restConf.Controls.Add(this.btnx_alterGarageId);
+            this.gp_restConf.Controls.Add(this.tb_garageID);
+            this.gp_restConf.DisabledBackColor = System.Drawing.Color.Empty;
+            this.gp_restConf.Location = new System.Drawing.Point(311, 191);
+            this.gp_restConf.Name = "gp_restConf";
+            this.gp_restConf.Size = new System.Drawing.Size(347, 300);
+            // 
+            // 
+            // 
+            this.gp_restConf.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+            this.gp_restConf.Style.BackColorGradientAngle = 90;
+            this.gp_restConf.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+            this.gp_restConf.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_restConf.Style.BorderBottomWidth = 1;
+            this.gp_restConf.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+            this.gp_restConf.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_restConf.Style.BorderLeftWidth = 1;
+            this.gp_restConf.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_restConf.Style.BorderRightWidth = 1;
+            this.gp_restConf.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+            this.gp_restConf.Style.BorderTopWidth = 1;
+            this.gp_restConf.Style.CornerDiameter = 4;
+            this.gp_restConf.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+            this.gp_restConf.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+            this.gp_restConf.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+            this.gp_restConf.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+            // 
+            // 
+            // 
+            this.gp_restConf.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            // 
+            // 
+            // 
+            this.gp_restConf.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.gp_restConf.TabIndex = 3;
+            this.gp_restConf.Text = "其他配置";
+            // 
+            // tb_garageID
+            // 
+            this.tb_garageID.Location = new System.Drawing.Point(126, 23);
+            this.tb_garageID.Name = "tb_garageID";
+            this.tb_garageID.Size = new System.Drawing.Size(54, 21);
+            this.tb_garageID.TabIndex = 0;
+            // 
+            // btnx_alterGarageId
+            // 
+            this.btnx_alterGarageId.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_alterGarageId.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_alterGarageId.Location = new System.Drawing.Point(233, 21);
+            this.btnx_alterGarageId.Name = "btnx_alterGarageId";
+            this.btnx_alterGarageId.Size = new System.Drawing.Size(75, 23);
+            this.btnx_alterGarageId.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_alterGarageId.TabIndex = 2;
+            this.btnx_alterGarageId.Text = "修改车库号";
+            // 
+            // tb_defaultLic
+            // 
+            this.tb_defaultLic.Location = new System.Drawing.Point(126, 70);
+            this.tb_defaultLic.Name = "tb_defaultLic";
+            this.tb_defaultLic.Size = new System.Drawing.Size(83, 21);
+            this.tb_defaultLic.TabIndex = 3;
+            // 
+            // btnx_alterDefaultLic
+            // 
+            this.btnx_alterDefaultLic.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_alterDefaultLic.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_alterDefaultLic.Location = new System.Drawing.Point(233, 70);
+            this.btnx_alterDefaultLic.Name = "btnx_alterDefaultLic";
+            this.btnx_alterDefaultLic.Size = new System.Drawing.Size(90, 23);
+            this.btnx_alterDefaultLic.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_alterDefaultLic.TabIndex = 5;
+            this.btnx_alterDefaultLic.Text = "修改默认车牌";
+            // 
+            // lbx_logAddress
+            // 
+            // 
+            // 
+            // 
+            this.lbx_logAddress.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_logAddress.Location = new System.Drawing.Point(14, 109);
+            this.lbx_logAddress.Name = "lbx_logAddress";
+            this.lbx_logAddress.Size = new System.Drawing.Size(309, 41);
+            this.lbx_logAddress.TabIndex = 6;
+            this.lbx_logAddress.Text = "当前日志路径:";
+            this.lbx_logAddress.WordWrap = true;
+            // 
+            // lbx_advertAddress
+            // 
+            // 
+            // 
+            // 
+            this.lbx_advertAddress.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_advertAddress.Location = new System.Drawing.Point(14, 206);
+            this.lbx_advertAddress.Name = "lbx_advertAddress";
+            this.lbx_advertAddress.Size = new System.Drawing.Size(309, 41);
+            this.lbx_advertAddress.TabIndex = 7;
+            this.lbx_advertAddress.Text = "当前广告路径:";
+            this.lbx_advertAddress.WordWrap = true;
+            // 
+            // btnx_alterLogAddress
+            // 
+            this.btnx_alterLogAddress.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+            this.btnx_alterLogAddress.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+            this.btnx_alterLogAddress.Location = new System.Drawing.Point(126, 156);
+            this.btnx_alterLogAddress.Name = "btnx_alterLogAddress";
+            this.btnx_alterLogAddress.Size = new System.Drawing.Size(90, 33);
+            this.btnx_alterLogAddress.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+            this.btnx_alterLogAddress.TabIndex = 8;
+            this.btnx_alterLogAddress.Text = "修改日志路径";
+            // 
+            // lbx_garageId
+            // 
+            // 
+            // 
+            // 
+            this.lbx_garageId.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_garageId.Location = new System.Drawing.Point(14, 23);
+            this.lbx_garageId.Name = "lbx_garageId";
+            this.lbx_garageId.Size = new System.Drawing.Size(75, 23);
+            this.lbx_garageId.TabIndex = 9;
+            this.lbx_garageId.Text = "车库号:";
+            // 
+            // lbx_defaultLic
+            // 
+            // 
+            // 
+            // 
+            this.lbx_defaultLic.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.lbx_defaultLic.Location = new System.Drawing.Point(14, 70);
+            this.lbx_defaultLic.Name = "lbx_defaultLic";
+            this.lbx_defaultLic.Size = new System.Drawing.Size(75, 23);
+            this.lbx_defaultLic.TabIndex = 10;
+            this.lbx_defaultLic.Text = "默认车牌:";
+            // 
+            // FormSysConfig
+            // 
+            this.ClientSize = new System.Drawing.Size(674, 519);
+            this.Controls.Add(this.gp_PLCConf);
+            this.Controls.Add(this.gp_restConf);
+            this.Controls.Add(this.gp_AllInOneMachineConf);
+            this.Controls.Add(this.gp_numMachineConfig);
+            this.DoubleBuffered = true;
+            this.Name = "FormSysConfig";
+            this.Text = "FormSysConfig";
+            this.gp_numMachineConfig.ResumeLayout(false);
+            this.gp_numMachineConfig.PerformLayout();
+            this.gp_restConf.ResumeLayout(false);
+            this.gp_restConf.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevComponents.DotNetBar.Controls.GroupPanel gp_numMachineConfig;
+        private DevComponents.DotNetBar.ButtonX btnx_nmRatioConfirm;
+        private DevComponents.DotNetBar.Controls.Slider sld_nmfilterRatio;
+        private System.Windows.Forms.TextBox tb_nmId;
+        private DevComponents.DotNetBar.ButtonX btnx_nmIdAlter;
+        private DevComponents.DotNetBar.ButtonX btnx_nmSearch;
+        private DevComponents.DotNetBar.LabelX lbx_nmId;
+        private DevComponents.DotNetBar.LabelX lbx_nmIP;
+        private System.Windows.Forms.ComboBox cb_nmIP;
+        private DevComponents.DotNetBar.Controls.GroupPanel gp_PLCConf;
+        private DevComponents.DotNetBar.Controls.GroupPanel gp_AllInOneMachineConf;
+        private DevComponents.DotNetBar.Controls.GroupPanel gp_restConf;
+        private DevComponents.DotNetBar.LabelX lbx_defaultLic;
+        private DevComponents.DotNetBar.LabelX lbx_garageId;
+        private DevComponents.DotNetBar.ButtonX btnx_alterLogAddress;
+        private DevComponents.DotNetBar.LabelX lbx_advertAddress;
+        private DevComponents.DotNetBar.LabelX lbx_logAddress;
+        private DevComponents.DotNetBar.ButtonX btnx_alterDefaultLic;
+        private System.Windows.Forms.TextBox tb_defaultLic;
+        private DevComponents.DotNetBar.ButtonX btnx_alterGarageId;
+        private System.Windows.Forms.TextBox tb_garageID;
+    }
+}

+ 117 - 0
PLCLinker/centralController/FormSysConfig.cs

@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Configuration;
+using System.Data;
+using System.Drawing;
+using System.Net;
+using System.Text;
+using System.Windows.Forms;
+using DevComponents.DotNetBar;
+using parkMonitor.LOG;
+
+namespace centralController
+{
+    public partial class FormSysConfig : DevComponents.DotNetBar.OfficeForm
+    {
+        public FormSysConfig()
+        {
+            InitializeComponent();
+            tb_garageID.Text = Monitor.Monitor.garageID.ToString();
+            tb_defaultLic.Text = Monitor.Monitor.defaultLic;
+            lbx_logAddress.Text = "当前日志路径:"+ LogManager.logAddress;
+            lbx_advertAddress.Text = "当前广告路径:" +Monitor.Monitor.advertPath;
+        }
+
+        private void cb_nmIP_DropDown(object sender, EventArgs e)
+        {
+            Dictionary<string, int>.Enumerator enumer = Monitor.Monitor.numMachineLinker.GetIpIdMap().GetEnumerator();
+            while (enumer.MoveNext())
+            {
+                cb_nmIP.Items.Add(enumer.Current.Key);
+            }
+        }
+        /// <summary>
+        /// 查询号牌机当前IP
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnx_nmSearch_Click(object sender, EventArgs e)
+        {
+            string selectedIP = (string)cb_nmIP.SelectedItem;
+            Dictionary<string, int> dictionary = Monitor.Monitor.numMachineLinker.GetIpIdMap();
+            if (dictionary != null && selectedIP != null)
+            {
+                bool result = dictionary.TryGetValue(selectedIP, out int id);
+                if (result)
+                    tb_nmId.Text = id.ToString();
+                else
+                    MessageBox.Show("未能找到该IP对应的号牌机ID", "查询失败");
+            }
+            else
+                MessageBox.Show("当前未识别到号牌机", "查询失败");
+        }
+        /// <summary>
+        /// 修改号牌机对应IP
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnx_nmIdAlter_Click(object sender, EventArgs e)
+        {
+            string selectedIP = (string)cb_nmIP.SelectedItem;
+            if (selectedIP == null)
+            {
+                MessageBox.Show("未选择IP", "修改失败");
+                return;
+            }
+            else
+            {
+                if (int.TryParse(tb_nmId.Text, out int id))
+                {
+                    ConfigurationManager.AppSettings.Set(selectedIP, tb_nmId.Text);
+                    ConfModify(selectedIP, tb_nmId.Text);
+                    MessageBox.Show("修改ip " + selectedIP + "对应id为" + tb_nmId.Text + "\n编号将在重启后生效", "修改成功");
+                }
+                else
+                {
+                    MessageBox.Show("识别到id并非整型数字", "修改失败");
+                }
+            }
+        }
+        /// <summary>
+        /// 修改号牌筛选比例
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnx_nmRatioConfirm_Click(object sender, EventArgs e)
+        {
+            int ratio = sld_nmfilterRatio.Value / 10 * 10;
+            Monitor.Monitor.numMachineLinker.SetRatio((ratio / 100.0));
+            ConfModify("filterRatio", (ratio / 100.0).ToString());
+            MessageBox.Show("号牌筛选比例已修改为" + (ratio / 100.0).ToString(), "修改成功");
+        }
+        /// <summary>
+        /// 保存配置文件修改
+        /// </summary>
+        /// <param name="key"></param>
+        /// <param name="value"></param>
+        private void ConfModify(string key, string value)
+        {
+            Configuration conf = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+            if (conf.AppSettings.Settings[key] != null)
+                conf.AppSettings.Settings[key].Value = value;
+            //else
+            //    conf.AppSettings.Settings.Add(key, value);
+            conf.Save(ConfigurationSaveMode.Modified);
+        }
+        /// <summary>
+        /// 实时显示slider值
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void sld_nmfilterRatio_ValueChanged(object sender, EventArgs e)
+        {
+            sld_nmfilterRatio.Text = "号牌筛选比例:" +(sld_nmfilterRatio.Value/10*10)/100.0;
+        }
+    }
+}

+ 120 - 0
PLCLinker/centralController/FormSysConfig.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
PLCLinker/centralController/Monitor/Monitor.cs

@@ -79,7 +79,7 @@ namespace Monitor
         public static string advertPath { get; set; }
         public static AdvertManager advertMgr;
         public static centralController.centralController mainWin { get; set; }
-
+        public static string defaultLic{get;set;}
         /// <summary>
         /// 系统初始化器句柄
         /// </summary>

+ 1 - 0
PLCLinker/centralController/Monitor/SystemInitializer.cs

@@ -40,6 +40,7 @@ namespace Monitor
             {
                 Monitor.SetNotification("读取配置文件中...",parkMonitor.model.TextColor.Log);
                 retryCount = Convert.ToInt32(ConfigurationManager.AppSettings.Get("retryCount"));
+                Monitor.defaultLic = ConfigurationManager.AppSettings.Get("defaultLic");
                 //数据库
                 remoteDBConnStr = ConfigurationManager.AppSettings.Get("remoteDBConnStr");
                 localDBConnStr = ConfigurationManager.AppSettings.Get("localDBConnStr");

+ 6 - 1
PLCLinker/centralController/NumMachine/INumMachineLinker.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using System.Drawing;
 
 namespace NumMachine
@@ -8,7 +9,11 @@ namespace NumMachine
 
 		Image GetImage(int id);
 
-		void Start();
+        Dictionary<string, int> GetIpIdMap();
+
+        void SetRatio(double ratio);
+
+        void Start();
 
 		void Stop();
 	}

+ 17 - 14
PLCLinker/centralController/NumMachine/NumMachine.cs

@@ -58,10 +58,13 @@ namespace NumMachine
         /// 用于消息传递机制
         /// </summary>
         //public static IntPtr hwndMain;
+        /// <summary>
+        /// 定义时钟委托
+        /// </summary>
+        private delegate void SetDateTime();
+        private static IntPtr flowLayoutPanel1;
+        private static ToolStripStatusLabel timeLabel;
 
-        public static IntPtr flowLayoutPanel1;
-
-        public static ToolStripStatusLabel timeLabel;
         /// <summary>
         /// 号牌机类构造函数
         /// </summary>
@@ -78,22 +81,12 @@ namespace NumMachine
             try
             {
                 VzClientSDK.VzLPRClient_Setup();
-                filterRatio = Double.Parse(ConfigurationManager.AppSettings.Get("filterRatio"));
+                 filterRatio = Double.Parse(ConfigurationManager.AppSettings.Get("filterRatio"));
             }
             catch (Exception e) { Console.WriteLine(e.Message + ",号牌机配置文件异常"); }
             //m_sAppPath = System.IO.Directory.GetCurrentDirectory();
         }
 
-        /// <summary>
-        /// 定义时钟委托
-        /// </summary>
-        public delegate void SetDateTime();
-
-        /// <summary>
-        /// 实时采集
-        /// </summary>
-        public delegate void Begin_Read();
-
         private void DateTimeInfo()
         {
             try
@@ -937,6 +930,16 @@ namespace NumMachine
         {
             return null;
         }
+
+        public Dictionary<string, int> GetIpIdMap()
+        {
+            return ipIdMap;
+        }
+
+        public void SetRatio(double ratio)
+        {
+            filterRatio = ratio;
+        }
     }
 
 }

+ 41 - 34
PLCLinker/centralController/Terminal/Terminal.cs

@@ -435,15 +435,36 @@ namespace Terminal
                     {
                         string license = "";
                         //判断之前是否已拍摄号牌
-                        if (!idLicMap.ContainsKey(terminalInfo[i].terminalID))
+                        if (!idLicMap.ContainsKey(term.terminalID))
                         {
                             license = "";// "桂K88888"; //Monitor.Monitor.numMachineLinker.GetLicensePlate(terminalInfo[i].terminalID);
-                            Monitor.Monitor.SetNotification("启动" + terminalInfo[i].terminalID + "号号牌机,号牌:" + license, parkMonitor.model.TextColor.Info);
+                            Monitor.Monitor.SetNotification("启动" + term.terminalID + "号号牌机,号牌:" + license, parkMonitor.model.TextColor.Info);
                         }
                         else
                         {
-                            idLicMap.TryGetValue(terminalInfo[i].terminalID, out license);
+                            idLicMap.TryGetValue(term.terminalID, out license);
                         }
+
+                        //无论号牌有无,皆记录或更新当前号牌,若无则填入默认号牌
+                        lock (idLicMap)
+                        {
+                            string currentLic = license == "" ? Monitor.Monitor.defaultLic : license;
+                            try
+                            {
+                                if (idLicMap.ContainsKey(term.terminalID))
+                                {
+                                    if (!idLicMap[term.terminalID].Equals(currentLic))
+                                        idLicMap[term.terminalID] = currentLic;
+                                }
+                                else
+                                {
+                                    idLicMap.Add(term.terminalID, currentLic);
+                                }
+                            }
+                            catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "号牌" + license + "记录号牌异常\n" + e.StackTrace); }
+                        }
+                        Log.WriteLog(LogType.process, LogFile.INFO, "号牌" + license + "已记录");
+
                         //未获得号牌,告知PLC终止,告诉终端提示用户重新操作
                         if (license == "")
                         {
@@ -457,7 +478,7 @@ namespace Terminal
                             Monitor.Monitor.PLC.WriteToPLC(mb, PLCDataType.central);
                             TerminalStru ts = new TerminalStru
                             {
-                                terminalID = (short)terminalInfo[i].terminalID,
+                                terminalID = (short)term.terminalID,
                                 paymentStatus = -1,
                                 parkingFee = -1,
                                 userType = -1,
@@ -468,28 +489,9 @@ namespace Terminal
                         }
                         else
                         {
-                            //记录或更新当前号牌
-                            lock (idLicMap)
-                            {
-                                try
-                                {
-                                    if (idLicMap.ContainsKey(terminalInfo[i].terminalID))
-                                    {
-                                        if (!idLicMap[terminalInfo[i].terminalID].Equals(license))
-                                            idLicMap[terminalInfo[i].terminalID] = license;
-                                    }
-                                    else
-                                    {
-                                        idLicMap.Add(terminalInfo[i].terminalID, license);
-                                    }
-                                }
-                                catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "号牌" + license + "记录号牌异常\n" + e.StackTrace); }
-                            }
-                            Log.WriteLog(LogType.process, LogFile.INFO, "号牌" + license + "已记录");
-
                             TerminalStru ts = new TerminalStru
                             {
-                                terminalID = (short)terminalInfo[i].terminalID,
+                                terminalID = (short)term.terminalID,
                                 paymentStatus = -1,
                                 parkingFee = -1,
                                 userType = -1
@@ -499,7 +501,7 @@ namespace Terminal
                             {
                                 int userID = term.licenseCodeA;
                                 string userLicense = GetLicenseFromTerm(term);
-                                //注册用户缺ID信息,转为普通用户停车
+                                //注册用户缺ID信息,转为普通用户停车,终端将限制该情况发生
                                 if (userID == 0)
                                 {
                                     term.btnStatus = 1;
@@ -510,7 +512,7 @@ namespace Terminal
                                     ValidateUserInfo(ts, userID, userLicense, out numReceivedStatus);
                                     if (numReceivedStatus == 2)
                                     {
-                                        idLicMap.Remove(terminalInfo[i].terminalID);
+                                        idLicMap.Remove(term.terminalID);
                                     }
                                 }
                             }
@@ -533,17 +535,16 @@ namespace Terminal
                             //号牌获取结果被清零才跳出
                             Monitor.Monitor.SetNotification("已写入号牌获取结果,等待号牌机启动指令清零", parkMonitor.model.TextColor.Info);
                         }
-                        int countdown = 5;
+                        int countdown = 10;
                         while (countdown-- > 0)
                         {
-                            if (term.numMachineLaunch == 0)
+                            if (terminalInfo[i].numMachineLaunch == 0)
                             {
                                 Monitor.Monitor.SetNotification("号牌机启动指令已被清零", parkMonitor.model.TextColor.Info); break;
                             }
                             else
                                 Thread.Sleep(500);
                         }
-
                     }
                 }
             }
@@ -560,7 +561,7 @@ namespace Terminal
             int parkingSpaceID = 0;
             if (processAttrib == 1)
             {
-                TerminalStru term;
+                TerminalStru term = new TerminalStru();
                 string license;
                 //等待完成信号
                 while (Monitor.Monitor.mainBlockInfo.processCompleted != 1)
@@ -573,7 +574,12 @@ namespace Terminal
                 //拿到号牌
                 if (/*terminalInfo[i].terminalID == currentTerm && */idLicMap.TryGetValue(currentTerm, out license) && license != "")
                 {
-                    term = terminalInfo[currentTerm - 1];
+                    for (int i = 0; i < terminalInfo.Count; i++)
+                    {
+                        if (terminalInfo[i].terminalID == currentTerm)
+                            term = terminalInfo[i];
+                    }
+                    //term = terminalInfo[currentTerm - 1];
                     Thread.Sleep(1500);
                     //找到停车位置
                     for (int s = 0; s < Monitor.Monitor.parkingSpaceInfo.Count; s++)
@@ -816,7 +822,7 @@ namespace Terminal
                 }
                 else
                 {
-                    Log.WriteLog(LogType.process, LogFile.ERROR, "根据凭证号"+ receipt + "查询停车记录失败");
+                    Log.WriteLog(LogType.process, LogFile.ERROR, "根据凭证号" + receipt + "查询停车记录失败");
                     Monitor.Monitor.SetNotification("取车流程, 根据凭证号查询停车记录失败", parkMonitor.model.TextColor.Error);
                     result = false;
                 }
@@ -1251,7 +1257,7 @@ namespace Terminal
                             termCalcMap[terminalInfo[termIndex].terminalID] = false;
                             fetchInfoMap.Remove(terminalInfo[termIndex].terminalID);
                             fetchCompleteMap.Remove(terminalInfo[termIndex].terminalID);
-                        }); 
+                        });
                     }
                 }
             }
@@ -1292,7 +1298,8 @@ namespace Terminal
             ParkProcess();
             FetchProcess();
             //定时更新云端车位,5min
-            Task.Factory.StartNew(()=> {
+            Task.Factory.StartNew(() =>
+            {
                 while (!isClosing)
                 {
                     UpdateAllParkingSpace(true);

+ 1 - 1
PLCLinker/centralController/WebServer/WebServer.cs

@@ -271,7 +271,7 @@ namespace centralController.WebServer
                                 DBOperResult = DBOperResult && ReserveDBOperation(false, msg.sender, true, msg.context, msg.bookTime, msg.bookLength);
                                 //回复成功给web
                                 if (!DBOperResult)
-                                    Log.WriteLog(LogType.process, LogFile.WARNING, "预约数据库操作未获得记录ID");
+                                    Log.WriteLog(LogType.process, LogFile.WARNING, msg.context+"从"+msg.bookTime+"开始预约"+msg.bookLength+"小时,预约指令数据库操作未获得记录ID");
                                 returnMsg.cmd = "OK";
                                 returnMsg.garageID = Monitor.Monitor.garageID;
                                 returnMsg.context = msg.context;

+ 9 - 0
PLCLinker/centralController/centralController.csproj

@@ -210,6 +210,12 @@
     <Compile Include="FormRecordsManager.Designer.cs">
       <DependentUpon>FormRecordsManager.cs</DependentUpon>
     </Compile>
+    <Compile Include="FormSysConfig.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FormSysConfig.Designer.cs">
+      <DependentUpon>FormSysConfig.cs</DependentUpon>
+    </Compile>
     <Compile Include="FormSysInfo.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -286,6 +292,9 @@
     <EmbeddedResource Include="FormRecordsManager.resx">
       <DependentUpon>FormRecordsManager.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FormSysConfig.resx">
+      <DependentUpon>FormSysConfig.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FormSysInfo.resx">
       <DependentUpon>FormSysInfo.cs</DependentUpon>
     </EmbeddedResource>

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

@@ -1 +1 @@
-f9b13c3d54a451bab9dae4aa07ecc7010b7042bd
+34c360fb20b62e50667afe432a7c5c55a98113c7

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

@@ -76,3 +76,4 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralControl
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\bin\Release\netstandard.dll
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\bin\Release\serversettings.json
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\bin\Release\Newtonsoft.Json.xml
+E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormSysConfig.resources

二进制
PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache