Overridable emulator heatup

This commit is contained in:
John Lewin 2017-12-15 18:19:36 -08:00
parent 0f1e522a89
commit b5d8832fe4
2 changed files with 13 additions and 2 deletions

View file

@ -33,6 +33,11 @@ namespace MatterHackers.PrinterEmulator
{
public partial class Emulator : IDisposable
{
/// <summary>
/// The number of seconds the emulator should take to heat up and given target
/// </summary>
public static double DefaultHeatUpTime = 3;
public int CDChangeCount;
public bool CDState;
public int CtsChangeCount;
@ -499,7 +504,7 @@ namespace MatterHackers.PrinterEmulator
}
}
private double _heatupTimeInSeconds = 3;
private double _heatupTimeInSeconds = DefaultHeatUpTime;
public double HeatUpTimeInSeconds
{
get => _heatupTimeInSeconds;
@ -544,7 +549,6 @@ namespace MatterHackers.PrinterEmulator
shutdown = true;
}
}
}
public class EmulatorPortFactory : FrostedSerialPortFactory

View file

@ -196,6 +196,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Load the TestEnv config
var config = TestAutomationConfig.Load();
Emulator.DefaultHeatUpTime = config.HeatupTime;
// Create the printer
testRunner.AddAndSelectPrinter(make, model);
@ -810,6 +812,11 @@ namespace MatterHackers.MatterControl.Tests.Automation
public double MouseUpDelay { get; set; } = 0.2;
/// <summary>
/// The number of seconds the emulator should take to heat up and given target
/// </summary>
public double HeatupTime { get; set; } = 0.5;
public static TestAutomationConfig Load()
{
TestAutomationConfig config = null;