Skip to content

Commit 6a01ce5

Browse files
author
Sven Erb
committed
Resolved merge conflicts between gcode_read and main
2 parents 9583d0c + 241435b commit 6a01ce5

42 files changed

Lines changed: 1982 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/BuildTestDeploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup Dotnet sdk
3939
uses: actions/setup-dotnet@v3
4040
with:
41-
dotnet-version: 7.0.x
41+
dotnet-version: 8.0.x
4242

4343
- name: Remove GUI Projects (Linux)
4444
if: contains(matrix.os, 'ubuntu')
@@ -50,17 +50,17 @@ jobs:
5050
- name: Test Linux
5151
if: contains(matrix.os, 'ubuntu')
5252
run: |
53-
dotnet run --configuration Release --framework net6 --no-build --project ReaderWriter/FileReaderWriterFactoryGRPCWrapper/FileReaderWriterFactoryGRPCWrapper.csproj &
53+
dotnet run --configuration Release --framework net8.0 --no-build --project ReaderWriter/FileReaderWriterFactoryGRPCWrapper/FileReaderWriterFactoryGRPCWrapper.csproj &
5454
grpcpid="$!"
5555
echo "started grpc server"
5656
sleep 5s
57-
dotnet test --no-build --configuration Release --framework net6
57+
dotnet test --no-build --configuration Release --framework net8.0
5858
kill $grpcpid
5959
6060
- name: Test Windows
6161
if: contains(matrix.os, 'windows')
6262
run: |
63-
$j = Start-Process -PassThru -Filepath 'dotnet' -WorkingDirectory $PWD -ArgumentList 'run --configuration Release --framework net6 --no-build --project .\ReaderWriter\FileReaderWriterFactoryGRPCWrapper\FileReaderWriterFactoryGRPCWrapper.csproj'
63+
$j = Start-Process -PassThru -Filepath 'dotnet' -WorkingDirectory $PWD -ArgumentList 'run --configuration Release --framework net8.0 --no-build --project .\ReaderWriter\FileReaderWriterFactoryGRPCWrapper\FileReaderWriterFactoryGRPCWrapper.csproj'
6464
Start-Sleep -s 5
6565
dotnet test --no-build --configuration Release
6666
$j | Select-Object -Property Id | Stop-Process
@@ -81,7 +81,7 @@ jobs:
8181
- name: Setup Dotnet sdk
8282
uses: actions/setup-dotnet@v3
8383
with:
84-
dotnet-version: 7.0.x
84+
dotnet-version: 8.0.x
8585

8686
- name: Build Windows
8787
run: |

Benchmarks/Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<IsPackable>false</IsPackable>
88
<Nullable>enable</Nullable>

OVFFileConverterGUI/OVFFileConverterGUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net6-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
77
<IsPackable>false</IsPackable>
88
</PropertyGroup>

PlausibilityChecker/PlausibilityCheckerUnitTests/PlausibilityCheckerUnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6</TargetFrameworks>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77
<Platforms>AnyCPU;x64</Platforms>

ReaderWriter/3rdPartyFormatAdapters/CLI_ILT/ILTFileReaderAdapter/ILTFileReaderAdapter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ private void OpenFile()
208208
{
209209
fileHandler.OpenFile(filename);
210210
jobfilename = Path.GetFileNameWithoutExtension(filename);
211+
212+
var ud_JobName = fileHandler.GetUserData("JobName");
213+
if(ud_JobName.Length > 0)
214+
jobfilename = ud_JobName;
215+
211216
if (buildJob != null)
212217
{
213218
ConvertILTStructure(progress);

ReaderWriter/3rdPartyFormatAdapters/CLI_ILT/ILTFileReaderAdapter/ILTFileReaderAdapter.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<None Include="..\..\..\..\icon.png" Pack="true" PackagePath="\"/>
23+
<None Include="..\..\..\..\icon.png" Pack="true" PackagePath="\" />
2424
</ItemGroup>
2525

2626
<ItemGroup>
2727
<ProjectReference Include="..\..\..\AbstractReaderWriter\AbstractReaderWriter.csproj" />
2828
<ProjectReference Include="..\ILTFileReaderInterfaces\ILTFileReaderInterfaces.csproj" />
29+
<ProjectReference Include="..\iltFileReader\ILTFileReader.csproj" />
2930
</ItemGroup>
3031

3132
</Project>
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
/*
2+
---- Copyright Start ----
3+
4+
This file is part of the OpenVectorFormatTools collection. This collection provides tools to facilitate the usage of the OpenVectorFormat.
5+
6+
Copyright (C) 2024 Digital-Production-Aachen
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General Public
19+
License along with this library; if not, write to the Free Software
20+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
22+
---- Copyright End ----
23+
*/
24+
25+
using ILTFileReader.OVFToCLIAdapter;
26+
using OpenVectorFormat;
27+
using OpenVectorFormat.AbstractReaderWriter;
28+
using OpenVectorFormat.ILTFileReader;
29+
using OpenVectorFormat.ILTFileReader.Controller;
30+
using System;
31+
using System.Collections.Generic;
32+
using System.IO;
33+
using System.Runtime.CompilerServices;
34+
using System.Text;
35+
using System.Threading.Tasks;
36+
using static OpenVectorFormat.ILTFileReader.Controller.CliFileAccess;
37+
38+
namespace ILTFileReaderAdapter.OVFToCLIAdapter
39+
{
40+
public class CLIWriterAdapter : FileWriter
41+
{
42+
public override FileWriteOperation FileOperationInProgress => _fileOperationInProgress;
43+
44+
private FileWriteOperation _fileOperationInProgress = FileWriteOperation.None;
45+
46+
private Job jobShell;
47+
private IFileReaderWriterProgress progress;
48+
49+
private static List<string> fileFormats = new List<string>() { ".cli" };
50+
private BinaryWriter binaryWriter;
51+
private StreamWriter steamWriter;
52+
private CliFileAccess cliAdapter = new CliFileAccess();
53+
54+
55+
/// <summary>
56+
/// List of file format extensions supported by this file reader.
57+
/// </summary>
58+
public static new List<string> SupportedFileFormats => fileFormats;
59+
60+
public override Job JobShell => jobShell;
61+
62+
public override void Dispose()
63+
{
64+
binaryWriter?.Dispose();
65+
steamWriter?.Dispose();
66+
}
67+
68+
public override Task SimpleJobWriteAsync(Job job, string filename, IFileReaderWriterProgress progress)
69+
{
70+
71+
var map = new Dictionary<int, Tuple<float, float>>();
72+
73+
if (CliPlus)
74+
{
75+
foreach (var part in job.MarkingParamsMap)
76+
{
77+
map.Add(part.Key, Tuple.Create(part.Value.LaserPowerInW, part.Value.LaserSpeedInMmPerS));
78+
}
79+
}
80+
81+
var adapter = new CliFileAccess(map);
82+
adapter.WriteFile(filename, new OVFCliJob(job) { Units = CliFormatSettings.Instance.Units });
83+
84+
return Task.CompletedTask;
85+
}
86+
87+
public override void StartWritePartial(Job jobShell, string filename, IFileReaderWriterProgress progress)
88+
{
89+
this.jobShell = jobShell;
90+
this.progress = progress;
91+
92+
var map = new Dictionary<int, Tuple<float, float>>();
93+
94+
if (CliPlus)
95+
{
96+
foreach (var part in jobShell.MarkingParamsMap)
97+
{
98+
map.Add(part.Key, Tuple.Create(part.Value.LaserPowerInW, part.Value.LaserSpeedInMmPerS));
99+
}
100+
}
101+
102+
using (var sW = new StreamWriter(filename, false))
103+
{
104+
WriteHeader(sW, new OVFCliJob(jobShell) { Units = CliFormatSettings.Instance.Units });
105+
}
106+
107+
cliAdapter = new CliFileAccess(map) ;
108+
109+
if (CliFormatSettings.Instance.dataFormatType == DataFormatType.binary)
110+
binaryWriter = new BinaryWriter(new FileStream(filename, FileMode.Append, FileAccess.Write, FileShare.None));
111+
else
112+
steamWriter = new StreamWriter(new FileStream(filename, FileMode.Append, FileAccess.Write, FileShare.None), Encoding.ASCII);
113+
}
114+
115+
public override void SimpleJobWrite(Job job, string filename, IFileReaderWriterProgress progress = null)
116+
{
117+
var map = new Dictionary<int, Tuple<float, float>>();
118+
119+
if (CliPlus)
120+
{
121+
foreach (var part in job.MarkingParamsMap)
122+
{
123+
map.Add(part.Key, Tuple.Create(part.Value.LaserPowerInW, part.Value.LaserSpeedInMmPerS));
124+
}
125+
}
126+
127+
var adapter = new CliFileAccess(map);
128+
adapter.WriteFile(filename, new OVFCliJob(job) { Units = CliFormatSettings.Instance.Units });
129+
}
130+
131+
public override void AppendWorkPlane(WorkPlane workPlane)
132+
{
133+
if(CliFormatSettings.Instance.dataFormatType == DataFormatType.binary)
134+
cliAdapter.AppendLayer(binaryWriter, new OVFCliLayer(workPlane));
135+
else
136+
cliAdapter.AppendLayer(steamWriter, new OVFCliLayer(workPlane));
137+
}
138+
139+
public override void AppendVectorBlock(VectorBlock block)
140+
{
141+
throw new NotImplementedException();
142+
}
143+
144+
public void WriteStartGeometry()
145+
{
146+
if(CliFormatSettings.Instance.dataFormatType == DataFormatType.ASCII)
147+
{
148+
steamWriter.WriteLine("");
149+
steamWriter.WriteLine("$$GEOMETRYSTART");
150+
}
151+
}
152+
153+
public void WriteEndGeometry()
154+
{
155+
if (CliFormatSettings.Instance.dataFormatType == DataFormatType.ASCII)
156+
{
157+
steamWriter.WriteLine("");
158+
steamWriter.WriteLine("$$GEOMETRYEND");
159+
}
160+
161+
}
162+
}
163+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
---- Copyright Start ----
3+
4+
This file is part of the OpenVectorFormatTools collection. This collection provides tools to facilitate the usage of the OpenVectorFormat.
5+
6+
Copyright (C) 2024 Digital-Production-Aachen
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General Public
19+
License along with this library; if not, write to the Free Software
20+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
22+
---- Copyright End ----
23+
*/
24+
using OpenVectorFormat.ILTFileReader;
25+
26+
27+
namespace ILTFileReader.OVFToCLIAdapter
28+
{
29+
public class Dimension : IDimension
30+
{
31+
public Dimension(float zmin, float zmax, float xmin, float xmax, float ymin, float ymax)
32+
{
33+
Z1 = zmin;
34+
Z2 = zmax;
35+
X1 = xmin;
36+
X2 = xmax;
37+
Y1 = ymin;
38+
Y2 = ymax;
39+
}
40+
public float X1 { get; set; }
41+
public float X2 { get; set; }
42+
public float Y1 { get; set; }
43+
public float Y2 { get; set; }
44+
public float Z1 { get; set; }
45+
public float Z2 { get; set; }
46+
}
47+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
---- Copyright Start ----
3+
4+
This file is part of the OpenVectorFormatTools collection. This collection provides tools to facilitate the usage of the OpenVectorFormat.
5+
6+
Copyright (C) 2024 Digital-Production-Aachen
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General Public
19+
License along with this library; if not, write to the Free Software
20+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
22+
---- Copyright End ----
23+
*/
24+
25+
using System;
26+
using System.Collections.Generic;
27+
using System.Text;
28+
using OpenVectorFormat.ILTFileReader;
29+
30+
namespace ILTFileReader.OVFToCLIAdapter
31+
{
32+
class Hatch : IHatch
33+
{
34+
public Hatch(Point2D start, Point2D end)
35+
{
36+
this.Start = start;
37+
this.End = end;
38+
}
39+
40+
public IPoint2D End
41+
{
42+
get;
43+
private set;
44+
}
45+
46+
public IPoint2D Start
47+
{
48+
get;
49+
private set;
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)