diff --git a/SlicerConfiguration/Settings/ProfileManager.cs b/SlicerConfiguration/Settings/ProfileManager.cs index 9bd94a87f..21ecd4ca0 100644 --- a/SlicerConfiguration/Settings/ProfileManager.cs +++ b/SlicerConfiguration/Settings/ProfileManager.cs @@ -125,17 +125,21 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return empytProfile; } + [JsonIgnore] + public string ActiveProfilePath => Path.Combine(ProfileManager.ProfilesPath, ActiveProfile.ID + ".json"); + + internal static SettingsProfile LoadProfileFromMCWS(string deviceToken) + { + WebClient client = new WebClient(); + string json = client.DownloadString($"{MatterControlApplication.MCWSBaseUri}/api/1/device/get-profile?key={deviceToken}"); + + var printerSettings = JsonConvert.DeserializeObject(json); + return new SettingsProfile(printerSettings); + } + internal static SettingsProfile LoadProfile(string profileID) { - // Conceptually, LoadProfile should... - // - // Find and load a locally cached copy of the profile - // - Query the webservice for the given profile passing along our ETAG - // Result: 304 or error - // Use locally cached copy as it's the latest or we're offline or the service has errored - // Result: 200 (Document updated remotely) - // Determine if the local profile is dirty. If so, we need to perform conflict resolution to work through the issues - // If not, simply write the profile to disk as latest, load and return + //return LoadProfileFromMCWS(profileID); // Only load profiles by ID that are defined in the profiles.json document if (ProfileManager.Instance[profileID] == null) diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index 712f4d164..9e8c3b2f6 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit 712f4d164d43570c4126991d0eebe50fc7ad61e7 +Subproject commit 9e8c3b2f60cd8a7920ba22a02b5fcf0f9d929c92