Update Class1.cs

This commit is contained in:
CortexCore 2024-03-03 18:05:45 +08:00
parent 0ba2aaf239
commit 05f2be0359
1 changed files with 18 additions and 14 deletions

View File

@ -6,9 +6,8 @@ using BITKit.CommandPattern;
using BITKit.Mod;
using System.Linq;
namespace BITFactory.Cutting
namespace BITFactory.Cutting.Mod
{
/// <summary>
/// 该程序将自动保存导出的数据到同级目录下
/// </summary>
@ -39,20 +38,25 @@ namespace BITFactory.Cutting
stringBuilder.AppendLine($"导出时间: {DateTime.Now}");
foreach (var x in commands)
{
switch (x)
if(x is CuttingPointCommand pointCommand)
{
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;
stringBuilder.AppendLine(
$"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}");
}
// 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());