From 1724b98591e220c690920a2e0af3e3d18f6bf14b Mon Sep 17 00:00:00 2001 From: CortexCore <2630229280@qq.com> Date: Sun, 3 Mar 2024 18:30:19 +0800 Subject: [PATCH] 1 --- Class1.cs | 33 ++++++++----------- ...ctory.cutting.mode.auto_save_images.csproj | 1 + 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Class1.cs b/Class1.cs index 9661551..87bca9e 100644 --- a/Class1.cs +++ b/Class1.cs @@ -1,10 +1,10 @@ using System; using System.IO; -using BITFactory.Cutting; using BITKit; using BITKit.CommandPattern; using BITKit.Mod; using System.Linq; +using BITFactory.Cutting; namespace BITFactory.Cutting.Mod { @@ -36,27 +36,22 @@ namespace BITFactory.Cutting.Mod var stringBuilder = new System.Text.StringBuilder(); var path = Path.Combine(FolderPath, $"export_{DateTime.Now.Ticks}.cfg"); stringBuilder.AppendLine($"导出时间: {DateTime.Now}"); - foreach (var x in commands) + foreach (var command in commands) { - if(x is CuttingPointCommand pointCommand) + switch (command) { - stringBuilder.AppendLine( - $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); + case CuttingPointCommand pointCommand: + stringBuilder.AppendLine( + $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); + break; + case CuttingLineCommand lineCommand: + stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}"); + foreach (var linePos in lineCommand.Line) + { + stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}"); + } + break; } - // switch (x) - // { - // case CuttingPointCommand pointCommand: - // stringBuilder.AppendLine( - // $"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); - // break; - // case CuttingLineCommand lineCommand: - // stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}"); - // foreach (var linePos in lineCommand.Line) - // { - // stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}"); - // } - // break; - // } } File.WriteAllText(path, stringBuilder.ToString()); diff --git a/com.ifactory.cutting.mode.auto_save_images.csproj b/com.ifactory.cutting.mode.auto_save_images.csproj index 517908f..3fa50e3 100644 --- a/com.ifactory.cutting.mode.auto_save_images.csproj +++ b/com.ifactory.cutting.mode.auto_save_images.csproj @@ -4,6 +4,7 @@ net7.0 disable enable + 8