Converted lots of get properties to methods in SettingsProfile

This commit is contained in:
Lars Brubaker 2016-04-27 18:57:51 -07:00
parent 0ba8a78dc5
commit 895eea253c
40 changed files with 306 additions and 359 deletions

View file

@ -124,11 +124,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|| stringEvent.Data == "bed_shape"
|| stringEvent.Data == "center_part_on_bed")
{
viewerVolume = new Vector3(ActiveSliceSettings.Instance.BedSize, ActiveSliceSettings.Instance.BuildHeight);
bedShape = ActiveSliceSettings.Instance.BedShape;
bedCenter = ActiveSliceSettings.Instance.BedCenter;
viewerVolume = new Vector3(ActiveSliceSettings.Instance.BedSize(), ActiveSliceSettings.Instance.BuildHeight());
bedShape = ActiveSliceSettings.Instance.BedShape();
bedCenter = ActiveSliceSettings.Instance.BedCenter();
double buildHeight = ActiveSliceSettings.Instance.BuildHeight;
double buildHeight = ActiveSliceSettings.Instance.BuildHeight();
UiThread.RunOnIdle(() =>
{
@ -357,7 +357,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
GetRenderType(),
gcodeViewWidget.FeatureToStartOnRatio0To1,
gcodeViewWidget.FeatureToEndOnRatio0To1,
new Vector2[] { ActiveSliceSettings.Instance.GetOffset(0), ActiveSliceSettings.Instance.GetOffset(1) });
new Vector2[] { ActiveSliceSettings.Instance.ExtruderOffset(0), ActiveSliceSettings.Instance.ExtruderOffset(1) });
gcodeViewWidget.gCodeRenderer.Render3D(renderInfo);
}
@ -472,7 +472,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// show the filament used
modelInfoContainer.AddChild(new TextWidget(filamentLengthLabelFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
{
double filamentUsed = gcodeViewWidget.LoadedGCode.GetFilamentUsedMm(ActiveSliceSettings.Instance.FilamentDiameter);
double filamentUsed = gcodeViewWidget.LoadedGCode.GetFilamentUsedMm(ActiveSliceSettings.Instance.FilamentDiameter());
GuiWidget estimatedPrintTime = new TextWidget(string.Format("{0:0.0} mm", filamentUsed), pointSize: 14, textColor: ActiveTheme.Instance.PrimaryTextColor);
//estimatedPrintTime.HAnchor = Agg.UI.HAnchor.ParentLeft;
@ -484,7 +484,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
string filamentVolumeLabelFull = string.Format("{0}:", filamentVolumeLabel);
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLabelFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
{
double filamentMm3 = gcodeViewWidget.LoadedGCode.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter);
double filamentMm3 = gcodeViewWidget.LoadedGCode.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter());
GuiWidget estimatedPrintTime = new TextWidget(string.Format("{0:0.00} cm3", filamentMm3 / 1000), pointSize: 14, textColor: ActiveTheme.Instance.PrimaryTextColor);
//estimatedPrintTime.HAnchor = Agg.UI.HAnchor.ParentLeft;
@ -507,7 +507,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
density = 1.24;
}
double filamentWeightGrams = gcodeViewWidget.LoadedGCode.GetFilamentWeightGrams(ActiveSliceSettings.Instance.FilamentDiameter, density);
double filamentWeightGrams = gcodeViewWidget.LoadedGCode.GetFilamentWeightGrams(ActiveSliceSettings.Instance.FilamentDiameter(), density);
GuiWidget estimatedPrintTime = new TextWidget(string.Format("{0:0.00} g", filamentWeightGrams), pointSize: 14, textColor: ActiveTheme.Instance.PrimaryTextColor);
//estimatedPrintTime.HAnchor = Agg.UI.HAnchor.ParentLeft;
@ -644,7 +644,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
// put in a simulate extrusion checkbox
if (ActiveSliceSettings.Instance.ExtruderCount > 1)
if (ActiveSliceSettings.Instance.ExtruderCount() > 1)
{
CheckBox hideExtruderOffsets = new CheckBox("Hide Offsets", textColor: ActiveTheme.Instance.PrimaryTextColor);
hideExtruderOffsets.Checked = gcodeViewWidget.HideExtruderOffsets;