This value accidentally not cached. Turned it back on.

Made some call backs go through invoke.
This commit is contained in:
Lars Brubaker 2015-12-17 16:26:54 -08:00
parent b215128f0d
commit 16562edf45
3 changed files with 7 additions and 31 deletions

View file

@ -921,7 +921,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (gcodeViewWidget != null
&& gcodeViewWidget.LoadedGCode == null)
{
// If we have finished loading the gcode and the source file exists but we don't have any loaded gcode it is because the loaded decided to not load it.
// If we have finished loading the gcode and the source file exists but we don't have any loaded gcode it is because the loader decided to not load it.
if (File.Exists(printItem.FileLocation))
{
SetProcessingMessage(string.Format(fileTooBigToLoad, printItem.Name));

View file

@ -214,10 +214,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
Invalidate();
if (ActiveLayerChanged != null)
{
ActiveLayerChanged(this, null);
}
ActiveLayerChanged?.Invoke(this, null);
}
}
}
@ -286,10 +283,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private void initialLoading_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (LoadingProgressChanged != null)
{
LoadingProgressChanged(this, e);
}
LoadingProgressChanged?.Invoke(this, e);
}
private async void initialLoading_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
@ -298,11 +292,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
gCodeRenderer = new GCodeRenderer(loadedGCode);
await Task.Run(() =>
{
DoPostLoadInitialization();
}
);
await Task.Run(() => DoPostLoadInitialization() );
postLoadInitialization_RunWorkerCompleted();
}
@ -311,10 +301,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
try
{
if (gCodeRenderer.GCodeFileToDraw != null)
{
gCodeRenderer.GCodeFileToDraw.GetFilamentUsedMm(ActiveSliceSettings.Instance.FilamentDiameter);
}
gCodeRenderer.GCodeFileToDraw?.GetFilamentUsedMm(ActiveSliceSettings.Instance.FilamentDiameter);
}
catch (Exception e)
{
@ -324,20 +311,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
gCodeRenderer.CreateFeaturesForLayerIfRequired(0);
}
private void postLoadInitialization_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (LoadingProgressChanged != null)
{
LoadingProgressChanged(this, e);
}
}
private void postLoadInitialization_RunWorkerCompleted()
{
if (DoneLoading != null)
{
DoneLoading(this, null);
}
DoneLoading?.Invoke(this, null);
}
private PathStorage grid = new PathStorage();

@ -1 +1 @@
Subproject commit 00222e4a2c8d1882bc6c9e29072465fe30ec48af
Subproject commit 44e8b42cf7395fa337726e134587b892c331d1e5