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;
		}
コード例 #2
0
		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;
		}
コード例 #3
0
		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;
		}