Forráskód Böngészése

添加界面提示

yc_t 6 éve
szülő
commit
c50a171005

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


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


+ 38 - 6
PLCLinker/PLCConnector/Form1.Designer.cs

@@ -57,6 +57,8 @@
             this.button7 = new System.Windows.Forms.Button();
             this.button8 = new System.Windows.Forms.Button();
             this.button9 = new System.Windows.Forms.Button();
+            this.button10 = new System.Windows.Forms.Button();
+            this.button11 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -87,6 +89,7 @@
             this.textBox2.Name = "textBox2";
             this.textBox2.Size = new System.Drawing.Size(121, 21);
             this.textBox2.TabIndex = 2;
+            this.textBox2.Text = "2";
             // 
             // groupBox1
             // 
@@ -110,6 +113,7 @@
             this.textBox4.Name = "textBox4";
             this.textBox4.Size = new System.Drawing.Size(121, 21);
             this.textBox4.TabIndex = 7;
+            this.textBox4.Text = "中控";
             // 
             // button1
             // 
@@ -136,6 +140,7 @@
             this.textBox3.Name = "textBox3";
             this.textBox3.Size = new System.Drawing.Size(121, 21);
             this.textBox3.TabIndex = 3;
+            this.textBox3.Text = "0";
             // 
             // groupBox2
             // 
@@ -156,6 +161,7 @@
             this.textBox5.Name = "textBox5";
             this.textBox5.Size = new System.Drawing.Size(121, 21);
             this.textBox5.TabIndex = 8;
+            this.textBox5.Text = "中控";
             // 
             // button2
             // 
@@ -204,6 +210,7 @@
             this.textBox6.Name = "textBox6";
             this.textBox6.Size = new System.Drawing.Size(121, 21);
             this.textBox6.TabIndex = 8;
+            this.textBox6.Text = "终端1";
             // 
             // button3
             // 
@@ -252,6 +259,7 @@
             this.textBox8.Name = "textBox8";
             this.textBox8.Size = new System.Drawing.Size(121, 21);
             this.textBox8.TabIndex = 8;
+            this.textBox8.Text = "车位1";
             // 
             // button4
             // 
@@ -283,7 +291,7 @@
             // 
             // btn_clear
             // 
-            this.btn_clear.Location = new System.Drawing.Point(35, 297);
+            this.btn_clear.Location = new System.Drawing.Point(443, 459);
             this.btn_clear.Name = "btn_clear";
             this.btn_clear.Size = new System.Drawing.Size(75, 23);
             this.btn_clear.TabIndex = 10;
@@ -303,7 +311,7 @@
             // 
             // button5
             // 
-            this.button5.Location = new System.Drawing.Point(35, 326);
+            this.button5.Location = new System.Drawing.Point(622, 433);
             this.button5.Name = "button5";
             this.button5.Size = new System.Drawing.Size(93, 23);
             this.button5.TabIndex = 12;
@@ -313,7 +321,7 @@
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(35, 353);
+            this.button7.Location = new System.Drawing.Point(443, 430);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(75, 23);
             this.button7.TabIndex = 13;
@@ -323,7 +331,7 @@
             // 
             // button8
             // 
-            this.button8.Location = new System.Drawing.Point(35, 382);
+            this.button8.Location = new System.Drawing.Point(245, 430);
             this.button8.Name = "button8";
             this.button8.Size = new System.Drawing.Size(75, 23);
             this.button8.TabIndex = 14;
@@ -333,7 +341,7 @@
             // 
             // button9
             // 
-            this.button9.Location = new System.Drawing.Point(35, 411);
+            this.button9.Location = new System.Drawing.Point(245, 459);
             this.button9.Name = "button9";
             this.button9.Size = new System.Drawing.Size(75, 23);
             this.button9.TabIndex = 15;
@@ -341,11 +349,33 @@
             this.button9.UseVisualStyleBackColor = true;
             this.button9.Click += new System.EventHandler(this.button9_Click);
             // 
+            // button10
+            // 
+            this.button10.Location = new System.Drawing.Point(12, 297);
+            this.button10.Name = "button10";
+            this.button10.Size = new System.Drawing.Size(120, 23);
+            this.button10.TabIndex = 16;
+            this.button10.Text = "切换中控停取模式";
+            this.button10.UseVisualStyleBackColor = true;
+            this.button10.Click += new System.EventHandler(this.button10_Click);
+            // 
+            // button11
+            // 
+            this.button11.Location = new System.Drawing.Point(12, 326);
+            this.button11.Name = "button11";
+            this.button11.Size = new System.Drawing.Size(120, 23);
+            this.button11.TabIndex = 17;
+            this.button11.Text = "切换终端1停取模式";
+            this.button11.UseVisualStyleBackColor = true;
+            this.button11.Click += new System.EventHandler(this.button11_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(791, 474);
+            this.ClientSize = new System.Drawing.Size(803, 527);
+            this.Controls.Add(this.button11);
+            this.Controls.Add(this.button10);
             this.Controls.Add(this.button9);
             this.Controls.Add(this.button8);
             this.Controls.Add(this.button7);
@@ -401,6 +431,8 @@
         private System.Windows.Forms.Button button7;
         private System.Windows.Forms.Button button8;
         private System.Windows.Forms.Button button9;
+        private System.Windows.Forms.Button button10;
+        private System.Windows.Forms.Button button11;
     }
 }
 

+ 38 - 0
PLCLinker/PLCConnector/Form1.cs

@@ -354,5 +354,43 @@ namespace PLCConnector
                 
             }
         }
+        /// <summary>
+        /// 切换中控停取模式
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button10_Click(object sender, EventArgs e)
+        {
+            List<object> list = pl.ReadFromPLC(PLCDataType.central, 0);
+            short park = ((MainBlockStru)list[0]).parkingRunning;
+            if(park == (short)0)
+            {
+                pl.WriteAccordingToOffset(PLCDataType.central, 12, (short)1);
+                pl.WriteAccordingToOffset(PLCDataType.central, 14, (short)0);
+            }
+            else
+            {
+                pl.WriteAccordingToOffset(PLCDataType.central, 12, (short)0);
+                pl.WriteAccordingToOffset(PLCDataType.central, 14, (short)1);
+            }
+        }
+        /// <summary>
+        /// 切换终端停取模式
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button11_Click(object sender, EventArgs e)
+        {
+            List<object> list = pl.ReadFromPLC(PLCDataType.terminal, 1);
+            short termStatus = ((TerminalStru)list[0]).terminalStatus;
+            if (termStatus == (short)1)
+            {
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 2, (short)2);
+            }
+            else
+            {
+                pl.WriteAccordingToOffset(PLCDataType.terminal, 2, (short)1);
+            }
+        }
     }
 }

+ 79 - 37
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -29,14 +29,14 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
             this.dotNetBarManager1 = new DevComponents.DotNetBar.DotNetBarManager(this.components);
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
             this.dockSite9 = new DevComponents.DotNetBar.DockSite();
             this.bar2 = new DevComponents.DotNetBar.Bar();
-            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.NumMachineMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.testPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.button1 = new System.Windows.Forms.Button();
             this.textBox2 = new System.Windows.Forms.TextBox();
@@ -44,7 +44,7 @@
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
-            this.paymentPanel = new DevComponents.DotNetBar.PanelDockContainer();
+            this.ParkingSpaceMonitorPanel = new DevComponents.DotNetBar.PanelDockContainer();
             this.dci_ParkingSpace = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
@@ -97,6 +97,8 @@
             this.panelDockContainer7 = new DevComponents.DotNetBar.PanelDockContainer();
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
+            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+            this.tbx_notification = new DevComponents.DotNetBar.Controls.TextBoxX();
             this.dockSite9.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar2)).BeginInit();
             this.bar2.SuspendLayout();
@@ -116,6 +118,7 @@
             this.basicInfoPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar6)).BeginInit();
             this.bar6.SuspendLayout();
+            this.warningPanel.SuspendLayout();
             this.dockSite7.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bar1)).BeginInit();
             this.SuspendLayout();
@@ -188,9 +191,9 @@
             this.bar2.CanHide = true;
             this.bar2.CanUndock = false;
             this.bar2.Controls.Add(this.NumMachineMonitorPanel);
+            this.bar2.Controls.Add(this.ParkingSpaceMonitorPanel);
             this.bar2.Controls.Add(this.paymentPanel);
             this.bar2.Controls.Add(this.testPanel);
-            this.bar2.Controls.Add(this.ParkingSpaceMonitorPanel);
             this.bar2.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
             this.bar2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bar2.IsMaximized = false;
@@ -211,19 +214,6 @@
             this.bar2.TabNavigation = true;
             this.bar2.TabStop = false;
             // 
-            // ParkingSpaceMonitorPanel
-            // 
-            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
-            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
-            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
-            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(659, 377);
-            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
-            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
-            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
-            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
-            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
-            this.ParkingSpaceMonitorPanel.TabIndex = 9;
-            // 
             // NumMachineMonitorPanel
             // 
             this.NumMachineMonitorPanel.Controls.Add(this.flowLayoutPanel1);
@@ -240,6 +230,7 @@
             // 
             // 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";
@@ -247,8 +238,22 @@
             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(659, 377);
+            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;
+            // 
             // testPanel
             // 
+            this.testPanel.Controls.Add(this.tableLayoutPanel2);
             this.testPanel.Controls.Add(this.button1);
             this.testPanel.Controls.Add(this.textBox2);
             this.testPanel.Controls.Add(this.textBox1);
@@ -324,18 +329,18 @@
             this.labelX1.Text = "label1\r\nlable2";
             this.labelX1.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
-            // paymentPanel
+            // ParkingSpaceMonitorPanel
             // 
-            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(659, 377);
-            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;
+            this.ParkingSpaceMonitorPanel.DisabledBackColor = System.Drawing.Color.Empty;
+            this.ParkingSpaceMonitorPanel.Location = new System.Drawing.Point(3, 28);
+            this.ParkingSpaceMonitorPanel.Name = "ParkingSpaceMonitorPanel";
+            this.ParkingSpaceMonitorPanel.Size = new System.Drawing.Size(659, 377);
+            this.ParkingSpaceMonitorPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
+            this.ParkingSpaceMonitorPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
+            this.ParkingSpaceMonitorPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
+            this.ParkingSpaceMonitorPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
+            this.ParkingSpaceMonitorPanel.Style.GradientAngle = 90;
+            this.ParkingSpaceMonitorPanel.TabIndex = 9;
             // 
             // dci_ParkingSpace
             // 
@@ -416,14 +421,14 @@
             this.realGetTime,
             this.receiptNum,
             this.parkingPrice});
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridViewX1.DefaultCellStyle = dataGridViewCellStyle1;
+            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dataGridViewX1.DefaultCellStyle = dataGridViewCellStyle5;
             this.dataGridViewX1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dataGridViewX1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
             this.dataGridViewX1.Location = new System.Drawing.Point(0, 0);
@@ -622,6 +627,7 @@
             // 
             // tbx_sysInfo
             // 
+            this.tbx_sysInfo.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
             // 
             // 
             // 
@@ -680,6 +686,7 @@
             // 
             // warningPanel
             // 
+            this.warningPanel.Controls.Add(this.tbx_notification);
             this.warningPanel.DisabledBackColor = System.Drawing.Color.Empty;
             this.warningPanel.Location = new System.Drawing.Point(3, 23);
             this.warningPanel.Name = "warningPanel";
@@ -929,6 +936,38 @@
             this.panelDockContainer8.Style.GradientAngle = 90;
             this.panelDockContainer8.TabIndex = 37;
             // 
+            // tableLayoutPanel2
+            // 
+            this.tableLayoutPanel2.ColumnCount = 2;
+            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel2.Location = new System.Drawing.Point(343, 108);
+            this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+            this.tableLayoutPanel2.RowCount = 2;
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+            this.tableLayoutPanel2.Size = new System.Drawing.Size(200, 100);
+            this.tableLayoutPanel2.TabIndex = 7;
+            // 
+            // tbx_notification
+            // 
+            this.tbx_notification.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            // 
+            // 
+            // 
+            this.tbx_notification.Border.Class = "TextBoxBorder";
+            this.tbx_notification.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+            this.tbx_notification.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tbx_notification.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tbx_notification.Location = new System.Drawing.Point(0, 0);
+            this.tbx_notification.Multiline = true;
+            this.tbx_notification.Name = "tbx_notification";
+            this.tbx_notification.PreventEnterBeep = true;
+            this.tbx_notification.ReadOnly = true;
+            this.tbx_notification.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.tbx_notification.Size = new System.Drawing.Size(314, 391);
+            this.tbx_notification.TabIndex = 0;
+            // 
             // centralController
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -947,7 +986,7 @@
             this.Controls.Add(this.dockSite8);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.Name = "centralController";
-            this.Text = "Form1";
+            this.Text = "智象停车中控端";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.dockSite9.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar2)).EndInit();
@@ -969,6 +1008,7 @@
             this.basicInfoPanel.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar6)).EndInit();
             this.bar6.ResumeLayout(false);
+            this.warningPanel.ResumeLayout(false);
             this.dockSite7.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.bar1)).EndInit();
             this.ResumeLayout(false);
@@ -1044,6 +1084,8 @@
         private DevComponents.DotNetBar.Bar bar5;
         private DevComponents.DotNetBar.Bar bar6;
         private DevComponents.DotNetBar.Controls.TextBoxX tbx_sysInfo;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+        public DevComponents.DotNetBar.Controls.TextBoxX tbx_notification;
     }
 }
 

+ 17 - 6
PLCLinker/centralController/FormCentralController.cs

@@ -35,19 +35,30 @@ namespace centralController
                         temp = Monitor.Monitor.initializeState;
                         progressBar1.Invoke(new Action(() => { progressBar1.Value = temp * 20; }));
                     }
-                    if (temp == 5) { break; }
+                    if (temp == 5) {
+                        dataGridViewX1.Invoke(new Action(() => { RefreshRecords(null, null); }));
+                        break;
+                    }
                     Thread.Sleep(200);
                 }
             });
-            //TimerCallback tc = new TimerCallback(RefreshRecords);
-            //System.Threading.Timer t = new System.Threading.Timer(tc,null,5000,1000);
+            //定时器,定时更新提示信息
             System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
-            timer.Interval = 10000;
-            timer.Tick += new EventHandler(RefreshRecords);
+            timer.Interval = 1000;
+            timer.Tick += new EventHandler(UpdateText);
             timer.Start();
             UpdateBasicInfo();
+            tbx_notification.Text = "";
+        }
+        /// <summary>
+        /// 定时更新提示信息
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void UpdateText(object sender, EventArgs e)
+        {
+            tbx_notification.Text = Monitor.Monitor.GetNotification();
         }
-
         /// <summary>
         /// 结束按钮
         /// </summary>

+ 3 - 3
PLCLinker/centralController/FormCentralController.resx

@@ -120,6 +120,9 @@
   <metadata name="dotNetBarManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>58</value>
+  </metadata>
   <metadata name="parkingRecordsID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -144,7 +147,4 @@
   <metadata name="parkingPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>100</value>
-  </metadata>
 </root>

+ 59 - 7
PLCLinker/centralController/Monitor/Monitor.cs

@@ -12,6 +12,7 @@ using System.Data;
 using System.Diagnostics;
 using System.Management;
 using System.Net;
+using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 using WebServer;
@@ -81,6 +82,11 @@ namespace Monitor
         /// 车库ID
         /// </summary>
         public static int garageID;
+        /// <summary>
+        /// 将显示在界面的提示字符串
+        /// </summary>
+        private static Queue<string> notificationQueue = new Queue<string>();
+        private const int MAXLINES = 10;
 
         private void PLCUpdate()
         {
@@ -183,7 +189,7 @@ namespace Monitor
         /// <summary>
         /// 操作系统版本
         /// </summary>
-        public static string getOsVersion()
+        private static string getOsVersion()
         {
             string str = "Windows 10";
             try
@@ -207,7 +213,7 @@ namespace Monitor
         /// <summary>
         /// 显卡名
         /// </summary>
-        public static string getGPUName()
+        private static string getGPUName()
         {
             string result = "";
             try
@@ -231,7 +237,7 @@ namespace Monitor
         /// <summary>
         /// 获取系统内存大小
         /// </summary>
-        public static string getMenSize()
+        private static string getMenSize()
         {
             ManagementObjectSearcher searcher = new ManagementObjectSearcher();   //用于查询一些如系统信息的管理对象 
             searcher.Query = new SelectQuery("Win32_PhysicalMemory", "", new string[] { "Capacity" });//设置查询条件 
@@ -258,6 +264,8 @@ namespace Monitor
             return ((double)capacity / gb).ToString("0.0") + "GB";
         }
 
+
+
         //************************************ 公有方法 **********************************
         public Monitor(IntPtr flpHandle)
         {
@@ -285,7 +293,41 @@ namespace Monitor
         {
 
         }
+        /// <summary>
+        /// 获取提示信息
+        /// </summary>
+        /// <returns></returns>
+        public static string GetNotification()
+        {
+            StringBuilder notificationStr = new StringBuilder();
+            lock (notificationQueue)
+            {
+                Queue<string>.Enumerator notiEnumer = notificationQueue.GetEnumerator();
+                while (notiEnumer.MoveNext()) {
+                    notificationStr.Append(notiEnumer.Current);
+                }
+            }
+            return notificationStr.ToString();
+        }
 
+        public static void AddNotification(string notification)
+        {
+            string time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
+            string notificationStr = time + notification + "\r\n";
+            lock (notificationQueue)
+            {
+                int count = notificationQueue.Count;
+                if (count >= MAXLINES)
+                {
+                    notificationQueue.Dequeue();
+                }
+                notificationQueue.Enqueue(notificationStr);
+            }
+        }
+        /// <summary>
+        /// 返回系统信息字符串
+        /// </summary>
+        /// <returns></returns>
         public static string GetSysInfo()
         {
             string info = "";
@@ -305,7 +347,10 @@ namespace Monitor
             catch (Exception) { }
             return info;
         }
-
+        /// <summary>
+        /// 返回停车记录信息
+        /// </summary>
+        /// <returns></returns>
         public static List<object[]> GetParkingRecords()
         {
             DateTime now = DateTime.Now;
@@ -356,12 +401,17 @@ namespace Monitor
             result.Reverse();
             return result;
         }
-
+        /// <summary>
+        /// 返回预约记录信息
+        /// </summary>
+        /// <returns></returns>
         public static List<object[]> GetOrderRecords()
         {
             return null;
         }
-
+        /// <summary>
+        /// 系统初始化,启动plc监控
+        /// </summary>
         public void Start()
         {
             if (flpHandle != IntPtr.Zero)
@@ -383,7 +433,9 @@ namespace Monitor
                 });
             }
         }
-
+        /// <summary>
+        /// 系统停止
+        /// </summary>
         public void Stop()
         {
             sysInitializer.Stop();

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

@@ -121,7 +121,8 @@ namespace Monitor
             //Monitor.allInOneMachine.Play(2, BroadcastBoard.PlayMode.download, "date");
             //Monitor.allInOneMachine.Play(3, BroadcastBoard.PlayMode.download, "time");
             //Monitor.allInOneMachine.Refresh();
-
+            Monitor.AddNotification("哈哈哈哈哈");
+            Monitor.AddNotification("啊啊啊啊啊");
             Terminal.Terminal.Start();
             //系统初始化结束,进入状态5
             if (!initStatus) { return; }

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

@@ -62,16 +62,16 @@ namespace Terminal
             string provinceQuerySql = "select NumberPlateHeader from numberplatemapping where mappedString = " + province + ";";
             lock (Monitor.Monitor.localDBOper)
             {
-                object[] result = Monitor.Monitor.localDBOper.Query(provinceQuerySql);
-                //MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(provinceQuerySql);
+                //object[] result = Monitor.Monitor.localDBOper.Query(provinceQuerySql);
+                MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(provinceQuerySql);
                 try
                 {
-                    //if (reader != null && reader.Read() && reader.HasRows)
-                    //{
-                    //    province = reader.GetString("NumberPlateHeader");
-                    //    //Console.WriteLine(province);
-                    //}
-                    if (result!=null && result.Length > 0) { province = (string)result[0]; }
+                    if (reader != null && reader.Read() && reader.HasRows)
+                    {
+                        province = reader.GetString("NumberPlateHeader");
+                        //Console.WriteLine(province);
+                    }
+                    //if (result!=null && result.Length > 0) { province = (string)result[0]; }
                 }
                 catch { }
                 //if (reader != null)
@@ -91,34 +91,34 @@ namespace Terminal
             HashSet<int> recordsIDSet = new HashSet<int>();
             lock (Monitor.Monitor.localDBOper)
             {
-                object[] result = Monitor.Monitor.localDBOper.Query(findParkingSpace);
-                if(result!=null && result.Length > 0)
-                {
-                    for (int i = 0; i < result.Length; i++)
-                    {
-                        recordsIDSet.Add((int)result[i]);
-                    }
-                }
-                //MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(findParkingSpace);
-                //if (reader != null)
+                //object[] result = Monitor.Monitor.localDBOper.Query(findParkingSpace);
+                //if(result!=null && result.Length > 0)
                 //{
-                //    while (reader.Read())
+                //    for (int i = 0; i < result.Length; i++)
                 //    {
-                //        if (reader.HasRows)
-                //        {
-                //            recordsIDSet.Add(reader.GetInt32("parkingSpaceID"));
-                //        }
+                //        recordsIDSet.Add((int)result[i]);
                 //    }
                 //}
-                //try
-                //{
-                //    if (reader != null)
-                //    {
-                //        reader.Close();
-                //        reader.Dispose();
-                //    }
-                //}
-                //catch { }
+                MySqlDataReader reader = Monitor.Monitor.localDBOper.Query(findParkingSpace);
+                if (reader != null)
+                {
+                    while (reader.Read())
+                    {
+                        if (reader.HasRows)
+                        {
+                            recordsIDSet.Add(reader.GetInt32("parkingSpaceID"));
+                        }
+                    }
+                }
+                try
+                {
+                    if (reader != null)
+                    {
+                        reader.Close();
+                        reader.Dispose();
+                    }
+                }
+                catch { }
             }
             List<string> updateSpaceList = new List<string>();
             List<string> insertSpaceList = new List<string>();

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


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


+ 2 - 1
PLCLinker/centralController/centralController.csproj

@@ -37,7 +37,8 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>sdk\broadcast\broadcastDLL.dll</HintPath>
     </Reference>
-    <Reference Include="db">
+    <Reference Include="db, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
       <HintPath>sdk\mysql\db.dll</HintPath>
     </Reference>
     <Reference Include="DevComponents.DotNetBar.SuperGrid, Version=12.5.0.2, Culture=neutral, PublicKeyToken=c39c3242a43eee2b" />

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


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

@@ -1 +1 @@
-736407c1bb7205d83159d990240ecaf9ff4c65b4
+ec57ee3b8371b9008a7e95d2f89d9f907d88a07e

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


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


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