Wrap printfs in DBG defines

This places the remaining printf statements behind DBG() macros to
suppress their output on release builds.  We should remove these prior
to 5.1
This commit is contained in:
Seth Hillbrand 2018-10-10 22:31:17 -07:00
parent a69635f539
commit bfa7f16b44
9 changed files with 19 additions and 19 deletions

View File

@ -2003,14 +2003,14 @@ void LIB_PIN::Show( int nestLevel, std::ostream& os ) const
void LIB_PIN::CalcEdit( const wxPoint& aPosition )
{
printf("m_Flags %x\n", m_Flags );
DBG(printf("m_Flags %x\n", m_Flags );)
if( m_Flags == IS_NEW )
{
SetPosition( aPosition );
}
else if( m_Flags == IS_MOVED )
{
printf("MOVEPIN\n");
DBG(printf("MOVEPIN\n");)
Move( aPosition );
}
}

View File

@ -410,7 +410,7 @@ void LIB_TEXT::EndEdit( const wxPoint& aPosition, bool aAbort )
void LIB_TEXT::CalcEdit( const wxPoint& aPosition )
{
printf("textCalcEdit %d %d\n", aPosition.x, aPosition.y );
DBG(printf("textCalcEdit %d %d\n", aPosition.x, aPosition.y );)
if( m_rotate )
{
@ -431,8 +431,8 @@ void LIB_TEXT::CalcEdit( const wxPoint& aPosition )
else if( m_Flags == IS_MOVED )
{
Move( m_initialPos + aPosition - m_initialCursorPos );
printf("%p: move %d %d\n", this, GetPosition().x, GetPosition().y );
DBG(printf("%p: move %d %d\n", this, GetPosition().x, GetPosition().y );)
}
printf("%p: move2 %d %d\n", this, GetPosition().x, GetPosition().y );
DBG(printf("%p: move2 %d %d\n", this, GetPosition().x, GetPosition().y );)
}

View File

@ -181,7 +181,7 @@ void LIB_EDIT_FRAME::PlacePin()
{
LIB_PIN* cur_pin = (LIB_PIN*) GetDrawItem();
printf("PlacePin!\n");
DBG(printf("PlacePin!\n");)
// Some tests
if( !cur_pin || cur_pin->Type() != LIB_PIN_T )
@ -335,7 +335,7 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
return;
printf("DrawMovePin\n");
DBG(printf("DrawMovePin\n");)
auto p = aPanel->GetParent()->GetCrossHairPosition( true );

View File

@ -129,7 +129,7 @@ static void AbortSymbolTraceOn( EDA_DRAW_PANEL* aPanel, wxDC* DC )
view->ClearPreview();
view->ShowPreview( false );
view->ClearHiddenFlags();
printf("abort\n");
DBG(printf("abort\n");)
parent->RebuildView();
}
@ -260,7 +260,7 @@ static void RedrawWhileMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
if( item == NULL )
return;
printf("CalcDraw!\n");
DBG(printf("CalcDraw!\n");)
auto view = static_cast<SCH_DRAW_PANEL*>(aPanel)->GetView();
@ -268,12 +268,12 @@ static void RedrawWhileMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
item->CalcEdit( p );
printf("cp: %d %d %d %d\n", item->GetPosition().x, item->GetPosition().y, p.x, p.y );
DBG(printf("cp: %d %d %d %d\n", item->GetPosition().x, item->GetPosition().y, p.x, p.y );)
view->ClearPreview();
auto copy = static_cast<LIB_ITEM*>( item->Clone() );
printf("cp: %d %d\n", copy->GetPosition().x, copy->GetPosition().y );
DBG(printf("cp: %d %d\n", copy->GetPosition().x, copy->GetPosition().y );)
view->AddToPreview( copy );
}
@ -306,7 +306,7 @@ void LIB_EDIT_FRAME::StartModifyDrawSymbol( wxDC* DC, LIB_ITEM* aItem )
if( aItem == NULL )
return;
printf("startmdifyraw\n");
DBG(printf("startmdifyraw\n");)
TempCopyComponent();
aItem->BeginEdit( IS_RESIZED, GetCrossHairPosition( true ) );
@ -328,7 +328,7 @@ static void SymbolDisplayDraw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
auto cp = aPanel->GetParent()->GetCrossHairPosition( true );
printf("SymbolDisplayDraw\n");
DBG(printf("SymbolDisplayDraw\n");)
item->CalcEdit( cp );
@ -371,7 +371,7 @@ void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC )
auto view = static_cast<SCH_DRAW_PANEL*>(m_canvas)->GetView();
printf("end: pos %d %d\n", item->GetPosition().x, item->GetPosition().y );
DBG(printf("end: pos %d %d\n", item->GetPosition().x, item->GetPosition().y );)
view->ClearHiddenFlags();
view->ClearPreview();

View File

@ -62,7 +62,7 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{
SCH_ITEM* item = GetScreen()->GetCurItem();
wxPoint gridPosition = GetGridPosition( aPosition );
printf("mousep %d %d gridp %d %d\n", aPosition.x, aPosition.y, gridPosition.x, gridPosition.y );
DBG(printf("mousep %d %d gridp %d %d\n", aPosition.x, aPosition.y, gridPosition.x, gridPosition.y );)
if( ( GetToolId() == ID_NO_TOOL_SELECTED ) || ( item && item->GetFlags() ) )

View File

@ -76,7 +76,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
bool blockActive = GetScreen()->IsBlockActive();
wxString msg;
printf("on-rclick cur %p blk %d\n", item, blockActive ? 1 : 0 );
DBG(printf("on-rclick cur %p blk %d\n", item, blockActive ? 1 : 0 );)
// Do not start a block command on context menu.
m_canvas->SetCanStartBlock( -1 );

View File

@ -658,7 +658,7 @@ void SCH_BASE_FRAME::SyncView()
gal->SetGridSize( VECTOR2D( gs.x, gs.y ));
printf("SyncView: grid %d %d\n", (int)gs.x, (int)gs.y );
DBG(printf("SyncView: grid %d %d\n", (int)gs.x, (int)gs.y );)
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
}

View File

@ -457,7 +457,7 @@ void SCH_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
{
auto cmd = (GetParent()->GetToolId() == ID_ZOOM_SELECTION) ? BLOCK_ZOOM : 0;
printf("start block\n");
DBG(printf("start block\n");)
if( !GetParent()->HandleBlockBegin( nullptr, cmd_type, m_CursorStartPos, cmd ) )
{

View File

@ -867,7 +867,7 @@ void SCH_EDIT_FRAME::OnRotate( wxCommandEvent& aEvent )
item = LocateAndShowItem( data->GetPosition(), SCH_COLLECTOR::RotatableItems,
aEvent.GetInt() );
printf("Rotate Item %p", item);
DBG(printf("Rotate Item %p", item);)
// Exit if no item found at the current location or the item is already being edited.
if( (item == NULL) || (item->GetFlags() != 0) )