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
|
@ -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,
|
||||
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,
|
||||
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
|
||||
|
@ -44,10 +46,10 @@ CACHED_CONTAINER_GPU::CACHED_CONTAINER_GPU( unsigned int aSize ) :
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -262,12 +262,6 @@ void PROJECT::SetElem( ELEM_T aIndex, _ELEM* aElem )
|
|||
|
||||
if( unsigned( aIndex ) < arrayDim( m_elems ) )
|
||||
{
|
||||
#if defined(DEBUG) && 0
|
||||
if( aIndex == ELEM_SCH_PART_LIBS )
|
||||
{
|
||||
printf( "%s: &m_elems[%i]:%p aElem:%p\n", __func__, aIndex, &m_elems[aIndex], aElem );
|
||||
}
|
||||
#endif
|
||||
delete m_elems[aIndex];
|
||||
m_elems[aIndex] = aElem;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2013 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2013-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
|
||||
|
@ -60,8 +60,6 @@ inline void scanList( PTREE* aTree, DSNLEXER* aLexer )
|
|||
|
||||
const char* key = aLexer->CurText();
|
||||
|
||||
//D(printf( "%s: '%s'\n", __func__, key );)
|
||||
|
||||
PTREE* list = &aTree->push_back( PTREE::value_type( key, PTREE() ) )->second;
|
||||
|
||||
if( tok != DSN_RIGHT )
|
||||
|
@ -81,8 +79,6 @@ inline void scanAtom( PTREE* aTree, DSNLEXER* aLexer )
|
|||
{
|
||||
const char* key = aLexer->CurText();
|
||||
|
||||
//D(printf( "%s: '%s'\n", __func__, key );)
|
||||
|
||||
aTree->push_back( PTREE::value_type( key, PTREE() ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013-2019 CERN
|
||||
* Copyright (C) 2013-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2013-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
|
@ -267,9 +267,8 @@ void ACTION_MENU::UpdateAll()
|
|||
{
|
||||
update();
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
wxLogDebug( wxString::Format( "ACTION_MENU update handler exception: %s", e.what() ) );
|
||||
}
|
||||
|
||||
if( m_tool )
|
||||
|
@ -560,9 +559,8 @@ void ACTION_MENU::runOnSubmenus( std::function<void(ACTION_MENU*)> aFunction )
|
|||
m->runOnSubmenus( aFunction );
|
||||
} );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
wxLogDebug( wxString::Format( "ACTION_MENU runOnSubmenus exception: %s", e.what() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,9 +80,8 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_cancelHandler)();
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PICKER_TOOL cancel handler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,9 +107,8 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
getNext = (*m_clickHandler)( *m_picked );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PICKER_TOOL click handler error: " << e.what() << std::endl;
|
||||
finalize_state = EXCEPTION_CANCEL;
|
||||
break;
|
||||
}
|
||||
|
@ -133,9 +131,8 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_motionHandler)( cursorPos );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PICKER_TOOL motion handler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,9 +157,8 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_finalizeHandler)( finalize_state );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PICKER_TOOL finalize handler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,10 +169,6 @@ void mpInfoLayer::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
if( (m_winX != scrx) || (m_winY != scry) )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "mpInfoLayer::Plot() screen size has changed from %d x %d to %d x %d", m_winX, m_winY, scrx, scry);
|
||||
#endif
|
||||
|
||||
if( m_winX > 1 )
|
||||
m_dim.x = (int) floor( (double) (m_dim.x * scrx / m_winX) );
|
||||
|
||||
|
@ -250,10 +246,6 @@ void mpInfoCoords::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
if( (m_winX != scrx) || (m_winY != scry) )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "mpInfoLayer::Plot() screen size has changed from %d x %d to %d x %d", m_winX, m_winY, scrx, scry);
|
||||
#endif
|
||||
|
||||
if( m_winX > 1 )
|
||||
m_dim.x = (int) floor( (double) (m_dim.x * scrx / m_winX) );
|
||||
|
||||
|
@ -319,10 +311,6 @@ void mpInfoLegend::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
if( (m_winX != scrx) || (m_winY != scry) )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "mpInfoLayer::Plot() screen size has changed from %d x %d to %d x %d", m_winX, m_winY, scrx, scry);
|
||||
#endif
|
||||
|
||||
if( m_winX > 1 )
|
||||
m_dim.x = (int) floor( (double) (m_dim.x * scrx / m_winX) );
|
||||
|
||||
|
@ -362,9 +350,6 @@ void mpInfoLegend::Plot( wxDC& dc, mpWindow& w )
|
|||
textX =
|
||||
( textX > (tmpX + baseWidth) ) ? textX : (tmpX + baseWidth + mpLEGEND_MARGIN);
|
||||
textY += (tmpY);
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "mpInfoLegend::Plot() Adding layer %d: %s", p, label.c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -872,8 +857,6 @@ void mpScaleX::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
|
||||
m_absVisibleMaxV = std::max( std::abs( minVvis ), std::abs( maxVvis ) );
|
||||
|
||||
// printf("minV %.10f maxV %.10f %.10f %.10f\n", minV, maxV, minVvis, maxVvis);
|
||||
|
||||
m_tickValues.clear();
|
||||
m_tickLabels.clear();
|
||||
|
||||
|
@ -884,9 +867,6 @@ void mpScaleX::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
{
|
||||
double curr_step = fabs( maxVvis - minVvis ) / (double) i;
|
||||
double base = pow( 10, floor( log10( curr_step ) ) );
|
||||
|
||||
// printf("base %.3f\n", base);
|
||||
|
||||
double stepInt = floor( curr_step / base ) * base;
|
||||
double err = fabs( curr_step - stepInt );
|
||||
|
||||
|
@ -895,15 +875,12 @@ void mpScaleX::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
minErr = err;
|
||||
bestStep = stepInt;
|
||||
}
|
||||
|
||||
// printf("curr_step %d %.3f %.3f best %.3f\n",i, curr_step, stepInt, bestStep);
|
||||
}
|
||||
|
||||
|
||||
double v = floor( minVvis / bestStep ) * bestStep;
|
||||
|
||||
double zeroOffset = 100000000.0;
|
||||
// printf("maxVVis %.3f\n", maxVvis);
|
||||
|
||||
while( v < maxVvis )
|
||||
{
|
||||
|
@ -912,7 +889,6 @@ void mpScaleX::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
if( fabs( v ) < zeroOffset )
|
||||
zeroOffset = fabs( v );
|
||||
|
||||
// printf("tick %.3f\n", v);
|
||||
v += bestStep;
|
||||
}
|
||||
|
||||
|
@ -967,7 +943,6 @@ int mpScaleBase::getLabelDecimalDigits( int maxDigits )
|
|||
|
||||
void mpScaleBase::computeLabelExtents( wxDC& dc, mpWindow& w )
|
||||
{
|
||||
// printf("test: %d %d %d\n", countDecimalDigits(1.0), countDecimalDigits(1.1), countDecimalDigits(1.22231));
|
||||
m_maxLabelHeight = 0;
|
||||
m_maxLabelWidth = 0;
|
||||
|
||||
|
@ -1067,8 +1042,6 @@ void mpScaleY::getVisibleDataRange( mpWindow& w, double& minV, double& maxV )
|
|||
double pymin = w.p2y( minYpx );
|
||||
double pymax = w.p2y( maxYpx );
|
||||
|
||||
// printf("PYmin %.3f PYmax %.3f\n", pymin, pymax);
|
||||
|
||||
minV = TransformFromPlot( pymax );
|
||||
maxV = TransformFromPlot( pymin );
|
||||
}
|
||||
|
@ -1082,7 +1055,6 @@ void mpScaleY::computeSlaveTicks( mpWindow& w )
|
|||
m_tickValues.clear();
|
||||
m_tickLabels.clear();
|
||||
|
||||
// printf("NTicks %d\n", m_masterScale->m_tickValues.size());
|
||||
double p0 = m_masterScale->TransformToPlot( m_masterScale->m_tickValues[0] );
|
||||
double p1 = m_masterScale->TransformToPlot( m_masterScale->m_tickValues[1] );
|
||||
|
||||
|
@ -1127,8 +1099,6 @@ void mpScaleY::computeSlaveTicks( mpWindow& w )
|
|||
|
||||
void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
||||
{
|
||||
// printf("this %p master %p\n", this, m_masterScale);
|
||||
|
||||
if( m_masterScale )
|
||||
{
|
||||
computeSlaveTicks( w );
|
||||
|
@ -1140,15 +1110,11 @@ void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
double minV, maxV, minVvis, maxVvis;
|
||||
GetDataRange( minV, maxV );
|
||||
getVisibleDataRange( w, minVvis, maxVvis );
|
||||
// printf("vdr %.10f %.10f\n", minVvis, maxVvis);
|
||||
|
||||
m_absVisibleMaxV = std::max( std::abs( minVvis ), std::abs( maxVvis ) );
|
||||
|
||||
|
||||
m_tickValues.clear();
|
||||
m_tickLabels.clear();
|
||||
|
||||
|
||||
double minErr = 1000000000000.0;
|
||||
double bestStep = 1.0;
|
||||
|
||||
|
@ -1156,9 +1122,6 @@ void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
{
|
||||
double curr_step = fabs( maxVvis - minVvis ) / (double) i;
|
||||
double base = pow( 10, floor( log10( curr_step ) ) );
|
||||
|
||||
// printf("base %.3f\n", base);
|
||||
|
||||
double stepInt = floor( curr_step / base ) * base;
|
||||
double err = fabs( curr_step - stepInt );
|
||||
|
||||
|
@ -1167,15 +1130,12 @@ void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
minErr = err;
|
||||
bestStep = stepInt;
|
||||
}
|
||||
|
||||
// printf("curr_step %d %.3f %.3f best %.3f\n",i, curr_step, stepInt, bestStep);
|
||||
}
|
||||
|
||||
|
||||
double v = floor( minVvis / bestStep ) * bestStep;
|
||||
|
||||
double zeroOffset = 100000000.0;
|
||||
// printf("v %.3f maxVVis %.3f\n", v, maxVvis);
|
||||
|
||||
const int iterLimit = 1000;
|
||||
int i = 0;
|
||||
|
@ -1187,7 +1147,6 @@ void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
if( fabs( v ) < zeroOffset )
|
||||
zeroOffset = fabs( v );
|
||||
|
||||
// printf("tick %.3f %d\n", v, m_tickValues.size());
|
||||
v += bestStep;
|
||||
i++;
|
||||
}
|
||||
|
@ -1213,7 +1172,6 @@ void mpScaleY::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
// end = n0 +
|
||||
|
||||
// n0 = floor( (w.GetPosX() ) / step ) * step ;
|
||||
// printf("zeroOffset:%.3f tickjs : %d\n", zeroOffset, m_tickValues.size());
|
||||
updateTickLabels( dc, w );
|
||||
|
||||
// labelStep = ceil(((double) m_maxLabelWidth + mpMIN_X_AXIS_LABEL_SEPARATION)/(w.GetScaleX()*step))*step;
|
||||
|
@ -1224,9 +1182,6 @@ void mpScaleXBase::getVisibleDataRange( mpWindow& w, double& minV, double& maxV
|
|||
{
|
||||
wxCoord startPx = m_drawOutsideMargins ? 0 : w.GetMarginLeft();
|
||||
wxCoord endPx = m_drawOutsideMargins ? w.GetScrX() : w.GetScrX() - w.GetMarginRight();
|
||||
|
||||
// printf("getVisibleDataRange\n");
|
||||
|
||||
double pxmin = w.p2x( startPx );
|
||||
double pxmax = w.p2x( endPx );
|
||||
|
||||
|
@ -1245,9 +1200,6 @@ void mpScaleXLog::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
// double decades = log( maxV / minV ) / log(10);
|
||||
double minDecade = pow( 10, floor( log10( minV ) ) );
|
||||
double maxDecade = pow( 10, ceil( log10( maxV ) ) );
|
||||
// printf("test: %d %d %d\n", countDecimalDigits(1.0), countDecimalDigits(1.1), countDecimalDigits(1.22231));
|
||||
|
||||
|
||||
double visibleDecades = log( maxVvis / minVvis ) / log( 10 );
|
||||
|
||||
double d;
|
||||
|
@ -1261,7 +1213,6 @@ void mpScaleXLog::recalculateTicks( wxDC& dc, mpWindow& w )
|
|||
|
||||
for( d = minDecade; d<=maxDecade; d *= 10.0 )
|
||||
{
|
||||
// printf("d %.1f\n",d );
|
||||
m_tickLabels.emplace_back( d );
|
||||
|
||||
for( double dd = d; dd < d * 10; dd += d )
|
||||
|
@ -1354,13 +1305,10 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
wxCoord minYpx = m_drawOutsideMargins ? 0 : w.GetMarginTop();
|
||||
wxCoord maxYpx = m_drawOutsideMargins ? w.GetScrY() : w.GetScrY() - w.GetMarginBottom();
|
||||
|
||||
// printf("StartPx %d endPx %d ordy %d maxy %d\n", startPx, endPx, orgy, maxYpx);
|
||||
|
||||
// int tmp=-65535;
|
||||
int labelH = m_maxLabelHeight; // Control labels heigth to decide where to put axis name (below labels or on top of axis)
|
||||
|
||||
// int maxExtent = tc.MaxLabelWidth();
|
||||
// printf("Ticks : %d\n",labelCount());
|
||||
for( int n = 0; n < tickCount(); n++ )
|
||||
{
|
||||
double tp = getTickPos( n );
|
||||
|
@ -1372,10 +1320,6 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
const int p = (int) ( ( px - w.GetPosX() ) * w.GetScaleX() );
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( wxT( "mpScaleX::Plot: n: %f -> p = %d" ), n, p );
|
||||
#endif
|
||||
|
||||
if( (p >= startPx) && (p <= endPx) )
|
||||
{
|
||||
if( m_ticks ) // draw axis ticks
|
||||
|
@ -1392,7 +1336,6 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
if( (m_flags == mpALIGN_BOTTOM) && !m_drawOutsideMargins )
|
||||
{
|
||||
// printf("d1");
|
||||
m_pen.SetStyle( wxPENSTYLE_DOT );
|
||||
dc.SetPen( m_pen );
|
||||
dc.DrawLine( p, orgy + 4, p, minYpx );
|
||||
|
@ -1404,12 +1347,10 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
{
|
||||
if( (m_flags == mpALIGN_TOP) && !m_drawOutsideMargins )
|
||||
{
|
||||
// printf("d2");
|
||||
dc.DrawLine( p, orgy - 4, p, maxYpx );
|
||||
}
|
||||
else
|
||||
{
|
||||
// printf("d3");
|
||||
dc.DrawLine( p, minYpx, p, maxYpx ); // 0/*-w.GetScrY()*/, p, w.GetScrY() );
|
||||
}
|
||||
}
|
||||
|
@ -1425,8 +1366,8 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
dc.DrawLine( startPx, minYpx, endPx, minYpx );
|
||||
dc.DrawLine( startPx, maxYpx, endPx, maxYpx );
|
||||
|
||||
// printf("Labels : %d\n",labelCount());
|
||||
// Actually draw labels, taking care of not overlapping them, and distributing them regularly
|
||||
// Actually draw labels, taking care of not overlapping them, and distributing them
|
||||
// regularly
|
||||
for( int n = 0; n < labelCount(); n++ )
|
||||
{
|
||||
double tp = getLabelPos( n );
|
||||
|
@ -1441,11 +1382,6 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w )
|
|||
|
||||
const int p = (int) ( ( px - w.GetPosX() ) * w.GetScaleX() );
|
||||
|
||||
// printf("p %d %.1f\n", p, px);
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( wxT( "mpScaleX::Plot: n_label = %f -> p_label = %d" ), n, p );
|
||||
#endif
|
||||
|
||||
if( (p >= startPx) && (p <= endPx) )
|
||||
{
|
||||
// Write ticks labels in s string
|
||||
|
@ -1527,7 +1463,6 @@ void mpScaleY::Plot( wxDC& dc, mpWindow& w )
|
|||
m_offset = -m_minV;
|
||||
m_scale = 1.0 / ( m_maxV - m_minV );
|
||||
|
||||
// printf("Plot Y-scale\n");
|
||||
recalculateTicks( dc, w );
|
||||
|
||||
if( m_visible )
|
||||
|
@ -1582,11 +1517,8 @@ void mpScaleY::Plot( wxDC& dc, mpWindow& w )
|
|||
s.Printf( fmt, n );
|
||||
dc.GetTextExtent( s, &tx, &labelHeigth );
|
||||
|
||||
// printf("Y-ticks: %d\n", tickCount());
|
||||
for( n = 0; n < tickCount(); n++ )
|
||||
{
|
||||
// printf("Tick %d\n", n);
|
||||
|
||||
double tp = getTickPos( n );
|
||||
|
||||
double py = TransformToPlot( tp ); // ( log10 ( tp ) - xlogmin) / (xlogmax - xlogmin);
|
||||
|
@ -1623,11 +1555,8 @@ void mpScaleY::Plot( wxDC& dc, mpWindow& w )
|
|||
}
|
||||
}
|
||||
|
||||
// printf("Y-ticks: %d\n", tickCount());
|
||||
for( n = 0; n < labelCount(); n++ )
|
||||
{
|
||||
// printf("Tick %d\n", n);
|
||||
|
||||
double tp = getLabelPos( n );
|
||||
|
||||
double py = TransformToPlot( tp ); // ( log10 ( tp ) - xlogmin) / (xlogmax - xlogmin);
|
||||
|
@ -1906,14 +1835,6 @@ void mpWindow::OnMouseMove( wxMouseEvent& event )
|
|||
|
||||
if( updateRequired )
|
||||
UpdateAll();
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "[mpWindow::OnMouseMove] Ax:%i Ay:%i m_posX:%f m_posY:%f",
|
||||
Ax,
|
||||
Ay,
|
||||
m_posX,
|
||||
m_posY );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1980,20 +1901,9 @@ void mpWindow::OnMouseLeftDown( wxMouseEvent& event )
|
|||
m_mouseLClick.x = event.GetX();
|
||||
m_mouseLClick.y = event.GetY();
|
||||
m_zooming = true;
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::OnMouseLeftDown() X = %d , Y = %d", event.GetX(), event.GetY() ); /*m_mouseLClick.x, m_mouseLClick.y);*/
|
||||
#endif
|
||||
wxPoint pointClicked = event.GetPosition();
|
||||
m_movingInfoLayer = IsInsideInfoLayer( pointClicked );
|
||||
|
||||
if( m_movingInfoLayer != NULL )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::OnMouseLeftDown() started moving layer %lx",
|
||||
(long int) m_movingInfoLayer ); /*m_mouseLClick.x, m_mouseLClick.y);*/
|
||||
#endif
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
@ -2074,10 +1984,8 @@ void mpWindow::Fit( double xMin, double xMax, double yMin, double yMax,
|
|||
|
||||
if( m_lockaspect )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::Fit()(lock) m_scaleX=%f,m_scaleY=%f", m_scaleX, m_scaleY );
|
||||
#endif
|
||||
// Keep the lowest "scale" to fit the whole range required by that axis (to actually "fit"!):
|
||||
// Keep the lowest "scale" to fit the whole range required by that axis (to actually
|
||||
// "fit"!):
|
||||
double s = m_scaleX < m_scaleY ? m_scaleX : m_scaleY;
|
||||
m_scaleX = s;
|
||||
m_scaleY = s;
|
||||
|
@ -2093,24 +2001,6 @@ void mpWindow::Fit( double xMin, double xMax, double yMin, double yMax,
|
|||
m_posY = (yMin + yMax) / 2 + ( (m_scrY - m_marginTop - m_marginBottom) / 2 + m_marginTop ) /
|
||||
m_scaleY; // m_posY = (yMin+yMax)/2 + (m_scrY/2)/m_scaleY;
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::Fit() m_desiredXmin=%f m_desiredXmax=%f m_desiredYmin=%f m_desiredYmax=%f",
|
||||
xMin,
|
||||
xMax,
|
||||
yMin,
|
||||
yMax );
|
||||
wxLogMessage(
|
||||
"mpWindow::Fit() m_scaleX = %f , m_scrX = %d,m_scrY=%d, Ax=%f, Ay=%f, m_posX=%f, m_posY=%f",
|
||||
m_scaleX,
|
||||
m_scrX,
|
||||
m_scrY,
|
||||
Ax,
|
||||
Ay,
|
||||
m_posX,
|
||||
m_posY );
|
||||
#endif
|
||||
|
||||
// It is VERY IMPORTANT to DO NOT call Refresh if we are drawing to the printer!!
|
||||
// Otherwise, the DC dimensions will be those of the window instead of the printer device
|
||||
if( printSizeX==NULL || printSizeY==NULL )
|
||||
|
@ -2131,11 +2021,6 @@ void mpWindow::DoZoomInXCalc( const int staticXpixel )
|
|||
// Adjust desired
|
||||
m_desiredXmin = m_posX;
|
||||
m_desiredXmax = m_posX + ( m_scrX - (m_marginLeft + m_marginRight) ) / m_scaleX;
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::DoZoomInXCalc() prior X coord: (%f), new X coord: (%f) SHOULD BE EQUAL!!",
|
||||
staticX, p2x( staticXpixel ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -2151,11 +2036,6 @@ void mpWindow::DoZoomInYCalc( const int staticYpixel )
|
|||
// Adjust desired
|
||||
m_desiredYmax = m_posY;
|
||||
m_desiredYmin = m_posY - ( m_scrY - (m_marginTop + m_marginBottom) ) / m_scaleY;
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::DoZoomInYCalc() prior Y coord: (%f), new Y coord: (%f) SHOULD BE EQUAL!!",
|
||||
staticY, p2y( staticYpixel ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -2171,11 +2051,6 @@ void mpWindow::DoZoomOutXCalc( const int staticXpixel )
|
|||
// Adjust desired
|
||||
m_desiredXmin = m_posX;
|
||||
m_desiredXmax = m_posX + ( m_scrX - (m_marginLeft + m_marginRight) ) / m_scaleX;
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::DoZoomOutXCalc() prior X coord: (%f), new X coord: (%f) SHOULD BE EQUAL!!",
|
||||
staticX, p2x( staticXpixel ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -2191,11 +2066,6 @@ void mpWindow::DoZoomOutYCalc( const int staticYpixel )
|
|||
// Adjust desired
|
||||
m_desiredYmax = m_posY;
|
||||
m_desiredYmin = m_posY - ( m_scrY - (m_marginTop + m_marginBottom) ) / m_scaleY;
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::DoZoomOutYCalc() prior Y coord: (%f), new Y coord: (%f) SHOULD BE EQUAL!!",
|
||||
staticY, p2y( staticYpixel ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -2326,12 +2196,6 @@ void mpWindow::ZoomIn( const wxPoint& centerPoint, double zoomFactor )
|
|||
m_desiredYmax = m_posY;
|
||||
m_desiredYmin = m_posY - (m_scrY - m_marginTop - m_marginBottom) / m_scaleY; // m_desiredYmin = m_posY - m_scrY / m_scaleY;
|
||||
AdjustLimitedView();
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::ZoomIn() prior coords: (%f,%f), new coords: (%f,%f) SHOULD BE EQUAL!!",
|
||||
prior_layer_x, prior_layer_y, p2x( c.x ), p2y( c.y ) );
|
||||
#endif
|
||||
|
||||
UpdateAll();
|
||||
}
|
||||
|
||||
|
@ -2370,21 +2234,12 @@ void mpWindow::ZoomOut( const wxPoint& centerPoint, double zoomFactor )
|
|||
m_desiredYmax = m_posY;
|
||||
m_desiredYmin = m_posY - (m_scrY - m_marginTop - m_marginBottom) / m_scaleY; // m_desiredYmin = m_posY - m_scrY / m_scaleY;
|
||||
|
||||
// printf("desired xmin %.1f ymin %.1f xmax %.1f ymax %.1f l %d\n", m_desiredXmin, m_desiredYmin, m_desiredXmax, m_desiredYmax, !!m_enableLimitedView);
|
||||
// printf("current xmin %.1f ymin %.1f xmax %.1f ymax %.1f\n", m_minX, m_minY, m_maxX, m_maxY);
|
||||
|
||||
if( !CheckXLimits( m_desiredXmax,
|
||||
m_desiredXmin ) || !CheckYLimits( m_desiredYmax, m_desiredYmin ) )
|
||||
{
|
||||
// printf("call fit()\n");
|
||||
Fit();
|
||||
}
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage(
|
||||
"mpWindow::ZoomOut() prior coords: (%f,%f), new coords: (%f,%f) SHOULD BE EQUAL!!",
|
||||
prior_layer_x, prior_layer_y, p2x( c.x ), p2y( c.y ) );
|
||||
#endif
|
||||
UpdateAll();
|
||||
}
|
||||
|
||||
|
@ -2431,10 +2286,6 @@ void mpWindow::ZoomRect( wxPoint p0, wxPoint p1 )
|
|||
double zoom_y_min = p0y<p1y ? p0y : p1y;
|
||||
double zoom_y_max = p0y>p1y ? p0y : p1y;
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "Zoom: (%f,%f)-(%f,%f)", zoom_x_min, zoom_y_min, zoom_x_max, zoom_y_max );
|
||||
#endif
|
||||
|
||||
Fit( zoom_x_min, zoom_x_max, zoom_y_min, zoom_y_max );
|
||||
AdjustLimitedView();
|
||||
}
|
||||
|
@ -2496,9 +2347,6 @@ void mpWindow::OnSize( wxSizeEvent& WXUNUSED( event ) )
|
|||
{
|
||||
// Try to fit again with the new window size:
|
||||
Fit( m_desiredXmin, m_desiredXmax, m_desiredYmin, m_desiredYmax );
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::OnSize() m_scrX = %d, m_scrY = %d", m_scrX, m_scrY );
|
||||
#endif // MATHPLOT_DO_LOGGING
|
||||
}
|
||||
|
||||
|
||||
|
@ -2568,10 +2416,6 @@ void mpWindow::OnPaint( wxPaintEvent& WXUNUSED( event ) )
|
|||
|
||||
dc.GetSize( &m_scrX, &m_scrY ); // This is the size of the visible area only!
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "[mpWindow::OnPaint] vis.area: x %i y%i", m_scrX, m_scrY );
|
||||
#endif
|
||||
|
||||
// Selects direct or buffered draw:
|
||||
wxDC* trgDc;
|
||||
|
||||
|
@ -2654,9 +2498,6 @@ void mpWindow::OnPaint( wxPaintEvent& WXUNUSED( event ) )
|
|||
|
||||
// void mpWindow::OnScroll2(wxScrollWinEvent &event)
|
||||
// {
|
||||
// #ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "[mpWindow::OnScroll2] Init: m_posX=%f m_posY=%f, sc_pos = %d",m_posX,m_posY, event.GetPosition());
|
||||
// #endif
|
||||
//// If scrollbars are not enabled, Skip operation
|
||||
// if (!m_enableScrollBars) {
|
||||
// event.Skip();
|
||||
|
@ -2691,11 +2532,6 @@ void mpWindow::OnPaint( wxPaintEvent& WXUNUSED( event ) )
|
|||
//// //m_posY = m_maxY - (double)py / GetScaleY() - (double)(height>>1)/GetScaleY();
|
||||
//// // m_posY = p2y(py);//m_maxY - (double)(py /*+ (m_scrY)*/)/GetScaleY();
|
||||
//// }*/
|
||||
// #ifdef MATHPLOT_DO_LOGGING
|
||||
// int px, py;
|
||||
// GetViewStart( &px, &py);
|
||||
// wxLogMessage( "[mpWindow::OnScroll2] End: m_posX = %f, m_posY = %f, px = %f, py = %f",m_posX, m_posY, px, py);
|
||||
// #endif
|
||||
//
|
||||
// UpdateAll();
|
||||
//// event.Skip();
|
||||
|
@ -2727,9 +2563,6 @@ void mpWindow::SetMPScrollbars( bool status )
|
|||
// m_scroll.y = (int) floor((m_maxY - m_posY /*- m_minY*/)*m_scaleY);
|
||||
// int scrollWidth = (int) floor(((m_maxX - m_minX) - (m_desiredXmax - m_desiredXmin))*m_scaleX);
|
||||
// int scrollHeight = (int) floor(((m_maxY - m_minY) - (m_desiredYmax - m_desiredYmin))*m_scaleY);
|
||||
// #ifdef MATHPLOT_DO_LOGGING
|
||||
// wxLogMessage( "mpWindow::SetMPScrollbars() scrollWidth = %d, scrollHeight = %d", scrollWidth, scrollHeight);
|
||||
// #endif
|
||||
// if(status) {
|
||||
// SetScrollbars(1,
|
||||
// 1,
|
||||
|
@ -2785,12 +2618,6 @@ bool mpWindow::UpdateBBox()
|
|||
// node = node->GetNext();
|
||||
}
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogDebug( wxT(
|
||||
"[mpWindow::UpdateBBox] Bounding box: Xmin = %f, Xmax = %f, Ymin = %f, YMax = %f" ), m_minX, m_maxX, m_minY,
|
||||
m_maxY );
|
||||
#endif // MATHPLOT_DO_LOGGING
|
||||
|
||||
return first == false;
|
||||
#endif
|
||||
}
|
||||
|
@ -2840,9 +2667,6 @@ bool mpWindow::UpdateBBox()
|
|||
*
|
||||
* SetScrollbars( 1, 1, sx, sy, px, py, true);
|
||||
*
|
||||
* #ifdef MATHPLOT_DO_LOGGING
|
||||
* wxLogMessage( "[mpWindow::UpdateAll] Size:%ix%i ScrollBars:%i,%i",sx,sy,px,py);
|
||||
* #endif
|
||||
* }
|
||||
*
|
||||
* FitInside();
|
||||
|
@ -3153,16 +2977,9 @@ mpInfoLayer* mpWindow::IsInsideInfoLayer( wxPoint& point )
|
|||
|
||||
for( li = m_layers.begin(); li != m_layers.end(); li++ )
|
||||
{
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::IsInsideInfoLayer() examinining layer = %p", (*li) );
|
||||
#endif // MATHPLOT_DO_LOGGING
|
||||
|
||||
if( (*li)->IsInfo() )
|
||||
{
|
||||
mpInfoLayer* tmpLyr = (mpInfoLayer*) (*li);
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "mpWindow::IsInsideInfoLayer() layer = %p", (*li) );
|
||||
#endif // MATHPLOT_DO_LOGGING
|
||||
|
||||
if( tmpLyr->Inside( point ) )
|
||||
{
|
||||
|
@ -3280,9 +3097,6 @@ void mpWindow::SetColourTheme( const wxColour& bgColour,
|
|||
* }
|
||||
* // Draw inside margins
|
||||
* double marginScaleX = ((double)(m_scrX - m_marginLeft - m_marginRight))/m_scrX;
|
||||
* #ifdef MATHPLOT_DO_LOGGING
|
||||
* wxLogMessage(wxT("x2p ScrX = %d, marginRight = %d, marginLeft = %d, marginScaleX = %f"), m_scrX, m_marginRight, m_marginLeft, marginScaleX);
|
||||
* #endif // MATHPLOT_DO_LOGGING
|
||||
* return (wxCoord) (int)(((x-m_posX) * m_scaleX)*marginScaleX) - m_marginLeft;
|
||||
* }
|
||||
*
|
||||
|
@ -3293,9 +3107,6 @@ void mpWindow::SetColourTheme( const wxColour& bgColour,
|
|||
* }
|
||||
* // Draw inside margins
|
||||
* double marginScaleY = ((double)(m_scrY - m_marginTop - m_marginBottom))/m_scrY;
|
||||
* #ifdef MATHPLOT_DO_LOGGING
|
||||
* wxLogMessage(wxT("y2p ScrY = %d, marginTop = %d, marginBottom = %d, marginScaleY = %f"), m_scrY, m_marginTop, m_marginBottom, marginScaleY);
|
||||
* #endif // MATHPLOT_DO_LOGGING
|
||||
* return (wxCoord) ((int)((m_posY-y) * m_scaleY)*marginScaleY) - m_marginTop;
|
||||
* }
|
||||
*/
|
||||
|
@ -3311,7 +3122,6 @@ IMPLEMENT_DYNAMIC_CLASS( mpFXYVector, mpFXY )
|
|||
mpFXYVector::mpFXYVector( const wxString& name, int flags ) : mpFXY( name, flags )
|
||||
{
|
||||
m_index = 0;
|
||||
// printf("FXYVector::FXYVector!\n");
|
||||
m_minX = -1;
|
||||
m_maxX = 1;
|
||||
m_minY = -1;
|
||||
|
@ -3409,17 +3219,12 @@ void mpFXYVector::SetData( const std::vector<double>& xs, const std::vector<doub
|
|||
{
|
||||
// Check if the data vectora are of the same size
|
||||
if( xs.size() != ys.size() )
|
||||
{
|
||||
wxLogError( "wxMathPlot error: X and Y vector are not of the same length!" );
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy the data:
|
||||
m_xs = xs;
|
||||
m_ys = ys;
|
||||
|
||||
// printf("FXYVector::setData %d %d\n", xs.size(), ys.size());
|
||||
|
||||
// Update internal variables for the bounding box.
|
||||
if( xs.size()>0 )
|
||||
{
|
||||
|
@ -3447,9 +3252,6 @@ void mpFXYVector::SetData( const std::vector<double>& xs, const std::vector<doub
|
|||
if( *it>m_maxY )
|
||||
m_maxY = *it;
|
||||
}
|
||||
|
||||
// printf("minX %.10f maxX %.10f\n ", m_minX, m_maxX );
|
||||
// printf("minY %.10f maxY %.10f\n ", m_minY, m_maxY );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3545,12 +3347,6 @@ bool mpPrintout::OnPrintPage( int page )
|
|||
m_prnY -= (2 * marginY);
|
||||
trgDc->SetDeviceOrigin( marginX, marginY );
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( wxT( "Print Size: %d x %d\n" ), m_prnX, m_prnY );
|
||||
wxLogMessage( wxT( "Screen Size: %d x %d\n" ), plotWindow->GetScrX(),
|
||||
plotWindow->GetScrY() );
|
||||
#endif
|
||||
|
||||
// Set the scale according to the page:
|
||||
plotWindow->Fit(
|
||||
plotWindow->GetDesiredXmin(),
|
||||
|
@ -3623,8 +3419,6 @@ void mpMovableObject::ShapeUpdated()
|
|||
// Just in case...
|
||||
if( m_shape_xs.size()!=m_shape_ys.size() )
|
||||
{
|
||||
wxLogError( wxT(
|
||||
"[mpMovableObject::ShapeUpdated] Error, m_shape_xs and m_shape_ys have different lengths!" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3776,21 +3570,15 @@ void mpCovarianceEllipse::RecalculateShape()
|
|||
m_shape_xs.clear();
|
||||
m_shape_ys.clear();
|
||||
|
||||
// Preliminar checks:
|
||||
// Preliminary checks:
|
||||
if( m_quantiles<0 )
|
||||
{
|
||||
wxLogError( wxT( "[mpCovarianceEllipse] Error: quantiles must be non-negative" ) ); return;
|
||||
}
|
||||
return;
|
||||
|
||||
if( m_cov_00<0 )
|
||||
{
|
||||
wxLogError( wxT( "[mpCovarianceEllipse] Error: cov(0,0) must be non-negative" ) ); return;
|
||||
}
|
||||
return;
|
||||
|
||||
if( m_cov_11<0 )
|
||||
{
|
||||
wxLogError( wxT( "[mpCovarianceEllipse] Error: cov(1,1) must be non-negative" ) ); return;
|
||||
}
|
||||
return;
|
||||
|
||||
m_shape_xs.resize( m_segments, 0 );
|
||||
m_shape_ys.resize( m_segments, 0 );
|
||||
|
@ -3803,9 +3591,7 @@ void mpCovarianceEllipse::RecalculateShape()
|
|||
double D = b * b - 4 * c;
|
||||
|
||||
if( D<0 )
|
||||
{
|
||||
wxLogError( wxT( "[mpCovarianceEllipse] Error: cov is not positive definite" ) ); return;
|
||||
}
|
||||
return;
|
||||
|
||||
double eigenVal0 = 0.5 * ( -b + sqrt( D ) );
|
||||
double eigenVal1 = 0.5 * ( -b - sqrt( D ) );
|
||||
|
@ -3887,12 +3673,7 @@ void mpPolygon::setPoints( const std::vector<double>& points_xs,
|
|||
const std::vector<double>& points_ys,
|
||||
bool closedShape )
|
||||
{
|
||||
if( points_xs.size()!=points_ys.size() )
|
||||
{
|
||||
wxLogError( wxT(
|
||||
"[mpPolygon] Error: points_xs and points_ys must have the same number of elements" ) );
|
||||
}
|
||||
else
|
||||
if( points_xs.size()==points_ys.size() )
|
||||
{
|
||||
m_shape_xs = points_xs;
|
||||
m_shape_ys = points_ys;
|
||||
|
@ -3920,11 +3701,7 @@ void mpBitmapLayer::GetBitmapCopy( wxImage& outBmp ) const
|
|||
|
||||
void mpBitmapLayer::SetBitmap( const wxImage& inBmp, double x, double y, double lx, double ly )
|
||||
{
|
||||
if( !inBmp.Ok() )
|
||||
{
|
||||
wxLogError( wxT( "[mpBitmapLayer] Assigned bitmap is not Ok()!" ) );
|
||||
}
|
||||
else
|
||||
if( inBmp.Ok() )
|
||||
{
|
||||
m_bitmap = inBmp; // .GetSubBitmap( wxRect(0, 0, inBmp.GetWidth(), inBmp.GetHeight()));
|
||||
m_min_x = x;
|
||||
|
@ -3999,19 +3776,6 @@ void mpBitmapLayer::Plot( wxDC& dc, mpWindow& w )
|
|||
wxCoord b_width = (wxCoord) ( (dx1 - dx0 + 1) / screenPixelX );
|
||||
wxCoord b_height = (wxCoord) ( (dy1 - dy0 + 1) / screenPixelY );
|
||||
|
||||
#ifdef MATHPLOT_DO_LOGGING
|
||||
wxLogMessage( "[mpBitmapLayer::Plot] screenPixel: x=%f y=%f d_width=%ix%i",
|
||||
screenPixelX,
|
||||
screenPixelY,
|
||||
d_width,
|
||||
d_height );
|
||||
wxLogMessage( "[mpBitmapLayer::Plot] offset: x=%i y=%i bmpWidth=%ix%i",
|
||||
offset_x,
|
||||
offset_y,
|
||||
b_width,
|
||||
b_height );
|
||||
#endif
|
||||
|
||||
// Is there any visible region?
|
||||
if( d_width>0 && d_height>0 )
|
||||
{
|
||||
|
@ -4101,7 +3865,6 @@ void mpFXY::SetScale( mpScaleBase* scaleX, mpScaleBase* scaleY )
|
|||
m_scaleX = scaleX;
|
||||
m_scaleY = scaleY;
|
||||
|
||||
// printf("SetScales : %p %p\n", scaleX, scaleY);
|
||||
UpdateScales();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 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
|
||||
|
@ -1078,8 +1078,6 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
{
|
||||
const std::string& payload = mail.GetPayload();
|
||||
|
||||
//DBG(printf( "%s: %s\n", __func__, payload.c_str() );)
|
||||
|
||||
switch( mail.Command() )
|
||||
{
|
||||
case MAIL_EESCHEMA_NETLIST:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jean-pierre.charras
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* 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
|
||||
|
@ -141,8 +141,6 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
|
|||
switch( guess )
|
||||
{
|
||||
case 0:
|
||||
DBG(printf("%s: guessed OK ref:%s fpid:%s\n", __func__,
|
||||
TO_UTF8( component->GetReference() ), component->GetFPID().Format().c_str() );)
|
||||
m_modified = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-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 as published by the
|
||||
|
@ -86,14 +86,10 @@ int CVPCB_ASSOCIATION_TOOL::CopyAssoc( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
if( !wxTheClipboard->SetData( new wxTextDataObject( fpid.GetUniStringLibId() ) ) )
|
||||
wxLogDebug( "Failed to copy data to clipboard" );
|
||||
|
||||
wxTheClipboard->SetData( new wxTextDataObject( fpid.GetUniStringLibId() ) );
|
||||
wxTheClipboard->Flush();
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
else
|
||||
wxLogDebug( "Failed to open the clipboard" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -126,7 +122,6 @@ int CVPCB_ASSOCIATION_TOOL::CutAssoc( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
if( !wxTheClipboard->SetData( new wxTextDataObject( fpid.GetUniStringLibId() ) ) )
|
||||
{
|
||||
wxLogDebug( "Failed to cut data to clipboard" );
|
||||
wxTheClipboard->Close();
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,7 +131,6 @@ int CVPCB_ASSOCIATION_TOOL::CutAssoc( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug( "Failed to open the clipboard" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -166,7 +160,6 @@ int CVPCB_ASSOCIATION_TOOL::PasteAssoc( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug( "Failed to open the clipboard" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -184,6 +177,7 @@ int CVPCB_ASSOCIATION_TOOL::PasteAssoc( const TOOL_EVENT& aEvent )
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_ASSOCIATION_TOOL::Reset( RESET_REASON aReason )
|
||||
{
|
||||
m_frame = getEditFrame<CVPCB_MAINFRAME>();
|
||||
|
|
|
@ -596,11 +596,4 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
|
|||
// of the HTML_MESSAGE_BOX.
|
||||
THROW_PARSE_ERROR( wxEmptyString, __func__, TO_UTF8( libs_not_found ), 0, 0 );
|
||||
}
|
||||
|
||||
#if defined(DEBUG) && 1
|
||||
printf( "%s: lib_names:\n", __func__ );
|
||||
|
||||
for( PART_LIBS::const_iterator it = begin(); it < end(); ++it )
|
||||
printf( " %s\n", TO_UTF8( it->GetName() ) );
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -489,9 +489,8 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
SCH_EDITOR_CONTROL* controlTool = m_toolManager->GetTool<SCH_EDITOR_CONTROL>();
|
||||
controlTool->BackAnnotateFootprints( payload );
|
||||
}
|
||||
catch( const IO_ERROR& DBG( ioe ) )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
DBG( printf( "%s: ioe:%s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -348,7 +348,6 @@ void DIALOG_BOM::installGeneratorsList()
|
|||
|
||||
for( const auto& path : pluginPaths )
|
||||
{
|
||||
wxLogDebug( wxString::Format( "Searching directory %s for BOM generators", path ) );
|
||||
wxDir dir( path );
|
||||
|
||||
if( !dir.IsOpened() )
|
||||
|
@ -362,7 +361,7 @@ void DIALOG_BOM::installGeneratorsList()
|
|||
{
|
||||
try
|
||||
{
|
||||
wxLogTrace( BOM_TRACE, wxString::Format( "Checking if %s is a BOM generator", fileName ) );
|
||||
wxLogTrace( BOM_TRACE,"Checking if %s is a BOM generator", fileName );
|
||||
|
||||
if( BOM_GENERATOR_HANDLER::IsValidGenerator( fileName ) )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015-2019 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
|
||||
|
@ -397,22 +397,6 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
|
|||
if( !wxPrintout::OnBeginDocument( startPage, endPage ) )
|
||||
return false;
|
||||
|
||||
#ifdef DEBUG
|
||||
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
|
||||
|
||||
wxLogDebug( wxT( "Printer name: " ) +
|
||||
m_parent->GetPageSetupData().GetPrintData().GetPrinterName() );
|
||||
wxLogDebug( wxT( "Paper ID: %d" ),
|
||||
m_parent->GetPageSetupData().GetPrintData().GetPaperId() );
|
||||
wxLogDebug( wxT( "Color: %d" ),
|
||||
(int)m_parent->GetPageSetupData().GetPrintData().GetColour() );
|
||||
wxLogDebug( wxT( "Monochrome: %d" ), cfg->m_Printing.monochrome );
|
||||
wxLogDebug( wxT( "Orientation: %d:" ),
|
||||
m_parent->GetPageSetupData().GetPrintData().GetOrientation() );
|
||||
wxLogDebug( wxT( "Quality: %d"),
|
||||
m_parent->GetPageSetupData().GetPrintData().GetQuality() );
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -446,9 +430,6 @@ void SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen )
|
|||
|
||||
fitRect = GetLogicalPaperRect();
|
||||
|
||||
wxLogDebug( wxT( "Fit rectangle: x = %d, y = %d, w = %d, h = %d" ),
|
||||
fitRect.x, fitRect.y, fitRect.width, fitRect.height );
|
||||
|
||||
// When is the actual paper size does not match the schematic page size, the drawing will
|
||||
// not be centered on X or Y axis. Give a draw offset to center the schematic page on the
|
||||
// paper draw area.
|
||||
|
|
|
@ -74,10 +74,9 @@ void PARAM_CFG_FIELDNAMES::ReadParam( wxConfigBase* aConfig ) const
|
|||
{
|
||||
m_Pt_param->Parse( &lexer, false );
|
||||
}
|
||||
catch( const IO_ERROR& DBG( e ) )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
// @todo show error msg
|
||||
DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -391,10 +390,8 @@ void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
|||
{
|
||||
m_templateFieldNames.Parse( &lexer, true );
|
||||
}
|
||||
catch( const IO_ERROR& DBG( e ) )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
// @todo show error msg
|
||||
DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -344,13 +344,7 @@ const EDA_RECT LIB_ARC::GetBoundingBox() const
|
|||
wxPoint normEnd = m_ArcEnd - m_Pos;
|
||||
|
||||
if( ( normStart == nullPoint ) || ( normEnd == nullPoint ) || ( m_Radius == 0 ) )
|
||||
{
|
||||
wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d), start(%d, %d), "
|
||||
"end(%d, %d), radius %d" ),
|
||||
m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
|
||||
m_ArcEnd.y, m_Radius );
|
||||
return rect;
|
||||
}
|
||||
|
||||
endPos = DefaultTransform.TransformCoordinate( m_ArcEnd );
|
||||
startPos = DefaultTransform.TransformCoordinate( m_ArcStart );
|
||||
|
|
|
@ -1309,7 +1309,6 @@ void LIB_PIN::CalcEdit( const wxPoint& aPosition )
|
|||
{
|
||||
if( IsMoving() )
|
||||
{
|
||||
DBG(printf("MOVEPIN\n");)
|
||||
MoveTo( aPosition );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,9 +114,8 @@ SEARCH_STACK* PROJECT::SchSearchS()
|
|||
{
|
||||
PART_LIBS::LibNamesAndPaths( this, false, &libDir );
|
||||
}
|
||||
catch( const IO_ERROR& DBG( ioe ) )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
DBG(printf( "%s: %s\n", __func__, TO_UTF8( ioe.What() ) );)
|
||||
}
|
||||
|
||||
if( !!libDir )
|
||||
|
|
|
@ -301,9 +301,6 @@ void SCH_SHEET::RemovePin( SCH_SHEET_PIN* aSheetPin )
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
|
||||
aSheetPin->GetShownText(), m_fields[ SHEETNAME ].GetText() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1017,8 +1014,6 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter )
|
|||
|
||||
SCH_SHEET& SCH_SHEET::operator=( const SCH_ITEM& aItem )
|
||||
{
|
||||
wxLogDebug( wxT( "Sheet assignment operator." ) );
|
||||
|
||||
wxCHECK_MSG( Type() == aItem.Type(), *this,
|
||||
wxT( "Cannot assign object type " ) + aItem.GetClass() + wxT( " to type " ) +
|
||||
GetClass() );
|
||||
|
|
|
@ -59,12 +59,6 @@ void SCH_EDITOR_CONTROL::BackAnnotateFootprints( const std::string& aChangedSetO
|
|||
{
|
||||
Scan( &doc, &lexer );
|
||||
|
||||
#if defined(DEBUG) && 0
|
||||
STRING_FORMATTER sf;
|
||||
Format( &sf, 0, 0, doc );
|
||||
printf( "%s: '%s'\n", __func__, sf.GetString().c_str() );
|
||||
#endif
|
||||
|
||||
CPTREE& back_anno = doc.get_child( "back_annotation" );
|
||||
wxString footprint;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Copyright (C) 1992-2017 Jean-Pierre Charras <jp.charras at wanadoo.fr>
|
||||
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* 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
|
||||
|
@ -31,6 +31,9 @@
|
|||
#include <am_primitive.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <wx/debug.h>
|
||||
|
||||
|
||||
extern int ReadInt( char*& text, bool aSkipSeparator = true );
|
||||
extern double ReadDouble( char*& text, bool aSkipSeparator = true );
|
||||
extern double Evaluate( AM_PARAM_EVAL_STACK& aExp );
|
||||
|
@ -116,7 +119,7 @@ double AM_PARAM::GetValue( const D_CODE* aDcode ) const
|
|||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug( wxT( "AM_PARAM::GetValue(): NULL param aDcode\n" ) );
|
||||
wxFAIL_MSG( "AM_PARAM::GetValue(): NULL param aDcode" );
|
||||
}
|
||||
|
||||
ops.push_back( AM_PARAM_EVAL( curr_value ) );
|
||||
|
@ -128,8 +131,10 @@ double AM_PARAM::GetValue( const D_CODE* aDcode ) const
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( "AM_PARAM::GetValue(): dcode %d prm %d/%d: unexpected type %d",
|
||||
aDcode ? aDcode->m_Num_Dcode : -1, ii, m_paramStack.size(), item.GetType() );
|
||||
wxFAIL_MSG( wxString::Format( "AM_PARAM::GetValue(): dcode %d prm %d/%d: "
|
||||
"unexpected type %d",
|
||||
aDcode ? aDcode->m_Num_Dcode : -1, ii,
|
||||
m_paramStack.size(), item.GetType() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -433,7 +433,6 @@ void AM_PRIMITIVE::DrawBasicShape( const GERBER_DRAW_ITEM* aParent,
|
|||
|
||||
case AMP_UNKNOWN:
|
||||
default:
|
||||
DBG( printf( "AM_PRIMITIVE::DrawBasicShape() err: unknown prim id %d\n",primitive_id) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,7 +260,6 @@ bool GERBVIEW_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
|
||||
if( !wxFileExists( path ) && wxDirExists( path ) )
|
||||
{
|
||||
wxLogDebug( wxT( "MRU path: %s." ), GetChars( path ) );
|
||||
m_mruPath = path;
|
||||
return true;
|
||||
}
|
||||
|
@ -455,7 +454,8 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "GERBVIEW_FRAME::SetElementVisibility(): bad arg %d" ), aLayerID );
|
||||
wxFAIL_MSG( wxString::Format( "GERBVIEW_FRAME::SetElementVisibility(): bad arg %d",
|
||||
aLayerID ) );
|
||||
}
|
||||
|
||||
if( dcodes_changed )
|
||||
|
@ -759,7 +759,7 @@ bool GERBVIEW_FRAME::IsElementVisible( int aLayerID ) const
|
|||
case LAYER_GERBVIEW_BACKGROUND: return true;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "GERBVIEW_FRAME::IsElementVisible(): bad arg %d" ), aLayerID );
|
||||
wxFAIL_MSG( wxString::Format( "GERBVIEW_FRAME::IsElementVisible(): bad arg %d", aLayerID ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -821,7 +821,8 @@ COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( int aLayerID )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "GERBVIEW_FRAME::GetVisibleElementColor(): bad arg %d" ), aLayerID );
|
||||
wxFAIL_MSG( wxString::Format( "GERBVIEW_FRAME::GetVisibleElementColor(): bad arg %d",
|
||||
aLayerID ) );
|
||||
}
|
||||
|
||||
return color;
|
||||
|
@ -865,7 +866,8 @@ void GERBVIEW_FRAME::SetVisibleElementColor( int aLayerID, COLOR4D aColor )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "GERBVIEW_FRAME::SetVisibleElementColor(): bad arg %d" ), aLayerID );
|
||||
wxFAIL_MSG( wxString::Format( "GERBVIEW_FRAME::SetVisibleElementColor(): bad arg %d",
|
||||
aLayerID ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ class MyClass
|
|||
public:
|
||||
int MyMethod( const string& arg )
|
||||
{
|
||||
printf( "MyClass(this = %p)::MyMethod() called with string '%s', length %d\n", this,
|
||||
arg.c_str(), arg.length() );
|
||||
return arg.length();
|
||||
}
|
||||
};
|
||||
|
@ -29,6 +27,5 @@ main()
|
|||
retval1 = ptr1( "apples" );
|
||||
retval2 = ptr2( "cherries" );
|
||||
|
||||
printf( "Object 1 returned %d, object 2 returned %d\n", retval1, retval2 );
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -94,8 +96,6 @@ SHAPE* SHAPE_FILE_IO::Read()
|
|||
|
||||
fscanf(m_file,"%d %s", &type, tmp);
|
||||
|
||||
printf("create shape %d\n", type);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case SHAPE::LINE_CHAIN:
|
||||
|
|
|
@ -58,7 +58,6 @@ MD5_HASH& MD5_HASH::operator=( const MD5_HASH& aOther )
|
|||
|
||||
void MD5_HASH::Init()
|
||||
{
|
||||
//printf("%p init\n", this);
|
||||
m_valid = false;
|
||||
md5_init(&m_ctx);
|
||||
}
|
||||
|
@ -75,7 +74,6 @@ void MD5_HASH::Hash ( int value )
|
|||
|
||||
void MD5_HASH::Finalize()
|
||||
{
|
||||
//printf("%p final\n", this);
|
||||
md5_final(&m_ctx, m_hash);
|
||||
m_valid = true;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
*
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
||||
|
@ -566,7 +566,7 @@ int AR_AUTOPLACER::testModuleOnBoard( MODULE* aModule, bool TstOtherSide, const
|
|||
|
||||
int diag = //testModuleByPolygon( aModule, side, aOffset );
|
||||
testRectangle( fpBBox, side );
|
||||
//printf("test %p diag %d\n", aModule, diag);fflush(0);
|
||||
|
||||
if( diag != AR_FREE_CELL )
|
||||
return diag;
|
||||
|
||||
|
@ -731,8 +731,6 @@ double AR_AUTOPLACER::computePlacementRatsnestCost( MODULE *aModule, const wxPoi
|
|||
if( !nearest )
|
||||
continue;
|
||||
|
||||
//printf("pad %s nearest %s\n", (const char *)aModule->GetReference().c_str(), (const char *)nearest->GetParent()->GetReference().c_str());
|
||||
|
||||
start = VECTOR2I( pad->GetPosition() ) - VECTOR2I(aOffset);
|
||||
end = VECTOR2I( nearest->GetPosition() );
|
||||
|
||||
|
@ -893,8 +891,6 @@ AR_RESULT AR_AUTOPLACER::AutoplaceModules( std::vector<MODULE*> aModules,
|
|||
|
||||
memopos = m_curPosition;
|
||||
|
||||
//printf("set grid: %d\n", m_gridSize);
|
||||
|
||||
m_matrix.m_GridRouting = m_gridSize; //(int) m_frame->GetScreen()->GetGridSize().x;
|
||||
|
||||
// Ensure Board.m_GridRouting has a reasonable value:
|
||||
|
@ -984,8 +980,6 @@ AR_RESULT AR_AUTOPLACER::AutoplaceModules( std::vector<MODULE*> aModules,
|
|||
// Try orientations 90, 180, 270 degrees from initial orientation
|
||||
rotAllowed = module->GetPlacementCost180();
|
||||
|
||||
//printf("rotAllowed %d\n", rotAllowed);
|
||||
|
||||
if( rotAllowed != 0 )
|
||||
{
|
||||
rotateModule( module, 1800.0, true );
|
||||
|
@ -1063,7 +1057,6 @@ end_of_tst:
|
|||
|
||||
if( bestRotation != module->GetOrientation() )
|
||||
{
|
||||
//printf("best rotation %d\n", bestRotation );
|
||||
rotateModule( module, bestRotation, false );
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
*
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
||||
|
@ -310,9 +310,6 @@ void AR_MATRIX::drawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, LAYE
|
|||
|
||||
int cx, cy, dx, dy;
|
||||
|
||||
|
||||
//printf("segmQcq %d %d %d %d\n", ux0, uy0, ux1, uy1);
|
||||
|
||||
SetCellOperation( op_logic );
|
||||
|
||||
// Make coordinate ux1 tj > ux0 to simplify calculations
|
||||
|
@ -381,9 +378,6 @@ void AR_MATRIX::drawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, LAYE
|
|||
|
||||
RotatePoint( &dx, &dy, angle ); // dx = length, dy = 0
|
||||
|
||||
|
||||
//printf("col_min %d max %d row_min %d max %d\n", col_min, col_max, row_min, row_max);
|
||||
|
||||
for( col = col_min; col <= col_max; col++ )
|
||||
{
|
||||
int64_t cxr;
|
||||
|
@ -797,8 +791,6 @@ void AR_MATRIX::TraceSegmentPcb(
|
|||
int ux1 = pt_segm->GetEnd().x - GetBrdCoordOrigin().x;
|
||||
int uy1 = pt_segm->GetEnd().y - GetBrdCoordOrigin().y;
|
||||
|
||||
//printf("traceSegm %d %d %d %d\n", ux0, uy0, ux1, uy1);
|
||||
|
||||
LAYER_NUM layer = UNDEFINED_LAYER; // Draw on all layers
|
||||
|
||||
switch( pt_segm->GetShape() )
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016-2018 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -198,10 +200,6 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
|||
|
||||
void CN_CONNECTIVITY_ALGO::searchConnections()
|
||||
{
|
||||
#ifdef CONNECTIVITY_DEBUG
|
||||
printf("Search start\n");
|
||||
#endif
|
||||
|
||||
#ifdef PROFILE
|
||||
PROF_COUNTER garbage_collection( "garbage-collection" );
|
||||
#endif
|
||||
|
@ -282,11 +280,6 @@ void CN_CONNECTIVITY_ALGO::searchConnections()
|
|||
#endif
|
||||
|
||||
m_itemList.ClearDirtyFlags();
|
||||
|
||||
#ifdef CONNECTIVITY_DEBUG
|
||||
printf("Search end\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -395,16 +388,6 @@ const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters( CLUST
|
|||
return a->OriginNet() < b->OriginNet();
|
||||
} );
|
||||
|
||||
#ifdef CONNECTIVITY_DEBUG
|
||||
printf("Active clusters: %d\n", clusters.size() );
|
||||
|
||||
for( auto cl : clusters )
|
||||
{
|
||||
printf( "Net %d\n", cl->OriginNet() );
|
||||
cl->Dump();
|
||||
}
|
||||
#endif
|
||||
|
||||
return clusters;
|
||||
}
|
||||
|
||||
|
|
|
@ -150,12 +150,12 @@ const VECTOR2I CN_ITEM::GetAnchor( int n ) const
|
|||
|
||||
void CN_ITEM::Dump()
|
||||
{
|
||||
printf(" valid: %d, connected: \n", !!Valid());
|
||||
wxLogDebug(" valid: %d, connected: \n", !!Valid());
|
||||
|
||||
for( auto i : m_connected )
|
||||
{
|
||||
TRACK* t = static_cast<TRACK*>( i->Parent() );
|
||||
printf( " - %p %d\n", t, t->Type() );
|
||||
wxLogDebug( " - %p %d\n", t, t->Type() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ void CN_CLUSTER::Dump()
|
|||
{
|
||||
wxLogTrace( "CN", " - item : %p bitem : %p type : %d inet %s\n", item, item->Parent(),
|
||||
item->Parent()->Type(), (const char*) item->Parent()->GetNetname().c_str() );
|
||||
printf( "- item : %p bitem : %p type : %d inet %s\n", item, item->Parent(),
|
||||
wxLogTrace( "CN", "- item : %p bitem : %p type : %d inet %s\n", item, item->Parent(),
|
||||
item->Parent()->Type(), (const char*) item->Parent()->GetNetname().c_str() );
|
||||
item->Dump();
|
||||
}
|
||||
|
|
|
@ -537,14 +537,6 @@ void EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers )
|
|||
}
|
||||
}
|
||||
|
||||
#if 0 && defined(DEBUG)
|
||||
printf( "m_cu_map:\n" );
|
||||
for( unsigned i=0; i<arrayDim(m_cu_map); ++i )
|
||||
{
|
||||
printf( "\t[%d]:%d\n", i, m_cu_map[i] );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set the layer names and cu count if we're loading a board.
|
||||
if( m_board )
|
||||
{
|
||||
|
@ -1019,7 +1011,6 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
|
|||
{
|
||||
if( element->GetName() != "element" )
|
||||
{
|
||||
wxLogDebug( "expected: <element> read <%s>. Skip it", element->GetName() );
|
||||
// Get next item
|
||||
element = element->GetNext();
|
||||
continue;
|
||||
|
@ -1115,7 +1106,6 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
|
|||
{
|
||||
if( attribute->GetName() != "attribute" )
|
||||
{
|
||||
wxLogDebug( "expected: <attribute> read <%s>. Skip it", attribute->GetName() );
|
||||
attribute = attribute->GetNext();
|
||||
continue;
|
||||
}
|
||||
|
@ -2431,8 +2421,6 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
|
|||
const wxString& pad = netItem->GetAttribute( "pad" );
|
||||
wxString key = makeKey( reference, pad ) ;
|
||||
|
||||
// D(printf( "adding refname:'%s' pad:'%s' netcode:%d netname:'%s'\n", reference.c_str(), pad.c_str(), netCode, netName.c_str() );)
|
||||
|
||||
m_pads_to_nets[ key ] = ENET( netCode, netName );
|
||||
|
||||
m_xpath->pop();
|
||||
|
@ -2579,9 +2567,6 @@ void EAGLE_PLUGIN::centerBoard()
|
|||
int desired_x = ( w - bbbox.GetWidth() ) / 2;
|
||||
int desired_y = ( h - bbbox.GetHeight() ) / 2;
|
||||
|
||||
DBG(printf( "bbox.width:%d bbox.height:%d w:%d h:%d desired_x:%d desired_y:%d\n",
|
||||
bbbox.GetWidth(), bbbox.GetHeight(), w, h, desired_x, desired_y );)
|
||||
|
||||
m_board->Move( wxPoint( desired_x - bbbox.GetX(), desired_y - bbbox.GetY() ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-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
|
||||
|
@ -73,7 +73,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() unknown event id %d" ), id );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* 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
|
||||
|
@ -230,7 +230,6 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event() error") );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2009-2013 Lorenzo Mercantonio
|
||||
* Copyright (C) 2014-2017 Cirilo Bernardo
|
||||
* Copyright (C) 2018 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-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
|
||||
|
@ -1492,10 +1492,6 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
|
|||
|
||||
if( srcModTime != destModTime )
|
||||
{
|
||||
wxLogDebug( "Copying 3D model %s to %s.",
|
||||
GetChars( srcFile.GetFullPath() ),
|
||||
GetChars( dstFile.GetFullPath() ) );
|
||||
|
||||
wxString fileExt = srcFile.GetExt();
|
||||
fileExt.LowerCase();
|
||||
|
||||
|
@ -1738,29 +1734,11 @@ static void create_vrml_plane( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX color
|
|||
|
||||
if( !( *layer ).Get2DTriangles( vertices, idxPlane, top_z, aTopPlane ) )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [INFO] no vertex data";
|
||||
wxLogDebug( "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( idxPlane.size() % 3 ) )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] index lists are not a multiple of 3 (not a triangle list)";
|
||||
wxLogDebug( "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
|
||||
throw( std::runtime_error( "[BUG] index lists are not a multiple of 3 (not a triangle list)" ) );
|
||||
}
|
||||
|
||||
|
@ -1825,30 +1803,13 @@ static void create_vrml_shell( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX color
|
|||
if( !( *layer ).Get3DTriangles( vertices, idxPlane, idxSide, top_z, bottom_z )
|
||||
|| idxPlane.empty() || idxSide.empty() )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [INFO] no vertex data";
|
||||
wxLogDebug( "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( idxPlane.size() % 3 ) || ( idxSide.size() % 3 ) )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] index lists are not a multiple of 3 (not a triangle list)";
|
||||
wxLogDebug( "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
|
||||
throw( std::runtime_error( "[BUG] index lists are not a multiple of 3 (not a triangle list)" ) );
|
||||
throw( std::runtime_error( "[BUG] index lists are not a multiple of 3 (not a "
|
||||
"triangle list)" ) );
|
||||
}
|
||||
|
||||
std::vector< SGPOINT > vlist;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-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
|
||||
|
@ -359,7 +359,6 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id )
|
|||
}
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "File_io Internal Error" ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
|
@ -312,7 +312,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
|
||||
wxFAIL_MSG( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -345,8 +345,8 @@ void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule )
|
|||
BASIC_FOOTPRINT_INFO footprintInfo( aModule );
|
||||
wxDataViewItem treeItem = m_adapter->FindItem( oldFPID );
|
||||
|
||||
if( treeItem.IsOk() ) // Can be not found in tree if the current footprint is imported from file
|
||||
// therefore not yet in tree.
|
||||
if( treeItem.IsOk() ) // Can be not found in tree if the current footprint is imported
|
||||
// from file therefore not yet in tree.
|
||||
{
|
||||
static_cast<LIB_TREE_NODE_LIB_ID*>( treeItem.GetID() )->Update( &footprintInfo );
|
||||
m_treePane->GetLibTree()->RefreshLibTree();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2012 Miguel Angel Ajo Pelayo, miguelangel@nbee.es
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-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
|
||||
|
@ -64,8 +64,9 @@ void FOOTPRINT_WIZARD_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "FOOTPRINT_WIZARD_FRAME::Process_Special_Functions error: id = %d" ),
|
||||
event.GetId() );
|
||||
wxFAIL_MSG( wxString::Format(
|
||||
"FOOTPRINT_WIZARD_FRAME::Process_Special_Functions error: id = %d",
|
||||
event.GetId() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -113,10 +114,6 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
|
|||
GetBoard()->Add( module, ADD_MODE::APPEND );
|
||||
module->SetPosition( wxPoint( 0, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG(printf( "footprintWizard->GetFootprint() returns NULL\n" );)
|
||||
}
|
||||
|
||||
updateView();
|
||||
GetCanvas()->Refresh();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 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
|
||||
|
@ -214,8 +214,6 @@ bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, wxStr
|
|||
{
|
||||
KICAD_CURL_EASY kcurl;
|
||||
|
||||
wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
|
||||
|
||||
kcurl.SetURL( aFullURLCommand );
|
||||
kcurl.SetUserAgent( "http://kicad-pcb.org" );
|
||||
kcurl.SetHeader( "Accept", m_option_string );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-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
|
||||
|
@ -142,7 +142,6 @@ void GITHUB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wx
|
|||
{
|
||||
try
|
||||
{
|
||||
//D(printf("%s: this:%p aLibPath:\"%s\"\n", __func__, this, TO_UTF8(aLibraryPath) );)
|
||||
cacheLib( aLibPath, aProperties );
|
||||
|
||||
typedef std::set<wxString> MYSET;
|
||||
|
@ -188,8 +187,6 @@ void GITHUB_PLUGIN::PrefetchLib(
|
|||
MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
|
||||
const wxString& aFootprintName, const PROPERTIES* aProperties )
|
||||
{
|
||||
// D(printf("%s: this:%p aLibraryPath:\"%s\"\n", __func__, this, TO_UTF8(aLibraryPath) );)
|
||||
|
||||
// clear or set to valid the variable m_pretty_dir
|
||||
cacheLib( aLibraryPath, aProperties );
|
||||
|
||||
|
@ -420,7 +417,6 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
|
|||
// operator==( wxString, wxChar* ) does not exist, construct wxString once here.
|
||||
const wxString kicad_mod( "kicad_mod" );
|
||||
|
||||
//D(printf("%s: this:%p m_lib_path:'%s' aLibraryPath:'%s'\n", __func__, this, TO_UTF8( m_lib_path), TO_UTF8(aLibraryPath) );)
|
||||
m_gh_cache = new GH_CACHE();
|
||||
|
||||
// INIT_LOGGER( "/tmp", "test.log" );
|
||||
|
@ -482,7 +478,6 @@ long long GITHUB_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryPath ) con
|
|||
bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string* aZipURL )
|
||||
{
|
||||
// e.g. "https://github.com/liftoff-sr/pretty_footprints"
|
||||
//D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );)
|
||||
|
||||
wxURI repo( aRepoURL );
|
||||
|
||||
|
@ -565,8 +560,6 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL )
|
|||
THROW_IO_ERROR( msg );
|
||||
}
|
||||
|
||||
wxLogDebug( wxT( "Attempting to download: " ) + zip_url );
|
||||
|
||||
KICAD_CURL_EASY kcurl; // this can THROW_IO_ERROR
|
||||
|
||||
kcurl.SetURL( zip_url.c_str() );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2010 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2010-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
|
||||
|
@ -576,7 +576,6 @@ wxSize LAYER_WIDGET::GetBestSize() const
|
|||
for( int i = 0; i < LYR_COLUMN_COUNT; ++i )
|
||||
{
|
||||
totWidth += widths[i] + m_LayersFlexGridSizer->GetHGap();
|
||||
// printf("widths[%d]:%d\n", i, widths[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -603,7 +602,6 @@ wxSize LAYER_WIDGET::GetBestSize() const
|
|||
for( int i = 0; i < RND_COLUMN_COUNT; ++i )
|
||||
{
|
||||
totWidth += widths[i] + m_RenderFlexGridSizer->GetHGap();
|
||||
// printf("widths[%d]:%d\n", i, widths[i] );
|
||||
}
|
||||
}
|
||||
// account for the parent's frame, this one has void space of 10 PLUS a border:
|
||||
|
@ -868,36 +866,29 @@ class MYFRAME : public wxFrame
|
|||
|
||||
void OnLayerColorChange( int aLayer, COLOR4D aColor )
|
||||
{
|
||||
printf( "OnLayerColorChange( aLayer:%d, aColor:%d )\n", aLayer, aColor );
|
||||
|
||||
/* a test trigger only
|
||||
if( aLayer == 2 )
|
||||
{
|
||||
ClearLayerRows();
|
||||
printf(" GetLayerRowCount(): %d\n", GetLayerRowCount() );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
bool OnLayerSelect( LAYER_NUM aLayer )
|
||||
{
|
||||
printf( "OnLayerSelect( aLayer:%d )\n", aLayer );
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool isFinal )
|
||||
{
|
||||
printf( "OnLayerVisible( aLayer:%d, isVisible:%d isFinal:%d)\n", aLayer, isVisible, isFinal );
|
||||
}
|
||||
|
||||
void OnRenderColorChange( int aId, COLOR4D aColor )
|
||||
{
|
||||
printf( "OnRenderColorChange( aId:%d, aColor:%d )\n", aId, aColor );
|
||||
}
|
||||
|
||||
void OnRenderEnable( int aId, bool isEnabled )
|
||||
{
|
||||
printf( "OnRenderEnable( aId:%d, isEnabled:%d )\n", aId, isEnabled );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -222,7 +222,6 @@ static inline char* ReadLine( LINE_READER* rdr, const char* caller )
|
|||
char* ret = rdr->ReadLine();
|
||||
|
||||
const char* line = rdr->Line();
|
||||
printf( "%-6u %s: %s", rdr->LineNumber(), caller, line );
|
||||
|
||||
#if 0 // trap
|
||||
if( !strcmp( "loadSETUP", caller ) && !strcmp( "$EndSETUP\n", line ) )
|
||||
|
@ -611,7 +610,6 @@ void LEGACY_PLUGIN::loadGENERAL()
|
|||
LEG_MASK enabledLayers = hexParse( line + SZ( "EnabledLayers" ) );
|
||||
LSET new_mask = leg_mask2new( m_cu_count, enabledLayers );
|
||||
|
||||
//DBG( printf( "EnabledLayers: %s\n", new_mask.FmtHex().c_str() );)
|
||||
m_board->SetEnabledLayers( new_mask );
|
||||
|
||||
// layer visibility equals layer usage, unless overridden later via "VisibleLayers"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.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
|
||||
|
@ -271,11 +271,8 @@ MODULE* PCB_BASE_FRAME::SelectFootprintFromLibTree( LIB_ID aPreselect )
|
|||
{
|
||||
module = loadFootprint( fpid );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
wxLogDebug( wxT( "Error loading footprint '%s'.\n\nError: %s" ),
|
||||
fpid.Format().c_str(),
|
||||
ioe.What() );
|
||||
}
|
||||
|
||||
if( module )
|
||||
|
@ -296,10 +293,8 @@ MODULE* PCB_BASE_FRAME::LoadFootprint( const LIB_ID& aFootprintId )
|
|||
{
|
||||
module = loadFootprint( aFootprintId );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
wxLogDebug( wxT( "An error occurred attemping to load footprint '%s'.\n\nError: %s" ),
|
||||
aFootprintId.Format().c_str(), GetChars( ioe.What() ) );
|
||||
}
|
||||
|
||||
return module;
|
||||
|
@ -317,10 +312,8 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const LIB_ID& aFootprintId )
|
|||
{
|
||||
module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
wxLogDebug( wxT( "An error occurred attemping to load footprint '%s'.\n\nError: %s" ),
|
||||
aFootprintId.Format().c_str(), GetChars( ioe.What() ) );
|
||||
}
|
||||
|
||||
// If the module is found, clear all net info,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2014 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
|
||||
|
@ -172,7 +172,7 @@ void NETINFO_LIST::Show() const
|
|||
NETNAMES_MAP::const_iterator it, itEnd;
|
||||
for( it = m_netNames.begin(), itEnd = m_netNames.end(); it != itEnd; ++it )
|
||||
{
|
||||
printf( "[%d]: netcode:%d netname:<%s>\n",
|
||||
wxLogDebug( "[%d]: netcode:%d netname:<%s>\n",
|
||||
i++,
|
||||
it->second->GetNet(),
|
||||
TO_UTF8( it->second->GetNetname() ) );
|
||||
|
|
|
@ -168,8 +168,8 @@ void KICAD_NETLIST_PARSER::Parse()
|
|||
|
||||
if( plevel != 0 )
|
||||
{
|
||||
wxLogDebug( wxT( "KICAD_NETLIST_PARSER::Parse(): bad parenthesis count (count = %d"),
|
||||
plevel );
|
||||
wxFAIL_MSG( wxString::Format( "KICAD_NETLIST_PARSER::Parse(): bad parenthesis "
|
||||
"count (count = %d", plevel ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -252,14 +252,11 @@ LIBEVAL::VALUE PCB_EXPR_VAR_REF::GetValue( LIBEVAL::CONTEXT* aCtx )
|
|||
|
||||
if( !m_isEnum )
|
||||
{
|
||||
//printf("item %p Get string '%s'\n", item, (const char*) it->second->Name().c_str() );
|
||||
str = item->Get<wxString>( it->second );
|
||||
}
|
||||
else
|
||||
{
|
||||
const wxAny& any = item->Get( it->second );
|
||||
any.GetAs<wxString>( &str );
|
||||
//printf("item %p get enum: '%s'\n", item , (const char*) str.c_str() );
|
||||
}
|
||||
|
||||
return LIBEVAL::VALUE( str );
|
||||
|
@ -310,7 +307,6 @@ std::unique_ptr<LIBEVAL::VAR_REF> PCB_EXPR_UCODE::CreateVarRef( const wxString&
|
|||
|
||||
if( prop )
|
||||
{
|
||||
//printf("Field '%s' class %s ptr %p haschoices %d typeid %s\n", field.c_str(), (const char *) cls.name.c_str(), prop, !!prop->HasChoices(), typeid(*prop).name() );
|
||||
vref->AddAllowedClass( cls.type, prop );
|
||||
|
||||
if( prop->TypeHash() == TYPE_HASH( int ) )
|
||||
|
|
|
@ -99,21 +99,6 @@ void PCB_PARSER::init()
|
|||
|
||||
m_layerMasks[ key ] = LSET( PCB_LAYER_ID( In15_Cu - i ) );
|
||||
}
|
||||
|
||||
#if defined(DEBUG) && 0
|
||||
printf( "m_layerMasks:\n" );
|
||||
for( LSET_MAP::const_iterator it = m_layerMasks.begin(); it != m_layerMasks.end(); ++it )
|
||||
{
|
||||
printf( " [%s] == 0x%s\n", it->first.c_str(), it->second.FmtHex().c_str() );
|
||||
}
|
||||
|
||||
printf( "m_layerIndices:\n" );
|
||||
for( LAYER_ID_MAP::const_iterator it = m_layerIndices.begin(); it != m_layerIndices.end(); ++it )
|
||||
{
|
||||
printf( " [%s] == %d\n", it->first.c_str(), it->second );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -863,8 +848,6 @@ void PCB_PARSER::parseGeneralSection()
|
|||
break;
|
||||
|
||||
default: // Skip everything but the board thickness.
|
||||
//wxLogDebug( wxT( "Skipping general section token %s " ), GetChars( GetTokenString( token ) ) );
|
||||
|
||||
while( ( token = NextTok() ) != T_RIGHT )
|
||||
{
|
||||
if( !IsSymbol( token ) && token != T_NUMBER )
|
||||
|
@ -1467,15 +1450,6 @@ T PCB_PARSER::lookUpLayer( const M& aMap )
|
|||
|
||||
if( it == aMap.end() )
|
||||
{
|
||||
#if 0 && defined(DEBUG)
|
||||
// dump the whole darn table, there's something wrong with it.
|
||||
for( it = aMap.begin(); it != aMap.end(); ++it )
|
||||
{
|
||||
wxLogDebug( &aMap == (void*)&m_layerIndices ? wxT( "lm[%s] = %d" ) :
|
||||
wxT( "lm[%s] = %08X" ), it->first.c_str(), it->second );
|
||||
}
|
||||
#endif
|
||||
|
||||
m_undefinedLayers.insert( curText );
|
||||
return Rescue;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* 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
|
||||
|
@ -83,8 +83,6 @@ void PCB_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent,
|
|||
|
||||
bool PCB_EDIT_FRAME::LoadProjectSettings()
|
||||
{
|
||||
wxLogDebug( wxT( "Loading project '%s' settings." ), GetChars( Prj().GetProjectFullName() ) );
|
||||
|
||||
PROJECT_FILE& project = Prj().GetProjectFile();
|
||||
PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings();
|
||||
|
||||
|
|
|
@ -69,9 +69,6 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives )
|
|||
|
||||
auto l0 = m_world->AssembleLine( li, &segIndex );
|
||||
|
||||
// printf( "solid %p jt %p fanout %d segs %d\n", solid, jt, jt->LinkCount(),
|
||||
/// l0.SegmentCount() );
|
||||
|
||||
DRAGGED_CONNECTION cn;
|
||||
|
||||
cn.origLine = l0;
|
||||
|
@ -81,8 +78,6 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives )
|
|||
}
|
||||
}
|
||||
|
||||
// printf( "Total: %d conns to drag\n", m_conns.size() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -173,12 +173,6 @@ bool LINE::Walkaround( SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN& aPre,
|
|||
|
||||
line.Intersect( aObstacle, ips );
|
||||
|
||||
|
||||
/* for( auto p : ips )
|
||||
{
|
||||
printf("gif %d %d our %d their %d\n", p.p.x, p.p.y, p.our.Index(), p.their.Index() );
|
||||
}*/
|
||||
|
||||
for( int i = 0; i < line.SegmentCount(); i++ )
|
||||
{
|
||||
const SEG& a = line.CSegment(i);
|
||||
|
@ -190,7 +184,6 @@ bool LINE::Walkaround( SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN& aPre,
|
|||
const SEG& so = aObstacle.CSegment(j);
|
||||
if( so.Contains( a ) )
|
||||
{
|
||||
// printf("discard seg %d\n", i );
|
||||
over = true;
|
||||
break;
|
||||
}
|
||||
|
@ -203,9 +196,6 @@ bool LINE::Walkaround( SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN& aPre,
|
|||
bool a_in = aObstacle.PointInside( a.A );// && !aObstacle.PointOnEdge( a.A );
|
||||
bool b_in = aObstacle.PointInside( a.B );// && !aObstacle.PointOnEdge( a.B );
|
||||
|
||||
// printf("i %d a %d %d %d %d [%d %d] a_in %d b_in %d\n", i, a.A.x, a.A.y, a.B.x, a.B.y, a.A.x- a.B.x, a.A.y - a.B.y, !!a_in, !!b_in );
|
||||
|
||||
|
||||
if( a_in ^ b_in ) // segment crosses hull boundary
|
||||
{
|
||||
for( int j = 0; j < aObstacle.SegmentCount(); j++ )
|
||||
|
@ -222,17 +212,13 @@ bool LINE::Walkaround( SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN& aPre,
|
|||
else
|
||||
p = aObstacle.CSegment(j).Intersect( a );
|
||||
|
||||
//printf("- cont_a %d cont_b %d p %d\n", !!cont_a, !!cont_b, p ? 1 : 0 );
|
||||
|
||||
|
||||
if ( p )
|
||||
if( p )
|
||||
{
|
||||
SHAPE_LINE_CHAIN::INTERSECTION ip;
|
||||
ip.our = a;
|
||||
ip.their = aObstacle.CSegment(j);
|
||||
ip.p = *p;
|
||||
ips.push_back(ip);
|
||||
//printf("chb %d %d\n", p->x, p->y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -261,14 +247,14 @@ bool LINE::Walkaround( SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN& aPre,
|
|||
const SEG& os = aObstacle.CSegment(j);
|
||||
|
||||
auto p = os.Intersect(a);
|
||||
if(p)
|
||||
|
||||
if( p )
|
||||
{
|
||||
SHAPE_LINE_CHAIN::INTERSECTION ip;
|
||||
ip.our = a;
|
||||
ip.their = aObstacle.CSegment(j);
|
||||
ip.p = *p;
|
||||
ips.push_back(ip);
|
||||
// printf("gif %d %d\n", p->x, p->y);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1019,7 +1019,6 @@ bool OPTIMIZER::Optimize( LINE* aLine, int aEffortLevel, NODE* aWorld, const VEC
|
|||
{
|
||||
auto c = new PRESERVE_VERTEX_CONSTRAINT( aWorld, aV );
|
||||
opt.AddConstraint( c );
|
||||
//printf("pres-v %d %d\n", aV.x, aV.y );
|
||||
}
|
||||
|
||||
if ( aEffortLevel & KEEP_TOPOLOGY )
|
||||
|
@ -1372,15 +1371,12 @@ bool tightenSegment( bool dir, NODE *aNode, const LINE& cur,
|
|||
|
||||
int step = initial;
|
||||
int current = step;
|
||||
//printf("step %d\n", step);
|
||||
SHAPE_LINE_CHAIN snew;
|
||||
|
||||
while (step > 1)
|
||||
{
|
||||
LINE l ( cur );
|
||||
|
||||
|
||||
//printf("current %d l %d\n", current, guide.Length() );
|
||||
snew.Clear();
|
||||
snew.Append( a.A );
|
||||
snew.Append( a.B + (a.A - a.B).Resize( current ) );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -238,7 +238,7 @@ SHOVE::SHOVE_STATUS SHOVE::processHullSet( LINE& aCurrent, LINE& aObstacle,
|
|||
|
||||
#ifdef DEBUG
|
||||
char str[128];
|
||||
sprintf(str,"att-%d-shoved", attempt);
|
||||
sprintf( str, "att-%d-shoved", attempt );
|
||||
Dbg()->AddLine( l.CLine(), 3, 20000, str );
|
||||
#endif
|
||||
|
||||
|
@ -322,7 +322,7 @@ SHOVE::SHOVE_STATUS SHOVE::ProcessSingleLine( LINE& aCurrent, LINE& aObstacle, L
|
|||
|
||||
#ifdef DEBUG
|
||||
char str[128];
|
||||
sprintf(str,"current-cl-%d", clearance );
|
||||
sprintf( str, "current-cl-%d", clearance );
|
||||
Dbg()->AddLine( aCurrent.CLine(), 5, 20000, str );
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -225,23 +225,15 @@ const WALKAROUND::RESULT WALKAROUND::Route( const LINE& aInitialPath )
|
|||
if( s_ccw != STUCK )
|
||||
s_ccw = singleStep( path_ccw, false );
|
||||
|
||||
//Dbg()->AddLine( path_cw.CLine(), 2, 10000 );
|
||||
|
||||
|
||||
//printf("iter %d s_cw %d s_ccw %d\n", m_iteration, s_cw, s_ccw );
|
||||
|
||||
auto old = path_cw.CLine();
|
||||
|
||||
if( clipToLoopStart( path_cw.Line() ))
|
||||
{
|
||||
//printf("ClipCW\n");
|
||||
//Dbg()->AddLine( old, 1, 40000 );
|
||||
s_cw = ALMOST_DONE;
|
||||
}
|
||||
|
||||
if( clipToLoopStart( path_ccw.Line() ))
|
||||
{
|
||||
//printf("ClipCCW\n");
|
||||
s_ccw = ALMOST_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2011 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
|
||||
|
@ -3564,8 +3564,6 @@ UNIT_RES UNIT_RES::Default( NULL, T_resolution );
|
|||
|
||||
int PADSTACK::Compare( PADSTACK* lhs, PADSTACK* rhs )
|
||||
{
|
||||
// printf( "PADSTACK::Compare( %p, %p)\n", lhs, rhs );
|
||||
|
||||
if( !lhs->hash.size() )
|
||||
lhs->hash = lhs->makeHash();
|
||||
|
||||
|
@ -3596,8 +3594,6 @@ int IMAGE::Compare( IMAGE* lhs, IMAGE* rhs )
|
|||
|
||||
int result = lhs->hash.compare( rhs->hash );
|
||||
|
||||
// printf("\"%s\" \"%s\" ret=%d\n", lhs->hash.c_str(), rhs->hash.c_str(), result );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-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
|
||||
|
@ -767,8 +767,6 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
|
|||
case S_RECT:
|
||||
case S_ARC:
|
||||
default:
|
||||
DBG( printf( "makeIMAGE(): unsupported shape %s\n",
|
||||
TO_UTF8( BOARD_ITEM::ShowShape( graphic->GetShape() ) ) ); )
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -636,7 +636,6 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( editModules && ( !board() || !module() ) )
|
||||
{
|
||||
wxLogDebug( wxT( "Attempting to paste to empty module editor window\n") );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 CERN
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-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
|
||||
|
@ -68,9 +68,8 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_cancelHandler)();
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PCBNEW_PICKER_TOOL cancelHandler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,9 +94,8 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
getNext = (*m_clickHandler)( *m_picked );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PCBNEW_PICKER_TOOL clickHandler error: " << e.what() << std::endl;
|
||||
finalize_state = EXCEPTION_CANCEL;
|
||||
break;
|
||||
}
|
||||
|
@ -120,9 +118,8 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_motionHandler)( cursorPos );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PCBNEW_PICKER_TOOL motion handler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,9 +145,8 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
(*m_finalizeHandler)( finalize_state );
|
||||
}
|
||||
catch( std::exception& e )
|
||||
catch( std::exception& )
|
||||
{
|
||||
std::cerr << "PCBNEW_PICKER_TOOL finalizeHandler error: " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2016 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
* 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
|
||||
|
@ -307,7 +307,8 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
|
|||
|
||||
default:
|
||||
{
|
||||
wxLogDebug( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
|
||||
wxFAIL_MSG( wxString::Format( "SaveCopyInUndoList() error (unknown code %X)",
|
||||
command ) );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -569,8 +570,8 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
|
||||
aList->GetPickedItemStatus( ii ) );
|
||||
wxFAIL_MSG( wxString::Format( "PutDataInPreviousState() error (unknown code %X)",
|
||||
aList->GetPickedItemStatus( ii ) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2018-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
|
||||
|
@ -53,12 +53,8 @@ public:
|
|||
|
||||
int CountTo( int n )
|
||||
{
|
||||
printf( "%s: Coroutine says hi. I will count from 1 to %d and yield each value.\n",
|
||||
__FUNCTION__, n );
|
||||
|
||||
for( int i = 1; i <= n; i++ )
|
||||
{
|
||||
printf( "%s: Yielding %d\n", __FUNCTION__, i );
|
||||
m_cofunc->KiYield( i );
|
||||
}
|
||||
|
||||
|
@ -68,16 +64,12 @@ public:
|
|||
void Run()
|
||||
{
|
||||
m_cofunc = std::make_unique<MyCoroutine>( this, &CoroutineExample::CountTo );
|
||||
printf( "%s: Calling coroutine that will count from 1 to 5.\n", __FUNCTION__ );
|
||||
m_cofunc->Call( m_count );
|
||||
|
||||
while( m_cofunc->Running() )
|
||||
{
|
||||
printf( "%s: Got value: %d\n", __FUNCTION__, m_cofunc->ReturnValue() );
|
||||
m_cofunc->Resume();
|
||||
}
|
||||
|
||||
printf( "%s: Done!\n", __FUNCTION__ );
|
||||
}
|
||||
|
||||
std::unique_ptr<MyCoroutine> m_cofunc;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2004-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-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
|
||||
|
@ -910,7 +910,6 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad, int aMinClearance
|
|||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "DRC::checkClearancePadToPad: unexpected pad shape %d" ), aPad->GetShape() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,24 +43,25 @@ void drcPrintDebugMessage( int level, wxString msg, const char *function, int li
|
|||
if( wxGetEnv( "DRC_DEBUG", &valueStr ) )
|
||||
{
|
||||
int setLevel = wxAtoi( valueStr );
|
||||
if( level <= setLevel )
|
||||
fprintf(stderr,"[%-30s:%-5d] %s", function, line, (const char *) msg.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
test::DRC_ENGINE::DRC_ENGINE( BOARD* aBoard, BOARD_DESIGN_SETTINGS *aSettings ) :
|
||||
m_board( aBoard ),
|
||||
m_designSettings ( aSettings ),
|
||||
m_reporter( nullptr ),
|
||||
m_progressReporter( nullptr )
|
||||
{
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
test::DRC_ENGINE::~DRC_ENGINE()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
test::DRC_REPORT::~DRC_REPORT()
|
||||
{
|
||||
for( auto item : m_entries )
|
||||
|
@ -70,6 +71,7 @@ test::DRC_REPORT::~DRC_REPORT()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*void test::DRC_ENGINE::AddMarker( MARKER_PCB* aMarker )
|
||||
{
|
||||
if( m_designSettings->Ignore( aMarker->GetRCItem()->GetErrorCode() ) )
|
||||
|
@ -81,6 +83,7 @@ test::DRC_REPORT::~DRC_REPORT()
|
|||
m_markers.push_back( aMarker );
|
||||
}*/
|
||||
|
||||
|
||||
bool test::DRC_ENGINE::LoadRules( wxFileName aPath )
|
||||
{
|
||||
|
||||
|
@ -301,6 +304,7 @@ void test::DRC_ENGINE::ReportProgress( double aProgress )
|
|||
m_progressReporter->SetCurrentProgress( aProgress );
|
||||
}
|
||||
|
||||
|
||||
void test::DRC_ENGINE::ReportStage ( const wxString& aStageName, int index, int total )
|
||||
{
|
||||
if( !m_progressReporter )
|
||||
|
@ -309,6 +313,7 @@ void test::DRC_ENGINE::ReportStage ( const wxString& aStageName, int index, int
|
|||
m_progressReporter->BeginPhase( index ); // fixme: coalesce all stages/test providers
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
test::DRC_CONSTRAINT test::DRC_ENGINE::GetWorstGlobalConstraint( test::DRC_CONSTRAINT_TYPE_T ruleID )
|
||||
{
|
||||
|
@ -329,6 +334,7 @@ test::DRC_CONSTRAINT test::DRC_ENGINE::GetWorstGlobalConstraint( test::DRC_CONST
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
std::vector<test::DRC_CONSTRAINT> test::DRC_ENGINE::QueryConstraintsById( test::DRC_CONSTRAINT_TYPE_T constraintID )
|
||||
{
|
||||
std::vector<test::DRC_CONSTRAINT> rv;
|
||||
|
|
|
@ -53,7 +53,6 @@ int main( int argc, char *argv[] )
|
|||
}
|
||||
catch( PARSE_ERROR& err )
|
||||
{
|
||||
printf("Can't load DRC rules: %s\n", (const char*) err.What().c_str() );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,18 +66,14 @@ BOOST_AUTO_TEST_CASE( Orientation )
|
|||
{
|
||||
TRANSFORM t = m_symbol.GetTransform();
|
||||
|
||||
wxLogDebug( "Angle 0: x1 = %d, y1 = %d, x2 = %d, y2 = %d", t.x1, t.y1, t.x2, t.y2 );
|
||||
m_symbol.SetOrientation( CMP_ORIENT_90 );
|
||||
t = m_symbol.GetTransform();
|
||||
wxLogDebug( "Angle 90: x1 = %d, y1 = %d, x2 = %d, y2 = %d", t.x1, t.y1, t.x2, t.y2 );
|
||||
m_symbol.SetTransform( TRANSFORM() );
|
||||
m_symbol.SetOrientation( CMP_ORIENT_180 );
|
||||
t = m_symbol.GetTransform();
|
||||
wxLogDebug( "Angle 180: x1 = %d, y1 = %d, x2 = %d, y2 = %d", t.x1, t.y1, t.x2, t.y2 );
|
||||
m_symbol.SetTransform( TRANSFORM() );
|
||||
m_symbol.SetOrientation( CMP_ORIENT_270 );
|
||||
t = m_symbol.GetTransform();
|
||||
wxLogDebug( "Angle 270: x1 = %d, y1 = %d, x2 = %d, y2 = %d", t.x1, t.y1, t.x2, t.y2 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@ bool testEvalExpr( const std::string expr, LIBEVAL::VALUE expectedResult, bool e
|
|||
{
|
||||
if ( expectError )
|
||||
{
|
||||
printf("result: OK (expected parse error)\n");
|
||||
ok = true;
|
||||
return ok;
|
||||
} else {
|
||||
printf("result: FAIL: %s\n", compiler.GetErrorStatus().Format().c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
|
@ -44,26 +44,6 @@ bool testEvalExpr( const std::string expr, LIBEVAL::VALUE expectedResult, bool e
|
|||
ok = (result == expectedResult);
|
||||
}
|
||||
|
||||
if( expectedResult.GetType() == LIBEVAL::VT_NUMERIC )
|
||||
{
|
||||
printf( "result: %s (got %.10f expected: %.10f)\n",
|
||||
ok ? "OK" : "FAIL",
|
||||
result.AsDouble(),
|
||||
expectedResult.AsDouble() );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "result: %s (got '%ls' expected: '%ls')\n",
|
||||
ok ? "OK" : "FAIL",
|
||||
GetChars( result.AsString() ),
|
||||
GetChars( expectedResult.AsString() ) );
|
||||
}
|
||||
|
||||
if (!ok )
|
||||
{
|
||||
printf("Offending code dump: \n%s\n", ucode.Dump().c_str() );
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -100,26 +80,15 @@ int main( int argc, char *argv[] )
|
|||
NETCLASSPTR netclass1( new NETCLASS("HV") );
|
||||
NETCLASSPTR netclass2( new NETCLASS("otherClass" ) );
|
||||
|
||||
printf("netcl1 classname '%s'\n", (const char *) netclass1->GetName().c_str() );
|
||||
|
||||
|
||||
auto net1info = new NETINFO_ITEM( &brd, "net1", 1);
|
||||
auto net2info = new NETINFO_ITEM( &brd, "net2", 2);
|
||||
|
||||
|
||||
net1info->SetClass( netclass1 );
|
||||
net2info->SetClass( netclass2 );
|
||||
|
||||
printf("netX classname '%s'\n", net1info->GetClassName().c_str() );
|
||||
|
||||
|
||||
printf("net1 class %p %p\n", net1info->GetNetClass(), netclass1.get() );
|
||||
|
||||
TRACK trackA(&brd);
|
||||
TRACK trackB(&brd);
|
||||
|
||||
printf("net1 classname '%s'\n", (const char*) net1info->GetClassName().c_str() );
|
||||
|
||||
trackA.SetNet( net1info );
|
||||
trackB.SetNet( net2info );
|
||||
|
||||
|
@ -128,9 +97,6 @@ int main( int argc, char *argv[] )
|
|||
trackA.SetWidth( Mils2iu( 10 ));
|
||||
trackB.SetWidth( Mils2iu( 20 ));
|
||||
|
||||
printf( "TrkA %p netclass '%s'\n", &trackA, (const char*) trackA.GetNetClassName().c_str() );
|
||||
printf( "TrkB %p netclass '%s'\n", &trackB, (const char*) trackB.GetNetClassName().c_str() );
|
||||
|
||||
// testEvalExpr( "A.onlayer('F.Cu') || A.onlayer('B.Cu')", VAL( 1.0 ), false, &trackA, &trackB );
|
||||
testEvalExpr( "A.type == 'Pad' && B.type == 'Pad' && (A.onLayer('F.Cu'))", VAL( 0.0 ), false, &trackA, &trackB );
|
||||
return 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2018-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
|
||||
|
@ -87,21 +87,13 @@ static void CheckArcGeom( const SHAPE_ARC& aArc, const ARC_PROPERTIES& aProps )
|
|||
/// All arcs are solid
|
||||
BOOST_CHECK_EQUAL( aArc.IsSolid(), true );
|
||||
|
||||
/// Test bouding box
|
||||
#if 0 // Only for debug.
|
||||
printf("abox %d %d %d %d prp %d %d %d %d\n",
|
||||
aArc.BBox().GetX(), aArc.BBox().GetY(), aArc.BBox().GetSize().x, aArc.BBox().GetSize().y,
|
||||
aProps.m_bbox.GetX(),aProps.m_bbox.GetY(),
|
||||
aProps.m_bbox.GetSize().x, aProps.m_bbox.GetSize().y );
|
||||
fflush(0);
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_PREDICATE(
|
||||
KI_TEST::IsBoxWithinTol<BOX2I>, ( aArc.BBox() )( aProps.m_bbox )( pos_tol ) );
|
||||
|
||||
/// Collisions will be checked elsewhere.
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check an arcs geometry and other class functions
|
||||
*/
|
||||
|
@ -145,6 +137,7 @@ BOOST_AUTO_TEST_CASE( NullCtor )
|
|||
CheckArc( arc, null_props );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Info to set up an arc by centre, start point and angle
|
||||
*
|
||||
|
@ -157,6 +150,7 @@ struct ARC_CENTRE_PT_ANGLE
|
|||
double m_center_angle;
|
||||
};
|
||||
|
||||
|
||||
struct ARC_CPA_CASE
|
||||
{
|
||||
/// The text context name
|
||||
|
@ -172,6 +166,7 @@ struct ARC_CPA_CASE
|
|||
ARC_PROPERTIES m_properties;
|
||||
};
|
||||
|
||||
|
||||
static const std::vector<ARC_CPA_CASE> arc_cases = {
|
||||
{
|
||||
"C(0,0) 114 + 360 degree",
|
||||
|
@ -316,6 +311,7 @@ static const std::vector<ARC_CPA_CASE> arc_cases = {
|
|||
},
|
||||
};
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE( BasicCPAGeom )
|
||||
{
|
||||
for( const auto& c : arc_cases )
|
||||
|
@ -361,6 +357,7 @@ bool ArePolylineEndPointsNearCircle(
|
|||
return GEOM_TEST::ArePointsNearCircle( points, aCentre, aRad, aTolEnds );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Predicate for checking a polyline has all the segment mid points on
|
||||
* (near) a circle of given centre and radius
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2019-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
|
||||
|
@ -92,16 +92,12 @@ static bool testEvalExpr( const wxString& expr, LIBEVAL::VALUE expectedResult,
|
|||
|
||||
context.SetItems( itemA, itemB );
|
||||
|
||||
printf( "Expr: '%s'\n", (const char*) expr.c_str() );
|
||||
|
||||
bool error = !compiler.Compile( expr, &ucode, &preflightContext );
|
||||
|
||||
BOOST_CHECK_EQUAL( error, expectError );
|
||||
|
||||
if( error != expectError )
|
||||
{
|
||||
printf( "result: FAIL: %s (code pos: %d)\n",
|
||||
(const char*) compiler.GetError().message.c_str(), compiler.GetError().srcPos );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -120,18 +116,10 @@ static bool testEvalExpr( const wxString& expr, LIBEVAL::VALUE expectedResult,
|
|||
if( expectedResult.GetType() == LIBEVAL::VT_NUMERIC )
|
||||
{
|
||||
BOOST_CHECK_EQUAL( result.AsDouble(), expectedResult.AsDouble() );
|
||||
/*printf( "result: %s (got %.10f expected: %.10f)\n",
|
||||
ok ? "OK" : "FAIL",
|
||||
result.AsDouble(),
|
||||
expectedResult.AsDouble() );*/
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_CHECK_EQUAL( result.AsString(), expectedResult.AsString() );
|
||||
/*printf( "result: %s (got '%ls' expected: '%ls')\n",
|
||||
ok ? "OK" : "FAIL",
|
||||
GetChars( result.AsString() ),
|
||||
GetChars( expectedResult.AsString() ) );*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,10 +72,8 @@ bool parse( std::istream& aStream, bool aVerbose )
|
|||
|
||||
duration = timer.SinceStart<PARSE_DURATION>();
|
||||
}
|
||||
catch( const IO_ERROR& parse_error )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
std::cerr << parse_error.Problem() << std::endl;
|
||||
std::cerr << parse_error.Where() << std::endl;
|
||||
}
|
||||
|
||||
if( aVerbose )
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2019-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
|
||||
|
@ -63,8 +63,6 @@ int polygon_gererator_main( int argc, char* argv[] )
|
|||
{
|
||||
if( argc < 2 )
|
||||
{
|
||||
printf( "A sample tool for dumping board geometry as a set of polygons.\n" );
|
||||
printf( "Usage : %s board_file.kicad_pcb\n\n", argv[0] );
|
||||
return KI_TEST::RET_CODES::BAD_CMDLINE;
|
||||
}
|
||||
|
||||
|
@ -82,8 +80,6 @@ int polygon_gererator_main( int argc, char* argv[] )
|
|||
|
||||
for( unsigned net = 0; net < brd->GetNetCount(); net++ )
|
||||
{
|
||||
printf( "net %d\n", net );
|
||||
|
||||
for( auto track : brd->Tracks() )
|
||||
process( track, net );
|
||||
|
||||
|
@ -95,8 +91,6 @@ int polygon_gererator_main( int argc, char* argv[] )
|
|||
|
||||
for( auto zone : brd->Zones() )
|
||||
process( zone, net );
|
||||
|
||||
printf( "endnet\n" );
|
||||
}
|
||||
|
||||
return KI_TEST::RET_CODES::OK;
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -99,7 +101,6 @@ void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResul
|
|||
{
|
||||
edgeList[i].index = i;
|
||||
edgeList[i].next = &edgeList[ (i != lc.SegmentCount() - 1) ? i + 1 : 0 ];
|
||||
//printf("n %p\n", edgeList[i].next);
|
||||
}
|
||||
|
||||
std::unordered_set<EDGE_LIST_ENTRY*> queue;
|
||||
|
@ -121,8 +122,6 @@ void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResul
|
|||
if( e1 > e2 )
|
||||
std::swap(e1, e2);
|
||||
|
||||
// printf("e1 %d e2 %d\n", e1, e2 ) ;
|
||||
|
||||
int e1_prev = e1 - 1;
|
||||
if (e1_prev < 0)
|
||||
e1_prev = lc.SegmentCount() - 1;
|
||||
|
@ -150,8 +149,6 @@ void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResul
|
|||
{
|
||||
if ( edgeList[i].next )
|
||||
queue.insert ( &edgeList[i] );
|
||||
//else
|
||||
//printf("Skip %d\n", i);
|
||||
}
|
||||
|
||||
auto edgeBuf = std::make_unique<EDGE_LIST_ENTRY* []>( lc.SegmentCount() );
|
||||
|
@ -164,8 +161,9 @@ aResult->clear();
|
|||
auto e_first = (*queue.begin());
|
||||
auto e = e_first;
|
||||
int cnt=0;
|
||||
do {
|
||||
// printf("e %p cnt %d IDX %d\n", e, cnt, e->index);
|
||||
|
||||
do
|
||||
{
|
||||
edgeBuf[cnt++] = e;
|
||||
e = e->next;
|
||||
} while( e != e_first );
|
||||
|
@ -175,13 +173,11 @@ aResult->clear();
|
|||
for(int i = 0; i < cnt ;i++)
|
||||
{
|
||||
auto p = lc.CPoint(edgeBuf[i]->index);
|
||||
// printf("append %d %d\n", p.x, p.y);
|
||||
outl.Append( p );
|
||||
queue.erase( edgeBuf[i] );
|
||||
}
|
||||
|
||||
// auto p_last = lc.Point( edgeBuf[cnt-1]->index + 1 );
|
||||
//printf("appendl %d %d\n", p_last.x, p_last.y);
|
||||
// outl.Append( p_last );
|
||||
|
||||
outl.SetClosed(true);
|
||||
|
@ -247,7 +243,6 @@ int polygon_triangulation_main( int argc, char *argv[] )
|
|||
poly.CacheTriangulation();
|
||||
|
||||
(void) poly;
|
||||
printf( "zone %zu/%d\n", ( areaId + 1 ), brd->GetAreaCount() );
|
||||
#if 0
|
||||
PROF_COUNTER unfrac("unfrac");
|
||||
poly.Unfracture( SHAPE_POLY_SET::PM_FAST );
|
||||
|
|
|
@ -69,10 +69,8 @@ std::unique_ptr<BOARD_ITEM> ReadBoardItemFromStream( std::istream& aStream )
|
|||
{
|
||||
board.reset( parser.Parse() );
|
||||
}
|
||||
catch( const IO_ERROR& parse_error )
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
std::cerr << parse_error.Problem() << std::endl;
|
||||
std::cerr << parse_error.Where() << std::endl;
|
||||
}
|
||||
|
||||
return board;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
|
@ -121,7 +121,6 @@ program;
|
|||
|
||||
PGM_BASE& Pgm()
|
||||
{
|
||||
printf("Pgm @ %p\n", &program );
|
||||
return program;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013-2017 CERN
|
||||
* Copyright (C) 2013-2020 CERN
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -149,7 +149,6 @@ BOARD* PCB_TEST_FRAME::LoadAndDisplayBoard( const std::string& filename )
|
|||
wxString msg = wxString::Format( _( "Error loading board.\n%s" ),
|
||||
ioe.Problem() );
|
||||
|
||||
printf( "%s\n", (const char*) msg.mb_str() );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,6 @@ int COMBINED_UTILITY::HandleCommandLine( int argc, char** argv ) const
|
|||
|
||||
if( !func )
|
||||
{
|
||||
std::cerr << "Tool " << arg1 << " not found." << std::endl;
|
||||
return RET_CODES::UNKNOWN_TOOL;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 Cirilo Bernardo
|
||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-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
|
||||
|
@ -138,16 +138,9 @@ bool DXF2IDF::WriteOutline( FILE* aFile, bool isInch )
|
|||
|
||||
if( outline.empty() )
|
||||
{
|
||||
std::cerr << "* DXF2IDF::WriteOutline(): no valid outline in file\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !lines.empty() )
|
||||
{
|
||||
std::cerr << "* DXF2IDF::WriteOutline(): WARNING: more than 1 outline in file\n";
|
||||
std::cerr << "* Only the first outline will be used\n";
|
||||
}
|
||||
|
||||
char loopDir = '1';
|
||||
|
||||
if( outline.IsCCW() )
|
||||
|
@ -160,7 +153,6 @@ bool DXF2IDF::WriteOutline( FILE* aFile, bool isInch )
|
|||
{
|
||||
if( !outline.front()->IsCircle() )
|
||||
{
|
||||
std::cerr << "* DXF2IDF::WriteOutline(): bad outline\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014-2017 Cirilo Bernardo
|
||||
* Copyright (C) 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
|
||||
|
@ -102,7 +103,6 @@ bool IDF3::GetIDFString( const std::string& aLine, std::string& aIDFString,
|
|||
if( idx == len )
|
||||
{
|
||||
ERROR_IDF << "unterminated quote mark in line:\n";
|
||||
std::cerr << "LINE: " << aLine << "\n";
|
||||
aIndex = idx;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -732,7 +732,6 @@ void IDF3_COMP_OUTLINE_DATA::writePlaceData( std::ostream& aBoardFile,
|
|||
if( aPlacement == PS_INVALID )
|
||||
{
|
||||
ERROR_IDF << "placement invalid (" << aRefDes << ":";
|
||||
std::cerr << aPlacement << "); defaulting to PLACED\n";
|
||||
aPlacement = PS_PLACED;
|
||||
}
|
||||
|
||||
|
|
|
@ -406,7 +406,6 @@ int PANEL_KICAD2STEP::RunConverter()
|
|||
catch( const Standard_Failure& e )
|
||||
{
|
||||
wxString err = e.GetMessageString();
|
||||
//e.Print( std::cerr );
|
||||
wxMessageBox( err, "Export Error" );
|
||||
|
||||
ReportMessage( wxString::Format( "\nExport Error: %s\n", err ) );
|
||||
|
|
Loading…
Reference in New Issue