Convert to standard events with line arg
This commit is contained in:
parent
8c2f2314dd
commit
f83fadd06b
12 changed files with 136 additions and 180 deletions
|
|
@ -56,20 +56,19 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
: base(internalStream)
|
||||
{
|
||||
this.printer = printer;
|
||||
printer.Connection.LineReceived.RegisterEvent((s, e) =>
|
||||
printer.Connection.LineReceived += (s, line) =>
|
||||
{
|
||||
StringEventArgs currentEvent = e as StringEventArgs;
|
||||
if (currentEvent != null)
|
||||
if (line != null)
|
||||
{
|
||||
if (currentEvent.Data.Contains("ros_"))
|
||||
if (line.Contains("ros_"))
|
||||
{
|
||||
if(currentEvent.Data.Contains("TRIGGERED"))
|
||||
if(line.Contains("TRIGGERED"))
|
||||
{
|
||||
readOutOfFilament = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, ref unregisterEvents);
|
||||
};
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
|
|
@ -282,7 +281,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
int layerNumber;
|
||||
var printerRecoveryStream = internalStream as PrintRecoveryStream;
|
||||
|
||||
if (int.TryParse(layer, out layerNumber)
|
||||
if (int.TryParse(layer, out layerNumber)
|
||||
&& printer.Settings.Helpers.LayerToPauseOn().Contains(layerNumber)
|
||||
&& (printerRecoveryStream == null
|
||||
|| printerRecoveryStream.RecoveryState == RecoveryState.PrintingToEnd))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue