Merge remote-tracking branch 'origin/1.6'

# Conflicts:
#	Submodules/agg-sharp
This commit is contained in:
Lars Brubaker 2017-01-03 15:22:52 -08:00
commit 4fb4d3a15f
10 changed files with 96 additions and 22 deletions

View file

@ -330,7 +330,13 @@ namespace MatterHackers.MatterControl
webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCompleted);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
webClient.DownloadFileAsync(new Uri(downloadUri), updateFileName);
try
{
webClient.DownloadFileAsync(new Uri(downloadUri), updateFileName);
}
catch
{
}
}
}
}

View file

@ -192,7 +192,9 @@ namespace MatterHackers.MatterControl
public static Action SignInAction;
public static Action SignOutAction;
public static Action<bool> OutboundRequest;
public static Action WebRequestFailed;
public static Action WebRequestSucceeded;
#if DEBUG
@ -711,7 +713,14 @@ namespace MatterHackers.MatterControl
{
}
};
client.DownloadDataAsync(new Uri(uriToLoad));
try
{
client.DownloadDataAsync(new Uri(uriToLoad));
}
catch
{
}
}
}

View file

@ -2792,12 +2792,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication
printJobDisplayName = null;
// get us back to the no printing setting (this will clear the queued commands)
CreateStreamProcessors(null, false);
// never leave the extruder and the bed hot
ReleaseMotors();
TurnOffBedAndExtruders();
// get us back to the no printing setting
CreateStreamProcessors(null, false);
}
}
}

View file

@ -35,12 +35,12 @@ import time
import random
extruderGoalTemperature = 210
bedGoalTemperature = 0
bedGoalTemperature = -1 # no bed present
"""Add response callbacks here"""
def randomTemp(command):
# temp commands look like this: ok T:19.4 /0.0 B:0.0 /0.0 @:0 B@:0
if bedGoalTemperature == 0:
if bedGoalTemperature == -1:
return "ok T:%s\n" % (extruderGoalTemperature + random.randrange(-2,2))
else:
return "ok T:%s B:%s\n" % (extruderGoalTemperature + random.randrange(-2,2), bedGoalTemperature + random.randrange(-2,2))

@ -1 +1 @@
Subproject commit 9edd92c40a9db6c2f7f5a0e13dd4ca29c6818c50
Subproject commit b54405f158af34e95040218b2f30d0ea102b730a

View file

@ -69,6 +69,7 @@
<Compile Include="PrinterDropDownTests.cs" />
<Compile Include="PrintQueueTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PrintingTests.cs" />
<Compile Include="SliceSetingsTests.cs" />
<Compile Include="SqLiteLibraryProvider.cs" />
</ItemGroup>

View file

@ -0,0 +1,57 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg.PlatformAbstract;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.UI.Tests;
using MatterHackers.GuiAutomation;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.SlicerConfiguration;
using NUnit.Framework;
namespace MatterHackers.MatterControl.Tests.Automation
{
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain]
public class PrintingTests
{
[Test, Apartment(ApartmentState.STA)]
public async Task CompletingPrintTurnsoffHeat()
{
AutomationTest testToRun = (testRunner) =>
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorProcess = testRunner.LaunchAndConnectToPrinterEmulator())
{
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
MatterControlUtilities.SwitchToAdvancedSettings(testRunner);
testRunner.ClickByName("Printer Tab", 1);
testRunner.ClickByName("Custom G-Code Tab", 1);
testRunner.ClickByName("end_gcode Edit Field");
testRunner.Type("^a");
testRunner.Type("{BACKSPACE}");
testRunner.Type("G28");
testRunner.ClickByName("Start Print Button", 1);
testRunner.WaitForName("Done Button", 30);
testRunner.WaitForName("Print Again Button", 1);
testRunner.Wait(5);
Assert.Less(PrinterConnectionAndCommunication.Instance.GetActualExtruderTemperature(0), 30);
Assert.Less(PrinterConnectionAndCommunication.Instance.ActualBedTemperature, 10);
return Task.FromResult(0);
}
};
await MatterControlUtilities.RunTest(testToRun, maxTimeToRun: 90);
}
}
}

View file

@ -194,6 +194,9 @@ namespace MatterHackers.MatterControl.Tests.Automation
process.Start();
// edit the com port
SystemWindow containingWindow;
var editButton = testRunner.GetWidgetByName("Edit Printer Button", out containingWindow);
testRunner.WaitUntil(() => editButton.Enabled, 5); // Wait until the edit button is ready to click it. Ensures the printer is loaded.
testRunner.ClickByName("Edit Printer Button", 3);
testRunner.ClickByName("Serial Port Dropdown", 3);

View file

@ -30,16 +30,14 @@ namespace MatterHackers.MatterControl
}
}
public void OutboundRequest(bool success)
public void WebRequestFailed()
{
if (success)
{
failedRequestCount = 0;
}
else
{
failedRequestCount++;
}
failedRequestCount++;
}
public void WebRequestSucceeded()
{
failedRequestCount = 0;
}
public static AuthenticationData Instance { get; } = new AuthenticationData();

View file

@ -115,7 +115,7 @@ namespace MatterHackers.MatterControl.VersionManagement
RequestFailed(this, new ResponseErrorEventArgs() { ResponseValues = responseValues });
}
ApplicationController.OutboundRequest?.Invoke(false);
ApplicationController.WebRequestFailed?.Invoke();
}
protected void OnRequestSuceeded(ResponseType responseItem)
@ -125,7 +125,7 @@ namespace MatterHackers.MatterControl.VersionManagement
{
tempHandler(this, new ResponseSuccessEventArgs<ResponseType>() { ResponseItem = responseItem });
}
ApplicationController.OutboundRequest?.Invoke(true);
ApplicationController.WebRequestSucceeded?.Invoke();
}
protected void SendRequest()
@ -316,7 +316,7 @@ namespace MatterHackers.MatterControl.VersionManagement
responseValues["ErrorMessage"] = "Unable to connect to server";
responseValues["ErrorCode"] = "00";
ApplicationController.OutboundRequest?.Invoke(false);
ApplicationController.WebRequestFailed?.Invoke();
}
else
{
@ -331,7 +331,7 @@ namespace MatterHackers.MatterControl.VersionManagement
ApplicationController.Instance.ChangeCloudSyncStatus(userAuthenticated: false, reason: "Session Expired".Localize());
}
ApplicationController.OutboundRequest?.Invoke(true);
ApplicationController.WebRequestSucceeded?.Invoke();
}
catch
{