Merge commit '34c3d16fd7' into development

Conflicts:
	ActionBar/PrintStatusRow.cs
This commit is contained in:
Kevin Pope 2014-02-11 11:49:10 -08:00
commit 180dbe5896
38 changed files with 422 additions and 321 deletions

View file

@ -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);

View file

@ -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;

View file

@ -7,6 +7,7 @@ using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Font;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -75,14 +76,14 @@ namespace MatterHackers.MatterControl
FlowLayoutWidget yesNoButtonsFlow = new FlowLayoutWidget();
yesNoButtonsFlow.HAnchor |= HAnchor.ParentCenter;
Button yesButton = textImageButtonFactory.Generate("Yes", centerText:true);
Button yesButton = textImageButtonFactory.Generate(new LocalizedString("Yes").Translated, centerText:true);
yesButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
yesNoButtonsFlow.AddChild(yesButton);
GuiWidget buttonSpacer = new GuiWidget(10, 10);
yesNoButtonsFlow.AddChild(buttonSpacer);
Button noButton = textImageButtonFactory.Generate("No", centerText: true);
Button noButton = textImageButtonFactory.Generate(new LocalizedString("No").Translated, centerText: true);
noButton.Click += new ButtonBase.ButtonEventHandler(noButton_Click);
yesNoButtonsFlow.AddChild(noButton);
@ -92,7 +93,7 @@ namespace MatterHackers.MatterControl
case MessageType.OK:
{
Button okButton = textImageButtonFactory.Generate("Ok", centerText: true);
Button okButton = textImageButtonFactory.Generate(new LocalizedString("Ok").Translated, centerText: true);
//okButton.DebugShowBounds = true;
okButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click);
okButton.HAnchor = HAnchor.ParentCenter;

View file

@ -5,6 +5,7 @@ using System.Text;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -64,7 +65,7 @@ namespace MatterHackers.MatterControl
// TODO: This hack needs a unit test and then pass and then remove this line.
this.MinimumSize = new VectorMath.Vector2(0, numberInputField.Height);
setButton = textImageButtonFactory.Generate("SET");
setButton = textImageButtonFactory.Generate("SET");
setButton.VAnchor = VAnchor.ParentCenter;
setButton.Margin = new BorderDouble(left: 6);
setButton.Visible = false;

View file

@ -111,6 +111,11 @@ namespace MatterHackers.MatterControl
}
void exportGCode_Click(object sender, MouseEventArgs mouseEvent)
{
UiThread.RunOnIdle(DoExportGCode_Click);
}
void DoExportGCode_Click(object state)
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Export GCode|*.gcode", title: "Export GCode");
saveParams.Title = "MatterControl: Export File";
@ -178,6 +183,11 @@ namespace MatterHackers.MatterControl
}
void exportSTL_Click(object sender, MouseEventArgs mouseEvent)
{
UiThread.RunOnIdle(DoExportSTL_Click);
}
void DoExportSTL_Click(object state)
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
saveParams.Title = "MatterControl: Export File";

View file

@ -156,7 +156,7 @@ namespace MatterHackers.MatterControl
double maxSize = Math.Max(aabb.XSize, aabb.YSize);
double scale = thumbnailWidget.image.Width / (maxSize * 1.2);
RectangleDouble bounds2D = new RectangleDouble(aabb.minXYZ.x, aabb.minXYZ.y, aabb.maxXYZ.x, aabb.maxXYZ.y);
PolygonMesh.Processors.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh,
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh,
new Vector2((thumbnailWidget.image.Width / scale - bounds2D.Width) / 2 - bounds2D.Left,
(thumbnailWidget.image.Height / scale - bounds2D.Height) / 2 - bounds2D.Bottom),
scale,

View file

@ -1,70 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Font;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.ImageProcessing;
using MatterHackers.Agg.OpenGlGui;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.MarchingSquares;
using MatterHackers.MatterControl;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PartPreviewWindow;
using MatterHackers.MatterControl.PrintLibrary;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.MeshVisualizer;
using MatterHackers.PolygonMesh;
using MatterHackers.PolygonMesh.Csg;
using MatterHackers.PolygonMesh.Processors;
using MatterHackers.RayTracer;
using MatterHackers.RayTracer.Traceable;
using MatterHackers.RenderOpenGl;
using MatterHackers.VectorMath;
namespace MatterHackers.Agg.UI
{
public class PerformanceFeedbackWindow : SystemWindow
{
string timingString;
StyledTypeFace boldFont;
public PerformanceFeedbackWindow()
: base(700, 480)
{
BackgroundColor = RGBA_Bytes.White;
ShowAsSystemWindow();
string staticDataPath = ApplicationDataStorage.Instance.ApplicationStaticDataPath;
string fontPath = Path.Combine(staticDataPath, "Fonts", "LiberationMono.svg");
TypeFace boldTypeFace = TypeFace.LoadSVG(fontPath);
boldFont = new StyledTypeFace(boldTypeFace, 12);
}
public override void OnDraw(Graphics2D graphics2D)
{
TypeFacePrinter stringPrinter = new TypeFacePrinter(timingString, boldFont, new Vector2(0, Height - 16));
stringPrinter.DrawFromHintedCache = true;
stringPrinter.Render(graphics2D, RGBA_Bytes.Black);
base.OnDraw(graphics2D);
}
void SetDisplay(string timingString)
{
this.timingString = timingString;
Invalidate();
}
public void ShowResults(double totalTimeTracked)
{
string timingString = ExecutionTimer.Instance.GetResults(totalTimeTracked);
SetDisplay(timingString);
}
}
}

View file

@ -5,6 +5,7 @@ using System.Text;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -56,13 +57,13 @@ namespace MatterHackers.MatterControl
FlowLayoutWidget buttonBar = new FlowLayoutWidget();
textImageButtonFactory.FixedWidth = 60;
backButton = textImageButtonFactory.Generate("Back", centerText: true);
backButton = textImageButtonFactory.Generate(new LocalizedString("Back").Translated, centerText: true);
backButton.Click += new ButtonBase.ButtonEventHandler(back_Click);
nextButton = textImageButtonFactory.Generate("Next", centerText: true);
nextButton = textImageButtonFactory.Generate(new LocalizedString("Next").Translated, centerText: true);
nextButton.Click += new ButtonBase.ButtonEventHandler(next_Click);
doneButton = textImageButtonFactory.Generate("Done", centerText: true);
doneButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated, centerText: true);
doneButton.Click += new ButtonBase.ButtonEventHandler(done_Click);
textImageButtonFactory.FixedWidth = 0;
@ -82,7 +83,7 @@ namespace MatterHackers.MatterControl
UiThread.RunOnIdle(CloseOnIdle);
}
void CloseOnIdle(object state)
void CloseOnIdle(object state)
{
Close();
}

View file

@ -74,7 +74,6 @@
<Compile Include="ActionBar\PrintStatusRow.cs" />
<Compile Include="CustomWidgets\ExportQueueItemWindow.cs" />
<Compile Include="CustomWidgets\ExportToFolderFeedbackWindow.cs" />
<Compile Include="CustomWidgets\PerformanceFeedbackWindow.cs" />
<Compile Include="FieldValidation.cs" />
<Compile Include="PartPreviewWindow\CreateDiscreteMeshes.cs" />
<Compile Include="CustomWidgets\EditableNumberDisplay.cs" />
@ -126,7 +125,6 @@
<Compile Include="PartPreviewWindow\PartPreviewMainWindow.cs" />
<Compile Include="PartsSheet.cs" />
<Compile Include="JsonResponseDictionary.cs" />
<Compile Include="OrthographicZProjection.cs" />
<Compile Include="PrinterCommunication.cs" />
<Compile Include="PrinterControls\PrintLeveling.cs" />
<Compile Include="PrinterControls\OutputScrollWindow.cs" />

View file

@ -1,18 +1,11 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="SliceConfiguration\SliceSettingsWidget.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="PrintLevelWizard.cs">
<Files>
<File FileName="MatterControlApplication.cs" Line="1" Column="1" />
<File FileName="..\agg-sharp\OpenGlGui\TrackballTumbleWidget.cs" Line="1" Column="1" />
<File FileName="Localizations\LocalizedString.cs" Line="1" Column="1" />
<File FileName="MainSlidePanel.cs" Line="1" Column="1" />
<File FileName="WidescreenPanel.cs" Line="1" Column="1" />
<File FileName="SliceConfiguration\SettingsControlBar.cs" Line="34" Column="10" />
<File FileName="SliceConfiguration\ActiveSliceSettings.cs" Line="514" Column="109" />
<File FileName="SliceConfiguration\SliceSettingsLayerSelector.cs" Line="1" Column="1" />
<File FileName="SliceConfiguration\SliceSettingsOrganizer.cs" Line="286" Column="36" />
<File FileName="SliceConfiguration\SliceSettingsWidget.cs" Line="449" Column="118" />
<File FileName="PartPreviewWindow\GcodeViewBasic.cs" Line="1" Column="1" />
<File FileName="c:\Users\Matter Hackers 1\Development\agg-sharp\Gui\GUIWidget.cs" Line="2116" Column="1" />
<File FileName="PrintLevelWizard.cs" Line="392" Column="40" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>

View file

@ -67,10 +67,10 @@ namespace MatterHackers.MatterControl
string[] commandLineArgs = null;
bool firstDraw = true;
public MatterControlApplication(string[] commandLineArgs, double width, double height)
public MatterControlApplication(double width, double height)
: base(width, height)
{
this.commandLineArgs = commandLineArgs;
this.commandLineArgs = Environment.GetCommandLineArgs();;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
//WriteTestGCodeFile();
@ -264,7 +264,12 @@ namespace MatterHackers.MatterControl
#if false
if (timingWindow == null)
{
timingWindow = new PerformanceFeedbackWindow();
string staticDataPath = ApplicationDataStorage.Instance.ApplicationStaticDataPath;
string fontPath = Path.Combine(staticDataPath, "Fonts", "LiberationMono.svg");
TypeFace boldTypeFace = TypeFace.LoadSVG(fontPath);
typeFaceToUse = new StyledTypeFace(boldTypeFace, 12);
timingWindow = new PerformanceFeedbackWindow();
}
{
if (totalDrawTime.Elapsed.TotalSeconds > .05)
@ -299,7 +304,7 @@ namespace MatterHackers.MatterControl
}
[STAThread]
public static void Main(string[] commandLineArgs)
public static void Main()
{
Datastore.Instance.Initialize();
@ -314,7 +319,7 @@ namespace MatterHackers.MatterControl
height = int.Parse(sizes[1]);
}
//MessageBox.ShowMessageBox(timerInfo, "Timing", MessageBox.MessageType.OK);
new MatterControlApplication(commandLineArgs, width, height);
new MatterControlApplication(width, height);
}
public override void OnClosed(EventArgs e)

View file

@ -1,77 +0,0 @@
/*
Copyright (c) 2013, Lars Brubaker
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MatterHackers.PolygonMesh;
using MatterHackers.VectorMath;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.VertexSource;
namespace MatterHackers.PolygonMesh.Processors
{
public static class OrthographicZProjection
{
public static void DrawTo(Graphics2D graphics2D, Mesh meshToDraw, Vector2 offset, double scale, RGBA_Bytes silhouetteColor)
{
graphics2D.Rasterizer.gamma(new gamma_power(.3));
PathStorage polygonProjected = new PathStorage();
foreach (Face face in meshToDraw.Faces)
{
if (face.normal.z > 0)
{
polygonProjected.remove_all();
bool first = true;
foreach (FaceEdge faceEdge in face.FaceEdgeIterator())
{
Vector2 position = new Vector2(faceEdge.vertex.Position.x, faceEdge.vertex.Position.y);
position += offset;
position *= scale;
if (first)
{
polygonProjected.MoveTo(position.x, position.y);
first = false;
}
else
{
polygonProjected.LineTo(position.x, position.y);
}
}
graphics2D.Render(polygonProjected, silhouetteColor);
}
}
graphics2D.Rasterizer.gamma(new gamma_none());
}
}
}

View file

@ -39,7 +39,6 @@ using MatterHackers.Agg.ImageProcessing;
using MatterHackers.Agg.VertexSource;
using MatterHackers.MarchingSquares;
using MatterHackers.PolygonMesh;
using MatterHackers.PolygonMesh.Processors;
using MatterHackers.VectorMath;
using ClipperLib;
@ -67,7 +66,7 @@ namespace MatterHackers.MatterControl
double scaleFactor = 5;
ImageBuffer partPlate = new ImageBuffer((int)(buildVolume.x * scaleFactor), (int)(buildVolume.y * scaleFactor), 32, new BlenderBGRA());
Vector2 renderOffset = new Vector2(buildVolume.x / 2, buildVolume.y / 2) - new Vector2(partBounds.Center.x, partBounds.Center.y);
PolygonMesh.Processors.OrthographicZProjection.DrawTo(partPlate.NewGraphics2D(), meshToSplit, renderOffset, scaleFactor, RGBA_Bytes.White);
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partPlate.NewGraphics2D(), meshToSplit, renderOffset, scaleFactor, RGBA_Bytes.White);
if (backgroundWorker != null)
{

View file

@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
else
{
startingMessage = "Press 'generate' to view layers";
startingMessage = new LocalizedString("Press 'generate' to view layers").Translated;
}
if (File.Exists(gcodePathAndFileName) && gcodeFileIsComplete)
@ -208,7 +208,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
BorderDouble buttonMargin = new BorderDouble(top: 3);
expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Model", "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Model").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandModelOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandModelOptions);
expandModelOptions.Checked = true;
@ -218,7 +218,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
//modelOptionsContainer.Visible = false;
buttonRightPanel.AddChild(modelOptionsContainer);
expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Layer", "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Layer").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandLayerOptions.Margin = new BorderDouble(bottom: 2);
//buttonRightPanel.AddChild(expandLayerOptions);
@ -227,7 +227,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layerOptionsContainer.Visible = false;
buttonRightPanel.AddChild(layerOptionsContainer);
expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Display", "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Display").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandDisplayOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandDisplayOptions);
expandDisplayOptions.Checked = true;
@ -265,8 +265,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.HAnchor = HAnchor.ParentLeftRight;
modelInfoContainer.Padding = new BorderDouble(5);
string printTimeLbl = new LocalizedString ("Print Time").Translated;
string printTimeLblFull = string.Format ("{0}:", printTimeLbl);
// put in the print time
modelInfoContainer.AddChild(new TextWidget("Print Time:", textColor: RGBA_Bytes.White));
modelInfoContainer.AddChild(new TextWidget(printTimeLblFull, textColor: RGBA_Bytes.White));
{
string timeRemainingText = "---";
@ -294,8 +296,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
//modelInfoContainer.AddChild(new TextWidget("Size:", textColor: RGBA_Bytes.White));
string filamentLengthLbl = new LocalizedString ("Filament Length").Translated;
string filamentLengthLblFull = string.Format ("{0}:", filamentLengthLbl);
// show the filament used
modelInfoContainer.AddChild(new TextWidget("Filament Length:", textColor: RGBA_Bytes.White));
modelInfoContainer.AddChild(new TextWidget(filamentLengthLblFull, textColor: RGBA_Bytes.White));
{
double filamentUsed = gcodeViewWidget.LoadedGCode.GetFilamentUsedMm(ActiveSliceSettings.Instance.NozzleDiameter);
@ -305,7 +309,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.AddChild(estimatedPrintTime);
}
modelInfoContainer.AddChild(new TextWidget("Filament Volume:", textColor: RGBA_Bytes.White));
string filamentVolumeLbl = new LocalizedString ("Filament Volume").Translated;
string filamentVolumeLblFull = string.Format("{0}:", filamentVolumeLbl);
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLblFull, textColor: RGBA_Bytes.White));
{
var density = 1.0;
string filamentType = "PLA";
@ -326,7 +332,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.AddChild(estimatedPrintTime);
}
modelInfoContainer.AddChild(new TextWidget("Weight:", textColor: RGBA_Bytes.White));
string weightLbl = new LocalizedString("Weight").Translated;
string weightLblFull = string.Format("{0}:", weightLbl);
modelInfoContainer.AddChild(new TextWidget(weightLblFull, textColor: RGBA_Bytes.White));
{
var density = 1.0;
string filamentType = "PLA";
@ -386,7 +394,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layerInfoContainer.Padding = new BorderDouble(5);
// put in a show grid check box
CheckBox showGrid = new CheckBox("Show Grid", textColor: RGBA_Bytes.White);
CheckBox showGrid = new CheckBox(new LocalizedString("Show Grid").Translated, textColor: RGBA_Bytes.White);
showGrid.Checked = gcodeViewWidget.RenderGrid;
showGrid.CheckedStateChanged += (sender, e) =>
{
@ -395,7 +403,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layerInfoContainer.AddChild(showGrid);
// put in a show moves checkbox
CheckBox showMoves = new CheckBox("Show Moves", textColor: RGBA_Bytes.White);
CheckBox showMoves = new CheckBox(new LocalizedString("Show Moves").Translated, textColor: RGBA_Bytes.White);
showMoves.Checked = gcodeViewWidget.RenderMoves;
showMoves.CheckedStateChanged += (sender, e) =>
{
@ -625,7 +633,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.AddChild(editCurrentLayerIndex);
gcodeViewWidget.ActiveLayerChanged += new EventHandler(gcodeViewWidget_ActiveLayerChanged);
setLayerButton = textImageButtonFactory.Generate("Go");
setLayerButton = textImageButtonFactory.Generate(new LocalizedString("Go").Translated);
setLayerButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
setLayerButton.Click += new Button.ButtonEventHandler(layerCountTextWidget_EditComplete);
this.AddChild(setLayerButton);

View file

@ -28,22 +28,15 @@ either expressed or implied, of the FreeBSD Project.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.OpenGlGui;
using MatterHackers.PolygonMesh;
using MatterHackers.RenderOpenGl;
using MatterHackers.VectorMath;
using MatterHackers.Agg.Font;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.Localizations;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl.PartPreviewWindow
{
@ -116,9 +109,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
#if false
if (timingWindow == null)
{
timingWindow = new PerformanceFeedbackWindow();
}
{
string staticDataPath = ApplicationDataStorage.Instance.ApplicationStaticDataPath;
string fontPath = Path.Combine(staticDataPath, "Fonts", "LiberationMono.svg");
TypeFace boldTypeFace = TypeFace.LoadSVG(fontPath);
timingWindow = new PerformanceFeedbackWindow(new StyledTypeFace(boldTypeFace, 12));
//}
//{
timingWindow.ShowResults(totalDrawTime.Elapsed.TotalSeconds);
}
#endif

View file

@ -419,7 +419,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (Meshes.Count > 0)
{
processingProgressControl.textWidget.Text = new LocalizedString("Making Copy:").Translated;
string makingCopyLabel = new LocalizedString("Making Copy").Translated;
string makingCopyLabelFull = string.Format ("{0}:", makingCopyLabel);
processingProgressControl.textWidget.Text = makingCopyLabelFull;
processingProgressControl.Visible = true;
processingProgressControl.PercentComplete = 0;
LockEditControls();
@ -587,7 +589,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (Meshes.Count > 0)
{
processingProgressControl.textWidget.Text = "Loading Parts:";
string loadingPartLabel = new LocalizedString("Loading Parts").Translated;
string loadingPartLabelFull = string.Format("{0}:", loadingPartLabel);
processingProgressControl.textWidget.Text = loadingPartLabelFull;
processingProgressControl.Visible = true;
processingProgressControl.PercentComplete = 0;
LockEditControls();
@ -938,7 +942,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// put in the part info display
if(false)
{
CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Part Info", "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Part Info").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandPartInfoOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandPartInfoOptions);
@ -953,7 +957,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
PartInfoOptionContainer.Margin = new BorderDouble(8, 3);
TextWidget sizeInfo = new TextWidget("Size:", textColor: RGBA_Bytes.White);
string sizeInfoLbl = new LocalizedString("Size").Translated;
string sizeInfoLblFull = string.Format("{0}:", sizeInfoLbl);
TextWidget sizeInfo = new TextWidget(sizeInfoLblFull, textColor: RGBA_Bytes.White);
PartInfoOptionContainer.AddChild(sizeInfo);
TextWidget xSizeInfo = new TextWidget(" x 10.1", pointSize: 10, textColor: RGBA_Bytes.White);
xSizeInfo.AutoExpandBoundsToText = true;
@ -1039,7 +1045,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
scaleRatioContainer.HAnchor = HAnchor.ParentLeftRight;
scaleRatioContainer.Padding = new BorderDouble(5);
TextWidget scaleRatioLabel = new TextWidget(new LocalizedString("Ratio:").Translated, textColor: RGBA_Bytes.White);
string scaleRatioLblTxt = new LocalizedString("Ratio").Translated;
string scaleRatioLblTxtFull = string.Format("{0}:", scaleRatioLblTxt);
TextWidget scaleRatioLabel = new TextWidget(scaleRatioLblTxtFull, textColor: RGBA_Bytes.White);
scaleRatioLabel.VAnchor = VAnchor.ParentCenter;
scaleRatioContainer.AddChild(scaleRatioLabel);
@ -1114,7 +1122,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
buttonPanel.AddChild(presetScaleMenu);
applyScaleButton = whiteButtonFactory.Generate("Apply Scale", centerText: true);
applyScaleButton = whiteButtonFactory.Generate(new LocalizedString("Apply Scale").Translated, centerText: true);
applyScaleButton.Visible = false;
applyScaleButton.Cursor = Cursors.Hand;
buttonPanel.AddChild(applyScaleButton);
@ -1178,7 +1186,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
GuiWidget horizontalSpacer = new GuiWidget();
horizontalSpacer.HAnchor = HAnchor.ParentLeftRight;
TextWidget degreesLabel = new TextWidget(new LocalizedString("Degrees:").Translated, textColor: RGBA_Bytes.White);
string degreesLabelTxt = new LocalizedString("Degrees").Translated;
string degreesLabelTxtFull = string.Format("{0}:", degreesLabelTxt);
TextWidget degreesLabel = new TextWidget(degreesLabelTxt, textColor: RGBA_Bytes.White);
degreesContainer.AddChild(degreesLabel);
degreesContainer.AddChild(horizontalSpacer);
@ -1385,9 +1395,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
processingProgressControl.PercentComplete = 0;
LockEditControls();
// we sent the data to the asynch lists but we will not pull it back out (only use it as a temp holder).
PushMeshDataToAsynchLists(true);
BackgroundWorker mergeAndSavePartsBackgroundWorker = new BackgroundWorker();
mergeAndSavePartsBackgroundWorker.WorkerReportsProgress = true;
@ -1401,6 +1408,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
void mergeAndSavePartsBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
// we sent the data to the asynch lists but we will not pull it back out (only use it as a temp holder).
PushMeshDataToAsynchLists(true);
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
BackgroundWorker backgroundWorker = (BackgroundWorker)sender;
try

View file

@ -182,7 +182,7 @@ namespace MatterHackers.MatterControl
Stroke rectOutline = new Stroke(rect, strokeWidth);
partGraphics2D.Render(rectOutline, RGBA_Bytes.DarkGray);
PolygonMesh.Processors.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh, new Vector2(-bounds2D.Left + PartMarginMM, -bounds2D.Bottom + textSpaceMM + PartMarginMM), PixelPerMM, RGBA_Bytes.Black);
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh, new Vector2(-bounds2D.Left + PartMarginMM, -bounds2D.Bottom + textSpaceMM + PartMarginMM), PixelPerMM, RGBA_Bytes.Black);
partGraphics2D.Render(typeFacePrinter, RGBA_Bytes.Black);
partImagesToPrint.Add(new PartImage(imageOfPart));

View file

@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2013, Lars Brubaker
All rights reserved.
@ -37,6 +37,7 @@ using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using MatterHackers.Agg.Font;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -205,8 +206,15 @@ namespace MatterHackers.MatterControl
public class GetCoarseBedHeight : FindBedHeight
{
static string setZHeightCoarseInstruction1 = "Using the [Z] controls on this screen, we will now take a coarse measurement of the extruder height at this position.";
static string setZHeightCoarseInstruction2 = "\t• Place the paper under the extruder\n\t• Using the above contols\n\t• Press [Z-] until there is resistance to moving the paper\n\t• Press [Z+] once to release the paper\n\nFinally click 'Next' to continue.";
static string setZHeightCoarseInstruction1 = new LocalizedString("Using the [Z] controls on this screen, we will now take a coarse measurement of the extruder height at this position.").Translated;
static string setZHeightCourseInstructTxtOne = new LocalizedString("Place the paper under the extruder").Translated;
static string setZHeightCourseInstructTxtTwo = new LocalizedString("Using the above contols").Translated;
static string setZHeightCourseInstructTxtThree = new LocalizedString("Press [Z-] until there is resistance to moving the paper").Translated;
static string setZHeightCourseInstructTxtFour = new LocalizedString("Press [Z+] once to release the paper").Translated;
static string setZHeightCourseInstructTxtFive = new LocalizedString("Finally click 'Next' to continue.").Translated;
static string setZHeightCoarseInstruction2 = string.Format("\t• {0}\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}", setZHeightCourseInstructTxtOne, setZHeightCourseInstructTxtTwo, setZHeightCourseInstructTxtThree,setZHeightCourseInstructTxtFour, setZHeightCourseInstructTxtFive);
Vector3 probeStartPosition;
WizardControl container;
@ -244,8 +252,11 @@ namespace MatterHackers.MatterControl
public class GetFineBedHeight : FindBedHeight
{
static string setZHeightFineInstruction1 = "We will now refine our measurement of the extruder height at this position.";
static string setZHeightFineInstruction2 = "\t• Press [Z-] until there is resistance to moving the paper\n\t• Press [Z+] once to release the paper\n\nFinally click 'Next' to continue.";
static string setZHeightFineInstruction1 = new LocalizedString("We will now refine our measurement of the extruder height at this position.").Translated;
static string setZHeightFineInstructionTxtOne = new LocalizedString("Press [Z-] until there is resistance to moving the paper").Translated;
static string setZHeightFineInstructionTxtTwo = new LocalizedString("Press [Z+] once to release the paper").Translated;
static string setZHeightFineInstructionTxtThree = new LocalizedString("Finally click 'Next' to continue.").Translated;
static string setZHeightFineInstruction2 = string.Format("\t• {0}\n\t• {1}\n\n{2}",setZHeightFineInstructionTxtOne, setZHeightFineInstructionTxtTwo, setZHeightFineInstructionTxtThree);
public GetFineBedHeight(string instructionsText, ProbePosition whereToWriteProbePosition)
: base(instructionsText, setZHeightFineInstruction1, setZHeightFineInstruction2, .1, whereToWriteProbePosition)
@ -255,8 +266,10 @@ namespace MatterHackers.MatterControl
public class GetUltraFineBedHeight : FindBedHeight
{
static string setZHeightFineInstruction1 = "We will now finalize our measurement of the extruder height at this position.";
static string setZHeightFineInstruction2 = "\t• Press [Z-] one click PAST the first hint of resistance\n\n\nFinally click 'Next' to continue.";
static string setZHeightFineInstruction1 = new LocalizedString("We will now finalize our measurement of the extruder height at this position.").Translated;
static string setHeightFineInstructionTxtOne = new LocalizedString("Press [Z-] one click PAST the first hint of resistance").Translated;
static string setHeightFineInstructionTxtTwo = new LocalizedString("Finally click 'Next' to continue.").Translated;
static string setZHeightFineInstruction2 = string.Format("\t• {0}\n\n\n{1}", setHeightFineInstructionTxtOne, setHeightFineInstructionTxtTwo);
public GetUltraFineBedHeight(string instructionsText, ProbePosition whereToWriteProbePosition)
: base(instructionsText, setZHeightFineInstruction1, setZHeightFineInstruction2, .02, whereToWriteProbePosition)
@ -285,17 +298,36 @@ namespace MatterHackers.MatterControl
public class PrintLevelWizardWindow : SystemWindow
{
string pageOneInstructions = "Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.\n\n\t• 'Home' the printer\n\t• Sample the bed at three points\n\t• Turn auto leveling on\n\nYou should be done in about 3 minutes.\n\nClick 'Next' to continue.";
string pageOneInstructionsTxtOne = new LocalizedString("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.").Translated;
string pageOneInstructionsTxtTwo = new LocalizedString("'Home' the printer").Translated;
string pageOneInstructionsTxtThree = new LocalizedString("Sample the bed at three points").Translated;
string pageOneInstructionsTxtFour = new LocalizedString("Turn auto leveling on").Translated;
string pageOneInstructionsTxtFive = new LocalizedString("You should be done in about 3 minutes.").Translated;
string pageOneInstructionsTxtSix = new LocalizedString("Click 'Next' to continue.").Translated;
string pageOneInstructions;
string homingPageInstructions = "The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need:\n\n\t• A standard sheet of paper\n\nWe will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue.";
string doneInstructions = "Congratulations!\n\nAuto Print Leveling is now configured and enabled.\n\n\t• Remove the paper\n\nIf in the future you wish to turn Auto Print Leveling off, you can uncheck the 'Enabled' button found in 'Advanced Settings'->'Printer Controls'.\n\nClick 'Done' to close this window.";
string homingPageInstructionsTxtOne = new LocalizedString("The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need").Translated;
string homingPageInstructionsTxtTwo = new LocalizedString("A standard sheet of paper").Translated;
string homingPageInstructionsTxtThree = new LocalizedString("We will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue.").Translated;
string homingPageInstructions;
string doneInstructionsTxt = new LocalizedString("Congratulations!\n\nAuto Print Leveling is now configured and enabled.").Translated;
string doneInstructionsTxtTwo = new LocalizedString("Remove the paper").Translated;
string doneInstructionsTxtThree = new LocalizedString("If in the future you wish to turn Auto Print Leveling off, you can uncheck the 'Enabled' button found in 'Advanced Settings'->'Printer Controls'.\n\nClick 'Done' to close this window.").Translated;
string doneInstructions;
WizardControl printLevelWizard;
public PrintLevelWizardWindow()
: base(500, 370)
{
Title = "MatterControl - Print Leveling Wizard";
{
pageOneInstructions = string.Format("{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}\n\n{5}",pageOneInstructionsTxtOne, pageOneInstructionsTxtTwo, pageOneInstructionsTxtThree, pageOneInstructionsTxtFour, pageOneInstructionsTxtFive, pageOneInstructionsTxtSix);
homingPageInstructions = string.Format("{0}:\n\n\t• {1}\n\n{2}", homingPageInstructionsTxtOne, homingPageInstructionsTxtTwo, homingPageInstructionsTxtThree);
doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}",doneInstructionsTxt, doneInstructionsTxtTwo, doneInstructionsTxtThree);
string printLevelWizardTitle = new LocalizedString("MatterControl").Translated;
string printLevelWizardTitleFull = new LocalizedString ("Print Leveling Wizard").Translated;
Title = string.Format("{0} - {1}",printLevelWizardTitle, printLevelWizardTitleFull);
ProbePosition[] probePositions = new ProbePosition[3];
probePositions[0] = new ProbePosition();
probePositions[1] = new ProbePosition();
@ -309,30 +341,60 @@ namespace MatterHackers.MatterControl
printLevelWizard.AddPage(new HomePrinterPage(homingPageInstructions));
Vector2 probeBackCenter = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(0);
printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeBackCenter, 10), string.Format("{0} Position 1 - Low Precision", Step()), probePositions[0]));
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} Position 1 - Medium Precision", Step()), probePositions[0]));
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} Position 1 - High Precision", Step()), probePositions[0]));
string lowPrecisionPositionLbl = new LocalizedString ("Position").Translated;
string lowPrecisionLbl = new LocalizedString ("Low Precision").Translated;
GetCoarseBedHeight getCourseBedHeight = new GetCoarseBedHeight (printLevelWizard,
new Vector3 (probeBackCenter, 10),
string.Format ("{0} {1} 1 - {2}", Step (),lowPrecisionPositionLbl, lowPrecisionLbl),
probePositions [0]);
printLevelWizard.AddPage(getCourseBedHeight);
string precisionPositionLbl = new LocalizedString("Position").Translated;
string medPrecisionLbl = new LocalizedString("Medium Precision").Translated;
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 1 - {2}", Step(), precisionPositionLbl, medPrecisionLbl), probePositions[0]));
string highPrecisionLbl = new LocalizedString("High Precision").Translated;
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 1 - {2}", Step(), precisionPositionLbl, highPrecisionLbl), probePositions[0]));
Vector2 probeFrontLeft = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(1);
printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} Position 2 - Low Precision", Step()), probePositions[1]));
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} Position 2 - Medium Precision", Step()), probePositions[1]));
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} Position 2 - High Precision", Step()), probePositions[1]));
string positionLblTwo = new LocalizedString("Position").Translated;
string lowPrecisionTwoLbl = new LocalizedString("Low Precision").Translated;
string medPrecisionTwoLbl = new LocalizedString("Medium Precision").Translated;
string highPrecisionTwoLbl = new LocalizedString("High Precision").Translated;
printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo, lowPrecisionTwoLbl ), probePositions[1]));
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo,medPrecisionTwoLbl), probePositions[1]));
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo,highPrecisionTwoLbl), probePositions[1]));
Vector2 probeFrontRight = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(2);
printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} Position 3 - Low Precision", Step()), probePositions[2]));
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} Position 3 - Medium Precision", Step()), probePositions[2]));
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} Position 3 - High Precision", Step()), probePositions[2]));
string positionLabelThree = new LocalizedString("Position").Translated;
string lowPrecisionLblThree = new LocalizedString("Low Precision").Translated;
string medPrecisionLblThree = new LocalizedString("Medium Precision").Translated;
string highPrecisionLblThree = new LocalizedString("High Precision").Translated;
printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", Step(), positionLabelThree, lowPrecisionLblThree), probePositions[2]));
printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", Step(),positionLabelThree, medPrecisionLblThree ), probePositions[2]));
printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", Step(), positionLabelThree, highPrecisionLblThree ), probePositions[2]));
printLevelWizard.AddPage(new LastPageInstructions(doneInstructions, probePositions));
}
int step = 1;
string stepTextBeg = new LocalizedString("Step").Translated;
string stepTextEnd = new LocalizedString("of").Translated;
string Step()
{
return string.Format("Step {0} of 9:", step++);
return string.Format("{0} {1} {2} 9:",stepTextBeg, step++, stepTextEnd);
}
void DoneButton_Click(object sender, MouseEventArgs mouseEvent)
{
UiThread.RunOnIdle (DoDoneButton_Click);
}
void DoDoneButton_Click(object state)
{
UiThread.RunOnIdle(DoDoneButton_Click);
}
void DoDoneButton_Click(object state)
{
Close();
}

View file

@ -98,6 +98,11 @@ namespace MatterHackers.MatterControl.PrintLibrary
}
void exportGCode_Click(object sender, MouseEventArgs mouseEvent)
{
UiThread.RunOnIdle(DoExportGCode_Click);
}
void DoExportGCode_Click(object state)
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Export GCode|*.gcode", title: "Export GCode");
saveParams.Title = "MatterControl: Export File";
@ -165,6 +170,11 @@ namespace MatterHackers.MatterControl.PrintLibrary
}
void exportSTL_Click(object sender, MouseEventArgs mouseEvent)
{
UiThread.RunOnIdle(DoExportSTL_Click);
}
void DoExportSTL_Click(object state)
{
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save as STL|*.stl");
saveParams.Title = "MatterControl: Export File";

View file

@ -71,7 +71,9 @@ namespace MatterHackers.MatterControl.PrintLibrary
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
string elementHeaderLbl = new LocalizedString ("Select a Design Tool:").Translated;
string elementHeaderLblBeg = new LocalizedString("Select a Design Tool").Translated;
string elementHeaderLblFull = string.Format("{0}:", elementHeaderLblBeg);
string elementHeaderLbl = elementHeaderLblFull;
TextWidget elementHeader = new TextWidget(string.Format(elementHeaderLbl), pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.ParentLeftRight;

View file

@ -158,7 +158,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
double maxSize = Math.Max(aabb.XSize, aabb.YSize);
double scale = thumbnailWidget.image.Width / (maxSize * 1.2);
RectangleDouble bounds2D = new RectangleDouble(aabb.minXYZ.x, aabb.minXYZ.y, aabb.maxXYZ.x, aabb.maxXYZ.y);
PolygonMesh.Processors.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh,
PolygonMesh.Rendering.OrthographicZProjection.DrawTo(partGraphics2D, loadedMesh,
new Vector2((thumbnailWidget.image.Width / scale - bounds2D.Width) / 2 - bounds2D.Left,
(thumbnailWidget.image.Height / scale - bounds2D.Height) / 2 - bounds2D.Bottom),
scale,

View file

@ -370,8 +370,11 @@ namespace MatterHackers.MatterControl.PrintQueue
string end = maxLengthName.Substring(maxLengthName.Length - amountRemaining, amountRemaining);
maxLengthName = start + end;
}
string message = String.Format("Oops! Could not find this file:\n'{0}'\n\nWould you like to remove it from the queue?", maxLengthName);
if (StyledMessageBox.ShowMessageBox(message, "Item not found", StyledMessageBox.MessageType.YES_NO))
string notFoundMessage = new LocalizedString("Oops! Could not find this file").Translated;
string notFoundMessageEnd = new LocalizedString("Would you like to remove it from the queue").Translated;
string message = String.Format("{0}:\n'{1}'\n\n{2}?",notFoundMessage, maxLengthName,notFoundMessageEnd);
string titleLbl = new LocalizedString("Item not Found").Translated;
if (StyledMessageBox.ShowMessageBox(message, titleLbl, StyledMessageBox.MessageType.YES_NO))
{
PrintQueueControl.Instance.RemoveIndex(PrintQueueControl.Instance.GetIndex(printItem));
}

View file

@ -39,6 +39,7 @@ using MatterHackers.VectorMath;
using MatterHackers.Agg.Image;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.FieldValidation;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -73,7 +74,9 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
TextWidget elementHeader = new TextWidget(string.Format("Edit Macro:"), pointSize: 14);
string editMacroLabel = new LocalizedString("Edit Macro").Translated;
string editMacroLabelFull = string.Format("{0}:", editMacroLabel);
TextWidget elementHeader = new TextWidget(editMacroLabelFull, pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.ParentLeftRight;
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
@ -97,10 +100,10 @@ namespace MatterHackers.MatterControl
presetsFormContainer.AddChild(createMacroCommandContainer());
Button addMacroButton = textImageButtonFactory.Generate("Save");
Button addMacroButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated);
addMacroButton.Click += new ButtonBase.ButtonEventHandler(saveMacro_Click);
Button cancelPresetsButton = textImageButtonFactory.Generate("Cancel");
Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated);
cancelPresetsButton.Click += (sender, e) =>
{
UiThread.RunOnIdle((state) =>
@ -131,7 +134,9 @@ namespace MatterHackers.MatterControl
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
TextWidget macroNameLabel = new TextWidget("Macro Name:", 0, 0, 12);
string macroNameLabelTxt = new LocalizedString("Macro Name").Translated;
string macroNameLabelTxtFull = string.Format("{0}:", macroNameLabelTxt);
TextWidget macroNameLabel = new TextWidget( macroNameLabelTxtFull, 0, 0, 12);
macroNameLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
macroNameLabel.HAnchor = HAnchor.ParentLeftRight;
macroNameLabel.Margin = new BorderDouble(0, 0, 0, 1);
@ -139,7 +144,9 @@ namespace MatterHackers.MatterControl
macroNameInput = new MHTextEditWidget(windowController.ActiveMacro.Name);
macroNameInput.HAnchor = HAnchor.ParentLeftRight;
macroNameError = new TextWidget("Give your macro a name.", 0, 0, 10);
string giveMacroANameLbl = new LocalizedString("Give your macro a name").Translated;
string giveMacroANameLblFull = string.Format ("{0}.", giveMacroANameLbl);
macroNameError = new TextWidget(giveMacroANameLblFull, 0, 0, 10);
macroNameError.TextColor = RGBA_Bytes.White;
macroNameError.HAnchor = HAnchor.ParentLeftRight;
macroNameError.Margin = elementMargin;
@ -157,7 +164,9 @@ namespace MatterHackers.MatterControl
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
TextWidget macroCommandLabel = new TextWidget("Macro Commands:", 0, 0, 12);
string macroCommandLblTxt = new LocalizedString("Macro Commands").Translated;
string macroCommandLblTxtFull = string.Format ("{0}:", macroCommandLblTxt);
TextWidget macroCommandLabel = new TextWidget(macroCommandLblTxtFull, 0, 0, 12);
macroCommandLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
macroCommandLabel.HAnchor = HAnchor.ParentLeftRight;
macroCommandLabel.Margin = new BorderDouble(0, 0, 0, 1);
@ -165,7 +174,9 @@ namespace MatterHackers.MatterControl
macroCommandInput = new MHTextEditWidget(windowController.ActiveMacro.Value, pixelHeight: 120, multiLine: true);
macroCommandInput.HAnchor = HAnchor.ParentLeftRight;
macroCommandError = new TextWidget("This should be in 'Gcode'.", 0, 0, 10);
string shouldBeGCodeLbl = new LocalizedString("This should be in 'Gcode'").Translated;
string shouldBeGCodeLblFull = string.Format("{0}.", shouldBeGCodeLbl);
macroCommandError = new TextWidget(shouldBeGCodeLblFull, 0, 0, 10);
macroCommandError.TextColor = RGBA_Bytes.White;
macroCommandError.HAnchor = HAnchor.ParentLeftRight;
macroCommandError.Margin = elementMargin;
@ -259,7 +270,9 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
TextWidget elementHeader = new TextWidget(string.Format("Macro Presets:"), pointSize: 14);
string macroPresetsLabel = new LocalizedString("Macro Presets").Translated;
string macroPresetsLabelFull = string.Format("{0}:", macroPresetsLabel);
TextWidget elementHeader = new TextWidget(macroPresetsLabelFull, pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.ParentLeftRight;
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
@ -296,7 +309,7 @@ namespace MatterHackers.MatterControl
hSpacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
macroRow.AddChild(hSpacer);
Button editLink = linkButtonFactory.Generate("edit");
Button editLink = linkButtonFactory.Generate(new LocalizedString("edit").Translated);
editLink.Margin = new BorderDouble(right: 5);
editLink.Click += (sender, e) =>
{
@ -304,7 +317,7 @@ namespace MatterHackers.MatterControl
};
macroRow.AddChild(editLink);
Button removeLink = linkButtonFactory.Generate("remove");
Button removeLink = linkButtonFactory.Generate(new LocalizedString("remove").Translated);
removeLink.Click += (sender, e) =>
{
m.Delete();
@ -318,10 +331,10 @@ namespace MatterHackers.MatterControl
}
Button addMacroButton = textImageButtonFactory.Generate("Add", "icon_circle_plus.png");
Button addMacroButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png");
addMacroButton.Click += new ButtonBase.ButtonEventHandler(addMacro_Click);
Button cancelPresetsButton = textImageButtonFactory.Generate("Close");
Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Close").Translated);
cancelPresetsButton.Click += (sender, e) => { this.windowController.Close(); };
FlowLayoutWidget buttonRow = new FlowLayoutWidget();
@ -369,7 +382,7 @@ namespace MatterHackers.MatterControl
public EditMacrosWindow(IEnumerable<DataStorage.CustomCommands> macros, EventHandler functionToCallOnSave)
: base(360, 420)
{
Title = "Macro Editor";
Title = new LocalizedString("Macro Editor").Translated;
this.functionToCallOnSave = functionToCallOnSave;
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
ChangeToMacroList();

View file

@ -38,6 +38,7 @@ using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using MatterHackers.Agg.Image;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -62,7 +63,9 @@ namespace MatterHackers.MatterControl
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
{
TextWidget elementHeader = new TextWidget(string.Format("Temperature Shortcut Presets:"), pointSize: 14);
string tempShortcutPresetLbl = new LocalizedString("Temperature Shortcut Presets").Translated;
string tempShortcutPresetLblFull = string.Format ("{0}:", tempShortcutPresetLbl);
TextWidget elementHeader = new TextWidget(tempShortcutPresetLblFull, pointSize: 14);
elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor;
elementHeader.HAnchor = HAnchor.ParentLeftRight;
elementHeader.VAnchor = Agg.UI.VAnchor.ParentBottom;
@ -108,7 +111,8 @@ namespace MatterHackers.MatterControl
labelLabelContainer.Height = 16;
labelLabelContainer.Margin = new BorderDouble(3, 0);
TextWidget labelLabel = new TextWidget(string.Format("Label"), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
string labelLabelTxt = new LocalizedString("Label").Translated;
TextWidget labelLabel = new TextWidget(string.Format(labelLabelTxt), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
labelLabel.HAnchor = HAnchor.ParentLeft;
labelLabel.VAnchor = VAnchor.ParentCenter;
@ -120,13 +124,13 @@ namespace MatterHackers.MatterControl
tempLabelContainer.Height = 16;
tempLabelContainer.Margin = new BorderDouble(3, 0);
TextWidget tempLabel = new TextWidget(string.Format("Temp (C)"), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
TextWidget tempLabel = new TextWidget(string.Format("Temp (C)"), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10);
tempLabel.HAnchor = HAnchor.ParentLeft;
tempLabel.VAnchor = VAnchor.ParentCenter;
tempLabelContainer.AddChild(tempLabel);
leftRightLabels.AddChild(hLabelSpacer);
leftRightLabels.AddChild(hLabelSpacer);
leftRightLabels.AddChild(labelLabelContainer);
leftRightLabels.AddChild(tempLabelContainer);
@ -141,7 +145,8 @@ namespace MatterHackers.MatterControl
FlowLayoutWidget leftRightEdit = new FlowLayoutWidget();
leftRightEdit.Padding = new BorderDouble(3);
leftRightEdit.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
TextWidget label = new TextWidget(string.Format("Preset {0}.", preset_count), textColor: ActiveTheme.Instance.PrimaryTextColor);
string presetLabelTxt = new LocalizedString ("Preset").Translated;
TextWidget label = new TextWidget(string.Format("{1} {0}.", preset_count,presetLabelTxt ), textColor: ActiveTheme.Instance.PrimaryTextColor);
label.VAnchor = VAnchor.ParentCenter;
leftRightEdit.AddChild(label);
@ -176,7 +181,7 @@ namespace MatterHackers.MatterControl
GuiWidget hSpacer = new GuiWidget();
hSpacer.HAnchor = HAnchor.ParentLeftRight;
TextWidget maxWidgetLabel = new TextWidget("Max Temp.", textColor: ActiveTheme.Instance.PrimaryTextColor);
TextWidget maxWidgetLabel = new TextWidget(new LocalizedString("Max Temp.").Translated, textColor: ActiveTheme.Instance.PrimaryTextColor);
maxWidgetLabel.VAnchor = VAnchor.ParentCenter;
leftRightEdit.AddChild(maxWidgetLabel);
leftRightEdit.AddChild(hSpacer);
@ -195,10 +200,10 @@ namespace MatterHackers.MatterControl
ShowAsSystemWindow();
Button savePresetsButton = textImageButtonFactory.Generate("Save");
Button savePresetsButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated);
savePresetsButton.Click += new ButtonBase.ButtonEventHandler(save_Click);
Button cancelPresetsButton = textImageButtonFactory.Generate("Cancel");
Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated);
cancelPresetsButton.Click += (sender, e) => { CloseOnIdle(); };
FlowLayoutWidget buttonRow = new FlowLayoutWidget();

View file

@ -17,7 +17,9 @@ namespace MatterHackers.MatterControl
public PrinterChooser(string selectedMake = null)
{
ManufacturerDropList = new StyledDropDownList(new LocalizedString("- Select Make -").Translated);
string defaultManufacturerLbl = new LocalizedString ("Select Make").Translated;
string defaultManufacturerLblFull = string.Format ("- {0} -", defaultManufacturerLbl);
ManufacturerDropList = new StyledDropDownList(defaultManufacturerLblFull);
bool addOther = false;
string pathToWhitelist = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "OEMSettings", "PrinterSettingsWhitelist.txt");
string[] folderWhitelist = File.ReadAllLines(pathToWhitelist);
@ -80,7 +82,9 @@ namespace MatterHackers.MatterControl
public ModelChooser(string manufacturer)
{
ModelDropList = new StyledDropDownList(new LocalizedString("- Select Model -").Translated);
string defaultModelDropDownLbl = new LocalizedString("Select Model").Translated;
string defaultModelDropDownLblFull = string.Format("- {0} -", defaultModelDropDownLbl);
ModelDropList = new StyledDropDownList(defaultModelDropDownLblFull);
string pathToModels = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "PrinterSettings", manufacturer);
if (Directory.Exists(pathToModels))
{

View file

@ -161,7 +161,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{
try
{
printerDriverMessage.Text = new LocalizedString("Installing...").Translated;
string printerDriverMessageLbl = new LocalizedString("Installing").Translated;
string printerDriverMessageLblFull = string.Format("{0}...", printerDriverMessageLbl);
printerDriverMessage.Text = printerDriverMessageLblFull;
InstallDriver(this.printerDriverFilePath);
return true;
}

View file

@ -77,7 +77,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
TextWidget printerNameLabel = new TextWidget(new LocalizedString("Printer Name:").Translated, 0, 0, 12);
string printerNameLabelTxt = new LocalizedString("Printer Name").Translated;
string printerNameLabelTxtFull = string.Format ("{0}:", printerNameLabelTxt);
TextWidget printerNameLabel = new TextWidget(printerNameLabelTxtFull, 0, 0, 12);
printerNameLabel.TextColor = this.defaultTextColor;
printerNameLabel.HAnchor = HAnchor.ParentLeftRight;
printerNameLabel.Margin = new BorderDouble(0, 0, 0, 1);
@ -103,7 +105,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
TextWidget printerManufacturerLabel = new TextWidget(new LocalizedString("Select Make:").Translated, 0, 0, 12);
string printerManufacturerLabelTxt = new LocalizedString("Select Make").Translated;
string printerManufacturerLabelTxtFull = string.Format("{0}:", printerManufacturerLabelTxt);
TextWidget printerManufacturerLabel = new TextWidget(printerManufacturerLabelTxtFull, 0, 0, 12);
printerManufacturerLabel.TextColor = this.defaultTextColor;
printerManufacturerLabel.HAnchor = HAnchor.ParentLeftRight;
printerManufacturerLabel.Margin = elementMargin;
@ -132,7 +136,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
TextWidget printerModelLabel = new TextWidget(new LocalizedString("Select Model:").Translated, 0, 0, 12);
string printerModelLabelTxt = new LocalizedString("Select Model").Translated;
string printerModelLabelTxtFull = string.Format ("{0}:", printerModelLabelTxt);
TextWidget printerModelLabel = new TextWidget(printerModelLabelTxtFull, 0, 0, 12);
printerModelLabel.TextColor = this.defaultTextColor;
printerModelLabel.HAnchor = HAnchor.ParentLeftRight;
printerModelLabel.Margin = elementMargin;
@ -399,7 +405,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
else
{
this.printerNameError.TextColor = RGBA_Bytes.Red;
this.printerNameError.Text = "Printer name cannot be blank";
this.printerNameError.Text = "Printer name cannot be blank";
this.printerNameError.Visible = true;
return false;
}

View file

@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2013, Lars Brubaker
All rights reserved.
@ -295,7 +295,7 @@ namespace MatterHackers.MatterControl
string sliderLabelDefinitions = GetTemperaturePresets();
SortedDictionary<double, string> labels = new SortedDictionary<double, string>() {};
labels.Add(0.0,new LocalizedString("OFF").Translated);
labels.Add(0.0,"OFF");
string[] labelItems = sliderLabelDefinitions.Split(',');
for (int i = 0; i < labelItems.Length / 2; i++)
@ -404,7 +404,7 @@ namespace MatterHackers.MatterControl
public class ExtruderTemperatureControlWidget : TemperatureControlBase
{
public ExtruderTemperatureControlWidget()
: base("Extruder Temperature Override", "Extruder Temperature Settings")
: base("Extruder Temperature Override", "Extruder Temperature Settings")
{
AddHandlers();
}

View file

@ -89,16 +89,36 @@ namespace MatterHackers.MatterControl
{
Vector2 bedSize = ActiveSliceSettings.Instance.BedSize;
Vector2 printCenter = ActiveSliceSettings.Instance.PrintCenter;
switch (index)
switch (BedShape)
{
case 0:
return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8);
case 1:
return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
case 2:
return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
case MeshVisualizer.MeshViewerWidget.BedShape.Circular:
Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8);
switch (index)
{
case 0:
return firstPosition;
case 1:
return Vector2.Rotate(firstPosition, MathHelper.Tau / 3);
case 2:
return Vector2.Rotate(firstPosition, MathHelper.Tau * 2 / 3);
default:
throw new IndexOutOfRangeException();
}
case MeshVisualizer.MeshViewerWidget.BedShape.Rectangular:
default:
throw new IndexOutOfRangeException();
switch (index)
{
case 0:
return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8);
case 1:
return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
case 2:
return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8);
default:
throw new IndexOutOfRangeException();
}
}
}
@ -528,15 +548,15 @@ namespace MatterHackers.MatterControl
{
if (LayerHeight > NozzleDiameter)
{
string error = "'Layer Height' must be less than or equal to the 'Nozzle Diameter'.";
string error = new LocalizedString("'Layer Height' must be less than or equal to the 'Nozzle Diameter'.").Translated;
string details = string.Format("Layer Height = {0}\nNozzle Diameter = {1}", LayerHeight, NozzleDiameter);
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'";
string location = new LocalizedString("Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'").Translated;
StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error");
return false;
}
else if (FirstLayerHeight > NozzleDiameter)
{
string error = "First Layer Height' must be less than or equal to the 'Nozzle Diameter'.";
string error = new LocalizedString("First Layer Height' must be less than or equal to the 'Nozzle Diameter'.").Translated;
string details = string.Format("First Layer Height = {0}\nNozzle Diameter = {1}", FirstLayerHeight, NozzleDiameter);
string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'";
StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error");

View file

@ -51,6 +51,7 @@ namespace MatterHackers.MatterControl
new MapItem("upSkinCount", "top_solid_layers"),
new FanTranslator("fanFullOnLayerNr", "disable_fan_first_layers"),
new MapItem("coolHeadLift", "cool_extruder_lift"),
new ScaledSingleNumber("retractionAmount", "retract_length", 1000),
new MapItem("retractionSpeed", "retract_speed"),
@ -69,7 +70,7 @@ namespace MatterHackers.MatterControl
new ScaledSingleNumber("supportLineDistance", "support_material_spacing", 1000),
new SupportMatterial("supportAngle", "support_material"),
new NotPassedItem("", "support_material_threshold"),
//new ScaledSingleNumber(supportEverywhere);
new MapItem("supportEverywhere", "support_material_create_internal_support"),
new ScaledSingleNumber("supportXYDistance", "support_material_xy_distance", 1000),
new ScaledSingleNumber("supportZDistance", "support_material_z_distance", 1000),
@ -102,7 +103,6 @@ namespace MatterHackers.MatterControl
SETTING(raftInterfaceLinewidth);
SETTING(minimalFeedrate);
SETTING(coolHeadLift);
fanFullOnLayerNr = 2;

View file

@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl
settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop;
settingsStatusLabelContainer.Margin = new BorderDouble(0);
{
string activeSettingsLabelText = new LocalizedString ("Active Settings:").Translated;
string activeSettingsLabelText = new LocalizedString ("Active Settings").Translated;
string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);
@ -64,7 +64,9 @@ namespace MatterHackers.MatterControl
settingsStatusDescription.AutoExpandBoundsToText = true;
settingsStatusDescription.TextColor = ActiveTheme.Instance.PrimaryTextColor;
unsavedChangesIndicator = new TextWidget("(unsaved changes)", pointSize: 10);
string unsavedChangesTxtBeg = new LocalizedString("unsaved changes").Translated;
string unsavedChangesTxtFull = string.Format ("({0})", unsavedChangesTxtBeg);
unsavedChangesIndicator = new TextWidget(unsavedChangesTxtFull, pointSize: 10);
unsavedChangesIndicator.AutoExpandBoundsToText = true;
unsavedChangesIndicator.Visible = false;
unsavedChangesIndicator.Margin = new BorderDouble(left: 4);
@ -208,11 +210,15 @@ namespace MatterHackers.MatterControl
void SetMenuItems()
{
string importTxt = new LocalizedString ("Import").Translated;
string importTxtFull = string.Format ("{0}", importTxt);
string exportTxt = new LocalizedString("Export").Translated;
string exportTxtFull = string.Format ("{0}", exportTxt);
//Set the name and callback function of the menu items
slicerOptionsMenuItems = new TupleList<string, Func<bool>>
{
{"Import", ImportQueueMenu_Click},
{"Export", ExportQueueMenu_Click},
{importTxtFull, ImportQueueMenu_Click},
{exportTxtFull, ExportQueueMenu_Click},
};
//Add the menu items to the menu itself

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl
public OrganizerSettingsData(string slicerConfigName, string presentationName, DataEditTypes dataEditType, string extraSettings = "", string helpText = "")
{
this.ExtraSettings = extraSettings;
this.ExtraSettings = extraSettings;
this.SlicerConfigName = slicerConfigName;
this.PresentationName = presentationName;
this.DataEditType = dataEditType;
@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl
public OrganizerSubGroup(string groupName)
{
this.name = groupName;
this.name = groupName;
}
}

View file

@ -1,19 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Utilities;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using MatterHackers.Agg.Font;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl
{

View file

@ -11,6 +11,7 @@ using MatterHackers.Agg;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl
{
@ -47,7 +48,9 @@ namespace MatterHackers.MatterControl
public void QueuePartForSlicing(PrintItemWrapper itemToQueue)
{
itemToQueue.DoneSlicing = false;
itemToQueue.OnSlicingOutputMessage(new StringEventArgs("Preparing to slice model..."));
string preparingToSliceModelTxt = new LocalizedString("Preparing to slice model").Translated;
string peparingToSliceModelFull = string.Format ("{0}...", preparingToSliceModelTxt);
itemToQueue.OnSlicingOutputMessage(new StringEventArgs(peparingToSliceModelFull));
using (TimedLock.Lock(listOfSlicingItems, "QueuePartForSlicing"))
{
//Add to thumbnail generation queue

View file

@ -10,6 +10,7 @@ bridge_speed = 60
brim_width = 0
build_height = 0
complete_objects = 0
cool_extruder_lift = 0
cooling = 1
default_acceleration = 0
disable_fan_first_layers = 1
@ -94,6 +95,7 @@ start_perimeters_at_concave_points = 0
start_perimeters_at_non_overhang = 0
support_material = 0
support_material_angle = 0
support_material_create_internal_support = 0
support_material_enforce_layers = 0
support_material_extruder = 1
support_material_extrusion_width = 0

View file

@ -111,6 +111,7 @@ Advanced
support_material_interface_spacing
support_material_xy_distance
support_material_z_distance
support_material_create_internal_support
Notes
Notes
notes
@ -163,6 +164,7 @@ Advanced
Enable
fan_always_on
cooling
cool_extruder_lift
Fan Speed
min_fan_speed
max_fan_speed

View file

@ -10,6 +10,7 @@ bridge_speed|Bridges|POSITVE_DOUBLE|mm/s|The speed to move when bridging between
brim_width|Brim Width|POSITVE_DOUBLE|mm|The amount of brim that will be drawn around each object. This is useful to ensure that parts stay affixed to the bed.
build_height|Build Height|POSITVE_DOUBLE|mm|The height of the printable area. If set to 0 the parts height will not be validated.
complete_objects|Complete Individual Objects|CHECK_BOX||Each individual part is printed to completion then the extruder is lowered back to the bed and the next part is printed.
cool_extruder_lift|Enable Extruder Lift|CHECK_BOX||Moves the extruder up off the part to allow cooling.
cooling|Enable Auto Cooling|CHECK_BOX||Turns on and off all cooling settings (all settings below this one).
default_acceleration|Default|POSITVE_DOUBLE|mm/s²|Acceleration to use on all moves not defined above. Set to 0 to disable changing the printer's acceleration.
disable_fan_first_layers|Disable Fan For The First|INT|Layers|The number of layers for which the fan will be forced to remain off.
@ -94,6 +95,7 @@ start_gcode|Start G-Code|MULTI_LINE_TEXT||This gcode will be inserted into the o
start_perimeters_at_concave_points|Start At Concave Points|CHECK_BOX||Make sure the first point on a perimeter is a concave point.
start_perimeters_at_non_overhang|Start At Non Overhang|CHECK_BOX||Make sure the first point on a perimeter is not an overhang.
support_material_angle|Pattern Angle|POSITVE_DOUBLE|degrees|The starting angle of the supports.
support_material_create_internal_support|Internal Support|CHECK_BOX||Create support where needed on internal features.
support_material_enforce_layers|Enforce Support For First|INT|layers|Generate support material everywhere not touching the bed for n layers, regardless of angle.
support_material_extruder|Support Material Extruder|INT||The index of the extruder to use for support material.
support_material_extrusion_width|Support Material|DOUBLE_OR_PERCENT|mm or %\nleave 0 for default|Leave this as 0 to allow automatic calculation of extrusion width.

View file

@ -14,6 +14,7 @@ using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;
using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PrintQueue;
using MatterHackers.Localizations;
namespace MatterHackers.MatterControl.ToolsPage
{
@ -65,18 +66,18 @@ namespace MatterHackers.MatterControl.ToolsPage
buttonPanel.HAnchor = HAnchor.ParentLeftRight;
buttonPanel.Padding = new BorderDouble(0, 3);
{
Button addToLibrary = textImageButtonFactory.Generate("Import", "icon_import_white_32x32.png");
Button addToLibrary = textImageButtonFactory.Generate(new LocalizedString("Import").Translated, "icon_import_white_32x32.png");
buttonPanel.AddChild(addToLibrary);
addToLibrary.Margin = new BorderDouble(0, 0, 3, 0);
addToLibrary.Click += new ButtonBase.ButtonEventHandler(loadFile_Click);
deleteFromLibraryButton = textImageButtonFactory.Generate("Delete");
deleteFromLibraryButton = textImageButtonFactory.Generate(new LocalizedString("Delete").Translated);
deleteFromLibraryButton.Margin = new BorderDouble(3, 0);
deleteFromLibraryButton.Click += new ButtonBase.ButtonEventHandler(deleteFromQueueButton_Click);
deleteFromLibraryButton.Visible = false;
buttonPanel.AddChild(deleteFromLibraryButton);
addToQueueButton = textImageButtonFactory.Generate("Add to Queue");
addToQueueButton = textImageButtonFactory.Generate(new LocalizedString("Add to Queue").Translated);
addToQueueButton.Margin = new BorderDouble(3, 0);
addToQueueButton.Click += new ButtonBase.ButtonEventHandler(addToQueueButton_Click);
addToQueueButton.Visible = false;