This commit is contained in:
iambossTC 2025-04-09 21:41:13 +08:00
parent 11ff5e343d
commit fc4063516d
7 changed files with 42 additions and 14 deletions

View File

@ -4,6 +4,11 @@ using Hi.Mech.Topo;
namespace Sample.Geom namespace Sample.Geom
{ {
/// <remarks>
/// ## Source Code
///
/// [!code-csharp[SampleCode](~/../Hi.Sample/Geom/DemoBuildGeom.cs)]
/// </remarks>
public static class DemoBuildGeom public static class DemoBuildGeom
{ {
public static List<IGetStl> GenGeoms() public static List<IGetStl> GenGeoms()

View File

@ -21,6 +21,12 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(Configuration)'=='Maintenance'"> <ItemGroup Condition="'$(Configuration)'=='Maintenance'">
<ProjectReference Include="..\HiLicense\HiLicense.csproj" />
<ProjectReference Include="..\HiGeom\HiGeom.csproj" />
<ProjectReference Include="..\HiDisp\HiDisp.csproj" />
<ProjectReference Include="..\HiCbtr\HiCbtr.csproj" />
<ProjectReference Include="..\HiMech\HiMech.csproj" />
<ProjectReference Include="..\HiUniNc\HiUniNc.csproj" />
<ProjectReference Include="..\HiNc\HiNc.csproj" /> <ProjectReference Include="..\HiNc\HiNc.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Demo'"> <ItemGroup Condition="'$(Configuration)'=='Demo'">

View File

@ -17,6 +17,11 @@ namespace Sample.MachineTool
/// <summary> /// <summary>
/// Provides access to the PMC-B1 machine tool model. /// Provides access to the PMC-B1 machine tool model.
/// </summary> /// </summary>
/// <remarks>
/// ## Source Code
///
/// [!code-csharp[SampleCode](~/../Hi.Sample/MachineTool/DemoBuildMachineTool.cs)]
/// </remarks>
public class DemoBuildMachineTool : IGetCodeXyzabcMachineTool public class DemoBuildMachineTool : IGetCodeXyzabcMachineTool
{ {
static DemoBuildMachineTool() static DemoBuildMachineTool()

View File

@ -6,9 +6,14 @@ using Hi.Numerical.Xyzabc;
namespace Sample.MachineTool namespace Sample.MachineTool
{ {
/// <summary> /// <summary>
/// Demo generating empty machine tool instances for testing or development. /// Demo Build Machine Tool without gemetries setting.
/// </summary> /// </summary>
public static class DemoBuildEmptyMachineTool /// <remarks>
/// ## Source Code
///
/// [!code-csharp[SampleCode](~/../Hi.Sample/MachineTool/DemoBuildMachineToolWithoutGeometrys.cs)]
/// </remarks>
public static class DemoBuildMachineToolWithoutGeometrys
{ {
/// <summary> /// <summary>
/// Generates an empty machine tool with basic configuration. /// Generates an empty machine tool with basic configuration.

View File

@ -22,6 +22,14 @@ using System.IO;
namespace Sample.Machining namespace Sample.Machining
{ {
/// <summary>
/// This example demonstrates how to create a complete machining project from scratch using HiAPI. It shows the step-by-step process of building all necessary components, including defining custom milling cutters with specific parameters (helix angle, rake angle, etc.), configuring tool holders, setting up a machining tool house with multiple tools, defining the fixture and workpiece geometry, and configuring the machine chain. The sample also demonstrates how to set workpiece material properties and generate the final project XML file. This example is particularly valuable for developers who need to programmatically create complete machining projects without using the HiNC GUI.
/// </summary>
/// <remarks>
/// ### Source Code
///
/// [!code-csharp[SampleCode](~/../Hi.Sample/Machining/DemoBuildMachiningProject.cs)]
/// </remarks>
public static class DemoBuildMachiningProject public static class DemoBuildMachiningProject
{ {
#region CreateMillingCutter1 #region CreateMillingCutter1
@ -125,7 +133,7 @@ namespace Sample.Machining
#region TestMethod #region TestMethod
[STAThread] [STAThread]
public static void Test() static void Main()
{ {
Console.WriteLine($"License Login."); Console.WriteLine($"License Login.");
License.LogInAll(); License.LogInAll();

View File

@ -7,10 +7,17 @@ using Hi.MongoUtils;
namespace Sample.Machining namespace Sample.Machining
{ {
/// <summary>
/// This sample demonstrates how to work with an existing machining project file and execute NC programs. It covers the entire workflow from project loading to executing machining operations, including setting up event handlers for monitoring machining progress and error conditions. The example shows how to configure runtime parameters like collision detection and material removal rate (MRR) monitoring, execute NC files, and properly clean up resources after machining is complete. It's particularly useful for applications that need to automate the execution of machining operations and handle events during the simulation process.
/// </summary>
/// <remarks>
/// ### Source Code
///
/// [!code-csharp[SampleCode](~/../Hi.Sample/Machining/DemoUseMachiningProject.cs)]
/// </remarks>
public static class DemoUseMachiningProject public static class DemoUseMachiningProject
{ {
#region LoadProjectFileAndRunNcFiles static void Main()
static void LoadProjectFileAndRunNcFiles()
{ {
#region LicenseAndDatabaseSetup #region LicenseAndDatabaseSetup
Console.WriteLine($"License Login."); Console.WriteLine($"License Login.");
@ -82,13 +89,5 @@ namespace Sample.Machining
Console.WriteLine($"Program end."); Console.WriteLine($"Program end.");
#endregion #endregion
} }
#endregion
#region Main
public static void Main(string[] args)
{
LoadProjectFileAndRunNcFiles();
}
#endregion
} }
} }