Prep work on slice settings layering.

This commit is contained in:
Kevin Pope 2014-03-24 18:56:41 -07:00
parent 2832653ecb
commit f1ac2fe746
2 changed files with 24 additions and 0 deletions

View file

@ -340,6 +340,24 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return "Unknown";
}
/// <summary>
/// Returns whether or not the setting is overridden by the active layer
/// </summary>
/// <param name="sliceSetting"></param>
/// <returns></returns>
public bool SettingExistsInLayer(string sliceSetting, int layer=0)
{
bool settingExistsInLayer;
if (layer < activeSettingsLayers.Count)
{
settingExistsInLayer = (activeSettingsLayers[layer].settingsDictionary.ContainsKey(sliceSetting));
}
else
{
settingExistsInLayer = false;
}
return settingExistsInLayer;
}
public Vector2 GetActiveVector2(string sliceSetting)
{

View file

@ -23,6 +23,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
public int ActiveLayerIndex
{
get { return activeLayerIndex; }
}
public void SaveSetting(string settingKey, string settingValue)
{
ActiveSliceSettings.Instance.SaveValue(settingKey, settingValue, this.activeLayerIndex);