This commit is contained in:
CortexCore 2024-03-03 18:30:19 +08:00
parent a2d98bb4d6
commit 1724b98591
2 changed files with 15 additions and 19 deletions

View File

@ -1,10 +1,10 @@
using System; using System;
using System.IO; using System.IO;
using BITFactory.Cutting;
using BITKit; using BITKit;
using BITKit.CommandPattern; using BITKit.CommandPattern;
using BITKit.Mod; using BITKit.Mod;
using System.Linq; using System.Linq;
using BITFactory.Cutting;
namespace BITFactory.Cutting.Mod namespace BITFactory.Cutting.Mod
{ {
@ -36,27 +36,22 @@ namespace BITFactory.Cutting.Mod
var stringBuilder = new System.Text.StringBuilder(); var stringBuilder = new System.Text.StringBuilder();
var path = Path.Combine(FolderPath, $"export_{DateTime.Now.Ticks}.cfg"); var path = Path.Combine(FolderPath, $"export_{DateTime.Now.Ticks}.cfg");
stringBuilder.AppendLine($"导出时间: {DateTime.Now}"); stringBuilder.AppendLine($"导出时间: {DateTime.Now}");
foreach (var x in commands) foreach (var command in commands)
{ {
if(x is CuttingPointCommand pointCommand) switch (command)
{ {
case CuttingPointCommand pointCommand:
stringBuilder.AppendLine( stringBuilder.AppendLine(
$"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}"); $"切削点: {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()); File.WriteAllText(path, stringBuilder.ToString());

View File

@ -4,6 +4,7 @@
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>8</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>