commit
f0632866a5
4 changed files with 51 additions and 23 deletions
|
|
@ -278,6 +278,19 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
alwaysEnabled.Add(temperatureRow);
|
||||
alwaysEnabled.Add(hotendRow);
|
||||
|
||||
if (hotendIndex == 1)
|
||||
{
|
||||
// add the extrusion movement speed multiplier
|
||||
var extruderMultiplier = SliceSettingsTabView.CreateItemRow(PrinterSettings.SettingsData[SettingsKey.t1_extrusion_move_speed_multiplier],
|
||||
settingsContext,
|
||||
printer,
|
||||
menuTheme,
|
||||
ref tabIndex,
|
||||
allUiFields);
|
||||
container.AddChild(extruderMultiplier);
|
||||
alwaysEnabled.Add(extruderMultiplier);
|
||||
}
|
||||
|
||||
// add in the temp graph
|
||||
var graph = new DataViewGraph()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,15 +27,16 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
|
|
@ -55,6 +56,8 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
private static HashSet<string> savedImages = new HashSet<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Download an image from the web into the specified ImageBuffer
|
||||
/// </summary>
|
||||
|
|
@ -75,6 +78,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
WebClient client = new WebClient();
|
||||
client.DownloadDataCompleted += (sender, e) =>
|
||||
{
|
||||
|
|
@ -83,7 +87,13 @@ namespace MatterHackers.MatterControl
|
|||
Stream stream = new MemoryStream(e.Result);
|
||||
|
||||
LoadImageInto(imageToLoadInto, scaleToImageX, scalingBlender, stream);
|
||||
Task.Run(() => AggContext.ImageIO.SaveImageData(imageFileName, imageToLoadInto));
|
||||
if (imageToLoadInto.Width > 0
|
||||
&& imageToLoadInto.Height > 0
|
||||
&& !savedImages.Contains(imageFileName))
|
||||
{
|
||||
savedImages.Add(imageFileName);
|
||||
AggContext.ImageIO.SaveImageData(imageFileName, imageToLoadInto);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -256,12 +266,9 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
double finalScale = imageToLoadInto.Width / (double)unScaledImage.Width;
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
imageToLoadInto.Allocate(imageToLoadInto.Width, (int)(unScaledImage.Height * finalScale), imageToLoadInto.Width * (imageToLoadInto.BitDepth / 8), imageToLoadInto.BitDepth);
|
||||
imageToLoadInto.NewGraphics2D().Render(unScaledImage, 0, 0, 0, finalScale, finalScale);
|
||||
imageToLoadInto.MarkImageChanged();
|
||||
});
|
||||
imageToLoadInto.Allocate(imageToLoadInto.Width, (int)(unScaledImage.Height * finalScale), imageToLoadInto.Width * (imageToLoadInto.BitDepth / 8), imageToLoadInto.BitDepth);
|
||||
imageToLoadInto.NewGraphics2D().Render(unScaledImage, 0, 0, 0, finalScale, finalScale);
|
||||
imageToLoadInto.MarkImageChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
{
|
||||
protected Dictionary<string, string> requestValues;
|
||||
protected string uri;
|
||||
private static object locker = new object();
|
||||
|
||||
public WebRequestBase()
|
||||
{
|
||||
|
|
@ -63,7 +64,8 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
|
||||
public event EventHandler<ResponseType> RequestSucceeded;
|
||||
|
||||
public event EventHandler<ResponseType> CacheMiss;
|
||||
public event EventHandler<ResponseType> ReloadRequest;
|
||||
|
||||
public static void Request(string requestUrl, string[] requestStringPairs)
|
||||
{
|
||||
WebRequestBase<ResponseType> tempRequest = new WebRequestBase<ResponseType>();
|
||||
|
|
@ -103,7 +105,7 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
});
|
||||
}
|
||||
|
||||
//This gets called after failure or success
|
||||
// This gets called after failure or success
|
||||
protected void OnRequestComplete()
|
||||
{
|
||||
RequestComplete?.Invoke(this, null);
|
||||
|
|
@ -128,7 +130,7 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
ResponseType cacheResponse = null;
|
||||
|
||||
if (longHash != 0
|
||||
&& CacheMiss != null)
|
||||
&& ReloadRequest != null)
|
||||
{
|
||||
if (File.Exists(cacheFileName))
|
||||
{
|
||||
|
|
@ -177,20 +179,24 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
|
||||
if (responseItem != null)
|
||||
{
|
||||
if (CacheMiss != null
|
||||
if (ReloadRequest != null
|
||||
&& longHash != 0)
|
||||
{
|
||||
if (cacheResponse == null || !cacheResponse.Equals(responseItem))
|
||||
{
|
||||
File.WriteAllText(cacheFileName, requestManager.LastResponse);
|
||||
lock (locker)
|
||||
{
|
||||
File.WriteAllText(cacheFileName, requestManager.LastResponse);
|
||||
}
|
||||
|
||||
if (cacheResponse != null)
|
||||
{
|
||||
// we already sent back the succeeded response, send a cache miss
|
||||
CacheMiss(this, responseItem);
|
||||
ReloadRequest(this, responseItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send back the succeeded response
|
||||
// send back the succeeded response
|
||||
OnRequestSucceeded(responseItem);
|
||||
}
|
||||
}
|
||||
|
|
@ -212,12 +218,12 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
/// <summary>
|
||||
/// Provides a WebReqeustBase implementation that allows the caller to specify the serialization object used by the WebRequestBase http post
|
||||
/// </summary>
|
||||
/// <typeparam name="RequestType">The type which will be passed to the Request method, stored in a local instance and serialized for the http post</typeparam>
|
||||
public class WebRequest2<RequestType> : WebRequestBase where RequestType : class
|
||||
/// <typeparam name="TRequestType">The type which will be passed to the Request method, stored in a local instance and serialized for the http post</typeparam>
|
||||
public class WebRequest2<TRequestType> : WebRequestBase where TRequestType : class
|
||||
{
|
||||
private RequestType localRequestValues;
|
||||
private TRequestType localRequestValues;
|
||||
|
||||
public void Request(string requestUrl, RequestType requestValues)
|
||||
public void Request(string requestUrl, TRequestType requestValues)
|
||||
{
|
||||
this.uri = requestUrl;
|
||||
localRequestValues = requestValues;
|
||||
|
|
@ -235,6 +241,7 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
{
|
||||
protected Dictionary<string, string> requestValues;
|
||||
protected string uri;
|
||||
|
||||
public WebRequestBase()
|
||||
{
|
||||
requestValues = new Dictionary<string, string>();
|
||||
|
|
@ -251,6 +258,7 @@ namespace MatterHackers.MatterControl.VersionManagement
|
|||
public event EventHandler<ResponseErrorEventArgs> RequestFailed;
|
||||
|
||||
public event EventHandler RequestSucceeded;
|
||||
|
||||
public static void Request(string requestUrl, string[] requestStringPairs)
|
||||
{
|
||||
WebRequestBase tempRequest = new WebRequestBase();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 43ec3a2e8b276c52a89a9a461b3b04ad59dcb64b
|
||||
Subproject commit 1cc561025d4facb873f88717784bcaa026bc37ec
|
||||
Loading…
Add table
Add a link
Reference in a new issue