ソースを参照

号牌机点击放大观察功能,号牌机显示根据个数动态调整

yc_t 6 年 前
コミット
be1e82bb3a

+ 2 - 2
PLCLinker/centralController/App.config

@@ -12,8 +12,8 @@
     <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"/>
     <!--号牌机信息-->
-    <add key="192.168.10.62" value="2"/>
-    <add key="192.168.0.21" value="1"/>
+    <add key="192.168.10.62" value="1"/>
+    <add key="192.168.10.61" value="2"/>
     <add key="filterRatio" value="0.7"/>
     <!--PLC基本配置-->
     <!--<add key="PLC_ip_address" value="192.168.0.10" />-->

+ 70 - 70
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -35,10 +35,6 @@
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
             this.dockSite_mainView = new DevComponents.DotNetBar.DockSite();
             this.bar_mainWin = new DevComponents.DotNetBar.Bar();
-            this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
-            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
-            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.testPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.button1 = new System.Windows.Forms.Button();
             this.textBox2 = new System.Windows.Forms.TextBox();
@@ -46,6 +42,10 @@
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
+            this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
@@ -106,9 +106,9 @@
             this.lbx_freeSpace = new DevComponents.DotNetBar.LabelX();
             this.shortcut_login = new DevComponents.DotNetBar.ButtonItem();
             this.shortcut_logout = new DevComponents.DotNetBar.ButtonItem();
-            this.shortcut_close = new DevComponents.DotNetBar.ButtonItem();
             this.shortcut_sysInfo = new DevComponents.DotNetBar.ButtonItem();
             this.shortcut_about = new DevComponents.DotNetBar.ButtonItem();
+            this.shortcut_close = new DevComponents.DotNetBar.ButtonItem();
             this.dockSite3 = new DevComponents.DotNetBar.DockSite();
             this.panelDockContainer10 = new DevComponents.DotNetBar.PanelDockContainer();
             this.dockContainerItem2 = new DevComponents.DotNetBar.DockContainerItem();
@@ -121,10 +121,10 @@
             this.dockSite_mainView.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).BeginInit();
             this.bar_mainWin.SuspendLayout();
-            this.NumMachineMonitorPanel.SuspendLayout();
             this.testPanel.SuspendLayout();
             this.tableLayoutPanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+            this.NumMachineMonitorPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).BeginInit();
             this.bar_bottom.SuspendLayout();
             this.RecordsMonitorPanel.SuspendLayout();
@@ -208,10 +208,10 @@
             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.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.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;
@@ -223,7 +223,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(524, 345);
             this.bar_mainWin.Stretch = true;
@@ -232,56 +232,6 @@
             this.bar_mainWin.TabNavigation = true;
             this.bar_mainWin.TabStop = false;
             // 
-            // NumMachineMonitorPanel
-            // 
-            this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
-            this.NumMachineMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.NumMachineMonitorPanel.Location = new System.Drawing.Point(3, 28);
-            this.NumMachineMonitorPanel.Name = "NumMachineMonitorPanel";
-            this.NumMachineMonitorPanel.Size = new System.Drawing.Size(518, 314);
-            this.NumMachineMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.NumMachineMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.NumMachineMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.NumMachineMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.NumMachineMonitorPanel.Style.GradientAngle = 90;
-            this.NumMachineMonitorPanel.TabIndex = 0;
-            // 
-            // flowLayoutPanel1
-            // 
-            this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
-            this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
-            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
-            this.flowLayoutPanel1.Size = new System.Drawing.Size(518, 314);
-            this.flowLayoutPanel1.TabIndex = 1;
-            this.flowLayoutPanel1.Resize += new System.EventHandler(this.flowLayoutPanel1_Resize);
-            // 
-            // paymentPanel
-            // 
-            this.paymentPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.paymentPanel.Location = new System.Drawing.Point(3, 28);
-            this.paymentPanel.Name = "paymentPanel";
-            this.paymentPanel.Size = new System.Drawing.Size(518, 314);
-            this.paymentPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.paymentPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.paymentPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.paymentPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.paymentPanel.Style.GradientAngle = 90;
-            this.paymentPanel.TabIndex = 24;
-            // 
-            // ParkingSpaceMonitorPanel
-            // 
-            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
-            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
-            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(518, 314);
-            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
-            this.ParkingSpaceMonitorPanel.TabIndex = 9;
-            // 
             // testPanel
             // 
             this.testPanel.Controls.Add(this.button1);
@@ -359,6 +309,56 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
+            // NumMachineMonitorPanel
+            // 
+            this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
+            this.NumMachineMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.NumMachineMonitorPanel.Location = new System.Drawing.Point(3, 28);
+            this.NumMachineMonitorPanel.Name = "NumMachineMonitorPanel";
+            this.NumMachineMonitorPanel.Size = new System.Drawing.Size(518, 314);
+            this.NumMachineMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.NumMachineMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.NumMachineMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.NumMachineMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.NumMachineMonitorPanel.Style.GradientAngle = 90;
+            this.NumMachineMonitorPanel.TabIndex = 0;
+            // 
+            // flowLayoutPanel1
+            // 
+            this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
+            this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+            this.flowLayoutPanel1.Size = new System.Drawing.Size(518, 314);
+            this.flowLayoutPanel1.TabIndex = 1;
+            this.flowLayoutPanel1.Resize += new System.EventHandler(this.flowLayoutPanel1_Resize);
+            // 
+            // paymentPanel
+            // 
+            this.paymentPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.paymentPanel.Location = new System.Drawing.Point(3, 28);
+            this.paymentPanel.Name = "paymentPanel";
+            this.paymentPanel.Size = new System.Drawing.Size(518, 314);
+            this.paymentPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.paymentPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.paymentPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.paymentPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.paymentPanel.Style.GradientAngle = 90;
+            this.paymentPanel.TabIndex = 24;
+            // 
+            // ParkingSpaceMonitorPanel
+            // 
+            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
+            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
+            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(518, 314);
+            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
+            this.ParkingSpaceMonitorPanel.TabIndex = 9;
+            // 
             // dci_NumMachine
             // 
             this.dci_NumMachine.Control = this.NumMachineMonitorPanel;
@@ -979,16 +979,6 @@
             this.shortcut_logout.ShowSubItems = false;
             this.shortcut_logout.Text = "登出";
             // 
-            // shortcut_close
-            // 
-            this.shortcut_close.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
-            this.shortcut_close.Image = global::centralController.Properties.Resources.close;
-            this.shortcut_close.Name = "shortcut_close";
-            this.shortcut_close.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
-            this.shortcut_close.ShowSubItems = false;
-            this.shortcut_close.Text = "退出";
-            this.shortcut_close.Click += new System.EventHandler(this.shortcut_close_Click);
-            // 
             // shortcut_sysInfo
             // 
             this.shortcut_sysInfo.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
@@ -1006,6 +996,16 @@
             this.shortcut_about.ShowSubItems = false;
             this.shortcut_about.Text = "关于我们";
             // 
+            // shortcut_close
+            // 
+            this.shortcut_close.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
+            this.shortcut_close.Image = global::centralController.Properties.Resources.close;
+            this.shortcut_close.Name = "shortcut_close";
+            this.shortcut_close.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
+            this.shortcut_close.ShowSubItems = false;
+            this.shortcut_close.Text = "退出";
+            this.shortcut_close.Click += new System.EventHandler(this.shortcut_close_Click);
+            // 
             // dockSite3
             // 
             this.dockSite3.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
@@ -1144,11 +1144,11 @@
             this.dockSite_mainView.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_mainWin)).EndInit();
             this.bar_mainWin.ResumeLayout(false);
-            this.NumMachineMonitorPanel.ResumeLayout(false);
             this.testPanel.ResumeLayout(false);
             this.testPanel.PerformLayout();
             this.tableLayoutPanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+            this.NumMachineMonitorPanel.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).EndInit();
             this.bar_bottom.ResumeLayout(false);
             this.RecordsMonitorPanel.ResumeLayout(false);

+ 34 - 33
PLCLinker/centralController/FormCentralController.cs

@@ -64,8 +64,6 @@ namespace centralController
             freeSpaceTimer.Interval = 1000;
             freeSpaceTimer.Tick += new EventHandler(UpdateFreeSpace);
             freeSpaceTimer.Start();
-
-            UpdateBasicInfo();
             tbx_notification.Text = "";
         }
 
@@ -95,10 +93,7 @@ namespace centralController
                     {
                         textBox2.Text = license;
                     }
-
                 });
-
-
             }
         }
         #endregion
@@ -160,6 +155,22 @@ namespace centralController
             Form_paymentScheme form_PaymentScheme = new Form_paymentScheme();
             form_PaymentScheme.ShowDialog();
         }
+        /// <summary>
+        /// 手动更新广告
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btn_advertUpdate_Click(object sender, EventArgs e)
+        {
+            if (Monitor.Monitor.advertMgr != null)
+            {
+                if (Monitor.Monitor.advertMgr.UpdateAdvert())
+                    MessageBox.Show("更新成功", "提示");
+                else
+                    MessageBox.Show("更新失败,请稍后重试", "提示");
+            }
+
+        }
         #endregion
 
         #region 视图
@@ -377,15 +388,6 @@ namespace centralController
             catch (Exception e) { Console.WriteLine("导出excel文件异常," + e.Message); }
 
         }
-        /// <summary>
-        /// 更新基本信息
-        /// </summary>
-        private void UpdateBasicInfo()
-        {
-            //string sysInfo = Monitor.Monitor.GetSysInfo();
-            //tbx_sysInfo.Text = sysInfo;
-            //tbx_sysInfo.ScrollToCaret();
-        }
 
         /// <summary>
         /// 动态调整号牌机界面
@@ -397,21 +399,21 @@ namespace centralController
             Control.ControlCollection flpCC = flowLayoutPanel1.Controls;
             try
             {
+                int rows = (int)Math.Sqrt(flowLayoutPanel1.Controls.Count + 1);
+                int columns = (int)(flowLayoutPanel1.Controls.Count * 1.0 / rows + 1);
                 for (int i = 0; i < flpCC.Count; i++)
                 {
-                    flpCC[i].Width = (int)(flowLayoutPanel1.Width * 0.3);
-                    flpCC[i].Height = (int)(flowLayoutPanel1.Height * 0.49);
+                    flpCC[i].Width = (int)(flowLayoutPanel1.Width * 1.0 / (columns * 1.1));
+                    flpCC[i].Height = (int)(flowLayoutPanel1.Height * 1.0 / (rows * 1.15));
                     Console.WriteLine("flp::" + flowLayoutPanel1.Width + "," + flowLayoutPanel1.Height);
                     //Console.WriteLine("tlp--"+flpCC[i].Width + "," + flpCC[i].Height);
                     Control.ControlCollection tlpCC = flpCC[i].Controls;
                     if (tlpCC.Count == 2)
                     {
-                        tlpCC[0].Width = flpCC[i].Width - 5;
+                        tlpCC[0].Width = (int)(flpCC[i].Width * 0.95);
                         tlpCC[0].Height = (int)(flpCC[i].Height * 0.79);
-                        tlpCC[1].Width = flpCC[i].Width - 5;
-                        tlpCC[1].Height = (int)(flpCC[i].Height * 0.19);
-                        //Console.WriteLine(tlpCC[0].Width + "," + tlpCC[0].Height);
-                        //Console.WriteLine(tlpCC[1].Width + "," + tlpCC[1].Height);
+                        tlpCC[1].Width = (int)(flpCC[i].Width*0.95);
+                        tlpCC[1].Height = (int)(flpCC[i].Height * 0.20);
                     }
                 }
             }
@@ -437,11 +439,20 @@ namespace centralController
             }
         }
 
+        #region 帮助
+        /// <summary>
+        /// 系统信息
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void btn_sysInfo_Click(object sender, EventArgs e)
         {
             FormSysInfo sysInfo = new FormSysInfo(Monitor.Monitor.GetSysInfo());
             sysInfo.ShowDialog();
         }
+        #endregion
+
+        #region 快捷菜单栏
 
         private void shortcut_sysInfo_Click(object sender, EventArgs e)
         {
@@ -449,21 +460,11 @@ namespace centralController
             sysInfo.ShowDialog();
         }
 
-        private void btn_advertUpdate_Click(object sender, EventArgs e)
-        {
-            if (Monitor.Monitor.advertMgr != null)
-            {
-                if (Monitor.Monitor.advertMgr.UpdateAdvert())
-                    MessageBox.Show("更新成功","提示");
-                else
-                    MessageBox.Show("更新失败,请稍后重试", "提示");
-            }
-            
-        }
-
         private void shortcut_close_Click(object sender, EventArgs e)
         {
             Close();
         }
+        # endregion
+
     }
 }

+ 48 - 0
PLCLinker/centralController/FormNumberMachinePreview.Designer.cs

@@ -0,0 +1,48 @@
+namespace centralController
+{
+    partial class FormNumberMachinePreview
+    {
+        /// <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.SuspendLayout();
+            // 
+            // FormNumberMachinePreview
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+            this.ClientSize = new System.Drawing.Size(530, 390);
+            this.Name = "FormNumberMachinePreview";
+            this.Text = "FormNumberMachinePreview";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormNumberMachinePreview_FormClosing);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 35 - 0
PLCLinker/centralController/FormNumberMachinePreview.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace centralController
+{
+    public partial class FormNumberMachinePreview : Form
+    {
+        TableLayoutPanel tlp;
+        PictureBox pb;
+        public FormNumberMachinePreview(string title,PictureBox pb,TableLayoutPanel tlp)
+        {
+            InitializeComponent();
+            this.Text = title;
+            pb.Dock = System.Windows.Forms.DockStyle.Fill;
+            Controls.Add(pb);
+            this.tlp = tlp;
+            this.pb = pb;
+        }
+
+        private void FormNumberMachinePreview_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            if (tlp != null && pb != null)
+            {
+                tlp.Controls.Add(pb, 0, 1);
+            }
+        }
+    }
+}

+ 120 - 0
PLCLinker/centralController/FormNumberMachinePreview.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>

+ 65 - 23
PLCLinker/centralController/NumMachine/NumMachine.cs

@@ -1,17 +1,17 @@
-using System;
+using centralController;
+using parkMonitor.entity;
+using System;
 using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
 using System.Drawing;
-using System.Windows.Forms;
-using System.Threading;
-using System.Collections;
-using VzClientSDKDemo;
-using System.Runtime.InteropServices;
 using System.IO;
 using System.Net;
-using parkMonitor.entity;
-using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Threading;
 using System.Threading.Tasks;
-using System.Configuration;
+using System.Windows.Forms;
+using VzClientSDKDemo;
 
 namespace NumMachine
 {
@@ -249,9 +249,9 @@ namespace NumMachine
                 return;
             }
             int handle = 0;
-            
+
             handle = VzClientSDK.VzLPRClient_Open(ip, (ushort)80, "admin", "admin");
-            
+
             if (handle == 0)
             {
                 return;
@@ -330,7 +330,7 @@ namespace NumMachine
                                     if (!namePicMap.ContainsKey(str) && handleCallbackMap.ContainsKey(handle))
                                     {
                                         IntPtr pic;
-                                        if (CreatePic(i,handle, out pic))
+                                        if (CreatePic(i, handle, out pic))
                                         {
                                             devPicMap.Add(handle, pic);
                                             //ipIdMap.Add(Get_IP(handle), i);
@@ -583,7 +583,7 @@ namespace NumMachine
         }
 
         ///<summary>创建新pic并记录在picNameMap</summary>
-        private bool CreatePic(int index,int handle, out IntPtr pic)
+        private bool CreatePic(int index, int handle, out IntPtr pic)
         {
             pic = IntPtr.Zero;
             PictureBox pb = new PictureBox
@@ -618,25 +618,67 @@ namespace NumMachine
                         {
                             Text = "编号" + id + "\nIP:" + ip,
                             TextAlign = ContentAlignment.MiddleCenter,
-                            Size = new Size(179,27)
+                            Size = new Size(179, 27)
                         };
+                        //temp.Dock = DockStyle.Bottom;
+                        //lb_numMachine.Dock = DockStyle.Top;
                         tlp.Controls.Add(temp, 0, 1);
                         tlp.Controls.Add(lb_numMachine, 0, 0);
                         tlp.RowStyles.Add(new RowStyle(SizeType.Percent, 20.00f));
                         tlp.RowStyles.Add(new RowStyle(SizeType.Percent, 80.00f));
-                        
-                        //tlp.Click += delegate(object o, EventArgs e){ };
+
+                        temp.Click += delegate (object o, EventArgs e)
+                        {
+                            //Console.WriteLine(((PictureBox)o).TopLevelControl.Name+","+e.ToString());
+                            try
+                            {
+                                if (((PictureBox)o).TopLevelControl.Name != "FormNumberMachinePreview")
+                                {
+                                    FormNumberMachinePreview form = new FormNumberMachinePreview("编号" + id + ", IP:" + ip, temp, tlp);
+                                    form.ShowDialog();
+                                }
+                            }
+                            catch { }
+                        };
                         //Control.FromHandle(flowLayoutPanel1).Controls.Add(temp);
                         if (flp.InvokeRequired)
                         {
-                            flp.Invoke(new Action(() => {
-                                tlp.Width = (int)(flp.Width * 0.3);
-                                tlp.Height = (int)(flp.Height * 0.49);
-                                temp.Width = tlp.Width - 5;
-                                temp.Height = (int)(tlp.Height * 0.79);
-                                lb_numMachine.Width = tlp.Width - 5;
-                                lb_numMachine.Height = (int)(tlp.Height * 0.19);
+                            flp.Invoke(new Action(() =>
+                            {
                                 flp.Controls.Add(tlp);
+                                //for (int i = 0; i < 12; i++)
+                                //{
+                                //    TableLayoutPanel tlpTemp = new TableLayoutPanel();
+                                //    tlpTemp.Width = 200;
+                                //    tlpTemp.Height = 200;
+                                //    flp.Controls.Add(tlpTemp);
+                                //}
+                                Control.ControlCollection flpCC = flp.Controls;
+                                try
+                                {
+                                    int rows = (int)Math.Sqrt(flp.Controls.Count + 1);
+                                    int columns = (int)(flp.Controls.Count * 1.0 / rows + 1);
+                                    //tlp.Width = (int)(flp.Width * 1.0 / (columns * 1.05));
+                                    //tlp.Height = (int)(flp.Height * 1.0 / (rows * 1.05));
+                                    
+                                    for (int i = 0; i < flpCC.Count; i++)
+                                    {
+                                        flpCC[i].Width = (int)(flp.Width * 1.0 / (columns * 1.1));
+                                        flpCC[i].Height = (int)(flp.Height * 1.0 / (rows * 1.15));
+                                        Console.WriteLine("flp::" + flp.Width + "," + flp.Height);
+                                        //Console.WriteLine("tlp--"+flpCC[i].Width + "," + flpCC[i].Height);
+                                        Control.ControlCollection tlpCC = flpCC[i].Controls;
+                                        if (tlpCC.Count == 2)
+                                        {
+                                            tlpCC[0].Width = (int)(flpCC[i].Width * 0.95);
+                                            tlpCC[0].Height = (int)(flpCC[i].Height * 0.79);
+                                            tlpCC[1].Width = (int)(flpCC[i].Width * 0.95);
+                                            tlpCC[1].Height = (int)(flpCC[i].Height * 0.20);
+                                        }
+                                    }
+                                    lb_numMachine.BackColor = Color.BurlyWood;
+                                }
+                                catch (Exception ex) { Console.WriteLine(ex.Message); }
                                 picHandle = temp.Handle;
                             }));
                         }

+ 6 - 6
PLCLinker/centralController/Terminal/Terminal.cs

@@ -453,7 +453,6 @@ namespace Terminal
                                     numReceivedStatus = 1;
                                     ts.licVerification = 1;
                                     Monitor.Monitor.PLC.WriteToPLC(ts, PLCDataType.central);
-
                                 }
                                 //无论是否注册,皆告知PLC,已获取号牌或比对异常、终止流程
                                 MainBlockStru mb = new MainBlockStru
@@ -462,11 +461,11 @@ namespace Terminal
                                 };
                                 Monitor.Monitor.PLC.WriteToPLC(mb, PLCDataType.central);
                                 //号牌获取结果被清零才跳出
-                                Monitor.Monitor.AddNotification("已写入号牌获取结果,等待号牌机启动指令清零");
-                                while (Monitor.Monitor.mainBlockInfo.numMachineLaunch != 0)
-                                {
-                                    Thread.Sleep(2000);
-                                }
+                                Monitor.Monitor.AddNotification("已写入号牌获取结果,等待号牌机启动指令清零"); 
+                            }
+                            while (Monitor.Monitor.mainBlockInfo.numMachineLaunch != 0)
+                            {
+                                Thread.Sleep(1000);
                             }
                         }
                     }
@@ -711,6 +710,7 @@ namespace Terminal
             //取车状态、凭证号不为空,查询数据库计费
             if (termIndex != -1 && termUsedMap.Count >= termIndex && termUsedMap.TryGetValue(termIndex, out bool value) && !value && fetchState == 1 && receiptNum != 0)
             {
+                fetchState = Monitor.Monitor.mainBlockInfo.fetchingRunning;
                 Monitor.Monitor.AddNotification("取车流程,准备计算费用");
                 termUsedMap[termIndex] = true;
                 Console.WriteLine("终端编号" + termIndex);

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


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

@@ -12,8 +12,8 @@
     <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"/>
     <!--号牌机信息-->
-    <add key="192.168.10.62" value="2"/>
-    <add key="192.168.0.21" value="1"/>
+    <add key="192.168.10.62" value="1"/>
+    <add key="192.168.10.61" value="2"/>
     <add key="filterRatio" value="0.7"/>
     <!--PLC基本配置-->
     <!--<add key="PLC_ip_address" value="192.168.0.10" />-->

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


+ 9 - 0
PLCLinker/centralController/centralController.csproj

@@ -131,6 +131,12 @@
     <Compile Include="FormModbus\VideoCfg_Form.designer.cs">
       <DependentUpon>VideoCfg_Form.cs</DependentUpon>
     </Compile>
+    <Compile Include="FormNumberMachinePreview.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FormNumberMachinePreview.Designer.cs">
+      <DependentUpon>FormNumberMachinePreview.cs</DependentUpon>
+    </Compile>
     <Compile Include="FormSysInfo.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -198,6 +204,9 @@
     <EmbeddedResource Include="FormModbus\VideoCfg_Form.resx">
       <DependentUpon>VideoCfg_Form.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FormNumberMachinePreview.resx">
+      <DependentUpon>FormNumberMachinePreview.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FormSysInfo.resx">
       <DependentUpon>FormSysInfo.cs</DependentUpon>
     </EmbeddedResource>

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

@@ -1 +1 @@
-dbc811bc241653ecd4d999dbd71ececc366f9c90
+c44e0950ad3b7a34adfb92b11721256bb9d46263

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

@@ -30,3 +30,4 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralControl
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.exe
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.pdb
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.csprojResolveAssemblyReference.cache
+E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\centralController\obj\Release\centralController.FormNumberMachinePreview.resources

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


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


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