diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-23 07:58:34 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-23 07:58:34 +0200 |
| commit | 61d58bc83b6e4af1a7e98e30c3fbdaf31388026a (patch) | |
| tree | 78c98a12c930d2d3723c12d5b983fbe212ef0e7b /Samples | |
| parent | 5d5294ae25c1f7569bd3a7cd894a4ac2b4b99889 (diff) | |
ctx & surf debug events
Diffstat (limited to 'Samples')
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs | 26 | ||||
| -rw-r--r-- | Samples/DebugLogAnalyzer/ui/main.crow | 1 |
2 files changed, 27 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; diff --git a/Samples/DebugLogAnalyzer/ui/main.crow b/Samples/DebugLogAnalyzer/ui/main.crow index d6ed6054..bbeffe0f 100644 --- a/Samples/DebugLogAnalyzer/ui/main.crow +++ b/Samples/DebugLogAnalyzer/ui/main.crow @@ -73,6 +73,7 @@ <HorizontalStack Height="Fit" Width="Stretched" Background="Onyx" Margin="5"> <Label Text="Debug log output file:" Fit="true"/> <TextBox Text="{²../../../../dbgIfaceWidget.DebugLogFilePath}" /> + <Button Command="{../../../../dbgIfaceWidget.CMDSelectDebugLogFilePath}"/> </HorizontalStack> <EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template" Background="Grey" |