Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
larsbrubaker 2014-02-26 14:38:59 -08:00
commit b57b021e1b

View file

@ -1035,6 +1035,20 @@ namespace MatterHackers.MatterControl
}
}
public string ComPort
{
get
{
string comPort = null;
if (this.ActivePrinter != null)
{
comPort = this.ActivePrinter.ComPort;
}
return comPort;
}
}
public int BaudRate
{
get
@ -1053,8 +1067,6 @@ namespace MatterHackers.MatterControl
}
return baudRate;
}
}
private void ConnectToPrinter(Printer printerRecord)
@ -1470,6 +1482,36 @@ namespace MatterHackers.MatterControl
}
}
public void PulseRtsLow()
{
if (serialPort == null && this.ActivePrinter != null)
{
serialPort = new FrostedSerialPort(this.ActivePrinter.ComPort);
serialPort.BaudRate = this.BaudRate;
if (PrinterCommunication.Instance.DtrEnableOnConnect)
{
serialPort.DtrEnable = true;
}
// Set the read/write timeouts
serialPort.ReadTimeout = 500;
serialPort.WriteTimeout = 500;
serialPort.Open();
serialPort.RtsEnable = true;
serialPort.RtsEnable = false;
try
{
Thread.Sleep(1);
}
catch
{
}
serialPort.RtsEnable = true;
serialPort.Close();
}
}
public void Disable()
{
if (PrinterIsConnected)