public ResumePrintingStream(GCodeFileStream internalStream, double percentDone)
        {
            this.internalStream = internalStream;
            this.percentDone    = percentDone;

            queuedCommands = new QueuedCommandsStream(null);
        }
		public ResumePrintingStream(GCodeFileStream internalStream, double percentDone)
		{
			this.internalStream = internalStream;
			this.percentDone = percentDone;

			queuedCommands = new QueuedCommandsStream(null);
		}
Beispiel #3
0
 public ToolChangeStream(PrinterConfig printer, GCodeStream internalStream, QueuedCommandsStream queuedCommandsStream)
     : base(printer, internalStream)
 {
     this.queuedCommandsStream = queuedCommandsStream;
     extruderCount             = printer.Settings.GetValue <int>(SettingsKey.extruder_count);
     activeTool = printer.Connection.ActiveExtruderIndex;
 }
        public ToolChangeStream(PrinterConfig printer, GCodeStream internalStream, QueuedCommandsStream queuedCommandsStream, IGCodeLineReader gcodeLineReader)
            : base(printer, internalStream)
        {
            this.gcodeLineReader = gcodeLineReader;
            if (gcodeLineReader != null)
            {
                this.gCodeMemoryFile = gcodeLineReader.GCodeFile as GCodeMemoryFile;
            }

            this.queuedCommandsStream = queuedCommandsStream;
            extruderCount             = printer.Settings.GetValue <int>(SettingsKey.extruder_count);
            activeTool = printer.Connection.ActiveExtruderIndex;
        }
        public RunSceneGCodeProcesorsStream(PrinterConfig printer, GCodeStream internalStream, QueuedCommandsStream queueStream)
            : base(printer, internalStream)
        {
            this.queueStream = queueStream;

            // get all the gcode processors that are in the scene
            gcodeTransformers = printer.Bed.Scene.Descendants().Where(i => i is IGCodeTransformer).Select(i => (IGCodeTransformer)i).ToList();

            foreach (var gcodeTransformer in gcodeTransformers)
            {
                gcodeTransformer.Reset();
            }
        }
        public PrintRecoveryStream(GCodeFileStream internalStream, double percentDone)
        {
            this.internalStream = internalStream;
            this.percentDone    = percentDone;

            recoverFeedRate = ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.recover_first_layer_speed);
            if (recoverFeedRate == 0)
            {
                recoverFeedRate = 10;
            }
            recoverFeedRate *= 60;

            queuedCommands = new QueuedCommandsStream(null);
        }
		public PrintRecoveryStream(GCodeFileStream internalStream, double percentDone)
		{
			this.internalStream = internalStream;
			this.percentDone = percentDone;

			recoverFeedRate = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.recover_first_layer_speed);
			if (recoverFeedRate == 0)
			{
				recoverFeedRate = 10;
			}
			recoverFeedRate *= 60;

			queuedCommands = new QueuedCommandsStream(null);
		}
Beispiel #8
0
        public ResumePrintingStream(GCodeFileStream internalStream, double percentDone)
        {
            this.internalStream = internalStream;
            this.percentDone    = percentDone;

            resumeFeedRate = ActiveSliceSettings.Instance.GetValue <double>("resume_first_layer_speed");
            if (resumeFeedRate == 0)
            {
                resumeFeedRate = 10;
            }
            resumeFeedRate *= 60;

            queuedCommands = new QueuedCommandsStream(null);
        }
        public PrintRecoveryStream(GCodeSwitcher internalStream, PrinterConfig printer, double percentDone)
            : base(printer)
        {
            this.internalStream = internalStream;
            this.percentDone    = percentDone;

            recoverFeedRate = printer.Settings.GetValue <double>(SettingsKey.recover_first_layer_speed);
            if (recoverFeedRate == 0)
            {
                recoverFeedRate = 10;
            }
            recoverFeedRate *= 60;

            queuedCommands = new QueuedCommandsStream(printer, null);
        }
		private void loadGCodeWorker_DoWork(object sender, DoWorkEventArgs e)
		{
			totalGCodeStream?.Dispose();

			string gcodeFilename = e.Argument as string;
			loadedGCode = GCodeFile.Load(gcodeFilename);

			gCodeFileStream0 = new GCodeFileStream(loadedGCode);
			pauseHandlingStream1 = new PauseHandlingStream(gCodeFileStream0);
			queuedCommandStream2 = new QueuedCommandsStream(pauseHandlingStream1);
			relativeToAbsoluteStream3 = new RelativeToAbsoluteStream(queuedCommandStream2);
			printLevelingStream4 = new PrintLevelingStream(relativeToAbsoluteStream3);
			waitForTempStream5 = new WaitForTempStream(printLevelingStream4);
			babyStepsStream6 = new BabyStepsStream(waitForTempStream5);
			extrusionMultiplyerStream7 = new ExtrusionMultiplyerStream(babyStepsStream6);
			feedrateMultiplyerStream8 = new FeedRateMultiplyerStream(extrusionMultiplyerStream7);
			requestTemperaturesStream9 = new RequestTemperaturesStream(feedrateMultiplyerStream8);
			totalGCodeStream = requestTemperaturesStream9;
		}
		void CreateStreamProcessors(string gcodeFilename, bool recoveryEnabled)
		{
			totalGCodeStream?.Dispose();

			GCodeStream firstStream = null;
			if (gcodeFilename != null)
			{
				loadedGCode = GCodeFile.Load(gcodeFilename);
				gCodeFileStream0 = new GCodeFileStream(loadedGCode);

				if (ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.recover_is_enabled)
					&& activePrintTask != null) // We are resuming a failed print (do lots of interesting stuff).
				{
					pauseHandlingStream1 = new PauseHandlingStream(new PrintRecoveryStream(gCodeFileStream0, activePrintTask.PercentDone));
				}
				else
				{
					pauseHandlingStream1 = new PauseHandlingStream(gCodeFileStream0);
				}

				firstStream = pauseHandlingStream1;
			}
			else
			{
				firstStream = new NotPrintingStream();
			}

			queuedCommandStream2 = new QueuedCommandsStream(firstStream);
			relativeToAbsoluteStream3 = new RelativeToAbsoluteStream(queuedCommandStream2);
			printLevelingStream4 = new PrintLevelingStream(relativeToAbsoluteStream3, true);
			waitForTempStream5 = new WaitForTempStream(printLevelingStream4);
			babyStepsStream6 = new BabyStepsStream(waitForTempStream5);
			if (activePrintTask != null)
			{
				// make sure we are in the position we were when we stopped printing
				babyStepsStream6.Offset = new Vector3(activePrintTask.PrintingOffsetX, activePrintTask.PrintingOffsetY, activePrintTask.PrintingOffsetZ);
			}
			extrusionMultiplyerStream7 = new ExtrusionMultiplyerStream(babyStepsStream6);
			feedrateMultiplyerStream8 = new FeedRateMultiplyerStream(extrusionMultiplyerStream7);
			requestTemperaturesStream9 = new RequestTemperaturesStream(feedrateMultiplyerStream8);
			totalGCodeStream = requestTemperaturesStream9;
		}
 public MacroProcessingStream(QueuedCommandsStream queuedCommandsStream, PrinterConfig printer)
     : base(queuedCommandsStream)
 {
     this.queuedCommandsStream = queuedCommandsStream;
     this.printer = printer;
 }
		private void LoadGCodeToPrint(string gcodeFilename)
		{
			totalGCodeStream?.Dispose();

			loadedGCode = GCodeFile.Load(gcodeFilename);

			gCodeFileStream0 = new GCodeFileStream(loadedGCode);
			if(activePrintTask != null) // We are resuming a failed print (do lots of interesting stuff).
			{
				pauseHandlingStream1 = new PauseHandlingStream(new ResumePrintingStream(gCodeFileStream0, activePrintTask.PercentDone));
			}
			else
			{
				pauseHandlingStream1 = new PauseHandlingStream(gCodeFileStream0);
			}
			queuedCommandStream2 = new QueuedCommandsStream(pauseHandlingStream1);
			relativeToAbsoluteStream3 = new RelativeToAbsoluteStream(queuedCommandStream2);
			printLevelingStream4 = new PrintLevelingStream(relativeToAbsoluteStream3);
			waitForTempStream5 = new WaitForTempStream(printLevelingStream4);
			babyStepsStream6 = new BabyStepsStream(waitForTempStream5);
			if(activePrintTask != null)
			{
				// make sure we are in the position we were when we stopped printing
				babyStepsStream6.Offset = new Vector3(activePrintTask.PrintingOffsetX, activePrintTask.PrintingOffsetY, activePrintTask.PrintingOffsetZ);
			}
			extrusionMultiplyerStream7 = new ExtrusionMultiplyerStream(babyStepsStream6);
			feedrateMultiplyerStream8 = new FeedRateMultiplyerStream(extrusionMultiplyerStream7);
			requestTemperaturesStream9 = new RequestTemperaturesStream(feedrateMultiplyerStream8);
			totalGCodeStream = requestTemperaturesStream9;
		}
Beispiel #14
0
 public ProcessWriteRegexStream(PrinterConfig printer, GCodeStream internalStream, QueuedCommandsStream queueStream)
     : base(printer, internalStream)
 {
     this.queueStream = queueStream;
 }