Skip to content

Commit

Permalink
0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Maisak authored and Anton Maisak committed Apr 23, 2019
1 parent 03db5df commit 10025bc
Show file tree
Hide file tree
Showing 4 changed files with 6,441 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Gcode.Utils/Gcode.Utils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<PackageTags>csharp gcode 3d-printing reprap reprap-3d-printer marlin marlin-firmware repitier repitier-firmware json</PackageTags>
<RepositoryType>git</RepositoryType>
<Copyright>Anton Maisak</Copyright>
<AssemblyVersion>0.2.0.6</AssemblyVersion>
<AssemblyVersion>0.2.0.7</AssemblyVersion>
<PackageReleaseNotes>Gcode.Entity
Gcode.Common.Utils</PackageReleaseNotes>
<Version>0.2.6</Version>
<FileVersion>0.2.0.6</FileVersion>
<Version>0.2.7</Version>
<FileVersion>0.2.0.7</FileVersion>
<PackageIconUrl>https://raw.githubusercontent.com/avmaisak/Gcode/master/misc/design/logo/logo.png</PackageIconUrl>
</PropertyGroup>

Expand Down
25 changes: 13 additions & 12 deletions src/Gcode.Utils/SlicerParser/KisSlicerParser.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using Gcode.Utils.Entity;
using LibBase.Extensions;

namespace Gcode.Utils.SlicerParser
{
Expand Down Expand Up @@ -48,19 +49,20 @@ public override KisSlicerInfo GetSlicerInfo(string[] fileContent)
var filamentUsageExt1 = fileContent.FirstOrDefault(x => x.StartsWith("; Ext 1 = "));
if (filamentUsageExt1 != null)
{
filamentUsageExt1 = filamentUsageExt1.TrimString();

res.FilamentUsedExtruder1 = Convert.ToDecimal(
filamentUsageExt1.Split('=')[1]?
.Split(')')[0]?
.Split(' ')[1]?
filamentUsageExt1
.Split('=')[1]?
.Split(new string[] { "mm" }, StringSplitOptions.RemoveEmptyEntries)[0]
.Replace(".",",")?
.Trim()
);

res.FilamentUsedExtruder1Volume = Convert.ToDecimal(
filamentUsageExt1
.Split('=')[1]?
.Split('(')[1]?
.Split(' ')[0]?
.Split('(')[1]
.Split(new string[] { "cm" }, StringSplitOptions.RemoveEmptyEntries)[0]
.Replace(".",",")?
.Trim()
);
Expand All @@ -70,18 +72,17 @@ public override KisSlicerInfo GetSlicerInfo(string[] fileContent)
if (filamentUsageExt2 != null)
{
res.FilamentUsedExtruder2 = Convert.ToDecimal(
filamentUsageExt2.Split('=')[1]?
.Split(')')[0]?
.Split(' ')[1]?
filamentUsageExt2
.Split('=')[1]?
.Split(new string[] { "mm" }, StringSplitOptions.RemoveEmptyEntries)[0]
.Replace(".",",")?
.Trim()
);

res.FilamentUsedExtruder2Volume = Convert.ToDecimal(
filamentUsageExt2
.Split('=')[1]?
.Split('(')[1]?
.Split(' ')[0]?
.Split('(')[1]
.Split(new string[] { "cm" }, StringSplitOptions.RemoveEmptyEntries)[0]
.Replace(".",",")?
.Trim()
);
Expand Down
Loading

0 comments on commit 10025bc

Please sign in to comment.