Remove duplicate code (pcbnew saves twice 'general' and 'layers' keys in 'kicad_pcb' file)
Fixes: lp:1724522 https://bugs.launchpad.net/kicad/+bug/1724522
This commit is contained in:
parent
537804b5e8
commit
72d4889a6d
|
@ -533,81 +533,6 @@ void PCB_IO::formatSetup( 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",
|
||||
FMTIU( dsnSettings.GetBoardThickness() ).c_str() );
|
||||
|
||||
m_out->Print( aNestLevel+1, "(drawings %d)\n", aBoard->Drawings().Size() );
|
||||
m_out->Print( aNestLevel+1, "(tracks %d)\n", aBoard->GetNumSegmTrack() );
|
||||
m_out->Print( aNestLevel+1, "(zones %d)\n", aBoard->GetNumSegmZone() );
|
||||
m_out->Print( aNestLevel+1, "(modules %d)\n", aBoard->m_Modules.GetCount() );
|
||||
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 );
|
||||
aBoard->GetTitleBlock().Format( m_out, aNestLevel, m_ctl );
|
||||
|
||||
// Layers.
|
||||
m_out->Print( aNestLevel, "(layers\n" );
|
||||
|
||||
// Save only the used copper layers from front to back.
|
||||
LSET visible_layers = aBoard->GetVisibleLayers();
|
||||
|
||||
for( LSEQ cu = aBoard->GetEnabledLayers().CuStack(); cu; ++cu )
|
||||
{
|
||||
PCB_LAYER_ID layer = *cu;
|
||||
|
||||
m_out->Print( aNestLevel+1, "(%d %s %s", layer,
|
||||
m_out->Quotew( aBoard->GetLayerName( layer ) ).c_str(),
|
||||
LAYER::ShowType( aBoard->GetLayerType( layer ) ) );
|
||||
|
||||
if( !visible_layers[layer] )
|
||||
m_out->Print( 0, " hide" );
|
||||
|
||||
m_out->Print( 0, ")\n" );
|
||||
}
|
||||
|
||||
// Save used non-copper layers in the order they are defined.
|
||||
// desired sequence for non Cu BOARD layers.
|
||||
static const PCB_LAYER_ID non_cu[] =
|
||||
{
|
||||
B_Adhes, // 32
|
||||
F_Adhes,
|
||||
B_Paste,
|
||||
F_Paste,
|
||||
B_SilkS,
|
||||
F_SilkS,
|
||||
B_Mask,
|
||||
F_Mask,
|
||||
Dwgs_User,
|
||||
Cmts_User,
|
||||
Eco1_User,
|
||||
Eco2_User,
|
||||
Edge_Cuts,
|
||||
Margin,
|
||||
B_CrtYd,
|
||||
F_CrtYd,
|
||||
B_Fab,
|
||||
F_Fab
|
||||
};
|
||||
|
||||
for( LSEQ seq = aBoard->GetEnabledLayers().Seq( non_cu, DIM( non_cu ) ); seq; ++seq )
|
||||
{
|
||||
PCB_LAYER_ID layer = *seq;
|
||||
|
||||
m_out->Print( aNestLevel+1, "(%d %s user", layer,
|
||||
m_out->Quotew( aBoard->GetLayerName( layer ) ).c_str() );
|
||||
|
||||
if( !visible_layers[layer] )
|
||||
m_out->Print( 0, " hide" );
|
||||
|
||||
m_out->Print( 0, ")\n" );
|
||||
}
|
||||
|
||||
m_out->Print( aNestLevel, ")\n\n" );
|
||||
|
||||
// Setup
|
||||
m_out->Print( aNestLevel, "(setup\n" );
|
||||
|
||||
|
|
Loading…
Reference in New Issue