| | |
| | | using Newtonsoft.Json; |
| | | using LB_SmartVisionCommon; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using System.Collections.Concurrent; |
| | | using System.Diagnostics; |
| | |
| | | namespace LB_VisionProcesses.Communicators |
| | | { |
| | | [Serializable] |
| | | [Process("通讯测试", Category = "通讯工具", Description = "创建通讯测试工具")] |
| | | [Process("通讯模块", Category = "通讯工具", Description = "创建通讯模块工具")] |
| | | public class CommunicatorConfig : IProcess |
| | | { |
| | | /// <summary> |
| | |
| | | { |
| | | this.dicCommunicators = dicCommunicators; |
| | | |
| | | strProcessName = "通讯测试"; |
| | | strProcessName = "通讯模块"; |
| | | strProcessClass = "LB_VisionProcesses.Communicators.CommunicatorConfig"; |
| | | |
| | | Params.Inputs.Add("通讯口名", ""); |
| | |
| | | |
| | | if (!fullPath.Contains(".json")) |
| | | { |
| | | Debug.WriteLine("文件路径不完整"); |
| | | AsyncLogHelper.Info("文件路径不完整"); |
| | | return false; |
| | | } |
| | | if (string.IsNullOrEmpty(fullPath) || fullPath.Trim() == "") |
| | | { |
| | | Debug.WriteLine("文件路径不完整"); |
| | | AsyncLogHelper.Info("文件路径不完整"); |
| | | return false; |
| | | } |
| | | |
| | |
| | | |
| | | if (!File.Exists(fullPath)) |
| | | { |
| | | Debug.WriteLine("文件不存在创建空文件"); |
| | | AsyncLogHelper.Info("文件不存在创建空文件"); |
| | | Save(directoryPath); |
| | | return true; |
| | | } |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(filePath) || filePath.Trim() == "") |
| | | { |
| | | Debug.WriteLine("文件路径不完整"); |
| | | AsyncLogHelper.Info("文件路径不完整"); |
| | | return false; |
| | | } |
| | | |