This commit is contained in:
parent
3084db3e86
commit
7263881497
10
Class1.cs
10
Class1.cs
|
@ -3,7 +3,8 @@ using BITKit;
|
||||||
using BITKit.CommandPattern;
|
using BITKit.CommandPattern;
|
||||||
using BITKit.Mod;
|
using BITKit.Mod;
|
||||||
|
|
||||||
namespace com.ifactory.cutting.mode.auto_save_images;
|
namespace BITFactory.Cutting
|
||||||
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 该程序将自动保存导出的数据到同级目录下
|
/// 该程序将自动保存导出的数据到同级目录下
|
||||||
|
@ -14,6 +15,7 @@ public sealed class AutoSaveImage:MyMod
|
||||||
public override string Name { get; set; } = "自动保存导出数据";
|
public override string Name { get; set; } = "自动保存导出数据";
|
||||||
|
|
||||||
[Inject] private ICuttingTool _cuttingTool;
|
[Inject] private ICuttingTool _cuttingTool;
|
||||||
|
|
||||||
public override void OnInitialized()
|
public override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
|
@ -37,7 +39,8 @@ public sealed class AutoSaveImage:MyMod
|
||||||
switch (x)
|
switch (x)
|
||||||
{
|
{
|
||||||
case CuttingPointCommand pointCommand:
|
case CuttingPointCommand pointCommand:
|
||||||
stringBuilder.AppendLine($"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}");
|
stringBuilder.AppendLine(
|
||||||
|
$"切削点: {pointCommand.PlanePoint.x} {pointCommand.PlanePoint.y} {pointCommand.PlanePoint.z}");
|
||||||
break;
|
break;
|
||||||
case CuttingLineCommand lineCommand:
|
case CuttingLineCommand lineCommand:
|
||||||
stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}");
|
stringBuilder.AppendLine($"切削线:{lineCommand.Line.Length}");
|
||||||
|
@ -45,11 +48,14 @@ public sealed class AutoSaveImage:MyMod
|
||||||
{
|
{
|
||||||
stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}");
|
stringBuilder.AppendLine($"切削线点: {linePos.x} {linePos.y} {linePos.z}");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllText(path, stringBuilder.ToString());
|
File.WriteAllText(path, stringBuilder.ToString());
|
||||||
|
|
||||||
BIT4Log.Log<AutoSaveImage>($"导出数据已保存到:{path}");
|
BIT4Log.Log<AutoSaveImage>($"导出数据已保存到:{path}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue