mattercontrol/SlicerConfiguration/MatterSliceInfo.cs
2015-04-08 15:20:10 -07:00

58 lines
No EOL
1.4 KiB
C#

using MatterHackers.Agg.PlatformAbstract;
using MatterHackers.MatterControl.DataStorage;
using System.IO;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public class MatterSliceInfo : SliceEngineInfo
{
public MatterSliceInfo()
: base(MatterSliceInfo.DisplayName)
{
}
public static string DisplayName = "MatterSlice";
public override ActivePrinterProfile.SlicingEngineTypes GetSliceEngineType()
{
return ActivePrinterProfile.SlicingEngineTypes.MatterSlice;
}
public override bool Exists()
{
if (OsInformation.OperatingSystem == OSType.Android || OsInformation.OperatingSystem == OSType.Mac || SlicingQueue.runInProcess)
{
return true;
}
else
{
if (this.GetEnginePath() == null)
{
return false;
}
else
{
return System.IO.File.Exists(this.GetEnginePath());
}
}
}
protected override string getWindowsPath()
{
string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe");
return Path.GetFullPath(matterSliceRelativePath);
}
protected override string getMacPath()
{
string applicationPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationPath, "MatterSlice");
return applicationPath;
}
protected override string getLinuxPath()
{
string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe");
return Path.GetFullPath(matterSliceRelativePath);
}
}
}