Making GCodeFile a abstract base class
implementing a loaded gcode file and as streamed gcode file
This commit is contained in:
parent
e1979e770e
commit
55fa89d684
5 changed files with 13 additions and 18 deletions
|
|
@ -264,11 +264,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
if (firstExtrusionIndex > 0)
|
||||
{
|
||||
for (int i = 0; i < loadedGCode.NumChangesInZ; i++)
|
||||
for (int layerIndex = 0; layerIndex < loadedGCode.NumChangesInZ; layerIndex++)
|
||||
{
|
||||
if (firstExtrusionIndex < loadedGCode.IndexOfChangeInZ[i])
|
||||
if (firstExtrusionIndex < loadedGCode.GetInstructionIndexAtLayer(layerIndex))
|
||||
{
|
||||
activeLayerIndex = Math.Max(0, i-1);
|
||||
activeLayerIndex = Math.Max(0, layerIndex-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -481,7 +481,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
public void Load(string gcodePathAndFileName)
|
||||
{
|
||||
loadedGCode = new GCodeFile(gcodePathAndFileName);
|
||||
loadedGCode = GCodeFile.Load(gcodePathAndFileName);
|
||||
SetInitalLayer();
|
||||
CenterPartInView();
|
||||
}
|
||||
|
|
@ -497,7 +497,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(initialLoading_RunWorkerCompleted);
|
||||
|
||||
loadedGCode = null;
|
||||
GCodeFile.LoadInBackground(backgroundWorker, gcodePathAndFileName);
|
||||
GCodeFileLoaded.LoadInBackground(backgroundWorker, gcodePathAndFileName);
|
||||
}
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue