C3204
2026-01-07 75d1950a9c3d8a32090bd95cea271ec36e7c09dc
LB_VisionProcesses/Communicators/CommunicatorForm.cs
@@ -1,4 +1,7 @@
using System;
using LB_VisionProcesses.Communicators.SiemensS7;
using LB_VisionProcesses.Communicators.TCom;
using RJCP.IO.Ports;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
@@ -11,8 +14,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LB_VisionProcesses.Communicators.TCom;
using RJCP.IO.Ports;
namespace LB_VisionProcesses.Communicators
{
@@ -84,6 +85,7 @@
                cmbType.Text = type.ToString();
                ckbRuleCheck.Checked = bRuleCheck;
                txtMsg.Text = Msg;
                this.grpSetting.ForeColor= SystemColors.Control;
            }
        }
@@ -114,12 +116,16 @@
                cmbIP.Visible = true;
                txtIP.Visible = false;
                this.lblAddress.Visible = false;
                this.txtAddress.Visible = false;
                lblIP.Text = "串口号";
                lblIP.Text = "波特率";
                cmbIP.Text = communicator.CommunicatorConnections["地址"].ToString();
                txtPort.Text = communicator.CommunicatorConnections["端口"].ToString();
                this.grpSetting.ForeColor = SystemColors.Control;
            }
            else if (communicator is LocalMonitor)
            {
@@ -128,17 +134,40 @@
                cmbIP.Visible = false;
                txtIP.Visible = true;
                this.lblAddress.Visible = false;
                this.txtAddress.Visible = false;
                lblIP.Text = "监控文件";
                lblIP.Text = "写入文件";
                txtIP.Text = communicator.CommunicatorConnections["地址"].ToString();
                txtPort.Text = communicator.CommunicatorConnections["端口"].ToString();
                this.grpSetting.ForeColor = SystemColors.Control;
            }
            else if (communicator is SiemensLBS7)
            {
                btnSend.Enabled = communicator.bConnected;
                cmbIP.Visible = false;
                txtIP.Visible = true;
                this.lblAddress.Visible = true;
                this.txtAddress.Visible = true;
                lblIP.Text = "IP";
                lblIP.Text = "槽";
                txtIP.Text = communicator.CommunicatorConnections["地址"].ToString();
                txtPort.Text = communicator.CommunicatorConnections["端口"].ToString();
                this.txtAddress.Text = communicator.CommunicatorConnections["变量地址"]?.ToString();
                this.grpSetting.ForeColor = SystemColors.Control;
                btnRuleSend.Visible = false;
            }
            else
            {
                btnSend.Enabled = communicator.bConnected;
                btnRuleSend.Enabled = false;
                this.lblAddress.Visible = false;
                this.txtAddress.Visible = false;
                cmbIP.Visible = false;
                txtIP.Visible = true;