move the print canceled and complete messages to a dialog

issue: MatterHackers/MCCentral#5339
Change to Dialog Print Completed implementation
This commit is contained in:
LarsBrubaker 2019-04-20 21:56:11 -07:00
parent b2b256b263
commit 3ada6a08f4
6 changed files with 52 additions and 54 deletions

View file

@ -1946,21 +1946,24 @@ You will then need to logout and log back in to the computer for the changes to
}
}
public bool CalibrationPrint { get; private set; }
private CancellationTokenSource printingCancellation;
public async Task StartPrint(string gcodeFilename, PrintTask printTaskToUse = null, bool allowRecovery = true)
public async Task StartPrint(string gcodeFilename, PrintTask printTaskToUse = null, bool calibrationPrint = false)
{
var gcodeStream = new StreamReader(gcodeFilename);
await StartPrint(gcodeStream.BaseStream, gcodeFilename, printTaskToUse, allowRecovery);
await StartPrint(gcodeStream.BaseStream, gcodeFilename, printTaskToUse, calibrationPrint);
}
public async Task StartPrint(Stream gcodeStream, string gcodeFileNameForTask = null, PrintTask printTaskToUse = null, bool allowRecovery = true)
public async Task StartPrint(Stream gcodeStream, string gcodeFileNameForTask = null, PrintTask printTaskToUse = null, bool calibrationPrint = false)
{
if (!this.IsConnected || Printing)
{
return;
}
this.CalibrationPrint = calibrationPrint;
printingCancellation = new CancellationTokenSource();
haveReportedError = false;
@ -2001,7 +2004,7 @@ You will then need to logout and log back in to the computer for the changes to
if (gcodeFileNameForTask != null
&& activePrintTask == null
&& allowRecovery)
&& CalibrationPrint)
{
// TODO: Fix printerItemID int requirement
activePrintTask = new PrintTask