From 31beeb3d23e658e5aa2bbb9f251b006095eef15a Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期一, 07 七月 2025 11:05:04 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/自定义类.cs | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" index 3427268..1795ae3 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" @@ -28,8 +28,6 @@ using GZ.DB.Repository.OIDATABASE; using GZ.DB.IRepository.OIDATABASE; using GZ.DB.Entity.OIDATABASE; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; -using NLog.Fluent; namespace GZ.Projects.AuxAllWCS { public class Settings @@ -121,7 +119,7 @@ else { logger = LogFactory.CreateLogger(name); - if (logger != null) + if (logger != null && !loggers.Keys.Contains(name)) { loggers.Add(name, logger); } @@ -172,11 +170,11 @@ // 娣诲姞target-console - //var consoleTarget = new ColoredConsoleTarget(); - //consoleTarget.Layout = @"${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}"; + var consoleTarget = new ColoredConsoleTarget(); + consoleTarget.Layout = @"${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}"; - //config.AddTarget("console", consoleTarget); - //config.AddRule(LogLevel.Debug, LogLevel.Fatal, consoleTarget); + config.AddTarget("console", consoleTarget); + config.AddRule(LogLevel.Debug, LogLevel.Fatal, consoleTarget); //娣诲姞target-info var infoFileTarget = new FileTarget(); @@ -678,6 +676,7 @@ public string endBit { get; set; } public string reqCode { get; set; } public string cntrCode { get; set; } + public string materialCode { get; set; } internal static ReturnMsg CreatemesTask(CreateTask model) { @@ -705,6 +704,7 @@ S_WORK_MODE = "agv", S_B_STATE = "MES", S_CNTRS = model.cntrCode, + S_INDEX = model.materialCode,//mes浠诲姟涓�S_INDEX鏄�鐗╂枡缂栫爜銆�agv浠诲姟涓槸 agv浠诲姟绫诲瀷 N_START_LAYER = 1, N_END_LAYER = 1, N_CNTR_COUNT = 1 @@ -765,16 +765,40 @@ } } } - public static void ResMesTask() + public static void ResMesTask(Tag tag) { - AutoThread.InvokeMethod(AutoThread.Instance, "ResolveMesTask"); ///1. + + AutoThread.InvokeMethod(AutoThread.Instance, "ResolveMesTask", new object[] { tag }); //var VERX = Settings.deviceInfos?.FindAll(x => x.deviceName.Contains("鎹风灛鎶撹噦")); //if () ///2 鐪嬬紦瀛樺尯銆�娌℃弧鐨勩� + + } #endregion [鑷畾涔夌被][20250531152402452][ToWMSMES] } + public class ConsoleInterceptor : TextWriter + { + #region [鑷畾涔夌被][20250702112833751][ConsoleInterceptor] + private readonly TextWriter _originalOut; + + public ConsoleInterceptor() + { + _originalOut = Console.Out; + } + + public override Encoding Encoding => Encoding.UTF8; + + public override void WriteLine(string value = "") + { + string values = (string)AutoThread.InvokeMethod(AutoThread.Instance, "WriteLine", new object[] { value }); + //// 鍙互閫夋嫨缁х画杈撳嚭鍒板師鎺у埗鍙�+ if (!string.IsNullOrEmpty(values)) + _originalOut.WriteLine(values); + } + #endregion [鑷畾涔夌被][20250702112833751][ConsoleInterceptor] + } } \ No newline at end of file -- Gitblit v1.9.1