Add rough debugging system for stream processors
This commit is contained in:
parent
c82fb09e3d
commit
88f7de14c1
20 changed files with 184 additions and 10 deletions
76
MatterControl.Winforms/InspectForm.Designer.cs
generated
76
MatterControl.Winforms/InspectForm.Designer.cs
generated
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue