KiCad PCB EDA Suite
trace_helpers.h File Reference

wxLogTrace helper definitions. More...

#include <wx/arrstr.h>
#include <wx/event.h>
#include <wx/string.h>
#include <stdarg.h>
#include <map>

Go to the source code of this file.

Classes

class  TRACE_MANAGER
 

Macros

#define KI_TRACE(...)   TRACE_MANAGER::Instance().Trace( __VA_ARGS__ )
 

Functions

wxString dump (const wxKeyEvent &aEvent)
 Debug helper for printing wxKeyEvent information. More...
 
wxString dump (const wxArrayString &aArray)
 Debug helper for printing wxArrayString contents. More...
 

Variables

const wxChar *const traceFindItem
 Flag to enable find debug tracing. More...
 
const wxChar *const traceFindReplace
 Flag to enable find and replace debug tracing. More...
 
const wxChar *const kicadTraceCoords
 Flag to enable draw panel coordinate debug tracing. More...
 
const wxChar *const kicadTraceKeyEvent
 Flag to enable wxKeyEvent debug tracing. More...
 
const wxChar *const kicadTraceToolStack
 Flag to enable tracing of the tool handling stack. More...
 
const wxChar *const kicadTraceCoroutineStack
 Flag to enable tracing of the coroutine call stack. More...
 
const wxChar *const traceAutoSave
 Flag to enable auto save feature debug tracing. More...
 
const wxChar *const traceSchLibMem
 Flag to enable schematic library memory deletion debug output. More...
 
const wxChar *const traceSchLegacyPlugin
 Flag to enable legacy schematic plugin debug output. More...
 
const wxChar *const traceKicadPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const traceGedaPcbPlugin
 Flag to enable GEDA PCB plugin debug output. More...
 
const wxChar *const tracePrinting
 Flag to enable print controller debug output. More...
 
const wxChar *const tracePathsAndFiles
 Flag to enable path and file name debug output. More...
 
const wxChar *const traceLocale
 Flag to enable locale debug output. More...
 
const wxChar *const traceScreen
 Flag to enable debug output of BASE_SCREEN and it's derivatives. More...
 
const wxChar *const traceDisplayLocation
 Flag to enable debug output of display positioning logic. More...
 
const wxChar *const traceZoomScroll
 Flag to enable debug output of zoom-scrolling calculations in KIGFX::ZOOM_CONTROLLER and derivatives. More...
 
const wxChar *const traceSymbolResolver
 Flag to enable debug output of symbol library resolver results. More...
 
const wxChar *const traceSchSheetPaths
 Flag to enable debug output of schematic symbol sheet path manipulation code. More...
 
const wxChar *const traceEnvVars
 Flag to enable debug output of environment variable operations. More...
 
const wxChar *const traceGalProfile
 Flag to enable debug output of GAL performance profiling. More...
 

Detailed Description

wxLogTrace helper definitions.

Definition in file trace_helpers.h.

Macro Definition Documentation

◆ KI_TRACE

#define KI_TRACE (   ...)    TRACE_MANAGER::Instance().Trace( __VA_ARGS__ )

Definition at line 260 of file trace_helpers.h.

Function Documentation

◆ dump() [1/2]

wxString dump ( const wxKeyEvent &  aEvent)

Debug helper for printing wxKeyEvent information.

Parameters
aEventis the wxKeyEvent to generate the print string from.
Returns
the wxKeyEvent information.

Definition at line 231 of file trace_helpers.cpp.

232 {
233  wxString msg;
234  wxString eventType = wxT( "unknown" );
235 
236  if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
237  eventType = wxT( "KeyDown" );
238  else if( aEvent.GetEventType() == wxEVT_KEY_UP )
239  eventType = wxT( "KeyUp" );
240  else if( aEvent.GetEventType() == wxEVT_CHAR )
241  eventType = wxT( "Char" );
242  else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
243  eventType = wxT( "Hook" );
244 
245  // event key_name KeyCode modifiers Unicode raw_code raw_flags pos
246  msg.Printf( wxT( "%7s %15s %5d %c%c%c%c" )
247 #if wxUSE_UNICODE
248  wxT( "%5d (U+%04x)" )
249 #else
250  wxT( " none " )
251 #endif
252 #ifdef wxHAS_RAW_KEY_CODES
253  wxT( " %7lu 0x%08lx" )
254 #else
255  wxT( " not-set not-set" )
256 #endif
257  wxT( " (%5d,%5d)" ),
258  eventType,
259  GetKeyName( aEvent ),
260  aEvent.GetKeyCode(),
261  aEvent.ControlDown() ? 'C' : '-',
262  aEvent.AltDown() ? 'A' : '-',
263  aEvent.ShiftDown() ? 'S' : '-',
264  aEvent.MetaDown() ? 'M' : '-'
265 #if wxUSE_UNICODE
266  , aEvent.GetUnicodeKey()
267  , aEvent.GetUnicodeKey()
268 #endif
269 #ifdef wxHAS_RAW_KEY_CODES
270  , (unsigned long) aEvent.GetRawKeyCode()
271  , (unsigned long) aEvent.GetRawKeyFlags()
272 #endif
273  , aEvent.GetX()
274  , aEvent.GetY()
275  );
276 
277  return msg;
278 }
wxString GetKeyName(const wxKeyEvent &aEvent)

References GetKeyName().

◆ dump() [2/2]

wxString dump ( const wxArrayString &  aArray)

Debug helper for printing wxArrayString contents.

Parameters
aArrayis the string array to output.
Returns
the wxArrayString contents in a formatted string for debugging output.

Definition at line 57 of file trace_helpers.cpp.

58 {
59  wxString tmp;
60 
61  for( unsigned i = 0; i < aArray.GetCount(); i++ )
62  {
63  if( aArray[i].IsEmpty() )
64  tmp << wxT( "\"\" " );
65  else
66  tmp << aArray[i] << wxT( " " );
67  }
68 
69  return tmp;
70 }

Referenced by TOOL_DISPATCHER::DispatchWxEvent(), LIBEVAL::COMPILER::generateUCode(), TOOL_DISPATCHER::GetToolEvent(), FOOTPRINTS_LISTBOX::OnChar(), LIBRARY_LISTBOX::OnChar(), SYMBOLS_LISTBOX::OnChar(), EDA_BASE_FRAME::OnCharHook(), and GPCB_FPL_CACHE::parseParameters().