Move LoadPlateFromHistory from printer to bed

- Needs reference to private historyContainer in bed
This commit is contained in:
John Lewin 2018-10-04 19:28:41 -07:00
parent 51289443cc
commit f2c2011aa7
2 changed files with 16 additions and 16 deletions

View file

@ -184,6 +184,20 @@ namespace MatterHackers.MatterControl
return insertionGroup;
}
/// <summary>
/// Loads content to the bed and prepares edit/persistence context for use
/// </summary>
/// <param name="editContext"></param>
/// <returns></returns>
public async Task LoadPlateFromHistory()
{
await this.LoadContent(new EditContext()
{
ContentStore = historyContainer,
SourceItem = historyContainer.GetLastPlateOrNew()
});
}
public async Task StashAndPrintGCode(ILibraryItem libraryItem)
{
// Clear plate
@ -1050,20 +1064,6 @@ namespace MatterHackers.MatterControl
}
}
}
/// <summary>
/// Loads content to the bed and prepares edit/persistence context for use
/// </summary>
/// <param name="editContext"></param>
/// <returns></returns>
internal async Task LoadPlateFromHistory()
{
await this.Bed.LoadContent(new EditContext()
{
ContentStore = ApplicationController.Instance.Library.PlatingHistory,
SourceItem = BedConfig.GetLastPlateOrNew()
});
}
}
public class View3DConfig : INotifyPropertyChanged

View file

@ -162,7 +162,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
var printer = new PrinterConfig(await ProfileManager.LoadProfileAsync(printerID));
await printer.LoadPlateFromHistory();
await printer.Bed.LoadPlateFromHistory();
await ApplicationController.Instance.SetActivePrinter(printer);
}
@ -492,7 +492,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
ProfileManager.Instance.LastProfileID = guid;
var printer = new PrinterConfig(printerSettings);
await printer.LoadPlateFromHistory();
await printer.Bed.LoadPlateFromHistory();
await ApplicationController.Instance.SetActivePrinter(printer);