This commit is contained in:
parent
a2d98bb4d6
commit
1724b98591
33
Class1.cs
33
Class1.cs
|
@ -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)
|
||||||
{
|
{
|
||||||
stringBuilder.AppendLine(
|
case CuttingPointCommand pointCommand:
|
||||||
$"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}");
|
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());
|
File.WriteAllText(path, stringBuilder.ToString());
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue