This commit is contained in:
parent
94670b656a
commit
8006256f0c
53
Class1.cs
53
Class1.cs
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using BITKit;
|
using BITKit;
|
||||||
using BITKit.CommandPattern;
|
using BITKit.CommandPattern;
|
||||||
|
@ -17,6 +18,12 @@ namespace BITFactory.Cutting.Mod
|
||||||
public override string PackageName { get; set; } = "iFactory.Cutting.Mod.auto_save_images";
|
public override string PackageName { get; set; } = "iFactory.Cutting.Mod.auto_save_images";
|
||||||
public override string Name { get; set; } = "自动保存导出数据";
|
public override string Name { get; set; } = "自动保存导出数据";
|
||||||
|
|
||||||
|
public override string Description { get; set; } =
|
||||||
|
@"""
|
||||||
|
自动保存导出的数据到该程序所在目录下,并且在导出后弹出对话框提示
|
||||||
|
导出的格式为export_{Timestamp}.cfg
|
||||||
|
""";
|
||||||
|
|
||||||
[Inject] private ICuttingTool _cuttingTool;
|
[Inject] private ICuttingTool _cuttingTool;
|
||||||
[Inject] private IUXDialogue _dialogue;
|
[Inject] private IUXDialogue _dialogue;
|
||||||
|
|
||||||
|
@ -38,40 +45,26 @@ namespace BITFactory.Cutting.Mod
|
||||||
var commands = obj.OfType<ICuttingCommand>().ToArray();
|
var commands = obj.OfType<ICuttingCommand>().ToArray();
|
||||||
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},导出命令数量: {commands.Length}");
|
stringBuilder.AppendLine($"导出时间: {DateTime.Now},导出命令数量: {obj.Length},有效命名数量: {commands.Length}");
|
||||||
foreach (var command in commands)
|
foreach (var command in commands)
|
||||||
{
|
{
|
||||||
if(command 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;
|
||||||
|
default:
|
||||||
|
stringBuilder.AppendLine($"{command.Name}:{command.GetType().FullName}");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if(command is CuttingLineCommand lineCommand)
|
|
||||||
{
|
|
||||||
stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}");
|
|
||||||
foreach (var linePos in lineCommand.Line)
|
|
||||||
{
|
|
||||||
stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
stringBuilder.AppendLine($"{command.Name}:{command}");
|
|
||||||
}
|
|
||||||
// switch (command)
|
|
||||||
// {
|
|
||||||
// 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());
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
导出时间: 2024/3/4 23:35:49,导出命令数量: 47,有效命名数量: 47
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.23]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.22]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.21]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.19]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.17]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.16]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.15]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.27]Y[1.00]Z[-0.13]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.27]Y[1.00]Z[-0.12]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.27]Y[1.00]Z[-0.11]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.26]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.24]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.23]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.21]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.20]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.19]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.01]Y[1.00]Z[-0.19]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.01]Y[1.00]Z[-0.17]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.01]Y[1.00]Z[-0.16]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.02]Y[1.00]Z[-0.14]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.02]Y[1.00]Z[-0.13]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.02]Y[1.00]Z[-0.11]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.02]Y[1.00]Z[-0.10]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.03]Y[1.00]Z[-0.09]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.03]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.01]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[0.00]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.01]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.02]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.03]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.04]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.17]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.15]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.13]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.12]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.11]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.09]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.08]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.06]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.10]Y[1.00]Z[-0.05]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.11]Y[1.00]Z[-0.05]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.12]Y[1.00]Z[-0.05]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.14]Y[1.00]Z[-0.06]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.16]Y[1.00]Z[-0.06]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.17]Y[1.00]Z[-0.07]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.19]Y[1.00]Z[-0.07]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
||||||
|
切削球:X[-0.20]Y[1.00]Z[-0.07]R[0.01]:BITFactory.Cutting.CuttingSphereCommand
|
Loading…
Reference in New Issue