2015-04-08 15:20:10 -07:00
|
|
|
|
using MatterHackers.Agg.PlatformAbstract;
|
|
|
|
|
|
using System;
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl.SlicerConfiguration
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class SliceEngineInfo
|
|
|
|
|
|
{
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract string getWindowsPath();
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract string getMacPath();
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
protected abstract string getLinuxPath();
|
|
|
|
|
|
|
2016-04-18 11:31:31 -07:00
|
|
|
|
public abstract SlicingEngineTypes GetSliceEngineType();
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2014-08-20 12:14:45 -07:00
|
|
|
|
public SliceEngineInfo(string name)
|
2014-08-20 10:52:47 -07:00
|
|
|
|
{
|
2015-04-08 15:20:10 -07:00
|
|
|
|
this.Name = name;
|
2014-08-20 10:52:47 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public virtual bool Exists()
|
|
|
|
|
|
{
|
2014-09-05 13:04:41 -07:00
|
|
|
|
if (this.GetEnginePath() == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return System.IO.File.Exists(this.GetEnginePath());
|
|
|
|
|
|
}
|
2015-04-08 15:20:10 -07:00
|
|
|
|
}
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public string GetEnginePath()
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (OsInformation.OperatingSystem)
|
|
|
|
|
|
{
|
|
|
|
|
|
case OSType.Windows:
|
|
|
|
|
|
return getWindowsPath();
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
case OSType.Mac:
|
|
|
|
|
|
return getMacPath();
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
case OSType.X11:
|
|
|
|
|
|
return getLinuxPath();
|
2014-08-20 10:52:47 -07:00
|
|
|
|
|
2014-09-05 13:04:41 -07:00
|
|
|
|
case OSType.Android:
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
default:
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2014-08-20 10:52:47 -07:00
|
|
|
|
}
|
2015-04-08 15:20:10 -07:00
|
|
|
|
}
|