| LB_SmartVision/VisionForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/VisionForm.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVisionCommon/ConfigManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/BaseCommunicator.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/TCom/LocalMonitor.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/TCom/TCPClient.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/TCom/TCPServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/TCom/UARTPort.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Communicators/UserCommunicator/T306Command/T306CommandTool.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
LB_SmartVision/VisionForm.cs
@@ -852,7 +852,7 @@ string ClassName = match.Groups["ClassName"].Value; // "TCP" string IP = match.Groups["IP"].Value; // "127.0.0.1" string Slot = match.Groups["Slot"].Value; // "1111" string CpuType= match.Groups["CpuType"].Value; string CpuType = match.Groups["CpuType"].Value; string PlcAddress = match.Groups["PlcAddress"].Value; string DataType = match.Groups["DataType"].Success ? match.Groups["DataType"].Value : "String"; @@ -1029,7 +1029,6 @@ { string strJson = string.Empty; GlobalVar.allCommunicatorsConnectionString = new ConcurrentDictionary<string, string>(); foreach (var item in GlobalVar.dicCommunicators) { string ClassName = item.Value.GetType().FullName;// "TCP" @@ -1058,6 +1057,7 @@ string CommunicatorConnectionString = $"({ClassName})[{IP}][{PORT}]"; GlobalVar.allCommunicatorsConnectionString.TryAdd(item.Key, CommunicatorConnectionString); } GlobalVar.dicCommunicators[item.Key].ClassName = ClassName; } var settings = new JsonSerializerSettings { @@ -1082,6 +1082,11 @@ { } } File.WriteAllText(GlobalVar.allCommunicatorsConnectionStringPath, strJson, Encoding.UTF8); foreach (var item in GlobalVar.dicCommunicators) { string ClassName = item.Value.GetType().FullName;// "TCP" } ConfigManager<ObservableConcurrentDictionary<string, BaseCommunicator>>.SaveConfig<ObservableConcurrentDictionary<string, BaseCommunicator>>(GlobalVar.dicCommunicators, GlobalVar.strApplicationPath + "\\所有产品\\" + GlobalVar.strProductName + "\\dicCommunicators.json"); return true; } catch { return false; } LB_SmartVision/VisionForm.resx
@@ -121,24 +121,24 @@ <data name="theme_VisionForm.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO vAAADrwBlbxySQAAA+xJREFUWEftV0loFUkYbvcNFzJi0lWdBEPQruqXKEYdcRgz4AYqeplBwYiXEUVB UHAhCEG8iR509OBlmIsOjJ5EBvQSRVHzuvslxjAy8eCG+75GozF+f716L6873fqe2ykffDR59e9/1V8V ow99KARtUg72J5aypGNN8xy2yJPWcleylb5gS13HnJdy+KSW6uJx3b8ZA7TKl6PbMPq3SbMsBUcpyf/2 BP8PDh96kr32BX/rS/4O30789grfO1j/k4LQ6p8POO6XdFgpDNbDSZsn2Bt8u2MpWGdKsCPeBNMm3TZp FaUc6/cW20pQEtpsflCllmwxjDbpLKOd9vAZuBPOx5J+86TyMdDbBxsdYLsn+SpUZYQy/imQILLdBIP3 cxzEU7Dbns3WejXmcNK/NPGHkajabtUiLYO/nyOgXWdRFeUkDmdnWMOg2ACFFwEn8fzfFeaSxlpjIOlT EHC0HVm/CstSC13B93sVFaOVszDQpwGuYGtQLipnQDlMyLzH12t2zJ8adH/TbeMbVLYROmmyDvjYRrLK aS4Q3Y/gtWjFALtg6KSf4NW02Uj3HwSPzOuw9iAk24sI/p5rm3OV0w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> </data> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> LB_SmartVisionCommon/ConfigManager.cs
@@ -21,6 +21,16 @@ /// <param name="filePath">文件存储路径以及名称</param> public static void SaveConfig<T>(T config, string filePath) { if (config == null) { AsyncLogHelper.Error(nameof(config)); throw new ArgumentNullException(nameof(config)); } if (filePath == null) { AsyncLogHelper.Error(nameof(filePath)); AsyncLogHelper.Error(nameof(filePath)); } var json = JsonConvert.SerializeObject(config, Newtonsoft.Json.Formatting.Indented); File.WriteAllText(filePath, json); } LB_VisionProcesses/Communicators/BaseCommunicator.cs
@@ -1,7 +1,14 @@ namespace LB_VisionProcesses.Communicators using Newtonsoft.Json; namespace LB_VisionProcesses.Communicators { [JsonObject(MemberSerialization.OptOut)] public abstract class BaseCommunicator : ICommunicator { /// <summary> /// 子类名称 /// </summary> public string ClassName { get; set; } = string.Empty; /// <summary> /// 通讯名称 /// </summary> @@ -45,11 +52,12 @@ /// <summary> /// 获取消息回调 /// </summary> [JsonIgnore] public Action<string> MessageReceived; /// <summary> /// 获取消息回调 /// </summary> [JsonIgnore] public Action<string, string> TriggerRunMessageReceived; /// <summary> @@ -65,13 +73,13 @@ /// <summary> /// 心跳发送线程 /// </summary> [JsonIgnore] public Thread heartbeatThread; public BaseCommunicator(string name = "") { CommunicatorName = name; } public virtual void SendHeartbeat() { while (true) LB_VisionProcesses/Communicators/TCom/LocalMonitor.cs
@@ -1,4 +1,5 @@ using System; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +7,7 @@ namespace LB_VisionProcesses.Communicators.TCom { [JsonObject(MemberSerialization.OptOut)] public class LocalMonitor : BaseCommunicator { // 使用 FileSystemWatcher 来实时监听文件夹变化 LB_VisionProcesses/Communicators/TCom/TCPClient.cs
@@ -1,4 +1,5 @@ using System; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -9,6 +10,7 @@ namespace LB_VisionProcesses.Communicators.TCom { [JsonObject(MemberSerialization.OptOut)] public class TCPClient : BaseCommunicator { private TcpClient _tcpClient = new TcpClient(); LB_VisionProcesses/Communicators/TCom/TCPServer.cs
@@ -1,4 +1,5 @@ using System; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -9,6 +10,7 @@ namespace LB_VisionProcesses.Communicators.TCom { [JsonObject(MemberSerialization.OptOut)] public class TCPServer : BaseCommunicator { private TcpListener _tcpListener; LB_VisionProcesses/Communicators/TCom/UARTPort.cs
@@ -1,4 +1,5 @@ using RJCP.IO.Ports; using Newtonsoft.Json; using RJCP.IO.Ports; using System; using System.Collections.Generic; using System.Linq; @@ -7,6 +8,7 @@ namespace LB_VisionProcesses.Communicators.TCom { [JsonObject(MemberSerialization.OptOut)] public class UARTPort : BaseCommunicator { private RJCP.IO.Ports.SerialPortStream SerialPort = new RJCP.IO.Ports.SerialPortStream(); LB_VisionProcesses/Communicators/UserCommunicator/T306Command/T306CommandTool.cs
@@ -1,4 +1,5 @@ using LB_VisionProcesses.Communicators.TCom; using Newtonsoft.Json; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -9,6 +10,7 @@ namespace LB_VisionProcesses.Communicators.UserCommunicator.T306Command { [JsonObject(MemberSerialization.OptOut)] internal class T306CommandTool : CommunicatorConfig { string HDCP14CHECK = "0422CCF2";