CHANGED: locked parameter explictly written

Removed the bitmap status field that saved internal states into the
file, creating rcs churn.  Also removed the unneeded count variables at
the start of the file as these created merge conflicts for every board
that had multiple revisions

Fixes https://gitlab.com/kicad/code/kicad/issues/1850
This commit is contained in:
Seth Hillbrand 2020-08-18 06:08:32 -07:00
parent a38c2aad1f
commit a3fc028c9b
4 changed files with 33 additions and 26 deletions

View File

@ -525,14 +525,9 @@ void PCB_IO::formatGeneral( BOARD* aBoard, int aNestLevel ) const
m_out->Print( 0, "\n" );
m_out->Print( aNestLevel, "(general\n" );
// Write Bounding box info
m_out->Print( aNestLevel+1, "(thickness %s)\n",
FormatInternalUnits( dsnSettings.GetBoardThickness() ).c_str() );
m_out->Print( aNestLevel+1, "(drawings %u)\n", (unsigned)aBoard->Drawings().size() );
m_out->Print( aNestLevel + 1, "(tracks %u)\n", (unsigned)aBoard->Tracks().size() );
m_out->Print( aNestLevel + 1, "(modules %u)\n", (unsigned)aBoard->Modules().size() );
m_out->Print( aNestLevel+1, "(nets %d)\n", m_mapping->GetSize() );
m_out->Print( aNestLevel, ")\n\n" );
aBoard->GetPageSettings().Format( m_out, aNestLevel, m_ctl );
@ -819,9 +814,6 @@ void PCB_IO::format( DRAWSEGMENT* aSegment, int aNestLevel ) const
m_out->Print( 0, " (tstamp %s)", TO_UTF8( aSegment->m_Uuid.AsString() ) );
if( aSegment->GetStatus() )
m_out->Print( 0, " (status %X)", aSegment->GetStatus() );
m_out->Print( 0, ")\n" );
}
@ -1670,13 +1662,13 @@ void PCB_IO::format( TRACK* aTrack, int aNestLevel ) const
m_out->Print( 0, " (layer %s)", m_out->Quotew( aTrack->GetLayerName() ).c_str() );
}
if( aTrack->IsLocked() )
m_out->Print( 0, " (locked)" );
m_out->Print( 0, " (net %d)", m_mapping->Translate( aTrack->GetNetCode() ) );
m_out->Print( 0, " (tstamp %s)", TO_UTF8( aTrack->m_Uuid.AsString() ) );
if( aTrack->GetStatus() != 0 )
m_out->Print( 0, " (status %X)", aTrack->GetStatus() );
m_out->Print( 0, ")\n" );
}

View File

@ -77,7 +77,8 @@ class TEXTE_PCB;
//#define SEXPR_BOARD_FILE_VERSION 20200807 // Add zone hatch advanced settings
//#define SEXPR_BOARD_FILE_VERSION 20200808 // Add properties to modules
//#define SEXPR_BOARD_FILE_VERSION 20200809 // Add REMOVE_UNUSED_LAYERS option to vias and THT pads
#define SEXPR_BOARD_FILE_VERSION 20200811 // Add groups
//#define SEXPR_BOARD_FILE_VERSION 20200811 // Add groups
#define SEXPR_BOARD_FILE_VERSION 20200818 // Remove Status flag bitmap and setup counts
#define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names
#define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library)

View File

@ -836,17 +836,6 @@ void PCB_PARSER::parseGeneralSection()
NeedRIGHT();
break;
case T_nets:
m_netCodes.resize( parseInt( "nets number" ) );
NeedRIGHT();
break;
case T_no_connects:
// ignore
parseInt( "no connect count" );
NeedRIGHT();
break;
default: // Skip everything but the board thickness.
while( ( token = NextTok() ) != T_RIGHT )
{
@ -2228,6 +2217,7 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT( bool aAllowCirclesZeroWidth )
const_cast<KIID&>( segment->m_Uuid ) = CurStrToKIID();
break;
/// We continue to parse the status field but it is no longer written
case T_status:
segment->SetStatus( static_cast<STATUS_FLAGS>( parseHex() ) );
break;
@ -3077,12 +3067,13 @@ EDGE_MODULE* PCB_PARSER::parseEDGE_MODULE()
const_cast<KIID&>( segment->m_Uuid ) = CurStrToKIID();
break;
/// We continue to parse the status field but it is no longer written
case T_status:
segment->SetStatus( static_cast<STATUS_FLAGS>( parseHex() ) );
break;
default:
Expecting( "layer or width" );
Expecting( "layer, width or tstamp" );
}
NeedRIGHT();
@ -3754,10 +3745,15 @@ ARC* PCB_PARSER::parseARC()
const_cast<KIID&>( arc->m_Uuid ) = CurStrToKIID();
break;
/// We continue to parse the status field but it is no longer written
case T_status:
arc->SetStatus( static_cast<STATUS_FLAGS>( parseHex() ) );
break;
case T_locked:
arc->SetState( TRACK_LOCKED, 1 );
break;
default:
Expecting( "start, mid, end, width, layer, net, tstamp, or status" );
}
@ -3821,12 +3817,17 @@ TRACK* PCB_PARSER::parseTRACK()
const_cast<KIID&>( track->m_Uuid ) = CurStrToKIID();
break;
/// We continue to parse the status field but it is no longer written
case T_status:
track->SetStatus( static_cast<STATUS_FLAGS>( parseHex() ) );
break;
case T_locked:
track->SetState( TRACK_LOCKED, 1 );
break;
default:
Expecting( "start, end, width, layer, net, tstamp, or status" );
Expecting( "start, end, width, layer, net, tstamp, or locked" );
}
NeedRIGHT();
@ -3916,11 +3917,17 @@ VIA* PCB_PARSER::parseVIA()
NeedRIGHT();
break;
/// We continue to parse the status field but it is no longer written
case T_status:
via->SetStatus( static_cast<STATUS_FLAGS>( parseHex() ) );
NeedRIGHT();
break;
case T_locked:
via->SetState( TRACK_LOCKED, 1 );
NeedRIGHT();
break;
default:
Expecting( "blind, micro, at, size, drill, layers, net, tstamp, or status" );
}

View File

@ -4,6 +4,13 @@
"active_layer_preset": "",
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 1.0
},
"selection_filter": {
"dimensions": true,
"footprints": true,
@ -58,6 +65,6 @@
},
"meta": {
"filename": "complex_hierarchy.kicad_prl",
"version": 1
"version": 2
}
}