本文整理汇总了C++中LSET::CuStack方法的典型用法代码示例。如果您正苦于以下问题:C++ LSET::CuStack方法的具体用法?C++ LSET::CuStack怎么用?C++ LSET::CuStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSET
的用法示例。
在下文中一共展示了LSET::CuStack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReFill
void PCB_LAYER_WIDGET::ReFill()
{
BOARD* brd = myframe->GetBoard();
LSET enabled = brd->GetEnabledLayers();
ClearLayerRows();
wxString dsc;
// show all coppers first, with front on top, back on bottom, then technical layers
for( LSEQ cu_stack = enabled.CuStack(); cu_stack; ++cu_stack )
{
LAYER_ID layer = *cu_stack;
switch( layer )
{
case F_Cu:
dsc = _("Front copper layer");
break;
case B_Cu:
dsc = _("Back copper layer");
break;
default:
dsc = _("Inner copper layer");
break;
}
AppendLayerRow( LAYER_WIDGET::ROW(
brd->GetLayerName( layer ), layer, brd->GetLayerColor( layer ),
dsc, true ) );
}
// technical layers are shown in this order:
// Because they are static, wxGetTranslation must be explicitely
// called for tooltips.
static const struct {
LAYER_ID layerId;
wxString tooltip;
} non_cu_seq[] = {
{ F_Adhes, _( "Adhesive on board's front" ) },
{ B_Adhes, _( "Adhesive on board's back" ) },
{ F_Paste, _( "Solder paste on board's front" ) },
{ B_Paste, _( "Solder paste on board's back" ) },
{ F_SilkS, _( "Silkscreen on board's front" ) },
{ B_SilkS, _( "Silkscreen on board's back" ) },
{ F_Mask, _( "Solder mask on board's front" ) },
{ B_Mask, _( "Solder mask on board's back" ) },
{ Dwgs_User, _( "Explanatory drawings" ) },
{ Cmts_User, _( "Explanatory comments" ) },
{ Eco1_User, _( "User defined meaning" ) },
{ Eco2_User, _( "User defined meaning" ) },
{ Edge_Cuts, _( "Board's perimeter definition" ) },
{ Margin, _( "Board's edge setback outline" ) },
{ F_CrtYd, _( "Footprint courtyards on board's front" ) },
{ B_CrtYd, _( "Footprint courtyards on board's back" ) },
{ F_Fab, _( "Footprint assembly on board's front" ) },
{ B_Fab, _( "Footprint assembly on board's back" ) }
};
for( unsigned i=0; i<DIM(non_cu_seq); ++i )
{
LAYER_ID layer = non_cu_seq[i].layerId;
if( !enabled[layer] )
continue;
AppendLayerRow( LAYER_WIDGET::ROW(
brd->GetLayerName( layer ), layer, brd->GetLayerColor( layer ),
wxGetTranslation( non_cu_seq[i].tooltip ), true ) );
}
installRightLayerClickHandler();
}
示例2: ReFill
void PCB_LAYER_WIDGET::ReFill()
{
BOARD* brd = myframe->GetBoard();
LSET enabled = brd->GetEnabledLayers();
ClearLayerRows();
wxString dsc;
// show all coppers first, with front on top, back on bottom, then technical layers
for( LSEQ cu_stack = enabled.CuStack(); cu_stack; ++cu_stack )
{
PCB_LAYER_ID layer = *cu_stack;
switch( layer )
{
case F_Cu:
dsc = _( "Front copper layer" );
break;
case B_Cu:
dsc = _( "Back copper layer" );
break;
default:
dsc = _( "Inner copper layer" );
break;
}
AppendLayerRow( LAYER_WIDGET::ROW(
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
dsc, true ) );
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false );
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString );
}
}
UpdateLayouts();
// technical layers are shown in this order:
// Because they are static, wxGetTranslation must be explicitly
// called for tooltips.
static const struct {
PCB_LAYER_ID layerId;
wxString tooltip;
} non_cu_seq[] = {
{ F_Adhes, _( "Adhesive on board's front" ) },
{ B_Adhes, _( "Adhesive on board's back" ) },
{ F_Paste, _( "Solder paste on board's front" ) },
{ B_Paste, _( "Solder paste on board's back" ) },
{ F_SilkS, _( "Silkscreen on board's front" ) },
{ B_SilkS, _( "Silkscreen on board's back" ) },
{ F_Mask, _( "Solder mask on board's front" ) },
{ B_Mask, _( "Solder mask on board's back" ) },
{ Dwgs_User, _( "Explanatory drawings" ) },
{ Cmts_User, _( "Explanatory comments" ) },
{ Eco1_User, _( "User defined meaning" ) },
{ Eco2_User, _( "User defined meaning" ) },
{ Edge_Cuts, _( "Board's perimeter definition" ) },
{ Margin, _( "Board's edge setback outline" ) },
{ F_CrtYd, _( "Footprint courtyards on board's front" ) },
{ B_CrtYd, _( "Footprint courtyards on board's back" ) },
{ F_Fab, _( "Footprint assembly on board's front" ) },
{ B_Fab, _( "Footprint assembly on board's back" ) }
};
for( unsigned i=0; i<arrayDim( non_cu_seq ); ++i )
{
PCB_LAYER_ID layer = non_cu_seq[i].layerId;
if( !enabled[layer] )
continue;
AppendLayerRow( LAYER_WIDGET::ROW(
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
wxGetTranslation( non_cu_seq[i].tooltip ), true ) );
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false );
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString );
}
}
}