Compare commits
2
Commits
8115f888c4
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7acf47e02b | ||
|
|
139aac9198 |
@@ -1,4 +1,4 @@
|
|||||||
using Hi.Coloring;
|
using Hi.Coloring;
|
||||||
using Hi.MachiningProcs;
|
using Hi.MachiningProcs;
|
||||||
using Hi.Common;
|
using Hi.Common;
|
||||||
using Hi.Disp;
|
using Hi.Disp;
|
||||||
@@ -8,6 +8,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using Hi.Geom;
|
using Hi.Geom;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Hi.NcMech.Solids;
|
||||||
using Hi.Numerical;
|
using Hi.Numerical;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -85,26 +86,28 @@ public class MachiningProjectDisplayee : IDisplayee, IGetAnchor
|
|||||||
|
|
||||||
LocalProjectService localProjectService = LocalProjectService;
|
LocalProjectService localProjectService = LocalProjectService;
|
||||||
HardNcEnv ncEnv = machiningProject.NcEnv;
|
HardNcEnv ncEnv = machiningProject.NcEnv;
|
||||||
var workpiece = localProjectService.Workpiece;
|
//the execution scene draws the RUNTIME face throughout (equipment
|
||||||
|
//split: the service facades expose the authored setup face instead)
|
||||||
var machiningEquipment = localProjectService.MachiningEquipment;
|
var machiningEquipment = localProjectService.MachiningEquipment;
|
||||||
|
var workpiece = machiningEquipment?.Workpiece;
|
||||||
|
|
||||||
if (RenderingFlagBitArray[(int)RenderingFlag.ClStrip])
|
if (RenderingFlagBitArray[(int)RenderingFlag.ClStrip])
|
||||||
{
|
{
|
||||||
localProjectService.ClStrip.IsKeepingDispAlive = true;
|
localProjectService.ClStrip.IsKeepingDispAlive = true;
|
||||||
dst.Add(new AnchoredDisplayee(
|
dst.Add(new AnchoredDisplayee(
|
||||||
localProjectService.MachiningEquipment?.Workpiece?.ProgramZeroAnchor,
|
workpiece?.ProgramZeroAnchor,
|
||||||
localProjectService.ClStrip));
|
localProjectService.ClStrip));
|
||||||
}
|
}
|
||||||
if (RenderingFlagBitArray[(int)RenderingFlag.Mech])
|
if (RenderingFlagBitArray[(int)RenderingFlag.Mech])
|
||||||
{
|
{
|
||||||
if (localProjectService.MachiningEquipment != null)
|
if (machiningEquipment != null)
|
||||||
{
|
{
|
||||||
List<IAnchoredDisplayee> machAncDisplayees = localProjectService
|
List<IAnchoredDisplayee> machAncDisplayees =
|
||||||
?.MachiningEquipment?.GetAnchoredDisplayeeList() ?? [];
|
machiningEquipment.GetAnchoredDisplayeeList() ?? [];
|
||||||
HashSet<Anchor> exclusiveAnchorSet = new([
|
HashSet<Anchor> exclusiveAnchorSet = new([
|
||||||
.. localProjectService.Workpiece?.Asmb.GetDescendantAnchors()??[],
|
.. workpiece?.Asmb.GetDescendantAnchors()??[],
|
||||||
.. localProjectService.MachiningTool?.GetAsmb().GetDescendantAnchors()??[],
|
.. machiningEquipment.MachiningTool?.GetAsmb().GetDescendantAnchors()??[],
|
||||||
.. localProjectService.Fixture?.Asmb.GetDescendantAnchors()??[],
|
.. machiningEquipment.Fixture?.Asmb.GetDescendantAnchors()??[],
|
||||||
]);
|
]);
|
||||||
dst.AddRange(machAncDisplayees.Where(ad =>
|
dst.AddRange(machAncDisplayees.Where(ad =>
|
||||||
!exclusiveAnchorSet.Contains(ad.GetAnchor())));
|
!exclusiveAnchorSet.Contains(ad.GetAnchor())));
|
||||||
@@ -118,19 +121,17 @@ public class MachiningProjectDisplayee : IDisplayee, IGetAnchor
|
|||||||
}
|
}
|
||||||
if (RenderingFlagBitArray[(int)RenderingFlag.Tool])
|
if (RenderingFlagBitArray[(int)RenderingFlag.Tool])
|
||||||
{
|
{
|
||||||
if (localProjectService.MachiningEquipment != null
|
if (machiningEquipment?.MachiningTool != null)
|
||||||
&& localProjectService.MachiningTool != null)
|
|
||||||
dst.Add(new AnchoredDisplayee(
|
dst.Add(new AnchoredDisplayee(
|
||||||
localProjectService.MachiningTool?.GetAnchor(),
|
machiningEquipment.MachiningTool?.GetAnchor(),
|
||||||
localProjectService.MachiningTool));
|
machiningEquipment.MachiningTool));
|
||||||
}
|
}
|
||||||
if (RenderingFlagBitArray[(int)RenderingFlag.Fixture])
|
if (RenderingFlagBitArray[(int)RenderingFlag.Fixture])
|
||||||
{
|
{
|
||||||
if (localProjectService.MachiningEquipment != null
|
if (machiningEquipment?.Fixture != null)
|
||||||
&& localProjectService.Fixture != null)
|
|
||||||
dst.Add(new AnchoredDisplayee(
|
dst.Add(new AnchoredDisplayee(
|
||||||
localProjectService.Fixture?.GeomAnchor,
|
machiningEquipment.Fixture?.GeomAnchor,
|
||||||
localProjectService.Fixture));
|
machiningEquipment.Fixture));
|
||||||
}
|
}
|
||||||
if (RenderingFlagBitArray[(int)RenderingFlag.ProgramZero])
|
if (RenderingFlagBitArray[(int)RenderingFlag.ProgramZero])
|
||||||
{
|
{
|
||||||
@@ -155,14 +156,16 @@ public class MachiningProjectDisplayee : IDisplayee, IGetAnchor
|
|||||||
internal static Anchor GetRootAnchor(
|
internal static Anchor GetRootAnchor(
|
||||||
LocalProjectService localProjectService, BitArray renderingFlagBitArray)
|
LocalProjectService localProjectService, BitArray renderingFlagBitArray)
|
||||||
{
|
{
|
||||||
|
//runtime face throughout: this roots the execution scene
|
||||||
|
var machiningEquipment = localProjectService?.MachiningEquipment;
|
||||||
if (renderingFlagBitArray[(int)RenderingFlag.Mech])
|
if (renderingFlagBitArray[(int)RenderingFlag.Mech])
|
||||||
return localProjectService?.MachiningEquipment?.GetAnchor();
|
return machiningEquipment?.GetAnchor();
|
||||||
else if (renderingFlagBitArray[(int)RenderingFlag.WorkpieceGeom])
|
else if (renderingFlagBitArray[(int)RenderingFlag.WorkpieceGeom])
|
||||||
return localProjectService.Workpiece?.GetAnchor();
|
return machiningEquipment?.Workpiece?.GetAnchor();
|
||||||
else if (renderingFlagBitArray[(int)RenderingFlag.Fixture])
|
else if (renderingFlagBitArray[(int)RenderingFlag.Fixture])
|
||||||
return localProjectService.Fixture?.GetAnchor();
|
return machiningEquipment?.Fixture?.GetAnchor();
|
||||||
else if (renderingFlagBitArray[(int)RenderingFlag.Tool])
|
else if (renderingFlagBitArray[(int)RenderingFlag.Tool])
|
||||||
return localProjectService.MachiningTool?.GetAnchor();
|
return machiningEquipment?.MachiningTool?.GetAnchor();
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -222,9 +225,17 @@ public class MachiningProjectDisplayee : IDisplayee, IGetAnchor
|
|||||||
bind.ModelMatStack.Pop();
|
bind.ModelMatStack.Pop();
|
||||||
|
|
||||||
bind.PushColorByRgb(1, 1, 1);
|
bind.PushColorByRgb(1, 1, 1);
|
||||||
LocalProjectService?.MachiningEquipment?.GetAsmb()?.Display(bind,
|
var machiningEquipment = LocalProjectService?.MachiningEquipment;
|
||||||
GetAnchor(),
|
//Collision red is per-scenario state owned by the execution equipment
|
||||||
GetAnchoredDisplayeeList().ToArray());
|
//(never stored on the shared Solid geometry): scope it to this scene
|
||||||
|
//so the setup topology never paints it.
|
||||||
|
using (CollisionRedScope.Enter(
|
||||||
|
machiningEquipment == null ? null : machiningEquipment.IsCollisionRed))
|
||||||
|
{
|
||||||
|
machiningEquipment?.GetAsmb()?.Display(bind,
|
||||||
|
GetAnchor(),
|
||||||
|
GetAnchoredDisplayeeList().ToArray());
|
||||||
|
}
|
||||||
bind.PopColor();
|
bind.PopColor();
|
||||||
}
|
}
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<VersionBuild>0</VersionBuild>
|
<VersionBuild>0</VersionBuild>
|
||||||
<VersionPrefix>3.1.$(VersionBuild)</VersionPrefix>
|
<VersionPrefix>3.2.$(VersionBuild)</VersionPrefix>
|
||||||
<Product>$(AssemblyName)</Product>
|
<Product>$(AssemblyName)</Product>
|
||||||
<OutputPath>bin\$(Platform).$(Configuration)\</OutputPath>
|
<OutputPath>bin\$(Platform).$(Configuration)\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
<ProjectReference Include="..\Hi.WpfPlus\Hi.WpfPlus.csproj" />
|
<ProjectReference Include="..\Hi.WpfPlus\Hi.WpfPlus.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Release'">
|
<ItemGroup Condition="'$(Configuration)'=='Release'">
|
||||||
<PackageReference Include="HiNc" Version="3.1.*" />
|
<PackageReference Include="HiNc" Version="3.2.*" />
|
||||||
<PackageReference Include="Hi.WpfPlus" Version="3.1.*" />
|
<PackageReference Include="Hi.WpfPlus" Version="3.2.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Mech\" />
|
<Folder Include="Mech\" />
|
||||||
|
|||||||
@@ -51,13 +51,19 @@ namespace Sample.Machining
|
|||||||
|
|
||||||
var projectDisplayee = new MachiningProjectDisplayee(localProjectService);
|
var projectDisplayee = new MachiningProjectDisplayee(localProjectService);
|
||||||
var device = new ClMillingDevice();
|
var device = new ClMillingDevice();
|
||||||
localProjectService.MachiningEquipment.MachiningChain = device;
|
//authored face (equipment split): the facade setter installs the
|
||||||
|
//chain on SetupEquipment and the runtime face follows by rebuild
|
||||||
|
localProjectService.MachiningChain = device;
|
||||||
localProjectService.ClStrip.IsShowDot = true;
|
localProjectService.ClStrip.IsShowDot = true;
|
||||||
double resolution_mm = 0.5;
|
double resolution_mm = 0.5;
|
||||||
var projectDir = Path.GetDirectoryName(projectPath);
|
var projectDir = Path.GetDirectoryName(projectPath);
|
||||||
localProjectService.WorkpieceService.InitGeom = new StlFile(stlFile_CylinderR20, projectDir);
|
//author the workpiece on the setup face, then let the runtime
|
||||||
localProjectService.WorkpieceService.IdealGeom = new StlFile(stlFile_CylinderR19, projectDir);
|
//face follow — a runtime-face write would be wiped by the
|
||||||
|
//session-boundary re-materialise
|
||||||
|
localProjectService.Workpiece.InitGeom = new StlFile(stlFile_CylinderR20, projectDir);
|
||||||
|
localProjectService.Workpiece.IdealGeom = new StlFile(stlFile_CylinderR19, projectDir);
|
||||||
localProjectService.Workpiece.InitResolution = resolution_mm;
|
localProjectService.Workpiece.InitResolution = resolution_mm;
|
||||||
|
localProjectService.NotifySetupEquipmentEdited();
|
||||||
|
|
||||||
SessionShell runtimeApi = localProjectService.SessionShell;
|
SessionShell runtimeApi = localProjectService.SessionShell;
|
||||||
runtimeApi.SetNcResolutionFixed(9999, 15);
|
runtimeApi.SetNcResolutionFixed(9999, 15);
|
||||||
|
|||||||
Reference in New Issue
Block a user