GOUpdateCache = Widget | Drawing | 0x03,
GOPaintCache = Widget | Drawing | 0x04,
GOPaint = Widget | Drawing | 0x05,
+ GOCreateSurface = Widget | Drawing | 0x06,
+ GOCreateContext = Widget | Drawing | 0x07,
+
GOLockUpdate = Widget | Lock | 0x01,
GOLockClipping = Widget | Lock | 0x02,
return Colors.MediumVioletRed;
case DbgEvtType.GODraw:
return Colors.SteelBlue;
+ case DbgEvtType.GOCreateSurface:
+ return Colors.SkyBlue;
+ case DbgEvtType.GOCreateContext:
+ return Colors.DeepSkyBlue;
case DbgEvtType.GORecreateCache:
return Colors.CornflowerBlue;
case DbgEvtType.GOUpdateCache:
public static void Save(Interface iface, string dbgLogFilePath = "debug.log") {
#if DEBUG_LOG
using (Stream stream = new FileStream (dbgLogFilePath, FileMode.Create, FileAccess.Write))
- Save (iface, stream);
+ Save (iface, stream, 0);
Console.WriteLine ($"Crow Debug Log saved to: {System.IO.Path.GetFullPath(dbgLogFilePath)}");
#endif
}
return null;
}
- public static FileSystemInfo [] GetFileSystemInfosOrdered (this DirectoryInfo di)
- => di.GetFileSystemInfos ().OrderBy (f => f.Attributes).ThenBy (f => f.Name).ToArray ();
+ public static FileSystemInfo [] GetFileSystemInfosOrdered (this DirectoryInfo di) {
+ try {
+ return di.GetFileSystemInfos ().OrderBy (f => f.Attributes).ThenBy (f => f.Name).ToArray ();
+ } catch {
+ return null;
+ }
+ }
internal static bool IsAnyLineBreakCharacter (this char c)
=> c == '\n' || c == '\r' || c == '\u0085' || c == '\u2028' || c == '\u2029';
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;
}
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;
<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"