diff options
Diffstat (limited to 'Samples/DebugLogAnalyzer/src')
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DbgEventWidget.cs | 38 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DbgLogViewer.cs | 2 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DebugInterface.cs | 21 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/Program.cs | 16 |
4 files changed, 45 insertions, 32 deletions
diff --git a/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs b/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs index 6af3f6df..b369d248 100644 --- a/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs +++ b/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs @@ -30,12 +30,15 @@ namespace Crow long ticksPerPixel; double pixelPerTick; + object dataMutex = new object(); + public DbgEvent Event { get => evt; set { if (evt == value) return; - evt = value; + lock (dataMutex) + evt = value; updatePixelPerTicks (); NotifyValueChangedAuto (evt); RegisterForRedraw (); @@ -46,6 +49,8 @@ namespace Crow private set { if (hoverEvt == value) return; + lock (dataMutex) + evt = value; hoverEvt = value; NotifyValueChangedAuto (hoverEvt); } @@ -83,24 +88,27 @@ namespace Crow protected override void onDraw (Context gr) { - if (Event == null) { - base.onDraw (gr); - return; - } + lock (dataMutex) { + + if (Event == null) { + base.onDraw (gr); + return; + } - gr.LineWidth = 1; - gr.SetDash (new double [] { 1.0, 3.0 }, 0); + gr.LineWidth = 1; + gr.SetDash (new double [] { 1.0, 3.0 }, 0); - Rectangle cb = ClientRectangle; + Rectangle cb = ClientRectangle; - if (Event.Duration == 0) { - gr.SetSource (Event.Color); - gr.Rectangle (cb); - gr.Fill (); - return; - } + if (Event.Duration == 0) { + gr.SetSource (Event.Color); + gr.Rectangle (cb); + gr.Fill (); + return; + } - drawEvent (gr, cb.Height, Event); + drawEvent (gr, cb.Height, Event); + } } void drawEvent (Context ctx, int h, DbgEvent dbge) { diff --git a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs index d39cc62a..251090ef 100644 --- a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs +++ b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs @@ -481,7 +481,7 @@ namespace Crow if (lastTick >= 0 && hoverTick >= 0) ScrollX += lastTick - hoverTick; if (lastLine >= 0 && hoverLine >= 0) - ScrollY += lastLine - hoverLine; + ScrollY += lastLine - hoverLine; updateMouseLocalPos (e.Position); } else { HoverWidget = (hoverLine < 0 || hoverLine >= widgets.Count) ? null : widgets [hoverLine]; diff --git a/Samples/DebugLogAnalyzer/src/DebugInterface.cs b/Samples/DebugLogAnalyzer/src/DebugInterface.cs index 1653f163..64de2163 100644 --- a/Samples/DebugLogAnalyzer/src/DebugInterface.cs +++ b/Samples/DebugLogAnalyzer/src/DebugInterface.cs @@ -43,13 +43,28 @@ namespace Crow } catch (System.Exception ex) { - while (Monitor.IsEntered(LayoutMutex)) + while (Monitor.IsEntered(LayoutMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit LayoutMutex on error"); + Monitor.Exit (LayoutMutex); + } + while (Monitor.IsEntered(UpdateMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit UpdateMutex on error"); + Monitor.Exit (UpdateMutex); + } + while (Monitor.IsEntered(ClippingMutex)) { + Console.WriteLine ($"[DebugIFace] trying to exit ClippingMutex on error"); + Monitor.Exit (ClippingMutex); + } + + + /*while (Monitor.IsEntered(LayoutMutex)) Monitor.Exit (LayoutMutex); while (Monitor.IsEntered(UpdateMutex)) Monitor.Exit (UpdateMutex); while (Monitor.IsEntered(ClippingMutex)) - Monitor.Exit (ClippingMutex); - delSetCurrentException (ex); + Monitor.Exit (ClippingMutex);*/ + delSetCurrentException (ex); + Console.WriteLine ($"[DbgIFace] {ex}"); ClearInterface(); Thread.Sleep(1000); } diff --git a/Samples/DebugLogAnalyzer/src/Program.cs b/Samples/DebugLogAnalyzer/src/Program.cs index 8cee874a..13e0234d 100644 --- a/Samples/DebugLogAnalyzer/src/Program.cs +++ b/Samples/DebugLogAnalyzer/src/Program.cs @@ -21,8 +21,7 @@ namespace DebugLogAnalyzer static void Main (string [] args) { - DbgLogger.IncludeEvents = DbgEvtType.None; - DbgLogger.DiscardEvents = DbgEvtType.All; + initDebugLog (); using (Program app = new Program ()) { CurrentProgramInstance = app; @@ -195,15 +194,6 @@ namespace DebugLogAnalyzer } public List<DbgWidgetEvent> CurWidgetRootEvents => curWidget == null? new List<DbgWidgetEvent>() : curWidget.RootEvents; - public bool DebugLogToFile { - get => Configuration.Global.Get<bool> (nameof(DebugLogToFile)); - set { - if (DbgLogger.ConsoleOutput != value) - return; - Configuration.Global.Set (nameof(DebugLogToFile), value); - NotifyValueChanged(DebugLogToFile); - } - } /*public string DebugLogFilePath { get => Configuration.Global.Get<string> (nameof (DebugLogFilePath)); set { @@ -216,8 +206,8 @@ namespace DebugLogAnalyzer public bool DebugLogOnStartup { get => Configuration.Global.Get<bool> (nameof(DebugLogOnStartup)); set { - if (DbgLogger.ConsoleOutput != value) - return; + if (DebugLogOnStartup == value) + return; Configuration.Global.Set (nameof(DebugLogOnStartup), value); NotifyValueChanged(DebugLogOnStartup); } |