Made the gcode 3d view recreate the bed correctly

Made the printer separate position tracking from bed leveling re-write
This commit is contained in:
larsbrubaker 2014-08-26 17:38:23 -07:00
parent 9e623a2f4a
commit 4a481fb867
3 changed files with 37 additions and 6 deletions

View file

@ -93,6 +93,26 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.printItem = printItem;
CreateAndAddChildren(null);
SliceSettingsWidget.PartPreviewSettingsChanged.RegisterEvent(RecreateBedAndPartPosition, ref unregisterEvents);
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(RecreateBedAndPartPosition, ref unregisterEvents);
}
void RecreateBedAndPartPosition(object sender, EventArgs e)
{
viewerVolume = new Vector3(ActiveSliceSettings.Instance.BedSize, ActiveSliceSettings.Instance.BuildHeight);
bedShape = ActiveSliceSettings.Instance.BedShape;
bedCenter = ActiveSliceSettings.Instance.BedCenter;
double buildHeight = ActiveSliceSettings.Instance.BuildHeight;
UiThread.RunOnIdle((state) =>
{
meshViewerWidget.CreatePrintBed(
viewerVolume,
bedCenter,
bedShape);
});
}
void CreateAndAddChildren(object state)