Merge pull request #1147 from gregory-diaz/master
Added code to handle scenario where user switches to a printer profil…
This commit is contained in:
commit
cced82136b
1 changed files with 11 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ using System.Collections.Generic;
|
|||
using MatterHackers.Agg.PlatformAbstract;
|
||||
using MatterHackers.SerialPortCommunication.FrostedSerial;
|
||||
using MatterHackers.Agg.UI;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -153,12 +154,21 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
internal static void SwitchToProfile(string printerID)
|
||||
internal static async Task SwitchToProfile(string printerID)
|
||||
{
|
||||
var profile = ProfileManager.LoadProfile(printerID);
|
||||
|
||||
ProfileManager.Instance.SetLastProfile(printerID);
|
||||
|
||||
if (profile == null)
|
||||
{
|
||||
var printerInfo = ProfileManager.Instance[printerID];
|
||||
|
||||
await ApplicationController.GetPrinterProfile(printerInfo, null);
|
||||
|
||||
profile = ProfileManager.LoadProfile(printerID);
|
||||
}
|
||||
|
||||
Instance = profile ?? ProfileManager.LoadEmptyProfile();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue