Revise export interface to support reporting

- Issue MatterHackers/MCCentral#3975
Show progress when exporting G-Code files
This commit is contained in:
John Lewin 2018-08-17 17:49:41 -07:00
parent 01c9a1d581
commit a94076cca4
9 changed files with 86 additions and 47 deletions

View file

@ -27,10 +27,13 @@ of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
@ -56,7 +59,7 @@ namespace MatterHackers.MatterControl.Library.Export
public bool ExportPossible(ILibraryAsset libraryItem) => true;
public Task<bool> Generate(IEnumerable<ILibraryItem> libraryItems, string outputPath)
public Task<bool> Generate(IEnumerable<ILibraryItem> libraryItems, string outputPath, IProgress<ProgressStatus> progress, CancellationToken cancellationToken)
{
if (libraryItems.OfType<ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem)
{