Skip to content

Commit

Permalink
Merge pull request #32 from avmaisak/dev
Browse files Browse the repository at this point in the history
Fix2  PrusaSlicerParser
  • Loading branch information
avmaisak authored Feb 13, 2020
2 parents 10a1623 + fb83ad3 commit fe99b2c
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 fe99b2c

Please sign in to comment.