From f7e41712ce624345d321894edbe7cd281f39f4b9 Mon Sep 17 00:00:00 2001 From: CortexCore <2630229280@qq.com> Date: Sun, 3 Mar 2024 19:15:27 +0800 Subject: [PATCH] 1 --- Class1.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Class1.cs b/Class1.cs index c4cb871..7298e71 100644 --- a/Class1.cs +++ b/Class1.cs @@ -32,10 +32,10 @@ namespace BITFactory.Cutting.Mod private void OnRelease(ICommand[] obj) { - var commands = obj.OfType(); + var commands = obj.OfType().ToArray(); var stringBuilder = new System.Text.StringBuilder(); var path = Path.Combine(FolderPath, $"export_{DateTime.Now.Ticks}.cfg"); - stringBuilder.AppendLine($"导出时间: {DateTime.Now}"); + stringBuilder.AppendLine($"导出时间: {DateTime.Now},导出命令数量: {commands.Length}"); foreach (var command in commands) { if(command is CuttingPointCommand pointCommand) @@ -51,6 +51,10 @@ namespace BITFactory.Cutting.Mod stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}"); } } + else + { + stringBuilder.AppendLine($"{command.Name}:{command}"); + } // switch (command) // { // case CuttingPointCommand pointCommand: