From b34d8e215019461d8f3f3c0a755509bfc2a1ad5d Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Sat, 9 Jun 2012 19:39:40 -0500 Subject: [PATCH] There was no reason for insertBeforeMe on track loading. Tracks should be loaded in the same order as they were saved, no exceptions. This is for the version control system user. But even with this objective now implemented in LEGACY_PLUGIN, the TRACKS are still going through a food processor after they are loaded, and the poor version control system user has no relief, even with this patch. TRACKS are always modified after being loaded, and I think this needs to be fixed still. --- pcbnew/legacy_plugin.cpp | 22 ++++++++++------------ pcbnew/legacy_plugin.h | 5 +---- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 451fcfa27d..205341aebd 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -244,8 +244,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend ) else if( TESTLINE( "$TRACK" ) ) { - TRACK* insertBeforeMe = doAppend ? NULL : m_board->m_Track.GetFirst(); - loadTrackList( insertBeforeMe, PCB_TRACE_T ); + loadTrackList( PCB_TRACE_T ); } else if( TESTLINE( "$NCLASS" ) ) @@ -270,8 +269,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend ) else if( TESTLINE( "$ZONE" ) ) { - SEGZONE* insertBeforeMe = doAppend ? NULL : m_board->m_Zone.GetFirst(); - loadTrackList( insertBeforeMe, PCB_ZONE_T ); + loadTrackList( PCB_ZONE_T ); } else if( TESTLINE( "$GENERAL" ) ) @@ -1888,7 +1886,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT() } -void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType ) +void LEGACY_PLUGIN::loadTrackList( int aStructType ) { while( READLINE( m_reader ) ) { @@ -1961,17 +1959,17 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType ) default: case PCB_TRACE_T: newTrack = new TRACK( m_board ); - m_board->m_Track.Insert( newTrack, aInsertBeforeMe ); + m_board->m_Track.Append( newTrack ); break; case PCB_VIA_T: newTrack = new SEGVIA( m_board ); - m_board->m_Track.Insert( newTrack, aInsertBeforeMe ); + m_board->m_Track.Append( newTrack ); break; case PCB_ZONE_T: // this is now deprecated, but exist in old boards newTrack = new SEGZONE( m_board ); - m_board->m_Zone.Insert( (SEGZONE*) newTrack, (SEGZONE*) aInsertBeforeMe ); + m_board->m_Zone.Append( (SEGZONE*) newTrack ); break; } @@ -2215,7 +2213,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER() arcsegcount = 32; zc->SetArcSegCount( arcsegcount ); - zc->SetIsFilled( fillstate == 'F' ? true : false ); + zc->SetIsFilled( fillstate == 'S' ? true : false ); zc->SetThermalReliefGap( thermalReliefGap ); zc->SetThermalReliefCopperBridge( thermalReliefCopperBridge ); } @@ -3393,7 +3391,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const // using "diff", then switch to more concise form for release builds. "Sc %lf %lf %lf\n", #else - "Sc %.16g %.16g %.16g\n", + "Sc %.10g %.10g %.10g\n", #endif t3D->m_MatScale.x, t3D->m_MatScale.y, @@ -3403,7 +3401,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const #if defined(DEBUG) "Of %lf %lf %lf\n", #else - "Of %.16g %.16g %.16g\n", + "Of %.10g %.10g %.10g\n", #endif t3D->m_MatPosition.x, t3D->m_MatPosition.y, @@ -3413,7 +3411,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const #if defined(DEBUG) "Ro %lf %lf %lf\n", #else - "Ro %.16g %.16g %.16g\n", + "Ro %.10g %.10g %.10g\n", #endif t3D->m_MatRotation.x, t3D->m_MatRotation.y, diff --git a/pcbnew/legacy_plugin.h b/pcbnew/legacy_plugin.h index a1c3fb8d9d..96f8380b33 100644 --- a/pcbnew/legacy_plugin.h +++ b/pcbnew/legacy_plugin.h @@ -189,13 +189,10 @@ protected: * Function loadTrackList * reads a list of segments (Tracks and Vias, or Segzones) * - * @param aInsertBeforeMe may be either NULL indicating append, or it may - * be an insertion point before which all the segments are inserted. - * * @param aStructType is either PCB_TRACE_T to indicate tracks and vias, or * PCB_ZONE_T to indicate oldschool zone segments (before polygons came to be). */ - void loadTrackList( TRACK* aInsertBeforeMe, int aStructType ); + void loadTrackList( int aStructType ); void loadZONE_CONTAINER(); // "$CZONE_OUTLINE" void loadDIMENSION(); // "$COTATION"