Browse Source

根据PLC流程修改停车完成读取方式,修改PLC掉线恢复提示

yc_t 6 năm trước cách đây
mục cha
commit
7fdee94a90
25 tập tin đã thay đổi với 295 bổ sung250 xóa
  1. 20 6
      PLCLinker/PLCConnector/Form1.cs
  2. BIN
      PLCLinker/PLCConnector/PLC/PLCS7.dll
  3. 1 1
      PLCLinker/PLCLinker/Program.cs
  4. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.exe
  5. BIN
      PLCLinker/PLCLinker/bin/Release/PLCLinker.pdb
  6. BIN
      PLCLinker/PLCLinker/bin/Release/PLCS7.dll
  7. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.csprojResolveAssemblyReference.cache
  8. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.exe
  9. BIN
      PLCLinker/PLCLinker/obj/Release/PLCLinker.pdb
  10. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.dll
  11. BIN
      PLCLinker/PLCS7/bin/Release/PLCS7.pdb
  12. 17 9
      PLCLinker/PLCS7/entity.cs
  13. 1 1
      PLCLinker/PLCS7/obj/Release/PLCS7.csproj.FileListAbsolute.txt
  14. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.dll
  15. BIN
      PLCLinker/PLCS7/obj/Release/PLCS7.pdb
  16. 80 98
      PLCLinker/centralController/FormCentralController.Designer.cs
  17. 3 0
      PLCLinker/centralController/Monitor/Monitor.cs
  18. 173 135
      PLCLinker/centralController/Terminal/Terminal.cs
  19. BIN
      PLCLinker/centralController/bin/Release/centralController.exe
  20. BIN
      PLCLinker/centralController/bin/Release/centralController.pdb
  21. BIN
      PLCLinker/centralController/obj/Release/centralController.csproj.GenerateResource.Cache
  22. BIN
      PLCLinker/centralController/obj/Release/centralController.csprojResolveAssemblyReference.cache
  23. BIN
      PLCLinker/centralController/obj/Release/centralController.exe
  24. BIN
      PLCLinker/centralController/obj/Release/centralController.pdb
  25. BIN
      PLCLinker/centralController/sdk/PLC/PLCS7.dll

+ 20 - 6
PLCLinker/PLCConnector/Form1.cs

@@ -124,6 +124,10 @@ namespace PLCConnector
                 case "车位1":
                     type = PLCDataType.parkingSpace;
                     break;
+                case "车位2":
+                    type = PLCDataType.parkingSpace;
+                    offset += 36;
+                    break;
             }
             if (value < 32768)
             {
@@ -156,13 +160,16 @@ namespace PLCConnector
                 case "车位1":
                     type = PLCDataType.parkingSpace; id = 4;
                     break;
+                case "车位2":
+                    type = PLCDataType.parkingSpace; id = 5;
+                    break;
             }
             string result = "";
             try
             {
-                if (id == 4)
+                if (id >= 4)
                 {
-                    List<object> list = pl.ReadFromPLC(type, 1);
+                    List<object> list = pl.ReadFromPLC(type, id-3);
                     result = ((ParkingSpaceStru)list[0]).ToString();
                 }
                 else if (id > 0)
@@ -201,13 +208,17 @@ namespace PLCConnector
                 case "车位1":
                     type = PLCDataType.parkingSpace; id = 4;
                     break;
+                case "车位2":
+                    type = PLCDataType.parkingSpace; id = 5;
+                    break;
             }
             string result = "";
             try
             {
-                if (id == 4)
+                if (id >= 4)
                 {
-                    List<object> list = pl.ReadFromPLC(type, 1);
+                    List<object> list = pl.ReadFromPLC(type, id - 3);
+                    Console.WriteLine(list.Count());
                     result = ((ParkingSpaceStru)list[0]).ToString();
                 }
                 else if (id > 0)
@@ -246,13 +257,16 @@ namespace PLCConnector
                 case "车位1":
                     type = PLCDataType.parkingSpace; id = 4;
                     break;
+                case "车位2":
+                    type = PLCDataType.parkingSpace; id = 5;
+                    break;
             }
             string result = "";
             try
             {
-                if (id == 4)
+                if (id >= 4)
                 {
-                    List<object> list = pl.ReadFromPLC(type, 1);
+                    List<object> list = pl.ReadFromPLC(type, id - 3);
                     result = ((ParkingSpaceStru)list[0]).ToString();
                 }
                 else if (id > 0)

BIN
PLCLinker/PLCConnector/PLC/PLCS7.dll


+ 1 - 1
PLCLinker/PLCLinker/Program.cs

@@ -16,7 +16,7 @@ namespace PLCTest
     {
         static void Main(string[] args)
         {
-            PLCLinker pl = new PLCLinker(CpuType.S71500, "192.168.0.1", 0, 1, 18, 41, 20, 1, 200);
+            PLCLinker pl = new PLCLinker(CpuType.S71500, "192.168.10.60", 0, 1, 18, 41, 20, 1, 200);
             Random rnd = new Random();
             Task t = Task.Factory.StartNew(() =>
             {

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


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


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


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


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


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


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


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


+ 17 - 9
PLCLinker/PLCS7/entity.cs

@@ -72,9 +72,9 @@ namespace PLCS7
 
         public override string ToString()
         {
-            return "[终端id:" + terminalID + ",终端状态:" + terminalStatus + ",按钮状态:" + btnStatus + ",终端指令:" + cmd + ",用户id:" + licenseCodeA + ","
-                + licenseCodeB + "," + licenseCodeC + "," + licenseCodeD + ",凭证号:" + receiptNum + ",支付状态:" + paymentStatus
-                + ",号牌验证:" + licVerification + ",停车费用:" + parkingFee + ",用户类型:" + userType + ",地感信号:" + groundStatus + "]";
+            return "[终端id(0):" + terminalID + ",终端状态(2):" + terminalStatus + ",按钮状态(4):" + btnStatus + ",终端指令(6):" + cmd + ",用户id(8):" + licenseCodeA + ","
+                + licenseCodeB + "," + licenseCodeC + "," + licenseCodeD + ",凭证号(24):" + receiptNum + ",支付状态(28):" + paymentStatus
+                + ",号牌验证(30):" + licVerification + ",停车费用(32):" + parkingFee + ",用户类型(34):" + userType + ",地感信号(36):" + groundStatus +",X坐标(38):"+coordX+",Y坐标(40):"+coordY+"]";
         }
 
         public override bool Equals(object obj)
@@ -186,10 +186,10 @@ namespace PLCS7
 
         public override string ToString()
         {
-            return "[id:" + terminalID + ",号牌:" + numMachineLaunch + ",摆扫:" + sweepLaserLaunch + ",轮距:" + wheelbaseLaserLaunch + ",急停:" + stop
-                + ",就绪:" + ready + ",停车启动:" + parkingRunning + ",取车启动:" + fetchingRunning + ",流程完成:" + processCompleted + ",流程中止:" + 
-                processStopped + ",摆扫状态:" + sweepLaserStatus + ",轮距状态:"+wheelbaseLaserStatus+",号牌获取:" + licenseReceived
-                + ",本地自动:" + localAutoMode + ",远程模式:" + remoteMode + ",本地手动:" + localManualMode + "," + groundAStatus
+            return "[id(0):" + terminalID + ",号牌(2):" + numMachineLaunch + ",摆扫(4):" + sweepLaserLaunch + ",轮距(6):" + wheelbaseLaserLaunch + ",急停(8):" + stop
+                + ",就绪(10):" + ready + ",停车启动(12):" + parkingRunning + ",取车启动(14):" + fetchingRunning + ",流程完成(16):" + processCompleted + ",流程中止(18):" + 
+                processStopped + ",摆扫状态(20):" + sweepLaserStatus + ",轮距状态(22):"+wheelbaseLaserStatus+",号牌获取(52):" + licenseReceived
+                + ",本地自动(54):" + localAutoMode + ",远程模式(56):" + remoteMode + ",本地手动(58):" + localManualMode + "," + groundAStatus
                 + "," + groundBStatus + "," + groundCStatus + "," + arriveAAndOpen + "," + arriveBAndOpen + "," + arriveCAndOpen
                  + "]";
         }
@@ -255,10 +255,18 @@ namespace PLCS7
         /// </summary>
         public short rearWheelbase;
 
+        public short year;
+        public byte month;
+        public byte day;
+        public byte hour;
+        public byte minute;
+        public byte second;
+        public int manosecond;
+
         public override string ToString()
         {
-            return "[车位编号:" + parkingSpace + ",长:" + length + ",宽:" + width + ",高:" + height + ",楼层:" + floorNo + ",X坐标:" + coordX + ",Y坐标:" + coordY + ",凭证号:" + receiptNum
-                + ",车位状态:" + spaceStatus + ",前轮距:" + frontWheelbase + ",后轮距:" + rearWheelbase + "]";
+            return "[车位编号(0):" + parkingSpace + ",长(2):" + length + ",宽(4):" + width + ",高(6):" + height + ",楼层(8):" + floorNo + ",X坐标(10):" + coordX + ",Y坐标(12):" + coordY + ",凭证号(14):" + receiptNum
+                + ",车位状态(16):" + spaceStatus + ",前轮距(18):" + frontWheelbase + ",后轮距(20):" + rearWheelbase + "]";
         }
         public override int GetHashCode()
         {

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

@@ -2,7 +2,7 @@ E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\bin\Rele
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\bin\Release\PLCS7.dll
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\bin\Release\PLCS7.pdb
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\bin\Release\S7.Net.dll
-E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.csprojResolveAssemblyReference.cache
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.csproj.CoreCompileInputs.cache
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.dll
 E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.pdb
+E:\superScene\智能停车项目\智能停车项目v2.0\PLCLinker\PLCS7\obj\Release\PLCS7.csprojResolveAssemblyReference.cache

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


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


+ 80 - 98
PLCLinker/centralController/FormCentralController.Designer.cs

@@ -30,8 +30,6 @@
         {
             this.components = new System.ComponentModel.Container();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(centralController));
             this.dotNetBarManager1 = new DevComponents.DotNetBar.DotNetBarManager(this.components);
             this.dockSite4 = new DevComponents.DotNetBar.DockSite();
@@ -46,6 +44,7 @@
             this.textBox2 = new System.Windows.Forms.TextBox();
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.labelX1 = new DevComponents.DotNetBar.LabelX();
             this.dci_NumMachine = new DevComponents.DotNetBar.DockContainerItem();
             this.dci_payment = new DevComponents.DotNetBar.DockContainerItem();
@@ -105,6 +104,11 @@
             this.bar_shortcut = new DevComponents.DotNetBar.Bar();
             this.panel_freeSpace = new System.Windows.Forms.Panel();
             this.lbx_freeSpace = new DevComponents.DotNetBar.LabelX();
+            this.shortcut_login = new DevComponents.DotNetBar.ButtonItem();
+            this.shortcut_logout = 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();
@@ -114,18 +118,13 @@
             this.dockContainerItem1 = new DevComponents.DotNetBar.DockContainerItem();
             this.panelDockContainer8 = new DevComponents.DotNetBar.PanelDockContainer();
             this.controlContainerItem1 = new DevComponents.DotNetBar.ControlContainerItem();
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.shortcut_login = new DevComponents.DotNetBar.ButtonItem();
-            this.shortcut_logout = 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.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();
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).BeginInit();
             this.bar_bottom.SuspendLayout();
             this.RecordsMonitorPanel.SuspendLayout();
@@ -141,7 +140,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.bar_shortcut)).BeginInit();
             this.bar_shortcut.SuspendLayout();
             this.panel_freeSpace.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
             // dotNetBarManager1
@@ -211,9 +209,9 @@
             this.bar_mainWin.CanDockTop = false;
             this.bar_mainWin.CanHide = true;
             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.ParkingSpaceMonitorPanel);
+            this.bar_mainWin.Controls.Add(this.paymentPanel);
             this.bar_mainWin.DockTabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Top;
             this.bar_mainWin.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bar_mainWin.IsMaximized = false;
@@ -340,6 +338,14 @@
             this.tableLayoutPanel1.Size = new System.Drawing.Size(185, 168);
             this.tableLayoutPanel1.TabIndex = 3;
             // 
+            // pictureBox1
+            // 
+            this.pictureBox1.Location = new System.Drawing.Point(3, 36);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(179, 127);
+            this.pictureBox1.TabIndex = 2;
+            this.pictureBox1.TabStop = false;
+            // 
             // labelX1
             // 
             // 
@@ -424,14 +430,6 @@
             // dgvx_parkingRecords
             // 
             this.dgvx_parkingRecords.BackgroundColor = System.Drawing.SystemColors.ActiveCaption;
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvx_parkingRecords.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
             this.dgvx_parkingRecords.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.dgvx_parkingRecords.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.parkingRecordsID,
@@ -442,26 +440,18 @@
             this.realGetTime,
             this.receiptNum,
             this.parkingPrice});
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dgvx_parkingRecords.DefaultCellStyle = dataGridViewCellStyle2;
+            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.dgvx_parkingRecords.DefaultCellStyle = dataGridViewCellStyle1;
             this.dgvx_parkingRecords.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dgvx_parkingRecords.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
             this.dgvx_parkingRecords.Location = new System.Drawing.Point(0, 0);
             this.dgvx_parkingRecords.Name = "dgvx_parkingRecords";
-            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvx_parkingRecords.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
             this.dgvx_parkingRecords.RowTemplate.Height = 23;
             this.dgvx_parkingRecords.Size = new System.Drawing.Size(865, 189);
             this.dgvx_parkingRecords.TabIndex = 0;
@@ -734,8 +724,8 @@
             // 
             // bar_Menu
             // 
-            this.bar_Menu.AccessibleDescription = "bar1 (bar_Menu)";
-            this.bar_Menu.AccessibleName = "bar1";
+            this.bar_Menu.AccessibleDescription = "DotNetBar Bar (bar_Menu)";
+            this.bar_Menu.AccessibleName = "DotNetBar Bar";
             this.bar_Menu.AccessibleRole = System.Windows.Forms.AccessibleRole.MenuBar;
             this.bar_Menu.DockSide = DevComponents.DotNetBar.eDockSide.Top;
             this.bar_Menu.Font = new System.Drawing.Font("微软雅黑", 9F);
@@ -918,8 +908,8 @@
             // 
             // bar_shortcut
             // 
-            this.bar_shortcut.AccessibleDescription = "bar1 (bar_shortcut)";
-            this.bar_shortcut.AccessibleName = "bar1";
+            this.bar_shortcut.AccessibleDescription = "DotNetBar Bar (bar_shortcut)";
+            this.bar_shortcut.AccessibleName = "DotNetBar Bar";
             this.bar_shortcut.AccessibleRole = System.Windows.Forms.AccessibleRole.MenuBar;
             this.bar_shortcut.AutoHide = true;
             this.bar_shortcut.AutoHideAnimationTime = 300;
@@ -971,6 +961,56 @@
             this.lbx_freeSpace.Text = "currentFreeSpace";
             this.lbx_freeSpace.TextAlignment = System.Drawing.StringAlignment.Center;
             // 
+            // shortcut_login
+            // 
+            this.shortcut_login.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
+            this.shortcut_login.Image = global::centralController.Properties.Resources.pc;
+            this.shortcut_login.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
+            this.shortcut_login.Name = "shortcut_login";
+            this.shortcut_login.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
+            this.shortcut_login.ShowSubItems = false;
+            this.shortcut_login.Text = "登录";
+            // 
+            // shortcut_logout
+            // 
+            this.shortcut_logout.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
+            this.shortcut_logout.Image = global::centralController.Properties.Resources.monitor;
+            this.shortcut_logout.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
+            this.shortcut_logout.Name = "shortcut_logout";
+            this.shortcut_logout.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
+            this.shortcut_logout.ShowSubItems = false;
+            this.shortcut_logout.Text = "登出";
+            // 
+            // shortcut_sysInfo
+            // 
+            this.shortcut_sysInfo.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
+            this.shortcut_sysInfo.Image = global::centralController.Properties.Resources.sysExplain1;
+            this.shortcut_sysInfo.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
+            this.shortcut_sysInfo.Name = "shortcut_sysInfo";
+            this.shortcut_sysInfo.ShowSubItems = false;
+            this.shortcut_sysInfo.Text = "系统信息";
+            this.shortcut_sysInfo.Click += new System.EventHandler(this.shortcut_sysInfo_Click);
+            // 
+            // shortcut_about
+            // 
+            this.shortcut_about.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
+            this.shortcut_about.Image = global::centralController.Properties.Resources.about;
+            this.shortcut_about.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
+            this.shortcut_about.Name = "shortcut_about";
+            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.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
+            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;
@@ -1084,64 +1124,6 @@
             this.controlContainerItem1.MenuVisibility = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways;
             this.controlContainerItem1.Name = "controlContainerItem1";
             // 
-            // pictureBox1
-            // 
-            this.pictureBox1.Location = new System.Drawing.Point(3, 36);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(179, 127);
-            this.pictureBox1.TabIndex = 2;
-            this.pictureBox1.TabStop = false;
-            // 
-            // shortcut_login
-            // 
-            this.shortcut_login.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
-            this.shortcut_login.Image = global::centralController.Properties.Resources.pc;
-            this.shortcut_login.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
-            this.shortcut_login.Name = "shortcut_login";
-            this.shortcut_login.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
-            this.shortcut_login.ShowSubItems = false;
-            this.shortcut_login.Text = "登录";
-            // 
-            // shortcut_logout
-            // 
-            this.shortcut_logout.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
-            this.shortcut_logout.Image = global::centralController.Properties.Resources.monitor;
-            this.shortcut_logout.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
-            this.shortcut_logout.Name = "shortcut_logout";
-            this.shortcut_logout.PopupAnimation = DevComponents.DotNetBar.ePopupAnimation.None;
-            this.shortcut_logout.ShowSubItems = false;
-            this.shortcut_logout.Text = "登出";
-            // 
-            // shortcut_sysInfo
-            // 
-            this.shortcut_sysInfo.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
-            this.shortcut_sysInfo.Image = global::centralController.Properties.Resources.sysExplain1;
-            this.shortcut_sysInfo.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
-            this.shortcut_sysInfo.Name = "shortcut_sysInfo";
-            this.shortcut_sysInfo.ShowSubItems = false;
-            this.shortcut_sysInfo.Text = "系统信息";
-            this.shortcut_sysInfo.Click += new System.EventHandler(this.shortcut_sysInfo_Click);
-            // 
-            // shortcut_about
-            // 
-            this.shortcut_about.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
-            this.shortcut_about.Image = global::centralController.Properties.Resources.about;
-            this.shortcut_about.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
-            this.shortcut_about.Name = "shortcut_about";
-            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.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
-            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);
-            // 
             // centralController
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1171,6 +1153,7 @@
             this.testPanel.ResumeLayout(false);
             this.testPanel.PerformLayout();
             this.tableLayoutPanel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.bar_bottom)).EndInit();
             this.bar_bottom.ResumeLayout(false);
             this.RecordsMonitorPanel.ResumeLayout(false);
@@ -1186,7 +1169,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.bar_shortcut)).EndInit();
             this.bar_shortcut.ResumeLayout(false);
             this.panel_freeSpace.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);
 
         }

+ 3 - 0
PLCLinker/centralController/Monitor/Monitor.cs

@@ -97,12 +97,14 @@ namespace Monitor
         private void PLCUpdate()
         {
             int linkCount = 0;
+            bool disconnected = false;
             while (!isClosing)
             {
                 if (PLC != null)
                 {
                     if (PLC.isConnected)
                     {
+                        if (disconnected) {disconnected = false; AddNotification("PLC已重新连接连接"); }
                         linkCount = 0;
                         List<object> received = PLC.ReadFromPLC(PLCDataType.terminal, 0);
                         //首先获取所有终端信息
@@ -175,6 +177,7 @@ namespace Monitor
                         linkCount += 1;
                         if (linkCount == 1)
                         {
+                            disconnected = true;
                             AddNotification("PLC掉线,请检查连接");
                         }
                     }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 173 - 135
PLCLinker/centralController/Terminal/Terminal.cs


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


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


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


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


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


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


BIN
PLCLinker/centralController/sdk/PLC/PLCS7.dll