Merge pull request #965 from larsbrubaker/master
More settings moved to GetValue
This commit is contained in:
commit
301108cc7c
23 changed files with 96 additions and 118 deletions
|
|
@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
protected override void SetTargetTemperature()
|
||||
{
|
||||
double targetTemp = ActiveSliceSettings.Instance.BedTemperature();
|
||||
double targetTemp = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.bed_temperature);
|
||||
if (targetTemp != 0)
|
||||
{
|
||||
double goalTemp = (int)(targetTemp + .5);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.Plugins.BrailleBuilder
|
||||
|
|
@ -47,9 +48,9 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder
|
|||
double buildHeight = ActiveSliceSettings.Instance.GetValue<double>("build_height");
|
||||
|
||||
part3DView = new View3DBrailleBuilder(
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), buildHeight),
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
|
||||
ActiveSliceSettings.Instance.GetValue<Vector2>("print_center"),
|
||||
ActiveSliceSettings.Instance.BedShape());
|
||||
ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape));
|
||||
|
||||
#if __ANDROID__
|
||||
this.AddChild(new SoftKeyboardContentOffset(part3DView));
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ namespace MatterHackers.MatterControl.Plugins.BrailleBuilder
|
|||
private TypeFace brailTypeFace;
|
||||
private TypeFace boldTypeFace;
|
||||
|
||||
public View3DBrailleBuilder(Vector3 viewerVolume, Vector2 bedCenter, MeshViewerWidget.BedShape bedShape)
|
||||
public View3DBrailleBuilder(Vector3 viewerVolume, Vector2 bedCenter, BedShape bedShape)
|
||||
{
|
||||
boldTypeFace = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "LiberationMono.svg")));
|
||||
brailTypeFace = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "Braille.svg")));
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
var settings = ActiveSliceSettings.Instance;
|
||||
|
||||
// Reset active slicer to MatterSlice when multi-extruder is detected and MatterSlice is not already set
|
||||
if (settings?.ExtruderCount() > 1 && settings.ActiveSliceEngineType() != SlicingEngineTypes.MatterSlice)
|
||||
if (settings?.GetValue<int>(SettingsKey.extruder_count) > 1 && settings.ActiveSliceEngineType() != SlicingEngineTypes.MatterSlice)
|
||||
{
|
||||
settings.ActiveSliceEngineType(SlicingEngineTypes.MatterSlice);
|
||||
ApplicationController.Instance.ReloadAll(null, null);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
using System;
|
||||
|
||||
|
|
@ -79,12 +80,12 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
|
||||
public static Vector2 GetPrintLevelPositionToSample(int index)
|
||||
{
|
||||
Vector2 bedSize = ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size");
|
||||
Vector2 bedSize = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size);
|
||||
Vector2 printCenter = ActiveSliceSettings.Instance.GetValue<Vector2>("print_center");
|
||||
|
||||
switch (ActiveSliceSettings.Instance.BedShape())
|
||||
switch (ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape))
|
||||
{
|
||||
case MeshVisualizer.MeshViewerWidget.BedShape.Circular:
|
||||
case BedShape.Circular:
|
||||
Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .5);
|
||||
switch (index)
|
||||
{
|
||||
|
|
@ -101,7 +102,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
|
||||
case MeshVisualizer.MeshViewerWidget.BedShape.Rectangular:
|
||||
case BedShape.Rectangular:
|
||||
default:
|
||||
switch (index)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
meshViewerWidget.CreatePrintBed(
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), buildHeight),
|
||||
ActiveSliceSettings.Instance.GetValue<Vector2>("print_center"),
|
||||
ActiveSliceSettings.Instance.BedShape());
|
||||
ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape));
|
||||
PutOemImageOnBed();
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ using MatterHackers.Agg.UI;
|
|||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
|
@ -99,9 +100,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
// put in the 3D view
|
||||
partPreviewView = new View3DWidget(printItem,
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), buildHeight),
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
|
||||
ActiveSliceSettings.Instance.GetValue<Vector2>("print_center"),
|
||||
ActiveSliceSettings.Instance.BedShape(),
|
||||
ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape),
|
||||
windowMode,
|
||||
autoRotate3DView,
|
||||
openMode);
|
||||
|
|
@ -116,9 +117,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
|
||||
viewGcodeBasic = new ViewGcodeBasic(printItem,
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), buildHeight),
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
|
||||
ActiveSliceSettings.Instance.GetValue<Vector2>("print_center"),
|
||||
ActiveSliceSettings.Instance.BedShape(), gcodeWindowMode);
|
||||
ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape), gcodeWindowMode);
|
||||
|
||||
if (windowMode == View3DWidget.WindowMode.StandAlone)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
public event EventHandler SelectedTransformChanged;
|
||||
|
||||
public View3DWidget(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, Vector2 bedCenter, MeshViewerWidget.BedShape bedShape, WindowMode windowType, AutoRotate autoRotate, OpenMode openMode = OpenMode.Viewing)
|
||||
public View3DWidget(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, Vector2 bedCenter, BedShape bedShape, WindowMode windowType, AutoRotate autoRotate, OpenMode openMode = OpenMode.Viewing)
|
||||
{
|
||||
this.openMode = openMode;
|
||||
this.windowType = windowType;
|
||||
|
|
@ -1064,7 +1064,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
private void AddMaterialControls(FlowLayoutWidget buttonPanel)
|
||||
{
|
||||
extruderButtons.Clear();
|
||||
for (int extruderIndex = 0; extruderIndex < ActiveSliceSettings.Instance.ExtruderCount(); extruderIndex++)
|
||||
for (int extruderIndex = 0; extruderIndex < ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count); extruderIndex++)
|
||||
{
|
||||
FlowLayoutWidget colorSelectionContainer = new FlowLayoutWidget(FlowDirection.LeftToRight);
|
||||
colorSelectionContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
|
@ -1461,7 +1461,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
|
||||
// put in the material options
|
||||
int numberOfExtruders = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int numberOfExtruders = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
expandMaterialOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Materials".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness());
|
||||
expandMaterialOptions.Margin = new BorderDouble(bottom: 2);
|
||||
|
|
@ -2110,8 +2110,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
AxisAlignedBoundingBox allBounds = MeshViewerWidget.GetAxisAlignedBoundingBox(MeshGroups);
|
||||
bool onBed = allBounds.minXYZ.z > -.001 && allBounds.minXYZ.z < .001; // really close to the bed
|
||||
RectangleDouble bedRect = new RectangleDouble(0, 0, ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size").x, ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size").y);
|
||||
bedRect.Offset(ActiveSliceSettings.Instance.GetValue<Vector2>("print_center") - ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size") / 2);
|
||||
RectangleDouble bedRect = new RectangleDouble(0, 0, ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size).x, ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size).y);
|
||||
bedRect.Offset(ActiveSliceSettings.Instance.GetValue<Vector2>("print_center") - ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size) / 2);
|
||||
|
||||
bool inBounds = bedRect.Contains(new Vector2(allBounds.minXYZ)) && bedRect.Contains(new Vector2(allBounds.maxXYZ));
|
||||
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
private Vector2 bedCenter;
|
||||
private Vector3 viewerVolume;
|
||||
private MeshViewerWidget.BedShape bedShape;
|
||||
private BedShape bedShape;
|
||||
private int sliderWidth;
|
||||
|
||||
public ViewGcodeBasic(PrintItemWrapper printItem, Vector3 viewerVolume, Vector2 bedCenter, MeshViewerWidget.BedShape bedShape, WindowMode windowMode)
|
||||
public ViewGcodeBasic(PrintItemWrapper printItem, Vector3 viewerVolume, Vector2 bedCenter, BedShape bedShape, WindowMode windowMode)
|
||||
{
|
||||
this.viewerVolume = viewerVolume;
|
||||
this.bedShape = bedShape;
|
||||
|
|
@ -126,8 +126,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|| stringEvent.Data == "bed_shape"
|
||||
|| stringEvent.Data == "center_part_on_bed")
|
||||
{
|
||||
viewerVolume = new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), ActiveSliceSettings.Instance.GetValue<double>("build_height"));
|
||||
bedShape = ActiveSliceSettings.Instance.BedShape();
|
||||
viewerVolume = new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), ActiveSliceSettings.Instance.GetValue<double>("build_height"));
|
||||
bedShape = ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape);
|
||||
bedCenter = ActiveSliceSettings.Instance.GetValue<Vector2>("print_center");
|
||||
|
||||
double buildHeight = ActiveSliceSettings.Instance.GetValue<double>("build_height");
|
||||
|
|
@ -646,7 +646,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
|
||||
// put in a simulate extrusion checkbox
|
||||
if (ActiveSliceSettings.Instance.ExtruderCount() > 1)
|
||||
if (ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count) > 1)
|
||||
{
|
||||
CheckBox hideExtruderOffsets = new CheckBox("Hide Offsets", textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
hideExtruderOffsets.Checked = gcodeViewWidget.HideExtruderOffsets;
|
||||
|
|
|
|||
|
|
@ -2800,7 +2800,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication
|
|||
|
||||
private void TurnOffBedAndExtruders()
|
||||
{
|
||||
for (int i = 0; i < ActiveSliceSettings.Instance.ExtruderCount(); i++)
|
||||
for (int i = 0; i < ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count); i++)
|
||||
{
|
||||
SetTargetExtruderTemperature(i, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
|||
temperatureGroupBox.AddChild(mainContainer);
|
||||
RGBA_Bytes separatorLineColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 100);
|
||||
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
if (numberOfHeatedExtruders > 1)
|
||||
{
|
||||
for (int i = 0; i < numberOfHeatedExtruders; i++)
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
protected override double GetPreheatTemperature()
|
||||
{
|
||||
return ActiveSliceSettings.Instance.BedTemperature();
|
||||
return ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
}
|
||||
|
||||
protected override double GetActualTemperature()
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
private FlowLayoutWidget CreateEButtons(double buttonSeparationDistance)
|
||||
{
|
||||
int extruderCount = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int extruderCount = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
FlowLayoutWidget eButtons = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,14 +48,20 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
using DataStorage;
|
||||
using Agg.PlatformAbstract;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using MeshVisualizer;
|
||||
public enum SettingsKey
|
||||
{
|
||||
bed_shape,
|
||||
bed_size,
|
||||
bed_temperature,
|
||||
has_heated_bed,
|
||||
resume_position_before_z_home,
|
||||
z_homes_to_max,
|
||||
nozzle_diameter,
|
||||
min_fan_speed,
|
||||
extruder_count,
|
||||
extruders_share_temperature,
|
||||
fill_density,
|
||||
};
|
||||
|
||||
public class SettingsProfile
|
||||
|
|
@ -231,16 +237,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
layeredProfile.SetMaterialPreset(extruderIndex, text);
|
||||
}
|
||||
|
||||
public double BedTemperature()
|
||||
{
|
||||
double targetTemp = 0;
|
||||
if (this.GetValue<bool>("has_heated_bed"))
|
||||
{
|
||||
double.TryParse(GetValue("bed_temperature"), out targetTemp);
|
||||
}
|
||||
return targetTemp;
|
||||
}
|
||||
|
||||
public int[] LayerToPauseOn()
|
||||
{
|
||||
string[] userValues = GetValue("layer_to_pause").Split(';');
|
||||
|
|
@ -256,26 +252,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}).ToArray();
|
||||
}
|
||||
|
||||
public double FillDensity()
|
||||
{
|
||||
string fillDensityValueString = GetValue("fill_density");
|
||||
if (fillDensityValueString.Contains("%"))
|
||||
{
|
||||
string onlyNumber = fillDensityValueString.Replace("%", "");
|
||||
double ratio = ParseDouble(onlyNumber) / 100;
|
||||
return ratio;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ParseDouble(GetValue("fill_density"));
|
||||
}
|
||||
}
|
||||
|
||||
public double MinFanSpeed()
|
||||
{
|
||||
return ParseDouble(GetValue("min_fan_speed"));
|
||||
}
|
||||
|
||||
internal string MaterialPresetKey(int extruderIndex)
|
||||
{
|
||||
return layeredProfile.GetMaterialPresetKey(extruderIndex);
|
||||
|
|
@ -296,42 +272,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return firstLayerValue;
|
||||
}
|
||||
|
||||
public MeshVisualizer.MeshViewerWidget.BedShape BedShape()
|
||||
{
|
||||
switch (GetValue("bed_shape"))
|
||||
{
|
||||
case "rectangular":
|
||||
return MeshVisualizer.MeshViewerWidget.BedShape.Rectangular;
|
||||
|
||||
case "circular":
|
||||
return MeshVisualizer.MeshViewerWidget.BedShape.Circular;
|
||||
|
||||
default:
|
||||
#if DEBUG
|
||||
throw new NotImplementedException(string.Format("'{0}' is not a known bed_shape.", GetValue("bed_shape")));
|
||||
#else
|
||||
return MeshVisualizer.MeshViewerWidget.BedShape.Rectangular;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public int ExtruderCount()
|
||||
{
|
||||
if (this.GetValue<bool>("extruders_share_temperature"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int extruderCount;
|
||||
string extruderCountString = GetValue("extruder_count");
|
||||
if (!int.TryParse(extruderCountString, out extruderCount))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return extruderCount;
|
||||
}
|
||||
|
||||
public Vector2 ExtruderOffset(int extruderIndex)
|
||||
{
|
||||
string currentOffsets = GetValue("extruder_offset");
|
||||
|
|
@ -449,15 +389,21 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (typeof(T) == typeof(bool))
|
||||
{
|
||||
return (T)(object) (this.GetValue(settingsKey) == "1");
|
||||
return (T)(object)(this.GetValue(settingsKey) == "1");
|
||||
}
|
||||
else if (typeof(T) == typeof(int))
|
||||
{
|
||||
if (settingsKey == SettingsKey.extruder_count.ToString()
|
||||
&& this.GetValue<bool>(SettingsKey.extruders_share_temperature))
|
||||
{
|
||||
return (T)(object)1;
|
||||
}
|
||||
|
||||
int result;
|
||||
int.TryParse(this.GetValue(settingsKey), out result);
|
||||
return (T)(object)(result);
|
||||
}
|
||||
else if(typeof(T) == typeof(Vector2))
|
||||
else if (typeof(T) == typeof(Vector2))
|
||||
{
|
||||
string[] twoValues = GetValue(settingsKey).Split(',');
|
||||
if (twoValues.Length != 2)
|
||||
|
|
@ -481,7 +427,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
return (T)(object)(GetValue<double>("layer_height") * ratio);
|
||||
}
|
||||
else if(settingsKey == "first_layer_extrusion_width")
|
||||
else if (settingsKey == "first_layer_extrusion_width")
|
||||
{
|
||||
return (T)(object)(GetValue<double>("layer_height") * ratio);
|
||||
}
|
||||
|
|
@ -489,10 +435,35 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return (T)(object)(ratio);
|
||||
}
|
||||
|
||||
if (settingsKey == SettingsKey.bed_temperature.ToString()
|
||||
&& !this.GetValue<bool>("has_heated_bed"))
|
||||
{
|
||||
return (T)(object)(0);
|
||||
}
|
||||
|
||||
double result;
|
||||
double.TryParse(this.GetValue(settingsKey), out result);
|
||||
return (T)(object)(result);
|
||||
}
|
||||
else if (typeof(T) == typeof(BedShape))
|
||||
{
|
||||
switch (GetValue(settingsKey.ToString()))
|
||||
{
|
||||
case "rectangular":
|
||||
return (T)(object)BedShape.Rectangular;
|
||||
|
||||
case "circular":
|
||||
return (T)(object)BedShape.Circular;
|
||||
|
||||
default:
|
||||
#if DEBUG
|
||||
throw new NotImplementedException(string.Format("'{0}' is not a known bed_shape.", GetValue("bed_shape")));
|
||||
#else
|
||||
return (T)(object)BedShape.Rectangular;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (T)default(T);
|
||||
}
|
||||
|
|
@ -677,10 +648,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return false;
|
||||
}
|
||||
|
||||
if (MinFanSpeed() > 100)
|
||||
if (GetValue<double>(SettingsKey.min_fan_speed) > 100)
|
||||
{
|
||||
string error = "The Minimum Fan Speed can only go as high as 100%.".Localize();
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), MinFanSpeed());
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), GetValue<double>(SettingsKey.min_fan_speed));
|
||||
string location = "Location: 'Settings & Controls' -> 'Settings' -> 'Filament' -> 'Cooling'".Localize();
|
||||
StyledMessageBox.ShowMessageBox(null, string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error".Localize());
|
||||
return false;
|
||||
|
|
@ -695,25 +666,25 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ExtruderCount() < 1)
|
||||
if (GetValue<int>(SettingsKey.extruder_count) < 1)
|
||||
{
|
||||
string error = "The Extruder Count must be at least 1.".Localize();
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), ExtruderCount());
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), GetValue<int>(SettingsKey.extruder_count));
|
||||
string location = "Location: 'Settings & Controls' -> 'Settings' -> 'Printer' -> 'Features'".Localize();
|
||||
StyledMessageBox.ShowMessageBox(null, string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error".Localize());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FillDensity() < 0 || FillDensity() > 1)
|
||||
if (GetValue<double>(SettingsKey.fill_density) < 0 || GetValue<double>(SettingsKey.fill_density) > 1)
|
||||
{
|
||||
string error = "The Fill Density must be between 0 and 1.".Localize();
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), FillDensity());
|
||||
string details = string.Format("It is currently set to {0}.".Localize(), GetValue<double>(SettingsKey.fill_density));
|
||||
string location = "Location: 'Settings & Controls' -> 'Settings' -> 'General' -> 'Infill'".Localize();
|
||||
StyledMessageBox.ShowMessageBox(null, string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error".Localize());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FillDensity() == 1
|
||||
if (GetValue<double>(SettingsKey.fill_density) == 1
|
||||
&& GetValue("infill_type") != "LINES")
|
||||
{
|
||||
string error = "Solid Infill works best when set to LINES.".Localize();
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
this.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
this.AddChild(new PresetSelectorWidget("Quality".Localize(), RGBA_Bytes.Yellow, NamedSettingsLayers.Quality, 0));
|
||||
this.AddChild(new GuiWidget(8, 0));
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
foreach (SliceEngineInfo engineMenuItem in SlicingQueue.AvailableSliceEngines)
|
||||
{
|
||||
bool engineAllowed = true;
|
||||
if (ActiveSliceSettings.Instance.ExtruderCount() > 1 && engineMenuItem.Name != "MatterSlice")
|
||||
if (ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count) > 1 && engineMenuItem.Name != "MatterSlice")
|
||||
{
|
||||
engineAllowed = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
if (subGroup.Name == "Extruder X")
|
||||
{
|
||||
numberOfCopies = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
numberOfCopies = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
}
|
||||
|
||||
for (int copyIndex = 0; copyIndex < numberOfCopies; copyIndex++)
|
||||
|
|
|
|||
|
|
@ -168,14 +168,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
preStartGCode.Add("; automatic settings before start_gcode");
|
||||
AddDefaultIfNotPresent(preStartGCode, "G21", preStartGCodeLines, "set units to millimeters");
|
||||
AddDefaultIfNotPresent(preStartGCode, "M107", preStartGCodeLines, "fan off");
|
||||
double bed_temperature = ActiveSliceSettings.Instance.BedTemperature();
|
||||
double bed_temperature = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.bed_temperature);
|
||||
if (bed_temperature > 0)
|
||||
{
|
||||
string setBedTempString = string.Format("M190 S{0}", bed_temperature);
|
||||
AddDefaultIfNotPresent(preStartGCode, setBedTempString, preStartGCodeLines, "wait for bed temperature to be reached");
|
||||
}
|
||||
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
// Start heating all the extruder that we are going to use.
|
||||
for (int extruderIndex0Based = 0; extruderIndex0Based < numberOfHeatedExtruders; extruderIndex0Based++)
|
||||
|
|
@ -238,7 +238,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
List<string> postStartGCode = new List<string>();
|
||||
postStartGCode.Add("; automatic settings after start_gcode");
|
||||
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
|
||||
// don't set the extruders to heating if we already waited for them to reach temp
|
||||
if (ActiveSliceSettings.Instance.GetValue("heat_extruder_before_homing") != "1")
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
extrudersUsed.Clear();
|
||||
|
||||
int extruderCount = ActiveSliceSettings.Instance.ExtruderCount();
|
||||
int extruderCount = ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count);
|
||||
for (int extruderIndex = 0; extruderIndex < extruderCount; extruderIndex++)
|
||||
{
|
||||
extrudersUsed.Add(false);
|
||||
|
|
@ -179,7 +179,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (ActiveSliceSettings.Instance.GetValue<int>("support_material_extruder") != 0)
|
||||
{
|
||||
int supportExtruder = Math.Max(0, Math.Min(ActiveSliceSettings.Instance.ExtruderCount() - 1, ActiveSliceSettings.Instance.GetValue<int>("support_material_extruder") - 1));
|
||||
int supportExtruder = Math.Max(0, Math.Min(ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count) - 1, ActiveSliceSettings.Instance.GetValue<int>("support_material_extruder") - 1));
|
||||
extrudersUsed[supportExtruder] = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (ActiveSliceSettings.Instance.GetValue<int>("raft_extruder") != 0)
|
||||
{
|
||||
int raftExtruder = Math.Max(0, Math.Min(ActiveSliceSettings.Instance.ExtruderCount() - 1, ActiveSliceSettings.Instance.GetValue<int>("raft_extruder") - 1));
|
||||
int raftExtruder = Math.Max(0, Math.Min(ActiveSliceSettings.Instance.GetValue<int>(SettingsKey.extruder_count) - 1, ActiveSliceSettings.Instance.GetValue<int>("raft_extruder") - 1));
|
||||
extrudersUsed[raftExtruder] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5032,3 +5032,6 @@ Translated:You have successfully imported a new printer profile. You can find '{
|
|||
English:Import Successful
|
||||
Translated:Import Successful
|
||||
|
||||
English:The distance between the first layer (the bottom) and the top of the support material. A good value depends on the type of material. For PLA and ABS a value between 0.1 and 0.3 generaly works well.
|
||||
Translated:The distance between the first layer (the bottom) and the top of the support material. A good value depends on the type of material. For PLA and ABS a value between 0.1 and 0.3 generaly works well.
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 02f057d6f7ba993ec5206b1857cf82721bd973a2
|
||||
Subproject commit 0efc4e2fbcbda33885e31cff2cbc3d9a3803e83b
|
||||
|
|
@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.Plugins.TextCreator
|
||||
|
|
@ -47,9 +48,9 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator
|
|||
double buildHeight = ActiveSliceSettings.Instance.GetValue<double>("build_height");
|
||||
|
||||
part3DView = new View3DTextCreator(
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>("bed_size"), buildHeight),
|
||||
new Vector3(ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size), buildHeight),
|
||||
ActiveSliceSettings.Instance.GetValue<Vector2>("print_center"),
|
||||
ActiveSliceSettings.Instance.BedShape());
|
||||
ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape));
|
||||
|
||||
#if __ANDROID__
|
||||
this.AddChild(new SoftKeyboardContentOffset(part3DView));
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace MatterHackers.MatterControl.Plugins.TextCreator
|
|||
|
||||
private TypeFace boldTypeFace;
|
||||
|
||||
public View3DTextCreator(Vector3 viewerVolume, Vector2 bedCenter, MeshViewerWidget.BedShape bedShape)
|
||||
public View3DTextCreator(Vector3 viewerVolume, Vector2 bedCenter, BedShape bedShape)
|
||||
{
|
||||
boldTypeFace = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "LiberationSans-Bold.svg")));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue