Added recovery count to the history data

MatterHackers/MCCentral#914
Track the recovered count to aid diagnostics
This commit is contained in:
Lars Brubaker 2016-12-14 11:26:53 -08:00
parent c9bd9aae0c
commit 53e6ff3eba
6 changed files with 38 additions and 3 deletions

View file

@ -334,6 +334,8 @@ namespace MatterHackers.MatterControl.DataStorage
public string PrintingGCodeFileName { get; set; }
public double RecoveryCount { get; set; }
public double PercentDone { get; set; }
public bool PrintComplete { get; set; }

View file

@ -146,7 +146,19 @@ namespace MatterHackers.MatterControl.PrintHistory
if (printTask.PercentDone > 0)
{
timeIndicator.AutoExpandBoundsToText = true;
timeIndicator.Text += " ({0:0.0}%)".FormatWith(printTask.PercentDone);
timeIndicator.Text += $" ({printTask.PercentDone:0.0}%)";
if(printTask.RecoveryCount > 0)
{
if (printTask.RecoveryCount == 1)
{
timeIndicator.Text += " - " + "recovered once".Localize();
}
else
{
timeIndicator.Text += " - " + "recovered {0} times".FormatWith(printTask.RecoveryCount);
}
}
}
timeIndicator.Margin = new BorderDouble(right: 6);

View file

@ -2222,6 +2222,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication
private void AttemptToConnect(string serialPortName, int baudRate)
{
// make sure we don't have a left over print task
activePrintTask = null;
connectionFailureMessage = LocalizedString.Get("Unknown Reason");
if (PrinterIsConnected)
@ -2450,6 +2453,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication
&& activePrintTask != null) // We are resuming a failed print (do lots of interesting stuff).
{
pauseHandlingStream1 = new PauseHandlingStream(new PrintRecoveryStream(gCodeFileStream0, activePrintTask.PercentDone));
// And increment the recovery count
activePrintTask.RecoveryCount++;
activePrintTask.Commit();
}
else
{

View file

@ -5671,3 +5671,18 @@ Translated:Discard Changes
English:Stay Connected
Translated:Stay Connected
English:Cancel Print
Translated:Cancel Print
English:Continue Printing
Translated:Continue Printing
English:Recovered Once
Translated:Recovered Once
English:Recovered once
Translated:Recovered once
English:recovered once
Translated:recovered once

@ -1 +1 @@
Subproject commit 3a04f46f41c96a0ce5f084112d2ff0000a1d9ac3
Subproject commit 17c395640e43ceb5a4803611a8bbfe4cacd72d84

@ -1 +1 @@
Subproject commit 9a88dacf7849a32b08e4be1497ac18037d151970
Subproject commit f7a23ccde5b894dc12bd1fdba867dcb1008013f5