Merge pull request #885 from larsbrubaker/master
Don't show connection settings in presets
This commit is contained in:
commit
46ae52c80e
3 changed files with 79 additions and 58 deletions
|
|
@ -59,6 +59,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
|
|
||||||
public string ExtraSettings { get; set; }
|
public string ExtraSettings { get; set; }
|
||||||
|
|
||||||
|
public bool ShowAsOverride { get; set; } = true;
|
||||||
|
|
||||||
public List<QuickMenuNameValue> QuickMenuSettings = new List<QuickMenuNameValue>();
|
public List<QuickMenuNameValue> QuickMenuSettings = new List<QuickMenuNameValue>();
|
||||||
|
|
||||||
public List<string> SetSettingsOnChange = new List<string>();
|
public List<string> SetSettingsOnChange = new List<string>();
|
||||||
|
|
|
||||||
|
|
@ -372,31 +372,30 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
|
|
||||||
this.HAnchor = HAnchor.ParentLeftRight;
|
this.HAnchor = HAnchor.ParentLeftRight;
|
||||||
|
|
||||||
foreach (OrganizerSettingsData settingInfo in subGroup.SettingDataList)
|
foreach (OrganizerSettingsData settingData in subGroup.SettingDataList)
|
||||||
{
|
{
|
||||||
bool settingShouldBeShown = CheckIfShouldBeShown(settingInfo);
|
bool settingShouldBeShown = CheckIfShouldBeShown(settingData);
|
||||||
|
|
||||||
if (ActiveSliceSettings.Instance.ActiveSliceEngine().MapContains(settingInfo.SlicerConfigName)
|
if (ActiveSliceSettings.Instance.ActiveSliceEngine().MapContains(settingData.SlicerConfigName)
|
||||||
&& settingShouldBeShown)
|
&& settingShouldBeShown)
|
||||||
{
|
{
|
||||||
addedSettingToSubGroup = true;
|
addedSettingToSubGroup = true;
|
||||||
bool addControl;
|
bool addControl;
|
||||||
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, copyIndex, out addControl);
|
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingData, copyIndex, out addControl);
|
||||||
if (addControl)
|
if (addControl)
|
||||||
{
|
{
|
||||||
topToBottomSettings.AddChild(controlsForThisSetting);
|
topToBottomSettings.AddChild(controlsForThisSetting);
|
||||||
|
GuiWidget helpBox = AddInHelpText(topToBottomSettings, settingData);
|
||||||
|
if (!sliceSettingsDetailControl.ShowingHelp)
|
||||||
|
{
|
||||||
|
helpBox.Visible = false;
|
||||||
|
}
|
||||||
|
sliceSettingsDetailControl.ShowHelpChanged += (s, e) =>
|
||||||
|
{
|
||||||
|
helpBox.Visible = sliceSettingsDetailControl.ShowingHelp;
|
||||||
|
};
|
||||||
|
topToBottomSettings.AddChild(helpBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiWidget helpBox = AddInHelpText(topToBottomSettings, settingInfo);
|
|
||||||
if (!sliceSettingsDetailControl.ShowingHelp)
|
|
||||||
{
|
|
||||||
helpBox.Visible = false;
|
|
||||||
}
|
|
||||||
sliceSettingsDetailControl.ShowHelpChanged += (s, e) =>
|
|
||||||
{
|
|
||||||
helpBox.Visible = sliceSettingsDetailControl.ShowingHelp;
|
|
||||||
};
|
|
||||||
topToBottomSettings.AddChild(helpBox);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -469,14 +468,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
return leftSideGroupTabs;
|
return leftSideGroupTabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckIfShouldBeShown(OrganizerSettingsData settingInfo)
|
private bool CheckIfShouldBeShown(OrganizerSettingsData settingData)
|
||||||
{
|
{
|
||||||
bool settingShouldBeShown = true;
|
bool settingShouldBeShown = true;
|
||||||
if (settingInfo.ShowIfSet != null
|
if (settingData.ShowIfSet != null
|
||||||
&& settingInfo.ShowIfSet != "")
|
&& settingData.ShowIfSet != "")
|
||||||
{
|
{
|
||||||
string showValue = "0";
|
string showValue = "0";
|
||||||
string checkName = settingInfo.ShowIfSet;
|
string checkName = settingData.ShowIfSet;
|
||||||
if (checkName.StartsWith("!"))
|
if (checkName.StartsWith("!"))
|
||||||
{
|
{
|
||||||
showValue = "1";
|
showValue = "1";
|
||||||
|
|
@ -489,10 +488,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (viewFilter == NamedSettingsLayers.Material || viewFilter == NamedSettingsLayers.Quality)
|
||||||
|
{
|
||||||
|
if (!settingData.ShowAsOverride)
|
||||||
|
{
|
||||||
|
settingShouldBeShown = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return settingShouldBeShown;
|
return settingShouldBeShown;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GuiWidget AddInHelpText(FlowLayoutWidget topToBottomSettings, OrganizerSettingsData settingInfo)
|
private GuiWidget AddInHelpText(FlowLayoutWidget topToBottomSettings, OrganizerSettingsData settingData)
|
||||||
{
|
{
|
||||||
FlowLayoutWidget allText = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
FlowLayoutWidget allText = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||||
allText.HAnchor = HAnchor.ParentLeftRight;
|
allText.HAnchor = HAnchor.ParentLeftRight;
|
||||||
|
|
@ -503,7 +510,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
|
|
||||||
double helpPointSize = 10;
|
double helpPointSize = 10;
|
||||||
|
|
||||||
GuiWidget helpWidget = new WrappedTextWidget(settingInfo.HelpText, textRegionWidth, pointSize: helpPointSize, textColor: RGBA_Bytes.White);
|
GuiWidget helpWidget = new WrappedTextWidget(settingData.HelpText, textRegionWidth, pointSize: helpPointSize, textColor: RGBA_Bytes.White);
|
||||||
helpWidget.Margin = new BorderDouble(5, 0, 0, 0);
|
helpWidget.Margin = new BorderDouble(5, 0, 0, 0);
|
||||||
//helpWidget.HAnchor = HAnchor.ParentLeft;
|
//helpWidget.HAnchor = HAnchor.ParentLeft;
|
||||||
allText.AddChild(helpWidget);
|
allText.AddChild(helpWidget);
|
||||||
|
|
@ -538,11 +545,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
{
|
{
|
||||||
if (!SliceSettingsOrganizer.Instance.Contains(UserLevel, keyValue.Key))
|
if (!SliceSettingsOrganizer.Instance.Contains(UserLevel, keyValue.Key))
|
||||||
{
|
{
|
||||||
OrganizerSettingsData settingInfo = new OrganizerSettingsData(keyValue.Key, keyValue.Key, OrganizerSettingsData.DataEditTypes.STRING);
|
OrganizerSettingsData settingData = new OrganizerSettingsData(keyValue.Key, keyValue.Key, OrganizerSettingsData.DataEditTypes.STRING);
|
||||||
if (ActiveSliceSettings.Instance.ActiveSliceEngine().MapContains(settingInfo.SlicerConfigName))
|
if (ActiveSliceSettings.Instance.ActiveSliceEngine().MapContains(settingData.SlicerConfigName))
|
||||||
{
|
{
|
||||||
bool addControl;
|
bool addControl;
|
||||||
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, 0, out addControl);
|
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingData, 0, out addControl);
|
||||||
if (addControl)
|
if (addControl)
|
||||||
{
|
{
|
||||||
topToBottomSettings.AddChild(controlsForThisSetting);
|
topToBottomSettings.AddChild(controlsForThisSetting);
|
||||||
|
|
@ -1401,30 +1408,34 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
container.HAnchor = HAnchor.ParentLeftRight;
|
container.HAnchor = HAnchor.ParentLeftRight;
|
||||||
container.VAnchor = VAnchor.FitToChildren;
|
container.VAnchor = VAnchor.FitToChildren;
|
||||||
|
|
||||||
var restoreButton = new Button(new ButtonViewStates(new ImageWidget(restoreNormal), new ImageWidget(restoreHover), new ImageWidget(restorePressed), new ImageWidget(restoreNormal)))
|
Button restoreButton = null;
|
||||||
|
if (settingData.ShowAsOverride)
|
||||||
{
|
{
|
||||||
Name = "Restore " + settingData.SlicerConfigName,
|
restoreButton = new Button(new ButtonViewStates(new ImageWidget(restoreNormal), new ImageWidget(restoreHover), new ImageWidget(restorePressed), new ImageWidget(restoreNormal)))
|
||||||
VAnchor = VAnchor.ParentCenter,
|
{
|
||||||
Margin = new BorderDouble(0, 0, 5, 0),
|
Name = "Restore " + settingData.SlicerConfigName,
|
||||||
ToolTipText = "Restore Default".Localize()
|
VAnchor = VAnchor.ParentCenter,
|
||||||
};
|
Margin = new BorderDouble(0, 0, 5, 0),
|
||||||
|
ToolTipText = "Restore Default".Localize()
|
||||||
|
};
|
||||||
|
|
||||||
restoreButton.Click += (sender, e) =>
|
restoreButton.Click += (sender, e) =>
|
||||||
{
|
{
|
||||||
// Revert the user override
|
// Revert the user override
|
||||||
if (persistenceLayer == null)
|
if (persistenceLayer == null)
|
||||||
{
|
{
|
||||||
ActiveSliceSettings.Instance.ClearValue(settingData.SlicerConfigName);
|
ActiveSliceSettings.Instance.ClearValue(settingData.SlicerConfigName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ActiveSliceSettings.Instance.ClearValue(settingData.SlicerConfigName, persistenceLayer);
|
ActiveSliceSettings.Instance.ClearValue(settingData.SlicerConfigName, persistenceLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsRow.RefreshValue(layerCascade);
|
settingsRow.RefreshValue(layerCascade);
|
||||||
};
|
};
|
||||||
|
|
||||||
restoreArea.AddChild(restoreButton);
|
restoreArea.AddChild(restoreButton);
|
||||||
|
}
|
||||||
|
|
||||||
container.AddChild(settingsRow);
|
container.AddChild(settingsRow);
|
||||||
|
|
||||||
|
|
@ -1436,7 +1447,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
switch (this.viewFilter)
|
switch (this.viewFilter)
|
||||||
{
|
{
|
||||||
case NamedSettingsLayers.All:
|
case NamedSettingsLayers.All:
|
||||||
settingsRow.BackgroundColor = userSettingBackgroundColor;
|
if (settingData.ShowAsOverride)
|
||||||
|
{
|
||||||
|
settingsRow.BackgroundColor = userSettingBackgroundColor;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case NamedSettingsLayers.Material:
|
case NamedSettingsLayers.Material:
|
||||||
settingsRow.BackgroundColor = materialSettingBackgroundColor;
|
settingsRow.BackgroundColor = materialSettingBackgroundColor;
|
||||||
|
|
@ -1446,7 +1460,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreButton.Visible = true;
|
if(restoreButton != null) restoreButton.Visible = true;
|
||||||
}
|
}
|
||||||
else if (layerCascade == null)
|
else if (layerCascade == null)
|
||||||
{
|
{
|
||||||
|
|
@ -1463,11 +1477,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
settingsRow.BackgroundColor = RGBA_Bytes.Transparent;
|
settingsRow.BackgroundColor = RGBA_Bytes.Transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreButton.Visible = false;
|
if (restoreButton != null) restoreButton.Visible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
restoreButton.Visible = false;
|
if (restoreButton != null) restoreButton.Visible = false;
|
||||||
settingsRow.BackgroundColor = RGBA_Bytes.Transparent;
|
settingsRow.BackgroundColor = RGBA_Bytes.Transparent;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1222,35 +1222,40 @@
|
||||||
"HelpText": "The serial port communication speed of the printers firmware.",
|
"HelpText": "The serial port communication speed of the printers firmware.",
|
||||||
"DataEditType": "INT",
|
"DataEditType": "INT",
|
||||||
"ExtraSettings": "",
|
"ExtraSettings": "",
|
||||||
"QuickMenuSettings": [{"MenuName" : "115200", "Value": "115200"},{"MenuName" : "250000", "Value": "250000"}]
|
"QuickMenuSettings": [{"MenuName" : "115200", "Value": "115200"},{"MenuName" : "250000", "Value": "250000"}],
|
||||||
|
"ShowAsOverride": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "MatterControl.DeletePrinter",
|
"SlicerConfigName": "MatterControl.DeletePrinter",
|
||||||
"PresentationName": "",
|
"PresentationName": "",
|
||||||
"HelpText": "Delete the currently selected printer profile.",
|
"HelpText": "Delete the currently selected printer profile.",
|
||||||
"DataEditType": "DELETE_PRINTER",
|
"DataEditType": "DELETE_PRINTER",
|
||||||
"ExtraSettings": ""
|
"ExtraSettings": "",
|
||||||
|
"ShowAsOverride": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "MatterControl.PrinterName",
|
"SlicerConfigName": "MatterControl.PrinterName",
|
||||||
"PresentationName": "",
|
"PresentationName": "",
|
||||||
"HelpText": "This is the name of your printer that will be displayed in the choose printer menu.",
|
"HelpText": "This is the name of your printer that will be displayed in the choose printer menu.",
|
||||||
"DataEditType": "STRING",
|
"DataEditType": "STRING",
|
||||||
"ExtraSettings": ""
|
"ExtraSettings": "",
|
||||||
|
"ShowAsOverride": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "MatterControl.AutoConnect",
|
"SlicerConfigName": "MatterControl.AutoConnect",
|
||||||
"PresentationName": "Auto Connect",
|
"PresentationName": "Auto Connect",
|
||||||
"HelpText": "If set, the printer will automatically attempt to connect when selected.",
|
"HelpText": "If set, the printer will automatically attempt to connect when selected.",
|
||||||
"DataEditType": "CHECK_BOX",
|
"DataEditType": "CHECK_BOX",
|
||||||
"ExtraSettings": ""
|
"ExtraSettings": "",
|
||||||
|
"ShowAsOverride": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "MatterControl.ComPort",
|
"ShowAsOverride": false,
|
||||||
"PresentationName": "COM Port",
|
|
||||||
"HelpText": "The COM port to use while connecting to this printer.",
|
|
||||||
"DataEditType": "COM_PORT",
|
"DataEditType": "COM_PORT",
|
||||||
"ExtraSettings": ""
|
"ExtraSettings": "",
|
||||||
|
"HelpText": "The COM port to use while connecting to this printer.",
|
||||||
|
"PresentationName": "COM Port",
|
||||||
|
"SlicerConfigName": "MatterControl.ComPort"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "vibration_limit",
|
"SlicerConfigName": "vibration_limit",
|
||||||
|
|
@ -1260,11 +1265,11 @@
|
||||||
"ExtraSettings": "Hz"
|
"ExtraSettings": "Hz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "wipe",
|
|
||||||
"PresentationName": "Wipe Before Retract",
|
|
||||||
"HelpText": "The extruder will wipe the nozzle over the last up to 10 mm of tool path after retracting.",
|
|
||||||
"DataEditType": "CHECK_BOX",
|
"DataEditType": "CHECK_BOX",
|
||||||
"ExtraSettings": ""
|
"ExtraSettings": "",
|
||||||
|
"HelpText": "The extruder will wipe the nozzle over the last up to 10 mm of tool path after retracting.",
|
||||||
|
"PresentationName": "Wipe Before Retract",
|
||||||
|
"SlicerConfigName": "wipe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"SlicerConfigName": "wipe_shield_distance",
|
"SlicerConfigName": "wipe_shield_distance",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue