diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/debian/bzr-builder.manifest kicad-0.201311242216+4497~17~ubuntu12.04.1/debian/bzr-builder.manifest --- kicad-0.201311240303+4496~17~ubuntu12.04.1/debian/bzr-builder.manifest 2013-11-24 03:04:11.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/debian/bzr-builder.manifest 2013-11-24 22:18:02.000000000 +0000 @@ -1,5 +1,5 @@ -# bzr-builder format 0.3 deb-version 0.201311240303+4496~17 +# bzr-builder format 0.3 deb-version 0.201311242216+4497~17 lp:~adamwolf/+junk/kicad-packaging revid:adamwolf@feelslikeburning.com-20130405014012-04hmstdf60u067xd -nest kicad lp:kicad kicad revid:jp.charras@wanadoo.fr-20131122194710-siespezymnolisvl -nest library lp:~kicad-lib-committers/kicad/library kicad-library revid:keruseykaryu@o2.pl-20131123171922-do2fu1h4m5h3zg9m +nest kicad lp:kicad kicad revid:jp.charras@wanadoo.fr-20131124174814-ecxns2hlq9b88bqw +nest library lp:~kicad-lib-committers/kicad/library kicad-library revid:keruseykaryu@o2.pl-20131124085011-qzuf4dmer2mj6fez nest docs lp:~kicad-developers/kicad/doc kicad-doc revid:jp.charras@wanadoo.fr-20131123201243-ndihrkq520ehlaqh diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/debian/changelog kicad-0.201311242216+4497~17~ubuntu12.04.1/debian/changelog --- kicad-0.201311240303+4496~17~ubuntu12.04.1/debian/changelog 2013-11-24 03:04:11.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/debian/changelog 2013-11-24 22:18:02.000000000 +0000 @@ -1,8 +1,8 @@ -kicad (0.201311240303+4496~17~ubuntu12.04.1) precise; urgency=low +kicad (0.201311242216+4497~17~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Adam Wolf Sun, 24 Nov 2013 03:04:11 +0000 + -- Adam Wolf Sun, 24 Nov 2013 22:18:02 +0000 kicad (0.0.20130404-1) precise; urgency=low diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/common/base_struct.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/common/base_struct.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/common/base_struct.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/common/base_struct.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -532,7 +532,7 @@ /* Calculate the bounding box of this, when rotated */ -EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ) +const EDA_RECT EDA_RECT::GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ) { wxPoint corners[4]; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_arc.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_arc.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_arc.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_arc.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -484,7 +484,7 @@ } -EDA_RECT LIB_ARC::GetBoundingBox() const +const EDA_RECT LIB_ARC::GetBoundingBox() const { int minX, minY, maxX, maxY, angleStart, angleEnd; EDA_RECT rect; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_arc.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_arc.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_arc.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_arc.h 2013-11-24 22:16:55.000000000 +0000 @@ -104,7 +104,7 @@ bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -378,7 +378,7 @@ } -EDA_RECT LIB_BEZIER::GetBoundingBox() const +const EDA_RECT LIB_BEZIER::GetBoundingBox() const { EDA_RECT rect; int xmin, xmax, ymin, ymax; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_bezier.h 2013-11-24 22:16:55.000000000 +0000 @@ -76,7 +76,7 @@ bool HitTest( wxPoint aPosRef, int aThreshold, const TRANSFORM& aTransform ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual bool Inside( EDA_RECT& aRect ) const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_circle.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_circle.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_circle.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_circle.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -105,7 +105,7 @@ if( aThreshold < 0 ) aThreshold = GetPenSize() / 2; - int dist = KiROUND( GetLineLength( aPosRef, aTransform.TransformCoordinate( m_Pos ) ) ); + int dist = KiROUND( GetLineLength( aPosRef, aTransform.TransformCoordinate( m_Pos ) ) ); if( abs( dist - m_Radius ) <= aThreshold ) return true; @@ -251,7 +251,7 @@ } -EDA_RECT LIB_CIRCLE::GetBoundingBox() const +const EDA_RECT LIB_CIRCLE::GetBoundingBox() const { EDA_RECT rect; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_circle.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_circle.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_circle.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_circle.h 2013-11-24 22:16:55.000000000 +0000 @@ -67,7 +67,7 @@ int GetPenSize( ) const; - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_draw_item.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_draw_item.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_draw_item.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_draw_item.h 2013-11-24 22:16:55.000000000 +0000 @@ -260,7 +260,7 @@ /** * @return the boundary box for this, in library coordinates */ - virtual EDA_RECT GetBoundingBox() const { return EDA_ITEM::GetBoundingBox(); } + virtual const EDA_RECT GetBoundingBox() const { return EDA_ITEM::GetBoundingBox(); } /** * Function GetMsgPanelInfo diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_field.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_field.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_field.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_field.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -524,7 +524,7 @@ } -EDA_RECT LIB_FIELD::GetBoundingBox() const +const EDA_RECT LIB_FIELD::GetBoundingBox() const { /* 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. diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_field.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_field.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_field.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_field.h 2013-11-24 22:16:55.000000000 +0000 @@ -165,7 +165,7 @@ return (m_Attributs & TEXT_NO_VISIBLE) == 0 ? true : false; } - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_pin.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_pin.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_pin.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_pin.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -1869,7 +1869,7 @@ } -EDA_RECT LIB_PIN::GetBoundingBox() const +const EDA_RECT LIB_PIN::GetBoundingBox() const { LIB_COMPONENT* entry = (LIB_COMPONENT*) m_Parent; EDA_RECT bbox; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_pin.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_pin.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_pin.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_pin.h 2013-11-24 22:16:55.000000000 +0000 @@ -139,7 +139,7 @@ bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual /** * Function ReturnPinEndPoint diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -353,7 +353,7 @@ } -EDA_RECT LIB_POLYLINE::GetBoundingBox() const +const EDA_RECT LIB_POLYLINE::GetBoundingBox() const { EDA_RECT rect; int xmin, xmax, ymin, ymax; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_polyline.h 2013-11-24 22:16:55.000000000 +0000 @@ -78,7 +78,7 @@ bool HitTest( wxPoint aPosition, int aThreshold, const TRANSFORM& aTransform ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual int GetPenSize( ) const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -256,7 +256,7 @@ } -EDA_RECT LIB_RECTANGLE::GetBoundingBox() const +const EDA_RECT LIB_RECTANGLE::GetBoundingBox() const { EDA_RECT rect; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_rectangle.h 2013-11-24 22:16:55.000000000 +0000 @@ -71,7 +71,7 @@ int GetPenSize( ) const; - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_text.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_text.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_text.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_text.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -430,7 +430,7 @@ } -EDA_RECT LIB_TEXT::GetBoundingBox() const +const EDA_RECT LIB_TEXT::GetBoundingBox() const { /* 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. diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_text.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_text.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/lib_text.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/lib_text.h 2013-11-24 22:16:55.000000000 +0000 @@ -96,7 +96,7 @@ void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // virtual void Rotate(); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -176,7 +176,7 @@ } -EDA_RECT SCH_BITMAP::GetBoundingBox() const +const EDA_RECT SCH_BITMAP::GetBoundingBox() const { EDA_RECT rect = m_Image->GetBoundingBox(); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bitmap.h 2013-11-24 22:16:55.000000000 +0000 @@ -90,7 +90,7 @@ */ wxSize GetSize() const; - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void SwapData( SCH_ITEM* aItem ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -110,7 +110,7 @@ } -bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg, +bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg, SCH_ITEM **out ) { char Name1[256]; @@ -136,7 +136,7 @@ this_new = new SCH_BUS_WIRE_ENTRY; *out = this_new; - if( !aLine.ReadLine() || sscanf( (char*) aLine, "%d %d %d %d ", + if( !aLine.ReadLine() || sscanf( (char*) aLine, "%d %d %d %d ", &this_new->m_pos.x, &this_new->m_pos.y, &this_new->m_size.x, &this_new->m_size.y ) != 4 ) { @@ -153,7 +153,7 @@ } -EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const +const EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const { EDA_RECT box; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_bus_entry.h 2013-11-24 22:16:55.000000000 +0000 @@ -76,7 +76,7 @@ static bool Load( LINE_READER& aLine, wxString& aErrorMsg, SCH_ITEM **out ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void Move( const wxPoint& aMoveVector ) { diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_component.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_component.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_component.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_component.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -1430,7 +1430,7 @@ } -EDA_RECT SCH_COMPONENT::GetBoundingBox() const +const EDA_RECT SCH_COMPONENT::GetBoundingBox() const { EDA_RECT bbox = GetBodyBoundingBox(); for( size_t i = 0; i < m_Fields.size(); i++ ) diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_component.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_component.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_component.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_component.h 2013-11-24 22:16:55.000000000 +0000 @@ -220,7 +220,7 @@ */ void SetTimeStamp( time_t aNewTimeStamp ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual //---------------------------------------------------------------- diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_field.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_field.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_field.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_field.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -259,7 +259,7 @@ } -EDA_RECT SCH_FIELD::GetBoundingBox() const +const EDA_RECT SCH_FIELD::GetBoundingBox() const { SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) m_Parent; int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_field.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_field.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_field.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_field.h 2013-11-24 22:16:55.000000000 +0000 @@ -100,7 +100,7 @@ void Place( SCH_EDIT_FRAME* frame, wxDC* DC ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual /** * Function IsVoid diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_junction.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_junction.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_junction.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_junction.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -98,7 +98,7 @@ } -EDA_RECT SCH_JUNCTION::GetBoundingBox() const +const EDA_RECT SCH_JUNCTION::GetBoundingBox() const { EDA_RECT rect; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_junction.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_junction.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_junction.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_junction.h 2013-11-24 22:16:55.000000000 +0000 @@ -55,7 +55,7 @@ void SwapData( SCH_ITEM* aItem ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor = UNSPECIFIED_COLOR ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_line.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_line.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_line.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_line.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -116,7 +116,7 @@ #endif -EDA_RECT SCH_LINE::GetBoundingBox() const +const EDA_RECT SCH_LINE::GetBoundingBox() const { int width = 25; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_line.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_line.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_line.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_line.h 2013-11-24 22:16:55.000000000 +0000 @@ -76,7 +76,7 @@ void SetEndPoint( const wxPoint& aPosition ) { m_end = aPosition; } - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual /** * Function GetLength diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_marker.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_marker.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_marker.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_marker.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -151,7 +151,7 @@ * object, and the units should be in the pcb or schematic coordinate system. * It is OK to overestimate the size by a few counts. */ -EDA_RECT SCH_MARKER::GetBoundingBox() const +const EDA_RECT SCH_MARKER::GetBoundingBox() const { return GetBoundingBoxMarker(); } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_marker.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_marker.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_marker.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_marker.h 2013-11-24 22:16:55.000000000 +0000 @@ -72,7 +72,7 @@ bool Save( FILE* aFile ) const; - EDA_RECT GetBoundingBox() const; + EDA_RECT const GetBoundingBox() const; // Virtual // Geometric transforms (used in block operations): diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -71,7 +71,7 @@ } -EDA_RECT SCH_NO_CONNECT::GetBoundingBox() const +const EDA_RECT SCH_NO_CONNECT::GetBoundingBox() const { int delta = ( GetPenSize() + m_size.x ) / 2; EDA_RECT box; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_no_connect.h 2013-11-24 22:16:55.000000000 +0000 @@ -62,7 +62,7 @@ bool Load( LINE_READER& aLine, wxString& aErrorMsg ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual // Geometric transforms (used in block operations): diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -628,7 +628,7 @@ } -EDA_RECT SCH_SHEET::GetBoundingBox() const +const EDA_RECT SCH_SHEET::GetBoundingBox() const { wxPoint end; EDA_RECT box( m_pos, m_size ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_sheet.h 2013-11-24 22:16:55.000000000 +0000 @@ -398,7 +398,7 @@ GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor = UNSPECIFIED_COLOR ); - EDA_RECT GetBoundingBox() const; + EDA_RECT const GetBoundingBox() const; /** * Function GetResizePos diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_text.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_text.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_text.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_text.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -574,7 +574,7 @@ } -EDA_RECT SCH_TEXT::GetBoundingBox() const +const EDA_RECT SCH_TEXT::GetBoundingBox() const { // We must pass the effective text thickness to GetTextBox // when calculating the bounding box @@ -969,7 +969,7 @@ } -EDA_RECT SCH_LABEL::GetBoundingBox() const +const EDA_RECT SCH_LABEL::GetBoundingBox() const { int x, y, dx, dy, length, height; @@ -1397,7 +1397,7 @@ } -EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const +const EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const { int x, y, dx, dy, length, height; @@ -1663,7 +1663,7 @@ } -EDA_RECT SCH_HIERLABEL::GetBoundingBox() const +const EDA_RECT SCH_HIERLABEL::GetBoundingBox() const { int x, y, dx, dy, length, height; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_text.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_text.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/eeschema/sch_text.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/eeschema/sch_text.h 2013-11-24 22:16:55.000000000 +0000 @@ -151,7 +151,7 @@ virtual void SwapData( SCH_ITEM* aItem ); - virtual EDA_RECT GetBoundingBox() const; + virtual const EDA_RECT GetBoundingBox() const; virtual bool Save( FILE* aFile ) const; @@ -249,7 +249,7 @@ void Rotate( wxPoint aPosition ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual bool Save( FILE* aFile ) const; @@ -298,7 +298,7 @@ bool Load( LINE_READER& aLine, wxString& aErrorMsg ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void CreateGraphicShape( std::vector & aPoints, const wxPoint& aPos ); @@ -353,7 +353,7 @@ bool Load( LINE_READER& aLine, wxString& aErrorMsg ); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual void MirrorY( int aYaxis_position ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -234,7 +234,7 @@ } -EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox() const +const EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox() const { // return a rectangle which is (pos,dim) in nature. therefore the +1 EDA_RECT bbox( m_Start, wxSize( 1, 1 ) ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/gerbview/class_gerber_draw_item.h 2013-11-24 22:16:55.000000000 +0000 @@ -218,7 +218,7 @@ */ D_CODE* GetDcodeDescr(); - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; // Virtual /* Display on screen: */ void Draw( EDA_DRAW_PANEL* aPanel, diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/include/base_struct.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/include/base_struct.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/include/base_struct.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/include/base_struct.h 2013-11-24 22:16:55.000000000 +0000 @@ -283,7 +283,7 @@ * useful to calculate bounding box of rotated items, when * rotation if not k*90 degrees */ - EDA_RECT GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ); + const EDA_RECT GetBoundingBoxRotated( wxPoint aRotCenter, double aAngle ); }; @@ -476,7 +476,7 @@ * system. * It is OK to overestimate the size by a few counts. */ - virtual EDA_RECT GetBoundingBox() const + virtual const EDA_RECT GetBoundingBox() const { #if defined(DEBUG) printf( "Missing GetBoundingBox()\n" ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/include/wxPcbStruct.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/include/wxPcbStruct.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/include/wxPcbStruct.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/include/wxPcbStruct.h 2013-11-24 22:16:55.000000000 +0000 @@ -1531,52 +1531,6 @@ */ void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ); - /** - * Function GetOptimalModulePlacement - * searches for the optimal position of the \a aModule. - * - * @param aModule A pointer to the MODULE object to get the optimal placement. - * @param aDC The device context to draw on. - * @return 1 if placement impossible or 0 if OK. - */ - int GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ); - - void GenModuleOnBoard( MODULE* Module ); - - /** - * Function Compute_Ratsnest_PlaceModule - * displays the module's ratsnest during displacement, and assess the "cost" - * of the position. - * - * The cost is the longest ratsnest distance with penalty for connections - * approaching 45 degrees. - */ - double Compute_Ratsnest_PlaceModule( wxDC* DC ); - - /** - * Function GenPlaceBoard - * generates board board (component side copper + rating): - * Allocate the memory needed to represent in "bitmap" on the grid - * Current: - * - The size of clearance area of component (the board) - * - The bitmap PENALTIES - * And initialize the cells of the board has - * - Hole in the cells occupied by a segment EDGE - * - CELL_is_ZONE for cell internal contour EDGE (if closed) - * - * Placement surface (board) gives the cells internal to the contour - * PCB, and among the latter the free cells and cells already occupied - * - * The bitmap PENALTIES give cells occupied by the modules, - * Plus a surface penalty related to the number of pads of the module - * - * Bitmap of the penalty is set to 0 - * Occupation cell is a 0 leaves - */ - int GenPlaceBoard(); - - void DrawInfoPlace( wxDC* DC ); - // Autorouting: int Solve( wxDC* DC, int two_sides ); void Reset_Noroutable( wxDC* DC ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/autorouter/autoplac.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/autorouter/autoplac.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/autorouter/autoplac.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/autorouter/autoplac.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -50,6 +49,8 @@ #include #include #include +#include +#include #define GAIN 16 @@ -57,54 +58,85 @@ /* Penalty for guidance given by CntRot90 and CntRot180: - * graduated from 0 (rotation allowed) to 10 (rotation count null) + * graduated from 0 (rotation allowed) to 10 (rotation not allowed) * the count is increased. */ static const double OrientPenality[11] = { - 2.0f, // CntRot = 0 rotation prohibited - 1.9f, // CntRot = 1 - 1.8f, // CntRot = 2 - 1.7f, // CntRot = 3 - 1.6f, // CntRot = 4 - 1.5f, // CntRot = 5 - 1.4f, // CntRot = 5 - 1.3f, // CntRot = 7 - 1.2f, // CntRot = 8 - 1.1f, // CntRot = 9 - 1.0f // CntRot = 10 rotation authorized, no penalty + 2.0, // CntRot = 0 rotation prohibited + 1.9, // CntRot = 1 + 1.8, // CntRot = 2 + 1.7, // CntRot = 3 + 1.6, // CntRot = 4 + 1.5, // CntRot = 5 + 1.4, // CntRot = 5 + 1.3, // CntRot = 7 + 1.2, // CntRot = 8 + 1.1, // CntRot = 9 + 1.0 // CntRot = 10 rotation authorized, no penalty }; // Cell states. -#define OUT_OF_BOARD -2 -#define OCCUPED_By_MODULE -1 - +#define OUT_OF_BOARD -2 +#define OCCUPED_By_MODULE -1 -static wxPoint CurrPosition; // Current position of the current module placement -static bool AutoPlaceShowAll = true; +static wxPoint CurrPosition; // Current position of the current module placement double MinCout; -static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ); -static void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, - int marge, int aKeepOut, int aLayerMask ); +/* generates the Routing matrix, used to fing the best placement + * of a footprint. + * Allocate a "bitmap" which is an image of the real board + * the bitmap handles: + * - The free areas + * - penalties (cell not occupied, but near occupied areas) + * - cells occupied by footprints, board cutout ... + */ +int genPlacementRoutingMatrix( BOARD* aBrd, EDA_MSG_PANEL* messagePanel ); + +/* searches for the optimal position of aModule. + * return 1 if placement impossible or 0 if OK. + */ +static int getOptimalModulePlacement( PCB_EDIT_FRAME* aFrame, + MODULE* aModule, wxDC* aDC ); + +/* + * Function compute_Ratsnest_PlaceModule + * displays the module's ratsnest during displacement, and assess the "cost" + * of the position. + * + * The cost is the longest ratsnest distance with penalty for connections + * approaching 45 degrees. + */ +static double compute_Ratsnest_PlaceModule( BOARD* aBrd ); + +/* Place a footprint on the Routing matrix. + */ +void genModuleOnRoutingMatrix( MODULE* Module ); -static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ); -static int propagate(); +static void drawInfoPlace( BOARD* aBrd, wxDC* DC ); +static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ); + +static void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, + int marge, int aKeepOut, int aLayerMask ); + +static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ); +static int propagate(); void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) { - MODULE* currModule = NULL; - wxPoint PosOK; - wxPoint memopos; - int error; - LAYER_NUM lay_tmp_TOP, lay_tmp_BOTTOM; + MODULE* currModule = NULL; + wxPoint PosOK; + wxPoint memopos; + int error; + LAYER_NUM lay_tmp_TOP, lay_tmp_BOTTOM; // Undo: init list - PICKED_ITEMS_LIST newList; + PICKED_ITEMS_LIST newList; + newList.m_Status = UR_CHANGED; - ITEM_PICKER picker( NULL, UR_CHANGED ); + ITEM_PICKER picker( NULL, UR_CHANGED ); if( GetBoard()->m_Modules == NULL ) return; @@ -113,44 +145,46 @@ switch( place_mode ) { - case PLACE_1_MODULE: - currModule = Module; + case PLACE_1_MODULE: + currModule = Module; - if( currModule == NULL ) - return; + if( currModule == NULL ) + return; - currModule->SetIsPlaced( false ); - currModule->SetNeedsPlaced( false ); - break; + currModule->SetIsPlaced( false ); + currModule->SetNeedsPlaced( false ); + break; - case PLACE_OUT_OF_BOARD: - break; + case PLACE_OUT_OF_BOARD: + break; - case PLACE_ALL: - if( !IsOK( this, _( "Footprints NOT LOCKED will be moved" ) ) ) - return; + case PLACE_ALL: - break; + if( !IsOK( this, _( "Footprints NOT LOCKED will be moved" ) ) ) + return; - case PLACE_INCREMENTAL: - if( !IsOK( this, _( "Footprints NOT PLACED will be moved" ) ) ) - return; + break; + + case PLACE_INCREMENTAL: + + if( !IsOK( this, _( "Footprints NOT PLACED will be moved" ) ) ) + return; break; } memopos = CurrPosition; - lay_tmp_BOTTOM = g_Route_Layer_BOTTOM; - lay_tmp_TOP = g_Route_Layer_TOP; + lay_tmp_BOTTOM = g_Route_Layer_BOTTOM; + lay_tmp_TOP = g_Route_Layer_TOP; RoutingMatrix.m_GridRouting = (int) GetScreen()->GetGridSize().x; // Ensure Board.m_GridRouting has a reasonable value: - if( RoutingMatrix.m_GridRouting < 10*IU_PER_MILS ) - RoutingMatrix.m_GridRouting = 10*IU_PER_MILS; // Min value = 1/1000 inch + if( RoutingMatrix.m_GridRouting < 10 * IU_PER_MILS ) + RoutingMatrix.m_GridRouting = 10 * IU_PER_MILS; // Min value = 1/100 inch // Compute module parameters used in auto place - if( GenPlaceBoard() == 0 ) + if( genPlacementRoutingMatrix( GetBoard(), m_messagePanel ) == 0 ) return; int moduleCount = 0; @@ -163,6 +197,7 @@ switch( place_mode ) { case PLACE_1_MODULE: + if( currModule == Module ) { // Module will be placed, add to undo. @@ -202,6 +237,7 @@ break; case PLACE_INCREMENTAL: + if( Module->IsLocked() ) { Module->SetIsPlaced( false ); @@ -220,14 +256,14 @@ } - if( Module->NeedsPlaced() ) // Erase from screen + if( Module->NeedsPlaced() ) // Erase from screen { moduleCount++; Module->Draw( m_canvas, DC, GR_XOR ); } else { - GenModuleOnBoard( Module ); + genModuleOnRoutingMatrix( Module ); } } @@ -235,22 +271,22 @@ if( newList.GetCount() ) SaveCopyInUndoList( newList, UR_CHANGED ); - int cnt = 0; - int ii; - wxString msg; + int cnt = 0; + int ii; + wxString msg; while( ( Module = PickModule( this, DC ) ) != NULL ) { // Display some info about activity, module placement can take a while: - msg.Printf( _("Place module %d of %d"), cnt, moduleCount ); + msg.Printf( _( "Place module %d of %d" ), cnt, moduleCount ); SetStatusText( msg ); // Display fill area of interest, barriers, penalties. - DrawInfoPlace( DC ); + drawInfoPlace( GetBoard(), DC ); - error = GetOptimalModulePlacement( Module, DC ); + error = getOptimalModulePlacement( this, Module, DC ); double BestScore = MinCout; - PosOK = CurrPosition; + PosOK = CurrPosition; if( error == ESC ) goto end_of_tst; @@ -263,13 +299,13 @@ int Angle_Rot_Module = 1800; Rotate_Module( DC, Module, Angle_Rot_Module, false ); Module->CalculateBoundingBox(); - error = GetOptimalModulePlacement( Module, DC ); + error = getOptimalModulePlacement( this, Module, DC ); MinCout *= OrientPenality[ii]; - if( BestScore > MinCout ) // This orientation is best. + if( BestScore > MinCout ) // This orientation is best. { - PosOK = CurrPosition; - BestScore = MinCout; + PosOK = CurrPosition; + BestScore = MinCout; } else { @@ -288,13 +324,13 @@ { int Angle_Rot_Module = 900; Rotate_Module( DC, Module, Angle_Rot_Module, false ); - error = GetOptimalModulePlacement( Module, DC ); + error = getOptimalModulePlacement( this, Module, DC ); MinCout *= OrientPenality[ii]; - if( BestScore > MinCout ) // This orientation is best. + if( BestScore > MinCout ) // This orientation is best. { - PosOK = CurrPosition; - BestScore = MinCout; + PosOK = CurrPosition; + BestScore = MinCout; } else { @@ -306,20 +342,20 @@ goto end_of_tst; } - // Determine if the best orientation of a module is 270. + // Determine if the best orientation of a module is 270. ii = (Module->GetPlacementCost90() >> 4 ) & 0x0F; if( ii != 0 ) { int Angle_Rot_Module = 2700; Rotate_Module( DC, Module, Angle_Rot_Module, false ); - error = GetOptimalModulePlacement( Module, DC ); + error = getOptimalModulePlacement( this, Module, DC ); MinCout *= OrientPenality[ii]; - if( BestScore > MinCout ) // This orientation is best. + if( BestScore > MinCout ) // This orientation is best. { - PosOK = CurrPosition; - BestScore = MinCout; + PosOK = CurrPosition; + BestScore = MinCout; } else { @@ -344,7 +380,7 @@ Module->CalculateBoundingBox(); - GenModuleOnBoard( Module ); + genModuleOnRoutingMatrix( Module ); Module->SetIsPlaced( true ); Module->SetNeedsPlaced( false ); } @@ -353,8 +389,8 @@ RoutingMatrix.UnInitRoutingMatrix(); - g_Route_Layer_TOP = lay_tmp_TOP; - g_Route_Layer_BOTTOM = lay_tmp_BOTTOM; + g_Route_Layer_TOP = lay_tmp_TOP; + g_Route_Layer_BOTTOM = lay_tmp_BOTTOM; Module = GetBoard()->m_Modules; @@ -369,11 +405,11 @@ } -void PCB_EDIT_FRAME::DrawInfoPlace( wxDC* DC ) +void drawInfoPlace( BOARD* aBrd, wxDC* DC ) { - int ii, jj; + int ii, jj; EDA_COLOR_T color; - int ox, oy; + int ox, oy; MATRIX_CELL top_state, bottom_state; GRSetDrawMode( DC, GR_COPY ); @@ -384,11 +420,11 @@ for( jj = 0; jj < RoutingMatrix.m_Ncols; jj++ ) { - ox = RoutingMatrix.m_BrdBox.GetX() + (jj * RoutingMatrix.m_GridRouting); - color = BLACK; + ox = RoutingMatrix.m_BrdBox.GetX() + (jj * RoutingMatrix.m_GridRouting); + color = BLACK; - top_state = RoutingMatrix.GetCell( ii, jj, TOP ); - bottom_state = RoutingMatrix.GetCell( ii, jj, BOTTOM ); + top_state = RoutingMatrix.GetCell( ii, jj, TOP ); + bottom_state = RoutingMatrix.GetCell( ii, jj, BOTTOM ); if( top_state & CELL_is_ZONE ) color = BLUE; @@ -400,43 +436,43 @@ color = LIGHTRED; else if( bottom_state & (HOLE | CELL_is_MODULE) ) color = LIGHTGREEN; - else // Display the filling and keep out regions. + else // Display the filling and keep out regions. { - if( RoutingMatrix.GetDist( ii, jj, TOP ) || - RoutingMatrix.GetDist( ii, jj, BOTTOM ) ) + if( RoutingMatrix.GetDist( ii, jj, TOP ) + || RoutingMatrix.GetDist( ii, jj, BOTTOM ) ) color = DARKGRAY; } - GRPutPixel( m_canvas->GetClipBox(), DC, ox, oy, color ); + GRPutPixel( NULL, DC, ox, oy, color ); } } } -int PCB_EDIT_FRAME::GenPlaceBoard() +int genPlacementRoutingMatrix( BOARD* aBrd, EDA_MSG_PANEL* messagePanel ) { - wxString msg; + wxString msg; RoutingMatrix.UnInitRoutingMatrix(); - EDA_RECT bbox = GetBoard()->ComputeBoundingBox( true ); + EDA_RECT bbox = aBrd->ComputeBoundingBox( true ); if( bbox.GetWidth() == 0 || bbox.GetHeight() == 0 ) { - DisplayError( this, _( "No PCB edge found, unknown board size!" ) ); + DisplayError( NULL, _( "No PCB edge found, unknown board size!" ) ); return 0; } - RoutingMatrix.ComputeMatrixSize( GetBoard(), true ); + RoutingMatrix.ComputeMatrixSize( aBrd, true ); int nbCells = RoutingMatrix.m_Ncols * RoutingMatrix.m_Nrows; - m_messagePanel->EraseMsgBox(); + messagePanel->EraseMsgBox(); msg.Printf( wxT( "%d" ), RoutingMatrix.m_Ncols ); - m_messagePanel->SetMessage( 1, _( "Cols" ), msg, GREEN ); + messagePanel->SetMessage( 1, _( "Cols" ), msg, GREEN ); msg.Printf( wxT( "%d" ), RoutingMatrix.m_Nrows ); - m_messagePanel->SetMessage( 7, _( "Lines" ), msg, GREEN ); + messagePanel->SetMessage( 7, _( "Lines" ), msg, GREEN ); msg.Printf( wxT( "%d" ), nbCells ); - m_messagePanel->SetMessage( 14, _( "Cells." ), msg, YELLOW ); + messagePanel->SetMessage( 14, _( "Cells." ), msg, YELLOW ); // Choose the number of board sides. RoutingMatrix.m_RoutingLayersCount = 2; @@ -445,7 +481,7 @@ // Display memory usage. msg.Printf( wxT( "%d" ), RoutingMatrix.m_MemSize / 1024 ); - m_messagePanel->SetMessage( 24, wxT( "Mem(Kb)" ), msg, CYAN ); + messagePanel->SetMessage( 24, wxT( "Mem(Kb)" ), msg, CYAN ); g_Route_Layer_BOTTOM = LAYER_N_FRONT; @@ -461,7 +497,7 @@ TmpSegm.SetNet( -1 ); TmpSegm.SetWidth( RoutingMatrix.m_GridRouting / 2 ); - EDA_ITEM* PtStruct = GetBoard()->m_Drawings; + EDA_ITEM* PtStruct = aBrd->m_Drawings; for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) { @@ -476,7 +512,7 @@ break; TmpSegm.SetStart( DrawSegm->GetStart() ); - TmpSegm.SetEnd( DrawSegm->GetEnd() ); + TmpSegm.SetEnd( DrawSegm->GetEnd() ); TmpSegm.SetShape( DrawSegm->GetShape() ); TmpSegm.m_Param = DrawSegm->GetAngle(); @@ -509,19 +545,21 @@ } -/* Place module on board. +/* Place module on Routing matrix. */ -void PCB_EDIT_FRAME::GenModuleOnBoard( MODULE* Module ) +void genModuleOnRoutingMatrix( MODULE* Module ) { - int ox, oy, fx, fy; - int marge = RoutingMatrix.m_GridRouting / 2; - int layerMask; - D_PAD* Pad; - - ox = Module->GetBoundingBox().GetX() - marge; - fx = Module->GetBoundingBox().GetRight() + marge; - oy = Module->GetBoundingBox().GetY() - marge; - fy = Module->GetBoundingBox().GetBottom() + marge; + int ox, oy, fx, fy; + int layerMask; + D_PAD* Pad; + + EDA_RECT fpBBox = Module->GetBoundingBox(); + + fpBBox.Inflate( RoutingMatrix.m_GridRouting / 2 ); + ox = fpBBox.GetX(); + fx = fpBBox.GetRight(); + oy = fpBBox.GetY(); + fy = fpBBox.GetBottom(); if( ox < RoutingMatrix.m_BrdBox.GetX() ) ox = RoutingMatrix.m_BrdBox.GetX(); @@ -558,70 +596,69 @@ TraceFilledRectangle( ox, oy, fx, fy, layerMask, CELL_is_MODULE, WRITE_OR_CELL ); - int trackWidth = GetBoard()->m_NetClasses.GetDefault()->GetTrackWidth(); - int clearance = GetBoard()->m_NetClasses.GetDefault()->GetClearance(); - - // Trace pads and surface safely. - marge = trackWidth + clearance; - + // Trace pads + clearance areas. for( Pad = Module->Pads(); Pad != NULL; Pad = Pad->Next() ) { - ::PlacePad( Pad, CELL_is_MODULE, marge, WRITE_OR_CELL ); + int margin = (RoutingMatrix.m_GridRouting / 2) + Pad->GetClearance(); + ::PlacePad( Pad, CELL_is_MODULE, margin, WRITE_OR_CELL ); } // Trace clearance. - marge = ( RoutingMatrix.m_GridRouting * Module->GetPadCount() ) / GAIN; - CreateKeepOutRectangle( ox, oy, fx, fy, marge, KEEP_OUT_MARGIN, layerMask ); + int margin = ( RoutingMatrix.m_GridRouting * Module->GetPadCount() ) / GAIN; + CreateKeepOutRectangle( ox, oy, fx, fy, margin, KEEP_OUT_MARGIN, layerMask ); } -int PCB_EDIT_FRAME::GetOptimalModulePlacement( MODULE* aModule, wxDC* aDC ) +int getOptimalModulePlacement( PCB_EDIT_FRAME* aFrame, MODULE* aModule, wxDC* aDC ) { - int cx, cy; - int ox, oy, fx, fy; // occupying part of the module focuses on the cursor int error = 1; - int showRat = 0; wxPoint LastPosOK; - double mincout, cout, Score; - int keepOut; + double min_cost, curr_cost, Score; bool TstOtherSide; bool showRats = g_Show_Module_Ratsnest; + BOARD* brd = aFrame->GetBoard(); g_Show_Module_Ratsnest = false; - SetMsgPanel( aModule ); + brd->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; + aFrame->SetMsgPanel( aModule ); + + LastPosOK = RoutingMatrix.m_BrdBox.GetOrigin(); + + wxPoint mod_pos = aModule->GetPosition(); + EDA_RECT fpBBox = aModule->GetFootprintRect(); + + // Move fpBBox to have the footprint position at (0,0) + fpBBox.Move( -mod_pos ); + wxPoint fpBBoxOrg = fpBBox.GetOrigin(); + + // Calculate the limit of the footprint position, relative + // to the routing matrix area + wxPoint xylimit = RoutingMatrix.m_BrdBox.GetEnd() - fpBBox.GetEnd(); - LastPosOK.x = RoutingMatrix.m_BrdBox.GetX(); - LastPosOK.y = RoutingMatrix.m_BrdBox.GetY(); + wxPoint initialPos = RoutingMatrix.m_BrdBox.GetOrigin() - fpBBoxOrg; - cx = aModule->GetPosition().x; - cy = aModule->GetPosition().y; - ox = aModule->GetBoundingBox().GetX() - cx; - fx = aModule->GetBoundingBox().GetWidth() + ox; - oy = aModule->GetBoundingBox().GetY() - cy; - fy = aModule->GetBoundingBox().GetHeight() + oy; - - CurrPosition.x = RoutingMatrix.m_BrdBox.GetX() - ox; - CurrPosition.y = RoutingMatrix.m_BrdBox.GetY() - oy; - - // Module placement on grid. - CurrPosition.x -= CurrPosition.x % RoutingMatrix.m_GridRouting; - CurrPosition.y -= CurrPosition.y % RoutingMatrix.m_GridRouting; - - g_Offset_Module.x = cx - CurrPosition.x; - g_Offset_Module.y = cy - CurrPosition.y; - GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; - - /* Test pads, a printed circuit with components of the 2 dimensions - * can become a component on opposite side if there is at least 1 patch - * appearing on the other side. + // Stay on grid. + initialPos.x -= initialPos.x % RoutingMatrix.m_GridRouting; + initialPos.y -= initialPos.y % RoutingMatrix.m_GridRouting; + + CurrPosition = initialPos; + + // Undraw the current footprint + g_Offset_Module = wxPoint( 0, 0 ); + DrawModuleOutlines( aFrame->GetCanvas(), aDC, aModule ); + + g_Offset_Module = mod_pos - CurrPosition; + + /* Examine pads, and set TstOtherSide to true if a footprint + * has at least 1 pad through. */ TstOtherSide = false; if( RoutingMatrix.m_RoutingLayersCount > 1 ) { - D_PAD* Pad; - int otherLayerMask = LAYER_BACK; + D_PAD* Pad; + int otherLayerMask = LAYER_BACK; if( aModule->GetLayer() == LAYER_N_BACK ) otherLayerMask = LAYER_FRONT; @@ -636,102 +673,75 @@ } } - DrawModuleOutlines( m_canvas, aDC, aModule ); + // Draw the initial bounding box position + fpBBox.SetOrigin( fpBBoxOrg + CurrPosition ); + GRRect( aFrame->GetCanvas()->GetClipBox(), aDC, fpBBox, 0, BROWN ); - mincout = -1.0; - SetStatusText( wxT( "Score ??, pos ??" ) ); + min_cost = -1.0; + aFrame->SetStatusText( wxT( "Score ??, pos ??" ) ); - for( ; CurrPosition.x < RoutingMatrix.m_BrdBox.GetRight() - fx; - CurrPosition.x += RoutingMatrix.m_GridRouting ) + for( ; CurrPosition.x < xylimit.x; CurrPosition.x += RoutingMatrix.m_GridRouting ) { wxYield(); - if( m_canvas->GetAbortRequest() ) + if( aFrame->GetCanvas()->GetAbortRequest() ) { - if( IsOK( this, _( "OK to abort?" ) ) ) + if( IsOK( aFrame, _( "OK to abort?" ) ) ) return ESC; else - m_canvas->SetAbortRequest( false ); + aFrame->GetCanvas()->SetAbortRequest( false ); } - cx = aModule->GetPosition().x; - cy = aModule->GetPosition().y; - aModule->GetBoundingBox().SetX( ox + CurrPosition.x ); - aModule->GetBoundingBox().SetY( oy + CurrPosition.y ); - - DrawModuleOutlines( m_canvas, aDC, aModule ); + CurrPosition.y = initialPos.y; - g_Offset_Module.x = cx - CurrPosition.x; - CurrPosition.y = RoutingMatrix.m_BrdBox.GetY() - oy; - - // Placement on grid. - CurrPosition.y -= CurrPosition.y % RoutingMatrix.m_GridRouting; - - DrawModuleOutlines( m_canvas, aDC, aModule ); - - for( ; CurrPosition.y < RoutingMatrix.m_BrdBox.GetBottom() - fy; - CurrPosition.y += RoutingMatrix.m_GridRouting ) + for( ; CurrPosition.y < xylimit.y; CurrPosition.y += RoutingMatrix.m_GridRouting ) { #ifndef USE_WX_OVERLAY // Erase traces. - DrawModuleOutlines( m_canvas, aDC, aModule ); - - if( showRat ) - Compute_Ratsnest_PlaceModule( aDC ); + GRRect( aFrame->GetCanvas()->GetClipBox(), aDC, fpBBox, 0, BROWN ); #endif - showRat = 0; - aModule->GetBoundingBox().SetX( ox + CurrPosition.x ); - aModule->GetBoundingBox().SetY( oy + CurrPosition.y ); - g_Offset_Module.y = cy - CurrPosition.y; + fpBBox.SetOrigin( fpBBoxOrg + CurrPosition ); + g_Offset_Module = mod_pos - CurrPosition; #ifndef USE_WX_OVERLAY - DrawModuleOutlines( m_canvas, aDC, aModule ); + // Draw at new place + GRRect( aFrame->GetCanvas()->GetClipBox(), aDC, fpBBox, 0, BROWN ); #endif - keepOut = TstModuleOnBoard( GetBoard(), aModule, TstOtherSide ); + int keepOutCost = TstModuleOnBoard( brd, aModule, TstOtherSide ); - if( keepOut >= 0 ) // i.e. if the module can be put here + if( keepOutCost >= 0 ) // i.e. if the module can be put here { error = 0; - build_ratsnest_module( aModule ); - cout = Compute_Ratsnest_PlaceModule( aDC ); - showRat = 1; - Score = cout + keepOut; + aFrame->build_ratsnest_module( aModule ); + curr_cost = compute_Ratsnest_PlaceModule( brd ); + Score = curr_cost + keepOutCost; - if( (mincout >= Score ) || (mincout < 0 ) ) + if( (min_cost >= Score ) || (min_cost < 0 ) ) { - LastPosOK = CurrPosition; - mincout = Score; + LastPosOK = CurrPosition; + min_cost = Score; wxString msg; - msg.Printf( wxT( "Score %g, pos %3.4g, %3.4g" ), - mincout, - (double) LastPosOK.x / 10000, - (double) LastPosOK.y / 10000 ); - SetStatusText( msg ); + msg.Printf( wxT( "Score %g, pos %s, %s" ), + min_cost, + ::CoordinateToString( LastPosOK.x ), + ::CoordinateToString( LastPosOK.y ) ); + aFrame->SetStatusText( msg ); } } - - if( showRat ) - Compute_Ratsnest_PlaceModule( aDC ); - - showRat = 0; } } - DrawModuleOutlines( m_canvas, aDC, aModule ); // erasing the last traces + // erasing the last traces + GRRect( aFrame->GetCanvas()->GetClipBox(), aDC, fpBBox, 0, BROWN ); g_Show_Module_Ratsnest = showRats; - if( showRat ) - Compute_Ratsnest_PlaceModule( aDC ); - // Regeneration of the modified variable. - aModule->GetBoundingBox().SetX( ox + cx ); - aModule->GetBoundingBox().SetY( oy + cy ); CurrPosition = LastPosOK; - GetBoard()->m_Status_Pcb &= ~( RATSNEST_ITEM_LOCAL_OK | LISTE_PAD_OK ); + brd->m_Status_Pcb &= ~( RATSNEST_ITEM_LOCAL_OK | LISTE_PAD_OK ); - MinCout = mincout; + MinCout = min_cost; return error; } @@ -740,29 +750,29 @@ * - is a free zone (except OCCUPED_By_MODULE returns) * - is on the working surface of the board (otherwise returns OUT_OF_BOARD) * - * Returns 0 if OK + * Returns OUT_OF_BOARD, or, OCCUPED_By_MODULE or 0 if OK */ -int TstRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int side ) +int TstRectangle( BOARD* Pcb, const EDA_RECT& aRect, int side ) { - int row, col; - int row_min, row_max, col_min, col_max; - unsigned int data; - - ux0 -= Pcb->GetBoundingBox().GetX(); - uy0 -= Pcb->GetBoundingBox().GetY(); - ux1 -= Pcb->GetBoundingBox().GetX(); - uy1 -= Pcb->GetBoundingBox().GetY(); + EDA_RECT rect = aRect; - row_max = uy1 / RoutingMatrix.m_GridRouting; - col_max = ux1 / RoutingMatrix.m_GridRouting; - row_min = uy0 / RoutingMatrix.m_GridRouting; + rect.Inflate( RoutingMatrix.m_GridRouting / 2 ); - if( uy0 > row_min * RoutingMatrix.m_GridRouting ) - row_min++; + wxPoint start = rect.GetOrigin(); + wxPoint end = rect.GetEnd(); - col_min = ux0 / RoutingMatrix.m_GridRouting; + start -= RoutingMatrix.m_BrdBox.GetOrigin(); + end -= RoutingMatrix.m_BrdBox.GetOrigin(); - if( ux0 > col_min * RoutingMatrix.m_GridRouting ) + int row_min = start.y / RoutingMatrix.m_GridRouting; + int row_max = end.y / RoutingMatrix.m_GridRouting; + int col_min = start.x / RoutingMatrix.m_GridRouting; + int col_max = end.x / RoutingMatrix.m_GridRouting; + + if( start.y > row_min * RoutingMatrix.m_GridRouting ) + row_min++; + + if( start.x > col_min * RoutingMatrix.m_GridRouting ) col_min++; if( row_min < 0 ) @@ -777,16 +787,16 @@ if( col_max >= ( RoutingMatrix.m_Ncols - 1 ) ) col_max = RoutingMatrix.m_Ncols - 1; - for( row = row_min; row <= row_max; row++ ) + for( int row = row_min; row <= row_max; row++ ) { - for( col = col_min; col <= col_max; col++ ) + for( int col = col_min; col <= col_max; col++ ) { - data = RoutingMatrix.GetCell( row, col, side ); + unsigned int data = RoutingMatrix.GetCell( row, col, side ); if( ( data & CELL_is_ZONE ) == 0 ) return OUT_OF_BOARD; - if( data & CELL_is_MODULE ) + if( (data & CELL_is_MODULE) ) return OCCUPED_By_MODULE; } } @@ -796,30 +806,26 @@ /* Calculates and returns the clearance area of the rectangular surface - * (ux, ux .. y0, y1): + * aRect): * (Sum of cells in terms of distance) */ -unsigned int CalculateKeepOutArea( int ux0, int uy0, int ux1, int uy1, int side ) +unsigned int CalculateKeepOutArea( const EDA_RECT& aRect, int side ) { - int row, col; - int row_min, row_max, col_min, col_max; - unsigned int keepOut; + wxPoint start = aRect.GetOrigin(); + wxPoint end = aRect.GetEnd(); - ux0 -= RoutingMatrix.m_BrdBox.GetX(); - uy0 -= RoutingMatrix.m_BrdBox.GetY(); - ux1 -= RoutingMatrix.m_BrdBox.GetX(); - uy1 -= RoutingMatrix.m_BrdBox.GetY(); + start -= RoutingMatrix.m_BrdBox.GetOrigin(); + end -= RoutingMatrix.m_BrdBox.GetOrigin(); - row_max = uy1 / RoutingMatrix.m_GridRouting; - col_max = ux1 / RoutingMatrix.m_GridRouting; - row_min = uy0 / RoutingMatrix.m_GridRouting; + int row_min = start.y / RoutingMatrix.m_GridRouting; + int row_max = end.y / RoutingMatrix.m_GridRouting; + int col_min = start.x / RoutingMatrix.m_GridRouting; + int col_max = end.x / RoutingMatrix.m_GridRouting; - if( uy0 > row_min * RoutingMatrix.m_GridRouting ) + if( start.y > row_min * RoutingMatrix.m_GridRouting ) row_min++; - col_min = ux0 / RoutingMatrix.m_GridRouting; - - if( ux0 > col_min * RoutingMatrix.m_GridRouting ) + if( start.x > col_min * RoutingMatrix.m_GridRouting ) col_min++; if( row_min < 0 ) @@ -834,104 +840,95 @@ if( col_max >= ( RoutingMatrix.m_Ncols - 1 ) ) col_max = RoutingMatrix.m_Ncols - 1; - keepOut = 0; + unsigned int keepOutCost = 0; - for( row = row_min; row <= row_max; row++ ) + for( int row = row_min; row <= row_max; row++ ) { - for( col = col_min; col <= col_max; col++ ) + for( int col = col_min; col <= col_max; col++ ) { - keepOut += RoutingMatrix.GetDist( row, col, side ); + // RoutingMatrix.GetDist returns the "cost" of the cell + // at position (row, col) + // in autoplace this is the cost of the cell, if it is + // inside aRect + keepOutCost += RoutingMatrix.GetDist( row, col, side ); } } - return keepOut; + return keepOutCost; } /* Test if the module can be placed on the board. * Returns the value TstRectangle(). - * Module is known by its rectangle + * Module is known by its bounding box */ -int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ) +int TstModuleOnBoard( BOARD* Pcb, MODULE* aModule, bool TstOtherSide ) { - int ox, oy, fx, fy; - int error, marge, side, otherside; - - side = TOP; otherside = BOTTOM; + int side = TOP; + int otherside = BOTTOM; - if( Module->GetLayer() == LAYER_N_BACK ) + if( aModule->GetLayer() == LAYER_N_BACK ) { side = BOTTOM; otherside = TOP; } - ox = Module->GetBoundingBox().GetX(); - fx = Module->GetBoundingBox().GetRight(); - oy = Module->GetBoundingBox().GetY(); - fy = Module->GetBoundingBox().GetBottom(); + EDA_RECT fpBBox = aModule->GetFootprintRect(); + fpBBox.Move( -g_Offset_Module ); - error = TstRectangle( Pcb, ox, oy, fx, fy, side ); + int diag = TstRectangle( Pcb, fpBBox, side ); - if( error < 0 ) - return error; + if( diag < 0 ) + return diag; if( TstOtherSide ) { - error = TstRectangle( Pcb, ox, oy, fx, fy, otherside ); + diag = TstRectangle( Pcb, fpBBox, otherside ); - if( error < 0 ) - return error; + if( diag < 0 ) + return diag; } - marge = ( RoutingMatrix.m_GridRouting * Module->GetPadCount() ) / GAIN; + int marge = ( RoutingMatrix.m_GridRouting * aModule->GetPadCount() ) / GAIN; - return CalculateKeepOutArea( ox - marge, oy - marge, fx + marge, fy + marge, side ); + fpBBox.Inflate( marge ); + return CalculateKeepOutArea( fpBBox, side ); } -double PCB_EDIT_FRAME::Compute_Ratsnest_PlaceModule( wxDC* DC ) +double compute_Ratsnest_PlaceModule( BOARD* aBrd ) { - double cout, icout; + double curr_cost; wxPoint start; // start point of a ratsnest wxPoint end; // end point of a ratsnest - int dx, dy; + int dx, dy; - if( ( GetBoard()->m_Status_Pcb & RATSNEST_ITEM_LOCAL_OK ) == 0 ) + if( ( aBrd->m_Status_Pcb & RATSNEST_ITEM_LOCAL_OK ) == 0 ) return -1; - cout = 0; - - EDA_COLOR_T color = g_ColorsSettings.GetItemColor(RATSNEST_VISIBLE); - - if( AutoPlaceShowAll ) - GRSetDrawMode( DC, GR_XOR ); + curr_cost = 0; - for( unsigned ii = 0; ii < GetBoard()->m_LocalRatsnest.size(); ii++ ) + for( unsigned ii = 0; ii < aBrd->m_LocalRatsnest.size(); ii++ ) { - RATSNEST_ITEM* pt_local_rats_nest = &GetBoard()->m_LocalRatsnest[ii]; + RATSNEST_ITEM* pt_local_rats_nest = &aBrd->m_LocalRatsnest[ii]; if( ( pt_local_rats_nest->m_Status & LOCAL_RATSNEST_ITEM ) ) - continue; // Skip ratsnest between 2 pads of the current module + continue; // Skip ratsnest between 2 pads of the current module // Skip modules not inside the board area - MODULE * module = pt_local_rats_nest->m_PadEnd->GetParent(); + MODULE* module = pt_local_rats_nest->m_PadEnd->GetParent(); + if( !RoutingMatrix.m_BrdBox.Contains( module->GetPosition() ) ) continue; - start = pt_local_rats_nest->m_PadStart->GetPosition() - g_Offset_Module; - end = pt_local_rats_nest->m_PadEnd->GetPosition(); + start = pt_local_rats_nest->m_PadStart->GetPosition() - g_Offset_Module; + end = pt_local_rats_nest->m_PadEnd->GetPosition(); -#ifndef USE_WX_OVERLAY - if( AutoPlaceShowAll ) - { - GRLine( m_canvas->GetClipBox(), DC, start, end, 0, color ); - } -#endif // Cost of the ratsnest. - dx = end.x - start.x; - dy = end.y - start.y; + dx = end.x - start.x; + dy = end.y - start.y; - dx = abs( dx ); - dy = abs( dy ); + dx = abs( dx ); + dy = abs( dy ); // ttry to have always dx >= dy to calculate the cost of the rastsnet if( dx < dy ) @@ -942,11 +939,11 @@ // the penalty is max for 45 degrees ratsnests, // and 0 for horizontal or vertical ratsnests. // For Horizontal and Vertical ratsnests, dy = 0; - icout = hypot( dx, dy * 2.0 ); - cout += icout; // Total cost = sum of costs of each connection + double conn_cost = hypot( dx, dy * 2.0 ); + curr_cost += conn_cost; // Total cost = sum of costs of each connection } - return cout; + return curr_cost; } @@ -957,23 +954,23 @@ * incremented by value aKeepOut * Cell outside this rectangle, but inside the rectangle * x0,y0 -marge to x1,y1 + marge are incremented by a decreasing value - * (aKeepOut ... 0). The decreasing value de pends on the distance to the first rectangle - * Therefore the cost is high in rect x0,y0 a x1,y1, and decrease outside this rectangle + * (aKeepOut ... 0). The decreasing value depends on the distance to the first rectangle + * Therefore the cost is high in rect x0,y0 to x1,y1, and decrease outside this rectangle */ void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut, int aLayerMask ) { - int row, col; - int row_min, row_max, col_min, col_max, pmarge; - int trace = 0; - DIST_CELL data, LocalKeepOut; - int lgain, cgain; + int row, col; + int row_min, row_max, col_min, col_max, pmarge; + int trace = 0; + DIST_CELL data, LocalKeepOut; + int lgain, cgain; if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) ) - trace = 1; // Trace on bottom layer. + trace = 1; // Trace on bottom layer. if( ( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) ) && RoutingMatrix.m_RoutingLayersCount ) - trace |= 2; // Trace on top layer. + trace |= 2; // Trace on top layer. if( trace == 0 ) return; @@ -1027,6 +1024,12 @@ for( col = col_min; col <= col_max; col++ ) { + // RoutingMatrix Dist map containt the "cost" of the cell + // at position (row, col) + // in autoplace this is the cost of the cell, when + // a footprint overlaps it, near a "master" footprint + // this cost is hight near the "master" footprint + // and decrease with the distance cgain = 256; LocalKeepOut = aKeepOut; @@ -1048,8 +1051,8 @@ if( trace & 2 ) { - data = RoutingMatrix.GetDist( row, col, TOP ); - data = std::max( data, LocalKeepOut ); + data = RoutingMatrix.GetDist( row, col, TOP ); + data = std::max( data, LocalKeepOut ); RoutingMatrix.SetDist( row, col, TOP, data ); } } @@ -1088,7 +1091,7 @@ */ static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ) { - MODULE* Module; + MODULE* Module; std::vector moduleList; // Build sorted footprints list (sort by decreasing size ) @@ -1097,7 +1100,7 @@ for( ; Module != NULL; Module = Module->Next() ) { Module->CalculateBoundingBox(); - moduleList.push_back(Module); + moduleList.push_back( Module ); } sort( moduleList.begin(), moduleList.end(), Tri_PlaceModules ); @@ -1128,8 +1131,8 @@ sort( moduleList.begin(), moduleList.end(), Tri_RatsModules ); // Search for "best" module. - MODULE* bestModule = NULL; - MODULE* altModule = NULL; + MODULE* bestModule = NULL; + MODULE* altModule = NULL; for( unsigned ii = 0; ii < moduleList.size(); ii++ ) { @@ -1180,10 +1183,10 @@ */ int propagate() { - int row, col; - long current_cell, old_cell_H; - std::vector< long > pt_cell_V; - int nbpoints = 0; + int row, col; + long current_cell, old_cell_H; + std::vector pt_cell_V; + int nbpoints = 0; #define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE) @@ -1199,7 +1202,7 @@ { current_cell = RoutingMatrix.GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) // a free cell is found + if( current_cell == 0 ) // a free cell is found { if( (old_cell_H & CELL_is_ZONE) || (pt_cell_V[col] & CELL_is_ZONE) ) { @@ -1224,7 +1227,7 @@ { current_cell = RoutingMatrix.GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) // a free cell is found + if( current_cell == 0 ) // a free cell is found { if( (old_cell_H & CELL_is_ZONE) || (pt_cell_V[col] & CELL_is_ZONE) ) { @@ -1249,7 +1252,7 @@ { current_cell = RoutingMatrix.GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) // a free cell is found + if( current_cell == 0 ) // a free cell is found { if( (old_cell_H & CELL_is_ZONE) || (pt_cell_V[row] & CELL_is_ZONE) ) { @@ -1274,7 +1277,7 @@ { current_cell = RoutingMatrix.GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) // a free cell is found + if( current_cell == 0 ) // a free cell is found { if( (old_cell_H & CELL_is_ZONE) || (pt_cell_V[row] & CELL_is_ZONE) ) { diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_board.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_board.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_board.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_board.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -2134,7 +2134,7 @@ // Filter non visible modules if requested if( (!aVisibleOnly) || IsModuleLayerVisible( layer ) ) { - EDA_RECT bb = pt_module->GetFootPrintRect(); + EDA_RECT bb = pt_module->GetFootprintRect(); int offx = bb.GetX() + bb.GetWidth() / 2; int offy = bb.GetY() + bb.GetHeight() / 2; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_board.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_board.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_board.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_board.h 2013-11-24 22:16:55.000000000 +0000 @@ -857,7 +857,7 @@ * as long as the BOARD has not changed. Remember, ComputeBoundingBox()'s * aBoardEdgesOnly argument is considered in this return value also. */ - EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override + const EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -446,7 +446,7 @@ } -EDA_RECT DIMENSION::GetBoundingBox() const +const EDA_RECT DIMENSION::GetBoundingBox() const { EDA_RECT bBox; int xmin, xmax, ymin, ymax; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_dimension.h 2013-11-24 22:16:55.000000000 +0000 @@ -139,7 +139,8 @@ return wxT( "DIMENSION" ); } - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; wxString GetSelectMenuText() const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -360,7 +360,7 @@ } -EDA_RECT DRAWSEGMENT::GetBoundingBox() const +const EDA_RECT DRAWSEGMENT::GetBoundingBox() const { EDA_RECT bbox; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_drawsegment.h 2013-11-24 22:16:55.000000000 +0000 @@ -168,7 +168,7 @@ virtual void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ); - virtual EDA_RECT GetBoundingBox() const; + virtual const EDA_RECT GetBoundingBox() const; virtual bool HitTest( const wxPoint& aPosition ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_mire.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_mire.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_mire.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_mire.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -194,7 +194,7 @@ } -EDA_RECT PCB_TARGET::GetBoundingBox() const +const EDA_RECT PCB_TARGET::GetBoundingBox() const { EDA_RECT bBox; bBox.SetX( m_Pos.x - m_Size/2 ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_mire.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_mire.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_mire.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_mire.h 2013-11-24 22:16:55.000000000 +0000 @@ -92,7 +92,8 @@ */ bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const; - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; wxString GetSelectMenuText() const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_module.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_module.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_module.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_module.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -409,12 +409,12 @@ void MODULE::CalculateBoundingBox() { - m_BoundaryBox = GetFootPrintRect(); + m_BoundaryBox = GetFootprintRect(); m_Surface = std::abs( (double) m_BoundaryBox.GetWidth() * m_BoundaryBox.GetHeight() ); } -EDA_RECT MODULE::GetFootPrintRect() const +EDA_RECT MODULE::GetFootprintRect() const { EDA_RECT area; @@ -433,9 +433,9 @@ } -EDA_RECT MODULE::GetBoundingBox() const +const EDA_RECT MODULE::GetBoundingBox() const { - EDA_RECT area = GetFootPrintRect(); + EDA_RECT area = GetFootprintRect(); // Calculate extended area including text fields area.Merge( m_Reference->GetBoundingBox() ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_module.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_module.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_module.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_module.h 2013-11-24 22:16:55.000000000 +0000 @@ -96,13 +96,14 @@ void CalculateBoundingBox(); /** - * Function GetFootPrintRect() + * Function GetFootprintRect() * Returns the area of the module footprint excluding any text. * @return EDA_RECT - The rectangle containing the footprint. */ - EDA_RECT GetFootPrintRect() const; + EDA_RECT GetFootprintRect() const; - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; DLIST& Pads() { return m_Pads; } const DLIST& Pads() const { return m_Pads; } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pad.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pad.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pad.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pad.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -119,7 +119,7 @@ } -EDA_RECT D_PAD::GetBoundingBox() const +const EDA_RECT D_PAD::GetBoundingBox() const { EDA_RECT area; wxPoint quadrant1, quadrant2, quadrant3, quadrant4; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pad.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pad.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pad.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pad.h 2013-11-24 22:16:55.000000000 +0000 @@ -392,7 +392,8 @@ return wxT( "PAD" ); } - EDA_RECT GetBoundingBox() const; + // Virtual function: + const EDA_RECT GetBoundingBox() const; /** * Function Compare diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -158,7 +158,7 @@ aList.push_back( MSG_PANEL_ITEM( _( "Size Y" ), msg, RED ) ); } -EDA_RECT TEXTE_PCB::GetBoundingBox() const +const EDA_RECT TEXTE_PCB::GetBoundingBox() const { EDA_RECT rect = GetTextBox( -1, -1 ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_pcb_text.h 2013-11-24 22:16:55.000000000 +0000 @@ -130,7 +130,8 @@ BITMAP_DEF GetMenuImage() const { return add_text_xpm; } - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; EDA_ITEM* Clone() const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -182,12 +182,12 @@ } -/** - * Function GetBoundingBox +/* + * Function GetBoundingBox (virtual) * returns the bounding box of this Text (according to text and footprint * orientation) */ -EDA_RECT TEXTE_MODULE::GetBoundingBox() const +const EDA_RECT TEXTE_MODULE::GetBoundingBox() const { double angle = GetDrawRotation(); EDA_RECT text_area = GetTextBox( -1, -1 ); diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_text_mod.h 2013-11-24 22:16:55.000000000 +0000 @@ -123,7 +123,8 @@ */ double GetDrawRotation() const; - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; void SetDrawCoord(); // Set absolute coordinates. diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_track.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_track.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_track.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_track.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -310,7 +310,7 @@ } -EDA_RECT TRACK::GetBoundingBox() const +const EDA_RECT TRACK::GetBoundingBox() const { // end of track is round, this is its radius, rounded up int radius = ( m_Width + 1 ) / 2; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_track.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_track.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_track.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_track.h 2013-11-24 22:16:55.000000000 +0000 @@ -127,7 +127,8 @@ int GetShape() const { return m_Shape; } void SetShape( int aShape ) { m_Shape = aShape; } - EDA_RECT GetBoundingBox() const; + // Virtual function + const EDA_RECT GetBoundingBox() const; /** * Function GetBestInsertPoint diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_zone.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_zone.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_zone.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_zone.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -358,7 +358,7 @@ } -EDA_RECT ZONE_CONTAINER::GetBoundingBox() const +const EDA_RECT ZONE_CONTAINER::GetBoundingBox() const { const int PRELOAD = 0x7FFFFFFF; // Biggest integer (32 bits) diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_zone.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_zone.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/class_zone.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/class_zone.h 2013-11-24 22:16:55.000000000 +0000 @@ -151,10 +151,10 @@ void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode = GR_OR ); - /** Function GetBoundingBox + /** Function GetBoundingBox (virtual) * @return an EDA_RECT that is the bounding box of the zone outline */ - EDA_RECT GetBoundingBox() const; + const EDA_RECT GetBoundingBox() const; int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const; diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -22,7 +22,7 @@ wxBoxSizer* bLeftSizer; bLeftSizer = new wxBoxSizer( wxVERTICAL ); - m_staticText6 = new wxStaticText( this, wxID_ANY, _("Current Module"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText6 = new wxStaticText( this, wxID_ANY, _("Current footprint"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText6->Wrap( -1 ); bLeftSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -30,7 +30,7 @@ m_OldModule->SetMaxLength( 0 ); bLeftSizer->Add( m_OldModule, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_staticText7 = new wxStaticText( this, wxID_ANY, _("Current Value"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText7 = new wxStaticText( this, wxID_ANY, _("Current value"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText7->Wrap( -1 ); bLeftSizer->Add( m_staticText7, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -38,7 +38,7 @@ m_OldValue->SetMaxLength( 0 ); bLeftSizer->Add( m_OldValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_staticText8 = new wxStaticText( this, wxID_ANY, _("New Module"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText8 = new wxStaticText( this, wxID_ANY, _("New footprint"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText8->Wrap( -1 ); bLeftSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -54,8 +54,8 @@ wxString m_SelectionChoices[] = { _("Change module"), _("Change same modules"), _("Ch. same module+value"), _("Change all") }; int m_SelectionNChoices = sizeof( m_SelectionChoices ) / sizeof( wxString ); - m_Selection = new wxRadioBox( this, ID_SELECTION_CLICKED, _("Browse Libs modules"), wxDefaultPosition, wxDefaultSize, m_SelectionNChoices, m_SelectionChoices, 1, wxRA_SPECIFY_COLS ); - m_Selection->SetSelection( 0 ); + m_Selection = new wxRadioBox( this, ID_SELECTION_CLICKED, _("Options"), wxDefaultPosition, wxDefaultSize, m_SelectionNChoices, m_SelectionChoices, 1, wxRA_SPECIFY_COLS ); + m_Selection->SetSelection( 2 ); bMiddleSizer->Add( m_Selection, 0, wxALL, 5 ); @@ -65,13 +65,16 @@ bRightSizer = new wxBoxSizer( wxVERTICAL ); m_OKbutton = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_OKbutton, 0, wxALL, 5 ); + bRightSizer->Add( m_OKbutton, 0, wxALL|wxEXPAND, 5 ); m_Quitbutton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_Quitbutton, 0, wxALL, 5 ); + bRightSizer->Add( m_Quitbutton, 0, wxALL|wxEXPAND, 5 ); + + m_buttonCmpList = new wxButton( this, wxID_ANY, _("Rebuild .cmp List"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonCmpList, 0, wxALL|wxEXPAND, 5 ); m_Browsebutton = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_Browsebutton, 0, wxALL, 5 ); + bRightSizer->Add( m_Browsebutton, 0, wxALL|wxEXPAND, 5 ); bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -98,6 +101,7 @@ m_Selection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnSelectionClicked ), NULL, this ); m_OKbutton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnOkClick ), NULL, this ); m_Quitbutton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnQuit ), NULL, this ); + m_buttonCmpList->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::RebuildCmpList ), NULL, this ); m_Browsebutton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::BrowseAndSelectFootprint ), NULL, this ); } @@ -107,6 +111,7 @@ m_Selection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnSelectionClicked ), NULL, this ); m_OKbutton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnOkClick ), NULL, this ); m_Quitbutton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::OnQuit ), NULL, this ); + m_buttonCmpList->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::RebuildCmpList ), NULL, this ); m_Browsebutton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXCHANGE_MODULE_BASE::BrowseAndSelectFootprint ), NULL, this ); } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.fbp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.fbp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.fbp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.fbp 2013-11-24 22:16:55.000000000 +0000 @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -141,7 +143,7 @@ 0 0 wxID_ANY - Current Module + Current footprint 0 @@ -315,7 +317,7 @@ 0 0 wxID_ANY - Current Value + Current value 0 @@ -489,7 +491,7 @@ 0 0 wxID_ANY - New Module + New footprint 0 @@ -675,7 +677,7 @@ 0 0 ID_SELECTION_CLICKED - Browse Libs modules + Options 1 0 @@ -692,7 +694,7 @@ 1 Resizable - 0 + 2 1 wxRA_SPECIFY_COLS @@ -745,7 +747,7 @@ none 5 - wxALL + wxALL|wxEXPAND 0 1 @@ -833,7 +835,7 @@ 5 - wxALL + wxALL|wxEXPAND 0 1 @@ -921,7 +923,95 @@ 5 - wxALL + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Rebuild .cmp List + + 0 + + + 0 + + 1 + m_buttonCmpList + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + RebuildCmpList + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND 0 1 diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.h kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.h --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.h 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/dialogs/dialog_exchange_modules_base.h 2013-11-24 22:16:55.000000000 +0000 @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Nov 6 2013) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -47,6 +47,7 @@ wxRadioBox* m_Selection; wxButton* m_OKbutton; wxButton* m_Quitbutton; + wxButton* m_buttonCmpList; wxButton* m_Browsebutton; wxStaticText* m_staticTextMsg; wxTextCtrl* m_WinMessages; @@ -55,6 +56,7 @@ virtual void OnSelectionClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } + virtual void RebuildCmpList( wxCommandEvent& event ) { event.Skip(); } virtual void BrowseAndSelectFootprint( wxCommandEvent& event ) { event.Skip(); } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/xchgmod.cpp kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/xchgmod.cpp --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad/pcbnew/xchgmod.cpp 2013-11-24 03:03:22.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad/pcbnew/xchgmod.cpp 2013-11-24 22:16:55.000000000 +0000 @@ -5,7 +5,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2013 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck * Copyright (C) 2013 Wayne Stambaugh * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. @@ -43,11 +43,8 @@ #include #include -static char* quiet_gcc_4_4_3; // GCC 4.4.3 and next .. - static bool RecreateCmpFile( BOARD * aBrd, const wxString& aFullCmpFileName ); - class DIALOG_EXCHANGE_MODULE : public DIALOG_EXCHANGE_MODULE_BASE { private: @@ -64,13 +61,12 @@ void OnOkClick( wxCommandEvent& event ); void OnQuit( wxCommandEvent& event ); void BrowseAndSelectFootprint( wxCommandEvent& event ); + void RebuildCmpList( wxCommandEvent& event ); void init(); void ChangeCurrentFootprint(); - void ChangeSameFootprints( bool aUseValue ); + void ChangeSameFootprints( bool aUseValue); void ChangeAllFootprints(); - int Maj_ListeCmp( const wxString& aReference, const FPID& aOldFootprintFPID, - const FPID& aNewFootprintFPID, bool aShowError ); bool Change_1_Module( MODULE* aModule, const FPID& aNewFootprintFPID, PICKED_ITEMS_LIST* aUndoPickList, @@ -123,6 +119,7 @@ void DIALOG_EXCHANGE_MODULE::OnOkClick( wxCommandEvent& event ) { m_selectionMode = m_Selection->GetSelection(); + switch( m_Selection->GetSelection() ) { case 0: @@ -146,120 +143,51 @@ void DIALOG_EXCHANGE_MODULE::OnSelectionClicked( wxCommandEvent& event ) { + bool enable = true; + switch( m_Selection->GetSelection() ) { case 0: case 1: case 2: - m_NewModule->Enable( true ); - m_Browsebutton->Enable( true ); break; case 3: - m_NewModule->Enable( false ); - m_Browsebutton->Enable( false ); + enable = false; break; } + + m_NewModule->Enable( enable ); + m_Browsebutton->Enable( enable ); } /* - * Updates the file name.CMP (if any) after an exchange module - * (By command changeMod), if the modules are managed by this file - * - * If ShowError! = 0 displays error message if the file. Cmp is not found. - * Return 1 if error + * Rebuild the file name.CMP (if any) after exchanging footprints + * if the footprint are managed by this file + * Return false if error */ -int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& aReference, - const FPID& aOldFootprintFPID, - const FPID& aNewFootprintFPID, - bool aShowError ) +void DIALOG_EXCHANGE_MODULE::RebuildCmpList( wxCommandEvent& event ) { wxFileName fn; - wxFileName tmpFileName; - FILE* FichCmp, * NewFile; - char line[1024]; wxString msg; - if( aOldFootprintFPID == aNewFootprintFPID ) - return 0; - // Build CMP file name by changing the extension of NetList filename fn = m_parent->GetBoard()->GetFileName(); fn.SetExt( ComponentFileExtension ); - FichCmp = wxFopen( fn.GetFullPath(), wxT( "rt" ) ); - - if( FichCmp == NULL ) + if( RecreateCmpFile( m_parent->GetBoard(), fn.GetFullPath() ) ) { - if( aShowError ) - { - msg.Printf( _( "file <%s> not found" ), GetChars( fn.GetFullPath() ) ); - m_WinMessages->AppendText( msg ); - } - - return 1; + msg.Printf( _( "File '%s' created\n" ), + GetChars( fn.GetFullPath() ) ); } - - tmpFileName = fn; - tmpFileName.SetExt( wxT( "$$$" ) ); - NewFile = wxFopen( tmpFileName.GetFullPath(), wxT( "wt" ) ); - - if( NewFile == NULL ) - { - if( aShowError ) - { - msg.Printf( _( "Unable to create file <%s>" ), - GetChars( tmpFileName.GetFullPath() ) ); - m_WinMessages->AppendText( msg ); - } - - return 1; - } - - quiet_gcc_4_4_3 = fgets( line, sizeof(line), FichCmp ); - - fprintf( NewFile, "Cmp-Mod V01 Created by PcbNew date = %s\n", TO_UTF8( DateAndTime() ) ); - - bool start_descr = false; - - while( fgets( line, sizeof(line), FichCmp ) != NULL ) + else { - if( strnicmp( line, "Reference = ", 9 ) == 0 ) - { - char buf[1024]; - strcpy( buf, line + 12 ); - strtok( buf, ";\n\r" ); - - if( stricmp( buf, TO_UTF8( aReference ) ) == 0 ) - { - start_descr = true; - } - } - - if( (strnicmp( line, "Begin", 5 ) == 0) || (strnicmp( line, "End", 3 ) == 0) ) - { - start_descr = false; - } - - if( start_descr && strnicmp( line, "IdModule", 8 ) == 0 ) - { - sprintf( line + 8, " = %s;\n", aNewFootprintFPID.Format().c_str() ); - - msg = wxT( " * in <" ) + fn.GetFullPath() + wxT( ">.\n" ); - m_WinMessages->AppendText( msg ); - - start_descr = false; - } - - fputs( line, NewFile ); + msg.Printf( _( "** Could not create file '%s' ***\n" ), + GetChars( fn.GetFullPath() ) ); } - fclose( FichCmp ); - fclose( NewFile ); - wxRemoveFile( fn.GetFullPath() ); - wxRenameFile( tmpFileName.GetFullPath(), fn.GetFullPath() ); - return 0; + m_WinMessages->AppendText( msg ); } @@ -401,7 +329,7 @@ if( !IsOK( this, _( "Change ALL modules ?" ) ) ) return; - /* The change is done from the last module for the routine + /* The change is done from the last module because the function * Change_1_Module () modifies the last module in the list */ PICKED_ITEMS_LIST pickList; @@ -460,9 +388,10 @@ FPID oldFootprintFPID = aModule->GetFPID(); // Load module. - line.Printf( _( "Change module %s (from %s) " ), + line.Printf( _( "Change module %s (from %s) to %s" ), GetChars( aModule->GetReference() ), - oldFootprintFPID.Format().c_str() ); + oldFootprintFPID.Format().c_str(), + aNewFootprintFPID.Format().c_str() ); m_WinMessages->AppendText( line ); wxString moduleName = FROM_UTF8( aNewFootprintFPID.GetFootprintName().c_str() ); @@ -476,7 +405,7 @@ if( newModule == NULL ) // New module not found, redraw the old one. { - m_WinMessages->AppendText( wxT( "No\n" ) ); + m_WinMessages->AppendText( wxT( " No\n" ) ); return false; } @@ -485,13 +414,10 @@ if( aModule == m_currentModule ) m_currentModule = newModule; - m_WinMessages->AppendText( wxT( "OK\n" ) ); + m_WinMessages->AppendText( wxT( " OK\n" ) ); m_parent->Exchange_Module( aModule, newModule, aUndoPickList ); - Maj_ListeCmp( newModule->GetReference(), - oldFootprintFPID, aNewFootprintFPID, aShowError ); - return true; } @@ -610,7 +536,7 @@ if( ! RecreateCmpFile( GetBoard(), fn.GetFullPath() ) ) { - msg = _( "Unable to create file " ) + fn.GetFullPath(); + msg.Printf( _( "Could not create file '%s'" ), GetChars(fn.GetFullPath() ) ); DisplayError( this, msg ); return; } diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad-library/library/digital-audio.dcm kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad-library/library/digital-audio.dcm --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad-library/library/digital-audio.dcm 2013-11-24 03:03:30.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad-library/library/digital-audio.dcm 2013-11-24 22:17:01.000000000 +0000 @@ -1,4 +1,21 @@ -EESchema-DOCLIB Version 2.0 Date: 2013-04-06 21:16:38 +EESchema-DOCLIB Version 2.0 +# +$CMP AK5392VS +D AK5392-VS, Enhanced Audio ADC, 2 channels Sigma Delta, 24bit, SO28 +K 24bit Sigma Delta Audio ADC 2ch +$ENDCMP +# +$CMP AK5393VS +D AK5393VS, Enhanced Audio ADC, 2 channels Sigma Delta, 24bit 96kHz, SO28 +K 96kHz 24bit Sigma Delta Audio ADC 2ch +F http://www.akm.com/akm/en/file/datasheet/AK5393VS.pdf +$ENDCMP +# +$CMP AK5394AVS +D AK5394AVS, Super High Performance Audio ADC, 2 channels Sigma Delta, 24bit 192kHz, SO28 +K 192kHz 24bit Sigma Delta Audio ADC 2ch +F http://www.akm.com/akm/en/file/datasheet/AK5394AVS.pdf +$ENDCMP # $CMP CS43L21 D Stereo digital to analog outputs diff -Nru kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad-library/library/digital-audio.lib kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad-library/library/digital-audio.lib --- kicad-0.201311240303+4496~17~ubuntu12.04.1/kicad-library/library/digital-audio.lib 2013-11-24 03:03:30.000000000 +0000 +++ kicad-0.201311242216+4497~17~ubuntu12.04.1/kicad-library/library/digital-audio.lib 2013-11-24 22:17:01.000000000 +0000 @@ -1,13 +1,142 @@ -EESchema-LIBRARY Version 2.3 Date: 2013-04-06 21:16:38 +EESchema-LIBRARY Version 2.3 #encoding utf-8 # +# AK5392VS +# +DEF AK5392VS U 0 40 Y Y 1 F N +F0 "U" -450 950 40 H V C CNN +F1 "AK5392VS" 450 -950 40 H V C CNN +F2 "SO28" 0 0 35 H V C CIN +F3 "" 800 -400 60 H V C CNN +$FPLIST + SO* +$ENDFPLIST +DRAW +S -500 900 500 -900 0 1 10 f +X VREFL 1 -650 800 150 R 40 40 1 1 O +X GNDL 2 -650 650 150 R 40 40 1 1 W +X VCOML 3 -650 550 150 R 40 40 1 1 O +X AINL+ 4 -650 200 150 R 40 40 1 1 I +X AINL- 5 -650 350 150 R 40 40 1 1 I +X ZCAL 6 -650 -800 150 R 40 40 1 1 I +X VD 7 200 1050 150 D 40 40 1 1 W +X DGND 8 200 -1050 150 U 40 40 1 1 W +X CAL 9 650 -800 150 L 40 40 1 1 O +X ~RST~ 10 650 -650 150 L 40 40 1 1 I +X TEST 20 650 -350 150 L 40 40 1 1 I +X SMODE2 11 650 150 150 L 40 40 1 1 I +X BGND 21 0 -1050 150 U 40 40 1 1 W +X SMODE1 12 650 250 150 L 40 40 1 1 I +X AGND 22 -200 -1050 150 U 40 40 1 1 W +X LRCK 13 650 600 150 L 40 40 1 1 B +X VA 23 -200 1050 150 D 40 40 1 1 W +X SCLK 14 650 700 150 L 40 40 1 1 B +X AINR- 24 -650 -450 150 R 40 40 1 1 I +X SDATA 15 650 400 150 L 40 40 1 1 O +X AINR+ 25 -650 -600 150 R 40 40 1 1 I +X FSYNC 16 650 500 150 L 40 40 1 1 B +X VCOMR 26 -650 -250 150 R 40 40 1 1 O +X CLK 17 650 -50 150 L 40 40 1 1 I +X GNDR 27 -650 -150 150 R 40 40 1 1 O +X CMODE 18 650 -150 150 L 40 40 1 1 I +X VREFR 28 -650 0 150 R 40 40 1 1 O +X HPFE 19 650 -450 150 L 40 40 1 1 I +ENDDRAW +ENDDEF +# +# AK5393VS +# +DEF AK5393VS U 0 40 Y Y 1 F N +F0 "U" -450 950 40 H V C CNN +F1 "AK5393VS" 450 -950 40 H V C CNN +F2 "SO28" 0 0 35 H V C CIN +F3 "" 800 -400 60 H V C CNN +$FPLIST + SO* +$ENDFPLIST +DRAW +S -500 900 500 -900 0 1 10 f +X VREFL 1 -650 800 150 R 40 40 1 1 O +X GNDL 2 -650 650 150 R 40 40 1 1 W +X VCOML 3 -650 550 150 R 40 40 1 1 O +X AINL+ 4 -650 200 150 R 40 40 1 1 I +X AINL- 5 -650 350 150 R 40 40 1 1 I +X ZCAL 6 -650 -800 150 R 40 40 1 1 I +X VD 7 200 1050 150 D 40 40 1 1 W +X DGND 8 200 -1050 150 U 40 40 1 1 W +X CAL 9 650 -800 150 L 40 40 1 1 O +X ~RST~ 10 650 -650 150 L 40 40 1 1 I +X TEST 20 650 -350 150 L 40 40 1 1 I +X SMODE2 11 650 150 150 L 40 40 1 1 I +X BGND 21 0 -1050 150 U 40 40 1 1 W +X SMODE1 12 650 250 150 L 40 40 1 1 I +X AGND 22 -200 -1050 150 U 40 40 1 1 W +X LRCK 13 650 600 150 L 40 40 1 1 B +X VA 23 -200 1050 150 D 40 40 1 1 W +X SCLK 14 650 700 150 L 40 40 1 1 B +X AINR- 24 -650 -450 150 R 40 40 1 1 I +X SDATA 15 650 400 150 L 40 40 1 1 O +X AINR+ 25 -650 -600 150 R 40 40 1 1 I +X FSYNC 16 650 500 150 L 40 40 1 1 B +X VCOMR 26 -650 -250 150 R 40 40 1 1 O +X MCLK 17 650 -50 150 L 40 40 1 1 I +X GNDR 27 -650 -150 150 R 40 40 1 1 O +X DFS 18 650 -150 150 L 40 40 1 1 I +X VREFR 28 -650 0 150 R 40 40 1 1 O +X HPFE 19 650 -450 150 L 40 40 1 1 I +ENDDRAW +ENDDEF +# +# AK5394AVS +# +DEF AK5394AVS U 0 40 Y Y 1 F N +F0 "U" -450 950 40 H V C CNN +F1 "AK5394AVS" 450 -950 40 H V C CNN +F2 "SO28" 0 0 35 H V C CIN +F3 "" 800 -400 60 H V C CNN +$FPLIST + SO* +$ENDFPLIST +DRAW +S -500 900 500 -900 0 1 10 f +X VREFL+ 1 -650 800 150 R 40 40 1 1 O +X VREFL- 2 -650 650 150 R 40 40 1 1 O +X VCOML 3 -650 550 150 R 40 40 1 1 O +X AINL+ 4 -650 200 150 R 40 40 1 1 I +X AINL- 5 -650 350 150 R 40 40 1 1 I +X ZCAL 6 -650 -800 150 R 40 40 1 1 I +X VD 7 200 1050 150 D 40 40 1 1 W +X DGND 8 200 -1050 150 U 40 40 1 1 W +X CAL 9 650 -800 150 L 40 40 1 1 O +X ~RST~ 10 650 -650 150 L 40 40 1 1 I +X DFS1 20 650 -250 150 L 40 40 1 1 I +X SMODE2 11 650 150 150 L 40 40 1 1 I +X BGND 21 0 -1050 150 U 40 40 1 1 W +X SMODE1 12 650 250 150 L 40 40 1 1 I +X AGND 22 -200 -1050 150 U 40 40 1 1 W +X LRCK 13 650 600 150 L 40 40 1 1 B +X VA 23 -200 1050 150 D 40 40 1 1 W +X SCLK 14 650 700 150 L 40 40 1 1 B +X AINR- 24 -650 -450 150 R 40 40 1 1 I +X SDATA 15 650 400 150 L 40 40 1 1 O +X AINR+ 25 -650 -600 150 R 40 40 1 1 I +X FSYNC 16 650 500 150 L 40 40 1 1 B +X VCOMR 26 -650 -250 150 R 40 40 1 1 O +X MCLK 17 650 -50 150 L 40 40 1 1 I +X VREFR- 27 -650 -150 150 R 40 40 1 1 O +X DFS0 18 650 -150 150 L 40 40 1 1 I +X VREFR+ 28 -650 0 150 R 40 40 1 1 O +X HPFE 19 650 -400 150 L 40 40 1 1 I +ENDDRAW +ENDDEF +# # CS43L21 # DEF CS43L21 U 0 40 Y Y 1 F N F0 "U" 350 1050 60 H V C CNN F1 "CS43L21" 350 -1050 60 H V C CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW T 0 -225 100 50 0 0 0 Audio Normal 0 L C T 0 -225 200 50 0 0 0 Digital Normal 0 L C @@ -45,8 +174,8 @@ DEF CS5361 U 0 40 Y Y 1 F N F0 "U" 450 1000 60 H V L CNN F1 "CS5361" 400 -1000 60 H V L CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW S -600 900 600 -900 0 1 0 N X RST 1 -850 -600 250 R 50 50 1 1 I @@ -81,8 +210,8 @@ DEF CS8406 U 0 40 Y Y 1 F N F0 "U" 250 1100 60 H V C CNN F1 "CS8406" 250 -1100 60 H V C CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW S -600 1050 600 -1050 0 0 0 N X VD+ 6 -850 950 250 R 50 50 1 0 W @@ -138,8 +267,8 @@ DEF CS8414 U 0 30 Y Y 1 F N F0 "U" 0 1250 60 H V C CNN F1 "CS8414" 0 -1249 60 H V C CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW S -600 -1200 600 1200 0 1 0 N X C 1 900 0 300 L 60 60 1 1 O @@ -178,8 +307,8 @@ DEF CS8420_SOFT U 0 40 Y Y 1 F N F0 "U" 250 1000 60 H V C CNN F1 "CS8420_SOFT" 0 -1000 60 H V C CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW S -600 950 600 -950 0 1 0 N X SDA/CDOUT 1 -850 0 250 R 50 50 1 1 B @@ -219,7 +348,7 @@ F0 "U" -500 800 40 H V C CNN F1 "TLV320AIC23BPW" 500 -800 40 H V C CNN F2 "TSSOP28" 0 0 35 H V C CIN -F3 "~" 0 -100 60 H V C CNN +F3 "" 0 -100 60 H V C CNN $FPLIST TSSOP* $ENDFPLIST @@ -262,7 +391,7 @@ F0 "U" -500 800 40 H V C CNN F1 "TLV320AIC23BRHD" 500 -800 40 H V C CNN F2 "QFN28" 0 0 35 H V C CIN -F3 "~" 0 -100 60 H V C CNN +F3 "" 0 -100 60 H V C CNN $FPLIST QFN* $ENDFPLIST @@ -304,8 +433,8 @@ DEF TPA5050 U 0 30 Y Y 1 F N F0 "U" 0 650 60 H V C CNN F1 "TPA5050" 0 -650 60 H V C CNN -F2 "~" 0 0 60 H V C CNN -F3 "~" 0 0 60 H V C CNN +F2 "" 0 0 60 H V C CNN +F3 "" 0 0 60 H V C CNN DRAW S -400 600 400 -600 0 1 0 N X LRCLK 1 -700 200 300 R 60 50 1 1 I