update ISO coordinate rendering for 3+2axis machine.
This commit is contained in:
parent
809a250c44
commit
96eb6ad050
@ -3,8 +3,8 @@ using System.Threading.Tasks;
|
|||||||
using Hi.Common;
|
using Hi.Common;
|
||||||
using Hi.Common.Messages;
|
using Hi.Common.Messages;
|
||||||
|
|
||||||
namespace Sample.Common
|
namespace Sample.Common;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates common message and exception handling patterns in HiAPI applications
|
/// Demonstrates common message and exception handling patterns in HiAPI applications
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -20,8 +20,8 @@ namespace Sample.Common
|
|||||||
internal static void DemoNormalMessages()
|
internal static void DemoNormalMessages()
|
||||||
{
|
{
|
||||||
#region Normal_Messages
|
#region Normal_Messages
|
||||||
MessageHost.ReportMessage("Operation completed successfully.");
|
MessageUtil.ReportMessage("Operation completed successfully.");
|
||||||
MessageHost.ReportWarning("Please check your input.");
|
MessageUtil.ReportWarning("Please check your input.");
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -55,4 +55,3 @@ namespace Sample.Common
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@ -13,8 +13,8 @@ using Hi.Mech;
|
|||||||
using Hi.Mech.Topo;
|
using Hi.Mech.Topo;
|
||||||
using Hi.Numerical;
|
using Hi.Numerical;
|
||||||
|
|
||||||
namespace Sample.Common
|
namespace Sample.Common;
|
||||||
{
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// ### Source Code
|
/// ### Source Code
|
||||||
/// [!code-csharp[SampleCode](~/../Hi.Sample/Common/DemoSessionMessage.cs)]
|
/// [!code-csharp[SampleCode](~/../Hi.Sample/Common/DemoSessionMessage.cs)]
|
||||||
@ -24,12 +24,12 @@ namespace Sample.Common
|
|||||||
#region Demo_UseSessionMessageHost
|
#region Demo_UseSessionMessageHost
|
||||||
internal static void DemoUseSessionMessageHost(LocalProjectService localProjectService)
|
internal static void DemoUseSessionMessageHost(LocalProjectService localProjectService)
|
||||||
{
|
{
|
||||||
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
|
SessionProgress sessionMessageHost = localProjectService.SessionProgress;
|
||||||
|
|
||||||
SessionMessageHost.FilterFlag filterFlags =
|
SessionProgress.FilterFlag filterFlags =
|
||||||
SessionMessageHost.FilterFlag.NC |
|
SessionProgress.FilterFlag.NC |
|
||||||
SessionMessageHost.FilterFlag.Progress |
|
SessionProgress.FilterFlag.Progress |
|
||||||
SessionMessageHost.FilterFlag.Error;
|
SessionProgress.FilterFlag.Error;
|
||||||
string filterText = null;
|
string filterText = null;
|
||||||
var filteredSessionMessageList = sessionMessageHost
|
var filteredSessionMessageList = sessionMessageHost
|
||||||
.GetFliteredList(filterFlags, filterText);
|
.GetFliteredList(filterFlags, filterText);
|
||||||
@ -60,7 +60,7 @@ namespace Sample.Common
|
|||||||
|
|
||||||
internal static void DemoUseSessionMessageHost2(LocalProjectService localProjectService)
|
internal static void DemoUseSessionMessageHost2(LocalProjectService localProjectService)
|
||||||
{
|
{
|
||||||
SessionMessageHost sessionMessageHost = localProjectService.SessionMessageHost;
|
SessionProgress sessionMessageHost = localProjectService.SessionProgress;
|
||||||
IMachiningChain machiningChain = localProjectService.MachiningChain;
|
IMachiningChain machiningChain = localProjectService.MachiningChain;
|
||||||
|
|
||||||
PresentAttribute mrrPresent = typeof(MachiningStep).GetProperty(nameof(MachiningStep.Mrr_mm3ds)).GetCustomAttribute<PresentAttribute>();
|
PresentAttribute mrrPresent = typeof(MachiningStep).GetProperty(nameof(MachiningStep.Mrr_mm3ds)).GetCustomAttribute<PresentAttribute>();
|
||||||
@ -70,11 +70,11 @@ namespace Sample.Common
|
|||||||
string torqueUnit = torquePresent?.TailUnitString;
|
string torqueUnit = torquePresent?.TailUnitString;
|
||||||
string torqueFormat = torquePresent?.DataFormatString;
|
string torqueFormat = torquePresent?.DataFormatString;
|
||||||
|
|
||||||
SessionMessageHost.FilterFlag filterFlags =
|
SessionProgress.FilterFlag filterFlags =
|
||||||
SessionMessageHost.FilterFlag.Step |
|
SessionProgress.FilterFlag.Step |
|
||||||
SessionMessageHost.FilterFlag.NC |
|
SessionProgress.FilterFlag.NC |
|
||||||
SessionMessageHost.FilterFlag.Progress |
|
SessionProgress.FilterFlag.Progress |
|
||||||
SessionMessageHost.FilterFlag.Error;
|
SessionProgress.FilterFlag.Error;
|
||||||
string filterText = null;
|
string filterText = null;
|
||||||
var filteredSessionMessageList = sessionMessageHost
|
var filteredSessionMessageList = sessionMessageHost
|
||||||
.GetFliteredList(filterFlags, filterText);
|
.GetFliteredList(filterFlags, filterText);
|
||||||
@ -145,4 +145,3 @@ namespace Sample.Common
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@ -3,8 +3,8 @@ using System.Collections.Generic;
|
|||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using Hi.Mech.Topo;
|
using Hi.Mech.Topo;
|
||||||
|
|
||||||
namespace Sample.Geom
|
namespace Sample.Geom;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates the creation and manipulation of geometric objects in HiAPI.
|
/// 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.
|
/// 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]);
|
return new List<IGetStl>([box, cylindroid, stl, stlFile, transformationGeom]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Sample.Geom
|
namespace Sample.Geom;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates how to create and calculate bounding boxes for different geometric objects.
|
/// 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.
|
/// Shows the use of Box3d to encompass multiple geometric elements with a single boundary.
|
||||||
@ -25,4 +25,3 @@ namespace Sample.Geom
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -34,8 +34,5 @@
|
|||||||
<ItemGroup Condition="'$(Configuration)'=='Release'">
|
<ItemGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<PackageReference Include="HiNc" Version="3.1.*" />
|
<PackageReference Include="HiNc" Version="3.1.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Coloring\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -3,8 +3,8 @@ using Hi.Mech.Topo;
|
|||||||
using Hi.NcMech.Xyzabc;
|
using Hi.NcMech.Xyzabc;
|
||||||
using Hi.Numerical.Xyzabc;
|
using Hi.Numerical.Xyzabc;
|
||||||
|
|
||||||
namespace Sample.MachineTool
|
namespace Sample.MachineTool;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demo Build Machine Tool without gemetries setting.
|
/// Demo Build Machine Tool without gemetries setting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -27,4 +27,3 @@ namespace Sample.MachineTool
|
|||||||
return xyzabcMachineTool;
|
return xyzabcMachineTool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -15,8 +15,8 @@ using Hi.Machining;
|
|||||||
using Hi.HiNcKits;
|
using Hi.HiNcKits;
|
||||||
using Hi.Milling.MillingTools;
|
using Hi.Milling.MillingTools;
|
||||||
|
|
||||||
namespace Sample.Machining
|
namespace Sample.Machining;
|
||||||
{
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// ### Source Code
|
/// ### Source Code
|
||||||
/// [!code-csharp[SampleCode](~/../Hi.Sample/Machining/DemoBuildGeomOnlyMachiningProject.cs)]
|
/// [!code-csharp[SampleCode](~/../Hi.Sample/Machining/DemoBuildGeomOnlyMachiningProject.cs)]
|
||||||
@ -94,4 +94,3 @@ namespace Sample.Machining
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -18,8 +18,8 @@ using System.IO;
|
|||||||
using Hi.HiNcKits;
|
using Hi.HiNcKits;
|
||||||
using Hi.Milling.MillingTools;
|
using Hi.Milling.MillingTools;
|
||||||
|
|
||||||
namespace Sample.Machining
|
namespace Sample.Machining;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates how to create and configure a <see cref="MachiningProject"/> programmatically.
|
/// Demonstrates how to create and configure a <see cref="MachiningProject"/> programmatically.
|
||||||
/// This sample shows how to set up <see cref="MillingCutter"/>, <see cref="CylindroidHolder"/>,
|
/// This sample shows how to set up <see cref="MillingCutter"/>, <see cref="CylindroidHolder"/>,
|
||||||
@ -213,4 +213,3 @@ namespace Sample.Machining
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -5,8 +5,8 @@ using Hi.MachiningProcs;
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Sample.Machining
|
namespace Sample.Machining;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates how to load and use an existing <see cref="MachiningProject"/> instance.
|
/// 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,
|
/// 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");
|
using StreamWriter writer = new StreamWriter("msg.txt");
|
||||||
//show message if something abnormal.
|
//show message if something abnormal.
|
||||||
localProjectService.SessionMessageHost.CollectionItemAdded += pack =>
|
localProjectService.SessionProgress.CollectionItemAdded += pack =>
|
||||||
{
|
{
|
||||||
if (pack.Tags.Contains(MessageFlag.Warning.ToString()) ||
|
if (pack.Tags.Contains(MessageFlag.Warning.ToString()) ||
|
||||||
pack.Tags.Contains(MessageFlag.Error.ToString()) ||
|
pack.Tags.Contains(MessageFlag.Error.ToString()) ||
|
||||||
@ -51,8 +51,9 @@ namespace Sample.Machining
|
|||||||
localProjectService.RuntimeApi.MachiningStepBuilt += (preStep, curStep) =>
|
localProjectService.RuntimeApi.MachiningStepBuilt += (preStep, curStep) =>
|
||||||
{
|
{
|
||||||
var sourceCommand = curStep.SourceCommand;
|
var sourceCommand = curStep.SourceCommand;
|
||||||
|
var indexedFileLine=sourceCommand?.GetSentence()?.IndexedFileLine;
|
||||||
if (curStep.Mrr_mm3ds > 500) //show only the step that contains large MRR.
|
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
|
#endregion
|
||||||
|
|
||||||
@ -83,4 +84,3 @@ namespace Sample.Machining
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user