From 8fef15cd5689907089e7b162762c5c1beb10a27b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 4 Jan 2012 20:10:33 +0100 Subject: [PATCH] Fix bug 910364: When a footprint saved in a .mod file is not on front layer and/or not with orientation 0 degree, the Module editor load it incorrectly. note: the Module editor save it with default orientation and layer, but the archive function does not, so some footprints can be not editable. TODO: modify the Archive Function to use the default layer / orientation. --- bitmaps_png/cpp_26/load_module_lib.cpp | 158 +-- bitmaps_png/sources/load_module_lib.svg | 1071 ++++------------- .../dialogs/dialog_print_using_printer.cpp | 7 +- pcbnew/loadcmp.cpp | 20 +- pcbnew/zones_polygons_test_connections.cpp | 85 +- 5 files changed, 393 insertions(+), 948 deletions(-) diff --git a/bitmaps_png/cpp_26/load_module_lib.cpp b/bitmaps_png/cpp_26/load_module_lib.cpp index 5e5293d1bf..00be91443f 100644 --- a/bitmaps_png/cpp_26/load_module_lib.cpp +++ b/bitmaps_png/cpp_26/load_module_lib.cpp @@ -8,84 +8,86 @@ static const unsigned char png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, - 0xce, 0x00, 0x00, 0x04, 0xc3, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0x0b, 0x50, 0x94, - 0x55, 0x14, 0xc7, 0x2f, 0x4e, 0x4a, 0x0a, 0x6a, 0x39, 0xd6, 0x38, 0x36, 0x9a, 0xaf, 0xc1, 0xb4, - 0x51, 0x74, 0x7c, 0x80, 0x06, 0x31, 0x21, 0x35, 0x26, 0xa4, 0xf9, 0x20, 0x28, 0x40, 0x17, 0x29, - 0x1a, 0xd4, 0x59, 0x72, 0x64, 0x10, 0x30, 0xd8, 0x87, 0x01, 0x22, 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 0x30, 0xf4, 0x6f, 0x67, 0xd5, 0x85, 0x93, 0xd8, 0x1c, 0x27, 0x0a, 0x6e, 0x4b, 0xcc, - 0x24, 0x5e, 0x7c, 0xa2, 0xa7, 0xa0, 0x98, 0x71, 0x4d, 0x41, 0x4a, 0x9b, 0x6f, 0xbb, 0xaf, 0xfb, - 0xbd, 0x86, 0x94, 0xb7, 0xab, 0x20, 0xcb, 0x4a, 0x46, 0xe4, 0xae, 0x6c, 0x88, 0xdf, 0xac, 0x81, - 0xc8, 0xc2, 0x80, 0x9d, 0xac, 0xe1, 0xb4, 0x1d, 0x13, 0x7a, 0x50, 0xe0, 0xc5, 0xc4, 0x5c, 0xe2, - 0x65, 0xee, 0x19, 0x61, 0x78, 0x9c, 0xbf, 0x01, 0x5d, 0xf7, 0x9c, 0x31, 0x62, 0xc8, 0x34, 0xf3, - 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, + 0xce, 0x00, 0x00, 0x04, 0xd9, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xad, 0x96, 0x7b, 0x4c, 0x93, + 0x57, 0x18, 0x87, 0xdf, 0xe9, 0xd8, 0x88, 0x11, 0x51, 0xd1, 0xcd, 0x0d, 0xa2, 0xfe, 0xa1, 0xcb, + 0xc4, 0x25, 0x9b, 0xd1, 0x51, 0x9c, 0x3a, 0x99, 0x04, 0x95, 0xb9, 0x09, 0x0b, 0x71, 0xc6, 0x5b, + 0x51, 0x99, 0xc0, 0x94, 0xa1, 0xec, 0xc2, 0x20, 0x52, 0x68, 0x11, 0x5a, 0xa1, 0x17, 0x2e, 0x05, + 0xbc, 0x56, 0x2e, 0xc2, 0xa0, 0x48, 0x84, 0x39, 0x41, 0x9d, 0x4c, 0x21, 0x33, 0x44, 0x99, 0x3a, + 0x11, 0x06, 0x4e, 0x40, 0x53, 0x28, 0x11, 0x28, 0x3a, 0x54, 0x86, 0xc3, 0x4a, 0x7f, 0x3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, 0x20, 0x29, 0x64, 0x4c, 0xa6, 0x7b, 0xec, 0xfb, 0x77, 0xfe, 0x17, + 0xd1, 0xb0, 0xd4, 0xba, 0xb2, 0x75, 0x5e, 0xa2, 0x93, 0x4c, 0xe2, 0xca, 0xc4, 0x44, 0x9e, 0xcf, + 0xbc, 0x47, 0x36, 0x0b, 0xa7, 0xd3, 0xcf, 0xe4, 0xc5, 0xa7, 0x4c, 0xf8, 0x4c, 0x55, 0xf7, 0x1c, + 0x2b, 0x2b, 0x61, 0x88, 0x6c, 0x3e, 0x47, 0x2f, 0x20, 0xf2, 0x19, 0xde, 0xf7, 0x2f, 0x94, 0x4d, + 0xa7, 0x8d, 0xfd, 0xa4, 0xc6, 0x76, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, }; const BITMAP_OPAQUE load_module_lib_xpm[1] = {{ png, sizeof( png ), "load_module_lib_xpm" }}; diff --git a/bitmaps_png/sources/load_module_lib.svg b/bitmaps_png/sources/load_module_lib.svg index e9d88ee7bd..6f30d5e6d7 100644 --- a/bitmaps_png/sources/load_module_lib.svg +++ b/bitmaps_png/sources/load_module_lib.svg @@ -1,839 +1,242 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - diff --git a/eeschema/dialogs/dialog_print_using_printer.cpp b/eeschema/dialogs/dialog_print_using_printer.cpp index d77fe74f07..4f945f598e 100644 --- a/eeschema/dialogs/dialog_print_using_printer.cpp +++ b/eeschema/dialogs/dialog_print_using_printer.cpp @@ -326,9 +326,12 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) old_org = aScreen->m_DrawOrg; oldClipBox = *panel->GetClipBox(); - /* Change scale factor, offsets, and clip box to print the whole page. */ - panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) ); + // Change clip box to print the whole page. + #define MAX_VALUE (INT_MAX/2) // MAX_VALUE is the max we can use in an integer + // and that allows calculations without overflow + panel->SetClipBox( EDA_RECT( wxPoint( 0, 0 ), wxSize( MAX_VALUE, MAX_VALUE ) ) ); + // Change scale factor and offset to print the whole page. bool printReference = parent->GetPrintSheetReference(); if( printReference ) diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 4cccee89e3..d2270ff2c5 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -91,9 +91,13 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) ); PlaceModule( aModule, NULL ); + // Put it on FRONT layer, + // because this is the default in ModEdit, and in libs if( aModule->GetLayer() != LAYER_N_FRONT ) aModule->Flip( aModule->m_Pos ); + // Put it in orientation 0, + // because this is the default orientation in ModEdit, and in libs Rotate_Module( NULL, aModule, 0, false ); GetScreen()->ClrModify(); Zoom_Automatique( false ); @@ -189,15 +193,15 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC* module->SetTimeStamp( GetNewTimeStamp() ); GetBoard()->m_Status_Pcb = 0; module->SetPosition( curspos ); + // Put it on FRONT layer, + // (Can be stored on BACK layer if the lib is an archive built from a board) + if( module->GetLayer() != LAYER_N_FRONT ) + module->Flip( module->m_Pos ); + // Put in in orientation 0, + // even if it is not saved with with orientation 0 in lib + // (Can happen if the lib is an archive built from a board) + Rotate_Module( NULL, module, 0, false ); - /* TODO: call RecalculateAllTracksNetcode() only if some pads pads have - * a netname. - * If all pads are not connected (usually the case in module libraries, - * rebuild only the pad and list of nets ( faster) - */ - - -// GetBoard()->m_Pcb->m_NetInfo.BuildListOfNets(); RecalculateAllTracksNetcode(); if( DC ) diff --git a/pcbnew/zones_polygons_test_connections.cpp b/pcbnew/zones_polygons_test_connections.cpp index 9b970ef7f6..3ce13e3c63 100644 --- a/pcbnew/zones_polygons_test_connections.cpp +++ b/pcbnew/zones_polygons_test_connections.cpp @@ -22,6 +22,16 @@ using namespace std; static bool CmpZoneSubnetValue( const BOARD_CONNECTED_ITEM* a, const BOARD_CONNECTED_ITEM* b ); void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode ); +// This helper function sort a list of zones by netcode, +// and for a given netcode by zone size +// zone size = size of the m_FilledPolysList buffer +bool sort_areas( const ZONE_CONTAINER* ref, const ZONE_CONTAINER* tst ) +{ + if( ref->GetNet() == tst->GetNet() ) + return ref->m_FilledPolysList.size() < tst->m_FilledPolysList.size(); + else + return ref->GetNet() < tst->GetNet(); +} /** * Function Test_Connection_To_Copper_Areas @@ -34,7 +44,6 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // It is static to avoid multiple memory realloc. static std::vector Candidates; - // clear .m_ZoneSubnet parameter for pads for( MODULE* module = m_Modules; module; module = module->Next() ) { @@ -52,46 +61,65 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // examine all zones, net by net: int subnet = 0; + + // Build zones candidates list + std::vector zones_candidates; for( int index = 0; index < GetAreaCount(); index++ ) { ZONE_CONTAINER* curr_zone = GetArea( index ); if( !curr_zone->IsOnCopperLayer() ) continue; - - int netcode = curr_zone->GetNet(); - if( (aNetcode >= 0) && !( aNetcode == netcode ) ) + if( (aNetcode >= 0) && ( aNetcode != curr_zone->GetNet() ) ) continue; - if( curr_zone->m_FilledPolysList.size() == 0 ) continue; + zones_candidates.push_back(curr_zone); + } + // sort them by netcode then vertices count. + // For a given net, examine the smaller zones first slightly speed up calculation + // (25% faster) + // this is only noticeable with very large boards and depends on board zones topology + // This is due to the fact some items are connected bt small zones ares, + // before examining large zones areas and these items are not tested after a connection is found + sort(zones_candidates.begin(), zones_candidates.end(), sort_areas ); + + int oldnetcode = -1; + for( unsigned idx = 0; idx < zones_candidates.size(); idx++ ) + { + ZONE_CONTAINER* curr_zone = zones_candidates[idx]; + + int netcode = curr_zone->GetNet(); // Build a list of candidates connected to the net: - Candidates.clear(); - // At this point, layers are not considered, because areas on different layers can // be connected by a via or a pad. - - // Build the list of pads candidates connected to the net: + // (because zones are sorted by netcode, there is made only once per net) NETINFO_ITEM* net = FindNet( netcode ); wxASSERT( net ); if( net == NULL ) continue; - Candidates.reserve( net->m_PadInNetList.size() ); - for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ ) - Candidates.push_back( net->m_PadInNetList[ii] ); - - // Build the list of track candidates connected to the net: - TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode ); - for( ; track; track = track->Next() ) + if( oldnetcode != netcode ) { - if( track->GetNet() != netcode ) - break; - Candidates.push_back( track ); + oldnetcode = netcode; + Candidates.clear(); + + // Build the list of pads candidates connected to the net: + Candidates.reserve( net->m_PadInNetList.size() ); + for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ ) + Candidates.push_back( net->m_PadInNetList[ii] ); + + // Build the list of track candidates connected to the net: + TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode ); + for( ; track; track = track->Next() ) + { + if( track->GetNet() != netcode ) + break; + Candidates.push_back( track ); + } } // test if a candidate is inside a filled area of this zone unsigned indexstart = 0, indexend; - for( indexend = 0; indexend < curr_zone->m_FilledPolysList.size(); indexend++ ) { // end of a filled sub-area found @@ -104,6 +132,9 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) { // test if this area is connected to a board item: BOARD_CONNECTED_ITEM* item = Candidates[ic]; + if( item->GetZoneSubNet() == subnet ) // Already merged + continue; + if( !item->IsOnLayer( curr_zone->GetLayer() ) ) continue; @@ -138,17 +169,19 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) if( !connected && (pos1 != pos2 ) ) { if( bbox.Contains( pos2 ) ) - if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, indexstart, - indexend, pos2.x, pos2.y ) ) + { + if( TestPointInsidePolygon( curr_zone->m_FilledPolysList, + indexstart, indexend, + pos2.x, pos2.y ) ) connected = true; + } } if( connected ) { // Set ZoneSubnet to the current subnet value. // If the previous subnet is not 0, merge all items with old subnet // to the new one - int old_subnet = 0; - old_subnet = item->GetZoneSubNet(); + int old_subnet = item->GetZoneSubNet(); item->SetZoneSubNet( subnet ); // Merge previous subnet with the current @@ -170,8 +203,8 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode ) // (if exists). End read one area in // curr_zone->m_FilledPolysList } - } // End read all segments in zone. - } // End read all zones in board + } // End read all segments in zone + } // End read all zones candidates }