Skip to content

Commit

Permalink
Update GrblPanel3D.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
arkypita committed Jun 9, 2024
1 parent 590c2f7 commit bc30284
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions LaserGRBL/UserControls/GrblPanel3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public partial class GrblPanel3D : UserControl, IGrblPanel

private static Exception FatalException;

// 0 = never run, 1 = init begin, 2 = init complete, 3 = draw begin, 4 = draw end, > 4 = running (can be tested with a timer to check if it stop incrementing)
// 0 = never run, 1 = init begin, 2 = create complete, 3 = init complete, 4 = draw begin, 5 = draw end, > 5 = running (can be tested with a timer to check if it stop incrementing)
private static ulong OpCounter;

public static string CurrentRendererType = "";
Expand All @@ -101,7 +101,7 @@ public static string GlDiagnosticMessage
return FatalException.Message;
else if (FirstGlError != null)
return FirstGlError;
else if (OpCounter < 4)
else if (OpCounter < 5)
return $"OpCounter {OpCounter}";

return null;
Expand Down Expand Up @@ -188,6 +188,8 @@ protected void InitializeOpenGL()
}
}

OpCounter++;

try { CurrentVendor = OpenGL.Vendor; } catch { CurrentVendor = "Unknown"; }
try { CurrentRenderer = OpenGL.Renderer; } catch { CurrentRenderer = "Unknown"; }
try { CurrentGLVersion = OpenGL.Version; } catch { CurrentGLVersion = "0.0"; }
Expand Down Expand Up @@ -534,12 +536,16 @@ protected override void OnPaint(PaintEventArgs e)
DrawException(e, FatalException.ToString());
else if (OnPaintException != null)
DrawException(e, OnPaintException.ToString());
else if (OpCounter == 0)
DrawException(e, "Initializing OpenGL");
else if (OpCounter == 0) // 0 = never run, 1 = init begin, 2 = create complete, 3 = init complete, 4 = draw begin, 5 = draw end, > 5 = running (can be tested with a timer to check if it stop incrementing)
DrawException(e, "0.Thread Starting");
else if (OpCounter == 1)
DrawException(e, "Waiting for draw begin");
else if (OpCounter == 0)
DrawException(e, "Drawing");
DrawException(e, "1.Initializing OpenGL");
else if (OpCounter == 2)
DrawException(e, "2.Creation Complete");
else if (OpCounter == 3)
DrawException(e, "3.Init Complete");
else if (OpCounter == 4)
DrawException(e, "4.Draw Begin");
else if (mBmp == null)
DrawException(e, "nothing to draw");
}
Expand Down

0 comments on commit bc30284

Please sign in to comment.