Display only parts
This commit is contained in:
@@ -25,43 +25,59 @@ namespace PepLib.IO
|
|||||||
|
|
||||||
Plate.Name = name;
|
Plate.Name = name;
|
||||||
|
|
||||||
foreach (var code in pgm)
|
for (int i = 0; i < pgm.Count; i++)
|
||||||
{
|
{
|
||||||
switch (code.CodeType())
|
var block = pgm[i];
|
||||||
|
|
||||||
|
switch (block.CodeType())
|
||||||
{
|
{
|
||||||
case CodeType.CircularMove:
|
case CodeType.CircularMove:
|
||||||
{
|
{
|
||||||
var arc = (CircularMove)code;
|
var arc = (CircularMove)block;
|
||||||
pos = arc.EndPoint;
|
pos = arc.EndPoint;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CodeType.LinearMove:
|
case CodeType.LinearMove:
|
||||||
{
|
{
|
||||||
var line = (LinearMove)code;
|
var line = (LinearMove)block;
|
||||||
pos = line.EndPoint;
|
pos = line.EndPoint;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CodeType.RapidMove:
|
case CodeType.RapidMove:
|
||||||
{
|
{
|
||||||
var rapid = (RapidMove)code;
|
var rapid = (RapidMove)block;
|
||||||
pos = rapid.EndPoint;
|
pos = rapid.EndPoint;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CodeType.Comment:
|
case CodeType.Comment:
|
||||||
{
|
{
|
||||||
var comment = (Comment)code;
|
var comment = (Comment)block;
|
||||||
LoadInfo(comment.Value);
|
LoadInfo(comment.Value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CodeType.SubProgramCall:
|
case CodeType.SubProgramCall:
|
||||||
{
|
{
|
||||||
var subpgm = (SubProgramCall)code;
|
var subpgm = (SubProgramCall)block;
|
||||||
var loop = nest.GetLoop(subpgm.LoopId);
|
var loop = nest.GetLoop(subpgm.LoopId);
|
||||||
var part = Part.Create(loop, pos, AngleConverter.ToRadians(subpgm.Rotation));
|
var part = Part.Create(loop, pos, AngleConverter.ToRadians(subpgm.Rotation));
|
||||||
|
|
||||||
|
var nextBlock = pgm[i + 1];
|
||||||
|
|
||||||
|
if (nextBlock.CodeType() == CodeType.Comment)
|
||||||
|
{
|
||||||
|
var comment = nextBlock as Comment;
|
||||||
|
|
||||||
|
if (comment.Value == "DISPLAY ONLY")
|
||||||
|
{
|
||||||
|
part.IsDisplayOnly = true;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Plate.Parts.Add(part);
|
Plate.Parts.Add(part);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ namespace PepLib
|
|||||||
get { return baseLoop.Rotation; }
|
get { return baseLoop.Rotation; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsDisplayOnly { get; set; } = false;
|
||||||
|
|
||||||
public void Rotate(double angle)
|
public void Rotate(double angle)
|
||||||
{
|
{
|
||||||
baseLoop.Rotate(angle);
|
baseLoop.Rotate(angle);
|
||||||
|
|||||||
@@ -33,9 +33,6 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DotNetZip, Version=1.13.3.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\..\packages\DotNetZip.1.13.3\lib\net40\DotNetZip.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -99,7 +96,9 @@
|
|||||||
<Compile Include="ZipHelper.cs" />
|
<Compile Include="ZipHelper.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<PackageReference Include="DotNetZip">
|
||||||
|
<Version>1.13.3</Version>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="DotNetZip" version="1.13.3" targetFramework="net461" />
|
|
||||||
</packages>
|
|
||||||
Reference in New Issue
Block a user