Trying to understand more about re-slice failure

This commit is contained in:
Lars Brubaker 2018-10-24 15:12:38 -07:00
parent 473cfffa51
commit e6495653b6
2 changed files with 11 additions and 0 deletions

View file

@ -92,6 +92,7 @@ namespace MatterHackers.PrinterEmulator
public event EventHandler ZPositionChanged;
public event EventHandler EPositionChanged;
public event EventHandler<string> RecievedInstruction;
// Instance reference allows test to access the most recently initialized emulator
public static Emulator Instance { get; private set; }
@ -178,6 +179,8 @@ namespace MatterHackers.PrinterEmulator
{
try
{
RecievedInstruction?.Invoke(this, inCommand);
// Remove line returns
var commandNoNl = inCommand.Split('\n')[0]; // strip of the trailing cr (\n)
var command = ParseChecksumLine(commandNoNl);

View file

@ -72,6 +72,14 @@ namespace MatterHackers.MatterControl.Tests.Automation
double lastAbsoluteEPostion = 0;
double largestAbsoluteEPosition = 0;
double largestRetraction = 0;
emulator.RecievedInstruction += (e, s) =>
{
if(s.Contains("G92"))
{
int a = 0;
}
};
emulator.EPositionChanged += (e, s) =>
{
largestAbsoluteEPosition = Math.Max(largestAbsoluteEPosition, emulator.CurrentExtruder.AbsoluteEPosition);