Merge commit '34c3d16fd7' into development
Conflicts: ActionBar/PrintStatusRow.cs
This commit is contained in:
commit
180dbe5896
38 changed files with 422 additions and 321 deletions
|
|
@ -56,20 +56,37 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
addButton.tooltipText = new LocalizedString("Add a file to be printed").Translated;
|
||||
addButton.Margin = new BorderDouble(0, 6, 6, 3);
|
||||
|
||||
startButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton("Start", "icon_play_32x32.png");
|
||||
startButton.tooltipText = "Begin printing the selected item.";
|
||||
startButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton(new LocalizedString("Start").Translated, "icon_play_32x32.png");
|
||||
startButton.tooltipText = new LocalizedString("Begin printing the selected item.").Translated;
|
||||
startButton.Margin = new BorderDouble(0, 6, 6, 3);
|
||||
|
||||
skipButton = makeButton("Skip", "Skip the current item and move to the next in queue");
|
||||
removeButton = makeButton("Remove", "Remove current item from queue");
|
||||
string skipButtonTxt = new LocalizedString("Skip").Translated;
|
||||
string skipButtonMessage = new LocalizedString("Skip the current item and move to the next in queue").Translated;
|
||||
skipButton = makeButton(skipButtonTxt, skipButtonMessage);
|
||||
|
||||
pauseButton = makeButton("Pause", "Pause the current print");
|
||||
cancelButton = makeButton("Cancel", "Stop the current print");
|
||||
string removeButtonTxt = new LocalizedString("Remove").Translated;
|
||||
string removeButtonMessage = new LocalizedString("Remove current item from queue").Translated;
|
||||
removeButton = makeButton(removeButtonTxt, removeButtonMessage);
|
||||
|
||||
resumeButton = makeButton("Resume", "Resume the current print");
|
||||
string pauseButtonTxt = new LocalizedString("Pause").Translated;
|
||||
string pauseButtonMessage = new LocalizedString("Pause the current print").Translated;
|
||||
pauseButton = makeButton(pauseButtonTxt, pauseButtonMessage);
|
||||
|
||||
reprintButton = makeButton("Reprint", "Print current item again");
|
||||
doneWithCurrentPartButton = makeButton("Done", "Move to next print in queue");
|
||||
string cancelButtonTxt = new LocalizedString("Cancel").Translated;
|
||||
string cancelButtonMessage = new LocalizedString("Stop the current print").Translated;
|
||||
cancelButton = makeButton(cancelButtonTxt, cancelButtonMessage);
|
||||
|
||||
string resumeButtonTxt = new LocalizedString("Resume").Translated;
|
||||
string resumeButtonMessage = new LocalizedString ("Resume the current print").Translated;
|
||||
resumeButton = makeButton(resumeButtonTxt, resumeButtonMessage);
|
||||
|
||||
string reprintButtonTxt = new LocalizedString("Reprint").Translated;
|
||||
string reprintButtonMessage = new LocalizedString ("Print current item again").Translated;
|
||||
reprintButton = makeButton(reprintButtonTxt, reprintButtonMessage);
|
||||
|
||||
string doneCurrentPartButtonTxt = new LocalizedString ("Done").Translated;
|
||||
string doenCurrentPartButtonMessage = new LocalizedString ("Move to next print in queue").Translated;
|
||||
doneWithCurrentPartButton = makeButton(doneCurrentPartButtonTxt, doenCurrentPartButtonMessage);
|
||||
|
||||
this.AddChild(addButton);
|
||||
allPrintButtons.Add(addButton);
|
||||
|
|
|
|||
|
|
@ -116,14 +116,16 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
topRow.Name = "PrintStatusRow.ActivePrinterInfo.TopRow";
|
||||
topRow.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
||||
activePrintLabel = getPrintStatusLabel(new LocalizedString("Next Print:").Translated, pointSize: 11);
|
||||
string nextPrintLbl = new LocalizedString("Next Print").Translated;
|
||||
string nextPrintLblFull = string.Format("{0}:", nextPrintLbl);
|
||||
activePrintLabel = getPrintStatusLabel(nextPrintLblFull, pointSize: 11);
|
||||
activePrintLabel.VAnchor = VAnchor.ParentTop;
|
||||
|
||||
topRow.AddChild(activePrintLabel);
|
||||
|
||||
activePrintName = getPrintStatusLabel("this is the biggest name we will allow", pointSize: 14);
|
||||
activePrintName = getPrintStatusLabel(new LocalizedString("this is the biggest name we will allow").Translated, pointSize: 14);
|
||||
activePrintName.AutoExpandBoundsToText = false;
|
||||
activePrintStatus = getPrintStatusLabel("this is the biggest label we will allow - bigger", pointSize: 11);
|
||||
activePrintStatus = getPrintStatusLabel(new LocalizedString("this is the biggest label we will allow - bigger").Translated, pointSize: 11);
|
||||
activePrintStatus.AutoExpandBoundsToText = false;
|
||||
activePrintStatus.Text = "";
|
||||
activePrintStatus.Margin = new BorderDouble(top: 3);
|
||||
|
|
@ -199,15 +201,84 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
if (PrinterCommunication.Instance.ActivePrintItem != null)
|
||||
{
|
||||
|
||||
int secondsPrinted = PrinterCommunication.Instance.SecondsPrinted;
|
||||
int hoursPrinted = (int)(secondsPrinted / (60 * 60));
|
||||
int minutesPrinted = (int)(secondsPrinted / 60 - hoursPrinted * 60);
|
||||
secondsPrinted = secondsPrinted % 60;
|
||||
string timePrintedText;
|
||||
if (hoursPrinted > 0)
|
||||
{
|
||||
string printTimeLbl = new LocalizedString ("Print Time").Translated;
|
||||
timePrintedText = string.Format("{3}: {0}:{1:00}:{2:00}",
|
||||
hoursPrinted,
|
||||
minutesPrinted,
|
||||
secondsPrinted,
|
||||
printTimeLbl);
|
||||
}
|
||||
else
|
||||
{
|
||||
string printTimeLbl = new LocalizedString ("Print Time").Translated;
|
||||
timePrintedText = string.Format("{2}: {0:00}:{1:00}",
|
||||
minutesPrinted,
|
||||
secondsPrinted,
|
||||
printTimeLbl);
|
||||
}
|
||||
|
||||
int secondsRemaining = PrinterCommunication.Instance.SecondsRemaining;
|
||||
int hoursRemaining = (int)(secondsRemaining / (60 * 60));
|
||||
int minutesRemaining = (int)(secondsRemaining / 60 - hoursRemaining * 60);
|
||||
secondsRemaining = secondsRemaining % 60;
|
||||
string timeRemainingText;
|
||||
if (secondsRemaining > 0)
|
||||
{
|
||||
if (hoursRemaining > 0)
|
||||
{
|
||||
string timeRemainingLbl = new LocalizedString ("Remaining").Translated;
|
||||
timeRemainingText = string.Format("{3} (est): {0}:{1:00}:{2:00}",
|
||||
hoursRemaining,
|
||||
minutesRemaining,
|
||||
secondsRemaining,
|
||||
timeRemainingLbl);
|
||||
}
|
||||
else
|
||||
{
|
||||
string timeRemainingLbl = new LocalizedString ("Remaining").Translated;
|
||||
timeRemainingText = string.Format("{2} (est): {0:00}:{1:00}",
|
||||
minutesRemaining,
|
||||
secondsRemaining,
|
||||
timeRemainingLbl);
|
||||
}
|
||||
}
|
||||
else if (PrinterCommunication.Instance.PrintIsFinished)
|
||||
{
|
||||
timeRemainingText = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
string timeRemainingLbl = new LocalizedString ("Remaining").Translated;
|
||||
timeRemainingText = string.Format("{0} (est): --:--",
|
||||
timeRemainingLbl,
|
||||
secondsPrinted / 60,
|
||||
secondsPrinted % 60);
|
||||
}
|
||||
|
||||
string printTimeInfoText = timePrintedText;
|
||||
if (timeRemainingText != "")
|
||||
{
|
||||
printTimeInfoText += ", " + timeRemainingText;
|
||||
}
|
||||
//GC.WaitForFullGCComplete();
|
||||
|
||||
string printPercentRemainingText;
|
||||
printPercentRemainingText = string.Format("{0:0.0}% complete", PrinterCommunication.Instance.PercentComplete);
|
||||
string printPercentCompleteTxt = new LocalizedString("complete").Translated;
|
||||
printPercentRemainingText = string.Format("{0:0.0}% {1}", PrinterCommunication.Instance.PercentComplete,printPercentCompleteTxt);
|
||||
|
||||
switch (PrinterCommunication.Instance.CommunicationState)
|
||||
{
|
||||
case PrinterCommunication.CommunicationStates.PreparingToPrint:
|
||||
activePrintLabel.Text = "Preparing To Print:";
|
||||
case PrinterCommunication.CommunicationStates.PreparingToPrint:
|
||||
string preparingPrintLbl = new LocalizedString("Preparing To Print").Translated;
|
||||
string preparingPrintLblFull = string.Format("{0}:", preparingPrintLbl);
|
||||
activePrintLabel.Text = preparingPrintLblFull;
|
||||
//ActivePrintStatusText = ""; // set by slicer
|
||||
activePrintInfo.Text = "";
|
||||
break;
|
||||
|
|
@ -221,13 +292,17 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
case PrinterCommunication.CommunicationStates.Paused:
|
||||
{
|
||||
activePrintLabel.Text = "Printing Paused:";
|
||||
string activePrintLblTxt = new LocalizedString ("Printing Paused").Translated;
|
||||
string activePrintLblTxtFull = string.Format("{0}:", activePrintLblTxt);
|
||||
activePrintLabel.Text = activePrintLblTxtFull;
|
||||
ActivePrintStatusText = printPercentRemainingText;
|
||||
}
|
||||
break;
|
||||
|
||||
case PrinterCommunication.CommunicationStates.FinishedPrint:
|
||||
activePrintLabel.Text = "Done Printing:";
|
||||
case PrinterCommunication.CommunicationStates.FinishedPrint:
|
||||
string donePrintingTxt = new LocalizedString ("Done Printing").Translated;
|
||||
string donePrintingTxtFull = string.Format ("{0}:", donePrintingTxt);
|
||||
activePrintLabel.Text = donePrintingTxtFull;
|
||||
ActivePrintStatusText = printPercentRemainingText;
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue