refactoring
This commit is contained in:
parent
27dc4b1f0a
commit
bae0720164
4 changed files with 164 additions and 163 deletions
|
|
@ -35,7 +35,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
public static class PrinterSettingsExtensions
|
||||
{
|
||||
private static Dictionary<string, string> blackListSettings = new Dictionary<string, string>()
|
||||
private static readonly Dictionary<string, string> BlackListSettings = new Dictionary<string, string>()
|
||||
{
|
||||
[SettingsKey.spiral_vase] = "0",
|
||||
[SettingsKey.layer_to_pause] = "",
|
||||
|
|
@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
[SettingsKey.filament_1_has_been_loaded] = "0"
|
||||
};
|
||||
|
||||
private static object writeLock = new object();
|
||||
private static readonly object WriteLock = new object();
|
||||
|
||||
public static double XSpeed(this PrinterSettings printerSettings)
|
||||
{
|
||||
|
|
@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public static void ClearBlackList(this PrinterSettings settings)
|
||||
{
|
||||
foreach (var kvp in blackListSettings)
|
||||
foreach (var kvp in BlackListSettings)
|
||||
{
|
||||
if (settings.UserLayer.ContainsKey(kvp.Key))
|
||||
{
|
||||
|
|
@ -113,7 +113,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public static void Save(this PrinterSettings settings, string filePath, bool userDrivenChange = true)
|
||||
{
|
||||
// TODO: Rewrite to be owned by ProfileManager and simply mark as dirty and every n period persist and clear dirty flags
|
||||
lock (writeLock)
|
||||
lock (WriteLock)
|
||||
{
|
||||
string json = settings.ToJson();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue