mattercontrol/SlicerConfiguration/MatterSliceInfo.cs

52 lines
1.2 KiB
C#
Raw Normal View History

2017-08-20 15:52:43 -07:00
using System;
2015-04-08 15:20:10 -07:00
using System.IO;
using MatterHackers.Agg.Platform;
2017-08-20 15:52:43 -07:00
using MatterHackers.MatterControl.DataStorage;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
2017-06-15 16:54:36 -07:00
public static class MatterSliceInfo
{
2017-06-15 16:54:36 -07:00
public static string DisplayName { get; } = "MatterSlice";
public static string GetEnginePath()
{
switch (AggContext.OperatingSystem)
2017-06-15 16:54:36 -07:00
{
case OSType.Windows:
return getWindowsPath();
2017-06-15 16:54:36 -07:00
case OSType.Mac:
return getMacPath();
2014-08-20 12:14:45 -07:00
2017-06-15 16:54:36 -07:00
case OSType.X11:
return getLinuxPath();
2014-08-20 12:14:45 -07:00
2017-06-15 16:54:36 -07:00
case OSType.Android:
return null;
default:
throw new NotImplementedException();
2015-04-08 15:20:10 -07:00
}
}
2014-08-20 12:14:45 -07:00
2017-06-15 16:54:36 -07:00
private static string getWindowsPath()
{
2014-08-27 12:02:15 -07:00
string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe");
return Path.GetFullPath(matterSliceRelativePath);
}
2017-06-15 16:54:36 -07:00
private static string getMacPath()
{
string applicationPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationPath, "MatterSlice");
return applicationPath;
}
2017-06-15 16:54:36 -07:00
private static string getLinuxPath()
{
2014-08-27 12:02:15 -07:00
string matterSliceRelativePath = Path.Combine(".", "MatterSlice.exe");
return Path.GetFullPath(matterSliceRelativePath);
}
}
}