Implemented MC side receive of Public Profile list and public profiles
This commit is contained in:
parent
e926186f6b
commit
bc5ef8a5b3
8 changed files with 229 additions and 36 deletions
|
|
@ -38,6 +38,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
using Agg;
|
||||
using Localizations;
|
||||
using VersionManagement;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Net;
|
||||
|
|
@ -272,18 +273,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
private static OemProfile LoadHttpOemProfile(string make, string model)
|
||||
{
|
||||
string url = string.Format(
|
||||
"http://matterdata.azurewebsites.net/api/oemprofiles?manufacturer={0}&model={1}",
|
||||
WebUtility.UrlEncode(make),
|
||||
WebUtility.UrlEncode(model));
|
||||
|
||||
var client = new WebClient();
|
||||
|
||||
string profileText = client.DownloadString(url);
|
||||
var printerProfile = JsonConvert.DeserializeObject<OemProfile>(profileText);
|
||||
RetrievePublicProfileRequest profileRequest = new RetrievePublicProfileRequest();
|
||||
string profText = profileRequest.getPrinterProfileByMakeModel(make, model);
|
||||
var printerProfile = JsonConvert.DeserializeObject<OemProfile>(profText);
|
||||
|
||||
return printerProfile;
|
||||
}
|
||||
|
||||
|
||||
private static void Profiles_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
// Any time the list changes, persist the updates to disk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue