Commit 4221c361 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: bug 880132 : partial fix.

Pcbnew: remove useless code.
Doc: remobe obsolete reference to MINIZIP (which do not exist now)
parent fc7189e6
......@@ -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.
......
......@@ -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 \
......
......@@ -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 \
......
......@@ -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.
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -459,8 +459,8 @@ void DRC::testPad2Pad()
#include <wx/progdlg.h>
/* 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 )
{
......
......@@ -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 );
......
......@@ -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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment