Added a new COM_PORT slice setting.
This commit is contained in:
parent
1ba768f9ef
commit
fcbb1bb9ae
5 changed files with 41 additions and 4 deletions
|
|
@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public class OrganizerSettingsData
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DataEditTypes { STRING, INT, INT_OR_MM, DOUBLE, POSITIVE_DOUBLE, OFFSET, DOUBLE_OR_PERCENT, VECTOR2, OFFSET2, CHECK_BOX, LIST, MULTI_LINE_TEXT, HARDWARE_PRESENT };
|
||||
public enum DataEditTypes { STRING, INT, INT_OR_MM, DOUBLE, POSITIVE_DOUBLE, OFFSET, DOUBLE_OR_PERCENT, VECTOR2, OFFSET2, CHECK_BOX, LIST, MULTI_LINE_TEXT, HARDWARE_PRESENT, COM_PORT };
|
||||
|
||||
public string SlicerConfigName { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ using MatterHackers.Agg.UI;
|
|||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.SerialPortCommunication.FrostedSerial;
|
||||
using MatterHackers.VectorMath;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -1047,6 +1048,39 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
break;
|
||||
|
||||
case OrganizerSettingsData.DataEditTypes.COM_PORT:
|
||||
{
|
||||
var selectableOptions = new StyledDropDownList("None", maxHeight: 200)
|
||||
{
|
||||
ToolTipText = settingData.HelpText,
|
||||
Margin = new BorderDouble()
|
||||
};
|
||||
|
||||
foreach (string listItem in FrostedSerialPort.GetPortNames())
|
||||
{
|
||||
MenuItem newItem = selectableOptions.AddItem(listItem);
|
||||
if (newItem.Text == sliceSettingValue)
|
||||
{
|
||||
selectableOptions.SelectedLabel = sliceSettingValue;
|
||||
}
|
||||
|
||||
newItem.Selected += (sender, e) =>
|
||||
{
|
||||
MenuItem menuItem = ((MenuItem)sender);
|
||||
SaveSetting(settingData.SlicerConfigName, menuItem.Text);
|
||||
|
||||
settingsRow2.UpdateStyle();
|
||||
|
||||
OnSettingsChanged(settingData);
|
||||
};
|
||||
}
|
||||
|
||||
dataArea.AddChild(selectableOptions);
|
||||
|
||||
settingsRow2.ValueChanged = (text) => selectableOptions.SelectedLabel = text;
|
||||
}
|
||||
break;
|
||||
|
||||
case OrganizerSettingsData.DataEditTypes.LIST:
|
||||
{
|
||||
var selectableOptions = new StyledDropDownList("None", maxHeight: 200)
|
||||
|
|
|
|||
|
|
@ -1226,8 +1226,8 @@
|
|||
{
|
||||
"SlicerConfigName": "MatterControl.ComPort",
|
||||
"PresentationName": "ComPort",
|
||||
"HelpText": "",
|
||||
"DataEditType": "STRING",
|
||||
"HelpText": "Set the com port to use while connecting to this printer.",
|
||||
"DataEditType": "COM_PORT",
|
||||
"ExtraSettings": ""
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4807,3 +4807,6 @@ Translated:Action
|
|||
English:ComPort
|
||||
Translated:ComPort
|
||||
|
||||
English:Set the com port to use while connecting to this printer.
|
||||
Translated:Set the com port to use while connecting to this printer.
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2917bf31fc782b70928bcf7df3a93d245e051cd6
|
||||
Subproject commit ab0dc31ca55218fdc2d10b987310f8b7eaba5b76
|
||||
Loading…
Add table
Add a link
Reference in a new issue