aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/DebugLogAnalyzer/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-07-23 07:58:34 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-07-23 07:58:34 +0200
commit61d58bc83b6e4af1a7e98e30c3fbdaf31388026a (patch)
tree78c98a12c930d2d3723c12d5b983fbe212ef0e7b /Samples/DebugLogAnalyzer/src
parent5d5294ae25c1f7569bd3a7cd894a4ac2b4b99889 (diff)
ctx & surf debug events
Diffstat (limited to 'Samples/DebugLogAnalyzer/src')
-rw-r--r--Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
index 3ba9faaa..c74bae64 100644
--- a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
+++ b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
@@ -129,6 +129,16 @@ namespace Crow
NotifyValueChangedAuto (value);
}
}
+ public string DebugLogFileFolder => System.IO.Path.GetDirectoryName (DebugLogFilePath);
+ public Command CMDSelectDebugLogFilePath => new Command ("...",
+ () => {
+ FileDialog dlg = IFace.LoadIMLFragment<FileDialog> (@"
+ <FileDialog Caption='Select Log file' CurrentDirectory='{DebugLogFileFolder}'
+ ShowFiles='true' ShowHidden='true' />");
+ dlg.OkClicked += (sender, e) => DebugLogFilePath = (sender as FileDialog).SelectedFileFullPath;
+ dlg.DataSource = this;
+ }
+ );
int firstWidgetIndexToSave, lastWidgetIndexToSave;
public int FirstWidgetIndexToSave {
get => firstWidgetIndexToSave;
@@ -430,7 +440,23 @@ namespace Crow
}
void loadLogFromDebugLogFilePath () {
+ DebugLogAnalyzer.Program dla = IFace as DebugLogAnalyzer.Program;
+
+ widgets = new List<DbgWidgetRecord>();
+ events = new List<DbgEvent>();
+ DbgLogger.Load(DebugLogFilePath, events, widgets);
+
+ 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]);
+ }
+ }
}
public virtual object GetScreenCoordinates () => ScreenCoordinates(Slot).TopLeft;