mattercontrol/SlicerConfiguration/SliceEngineInfo.cs

56 lines
989 B
C#
Raw Normal View History

2015-04-08 15:20:10 -07:00
using MatterHackers.Agg.PlatformAbstract;
using System;
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();
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 12:14:45 -07:00
public SliceEngineInfo(string name)
{
2015-04-08 15:20:10 -07:00
this.Name = name;
}
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
}
2015-04-08 15:20:10 -07:00
public string GetEnginePath()
{
switch (OsInformation.OperatingSystem)
{
case OSType.Windows:
return getWindowsPath();
2015-04-08 15:20:10 -07:00
case OSType.Mac:
return getMacPath();
2015-04-08 15:20:10 -07:00
case OSType.X11:
return getLinuxPath();
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();
}
}
}
2015-04-08 15:20:10 -07:00
}