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(aWhat, ...)
 

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 traceFonts
 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...
 
const wxChar *const traceKiCad2Step
 Flag to enable KiCad2Step debug tracing. More...
 

Detailed Description

wxLogTrace helper definitions.

Definition in file trace_helpers.h.

Macro Definition Documentation

◆ KI_TRACE

#define KI_TRACE (   aWhat,
  ... 
)
Value:
if( TRACE_MANAGER::Instance().IsTraceEnabled( aWhat ) ) \
{ \
TRACE_MANAGER::Instance().Trace( aWhat, __VA_ARGS__ ); \
} \
else \
{ \
}
static TRACE_MANAGER & Instance()

Definition at line 276 of file trace_helpers.h.

Function Documentation

◆ dump() [1/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 59 of file trace_helpers.cpp.

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

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().

◆ dump() [2/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 233 of file trace_helpers.cpp.

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

References GetKeyName().