mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-07 22:35:32 +00:00
Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive debugging output which makes finding specific debugging messages more difficult than it needs to be. There is still some debugging output in test code that really needs to be moved into a unit test. Add debugging output section to the coding policy regarding debugging output.
This commit is contained in:
parent
4cc820f550
commit
ede39780e2
3d-viewer
3d_canvas
3d_rendering
3d_render_ogl_legacy
3d_render_raytracing
common_ogl
Documentation/development
common
base_struct.cppdialog_shim.cppdsnlexer.cppeagle_parser.cppeda_base_frame.cpp
gal/opengl
gestfich.cppkicad_curl
lib_tree_model_adapter.cpplset.cppproject.cppptree.cpptool
widgets
cvpcb
eeschema
class_library.cppcross-probing.cpp
dialogs
eeschema_config.cpplib_arc.cpplib_pin.cppsch_edit_frame.cppsch_sheet.cpptools
gerbview
include/tool/examples
libs/kimath/src
pcbnew
autorouter
connectivity
eagle_plugin.cppedit.cppedit_track_width.cppexporters
files.cppfootprint_editor_utils.cppfootprint_wizard_frame_functions.cppgithub
layer_widget.cpplegacy_plugin.cppload_select_footprint.cppnetinfo_list.cppnetlist_reader
pcb_expr_evaluator.cpppcb_parser.cpppcbnew_config.cpprouter
specctra_import_export
tools
undo_redo.cppqa
common_tools/tools/coroutines
drc_proto
eeschema
libeval_compiler
libs/kimath/geometry
pcbnew
pcbnew_tools/tools
pcb_parser
polygon_generator
polygon_triangulation
pcbnew_utils
qa_utils
utils
@ -433,26 +433,10 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
else
|
||||
aWarningReporter->Report( wxEmptyString );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_stopCreateBoardPolyTime = GetRunningMicroSecs();
|
||||
unsigned stats_startCreateLayersTime = stats_stopCreateBoardPolyTime;
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Create layers" ) );
|
||||
|
||||
createLayers( aStatusReporter );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_stopCreateLayersTime = GetRunningMicroSecs();
|
||||
|
||||
printf( "BOARD_ADAPTER::InitSettings times\n" );
|
||||
printf( " CreateBoardPoly: %.3f ms\n",
|
||||
(float)( stats_stopCreateBoardPolyTime - stats_startCreateBoardPolyTime ) / 1e3 );
|
||||
printf( " CreateLayers and holes: %.3f ms\n",
|
||||
(float)( stats_stopCreateLayersTime - stats_startCreateLayersTime ) / 1e3 );
|
||||
printf( "\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,11 +170,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
if( m_stats_nr_vias )
|
||||
m_stats_via_med_hole_diameter /= (float)m_stats_nr_vias;
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T01: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Prepare copper layers index and containers
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
std::vector< PCB_LAYER_ID > layer_id;
|
||||
@ -204,11 +199,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T02: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Create tracks and vias" ) );
|
||||
|
||||
@ -242,11 +232,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T03: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Create VIAS and THTs objects and add it to holes containers
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||
@ -332,11 +317,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T04: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Create VIAS and THTs objects and add it to holes containers
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||
@ -433,11 +413,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T05: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Creates vertical outline contours of the tracks and add it to the poly of the layer
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||
@ -471,11 +446,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T06: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add holes of modules
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
@ -509,11 +479,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
if( m_stats_nr_holes )
|
||||
m_stats_hole_med_diameter /= (float)m_stats_nr_holes;
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T07: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add contours of the pad holes (pads can be Circle or Segment holes)
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( MODULE* module : m_board->Modules() )
|
||||
@ -541,11 +506,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T08: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add modules PADs objects to containers
|
||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||
{
|
||||
@ -572,11 +532,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T09: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add modules PADs poly contourns (vertical outlines)
|
||||
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
||||
@ -601,11 +556,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T10: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add graphic item on copper layers to object containers
|
||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||
{
|
||||
@ -653,11 +603,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T11: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Add graphic item on copper layers to poly contourns (vertical outlines)
|
||||
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
||||
@ -694,11 +639,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T12: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( GetFlag( FL_ZONE ) )
|
||||
{
|
||||
if( aStatusReporter )
|
||||
@ -752,11 +692,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "fill zones T13: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( GetFlag( FL_ZONE ) && GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
||||
{
|
||||
@ -776,11 +711,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T14: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Simplify layer polygons
|
||||
|
||||
if( aStatusReporter )
|
||||
@ -820,11 +750,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T15: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Simplify holes polygon contours
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
if( aStatusReporter )
|
||||
@ -845,12 +770,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T16: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
#endif
|
||||
// End Build Copper layers
|
||||
|
||||
|
||||
// This will make a union of all added contourns
|
||||
m_through_inner_holes_poly.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
m_through_outer_holes_poly.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
@ -859,17 +780,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
m_through_outer_ring_holes_vias_poly.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
//m_through_inner_holes_vias_poly.Simplify( SHAPE_POLY_SET::PM_FAST ); // Not in use
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endCopperLayersTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Build Tech layers
|
||||
// Based on: https://github.com/KiCad/kicad-source-mirror/blob/master/3d-viewer/3d_draw.cpp#L1059
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_startTechLayersTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Build Tech layers" ) );
|
||||
|
||||
@ -1051,16 +964,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
}
|
||||
// End Build Tech layers
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endTechLayersTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
|
||||
// Build BVH (Bounding volume hierarchy) for holes and vias
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_startHolesBVHTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Build BVH for holes and vias" ) );
|
||||
|
||||
@ -1081,24 +986,4 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
if( m_layers_container2D[F_Mask] )
|
||||
m_layers_container2D[F_Mask]->BuildBVH();
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endHolesBVHTime = GetRunningMicroSecs();
|
||||
|
||||
printf( "BOARD_ADAPTER::createLayers times\n" );
|
||||
printf( " Copper Layers: %.3f ms\n",
|
||||
(float)( stats_endCopperLayersTime - stats_startCopperLayersTime ) / 1e3 );
|
||||
printf( " Holes BVH creation: %.3f ms\n",
|
||||
(float)( stats_endHolesBVHTime - stats_startHolesBVHTime ) / 1e3 );
|
||||
printf( " Tech Layers: %.3f ms\n",
|
||||
(float)( stats_endTechLayersTime - stats_startTechLayersTime ) / 1e3 );
|
||||
printf( "Statistics:\n" );
|
||||
printf( " m_stats_nr_tracks %u\n", m_stats_nr_tracks );
|
||||
printf( " m_stats_nr_vias %u\n", m_stats_nr_vias );
|
||||
printf( " m_stats_nr_holes %u\n", m_stats_nr_holes );
|
||||
printf( " m_stats_via_med_hole_diameter (3DU) %f\n", m_stats_via_med_hole_diameter );
|
||||
printf( " m_stats_hole_med_diameter (3DU) %f\n", m_stats_hole_med_diameter );
|
||||
printf( " m_calc_seg_min_factor3DU (3DU) %f\n", m_calc_seg_min_factor3DU );
|
||||
printf( " m_calc_seg_max_factor3DU (3DU) %f\n", m_calc_seg_max_factor3DU );
|
||||
#endif
|
||||
}
|
||||
|
@ -342,25 +342,13 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
|
||||
COBJECT2D_STATS::Instance().ResetStats();
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf("InitSettings...\n");
|
||||
#endif
|
||||
|
||||
unsigned stats_startReloadTime = GetRunningMicroSecs();
|
||||
|
||||
m_boardAdapter.InitSettings( aStatusReporter, aWarningReporter );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endReloadTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
SFVEC3F camera_pos = m_boardAdapter.GetBoardCenter3DU();
|
||||
m_camera.SetBoardLookAtPos( camera_pos );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_start_OpenGL_Load_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Load OpenGL: board" ) );
|
||||
|
||||
@ -615,35 +603,13 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
layer_z_top );
|
||||
}// for each layer on map
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_end_OpenGL_Load_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
// Load 3D models
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_start_models_Load_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
aStatusReporter->Report( _( "Loading 3D models" ) );
|
||||
|
||||
load_3D_models( aStatusReporter );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_end_models_Load_Time = GetRunningMicroSecs();
|
||||
|
||||
|
||||
printf( "C3D_RENDER_OGL_LEGACY::reload times:\n" );
|
||||
printf( " Reload board: %.3f ms\n",
|
||||
(float)( stats_endReloadTime - stats_startReloadTime ) / 1000.0f );
|
||||
printf( " Loading to openGL: %.3f ms\n",
|
||||
(float)( stats_end_OpenGL_Load_Time - stats_start_OpenGL_Load_Time ) / 1000.0f );
|
||||
printf( " Loading 3D models: %.3f ms\n",
|
||||
(float)( stats_end_models_Load_Time - stats_start_models_Load_Time ) / 1000.0f );
|
||||
COBJECT2D_STATS::Instance().PrintStats();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
{
|
||||
// Calculation time in seconds
|
||||
|
@ -305,35 +305,6 @@ CBVH_PBRT::CBVH_PBRT( const CGENERICCONTAINER &aObjectContainer,
|
||||
flattenBVHTree( root, &offset );
|
||||
|
||||
wxASSERT( offset == (unsigned int)totalNodes );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
uint32_t treeBytes = totalNodes * sizeof( LinearBVHNode ) + sizeof( *this ) +
|
||||
m_primitives.size() * sizeof( m_primitives[0] ) +
|
||||
m_addresses_pointer_to_mm_free.size() * sizeof( void * );
|
||||
|
||||
printf( "////////////////////////////////////////////////////////////////////////////////\n" );
|
||||
printf( "Creating a CBVH_PBRT from %u objects ", (unsigned int)m_primitives.size() );
|
||||
|
||||
switch( m_splitMethod )
|
||||
{
|
||||
case SPLITMETHOD::MIDDLE:
|
||||
printf( "using SPLITMETHOD::MIDDLE\n" );
|
||||
break;
|
||||
case SPLITMETHOD::EQUALCOUNTS:
|
||||
printf( "using SPLITMETHOD::EQUALCOUNTS\n" );
|
||||
break;
|
||||
case SPLITMETHOD::SAH:
|
||||
printf( "using SPLITMETHOD::SAH\n" );
|
||||
break;
|
||||
case SPLITMETHOD::HLBVH:
|
||||
printf( "using SPLITMETHOD::HLBVH\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
printf( " BVH created with %d nodes (%.2f MB)\n",
|
||||
totalNodes, float(treeBytes) / (1024.f * 1024.f) );
|
||||
printf( "////////////////////////////////////////////////////////////////////////////////\n\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,19 +266,10 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
COBJECT2D_STATS::Instance().ResetStats();
|
||||
COBJECT3D_STATS::Instance().ResetStats();
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf("InitSettings...\n");
|
||||
#endif
|
||||
|
||||
unsigned stats_startReloadTime = GetRunningMicroSecs();
|
||||
|
||||
m_boardAdapter.InitSettings( aStatusReporter, aWarningReporter );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endReloadTime = GetRunningMicroSecs();
|
||||
unsigned stats_startConvertTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
SFVEC3F camera_pos = m_boardAdapter.GetBoardCenter3DU();
|
||||
m_camera.SetBoardLookAtPos( camera_pos );
|
||||
|
||||
@ -290,10 +281,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
// Create and add the outline board
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf("Create outline board...\n");
|
||||
#endif
|
||||
|
||||
delete m_outlineBoard2dObjects;
|
||||
|
||||
m_outlineBoard2dObjects = new CCONTAINER2D;
|
||||
@ -452,10 +439,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
// Add layers maps (except B_Mask and F_Mask)
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf("Add layers maps...\n");
|
||||
#endif
|
||||
|
||||
for( MAP_CONTAINER_2D::const_iterator ii = m_boardAdapter.GetMapLayers().begin();
|
||||
ii != m_boardAdapter.GetMapLayers().end();
|
||||
++ii )
|
||||
@ -983,11 +966,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
|
||||
// Create an accelerator
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_startAcceleratorTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
if( m_accelerator )
|
||||
{
|
||||
delete m_accelerator;
|
||||
@ -996,37 +974,6 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin
|
||||
|
||||
m_accelerator = new CBVH_PBRT( m_object_container );
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
unsigned stats_endAcceleratorTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "C3D_RENDER_RAYTRACING::reload times:\n" );
|
||||
printf( " Reload board: %.3f ms\n", (float)( stats_endReloadTime -
|
||||
stats_startReloadTime ) /
|
||||
|
||||
1000.0f );
|
||||
printf( " Convert to 3D objects: %.3f ms\n", (float)( stats_endConvertTime -
|
||||
stats_startConvertTime ) /
|
||||
1000.0f );
|
||||
printf( " Accelerator construction: %.3f ms\n", (float)( stats_endAcceleratorTime -
|
||||
stats_startAcceleratorTime ) /
|
||||
1000.0f );
|
||||
printf( " Load and add 3D models: %.3f ms\n", (float)( stats_endLoad3DmodelsTime -
|
||||
stats_startLoad3DmodelsTime ) /
|
||||
1000.0f );
|
||||
printf( "Optimizations\n" );
|
||||
|
||||
printf( " m_stats_converted_dummy_to_plane: %u\n",
|
||||
m_stats_converted_dummy_to_plane );
|
||||
|
||||
printf( " m_stats_converted_roundsegment2d_to_roundsegment: %u\n",
|
||||
m_stats_converted_roundsegment2d_to_roundsegment );
|
||||
|
||||
COBJECT2D_STATS::Instance().PrintStats();
|
||||
COBJECT3D_STATS::Instance().PrintStats();
|
||||
#endif
|
||||
|
||||
if( aStatusReporter )
|
||||
{
|
||||
// Calculation time in seconds
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2017 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -32,6 +32,7 @@
|
||||
#include "../../3d_fastmath.h"
|
||||
#include <cstdio>
|
||||
#include <wx/debug.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -88,7 +89,8 @@ void RAY::Init( const SFVEC3F& o, const SFVEC3F& d )
|
||||
{
|
||||
m_Classification = RAY_CLASSIFICATION::MMM;
|
||||
}
|
||||
else if( m_Dir.z > 0 ){
|
||||
else if( m_Dir.z > 0 )
|
||||
{
|
||||
m_Classification = RAY_CLASSIFICATION::MMP;
|
||||
}
|
||||
else//( m_Dir.z >= 0 )
|
||||
@ -397,6 +399,6 @@ bool RAYSEG2D::IntersectCircle( const SFVEC2F &aCenter,
|
||||
|
||||
void RAY::debug() const
|
||||
{
|
||||
printf("O(%f, %f, %f) D(%f, %f, %f)\n", m_Origin.x, m_Origin.y, m_Origin.z,
|
||||
m_Dir.x, m_Dir.y, m_Dir.z );
|
||||
wxLogDebug( "O(%f, %f, %f) D(%f, %f, %f)\n", m_Origin.x, m_Origin.y, m_Origin.z,
|
||||
m_Dir.x, m_Dir.y, m_Dir.z );
|
||||
}
|
||||
|
@ -64,11 +64,9 @@ const std::map<OBJECT2D_TYPE, const char*> objectTypeNames
|
||||
|
||||
void COBJECT2D_STATS::PrintStats()
|
||||
{
|
||||
printf( "OBJ2D Statistics:\n" );
|
||||
|
||||
for( auto& objectType : objectTypeNames )
|
||||
{
|
||||
printf( " %20s %u\n", objectType.second,
|
||||
wxLogDebug( " %20s %u\n", objectType.second,
|
||||
m_counter[static_cast<int>( objectType.first )] );
|
||||
}
|
||||
}
|
||||
|
@ -701,21 +701,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks(
|
||||
blockY -= blockAdvance.y;
|
||||
topToBottom += topToBottom_inc;
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "////////////////////////////////////////////////////////////////////////////////\n" );
|
||||
printf( "Convert_path_polygon_to_polygon_blocks_and_dummy_blocks\n" );
|
||||
printf( " grid_divisions (%u, %u)\n", grid_divisions.x, grid_divisions.y );
|
||||
printf( " N Total Blocks %u\n", grid_divisions.x * grid_divisions.y );
|
||||
printf( " N Empty Blocks %u\n", stats_n_empty_blocks );
|
||||
printf( " N Dummy Blocks %u\n", stats_n_dummy_blocks );
|
||||
printf( " N Polyg Blocks %u\n", stats_n_poly_blocks );
|
||||
printf( " Med N Seg Poly %u\n", stats_sum_size_of_polygons / stats_n_poly_blocks );
|
||||
printf( " medOfTheSquaresSegmentLength %f\n", medOfTheSquaresSegmentLength );
|
||||
printf( " minSegmentLength %f\n", minSegmentLength );
|
||||
printf( " aDivFactor %f\n", aDivFactor );
|
||||
printf( "////////////////////////////////////////////////////////////////////////////////\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -395,6 +395,6 @@ void CBBOX::ApplyTransformationAA( glm::mat4 aTransformMatrix )
|
||||
|
||||
void CBBOX::debug() const
|
||||
{
|
||||
printf( "min(%f, %f, %f) - max(%f, %f, %f)\n", m_min.x, m_min.y, m_min.z,
|
||||
m_max.x, m_max.y, m_max.z );
|
||||
wxLogDebug( "min(%f, %f, %f) - max(%f, %f, %f)\n", m_min.x, m_min.y, m_min.z,
|
||||
m_max.x, m_max.y, m_max.z );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -63,11 +63,11 @@ const std::map<OBJECT3D_TYPE, const char*> objectTypeNames
|
||||
|
||||
void COBJECT3D_STATS::PrintStats()
|
||||
{
|
||||
printf( "OBJ3D Statistics:\n" );
|
||||
wxLogDebug( "OBJ3D Statistics:\n" );
|
||||
|
||||
for( auto& objectType : objectTypeNames )
|
||||
{
|
||||
printf( " %20s %u\n", objectType.second,
|
||||
wxLogDebug( " %20s %u\n", objectType.second,
|
||||
m_counter[static_cast<int>( objectType.first )] );
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,6 @@ const int *COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE aAntiAliasingMode
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf("GetAttributesList: AntiAliasing is not supported.\n") );
|
||||
aAntiAliasingMode = ANTIALIASING_MODE::AA_NONE;
|
||||
}
|
||||
}
|
||||
|
@ -527,7 +527,29 @@ means that source files must be copyrighted and not be released into
|
||||
the public domain. Each source file has one or more owners.
|
||||
|
||||
|
||||
# 6. Header Files # {#header_files}
|
||||
# 6. Debugging Output {#debugging_output}
|
||||
Debugging output is a common method for validating code. However, it
|
||||
should not always active in debug builds. This makes it difficult for
|
||||
other developers to see their debugging output and can have a significant
|
||||
impact on the performance of debug builds. I you need to use debugging
|
||||
output, use [wxLogDebug] instead of `printf` or C++ output stream. If
|
||||
you accidentally leave the debugging output in the source, it will expand
|
||||
to nothing on release builds. All debugging output code should be removed
|
||||
from the source tree before pushing changes to the main KiCad repo. Do not
|
||||
comment out debugging output. This just adds more cruft to the code base.
|
||||
If you need to leave debugging output for, future testing, use tracing
|
||||
output (see 6.1).
|
||||
|
||||
## 6.1 Using Tracing for Debugging Output {#tracing_output}
|
||||
There are occasions when you want to see debugging output to ensure
|
||||
existing code performs as expected. In this case, use [wxLogTrace] which
|
||||
allows debugging output to be controlled by the `WXTRACE` environment
|
||||
variable. When using [wxLogTrace][wxLogTrace], the trace environment
|
||||
variable string should be documented by either adding it to the
|
||||
`trace_helper.{h/cpp}` source files or locally using the [Doxygen][Doxygen]
|
||||
comment `\ingroup trace_env_vars`.
|
||||
|
||||
# 7. Header Files # {#header_files}
|
||||
Project \*.h source files should:
|
||||
|
||||
- contain a license statement
|
||||
@ -537,7 +559,7 @@ Project \*.h source files should:
|
||||
|
||||
The license statement was described above.
|
||||
|
||||
## 6.1 Nested Include #ifndef ## {#nested_include}
|
||||
## 7.1 Nested Include #ifndef ## {#nested_include}
|
||||
Each header file should include an \#ifndef which is commonly used to
|
||||
prevent compiler errors in the case where the header file is seen
|
||||
multiple times in the code stream presented to the compiler. Just
|
||||
@ -561,7 +583,7 @@ the very bottom of the file. It is important that it wrap any nested
|
||||
\#include statements, so that the compiler can skip them if the
|
||||
\#ifndef evaluates to false, which will reduce compilation time.
|
||||
|
||||
## 6.2 Headers Without Unsatisfied Dependencies ## {#header_depends}
|
||||
## 7.2 Headers Without Unsatisfied Dependencies ## {#header_depends}
|
||||
Any header file should include other headers that it depends on. (Note:
|
||||
KiCad is not at this point now, but this section is a goal of the
|
||||
project.)
|
||||
@ -598,13 +620,13 @@ is exposed in the header file, merely by including that one header
|
||||
file.
|
||||
|
||||
|
||||
# 7. When in Doubt... # {#when_in_doubt}
|
||||
# 8. When in Doubt... # {#when_in_doubt}
|
||||
When editing existing source code files and there are multiple acceptable
|
||||
code formatting options or no formatting is defined, follow the existing
|
||||
formatting in the file.
|
||||
|
||||
|
||||
# 8. I Wrote X Lines of Code Before I Read This Document # {#x_lines}
|
||||
# 9. I Wrote X Lines of Code Before I Read This Document # {#x_lines}
|
||||
It's OK. We all make mistakes. Fortunately, KiCad provides a
|
||||
configuration file for the code beautifier uncrustify. Uncrustify won't
|
||||
fix your naming problems but it does a pretty decent job of formatting
|
||||
@ -618,7 +640,7 @@ uncrustify [website][uncrustify] for more information.
|
||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
||||
|
||||
|
||||
# 9. Show Me an Example # {#show_me_an_example}
|
||||
# 10. Show Me an Example # {#show_me_an_example}
|
||||
Nothing drives the point home like an example. The source file richio.h
|
||||
below was taken directly from the KiCad source.
|
||||
|
||||
@ -877,7 +899,7 @@ below was taken directly from the KiCad source.
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
# 10. Resources # {#resources}
|
||||
# 11. Resources # {#resources}
|
||||
There are plenty of excellent resources on the Internet on C++ coding
|
||||
styles and coding do's and don'ts. Here are a few useful ones. In most
|
||||
cases, the coding styles do not follow the KiCad coding style but there
|
||||
@ -895,3 +917,6 @@ learn something new.
|
||||
[kernel]:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/process/coding-style.rst
|
||||
[overloading]:http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
|
||||
[style]:http://en.wikipedia.org/wiki/Programming_style
|
||||
[wxLogDebug]:https://docs.wxwidgets.org/3.0/group__group__funcmacro__log.html#ga9c530ae20eb423744f90874d2c97d02b
|
||||
[wxLogTrace]:https://docs.wxwidgets.org/3.0/group__group__funcmacro__log.html#gae28a46b220921cd87a6f75f0842294c5
|
||||
[Doxygen]:https://www.doxygen.nl/index.html
|
||||
|
@ -96,11 +96,6 @@ void EDA_ITEM::SetModified()
|
||||
|
||||
const EDA_RECT EDA_ITEM::GetBoundingBox() const
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
printf( "Missing GetBoundingBox()\n" );
|
||||
Show( 0, std::cout ); // tell me which classes still need GetBoundingBox support
|
||||
#endif
|
||||
|
||||
// return a zero-sized box per default. derived classes should override
|
||||
// this
|
||||
return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2012-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -269,13 +269,6 @@ void DIALOG_SHIM::ResetSize()
|
||||
bool DIALOG_SHIM::Enable( bool enable )
|
||||
{
|
||||
// so we can do logging of this state change:
|
||||
|
||||
#if 0 && defined(DEBUG)
|
||||
const char* type_id = typeid( *this ).name();
|
||||
printf( "DIALOG_SHIM %s: %s\n", type_id, enable ? "enabled" : "disabled" );
|
||||
fflush(0); //Needed on msys2 to immediately print the message
|
||||
#endif
|
||||
|
||||
return wxDialog::Enable( enable );
|
||||
}
|
||||
|
||||
@ -364,16 +357,12 @@ int DIALOG_SHIM::ShowQuasiModal()
|
||||
// Get the optimal parent
|
||||
wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
|
||||
|
||||
// Show the optimal parent
|
||||
DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
|
||||
|
||||
wxASSERT_MSG( !m_qmodal_parent_disabler,
|
||||
wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
|
||||
|
||||
// quasi-modal: disable only my "optimal" parent
|
||||
m_qmodal_parent_disabler = new WDO_ENABLE_DISABLE( parent );
|
||||
|
||||
|
||||
// Apple in its infinite wisdom will raise a disabled window before even passing
|
||||
// us the event, so we have no way to stop it. Instead, we must set an order on
|
||||
// the windows so that the quasi-modal will be pushed in front of the disabled
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2007-2015 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2007-2020 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -776,7 +776,6 @@ exit: // single point of exit, no returns elsewhere please.
|
||||
|
||||
next = head;
|
||||
|
||||
// printf("tok:\"%s\"\n", curText.c_str() );
|
||||
return curTok;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2012-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017 CERN.
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
*
|
||||
@ -598,7 +598,6 @@ wxSize ETEXT::ConvertSize() const
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug( "Invalid font name \"%s\"", fontName );
|
||||
textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() );
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -196,8 +196,8 @@ void EDA_BASE_FRAME::SetShutdownBlockReason( const wxString& aReason )
|
||||
|
||||
if( !ShutdownBlockReasonCreate( GetHandle(), aReason.wc_str() ) )
|
||||
{
|
||||
// Nothing bad happens if this fails, at worst it uses a generic application is preventing shutdown message
|
||||
wxLogDebug( wxT( "ShutdownBlockReasonCreate failed to set reason: %s" ), aReason );
|
||||
// Nothing bad happens if this fails, at worst it uses a generic application is
|
||||
// preventing shutdown message
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -460,8 +460,6 @@ void EDA_BASE_FRAME::LoadWindowSettings( WINDOW_SETTINGS* aCfg )
|
||||
wxDisplay display( index );
|
||||
wxRect clientSize = display.GetClientArea();
|
||||
|
||||
wxLogDebug( "Client size (%d, %d)", clientSize.width, clientSize.height );
|
||||
|
||||
m_FramePos = wxDefaultPosition;
|
||||
|
||||
// Ensure the window fits on the display, since the other one could have been larger
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright 2013-2017 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -63,10 +65,6 @@ void CACHED_CONTAINER::SetItem( VERTEX_ITEM* aItem )
|
||||
|
||||
// Get the previously set offset if the item was stored previously
|
||||
m_chunkOffset = itemSize > 0 ? aItem->GetOffset() : -1;
|
||||
|
||||
#if CACHED_CONTAINER_TEST > 1
|
||||
wxLogDebug( wxT( "Adding/editing item 0x%08lx (size %d)" ), (long) m_item, itemSize );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +95,6 @@ void CACHED_CONTAINER::FinishItem()
|
||||
m_chunkOffset = 0;
|
||||
|
||||
#if CACHED_CONTAINER_TEST > 1
|
||||
wxLogDebug( wxT( "Finishing item 0x%08lx (size %d)" ), (long) m_item, itemSize );
|
||||
test();
|
||||
#endif
|
||||
}
|
||||
@ -156,10 +153,6 @@ void CACHED_CONTAINER::Delete( VERTEX_ITEM* aItem )
|
||||
|
||||
int offset = aItem->GetOffset();
|
||||
|
||||
#if CACHED_CONTAINER_TEST > 1
|
||||
wxLogDebug( wxT( "Removing 0x%08lx (size %d offset %d)" ), (long) aItem, size, offset );
|
||||
#endif
|
||||
|
||||
// Insert a free memory chunk entry in the place where item was stored
|
||||
addFreeChunk( offset, size );
|
||||
|
||||
@ -215,10 +208,6 @@ bool CACHED_CONTAINER::reallocate( unsigned int aSize )
|
||||
|
||||
unsigned int itemSize = m_item->GetSize();
|
||||
|
||||
#if CACHED_CONTAINER_TEST > 2
|
||||
wxLogDebug( wxT( "Resize %p from %d to %d" ), m_item, itemSize, aSize );
|
||||
#endif
|
||||
|
||||
// Find a free space chunk >= aSize
|
||||
FREE_CHUNK_MAP::iterator newChunk = m_freeChunks.lower_bound( aSize );
|
||||
|
||||
@ -256,10 +245,6 @@ bool CACHED_CONTAINER::reallocate( unsigned int aSize )
|
||||
// Check if the item was previously stored in the container
|
||||
if( itemSize > 0 )
|
||||
{
|
||||
#if CACHED_CONTAINER_TEST > 3
|
||||
wxLogDebug( wxT( "Moving 0x%08x from 0x%08x to 0x%08x" ),
|
||||
(int) m_item, oldChunkOffset, newChunkOffset );
|
||||
#endif
|
||||
// The item was reallocated, so we have to copy all the old data to the new place
|
||||
memcpy( &m_vertices[newChunkOffset], &m_vertices[m_chunkOffset], itemSize * VERTEX_SIZE );
|
||||
|
||||
@ -363,10 +348,6 @@ void CACHED_CONTAINER::mergeFreeChunks()
|
||||
// Add the last one
|
||||
m_freeChunks.insert( std::make_pair( size, offset ) );
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
totalTime.Stop();
|
||||
wxLogDebug( "Merged free chunks / %.1f ms", totalTime.msecs() );
|
||||
#endif /* __WXDEBUG__ */
|
||||
#if CACHED_CONTAINER_TEST > 0
|
||||
test();
|
||||
#endif
|
||||
@ -385,42 +366,11 @@ void CACHED_CONTAINER::addFreeChunk( unsigned int aOffset, unsigned int aSize )
|
||||
|
||||
void CACHED_CONTAINER::showFreeChunks()
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
FREE_CHUNK_MAP::iterator it;
|
||||
|
||||
wxLogDebug( wxT( "Free chunks:" ) );
|
||||
|
||||
for( it = m_freeChunks.begin(); it != m_freeChunks.end(); ++it )
|
||||
{
|
||||
unsigned int offset = getChunkOffset( *it );
|
||||
unsigned int size = getChunkSize( *it );
|
||||
assert( size > 0 );
|
||||
|
||||
wxLogDebug( wxT( "[0x%08x-0x%08x] (size %d)" ),
|
||||
offset, offset + size - 1, size );
|
||||
}
|
||||
#endif /* __WXDEBUG__ */
|
||||
}
|
||||
|
||||
|
||||
void CACHED_CONTAINER::showUsedChunks()
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
ITEMS::iterator it;
|
||||
|
||||
wxLogDebug( wxT( "Used chunks:" ) );
|
||||
|
||||
for( it = m_items.begin(); it != m_items.end(); ++it )
|
||||
{
|
||||
VERTEX_ITEM* item = *it;
|
||||
unsigned int offset = item->GetOffset();
|
||||
unsigned int size = item->GetSize();
|
||||
assert( size > 0 );
|
||||
|
||||
wxLogDebug( wxT( "[0x%08x-0x%08x] @ 0x%p (size %d)" ),
|
||||
offset, offset + size - 1, item, size );
|
||||
}
|
||||
#endif /* __WXDEBUG__ */
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright 2013-2017 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -43,15 +45,15 @@ CACHED_CONTAINER_GPU::CACHED_CONTAINER_GPU( unsigned int aSize ) :
|
||||
m_useCopyBuffer = GLEW_ARB_copy_buffer;
|
||||
|
||||
wxString vendor( glGetString(GL_VENDOR) );
|
||||
|
||||
// workaround for intel GPU drivers: disable glCopyBuffer, causes crashes/freezes on certain driver versions
|
||||
|
||||
// workaround for intel GPU drivers: disable glCopyBuffer, causes crashes/freezes on
|
||||
// certain driver versions
|
||||
if( vendor.Contains ( "Intel " ) || vendor.Contains ( "etnaviv" ) )
|
||||
{
|
||||
wxLogDebug( "Disabling glCopyBuffer(), on %s GPU.\n", vendor );
|
||||
m_useCopyBuffer = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
glGenBuffers( 1, &m_glBufferHandle );
|
||||
glBindBuffer( GL_ARRAY_BUFFER, m_glBufferHandle );
|
||||
glBufferData( GL_ARRAY_BUFFER, m_currentSize * VERTEX_SIZE, NULL, GL_DYNAMIC_DRAW );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
||||
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2012-2020 Kicad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* Graphics Abstraction Layer (GAL) for OpenGL
|
||||
*
|
||||
@ -185,8 +185,6 @@ void SHADER::programInfo( GLuint aProgram )
|
||||
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
||||
glGetProgramInfoLog( aProgram, glInfoLogLength, &writtenChars, glInfoLog );
|
||||
|
||||
std::cerr << glInfoLog << std::endl;
|
||||
|
||||
delete[] glInfoLog;
|
||||
}
|
||||
}
|
||||
@ -206,8 +204,6 @@ void SHADER::shaderInfo( GLuint aShader )
|
||||
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
||||
glGetShaderInfoLog( aShader, glInfoLogLength, &writtenChars, glInfoLog );
|
||||
|
||||
std::cerr << glInfoLog << std::endl;
|
||||
|
||||
delete[] glInfoLog;
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <stdexcept>
|
||||
#include <wx/log.h> // wxLogDebug
|
||||
|
||||
|
||||
int checkGlError( const std::string& aInfo, bool aThrow )
|
||||
{
|
||||
@ -127,13 +129,13 @@ static void GLAPIENTRY debugMsgCallback( GLenum aSource, GLenum aType, GLuint aI
|
||||
{
|
||||
switch( aSeverity )
|
||||
{
|
||||
case GL_DEBUG_SEVERITY_HIGH: printf( "OpenGL ERROR: " ); break;
|
||||
case GL_DEBUG_SEVERITY_MEDIUM: printf( "OpenGL WARNING: " ); break;
|
||||
case GL_DEBUG_SEVERITY_LOW: printf( "OpenGL INFO: " ); break;
|
||||
case GL_DEBUG_SEVERITY_HIGH: wxLogDebug( "OpenGL ERROR: " ); break;
|
||||
case GL_DEBUG_SEVERITY_MEDIUM: wxLogDebug( "OpenGL WARNING: " ); break;
|
||||
case GL_DEBUG_SEVERITY_LOW: wxLogDebug( "OpenGL INFO: " ); break;
|
||||
case GL_DEBUG_SEVERITY_NOTIFICATION: return;
|
||||
}
|
||||
|
||||
printf( "%s\n", aMessage );
|
||||
wxLogDebug( "%s\n", aMessage );
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2008-2017 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -81,16 +81,6 @@ wxString EDA_FILE_SELECTOR( const wxString& aTitle,
|
||||
|
||||
wxSetWorkingDirectory( defaultpath );
|
||||
|
||||
#if 0 && defined (DEBUG)
|
||||
printf( "defaultpath=\"%s\" defaultname=\"%s\" Ext=\"%s\" Mask=\"%s\" flag=%d keep_working_directory=%d\n",
|
||||
TO_UTF8( defaultpath ),
|
||||
TO_UTF8( defaultname ),
|
||||
TO_UTF8( aExtension ),
|
||||
TO_UTF8( aWildcard ),
|
||||
aStyle,
|
||||
aKeepWorkingDirectory );
|
||||
#endif
|
||||
|
||||
fullfilename = wxFileSelector( aTitle, defaultpath, defaultname,
|
||||
dotted_Ext, aWildcard,
|
||||
aStyle, // open mode wxFD_OPEN, wxFD_SAVE ..
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2015-2020 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -165,8 +165,6 @@ void KICAD_CURL::Init()
|
||||
|
||||
init_locks();
|
||||
|
||||
//wxLogDebug( "Using %s", GetVersion() );
|
||||
|
||||
s_initialized = true;
|
||||
}
|
||||
}
|
||||
|
@ -116,10 +116,6 @@ void LIB_TREE_MODEL_ADAPTER::SaveColWidths()
|
||||
auto cfg = Kiface().KifaceSettings();
|
||||
cfg->m_LibTree.column_width = m_widget->GetColumn( PART_COL )->GetWidth();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug( "Error saving column size, tree view doesn't exist" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2014-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -63,8 +63,6 @@ LSET::LSET( unsigned aIdCount, int aFirst, ... ) :
|
||||
{
|
||||
PCB_LAYER_ID id = (PCB_LAYER_ID) va_arg( ap, int );
|
||||
|
||||
// printf( "%s: id:%d PCB_LAYER_ID_COUNT:%d\n", __func__, id, PCB_LAYER_ID_COUNT );
|
||||
|
||||
assert( unsigned( id ) < PCB_LAYER_ID_COUNT );
|
||||
|
||||
set( id );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user