refactor(Sample): adapt demos to XFactory IProgress<object> signature
Made-with: Cursor
This commit is contained in:
parent
e5ea1961a5
commit
dd4c3ef28f
@ -1,4 +1,4 @@
|
|||||||
using Hi.Common.XmlUtils;
|
using Hi.Common.XmlUtils;
|
||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using Hi.Mech;
|
using Hi.Mech;
|
||||||
using Hi.Mech.Topo;
|
using Hi.Mech.Topo;
|
||||||
@ -25,7 +25,7 @@ namespace Sample.MachineTool
|
|||||||
{
|
{
|
||||||
static DemoBuildMachineTool()
|
static DemoBuildMachineTool()
|
||||||
{
|
{
|
||||||
XFactory.Regs.Add(XName, (xml, baseDirectory, relFile, res) => new DemoBuildMachineTool());
|
XFactory.Regs.Add(XName, (xml, baseDirectory, relFile, progress, res) => new DemoBuildMachineTool());
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates an XYZ-ABC machine tool instance from embedded resources.
|
/// Generates an XYZ-ABC machine tool instance from embedded resources.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Hi.Common.XmlUtils;
|
using Hi.Common.XmlUtils;
|
||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using Hi.MachiningProcs;
|
using Hi.MachiningProcs;
|
||||||
using Hi.Mech.Topo;
|
using Hi.Mech.Topo;
|
||||||
@ -83,9 +83,10 @@ public static class DemoBuildGeomOnlyMachiningProject
|
|||||||
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IProgress<object> progress = null;
|
||||||
localProjectService.MachiningChain
|
localProjectService.MachiningChain
|
||||||
= XFactory.GenByFile<CodeXyzabcMachineTool>(
|
= XFactory.GenByFile<CodeXyzabcMachineTool>(
|
||||||
"Resource", "MachineTool/PMC-B1/PMC-B1.mt", GenMode.Default);
|
"Resource", "MachineTool/PMC-B1/PMC-B1.mt", progress);
|
||||||
localProjectService.MachiningChainFile = "PMC-B1/PMC-B1.mt";
|
localProjectService.MachiningChainFile = "PMC-B1/PMC-B1.mt";
|
||||||
|
|
||||||
localProjectService.SaveProject();
|
localProjectService.SaveProject();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using Hi.Milling.Apts;
|
using Hi.Milling.Apts;
|
||||||
using Hi.Common.XmlUtils;
|
using Hi.Common.XmlUtils;
|
||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
@ -152,6 +152,8 @@ public static class DemoBuildMachiningProject
|
|||||||
localProjectService.LoadProject(projectPath);
|
localProjectService.LoadProject(projectPath);
|
||||||
MachiningProject machiningProject = localProjectService.MachiningProject;
|
MachiningProject machiningProject = localProjectService.MachiningProject;
|
||||||
|
|
||||||
|
IProgress<object> progress = null;
|
||||||
|
|
||||||
#region ConfigureMachiningToolHouse
|
#region ConfigureMachiningToolHouse
|
||||||
localProjectService.MachiningToolHouse = new MachiningToolHouse()
|
localProjectService.MachiningToolHouse = new MachiningToolHouse()
|
||||||
{
|
{
|
||||||
@ -195,16 +197,16 @@ public static class DemoBuildMachiningProject
|
|||||||
IdealGeom = null,
|
IdealGeom = null,
|
||||||
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
WorkpieceGeomToFixtureBuckleTransformer = new StaticTranslation(new Vec3d(0, 0, 0)),
|
||||||
CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
CuttingPara = XFactory.GenByFile<ICuttingPara>(
|
||||||
"Resource/CuttingParameter", "Al6061T6.mp", GenMode.Default),
|
"Resource/CuttingParameter", "Al6061T6.mp", progress),
|
||||||
WorkpieceMaterial = XFactory.GenByFile<WorkpieceMaterial>(
|
WorkpieceMaterial = XFactory.GenByFile<WorkpieceMaterial>(
|
||||||
"Resource/WorkpieceMaterial", "Al6061T6.WorkpieceMaterial", GenMode.Default),
|
"Resource/WorkpieceMaterial", "Al6061T6.WorkpieceMaterial", progress),
|
||||||
};
|
};
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ConfigureMachineChain
|
#region ConfigureMachineChain
|
||||||
localProjectService.MachiningChain
|
localProjectService.MachiningChain
|
||||||
= XFactory.GenByFile<CodeXyzabcMachineTool>(
|
= XFactory.GenByFile<CodeXyzabcMachineTool>(
|
||||||
"Resource", "MachineTool/PMC-B1/PMC-B1.mt", GenMode.Default);
|
"Resource", "MachineTool/PMC-B1/PMC-B1.mt", progress);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
machiningProject.MakeXmlSourceToFile(projectPath);
|
machiningProject.MakeXmlSourceToFile(projectPath);
|
||||||
|
|||||||
@ -4,8 +4,8 @@ using Hi.Disp;
|
|||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using Hi.Mech.Topo;
|
using Hi.Mech.Topo;
|
||||||
|
|
||||||
namespace Sample.Mech
|
namespace Sample.Mech;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrates the creation and visualization of mechanical assemblies with kinematic linkages.
|
/// Demonstrates the creation and visualization of mechanical assemblies with kinematic linkages.
|
||||||
/// Shows how to build coordinate systems, establish kinematic relationships, and capture visual output.
|
/// Shows how to build coordinate systems, establish kinematic relationships, and capture visual output.
|
||||||
@ -79,4 +79,3 @@ namespace Sample.Mech
|
|||||||
SnapshotToFile(GetDemoAsmb());
|
SnapshotToFile(GetDemoAsmb());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user