Beispiel #1
0
 public static GCodeFile Load(Stream fileStream,
                              Vector4 maxAccelerationMmPerS2,
                              Vector4 maxVelocityMmPerS,
                              Vector4 velocitySameAsStopMmPerS,
                              Vector4 speedMultiplier,
                              CancellationToken cancellationToken)
 {
     if (FileTooBigToLoad(fileStream))
     {
         return(new GCodeFileStreamed(fileStream));
     }
     else
     {
         return(GCodeMemoryFile.Load(fileStream,
                                     maxAccelerationMmPerS2,
                                     maxVelocityMmPerS,
                                     velocitySameAsStopMmPerS,
                                     speedMultiplier,
                                     cancellationToken,
                                     null));
     }
 }
        public GCodeMemoryFile(string pathAndFileName,
                               Vector4 maxAccelerationMmPerS2,
                               Vector4 maxVelocityMmPerS,
                               Vector4 velocitySameAsStopMmPerS,
                               Vector4 speedMultiplier,
                               CancellationToken cancellationToken, bool gcodeHasExplicitLayerChangeInfo = false)
        {
            this.gcodeHasExplicitLayerChangeInfo = gcodeHasExplicitLayerChangeInfo;

            var loadedFile = GCodeMemoryFile.Load(pathAndFileName,
                                                  maxAccelerationMmPerS2,
                                                  maxVelocityMmPerS,
                                                  velocitySameAsStopMmPerS,
                                                  speedMultiplier,
                                                  cancellationToken, null);

            if (loadedFile != null)
            {
                this.IndexOfLayerStart = loadedFile.IndexOfLayerStart;
                this.parsingLastZ      = loadedFile.parsingLastZ;
                this.GCodeCommandQueue = loadedFile.GCodeCommandQueue;
            }
        }