update ISO coordinate rendering for 3+2axis machine.

This commit is contained in:
iamboss 2026-04-06 15:09:05 +08:00
parent 809a250c44
commit 96eb6ad050
9 changed files with 559 additions and 570 deletions

View File

@ -3,8 +3,8 @@ using System.Threading.Tasks;
using Hi.Common;
using Hi.Common.Messages;
namespace Sample.Common
{
namespace Sample.Common;
/// <summary>
/// Demonstrates common message and exception handling patterns in HiAPI applications
/// </summary>
@ -20,8 +20,8 @@ namespace Sample.Common
internal static void DemoNormalMessages()
{
#region Normal_Messages
MessageHost.ReportMessage("Operation completed successfully.");
MessageHost.ReportWarning("Please check your input.");
MessageUtil.ReportMessage("Operation completed successfully.");
MessageUtil.ReportWarning("Please check your input.");
#endregion
}
/// <summary>
@ -55,4 +55,3 @@ namespace Sample.Common
#endregion
}
}
}

View File

@ -13,8 +13,8 @@ using Hi.Mech;
using Hi.Mech.Topo;
using Hi.Numerical;
namespace Sample.Common
{
namespace Sample.Common;
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Common/DemoSessionMessage.cs)]
@ -24,12 +24,12 @@ namespace Sample.Common
#region Demo_UseSessionMessageHost
internal static void DemoUseSessionMessageHost(LocalProjectService localProjectService)
{
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
SessionProgress sessionMessageHost = localProjectService.SessionProgress;
SessionMessageHost.FilterFlag filterFlags =
SessionMessageHost.FilterFlag.NC |
SessionMessageHost.FilterFlag.Progress |
SessionMessageHost.FilterFlag.Error;
SessionProgress.FilterFlag filterFlags =
SessionProgress.FilterFlag.NC |
SessionProgress.FilterFlag.Progress |
SessionProgress.FilterFlag.Error;
string filterText = null;
var filteredSessionMessageList = sessionMessageHost
.GetFliteredList(filterFlags, filterText);
@ -60,7 +60,7 @@ namespace Sample.Common
internal static void DemoUseSessionMessageHost2(LocalProjectService localProjectService)
{
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
SessionProgress sessionMessageHost = localProjectService.SessionProgress;
IMachiningChain machiningChain = localProjectService.MachiningChain;
PresentAttribute mrrPresent = typeof(MachiningStep).GetProperty(nameof(MachiningStep.Mrr_mm3ds)).GetCustomAttribute<PresentAttribute>();
@ -70,11 +70,11 @@ namespace Sample.Common
string torqueUnit = torquePresent?.TailUnitString;
string torqueFormat = torquePresent?.DataFormatString;
SessionMessageHost.FilterFlag filterFlags =
SessionMessageHost.FilterFlag.Step |
SessionMessageHost.FilterFlag.NC |
SessionMessageHost.FilterFlag.Progress |
SessionMessageHost.FilterFlag.Error;
SessionProgress.FilterFlag filterFlags =
SessionProgress.FilterFlag.Step |
SessionProgress.FilterFlag.NC |
SessionProgress.FilterFlag.Progress |
SessionProgress.FilterFlag.Error;
string filterText = null;
var filteredSessionMessageList = sessionMessageHost
.GetFliteredList(filterFlags, filterText);
@ -145,4 +145,3 @@ namespace Sample.Common
}
#endregion
}
}

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using Hi.Geom;
using Hi.Mech.Topo;
namespace Sample.Geom
{
namespace Sample.Geom;
/// <summary>
/// Demonstrates the creation and manipulation of geometric objects in HiAPI.
/// Shows how to create and transform various geometry types including boxes, cylindroids, and STL files.
@ -38,5 +38,3 @@ namespace Sample.Geom
return new List<IGetStl>([box, cylindroid, stl, stlFile, transformationGeom]);
}
}
}

View File

@ -1,8 +1,8 @@
using Hi.Geom;
using System;
namespace Sample.Geom
{
namespace Sample.Geom;
/// <summary>
/// Demonstrates how to create and calculate bounding boxes for different geometric objects.
/// Shows the use of Box3d to encompass multiple geometric elements with a single boundary.
@ -25,4 +25,3 @@ namespace Sample.Geom
#endregion
}
}
}

View File

@ -34,8 +34,5 @@
<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="HiNc" Version="3.1.*" />
</ItemGroup>
<ItemGroup>
<Folder Include="Coloring\" />
</ItemGroup>
</Project>

View File

@ -3,8 +3,8 @@ using Hi.Mech.Topo;
using Hi.NcMech.Xyzabc;
using Hi.Numerical.Xyzabc;
namespace Sample.MachineTool
{
namespace Sample.MachineTool;
/// <summary>
/// Demo Build Machine Tool without gemetries setting.
/// </summary>
@ -27,4 +27,3 @@ namespace Sample.MachineTool
return xyzabcMachineTool;
}
}
}

View File

@ -15,8 +15,8 @@ using Hi.Machining;
using Hi.HiNcKits;
using Hi.Milling.MillingTools;
namespace Sample.Machining
{
namespace Sample.Machining;
/// <remarks>
/// ### Source Code
/// [!code-csharp[SampleCode](~/../Hi.Sample/Machining/DemoBuildGeomOnlyMachiningProject.cs)]
@ -94,4 +94,3 @@ namespace Sample.Machining
}
}
}

View File

@ -18,8 +18,8 @@ using System.IO;
using Hi.HiNcKits;
using Hi.Milling.MillingTools;
namespace Sample.Machining
{
namespace Sample.Machining;
/// <summary>
/// Demonstrates how to create and configure a <see cref="MachiningProject"/> programmatically.
/// This sample shows how to set up <see cref="MillingCutter"/>, <see cref="CylindroidHolder"/>,
@ -213,4 +213,3 @@ namespace Sample.Machining
}
#endregion
}
}

View File

@ -5,8 +5,8 @@ using Hi.MachiningProcs;
using System;
using System.IO;
namespace Sample.Machining
{
namespace Sample.Machining;
/// <summary>
/// Demonstrates how to load and use an existing <see cref="MachiningProject"/> instance.
/// This sample shows how to set up event handlers for messages and machining step objects,
@ -36,7 +36,7 @@ namespace Sample.Machining
using StreamWriter writer = new StreamWriter("msg.txt");
//show message if something abnormal.
localProjectService.SessionMessageHost.CollectionItemAdded += pack =>
localProjectService.SessionProgress.CollectionItemAdded += pack =>
{
if (pack.Tags.Contains(MessageFlag.Warning.ToString()) ||
pack.Tags.Contains(MessageFlag.Error.ToString()) ||
@ -51,8 +51,9 @@ namespace Sample.Machining
localProjectService.RuntimeApi.MachiningStepBuilt += (preStep, curStep) =>
{
var sourceCommand = curStep.SourceCommand;
var indexedFileLine=sourceCommand?.GetSentence()?.IndexedFileLine;
if (curStep.Mrr_mm3ds > 500) //show only the step that contains large MRR.
Console.WriteLine($"MRR = {curStep.Mrr_mm3ds} At \"{sourceCommand?.FilePath}\" (Line {sourceCommand?.GetLineNo()}) \"{sourceCommand?.Line}\"");
Console.WriteLine($"MRR = {curStep.Mrr_mm3ds} At \"{indexedFileLine?.FilePath}\" (Line {indexedFileLine?.GetLineNo()}) \"{indexedFileLine?.Line}\"");
};
#endregion
@ -83,4 +84,3 @@ namespace Sample.Machining
#endregion
}
}
}