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

56 lines
No EOL
1,010 B
C#

using MatterHackers.Agg.PlatformAbstract;
using System;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
public abstract class SliceEngineInfo
{
public string Name { get; set; }
protected abstract string getWindowsPath();
protected abstract string getMacPath();
protected abstract string getLinuxPath();
public abstract ActivePrinterProfile.SlicingEngineTypes GetSliceEngineType();
public SliceEngineInfo(string name)
{
this.Name = name;
}
public virtual bool Exists()
{
if (this.GetEnginePath() == null)
{
return false;
}
else
{
return System.IO.File.Exists(this.GetEnginePath());
}
}
public string GetEnginePath()
{
switch (OsInformation.OperatingSystem)
{
case OSType.Windows:
return getWindowsPath();
case OSType.Mac:
return getMacPath();
case OSType.X11:
return getLinuxPath();
case OSType.Android:
return null;
default:
throw new NotImplementedException();
}
}
}
}