From 61d58bc83b6e4af1a7e98e30c3fbdaf31388026a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Fri, 23 Jul 2021 07:58:34 +0200 Subject: ctx & surf debug events --- .../DebugLogAnalyzer/src/DebugInterfaceWidget.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'Samples/DebugLogAnalyzer/src') 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 (@" + "); + 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(); + events = new List(); + 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; -- cgit v1.3.1-4-g156e