Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/avmaisak/Gcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Maisak authored and Anton Maisak committed Feb 13, 2020
2 parents 47bd81c + fe99b2c commit badd2a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gcode.Utils/SlicerParser/PrusaSlicerParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public override Slic3RInfo GetSlicerInfo(string[] fileContent)
var filamentUsed = fileContent.Where(x => x.StartsWith("; filament used [mm] = ")).ToArray();
if (filamentUsed.Length == 1 && filamentUsed[0] != null)
{
res.FilamentUsedExtruder1 = Convert.ToDecimal(filamentUsed[0].Split('=')[1].Split(',')[0].Trim().Replace(".",","));
res.FilamentUsedExtruder1 = Convert.ToDecimal(filamentUsed[0].Split(';')[1].Split('=')[1].Trim().Replace(".",","));
}

if (filamentUsed.Length == 2 && filamentUsed[1] != null)
{
// filament used
res.FilamentUsedExtruder2 = Convert.ToDecimal(filamentUsed[1].Split('=')[1]?.Split('=')[1].Split(','));
res.FilamentUsedExtruder2 = Convert.ToDecimal(filamentUsed[1].Split(';')[1].Split('=')[1].Trim().Replace(".",","));
}

var filamentDiameter = fileContent.FirstOrDefault(x => x.StartsWith("; filament_diameter"));
Expand Down

0 comments on commit badd2a1

Please sign in to comment.