Merge pull request #4492 from larsbrubaker/master

latest agg
This commit is contained in:
johnlewin 2019-05-02 21:31:11 -07:00 committed by GitHub
commit ba934a3271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 33 deletions

View file

@ -465,8 +465,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
#if !__ANDROID__
if (sceneContext.Printer.Connection.SerialPort is PrinterEmulator.Emulator emulator)
if (sceneContext.Printer.Connection.serialPort is PrinterEmulator.Emulator emulator)
{
var matrix = Matrix4X4.CreateTranslation(emulator.CurrentPosition + new Vector3(.5, .5, 5));
GLHelper.Render(PlatonicSolids.CreateCube(1, 1, 10),
@ -482,7 +481,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
lastEmulatorPosition = emulator.CurrentPosition;
}
#endif
transparentMeshes.Sort(BackToFrontXY);

View file

@ -238,7 +238,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication
private readonly StartsWithLineActions readLineStartCallBacks = new StartsWithLineActions();
// we start out by setting it to a nothing file
public IFrostedSerialPort SerialPort { get; private set; }
public IFrostedSerialPort serialPort { get; private set; }
private double _targetBedTemperature;
@ -896,12 +896,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication
public void ReleaseAndReportFailedConnection(ConnectionFailure reason)
{
// Shutdown the serial port
if (SerialPort != null)
if (serialPort != null)
{
// Close and dispose the serial port
SerialPort.Close();
SerialPort.Dispose();
SerialPort = null;
serialPort.Close();
serialPort.Dispose();
serialPort = null;
}
// Notify
@ -1001,7 +1001,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication
// we're actually doing the bulk of the connection time in CreateAndOpen
CommunicationState = CommunicationStates.AttemptingToConnect;
SerialPort = portFactory.CreateAndOpen(serialPortName, Printer.Settings, baudRate, true);
serialPort = portFactory.CreateAndOpen(serialPortName, Printer.Settings, baudRate, true);
#if __ANDROID__
ToggleHighLowHigh(serialPort);
#endif
@ -1021,10 +1021,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication
while (true)
{
// Plugins required probing to fill read buffer
var na = SerialPort.BytesToRead;
var na = serialPort.BytesToRead;
// Read, sanitize, store
string response = SerialPort.ReadExisting().Replace("\r\n", "\n").Replace('\r', '\n');
string response = serialPort.ReadExisting().Replace("\r\n", "\n").Replace('\r', '\n');
sb.Append(response);
bool hasNewline = response.Contains('\n');
@ -1189,13 +1189,13 @@ You will then need to logout and log back in to the computer for the changes to
CommunicationState = CommunicationStates.Disconnecting;
currentReadThreadIndex++;
if (SerialPort != null)
if (serialPort != null)
{
SerialPort.Close();
SerialPort.Dispose();
serialPort.Close();
serialPort.Dispose();
}
SerialPort = null;
serialPort = null;
}
else
{
@ -1490,7 +1490,7 @@ You will then need to logout and log back in to the computer for the changes to
{
// TODO: Ideally we would shutdown the printer connection when this method is called and we're connected. The
// current approach results in unpredictable behavior if the caller fails to close the connection
if (SerialPort == null && this.Printer.Settings != null)
if (serialPort == null && this.Printer.Settings != null)
{
IFrostedSerialPort resetSerialPort = FrostedSerialPortFactory.GetAppropriateFactory(this.DriverType).Create(this.ComPort, Printer.Settings);
resetSerialPort.Open();
@ -1511,7 +1511,7 @@ You will then need to logout and log back in to the computer for the changes to
timeSinceLastReadAnything.Restart();
// we want this while loop to be as fast as possible. Don't allow any significant work to happen in here
while (CommunicationState == CommunicationStates.AttemptingToConnect
|| (this.IsConnected && SerialPort != null && SerialPort.IsOpen && !Disconnecting && readThreadHolder.IsCurrentThread()))
|| (this.IsConnected && serialPort != null && serialPort.IsOpen && !Disconnecting && readThreadHolder.IsCurrentThread()))
{
if ((this.IsConnected
|| this.CommunicationState == CommunicationStates.AttemptingToConnect)
@ -1522,13 +1522,13 @@ You will then need to logout and log back in to the computer for the changes to
try
{
while (SerialPort != null
&& SerialPort.BytesToRead > 0
while (serialPort != null
&& serialPort.BytesToRead > 0
&& readThreadHolder.IsCurrentThread())
{
lock (locker)
{
string allDataRead = SerialPort.ReadExisting();
string allDataRead = serialPort.ReadExisting();
allDataRead = allDataRead.Replace("\r\n", "\n");
allDataRead = allDataRead.Replace('\r', '\n');
dataLastRead += allDataRead;
@ -1730,21 +1730,21 @@ You will then need to logout and log back in to the computer for the changes to
if (Printer.Settings.PrinterSelected)
{
// first make sure we are not printing if possible (cancel slicing)
if (SerialPort != null) // we still have a serial port
if (serialPort != null) // we still have a serial port
{
Stop(false);
ClearQueuedGCode();
CommunicationState = CommunicationStates.Disconnecting;
currentReadThreadIndex++;
ToggleHighLowHigh(SerialPort);
if (SerialPort != null)
ToggleHighLowHigh(serialPort);
if (serialPort != null)
{
SerialPort.Close();
SerialPort.Dispose();
serialPort.Close();
serialPort.Dispose();
}
SerialPort = null;
serialPort = null;
// make sure we clear out the stream processors
CreateStreamProcessors();
CommunicationState = CommunicationStates.Disconnected;
@ -2113,11 +2113,11 @@ You will then need to logout and log back in to the computer for the changes to
CommunicationState = CommunicationStates.Disconnecting;
currentReadThreadIndex++;
if (SerialPort != null)
if (serialPort != null)
{
SerialPort.Close();
SerialPort.Dispose();
SerialPort = null;
serialPort.Close();
serialPort.Dispose();
serialPort = null;
}
CommunicationState = CommunicationStates.Disconnected;
@ -2790,7 +2790,7 @@ You will then need to logout and log back in to the computer for the changes to
{
if (this.IsConnected || CommunicationState == CommunicationStates.AttemptingToConnect)
{
if (SerialPort != null && SerialPort.IsOpen)
if (serialPort != null && serialPort.IsOpen)
{
if (lineWithoutChecksum.StartsWith("G92"))
{
@ -2858,7 +2858,7 @@ You will then need to logout and log back in to the computer for the changes to
{
lock (locker)
{
SerialPort.Write(lineToWrite);
serialPort.Write(lineToWrite);
timeSinceLastWrite.Restart();
timeHaveBeenWaitingForOK.Restart();
}

@ -1 +1 @@
Subproject commit 13c8b766c91113dfe1d070b2065984fc4f212348
Subproject commit 762689f27eeeb61b1b31e7b60b5cdeceda12bf62