diff --git a/Documentation/compiling/COMPILING.txt b/Documentation/compiling/COMPILING.txt index 7cd486de36..3dd41ac3c3 100644 --- a/Documentation/compiling/COMPILING.txt +++ b/Documentation/compiling/COMPILING.txt @@ -215,8 +215,6 @@ One of these 2 option *must* be set to ON: CMAKE_INSTALL_PREFIX (OPTIONAL) - KICAD_MINIZIP ON/OFF - USE_WX_GRAPHICS_CONTEXT ON/OFF (OPTIONAL) *Experimental* advanced drawing library code using wxGraphicsContext (for tests only). Under Windows, a very recent version of mingw is needed. diff --git a/Documentation/compiling/linux-debian.txt b/Documentation/compiling/linux-debian.txt index a5ed45df11..b0625822b9 100644 --- a/Documentation/compiling/linux-debian.txt +++ b/Documentation/compiling/linux-debian.txt @@ -33,7 +33,7 @@ dpatch cat-all >>patch-stampT mv -f patch-stampT patch-stamp mkdir -p /home/david/Desktop/KICAD_SVN/build/kicad mkdir -p /home/david/Desktop/KICAD_SVN/build/bitmaps -cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake -DKICAD_MINIZIP=0 \ +cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake \ -DKICAD_DEMOS=/home/david/Desktop/KICAD_SVN/debian/kicad-common/usr/share/doc/ki\ cad/demos ../../kicad \ diff --git a/Documentation/compiling/linux-ubuntu.txt b/Documentation/compiling/linux-ubuntu.txt index ead79cd828..bb9310781c 100644 --- a/Documentation/compiling/linux-ubuntu.txt +++ b/Documentation/compiling/linux-ubuntu.txt @@ -71,7 +71,7 @@ dpatch cat-all >>patch-stampT mv -f patch-stampT patch-stamp mkdir -p /home/david/Desktop/KICAD_SVN/build/kicad mkdir -p /home/david/Desktop/KICAD_SVN/build/bitmaps -cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake -DKICAD_MINIZIP=0 \ +cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake \ -DKICAD_DEMOS=/home/david/Desktop/KICAD_SVN/debian/kicad-common/usr/share/doc/ki\ cad/demos ../../kicad \ diff --git a/INSTALL.txt b/INSTALL.txt index d7264ce776..2936040779 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -105,10 +105,10 @@ Mac OS X KiCad tree System wide files -/Library/Application Support/kicad/demos -/Library/Application Support/kicad/internat +/Library/Application Support/kicad/demos +/Library/Application Support/kicad/internat /Library/Application Support/kicad/library -/Library/Application Support/kicad/modules +/Library/Application Support/kicad/modules /Library/Application Support/kicad/modules/packages3d User files can be the same as the system wide files but only inside the users home directory. @@ -116,8 +116,8 @@ User files can be the same as the system wide files but only inside the users ho $HOME/Library/Application Support/kicad Warning: -These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new -project is created. +These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new +project is created. Installation from source code ----------------------------- @@ -178,9 +178,6 @@ configured and builded with "--enable-monolithic --disable-shared" parameters. For building dinamically linked executables. Can be used only if wxWidgets configured and builded with "--disable-monolithic --enable-shared" parameters. --DKICAD_MINIZIP=ON -Build the "minizip" executable. Use OFF to disable it building. - -DwxUSE_UNICODE=ON Require on locale utf8 for build the KiCad with cyrillic fonts support. diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index e9698d475a..298c5b5e76 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -320,12 +320,12 @@ void LIB_FIELD::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& a /* Set to one (1) to draw bounding box around field text to validate * bounding box calculation. */ #if 0 - wxString tmp = m_Text; - m_Text = *text; EDA_RECT bBox = GetBoundingBox(); - m_Text = tmp; - bBox.Inflate( 1, 1 ); - GRRect( &aPanel->m_ClipBox, aDC, bBox, 0, LIGHTMAGENTA ); + EDA_RECT grBox; + grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); + grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); + grBox.Move( aOffset ); + GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); #endif } @@ -511,18 +511,21 @@ wxString LIB_FIELD::GetFullText( int unit ) EDA_RECT LIB_FIELD::GetBoundingBox() const { - EDA_RECT rect = GetTextBox(); - rect.m_Pos.y *= -1; - rect.m_Pos.y -= rect.GetHeight(); + /* Y coordinates for LIB_ITEMS are bottom to top, so we must invert the Y position when + * calling GetTextBox() that works using top to bottom Y axis orientation. + */ + EDA_RECT rect = GetTextBox( -1, -1, true ); wxPoint orig = rect.GetOrigin(); wxPoint end = rect.GetEnd(); - wxPoint center = rect.Centre(); + NEGATE( orig.y); + NEGATE( end.y); - RotatePoint( &orig, center, m_Orient ); - RotatePoint( &end, center, m_Orient ); + RotatePoint( &orig, m_Pos, -m_Orient ); + RotatePoint( &end, m_Pos, -m_Orient ); rect.SetOrigin( orig ); rect.SetEnd( end ); + rect.Normalize(); return rect; } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index a797f9bc69..aa4abeab9d 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -343,8 +343,6 @@ int LIB_TEXT::GetPenSize() const void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor, int aDrawMode, void* aData, const TRANSFORM& aTransform ) { - wxPoint pos1, pos2; - int color = GetDefaultColor(); if( aColor < 0 ) // Used normal color or selected color @@ -357,8 +355,6 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO color = aColor; } - pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; - GRSetDrawMode( aDC, aDrawMode ); /* Calculate the text orientation, according to the component @@ -386,15 +382,12 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO * and use GetBoundaryBox to know the text coordinate considered as centered */ EDA_RECT bBox = GetBoundingBox(); - pos1 = bBox.Centre(); // this is the coordinates of the graphic text relative to the - // component position in schematic Y axis orientation. + wxPoint txtpos = bBox.Centre(); - /* convert y coordinate from schematic to library Y axis orientation - * because we want to call TransformCoordinate to calculate real coordinates - */ - NEGATE( pos1.y ); - pos1 = aTransform.TransformCoordinate( pos1 ) + aOffset; - DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text, orient, m_Size, + // Calculate pos accordint to mirror/rotation. + txtpos = aTransform.TransformCoordinate( txtpos ) + aOffset; + + DrawGraphicText( aPanel, aDC, txtpos, (EDA_Colors) color, m_Text, orient, m_Size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GetPenSize(), m_Italic, m_Bold ); @@ -404,13 +397,10 @@ void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aO */ #if 0 EDA_RECT grBox; - bBox.SetY( -bBox.GetY() ); - bBox.SetHeight( -bBox.GetHeight()); grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) ); grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) ); grBox.Move( aOffset ); - GRRect( &aPanel->m_ClipBox, aDC, grBox.GetOrigin().x, grBox.GetOrigin().y, - grBox.GetEnd().x, grBox.GetEnd().y, 0, LIGHTMAGENTA ); + GRRect( &aPanel->m_ClipBox, aDC, grBox, 0, LIGHTMAGENTA ); #endif } @@ -436,13 +426,15 @@ EDA_RECT LIB_TEXT::GetBoundingBox() const wxPoint orig = rect.GetOrigin(); wxPoint end = rect.GetEnd(); - wxPoint center = rect.Centre(); + NEGATE( orig.y); + NEGATE( end.y); - RotatePoint( &orig, center, m_Orient ); - RotatePoint( &end, center, m_Orient ); + RotatePoint( &orig, m_Pos, -m_Orient ); + RotatePoint( &end, m_Pos, -m_Orient ); rect.SetOrigin( orig ); rect.SetEnd( end ); rect.Normalize(); + return rect; } diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 52af6f5501..e5f798929d 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -357,14 +357,6 @@ public: */ void Compile_Ratsnest( wxDC* aDC, bool aDisplayStatus ); - /** - * Function TestOneRatsNest - * Compute the ratsnest relative to the net "net_code" - * @param aDC - Device context to draw on. - * @param aNetCode = netcode used to compute the ratsnest. - */ - int TestOneRatsNest( wxDC* aDC, int aNetCode ); - /** * Function build_ratsnest_module * Build a ratsnest relative to one footprint. This is a simplified computation diff --git a/pcbnew/class_netinfo.h b/pcbnew/class_netinfo.h index 5cd186ace0..d386308b87 100644 --- a/pcbnew/class_netinfo.h +++ b/pcbnew/class_netinfo.h @@ -65,6 +65,20 @@ public: m_NetCode = aNetCode; } + bool IsVisible() + { + return (m_Status & CH_VISIBLE) != 0; + } + + bool IsActive() + { + return (m_Status & CH_ACTIF) != 0; + } + + bool IsLocal() + { + return (m_Status & LOCAL_RATSNEST_ITEM) != 0; + } /** * Function Draw diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index 5d671a2282..fb015d845d 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -593,13 +593,22 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) Merge_SubNets_Connected_By_CopperAreas( m_Pcb, aNetCode ); - /* Test the ratsnest for this net */ - int nb_net_noconnect = TestOneRatsNest( aDC, aNetCode ); + /* rebuild the active ratsnest for this net */ + DrawGeneralRatsnest( aDC, aNetCode ); + TestForActiveLinksInRatsnest( aNetCode ); + DrawGeneralRatsnest( aDC, aNetCode ); /* Display results */ + int net_notconnected_count = 0; + NETINFO_ITEM* net = m_Pcb->FindNet( aNetCode ); + for( unsigned ii = net->m_RatsnestStartIdx; ii < net->m_RatsnestEndIdx; ii++ ) + { + if( m_Pcb->m_FullRatsnest[ii].IsActive() ) + net_notconnected_count++; + } msg.Printf( wxT( "links %d nc %d net:nc %d" ), m_Pcb->GetRatsnestsCount(), m_Pcb->GetNoconnectCount(), - nb_net_noconnect ); + net_notconnected_count ); SetStatusText( msg ); return; diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 3a56becf37..15648fad38 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -459,8 +459,8 @@ void DRC::testPad2Pad() #include /* Function testTracks * performs the DRC on all tracks. - * because this test can take a while, a progrsse bar can be displayed - * (Note: it is shown only if there are many tracks + * because this test can take a while, a progress bar can be displayed + * (Note: it is shown only if there are many tracks) */ void DRC::testTracks( bool aShowProgressBar ) { diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h index c91874c8e1..086ce4be25 100644 --- a/pcbnew/drc_stuff.h +++ b/pcbnew/drc_stuff.h @@ -266,9 +266,9 @@ private: /** * Function testTracks * performs the DRC on all tracks. - * because this test can take a while, a progrsse bar can be displayed + * because this test can take a while, a progress bar can be displayed * @param aShowProgressBar = true to show a progrsse bar - * (Note: it is shown only if there are many tracks + * (Note: it is shown only if there are many tracks) */ void testTracks( bool aShowProgressBar ); diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index eafca7ae22..39ddd4446b 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -487,22 +487,12 @@ void PCB_BASE_FRAME::TestForActiveLinksInRatsnest( int aNetCode ) for( unsigned ii = 0; ii < m_Pcb->GetRatsnestsCount(); ii++ ) { - if( m_Pcb->m_FullRatsnest[ii].m_Status & CH_ACTIF ) + if( m_Pcb->m_FullRatsnest[ii].IsActive() ) m_Pcb->m_NbNoconnect++; } } -int PCB_BASE_FRAME::TestOneRatsNest( wxDC* aDC, int aNetCode ) -{ - DrawGeneralRatsnest( aDC, aNetCode ); - TestForActiveLinksInRatsnest( aNetCode ); - DrawGeneralRatsnest( aDC, aNetCode ); - - return m_Pcb->GetRatsnestsCount(); -} - - void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule ) { // for local ratsnest calculation when moving a footprint: @@ -853,7 +843,7 @@ void PCB_BASE_FRAME::BuildAirWiresTargetsList( BOARD_CONNECTED_ITEM* aItemRef, { if( aPosition != track->m_Start ) s_TargetsLocations.push_back( track->m_Start ); - if( aPosition != track->m_End ) + if( aPosition != track->m_End && track->m_Start != track->m_End ) s_TargetsLocations.push_back( track->m_End ); } }