diff --git a/MatterControl.Winforms/InspectForm.Designer.cs b/MatterControl.Winforms/InspectForm.Designer.cs index 53fbc8eb8..946bc6284 100644 --- a/MatterControl.Winforms/InspectForm.Designer.cs +++ b/MatterControl.Winforms/InspectForm.Designer.cs @@ -36,10 +36,14 @@ this.tabPage2 = new System.Windows.Forms.TabPage(); this.sceneTreeView = new System.Windows.Forms.TreeView(); this.tabPage3 = new System.Windows.Forms.TabPage(); + this.btnApply = new System.Windows.Forms.Button(); this.themeTreeView = new System.Windows.Forms.TreeView(); this.btnSaveTheme = new System.Windows.Forms.Button(); this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); - this.btnApply = new System.Windows.Forms.Button(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.pipelineTree = new System.Windows.Forms.TreeView(); + this.button1 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -48,6 +52,7 @@ this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.tabPage3.SuspendLayout(); + this.tabPage4.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -87,6 +92,7 @@ this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; @@ -158,6 +164,16 @@ this.tabPage3.Text = "Theme"; this.tabPage3.UseVisualStyleBackColor = true; // + // btnApply + // + this.btnApply.Location = new System.Drawing.Point(438, 322); + this.btnApply.Name = "btnApply"; + this.btnApply.Size = new System.Drawing.Size(75, 23); + this.btnApply.TabIndex = 3; + this.btnApply.Text = "Apply"; + this.btnApply.UseVisualStyleBackColor = true; + this.btnApply.Click += new System.EventHandler(this.btnApply_Click); + // // themeTreeView // this.themeTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -190,15 +206,51 @@ this.propertyGrid1.TabIndex = 0; this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); // - // btnApply + // tabPage4 // - this.btnApply.Location = new System.Drawing.Point(438, 322); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(75, 23); - this.btnApply.TabIndex = 3; - this.btnApply.Text = "Apply"; - this.btnApply.UseVisualStyleBackColor = true; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); + this.tabPage4.Controls.Add(this.textBox1); + this.tabPage4.Controls.Add(this.button1); + this.tabPage4.Controls.Add(this.pipelineTree); + this.tabPage4.Location = new System.Drawing.Point(4, 22); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(600, 606); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "tabPage4"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // pipelineTree + // + this.pipelineTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pipelineTree.FullRowSelect = true; + this.pipelineTree.HideSelection = false; + this.pipelineTree.Location = new System.Drawing.Point(2, 5); + this.pipelineTree.Margin = new System.Windows.Forms.Padding(2); + this.pipelineTree.Name = "pipelineTree"; + this.pipelineTree.Size = new System.Drawing.Size(592, 253); + this.pipelineTree.TabIndex = 3; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(509, 263); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 4; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point(17, 292); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(567, 272); + this.textBox1.TabIndex = 5; // // InspectForm // @@ -219,6 +271,8 @@ this.tabPage1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.tabPage3.ResumeLayout(false); + this.tabPage4.ResumeLayout(false); + this.tabPage4.PerformLayout(); this.ResumeLayout(false); } @@ -237,5 +291,9 @@ private System.Windows.Forms.Button btnSaveTheme; private System.Windows.Forms.TreeView themeTreeView; private System.Windows.Forms.Button btnApply; + private System.Windows.Forms.TabPage tabPage4; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TreeView pipelineTree; + private System.Windows.Forms.TextBox textBox1; } } diff --git a/MatterControl.Winforms/InspectForm.cs b/MatterControl.Winforms/InspectForm.cs index b2c2f1583..921764d43 100644 --- a/MatterControl.Winforms/InspectForm.cs +++ b/MatterControl.Winforms/InspectForm.cs @@ -2,11 +2,13 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using System.Text; using System.Windows.Forms; using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.DataConverters3D; using MatterHackers.MatterControl.PartPreviewWindow; +using MatterHackers.MatterControl.PrinterCommunication.Io; using MatterHackers.MeshVisualizer; using MatterHackers.VectorMath; @@ -503,5 +505,20 @@ namespace MatterHackers.MatterControl { ApplicationController.Instance.ReloadAll().ConfigureAwait(false); } + + private void button1_Click(object sender, EventArgs e) + { + var context = ApplicationController.Instance.ActivePrinters.First().Connection.TotalGCodeStream; + + var sb = new StringBuilder(); + + while (context is GCodeStreamProxy gCodeStream) + { + sb.AppendFormat("{0} {1}\r\n", gCodeStream.GetType().Name, gCodeStream.DebugInfo); + context = gCodeStream.InternalStream; + } + + textBox1.Text = sb.ToString(); + } } } diff --git a/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs b/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs index d7f08430d..ae4264595 100644 --- a/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/BabyStepsStream.cs @@ -68,6 +68,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public Vector3[] RuntimeOffsets { get => offsetStream.RuntimeOffsets; } + public override string DebugInfo + { + get + { + return $"Last Destination = {offsetStream.lastDestination}"; + } + } + public override void Dispose() { offsetStream.Dispose(); diff --git a/MatterControlLib/PrinterCommunication/Io/ExtrusionMultiplyerStream.cs b/MatterControlLib/PrinterCommunication/Io/ExtrusionMultiplyerStream.cs index dbedbb559..b52931786 100644 --- a/MatterControlLib/PrinterCommunication/Io/ExtrusionMultiplyerStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/ExtrusionMultiplyerStream.cs @@ -43,6 +43,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public static double ExtrusionRatio { get; set; } = 1; + public override string DebugInfo + { + get + { + return $"ExtrusionRatio = {ExtrusionRatio}"; + } + } + public override string ReadLine() { var lineToSend = internalStream.ReadLine(); diff --git a/MatterControlLib/PrinterCommunication/Io/FeedRateMultiplyerStream.cs b/MatterControlLib/PrinterCommunication/Io/FeedRateMultiplyerStream.cs index 7fefd22c4..4691fa259 100644 --- a/MatterControlLib/PrinterCommunication/Io/FeedRateMultiplyerStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/FeedRateMultiplyerStream.cs @@ -44,6 +44,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public static double FeedRateRatio { get; set; } = 1; + public override string DebugInfo + { + get + { + return $"FeedRateRatio = {FeedRateRatio}"; + } + } + public override void SetPrinterPosition(PrinterMove position) { this.lastDestination.CopyKnowSettings(position); diff --git a/MatterControlLib/PrinterCommunication/Io/GCodeStreamProxy.cs b/MatterControlLib/PrinterCommunication/Io/GCodeStreamProxy.cs index 7ceecc0e5..4b60d8c12 100644 --- a/MatterControlLib/PrinterCommunication/Io/GCodeStreamProxy.cs +++ b/MatterControlLib/PrinterCommunication/Io/GCodeStreamProxy.cs @@ -47,10 +47,15 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io this.internalStream = internalStream; } + public GCodeStream InternalStream => internalStream; + + public abstract string DebugInfo { get; } + public override void Dispose() { internalStream.Dispose(); } + public override string ReadLine() { if (internalStream != null) diff --git a/MatterControlLib/PrinterCommunication/Io/MaxLengthStream.cs b/MatterControlLib/PrinterCommunication/Io/MaxLengthStream.cs index e78e86fce..7dea0d954 100644 --- a/MatterControlLib/PrinterCommunication/Io/MaxLengthStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/MaxLengthStream.cs @@ -47,6 +47,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io PrinterMove lastDestination = PrinterMove.Unknown; public double MaxSegmentLength { get; set; } + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + public void Cancel() { lock (movesToSend) diff --git a/MatterControlLib/PrinterCommunication/Io/OffsetStream.cs b/MatterControlLib/PrinterCommunication/Io/OffsetStream.cs index 5f52a72e0..f896f422a 100644 --- a/MatterControlLib/PrinterCommunication/Io/OffsetStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/OffsetStream.cs @@ -38,7 +38,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public class OffsetStream : GCodeStreamProxy { private int extruderIndex = 0; - PrinterMove lastDestination = PrinterMove.Unknown; + public PrinterMove lastDestination = PrinterMove.Unknown; Vector3[] extruderOffsets = new Vector3[4]; @@ -52,6 +52,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io ReadExtruderOffsets(); } + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + private void Settings_SettingChanged(object sender, StringEventArgs stringEvent) { if (stringEvent != null) diff --git a/MatterControlLib/PrinterCommunication/Io/PauseHandlingStream.cs b/MatterControlLib/PrinterCommunication/Io/PauseHandlingStream.cs index 3c57e120f..212106573 100644 --- a/MatterControlLib/PrinterCommunication/Io/PauseHandlingStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/PauseHandlingStream.cs @@ -58,6 +58,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io PositionSensorData positionSensorData = new PositionSensorData(); + public override string DebugInfo => ""; + public PauseHandlingStream(PrinterConfig printer, GCodeStream internalStream) : base(printer, internalStream) { diff --git a/MatterControlLib/PrinterCommunication/Io/PrintLevelingStream.cs b/MatterControlLib/PrinterCommunication/Io/PrintLevelingStream.cs index 30afea334..0ea412204 100644 --- a/MatterControlLib/PrinterCommunication/Io/PrintLevelingStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/PrintLevelingStream.cs @@ -49,6 +49,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io this.activePrinting = activePrinting; } + public override string DebugInfo + { + get + { + return $"Last Destination = {LastDestination}"; + } + } + public bool AllowLeveling { get; set; } public PrinterMove LastDestination => _lastDestination; diff --git a/MatterControlLib/PrinterCommunication/Io/PrinterMove.cs b/MatterControlLib/PrinterCommunication/Io/PrinterMove.cs index 698414c58..95fbeb56d 100644 --- a/MatterControlLib/PrinterCommunication/Io/PrinterMove.cs +++ b/MatterControlLib/PrinterCommunication/Io/PrinterMove.cs @@ -116,6 +116,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io return left; } + public override string ToString() => $"{position} E{extrusion} F{feedRate}"; + public void CopyKnowSettings(PrinterMove copyFrom) { if (copyFrom.position.X != double.PositiveInfinity) diff --git a/MatterControlLib/PrinterCommunication/Io/ProcessWriteRegExStream.cs b/MatterControlLib/PrinterCommunication/Io/ProcessWriteRegExStream.cs index 43bb9c34f..53233c116 100644 --- a/MatterControlLib/PrinterCommunication/Io/ProcessWriteRegExStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/ProcessWriteRegExStream.cs @@ -48,6 +48,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io private QueuedCommandsStream queueStream; + public override string DebugInfo => ""; + public ProcessWriteRegexStream(PrinterConfig printer, GCodeStream internalStream, QueuedCommandsStream queueStream) : base(printer, internalStream) { diff --git a/MatterControlLib/PrinterCommunication/Io/QueuedCommandsStream.cs b/MatterControlLib/PrinterCommunication/Io/QueuedCommandsStream.cs index ea44e8503..ad0754d45 100644 --- a/MatterControlLib/PrinterCommunication/Io/QueuedCommandsStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/QueuedCommandsStream.cs @@ -47,6 +47,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public int Count => commandQueue.Count; + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + public void Add(string line, bool forceTopOfQueue = false) { // lock queue diff --git a/MatterControlLib/PrinterCommunication/Io/RelativeToAbsoluteStream.cs b/MatterControlLib/PrinterCommunication/Io/RelativeToAbsoluteStream.cs index 8b5a05af9..e285b1e9c 100644 --- a/MatterControlLib/PrinterCommunication/Io/RelativeToAbsoluteStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/RelativeToAbsoluteStream.cs @@ -49,6 +49,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { } + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + public override void SetPrinterPosition(PrinterMove position) { this.lastDestination.CopyKnowSettings(position); diff --git a/MatterControlLib/PrinterCommunication/Io/RequestTemperaturesStream.cs b/MatterControlLib/PrinterCommunication/Io/RequestTemperaturesStream.cs index e15e1c059..0f14a4d40 100644 --- a/MatterControlLib/PrinterCommunication/Io/RequestTemperaturesStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/RequestTemperaturesStream.cs @@ -42,6 +42,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io nextReadTimeMs = UiThread.CurrentTimerMs + 1000; } + public override string DebugInfo => ""; + public override string ReadLine() { if (!printer.Connection.WaitingForPositionRead diff --git a/MatterControlLib/PrinterCommunication/Io/SendProgressStream.cs b/MatterControlLib/PrinterCommunication/Io/SendProgressStream.cs index 9c2d4782a..a24487b4d 100644 --- a/MatterControlLib/PrinterCommunication/Io/SendProgressStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/SendProgressStream.cs @@ -42,6 +42,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { } + public override string DebugInfo => ""; + public override string ReadLine() { if (printer.Settings.GetValue(SettingsKey.progress_reporting) != "None" diff --git a/MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs b/MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs index 52669d435..d147800f2 100644 --- a/MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs @@ -50,6 +50,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io // Register to listen for position after home and update Bounds based on the axis homed and position info. } + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + private void Connection_HomingPositionChanged(object sender, System.EventArgs e) { this.CalculateBounds(); diff --git a/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs b/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs index 00e075b66..4004fb7fb 100644 --- a/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs @@ -50,6 +50,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io activeExtruderIndex = printer.Connection.ActiveExtruderIndex; } + public override string DebugInfo + { + get + { + return $"Last Destination = {lastDestination}"; + } + } + private bool CheckIfNeedToSwitchExtruders(string lineIn) { bool queuedSwitch = false; diff --git a/MatterControlLib/PrinterCommunication/Io/WaitForTempStream.cs b/MatterControlLib/PrinterCommunication/Io/WaitForTempStream.cs index c8ee05cc2..3dec4fba6 100644 --- a/MatterControlLib/PrinterCommunication/Io/WaitForTempStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/WaitForTempStream.cs @@ -64,6 +64,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io public bool HeatingBed { get { return state == State.waitingForBedTemp; } } public bool HeatingExtruder { get { return state == State.waitingForExtruderTemp; } } + public override string DebugInfo => ""; + public void Cancel() { state = State.passthrough; diff --git a/MatterControlLib/PrinterCommunication/PrinterConnection.cs b/MatterControlLib/PrinterCommunication/PrinterConnection.cs index e0af6e066..b286247c3 100644 --- a/MatterControlLib/PrinterCommunication/PrinterConnection.cs +++ b/MatterControlLib/PrinterCommunication/PrinterConnection.cs @@ -2191,6 +2191,8 @@ You will then need to logout and log back in to the computer for the changes to ReadPosition(PositionReadType.Other); } + public GCodeStream TotalGCodeStream => totalGCodeStream; + private void SyncProgressToDB(CancellationToken cancellationToken) { //var timer = Stopwatch.StartNew();