aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/DebugLogAnalyzer/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-04-15 06:28:27 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-04-15 06:28:27 +0200
commit412e93ade521562145cf602cd340c4485fa15e37 (patch)
tree3f62500e2698bce844937ec36349dc2dc917dd50 /Samples/DebugLogAnalyzer/src
parenta08929b22ac6b6371585beec221c3efebc3b8a71 (diff)
wip
Diffstat (limited to 'Samples/DebugLogAnalyzer/src')
-rw-r--r--Samples/DebugLogAnalyzer/src/DbgEventWidget.cs12
-rw-r--r--Samples/DebugLogAnalyzer/src/DbgLogViewer.cs57
-rw-r--r--Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs131
-rw-r--r--Samples/DebugLogAnalyzer/src/Program.cs137
4 files changed, 285 insertions, 52 deletions
diff --git a/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs b/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs
index 19666ee2..6af3f6df 100644
--- a/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs
+++ b/Samples/DebugLogAnalyzer/src/DbgEventWidget.cs
@@ -10,6 +10,18 @@ using DebugLogAnalyzer;
namespace Crow
{
+ public class DbgEventView : TemplatedContainer {
+ DbgEvent evt;
+ public DbgEvent Event {
+ get => evt;
+ set {
+ if (evt == value)
+ return;
+ evt = value;
+ NotifyValueChangedAuto (evt);
+ }
+ }
+ }
public class DbgEventWidget : Widget
{
public DbgEventWidget (){}
diff --git a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
index 1273c9e6..d39cc62a 100644
--- a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
+++ b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
@@ -300,7 +300,7 @@ namespace Crow
double penX = 5.0 * g.xLevel + cb.Left;
- if (g.yIndex == 0)
+ if (g.xLevel == 0)
gr.SetSource (Crow.Colors.LightSalmon);
else if (currentLine == g.listIndex)
gr.SetSource(Colors.RoyalBlue);
@@ -434,11 +434,17 @@ namespace Crow
ctxR.Width = Math.Max (1, ctxR.Width);
ctx.Rectangle (ctxR);
- //ctx.SetSourceColor (Color.LightYellow);
- ctx.SetSource (Colors.Jet);
+ ctx.SetSource (0.0,0.2,0.8,0.15);
+ //ctx.SetSource (Colors.Jet);
ctx.Fill();
ctx.Operator = Cairo.Operator.Over;
+ str = $"{ticksToMS(Math.Abs (selEnd - selStart))} (ms)";
+
+ ctx.MoveTo (ctxR.Center.X - ctx.TextExtents (str).Width / 2, ctxR.Y + fe.Height);
+ ctx.SetSource (Colors.Black);
+ ctx.ShowText (str);
+
}
public override void OnLayoutChanges (LayoutingType layoutType)
{
@@ -469,7 +475,7 @@ namespace Crow
int lastLine = hoverLine;
updateMouseLocalPos (e.Position);
- if (IFace.IsDown (Glfw.MouseButton.Left) && selStart >= 0)
+ if ((IFace.IsDown (Glfw.MouseButton.Left) || IFace.IsDown (Glfw.MouseButton.Middle)) && selStart >= 0)
selEnd = hoverTick;
else if (IFace.IsDown(Glfw.MouseButton.Right)) {
if (lastTick >= 0 && hoverTick >= 0)
@@ -479,28 +485,30 @@ namespace Crow
updateMouseLocalPos (e.Position);
} else {
HoverWidget = (hoverLine < 0 || hoverLine >= widgets.Count) ? null : widgets [hoverLine];
- HoverEvent = hoverWidget?.Events.FirstOrDefault (ev => ev.begin <= hoverTick && ev.end >= hoverTick);
- Task.Run (() => findHoverEvent (hoverWidget, hoverTick));
+ //HoverEvent = hoverWidget?.Events.FirstOrDefault (ev => ev.begin <= hoverTick && ev.end >= hoverTick);
+ double tickPerPixel = (double)visibleTicks / ClientRectangle.Width;
+ //Console.WriteLine ($"ticks per pixel: {tickPerPixel}");
+ Task.Run (() => findHoverEvent (hoverWidget, hoverTick, (int)tickPerPixel));
}
RegisterForRepaint();
e.Handled = true;
base.onMouseMove (sender, e);
- }
- void findHoverEvent (DbgWidgetRecord widget, long tick) {
- DbgEvent tmp = widget?.Events.FirstOrDefault (ev => ev.begin <= tick && ev.end >= tick);
+ }
+ void findHoverEvent (DbgWidgetRecord widget, long tick, long precision = 0) {
+ DbgEvent tmp = widget?.Events.FirstOrDefault (ev => ev.begin - precision <= tick && ev.end + precision >= tick);
if (tmp == null) {
- tmp = Events.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin <= tick && ev.end >= tick).FirstOrDefault();
+ tmp = Events.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();
while(tmp != null) {
- DbgEvent che = tmp.Events?.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin <= tick && ev.end >= tick).FirstOrDefault();
+ DbgEvent che = tmp.Events?.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();
if (che == null)
break;
tmp = che;
}
} else {
while(tmp != null) {
- DbgEvent che = tmp.Events?.OfType<DbgWidgetEvent>()?.Where(ev=>ev.InstanceIndex == widget.listIndex && ev.begin <= tick && ev.end >= tick).FirstOrDefault();
+ DbgEvent che = tmp.Events?.OfType<DbgWidgetEvent>()?.Where(ev=>ev.InstanceIndex == widget.listIndex && ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();
if (che == null)
break;
tmp = che;
@@ -510,21 +518,23 @@ namespace Crow
}
public override void onMouseClick(object sender, MouseButtonEventArgs e)
{
- if (e.Button == Glfw.MouseButton.Left && selEnd < 0) {
- currentTick = hoverTick;
- currentLine = hoverLine;
- CurrentWidget = hoverWidget;
- CurrentEvent = hoverEvent;
+ if (e.Button == Glfw.MouseButton.Left) {
+ if (selEnd < 0) {
+ currentTick = hoverTick;
+ currentLine = hoverLine;
+ CurrentWidget = hoverWidget;
+ CurrentEvent = hoverEvent;
+ }
+ selStart = -1;
+ selEnd = -1;
}
- selStart = -1;
- selEnd = -1;
e.Handled = true;
base.onMouseClick(sender, e);
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
- if (e.Button == Glfw.MouseButton.Left) {
+ if (e.Button == Glfw.MouseButton.Left || e.Button == Glfw.MouseButton.Middle) {
selStart = hoverTick;
selEnd = -1;
}
@@ -561,7 +571,9 @@ namespace Crow
if (IFace.Shift)
ScrollX -= (int)((double)(e.Delta * MouseWheelSpeed) / xScale);
- else if (IFace.Ctrl) {
+ else if (IFace.Ctrl)
+ ScrollY -= e.Delta * MouseWheelSpeed;
+ else {
if (e.Delta > 0) {
XScale *= 2.0;
} else {
@@ -569,8 +581,7 @@ namespace Crow
XScale *= 0.5;
}
ScrollX = (long)(hoverTick - (long)((double)Math.Max(0, mousePos.X - (long)leftMargin) / xScale) - minTicks);
- }else
- ScrollY -= e.Delta * MouseWheelSpeed;
+ }
}
public override void onKeyDown (object sender, KeyEventArgs e)
diff --git a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
index 5432b05e..c6920ca5 100644
--- a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
+++ b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
@@ -12,6 +12,7 @@ using System.Diagnostics;
using CrowDbgShared;
using System.Collections.Generic;
using Crow.DebugLogger;
+using System.Linq;
namespace Crow
{
@@ -27,7 +28,10 @@ namespace Crow
Type dbgIfaceType;
Action<int, int> delResize;
Func<int, int, bool> delMouseMove;
+ Func<float, bool> delMouseWheelChanged;
Func<MouseButton, bool> delMouseDown, delMouseUp;
+ Func<char, bool> delKeyPress;
+ Func<Key, bool> delKeyDown, delKeyUp;
Action delResetDirtyState;
Action delResetDebugger;
Action<object, string> delSaveDebugLog;
@@ -178,12 +182,24 @@ namespace Crow
delMouseMove = (Func<int, int, bool>)Delegate.CreateDelegate(typeof(Func<int, int, bool>),
dbgIFace, dbgIfaceType.GetMethod("OnMouseMove"));
+ delMouseWheelChanged = (Func<float, bool>)Delegate.CreateDelegate(typeof(Func<float, bool>),
+ dbgIFace, dbgIfaceType.GetMethod("OnMouseWheelChanged"));
+
+
delMouseDown = (Func<MouseButton, bool>)Delegate.CreateDelegate(typeof(Func<MouseButton, bool>),
dbgIFace, dbgIfaceType.GetMethod("OnMouseButtonDown"));
delMouseUp = (Func<MouseButton, bool>)Delegate.CreateDelegate(typeof(Func<MouseButton, bool>),
dbgIFace, dbgIfaceType.GetMethod("OnMouseButtonUp"));
+ delKeyDown = (Func<Key, bool>)Delegate.CreateDelegate(typeof(Func<Key, bool>),
+ dbgIFace, dbgIfaceType.GetMethod("OnKeyDown"));
+ delKeyUp = (Func<Key, bool>)Delegate.CreateDelegate(typeof(Func<Key, bool>),
+ dbgIFace, dbgIfaceType.GetMethod("OnKeyUp"));
+ delKeyPress = (Func<char, bool>)Delegate.CreateDelegate(typeof(Func<char, bool>),
+ dbgIFace, dbgIfaceType.GetMethod("OnKeyPress"));
+
+
delGetSurfacePointer = (IntPtrGetterDelegate)Delegate.CreateDelegate(typeof(IntPtrGetterDelegate),
dbgIFace, dbgIfaceType.GetProperty("SurfacePointer").GetGetMethod());
delSetSource = (Action<string>)Delegate.CreateDelegate(typeof(Action<string>),
@@ -218,19 +234,60 @@ namespace Crow
}
public override bool CacheEnabled { get => true; set => base.CacheEnabled = true; }
+ public override void onKeyDown(object sender, KeyEventArgs e)
+ {
+ if (initialized) {
+ try
+ {
+ e.Handled = delKeyDown (e.Key);
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine($"[Error][DebugIFace key down]{ex}");
+ }
+ }
+ base.onKeyDown(sender, e);
+ }
+ public override void onKeyUp(object sender, KeyEventArgs e)
+ {
+ if (initialized) {
+ try
+ {
+ e.Handled = delKeyUp (e.Key);
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine($"[Error][DebugIFace key up]{ex}");
+ }
+ }
+ base.onKeyUp(sender, e);
+ }
+ public override void onKeyPress(object sender, KeyPressEventArgs e)
+ {
+ if (initialized) {
+ try
+ {
+ e.Handled = delKeyPress (e.KeyChar);
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine($"[Error][DebugIFace key press]{ex}");
+ }
+ }
+ base.onKeyPress(sender, e);
+ }
public override void onMouseMove(object sender, MouseMoveEventArgs e)
{
if (initialized) {
try
{
Point m = ScreenPointToLocal (e.Position);
- delMouseMove (m.X, m.Y);
+ e.Handled = delMouseMove (m.X, m.Y);
}
catch (System.Exception ex)
{
Console.WriteLine($"[Error][DebugIFace mouse move]{ex}");
- }
- e.Handled = true;
+ }
}
base.onMouseMove(sender, e);
}
@@ -239,13 +296,12 @@ namespace Crow
if (initialized) {
try
{
- delMouseDown (e.Button);
+ e.Handled = delMouseDown (e.Button);
}
catch (System.Exception ex)
{
Console.WriteLine($"[Error][DebugIFace mouse down]{ex}");
- }
- e.Handled=true;
+ }
}
base.onMouseDown (sender, e);
}
@@ -254,16 +310,29 @@ namespace Crow
if (initialized) {
try
{
- delMouseUp (e.Button);
+ e.Handled = delMouseUp (e.Button);
}
catch (System.Exception ex)
{
Console.WriteLine($"[Error][DebugIFace mouse up]{ex}");
- }
- e.Handled=true;
+ }
}
base.onMouseUp (sender, e);
}
+ public override void onMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ if (initialized) {
+ try
+ {
+ e.Handled = delMouseWheelChanged (e.Delta);
+ }
+ catch (System.Exception ex)
+ {
+ Console.WriteLine($"[Error][DebugIFace mouse wheel change]{ex}");
+ }
+ }
+ base.onMouseWheel(sender, e);
+ }
protected override void RecreateCache()
{
@@ -286,22 +355,52 @@ namespace Crow
}
+ int firstWidgetIndexToGet = 0;
void getLog () {
+ DebugLogAnalyzer.Program dla = IFace as DebugLogAnalyzer.Program;
+
using (Stream stream = new MemoryStream (1024)) {
Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
- debuggerType.GetMethod("Save", new Type[] {dbgIfaceType, typeof(Stream)}).Invoke(null, new object[] {dbgIFace, stream});
+ MethodInfo miSave = debuggerType.GetMethod("Save",
+ new Type[] {
+ dbgIfaceType,
+ typeof(Stream),
+ typeof(int),
+ typeof(bool)
+ });
+
+
+ widgets = new List<DbgWidgetRecord>();
+ events = new List<DbgEvent>();
+ miSave.Invoke(null, new object[] {dbgIFace, stream, firstWidgetIndexToGet, true});
//debuggerType.GetMethod("Save", new Type[] {dbgIfaceType, typeof(string)}).Invoke(null, new object[] {dbgIFace, "debug.log"});
//delSaveDebugLog(dbgIFace, "debug.log");
stream.Seek(0, SeekOrigin.Begin);
- events = new List<DbgEvent>();
- widgets = new List<DbgWidgetRecord>();
DbgLogger.Load (stream, events, widgets);
- //DbgLogger.Load ("debug.log", events, widgets);
- DebugLogAnalyzer.Program dla = IFace as DebugLogAnalyzer.Program;
- dla.Widgets = widgets;
- dla.Events = events;
+
+ lock (dla.UpdateMutex) {
+ for (int i = 0; i < widgets.Count; i++) {
+ widgets[i].listIndex = dla.Widgets.Count;
+ dla.Widgets.Add (widgets[i]);
+ }
+ for (int i = 0; i < events.Count; i++) {
+ dla.Events.Add (events[i]);
+ updateWidgetEvents (dla.Widgets, events[i]);
+ }
+ }
+ firstWidgetIndexToGet += widgets.Count;
+ if (widgets.Count > 0 && firstWidgetIndexToGet != widgets.Last().InstanceIndex + 1)
+ Debugger.Break ();
}
}
+ void updateWidgetEvents (List<DbgWidgetRecord> widgets, DbgEvent evt) {
+ if (evt is DbgWidgetEvent we)
+ widgets.FirstOrDefault (w => w.InstanceIndex == we.InstanceIndex)?.Events.Add (we);
+ if (evt.Events == null)
+ return;
+ foreach (DbgEvent e in evt.Events)
+ updateWidgetEvents (widgets, e);
+ }
public virtual object GetScreenCoordinates () => ScreenCoordinates(Slot).TopLeft;
}
diff --git a/Samples/DebugLogAnalyzer/src/Program.cs b/Samples/DebugLogAnalyzer/src/Program.cs
index 7da9f5a1..a2711dda 100644
--- a/Samples/DebugLogAnalyzer/src/Program.cs
+++ b/Samples/DebugLogAnalyzer/src/Program.cs
@@ -11,6 +11,7 @@ using Crow.Text;
using System.Collections.Generic;
using Encoding = System.Text.Encoding;
using Crow.DebugLogger;
+using System.Linq;
namespace DebugLogAnalyzer
{
@@ -41,7 +42,8 @@ namespace DebugLogAnalyzer
/*TreeView tv = FindByName("dbgTV") as TreeView;
dbgTreeViewScroller = tv.FindByNameInTemplate ("scroller1") as Scroller;*/
-
+ if (DebugLogOnStartup)
+ DebugLogRecording = true;
if (!File.Exists (CurrentFile))
newFile ();
@@ -50,20 +52,52 @@ namespace DebugLogAnalyzer
reloadFromFile ();
}
+
+ public override void UpdateFrame()
+ {
+ base.UpdateFrame();
+
+ }
+
- List<DbgEvent> events = new List<DbgEvent>();
- List<DbgWidgetRecord> widgets = new List<DbgWidgetRecord>();
- DbgEvent curEvent = new DbgEvent();
+ ObservableList<DbgEvent> events = new ObservableList<DbgEvent>();
+ ObservableList<DbgWidgetRecord> widgets = new ObservableList<DbgWidgetRecord>();
+ DbgEvent curEvent;
+ bool disableCurrentEventHistory;
+ Stack<DbgEvent> CurrentEventHistoryForward = new Stack<DbgEvent>();
+ Stack<DbgEvent> CurrentEventHistoryBackward = new Stack<DbgEvent>();
DbgWidgetRecord curWidget = new DbgWidgetRecord();
bool debugLogRecording;
- Scroller dbgTreeViewScroller;
int targetTvScroll = -1;
+ public string[] AllEventTypes => Enum.GetNames (typeof(DbgEvtType));
+ string searchEventType;
+ DbgWidgetRecord searchWidget;
+ public string SearchEventType {
+ get => searchEventType;
+ set {
+ if (searchEventType == value)
+ return;
+ searchEventType = value;
+ NotifyValueChanged (searchEventType);
+ }
+ }
+
+ public DbgWidgetRecord SearchWidget {
+ get => searchWidget;
+ set {
+ if (searchWidget == value)
+ return;
+ searchWidget = value;
+ NotifyValueChanged (searchWidget);
+ }
+ }
public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit, CMDShowLeftPane,
- CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions;
+ CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions,
+ CMDGotoParentEvent, CMDEventHistoryForward, CMDEventHistoryBackward;
public CommandGroup EventCommands, DirectoryCommands;
public CommandGroup EditorCommands => new CommandGroup (CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDSave, CMDSaveAs);
void initCommands ()
@@ -78,8 +112,12 @@ namespace DebugLogAnalyzer
CMDCopy = new Command ("Copy", new Action (() => copy ()), "#Icons.copy-file.svg", false);
CMDPaste= new Command ("Paste", new Action (() => paste ()), "#Icons.paste-on-document.svg", false);
+ CMDGotoParentEvent = new Command("parent", ()=> { CurrentEvent = CurrentEvent?.parentEvent; }, null, false);
+ CMDEventHistoryBackward = new Command("back.", currentEventHistoryGoBack, null, false);
+ CMDEventHistoryForward = new Command("forw.", currentEventHistoryGoForward, null, false);
+
EventCommands = new CommandGroup(
- new Command("Goto parent event", ()=> { CurrentEvent = CurrentEvent?.parentEvent; })
+ CMDGotoParentEvent, CMDEventHistoryBackward, CMDEventHistoryForward
);
DirectoryCommands = new CommandGroup(
new Command("Set as root directory", ()=> { CurrentEvent = CurrentEvent?.parentEvent; })
@@ -100,7 +138,7 @@ namespace DebugLogAnalyzer
NotifyValueChanged(CrowDbgAssemblyLocation);
}
}
- public List<DbgEvent> Events {
+ public ObservableList<DbgEvent> Events {
get => events;
set {
if (events == value)
@@ -109,7 +147,7 @@ namespace DebugLogAnalyzer
NotifyValueChanged (nameof (Events), events);
}
}
- public List<DbgWidgetRecord> Widgets {
+ public ObservableList<DbgWidgetRecord> Widgets {
get => widgets;
set {
if (widgets == value)
@@ -118,18 +156,83 @@ namespace DebugLogAnalyzer
NotifyValueChanged (nameof (Widgets), widgets);
}
}
+ /*IEnumerable<DbgWidgetEvent> widgetEvents (DbgWidgetRecord wr, DbgEvent evt) {
+ if (evt is DbgWidgetEvent we && we.InstanceIndex == wr.InstanceIndex)
+ yield return we;
+ if (evt.Events != null) {
+ foreach (DbgEvent e in evt.Events)
+ foreach (DbgWidgetEvent ye in widgetEvents (wr, e))
+ yield return ye;
+ }
+ }
+ IEnumerable<DbgWidgetEvent> currentWidgetEvents;
+
+ public IEnumerable<DbgWidgetEvent> CurrentWidgetEvents {
+ get => currentWidgetEvents;
+ set {
+ currentWidgetEvents = value;
+ NotifyValueChanged (currentWidgetEvents);
+ curWidget.Events = new List<DbgEvent> (currentWidgetEvents);
+ }
+ }
+ IEnumerable<DbgWidgetEvent> getCurrentWidgetEvents () {
+ if (CurrentWidget == null)
+ yield return null;
+ else {
+ foreach (DbgEvent evt in Events)
+ foreach (DbgWidgetEvent dwe in widgetEvents (CurrentWidget, evt))
+ yield return dwe;
+ }
+ }*/
+
+
public DbgEvent CurrentEvent {
get => curEvent;
set {
if (curEvent == value)
return;
+
+ if (!disableCurrentEventHistory) {
+ CurrentEventHistoryForward.Clear ();
+ CMDEventHistoryForward.CanExecute = false;
+ if (!(value == null || curEvent == null)) {
+ CurrentEventHistoryBackward.Push (curEvent);
+ CMDEventHistoryBackward.CanExecute = true;
+ }
+ }
curEvent = value;
+
NotifyValueChanged (nameof (CurrentEvent), curEvent);
NotifyValueChanged ("CurEventChildEvents", curEvent?.Events);
-
+ if (CurrentEvent != null && CurrentEvent.parentEvent != null)
+ CMDGotoParentEvent.CanExecute = true;
+ else
+ CMDGotoParentEvent.CanExecute = false;
+ }
+ }
+ void currentEventHistoryGoBack () {
+ disableCurrentEventHistory = true;
+ if (CurrentEvent != null) {
+ CurrentEventHistoryForward.Push (CurrentEvent);
+ CMDEventHistoryForward.CanExecute = true;
}
+ CurrentEvent = CurrentEventHistoryBackward.Pop ();
+ CMDEventHistoryBackward.CanExecute = CurrentEventHistoryBackward.Count > 0;
+
+ disableCurrentEventHistory = false;
+ }
+
+ void currentEventHistoryGoForward () {
+ disableCurrentEventHistory = true;
+ CurrentEventHistoryBackward.Push (CurrentEvent);
+ CMDEventHistoryBackward.CanExecute = true;
+ CurrentEvent = CurrentEventHistoryForward.Pop ();
+ CMDEventHistoryForward.CanExecute = CurrentEventHistoryForward.Count > 0;
+
+ disableCurrentEventHistory = false;
}
+
public DbgWidgetRecord CurrentWidget {
get => curWidget;
set {
@@ -138,8 +241,7 @@ namespace DebugLogAnalyzer
curWidget = value;
NotifyValueChanged (nameof (CurrentWidget), curWidget);
NotifyValueChanged ("CurWidgetRootEvents", curWidget?.RootEvents);
- NotifyValueChanged ("CurWidgetEvents", curWidget?.Events);
-
+ NotifyValueChanged ("CurrentWidgetEvents", curWidget?.Events);
}
}
public List<DbgWidgetEvent> CurWidgetRootEvents => curWidget == null? new List<DbgWidgetEvent>() : curWidget.RootEvents;
@@ -192,7 +294,16 @@ namespace DebugLogAnalyzer
debugLogRecording = value;
NotifyValueChanged(debugLogRecording);
}
- }
+ }
+ public bool DebugLogOnStartup {
+ get => Configuration.Global.Get<bool> (nameof(DebugLogOnStartup));
+ set {
+ if (DbgLogger.ConsoleOutput != value)
+ return;
+ Configuration.Global.Set (nameof(DebugLogOnStartup), value);
+ NotifyValueChanged(DebugLogOnStartup);
+ }
+ }
const string _defaultFileName = "unnamed.txt";