refactor(Hi.Sample): follow the Buckle to Mount rename -- the machine-tool and machining-project build demos and the coordinate-entry displayees use the ...Mount members

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 01:46:26 +08:00
co-authored by Claude Fable 5.1
parent 40214ca6f4
commit 2cf5d31bf6
6 changed files with 18 additions and 18 deletions
+9 -9
View File
@@ -60,9 +60,9 @@ namespace Sample.Disp
return;
////Console.WriteLine($"B: {CoordinateIndex}; {coordinateMove}");
Vec3d mcXyz_AttacherAtTableBuckleZero = MillingEquipmentFunc?.Invoke()
?.GetMachinePositionAtTableBuckleZero();
if (mcXyz_AttacherAtTableBuckleZero == null)
Vec3d mcXyz_AttacherAtTableMountZero = MillingEquipmentFunc?.Invoke()
?.GetMachinePositionAtTableMountZero();
if (mcXyz_AttacherAtTableMountZero == null)
return;
Vec3d coordinateMove;
@@ -85,7 +85,7 @@ namespace Sample.Disp
//Console.WriteLine($"text: [{text}]");
bind.ModelMatStack.Push();
bind.ModelMatStack.Trans(coordinateMove - mcXyz_AttacherAtTableBuckleZero);
bind.ModelMatStack.Trans(coordinateMove - mcXyz_AttacherAtTableMountZero);
CoordinateDrawing.Display(bind, text);
bind.ModelMatStack.Pop();
}
@@ -96,9 +96,9 @@ namespace Sample.Disp
if (ncEnv == null || NcEnv.CncBrand != CncBrand.Heidenhain)
return;
Vec3d mcXyz_AttacherAtTableBuckleZero = MillingEquipmentFunc?.Invoke()
?.GetMachinePositionAtTableBuckleZero();
if (mcXyz_AttacherAtTableBuckleZero == null)
Vec3d mcXyz_AttacherAtTableMountZero = MillingEquipmentFunc?.Invoke()
?.GetMachinePositionAtTableMountZero();
if (mcXyz_AttacherAtTableMountZero == null)
return;
Vec3d coordinateMove;
if (HeidenhainCycleDef247Q339 == 0 && HeidenhainCycleDef7Arg == null)
@@ -107,13 +107,13 @@ namespace Sample.Disp
HeidenhainCycleDef247Q339, HeidenhainCycleDef7Arg, ncEnv);
dst.Expand(-mcXyz_AttacherAtTableBuckleZero + coordinateMove);
dst.Expand(-mcXyz_AttacherAtTableMountZero + coordinateMove);
}
/// <inheritdoc/>
public Anchor GetAnchor()
{
return MillingEquipmentFunc?.Invoke()?.GetMachiningChain()
?.GetTableBuckle()?.GetAnchor();
?.GetTableMount()?.GetAnchor();
}
}
}
+1 -1
View File
@@ -82,7 +82,7 @@ public class IsoCoordinateEntryDisplayee : IAnchoredDisplayee
dst.Expand(attacherPos);
}
/// <inheritdoc/>
/// <returns>Table Buckle if existed; otherwise, return null.</returns>
/// <returns>Table Mount if existed; otherwise, return null.</returns>
public Anchor GetAnchor()
{
return MillingEquipmentFunc?.Invoke()?.GetMachiningChain()?.GetAnchor();
+1 -1
View File
@@ -41,7 +41,7 @@ namespace Sample.MachineTool
{
GeneralXyzabcMachineTool dst = GeneralXyzabcMachineTool.CreateFromChainCode(
"[O][Y][X][C][w];[O][Z][B][S][t]");
if (dst.ToolBuckleTransformer is StaticTranslation st)
if (dst.ToolMountTransformer is StaticTranslation st)
st.Trans = new Vec3d(-72.40, 72.40, 176.44);
dst.TransformerB.Pivot = new Vec3d(-72.4, -177.4, 225.94);
Dictionary<string, Solid> solidMap = new Dictionary<string, Solid>()
@@ -22,7 +22,7 @@ public static class DemoBuildMachineToolWithoutGeometrys
{
GeneralXyzabcMachineTool xyzabcMachineTool = GeneralXyzabcMachineTool.CreateFromChainCode(
"[O][C][w];[O][X][Y][Z][B][S][t]");
if (xyzabcMachineTool.ToolBuckleTransformer is StaticTranslation st)
if (xyzabcMachineTool.ToolMountTransformer is StaticTranslation st)
st.Trans = new Vec3d(-200, 200, 400);
return xyzabcMachineTool;
}
@@ -71,16 +71,16 @@ public static class DemoBuildGeomOnlyMachiningProject
};
//The fixture topology is free; the default shape has one branch from the
//geometry anchor to each buckle, so the workpiece buckle is placed by the
//geometry anchor to each mount, so the workpiece mount is placed by the
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
Fixture fixture = Fixture.CreateDefault();
fixture.Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10));
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceBuckle).Transformer
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
= new StaticTranslation(new Vec3d(0, 0, 10));
localProjectService.Fixture = fixture;
//The default shape already leads from the geometry anchor to the fixture
//buckle and to program zero by zero translations.
//mount and to program zero by zero translations.
Workpiece workpiece = Workpiece.CreateDefault();
workpiece.InitResolution = 0.25;
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);
+3 -3
View File
@@ -184,18 +184,18 @@ public static class DemoBuildMachiningProject
#region ConfigureFixture
//The fixture topology is free; the default shape has one branch from the
//geometry anchor to each buckle, so the workpiece buckle is placed by the
//geometry anchor to each mount, so the workpiece mount is placed by the
//transformer of the branch to it: on top of the 10 mm thick fixture geom.
Fixture fixture = Fixture.CreateDefault();
fixture.Geom = new Box3d(new Vec3d(-40, -40, 0), new Vec3d(40, 40, 10));
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceBuckle).Transformer
Branch.Get(fixture.GeomAnchor, fixture.WorkpieceMount).Transformer
= new StaticTranslation(new Vec3d(0, 0, 10));
localProjectService.Fixture = fixture;
#endregion
#region ConfigureWorkpiece
//The default shape already leads from the geometry anchor to the fixture
//buckle and to program zero by zero translations.
//mount and to program zero by zero translations.
Workpiece workpiece = Workpiece.CreateDefault();
workpiece.InitResolution = 0.25;
workpiece.InitGeom = new Box3d(0, 0, -50, 70, 50, 0);