Merge remote-tracking branch 'upstream/development'

Conflicts:
	StaticData/Translations/Master.txt
This commit is contained in:
gregory-diaz 2014-04-14 10:18:13 -07:00
commit acea4975af
8 changed files with 64 additions and 40 deletions

View file

@ -231,15 +231,15 @@ namespace MatterHackers.MatterControl.EeProm
string cmdho = "M206 X" + hox + " Y" + hoy + " Z" + hoz;
string cmdpid = "M301 P" + ppid + " I" + ipid + " D" + dpid;
PrinterCommunication.Instance.QueueLineToPrinter(cmdsteps);
PrinterCommunication.Instance.QueueLineToPrinter(cmdfeed);
PrinterCommunication.Instance.QueueLineToPrinter(cmdmacc);
PrinterCommunication.Instance.QueueLineToPrinter(cmdacc);
PrinterCommunication.Instance.QueueLineToPrinter(cmdav);
PrinterCommunication.Instance.QueueLineToPrinter(cmdho);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdsteps);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdfeed);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdmacc);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdacc);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdav);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdho);
if (hasPID)
{
PrinterCommunication.Instance.QueueLineToPrinter(cmdpid);
PrinterCommunication.Instance.SendLineToPrinterNow(cmdpid);
}
changed = false;
@ -395,14 +395,14 @@ namespace MatterHackers.MatterControl.EeProm
public void SaveToEeProm()
{
PrinterCommunication.Instance.QueueLineToPrinter("M500");
PrinterCommunication.Instance.SendLineToPrinterNow("M500");
}
// this does not save them to eeprom
public void SetPrinterToFactorySettings()
{
hasPID = false;
PrinterCommunication.Instance.QueueLineToPrinter("M502");
PrinterCommunication.Instance.SendLineToPrinterNow("M502");
}
public void Add(object sender, EventArgs e)
@ -426,7 +426,7 @@ namespace MatterHackers.MatterControl.EeProm
public void Update()
{
hasPID = false;
PrinterCommunication.Instance.QueueLineToPrinter("M503");
PrinterCommunication.Instance.SendLineToPrinterNow("M503");
}
}
}

View file

@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.EeProm
string cmd = "M206 T" + type + " P" + position + " ";
if (type == 3) cmd += "X" + val;
else cmd += "S" + val;
PrinterCommunication.Instance.QueueLineToPrinter(cmd);
PrinterCommunication.Instance.SendLineToPrinterNow(cmd);
changed = false;
}

View file

@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl.EeProm
public void AskPrinterForSettings()
{
PrinterCommunication.Instance.QueueLineToPrinter("M205");
PrinterCommunication.Instance.SendLineToPrinterNow("M205");
}
}
}

View file

@ -660,7 +660,7 @@ namespace MatterHackers.MatterControl
{
if (MonitorPrinterTemperature)
{
QueueLineToPrinter("M105");
SendLineToPrinterNow("M105");
}
temperatureRequestTimer.Restart();
}
@ -701,7 +701,7 @@ namespace MatterHackers.MatterControl
{
targetExtruderTemperature = value;
OnExtruderTemperatureSet(new TemperatureEventArgs(TargetExtruderTemperature));
QueueLineToPrinter("M104 S{0}".FormatWith(targetExtruderTemperature));
SendLineToPrinterNow("M104 S{0}".FormatWith(targetExtruderTemperature));
}
}
}
@ -718,7 +718,9 @@ namespace MatterHackers.MatterControl
{
if (ActivePrinter.DoPrintLeveling)
{
ForceImmediateWrites = true;
ReadPosition();
ForceImmediateWrites = false;
}
}
@ -752,7 +754,7 @@ namespace MatterHackers.MatterControl
{
fanSpeed = Math.Max(0, Math.Min(255, value));
OnFanSpeedSet(null);
QueueLineToPrinter("M106 S{0}".FormatWith(fanSpeed));
SendLineToPrinterNow("M106 S{0}".FormatWith(fanSpeed));
}
}
@ -768,7 +770,7 @@ namespace MatterHackers.MatterControl
{
targetBedTemperature = value;
OnBedTemperatureSet(new TemperatureEventArgs(TargetBedTemperature));
QueueLineToPrinter("M140 S{0}".FormatWith(targetBedTemperature));
SendLineToPrinterNow("M140 S{0}".FormatWith(targetBedTemperature));
}
}
}
@ -1258,8 +1260,8 @@ namespace MatterHackers.MatterControl
// let's check if the printer will talk to us
ReadPosition();
QueueLineToPrinter("M105");
QueueLineToPrinter("M115");
SendLineToPrinterNow("M105");
SendLineToPrinterNow("M115");
}
catch (System.ArgumentOutOfRangeException)
{
@ -1422,7 +1424,7 @@ namespace MatterHackers.MatterControl
}
}
public void QueueLineToPrinter(string lineToWrite)
public void SendLineToPrinterNow(string lineToWrite)
{
using (TimedLock.Lock(this, "QueueLineToPrinter"))
{
@ -1430,10 +1432,21 @@ namespace MatterHackers.MatterControl
if (lineToWrite.Contains("\n"))
{
string[] lines = lineToWrite.Split(new string[] { "\n" }, StringSplitOptions.None);
for (int i = lines.Length - 1; i >= 0; i--)
if (ForceImmediateWrites && !PrinterIsPrinting)
{
string line = lines[i];
QueueLineToPrinter(line);
for (int i = 0; i < lines.Length; i++)
{
string line = lines[i];
SendLineToPrinterNow(line);
}
}
else
{
for (int i = lines.Length - 1; i >= 0; i--)
{
string line = lines[i];
SendLineToPrinterNow(line);
}
}
return;
}
@ -1441,7 +1454,7 @@ namespace MatterHackers.MatterControl
lineToWrite = lineToWrite.Split(';')[0].Trim();
if (PrinterIsPrinting)
{
// insert the command into the printing queue
// insert the command into the printing queue at the head
if (printerCommandQueueIndex >= 0
&& printerCommandQueueIndex < loadedGCode.GCodeCommandQueue.Count - 1)
{
@ -1460,9 +1473,10 @@ namespace MatterHackers.MatterControl
}
else
{
// try not to write the exact same command twice (like M105)
if (LinesToWriteQueue.Count == 0 || LinesToWriteQueue[LinesToWriteQueue.Count - 1] != lineToWrite)
{
LinesToWriteQueue.Insert(0, lineToWrite);
LinesToWriteQueue.Add(lineToWrite);
}
}
}
@ -2013,7 +2027,7 @@ namespace MatterHackers.MatterControl
public void ReleaseMotors()
{
QueueLineToPrinter("M84");
SendLineToPrinterNow("M84");
}
[Flags]
@ -2034,18 +2048,18 @@ namespace MatterHackers.MatterControl
command += " Z0";
}
QueueLineToPrinter(command);
SendLineToPrinterNow(command);
ReadPosition();
}
public void SetMovementToAbsolute()
{
PrinterCommunication.Instance.QueueLineToPrinter("G90");
PrinterCommunication.Instance.SendLineToPrinterNow("G90");
}
public void SetMovementToRelative()
{
PrinterCommunication.Instance.QueueLineToPrinter("G91");
PrinterCommunication.Instance.SendLineToPrinterNow("G91");
}
public void MoveRelative(Axis axis, double moveAmountMm, double feedRateMmPerMinute)
@ -2053,8 +2067,8 @@ namespace MatterHackers.MatterControl
if (moveAmountMm != 0)
{
SetMovementToRelative();
PrinterCommunication.Instance.QueueLineToPrinter("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.QueueLineToPrinter("G1 {0}{1}".FormatWith(axis, moveAmountMm));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 {0}{1}".FormatWith(axis, moveAmountMm));
SetMovementToAbsolute();
}
}
@ -2062,20 +2076,20 @@ namespace MatterHackers.MatterControl
public void MoveAbsolute(Axis axis, double axisPositionMm, double feedRateMmPerMinute)
{
SetMovementToAbsolute();
PrinterCommunication.Instance.QueueLineToPrinter("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.QueueLineToPrinter("G1 {0}{1}".FormatWith(axis, axisPositionMm));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 {0}{1}".FormatWith(axis, axisPositionMm));
}
public void MoveAbsolute(Vector3 position, double feedRateMmPerMinute)
{
SetMovementToAbsolute();
PrinterCommunication.Instance.QueueLineToPrinter("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.QueueLineToPrinter("G1 X{0}Y{1}Z{2}".FormatWith(position.x, position.y, position.z));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 F{0}".FormatWith(feedRateMmPerMinute));
PrinterCommunication.Instance.SendLineToPrinterNow("G1 X{0}Y{1}Z{2}".FormatWith(position.x, position.y, position.z));
}
public void ReadPosition()
{
QueueLineToPrinter("M114");
SendLineToPrinterNow("M114");
}
}
}

View file

@ -173,7 +173,7 @@ namespace MatterHackers.MatterControl
protected void SentCommandToPrinter(string command)
{
PrinterCommunication.Instance.QueueLineToPrinter(command);
PrinterCommunication.Instance.SendLineToPrinterNow(command);
}
}
}

View file

@ -246,7 +246,7 @@ namespace MatterHackers.MatterControl
}
commandHistory.Add(textToSend);
commandHistoryIndex = commandHistory.Count;
PrinterCommunication.Instance.QueueLineToPrinter(textToSend);
PrinterCommunication.Instance.SendLineToPrinterNow(textToSend);
if (!filterOutput.Checked)
{
outputScrollWidget.WriteLine(this, new StringEventArgs(textToSend));

View file

@ -37,9 +37,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
ChangeToAddPrinter();
}
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
this.ShowAsSystemWindow();
MinimumSize = new Vector2(350, 400);
}
public override void OnMouseUp(MouseEventArgs mouseEvent)

View file

@ -1917,6 +1917,15 @@ Translated:Movement Speeds
English:Extruder
Translated:Extruder
English:No items to select. Press 'Add' to select a file to print.
Translated:No items to select. Press 'Add' to select a file to print.
English:Power on and connect printer
Translated:Power on and connect printer
English:Attempting to connect
Translated:Attempting to connect
English:Connection succeeded
Translated:Connection succeeded
English:You cannot move any lower. This position on your bed is too low for the extruder to reach. You need to raise your bed, or adjust your limits to allow the extruder to go lower.
Translated:You cannot move any lower. This position on your bed is too low for the extruder to reach. You need to raise your bed, or adjust your limits to allow the extruder to go lower.