Commit b34d8e21 authored by Dick Hollenbeck's avatar Dick Hollenbeck

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.
parent a2753e85
...@@ -244,8 +244,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend ) ...@@ -244,8 +244,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend )
else if( TESTLINE( "$TRACK" ) ) else if( TESTLINE( "$TRACK" ) )
{ {
TRACK* insertBeforeMe = doAppend ? NULL : m_board->m_Track.GetFirst(); loadTrackList( PCB_TRACE_T );
loadTrackList( insertBeforeMe, PCB_TRACE_T );
} }
else if( TESTLINE( "$NCLASS" ) ) else if( TESTLINE( "$NCLASS" ) )
...@@ -270,8 +269,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend ) ...@@ -270,8 +269,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend )
else if( TESTLINE( "$ZONE" ) ) else if( TESTLINE( "$ZONE" ) )
{ {
SEGZONE* insertBeforeMe = doAppend ? NULL : m_board->m_Zone.GetFirst(); loadTrackList( PCB_ZONE_T );
loadTrackList( insertBeforeMe, PCB_ZONE_T );
} }
else if( TESTLINE( "$GENERAL" ) ) else if( TESTLINE( "$GENERAL" ) )
...@@ -1888,7 +1886,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT() ...@@ -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 ) ) while( READLINE( m_reader ) )
{ {
...@@ -1961,17 +1959,17 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType ) ...@@ -1961,17 +1959,17 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType )
default: default:
case PCB_TRACE_T: case PCB_TRACE_T:
newTrack = new TRACK( m_board ); newTrack = new TRACK( m_board );
m_board->m_Track.Insert( newTrack, aInsertBeforeMe ); m_board->m_Track.Append( newTrack );
break; break;
case PCB_VIA_T: case PCB_VIA_T:
newTrack = new SEGVIA( m_board ); newTrack = new SEGVIA( m_board );
m_board->m_Track.Insert( newTrack, aInsertBeforeMe ); m_board->m_Track.Append( newTrack );
break; break;
case PCB_ZONE_T: // this is now deprecated, but exist in old boards case PCB_ZONE_T: // this is now deprecated, but exist in old boards
newTrack = new SEGZONE( m_board ); newTrack = new SEGZONE( m_board );
m_board->m_Zone.Insert( (SEGZONE*) newTrack, (SEGZONE*) aInsertBeforeMe ); m_board->m_Zone.Append( (SEGZONE*) newTrack );
break; break;
} }
...@@ -2215,7 +2213,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER() ...@@ -2215,7 +2213,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
arcsegcount = 32; arcsegcount = 32;
zc->SetArcSegCount( arcsegcount ); zc->SetArcSegCount( arcsegcount );
zc->SetIsFilled( fillstate == 'F' ? true : false ); zc->SetIsFilled( fillstate == 'S' ? true : false );
zc->SetThermalReliefGap( thermalReliefGap ); zc->SetThermalReliefGap( thermalReliefGap );
zc->SetThermalReliefCopperBridge( thermalReliefCopperBridge ); zc->SetThermalReliefCopperBridge( thermalReliefCopperBridge );
} }
...@@ -3393,7 +3391,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const ...@@ -3393,7 +3391,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
// using "diff", then switch to more concise form for release builds. // using "diff", then switch to more concise form for release builds.
"Sc %lf %lf %lf\n", "Sc %lf %lf %lf\n",
#else #else
"Sc %.16g %.16g %.16g\n", "Sc %.10g %.10g %.10g\n",
#endif #endif
t3D->m_MatScale.x, t3D->m_MatScale.x,
t3D->m_MatScale.y, t3D->m_MatScale.y,
...@@ -3403,7 +3401,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const ...@@ -3403,7 +3401,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
#if defined(DEBUG) #if defined(DEBUG)
"Of %lf %lf %lf\n", "Of %lf %lf %lf\n",
#else #else
"Of %.16g %.16g %.16g\n", "Of %.10g %.10g %.10g\n",
#endif #endif
t3D->m_MatPosition.x, t3D->m_MatPosition.x,
t3D->m_MatPosition.y, t3D->m_MatPosition.y,
...@@ -3413,7 +3411,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const ...@@ -3413,7 +3411,7 @@ void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const
#if defined(DEBUG) #if defined(DEBUG)
"Ro %lf %lf %lf\n", "Ro %lf %lf %lf\n",
#else #else
"Ro %.16g %.16g %.16g\n", "Ro %.10g %.10g %.10g\n",
#endif #endif
t3D->m_MatRotation.x, t3D->m_MatRotation.x,
t3D->m_MatRotation.y, t3D->m_MatRotation.y,
......
...@@ -189,13 +189,10 @@ protected: ...@@ -189,13 +189,10 @@ protected:
* Function loadTrackList * Function loadTrackList
* reads a list of segments (Tracks and Vias, or Segzones) * 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 * @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). * 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 loadZONE_CONTAINER(); // "$CZONE_OUTLINE"
void loadDIMENSION(); // "$COTATION" void loadDIMENSION(); // "$COTATION"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment