| | |
| | | |
| | | if (GlobalVar.dicCommunicators.ContainsKey(name)) |
| | | { |
| | | CommunicatorForm cameraForm = new CommunicatorForm(GlobalVar.dicCommunicators[name], name); |
| | | cameraForm.Show(); |
| | | CommunicatorForm communicatorFForm = new CommunicatorForm(GlobalVar.dicCommunicators[name], name); |
| | | communicatorFForm.CommunicatorChanged += CommunicatorFForm_CommunicatorChanged; |
| | | communicatorFForm.Show(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void CommunicatorFForm_CommunicatorChanged(BaseCommunicator communicator) |
| | | { |
| | | if (this.InvokeRequired) |
| | | { |
| | | this.Invoke(new Action<BaseCommunicator>(CommunicatorFForm_CommunicatorChanged), communicator); |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < uiFlowLayoutPanel1.Controls.Count; i++) |
| | | { |
| | | if (uiFlowLayoutPanel1.Controls[i] is UserItem flow && flow.Name == communicator.CommunicatorName) |
| | | { |
| | | string ClassName = communicator.GetType().Name; |
| | | string IP = communicator.CommunicatorConnections["地址"].ToString(); |
| | | string PORT = communicator.CommunicatorConnections["端口"].ToString(); |
| | | string DataType = communicator.CommunicatorConnections.Contains("数据类型") ? |
| | | communicator.CommunicatorConnections["数据类型"].ToString() : "String"; |
| | | |
| | | flow.Text = $"({ClassName}){IP}:{PORT} [{DataType}]"; |
| | | flow.Refresh(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 移除通讯口 |
| | | private void DeleteEvent(string Name, string Text) |
| | | { |