Make sure we output g11 and g10 commands correctly.

Put in spaces when outputting leveled GCode (export)
This commit is contained in:
larsbrubaker 2014-02-28 14:12:19 -08:00
parent 32fb2605e5
commit c7ac37a5cb
3 changed files with 12 additions and 2 deletions

View file

@ -674,6 +674,8 @@ namespace MatterHackers.MatterControl
terminalControlsContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
terminalControlsContainer.Height = 68;
OutputScrollWindow.HookupPrinterOutput();
{
FlowLayoutWidget buttonBar = new FlowLayoutWidget();
buttonBar.HAnchor |= HAnchor.ParentLeftRight;

View file

@ -50,6 +50,11 @@ namespace MatterHackers.MatterControl
RGBA_Bytes textColor = ActiveTheme.Instance.PrimaryTextColor;
TextImageButtonFactory controlButtonFactory = new TextImageButtonFactory();
public static void HookupPrinterOutput()
{
//throw new NotImplementedException();
}
static OutputScrollWindow connectionWindow = null;
static bool terminalWindowIsOpen = false;
public static void Show()
@ -73,6 +78,7 @@ namespace MatterHackers.MatterControl
}
}
// private as you can't make one
private OutputScrollWindow()
: base(400, 300)
{

View file

@ -80,7 +80,9 @@ namespace MatterHackers.MatterControl
public string ApplyLeveling(Vector3 currentDestination, PrinterMachineInstruction.MovementTypes movementMode, string lineBeingSent, bool addLFCR, bool includeSpaces)
{
if (lineBeingSent.StartsWith("G0") || lineBeingSent.StartsWith("G1"))
if ((lineBeingSent.StartsWith("G0") || lineBeingSent.StartsWith("G1"))
&& lineBeingSent.Length > 2
&& lineBeingSent[2] == ' ')
{
double extruderDelta = 0;
GCodeFile.GetFirstNumberAfter("E", lineBeingSent, ref extruderDelta);
@ -136,7 +138,7 @@ namespace MatterHackers.MatterControl
foreach (PrinterMachineInstruction instruction in unleveledGCode.GCodeCommandQueue)
{
Vector3 currentDestination = instruction.Position;
instruction.Line = ApplyLeveling(currentDestination, instruction.movementType, instruction.Line, false, false);
instruction.Line = ApplyLeveling(currentDestination, instruction.movementType, instruction.Line, false, true);
}
}
}