KiCad PCB EDA Suite
PANEL_SETUP_BOARD_STACKUP Class Reference

#include <panel_board_stackup.h>

Inheritance diagram for PANEL_SETUP_BOARD_STACKUP:
PANEL_SETUP_BOARD_STACKUP_BASE

Public Member Functions

 PANEL_SETUP_BOARD_STACKUP (PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame, PANEL_SETUP_LAYERS *aPanelLayers)
 
 ~PANEL_SETUP_BOARD_STACKUP ()
 
void ImportSettingsFrom (BOARD *aBoard)
 
void OnLayersOptionsChanged (LSET aNewLayerSet)
 Must be called if the copper layers count has changed or solder mask, solder paste or silkscreen layers are enabled or disabled Rebuild the Layer Stack Panel if the new layer set differs from the current layet set. More...
 
int GetCopperLayerCount () const
 
BOARD_STACKUP_ITEMGetStackupItem (int aRow)
 
int GetSublayerId (int aRow)
 
wxColor GetSelectedColor (int aRow) const
 Return the color currently selected for the row aRow. More...
 
BOARD_STACKUPGetStackup ()
 
bool TransferDataFromWindow () override
 

Protected Attributes

wxStaticText * m_lblCopperLayers
 
wxChoice * m_choiceCopperLayers
 
wxCheckBox * m_impedanceControlled
 
wxButton * m_buttonAddDielectricLayer
 
wxButton * m_buttonRemoveDielectricLayer
 
wxScrolledWindow * m_scGridWin
 
wxFlexGridSizer * m_fgGridSizer
 
wxStaticText * m_staticTextLayer
 
wxStaticText * m_staticTextLayerId
 
wxStaticText * m_staticTextType
 
wxStaticText * m_staticTextMaterial
 
wxStaticText * m_staticTextThickness
 
wxStaticBitmap * m_bitmapLockThickness
 
wxStaticText * m_staticTextColor
 
wxStaticText * m_staticTextEpsilonR
 
wxStaticText * m_staticTextLossTg
 
wxStaticText * m_staticTextCT
 
wxTextCtrl * m_tcCTValue
 
wxButton * m_buttonAdjust
 
wxButton * m_buttonExport
 

Private Member Functions

BOARD_STACKUP_ROW_UI_ITEM createRowData (int aRow, BOARD_STACKUP_ITEM *aStackupItem, int aSublayerIdx)
 Creates a BOARD_STACKUP_ROW_UI_ITEM relative to the aStackupItem. More...
 
wxControl * addSpacer ()
 add a Spacer in m_fgGridSizer when a empty cell is needed More...
 
void addMaterialChooser (wxWindowID aId, const wxString *aMaterialName, BOARD_STACKUP_ROW_UI_ITEM &aUiRowItem)
 add a control (a wxTextCtrl + a button) in m_fgGridSizer to select a material More...
 
void buildLayerStackPanel (bool aCreatedInitialStackup)
 Populate m_fgGridSizer with items to handle stackup parameters This is a full list: all copper layers and all tech layers that are supported by the stackup items not in the current board stackup will be not shown, but they are existing in list. More...
 
void synchronizeWithBoard (bool aFullSync)
 Synchronize the full stackup shown in m_fgGridSizer according to the stackup of the current board and optionally update the stackup params (thickness, color ... ) More...
 
void showOnlyActiveLayers ()
 Show or do not show items in m_fgGridSizer according to the stackup of the current board. More...
 
void rebuildLayerStackPanel ()
 Populate m_fgGridSizer with items to handle stackup parameters If previous items are in list, remove old items New prms are added must be called after adding or deleting a dielectric parameter set. More...
 
bool transferDataFromUIToStackup ()
 Transfer current UI settings to m_stackup but not to the board. More...
 
void updateCopperLayerCount ()
 Updates the enabled copper layers when the dropdown is changed. More...
 
int computeBoardThickness ()
 Recompute the board thickness and update the textbox. More...
 
void onColorSelected (wxCommandEvent &event)
 
void onMaterialChange (wxCommandEvent &event)
 
void onThicknessChange (wxCommandEvent &event)
 
void onExportToClipboard (wxCommandEvent &event) override
 
void onAddDielectricLayer (wxCommandEvent &event) override
 
void onRemoveDielectricLayer (wxCommandEvent &event) override
 
void onRemoveDielUI (wxUpdateUIEvent &event) override
 
void onCopperLayersSelCount (wxCommandEvent &event) override
 
void onAdjustDielectricThickness (wxCommandEvent &event) override
 
void updateIconColor (int aRow=-1)
 Update the icons color (swatches in first grid column) More...
 
wxColor getColorIconItem (int aRow)
 
wxBitmapComboBox * createColorBox (BOARD_STACKUP_ITEM *aStackupItem, int aRow)
 creates a bitmap combobox to select a layer color More...
 
void disconnectEvents ()
 disconnect event handlers connected to wxControl items found in list m_controlItemsList More...
 

Private Attributes

BOARD_STACKUP m_stackup
 
PANEL_SETUP_LAYERSm_panelLayers
 
LSET m_enabledLayers
 
DIELECTRIC_SUBSTRATE_LIST m_delectricMatList
 
DIELECTRIC_SUBSTRATE_LIST m_solderMaskMatList
 
DIELECTRIC_SUBSTRATE_LIST m_silkscreenMatList
 
std::vector< BOARD_STACKUP_ROW_UI_ITEMm_rowUiItemsList
 
PAGED_DIALOGm_parentDialog
 
BOARDm_board
 
BOARD_DESIGN_SETTINGSm_brdSettings
 
EDA_UNITS m_units
 
PCB_EDIT_FRAMEm_frame
 
wxSize m_numericTextCtrlSize
 
wxSize m_numericFieldsSize
 
wxArrayString m_core_prepreg_choice
 
wxSize m_colorSwatchesSize
 
wxSize m_colorIconsSize
 
std::vector< wxControl * > m_controlItemsList
 

Detailed Description

Definition at line 87 of file panel_board_stackup.h.

Constructor & Destructor Documentation

◆ PANEL_SETUP_BOARD_STACKUP()

PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP ( PAGED_DIALOG aParent,
PCB_EDIT_FRAME aFrame,
PANEL_SETUP_LAYERS aPanelLayers 
)

Definition at line 76 of file panel_board_stackup.cpp.

77 :
82{
83 m_parentDialog = aParent;
84 m_frame = aFrame;
85 m_panelLayers = aPanelLayers;
88 m_units = aFrame->GetUserUnits();
89
91
93
94 // Calculates a good size for color swatches (icons) in this dialog
95 wxClientDC dc( this );
96 m_colorSwatchesSize = dc.GetTextExtent( wxT( "XX" ) );
97 m_colorIconsSize = dc.GetTextExtent( wxT( "XXXX" ) );
98
99 // Calculates a good size for wxTextCtrl to enter Epsilon R and Loss tan
100 // ("0.0000000" + margins)
101 m_numericFieldsSize = dc.GetTextExtent( wxT( "X.XXXXXXX" ) );
102 m_numericFieldsSize.y = -1; // Use default for the vertical size
103
104 // Calculates a minimal size for wxTextCtrl to enter a dim with units
105 // ("000.0000000 mils" + margins)
106 m_numericTextCtrlSize = dc.GetTextExtent( wxT( "XXX.XXXXXXX mils" ) );
107 m_numericTextCtrlSize.y = -1; // Use default for the vertical size
108
109 // The grid column containing the lock checkbox is kept to a minimal
110 // size. So we use a wxStaticBitmap: set the bitmap itself
112
113 // Gives a minimal size of wxTextCtrl showing dimensions+units
114 m_tcCTValue->SetMinSize( m_numericTextCtrlSize );
115
116 // Prepare dielectric layer type: layer type keyword is "core" or "prepreg"
117 m_core_prepreg_choice.Add( _( "Core" ) );
118 m_core_prepreg_choice.Add( _( "PrePreg" ) );
119
120 buildLayerStackPanel( true );
121 synchronizeWithBoard( true );
123}
wxBitmap KiScaledBitmap(BITMAPS aBitmap, wxWindow *aWindow, int aHeight, bool aQuantized)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:148
static LSET StackupAllowedBrdLayers()
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:498
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:615
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
wxTreebook * GetTreebook()
Definition: paged_dialog.h:37
PANEL_SETUP_BOARD_STACKUP_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(680, 281), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
DIELECTRIC_SUBSTRATE_LIST m_silkscreenMatList
int computeBoardThickness()
Recompute the board thickness and update the textbox.
void synchronizeWithBoard(bool aFullSync)
Synchronize the full stackup shown in m_fgGridSizer according to the stackup of the current board and...
BOARD_DESIGN_SETTINGS * m_brdSettings
DIELECTRIC_SUBSTRATE_LIST m_solderMaskMatList
PANEL_SETUP_LAYERS * m_panelLayers
void buildLayerStackPanel(bool aCreatedInitialStackup)
Populate m_fgGridSizer with items to handle stackup parameters This is a full list: all copper layers...
DIELECTRIC_SUBSTRATE_LIST m_delectricMatList
void SetPhysicalStackupPanel(PANEL_SETUP_BOARD_STACKUP *aPanel)
BOARD * GetBoard() const
#define _(s)

References _, buildLayerStackPanel(), computeBoardThickness(), PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), BOARD::GetEnabledLayers(), EDA_BASE_FRAME::GetUserUnits(), KiScaledBitmap(), locked, PANEL_SETUP_BOARD_STACKUP_BASE::m_bitmapLockThickness, m_board, m_brdSettings, m_colorIconsSize, m_colorSwatchesSize, m_core_prepreg_choice, m_enabledLayers, m_frame, m_numericFieldsSize, m_numericTextCtrlSize, m_panelLayers, m_parentDialog, PANEL_SETUP_BOARD_STACKUP_BASE::m_tcCTValue, m_units, PANEL_SETUP_LAYERS::SetPhysicalStackupPanel(), BOARD_STACKUP::StackupAllowedBrdLayers(), and synchronizeWithBoard().

◆ ~PANEL_SETUP_BOARD_STACKUP()

PANEL_SETUP_BOARD_STACKUP::~PANEL_SETUP_BOARD_STACKUP ( )

Definition at line 126 of file panel_board_stackup.cpp.

127{
129}
void disconnectEvents()
disconnect event handlers connected to wxControl items found in list m_controlItemsList

References disconnectEvents().

Member Function Documentation

◆ addMaterialChooser()

void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser ( wxWindowID  aId,
const wxString *  aMaterialName,
BOARD_STACKUP_ROW_UI_ITEM aUiRowItem 
)
private

add a control (a wxTextCtrl + a button) in m_fgGridSizer to select a material

Parameters
aIdis the wxControl id, used to know the event source
aMaterialNameis the name of the currently selected material (can be null)
aUiRowItemis the BOARD_STACKUP_ROW_UI_ITEM to store the controls created

Definition at line 643 of file panel_board_stackup.cpp.

645{
646 wxBoxSizer* bSizerMat = new wxBoxSizer( wxHORIZONTAL );
647 m_fgGridSizer->Add( bSizerMat, 1, wxRIGHT|wxEXPAND, 4 );
648 wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY );
649
650 if( aMaterialName )
651 {
652 if( IsPrmSpecified( *aMaterialName ) )
653 textCtrl->ChangeValue( *aMaterialName );
654 else
655 textCtrl->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
656 }
657
658 textCtrl->SetMinSize( m_numericTextCtrlSize );
659 bSizerMat->Add( textCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
660
661 wxButton* m_buttonMat = new wxButton( m_scGridWin, aId, _( "..." ), wxDefaultPosition,
662 wxDefaultSize, wxBU_EXACTFIT );
663 bSizerMat->Add( m_buttonMat, 0, wxALIGN_CENTER_VERTICAL, 2 );
664
665 m_buttonMat->Connect( wxEVT_COMMAND_BUTTON_CLICKED,
666 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onMaterialChange ),
667 nullptr, this );
668 m_controlItemsList.push_back( m_buttonMat );
669
670 aUiRowItem.m_MaterialCtrl = textCtrl;
671 aUiRowItem.m_MaterialButt = m_buttonMat;
672}
bool IsPrmSpecified(const wxString &aPrmValue)
std::vector< wxControl * > m_controlItemsList
void onMaterialChange(wxCommandEvent &event)
wxString NotSpecifiedPrm()

References _, IsPrmSpecified(), m_controlItemsList, PANEL_SETUP_BOARD_STACKUP_BASE::m_fgGridSizer, BOARD_STACKUP_ROW_UI_ITEM::m_MaterialButt, BOARD_STACKUP_ROW_UI_ITEM::m_MaterialCtrl, m_numericTextCtrlSize, PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin, NotSpecifiedPrm(), and onMaterialChange().

Referenced by createRowData().

◆ addSpacer()

wxControl * PANEL_SETUP_BOARD_STACKUP::addSpacer ( )
private

add a Spacer in m_fgGridSizer when a empty cell is needed

Definition at line 675 of file panel_board_stackup.cpp.

676{
677 wxStaticText* emptyText = new wxStaticText( m_scGridWin, wxID_ANY, wxEmptyString );
678 m_fgGridSizer->Add( emptyText, 0, wxALIGN_CENTER_VERTICAL );
679 return emptyText;
680}

References PANEL_SETUP_BOARD_STACKUP_BASE::m_fgGridSizer, and PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin.

Referenced by createRowData().

◆ buildLayerStackPanel()

void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel ( bool  aCreatedInitialStackup)
private

Populate m_fgGridSizer with items to handle stackup parameters This is a full list: all copper layers and all tech layers that are supported by the stackup items not in the current board stackup will be not shown, but they are existing in list.

Parameters
aCreatedInitialStackup= true to create a initial stackup list for the dialog false to build the stackup panel from the existing stackup list.

Definition at line 933 of file panel_board_stackup.cpp.

934{
935 // Build a full stackup for the dialog, with a active copper layer count
936 // = current board layer count to calculate a reasonable default stackup:
937 if( aCreatedInitialStackup )
938 {
939 // Creates a full BOARD_STACKUP with 32 copper layers.
940 // extra layers will be hidden later.
941 // but if the number of layer is changed in the dialog, the corresponding
942 // widgets will be available with their previous values.
944 const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
945
946 // Now initialize all stackup items to the board values, when exist
947 for( BOARD_STACKUP_ITEM* item: m_stackup.GetList() )
948 {
949 // Search for board settings:
950 for( BOARD_STACKUP_ITEM* board_item: brd_stackup.GetList() )
951 {
952 if( item->GetBrdLayerId() != UNDEFINED_LAYER )
953 {
954 if( item->GetBrdLayerId() == board_item->GetBrdLayerId() )
955 {
956 *item = *board_item;
957 break;
958 }
959 }
960 else // dielectric layer: see m_DielectricLayerId for identification
961 {
962 // Compare dielectric layer with dielectric layer
963 if( board_item->GetBrdLayerId() != UNDEFINED_LAYER )
964 continue;
965
966 if( item->GetDielectricLayerId() == board_item->GetDielectricLayerId() )
967 {
968 *item = *board_item;
969 break;
970 }
971 }
972 }
973 }
974 }
975
976 int row = 0;
977
978 for( BOARD_STACKUP_ITEM* item : m_stackup.GetList() )
979 {
980 for( int sub_idx = 0; sub_idx < item->GetSublayersCount(); sub_idx++ )
981 {
982 BOARD_STACKUP_ROW_UI_ITEM ui_row_item = createRowData( row, item, sub_idx );
983 m_rowUiItemsList.emplace_back( ui_row_item );
984
985 row++;
986 }
987 }
988
990}
BOARD_STACKUP & GetStackupDescriptor()
Manage one layer needed to make a physical board.
Definition: board_stackup.h:90
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
void BuildDefaultStackupList(const BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
BOARD_STACKUP_ROW_UI_ITEM createRowData(int aRow, BOARD_STACKUP_ITEM *aStackupItem, int aSublayerIdx)
Creates a BOARD_STACKUP_ROW_UI_ITEM relative to the aStackupItem.
void updateIconColor(int aRow=-1)
Update the icons color (swatches in first grid column)
std::vector< BOARD_STACKUP_ROW_UI_ITEM > m_rowUiItemsList
@ UNDEFINED_LAYER
Definition: layer_ids.h:60

References BOARD_STACKUP::BuildDefaultStackupList(), createRowData(), BOARD_DESIGN_SETTINGS::GetCopperLayerCount(), BOARD_STACKUP::GetList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), m_brdSettings, m_rowUiItemsList, m_stackup, UNDEFINED_LAYER, and updateIconColor().

Referenced by PANEL_SETUP_BOARD_STACKUP(), and rebuildLayerStackPanel().

◆ computeBoardThickness()

int PANEL_SETUP_BOARD_STACKUP::computeBoardThickness ( )
private

Recompute the board thickness and update the textbox.

Returns
the computed value

Definition at line 431 of file panel_board_stackup.cpp.

432{
433 int thickness = 0;
434
436 {
437 BOARD_STACKUP_ITEM* item = ui_item.m_Item;
438
439 if( !item->IsThicknessEditable() || !ui_item.m_isEnabled )
440 continue;
441
442 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_ThicknessCtrl );
443 wxString txt = textCtrl->GetValue();
444
445 int item_thickness = ValueFromString( m_frame->GetUserUnits(), txt );
446 thickness += item_thickness;
447 }
448
449 wxString thicknessStr = StringFromValue( m_units, thickness, true );
450
451 // The text in the event will translate to the value for the text control
452 // and is only updated if it changed
453 m_tcCTValue->ChangeValue( thicknessStr );
454
455 return thickness;
456}
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: base_units.cpp:383
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:209
bool IsThicknessEditable() const

References EDA_BASE_FRAME::GetUserUnits(), BOARD_STACKUP_ITEM::IsThicknessEditable(), m_frame, m_rowUiItemsList, PANEL_SETUP_BOARD_STACKUP_BASE::m_tcCTValue, m_units, StringFromValue(), and ValueFromString().

Referenced by ImportSettingsFrom(), onAddDielectricLayer(), onAdjustDielectricThickness(), onCopperLayersSelCount(), onRemoveDielectricLayer(), onThicknessChange(), and PANEL_SETUP_BOARD_STACKUP().

◆ createColorBox()

wxBitmapComboBox * PANEL_SETUP_BOARD_STACKUP::createColorBox ( BOARD_STACKUP_ITEM aStackupItem,
int  aRow 
)
private

creates a bitmap combobox to select a layer color

Returns
the created wxBitmapComboBox
Parameters
aStackupItem= the BOARD_STACKUP_ITEM related to the bitmap combobox (to set the user color, if any) can be nullptr
aRow= the row index in the wxFlexGridSizer (used to build a wxWidget unique id)

Definition at line 1484 of file panel_board_stackup.cpp.

1486{
1487 wxBitmapComboBox* combo = new wxBitmapComboBox( m_scGridWin, ID_ITEM_COLOR + aRow,
1488 wxEmptyString, wxDefaultPosition,
1489 wxDefaultSize, 0, nullptr, wxCB_READONLY );
1490
1491 // Fills the combo box with choice list + bitmaps
1492 BOARD_STACKUP_ITEM_TYPE itemType = aStackupItem ? aStackupItem->GetType()
1494
1495 for( int ii = 0; ii < GetStandardColorCount( itemType ); ii++ )
1496 {
1497 wxString label;
1498 COLOR4D curr_color;
1499
1500 // Defined colors have a name, the user color uses HTML notation ( i.e. #FF000080)
1501 if( IsCustomColorIdx( itemType, ii )
1502 && aStackupItem && aStackupItem->GetColor().StartsWith( wxT( "#" ) ) )
1503 {
1504 label = aStackupItem->GetColor();
1505 curr_color = COLOR4D( label );
1506 }
1507 else
1508 {
1509 label = wxGetTranslation( GetStandardColorName( itemType, ii ) );
1510 curr_color = GetStandardColor( itemType, ii );
1511 }
1512
1513 wxBitmap layerbmp( m_colorSwatchesSize.x, m_colorSwatchesSize.y );
1514 LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D( 0, 0, 0, 0 ), curr_color );
1515
1516 combo->Append( label, layerbmp );
1517 }
1518
1519 // Ensure the size of the widget is enough to show the text and the icon
1520 // We have to have a selected item when doing this, because otherwise GTK
1521 // will just choose a random size that might not fit the actual data
1522 // (such as in cases where the font size is very large). So we select
1523 // the longest item (which should be the last item), and size it that way.
1524 int sel = combo->GetSelection();
1525 combo->SetSelection( combo->GetCount() - 1 );
1526
1527 combo->SetMinSize( wxSize( -1, -1 ) );
1528 wxSize bestSize = combo->GetBestSize();
1529
1530 bestSize.x = bestSize.x + m_colorSwatchesSize.x;
1531 combo->SetMinSize( bestSize );
1532 combo->SetSelection( sel );
1533
1534 // add the wxBitmapComboBox to wxControl list, to be able to disconnect the event
1535 // on exit
1536 m_controlItemsList.push_back( combo );
1537
1538 combo->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED,
1539 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onColorSelected ),
1540 nullptr, this );
1541
1542 combo->Bind( wxEVT_COMBOBOX_DROPDOWN,
1543 [combo]( wxCommandEvent& aEvent )
1544 {
1545 combo->SetString( combo->GetCount() - 1, _( "Custom..." ) );
1546 } );
1547
1548 return combo;
1549}
BOARD_STACKUP_ITEM_TYPE
Definition: board_stackup.h:41
@ BS_ITEM_TYPE_SILKSCREEN
Definition: board_stackup.h:49
wxString GetColor() const
BOARD_STACKUP_ITEM_TYPE GetType() const
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static void DrawColorSwatch(wxBitmap &aLayerbmp, const COLOR4D &aBackground, const COLOR4D &aColor)
void onColorSelected(wxCommandEvent &event)
@ ID_ITEM_COLOR
int GetStandardColorCount(BOARD_STACKUP_ITEM_TYPE aType)
bool IsCustomColorIdx(BOARD_STACKUP_ITEM_TYPE aType, int aIdx)
KIGFX::COLOR4D GetStandardColor(BOARD_STACKUP_ITEM_TYPE aType, int aIdx)
const wxString & GetStandardColorName(BOARD_STACKUP_ITEM_TYPE aType, int aIdx)

References _, BS_ITEM_TYPE_SILKSCREEN, LAYER_SELECTOR::DrawColorSwatch(), BOARD_STACKUP_ITEM::GetColor(), GetStandardColor(), GetStandardColorCount(), GetStandardColorName(), BOARD_STACKUP_ITEM::GetType(), ID_ITEM_COLOR, IsCustomColorIdx(), m_colorSwatchesSize, m_controlItemsList, PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin, and onColorSelected().

Referenced by createRowData().

◆ createRowData()

BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData ( int  aRow,
BOARD_STACKUP_ITEM aStackupItem,
int  aSublayerIdx 
)
private

Creates a BOARD_STACKUP_ROW_UI_ITEM relative to the aStackupItem.

Returns
a BOARD_STACKUP_ROW_UI_ITEM filled with corresponding widgets
Parameters
aRowis the row index in the row list
aStackupItemis the stackup item controlled by the created BOARD_STACKUP_ROW_UI_ITEM.
aSublayerIdxis used only for BS_ITEM_TYPE_DIELECTRIC stackup items. this is the index of the sublayer to used inside aStackupItem (from 0 to sub layer count - 1)

Definition at line 683 of file panel_board_stackup.cpp.

686{
687 wxASSERT( aStackupItem );
688 wxASSERT( aSublayerIdx >= 0 && aSublayerIdx < aStackupItem->GetSublayersCount() );
689
690 BOARD_STACKUP_ROW_UI_ITEM ui_row_item( aStackupItem, aSublayerIdx );
691 BOARD_STACKUP_ITEM* item = aStackupItem;
692 int row = aRow;
693
694 // Add color swatch icon. The color will be updated later,
695 // when all widgets are initialized
696 wxStaticBitmap* bitmap = new wxStaticBitmap( m_scGridWin, wxID_ANY, wxNullBitmap );
697 m_fgGridSizer->Add( bitmap, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 4 );
698 ui_row_item.m_Icon = bitmap;
699
700 ui_row_item.m_isEnabled = true;
701
702 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
703 {
704 wxString lname = item->FormatDielectricLayerName();
705
706 if( item->GetSublayersCount() > 1 )
707 {
708 lname << wxT( " (" ) << aSublayerIdx+1 << wxT( "/" )
709 << item->GetSublayersCount() << wxT( ")" );
710 }
711
712 wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname );
713 m_fgGridSizer->Add( st_text, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
714 ui_row_item.m_LayerName = st_text;
715
716 // For a dielectric layer, the layer type choice is not for each sublayer,
717 // only for the first (aSublayerIdx = 0), and is common to all sublayers
718 if( aSublayerIdx == 0 )
719 {
720 wxChoice* choice = new wxChoice( m_scGridWin, wxID_ANY, wxDefaultPosition,
721 wxDefaultSize, m_core_prepreg_choice );
722 choice->SetSelection( item->GetTypeName() == KEY_CORE ? 0 : 1 );
723 m_fgGridSizer->Add( choice, 1, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
724
725 ui_row_item.m_LayerTypeCtrl = choice;
726 }
727 else
728 {
729 ui_row_item.m_LayerTypeCtrl = addSpacer();
730 }
731 }
732 else
733 {
734 item->SetLayerName( m_board->GetLayerName( item->GetBrdLayerId() ) );
735 wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, item->GetLayerName() );
736 m_fgGridSizer->Add( st_text, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 1 );
737 st_text->Show( true );
738 ui_row_item.m_LayerName = st_text;
739
740 wxString lname;
741
742 if( item->GetTypeName() == KEY_COPPER )
743 lname = _( "Copper" );
744 else
745 lname = wxGetTranslation( item->GetTypeName() );
746
747 st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname );
748 m_fgGridSizer->Add( st_text, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
749 ui_row_item.m_LayerTypeCtrl = st_text;
750 }
751
752 if( item->IsMaterialEditable() )
753 {
754 wxString matName = item->GetMaterial( aSublayerIdx );
755 addMaterialChooser( ID_ITEM_MATERIAL+row, &matName, ui_row_item );
756 }
757 else
758 {
759 ui_row_item.m_MaterialCtrl = addSpacer();
760 }
761
762 if( item->IsThicknessEditable() )
763 {
764 wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, ID_ITEM_THICKNESS+row );
765 textCtrl->SetMinSize( m_numericTextCtrlSize );
766 textCtrl->ChangeValue( StringFromValue( m_units, item->GetThickness( aSublayerIdx ), true ) );
767 m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
768 m_controlItemsList.push_back( textCtrl );
769 textCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED,
770 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onThicknessChange ),
771 nullptr, this );
772 ui_row_item.m_ThicknessCtrl = textCtrl;
773
774 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
775 {
776 wxCheckBox* cb_box = new wxCheckBox( m_scGridWin, ID_ITEM_THICKNESS_LOCKED+row,
777 wxEmptyString );
778 cb_box->SetValue( item->IsThicknessLocked( aSublayerIdx ) );
779 m_fgGridSizer->Add( cb_box, 0, wxALIGN_CENTER_VERTICAL, 2 );
780 ui_row_item.m_ThicknessLockCtrl = cb_box;
781 }
782 else
783 {
784 ui_row_item.m_ThicknessLockCtrl = addSpacer();
785 }
786 }
787 else
788 {
789 ui_row_item.m_ThicknessCtrl = addSpacer();
790 ui_row_item.m_ThicknessLockCtrl = addSpacer();
791 }
792
793 if( item->IsColorEditable() )
794 {
795 if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color
796 {
797 ui_row_item.m_UserColor = COLOR4D( item->GetColor() ).ToColour();
798 }
799 else
800 ui_row_item.m_UserColor = GetDefaultUserColor( item->GetType() );
801
802 wxBitmapComboBox* bm_combo = createColorBox( item, row );
803 int selected = 0; // The "not specified" item
804
805 m_fgGridSizer->Add( bm_combo, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 );
806
807 if( item->GetColor().StartsWith( wxT( "#" ) ) )
808 {
809 selected = GetColorUserDefinedListIdx( item->GetType() );
810 bm_combo->SetString( selected, item->GetColor() );
811 }
812 else
813 {
814 // Note: don't use bm_combo->FindString() because the combo strings are translated.
815 for( int ii = 0; ii < GetStandardColorCount( item->GetType()); ii++ )
816 {
817 if( GetStandardColorName( item->GetType(), ii ) == item->GetColor() )
818 {
819 selected = ii;
820 break;
821 }
822 }
823 }
824
825 bm_combo->SetSelection( selected );
826 ui_row_item.m_ColorCtrl = bm_combo;
827 }
828 else
829 {
830 ui_row_item.m_ColorCtrl = addSpacer();
831 }
832
833 if( item->HasEpsilonRValue() )
834 {
835 wxString txt = Double2Str( item->GetEpsilonR( aSublayerIdx ) );
836 wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
837 wxDefaultPosition, m_numericFieldsSize );
838 textCtrl->ChangeValue( txt );
839 m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
840 ui_row_item.m_EpsilonCtrl = textCtrl;
841 }
842 else
843 {
844 ui_row_item.m_EpsilonCtrl = addSpacer();
845 }
846
847 if( item->HasLossTangentValue() )
848 {
849 wxString txt = Double2Str( item->GetLossTangent( aSublayerIdx ) );;
850 wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
851 wxDefaultPosition, m_numericFieldsSize );
852 textCtrl->ChangeValue( txt );
853 m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
854 ui_row_item.m_LossTgCtrl = textCtrl;
855 }
856 else
857 {
858 ui_row_item.m_LossTgCtrl = addSpacer();
859 }
860
861 return ui_row_item;
862}
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:44
wxString GetTypeName() const
int GetSublayersCount() const
double GetEpsilonR(int aDielectricSubLayer=0) const
bool HasEpsilonRValue() const
bool IsMaterialEditable() const
wxString FormatDielectricLayerName() const
wxString GetLayerName() const
bool HasLossTangentValue() const
PCB_LAYER_ID GetBrdLayerId() const
int GetThickness(int aDielectricSubLayer=0) const
wxString GetMaterial(int aDielectricSubLayer=0) const
bool IsThicknessLocked(int aDielectricSubLayer=0) const
void SetLayerName(const wxString &aName)
bool IsColorEditable() const
double GetLossTangent(int aDielectricSubLayer=0) const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:397
wxControl * addSpacer()
add a Spacer in m_fgGridSizer when a empty cell is needed
void onThicknessChange(wxCommandEvent &event)
wxBitmapComboBox * createColorBox(BOARD_STACKUP_ITEM *aStackupItem, int aRow)
creates a bitmap combobox to select a layer color
void addMaterialChooser(wxWindowID aId, const wxString *aMaterialName, BOARD_STACKUP_ROW_UI_ITEM &aUiRowItem)
add a control (a wxTextCtrl + a button) in m_fgGridSizer to select a material
@ ID_ITEM_THICKNESS
@ ID_ITEM_THICKNESS_LOCKED
@ ID_ITEM_MATERIAL
int GetColorUserDefinedListIdx(BOARD_STACKUP_ITEM_TYPE aType)
#define KEY_COPPER
#define KEY_CORE
KIGFX::COLOR4D GetDefaultUserColor(BOARD_STACKUP_ITEM_TYPE aType)
std::string Double2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 We want to avoid scientific ...

References _, addMaterialChooser(), addSpacer(), BS_ITEM_TYPE_DIELECTRIC, createColorBox(), Double2Str(), BOARD_STACKUP_ITEM::FormatDielectricLayerName(), BOARD_STACKUP_ITEM::GetBrdLayerId(), BOARD_STACKUP_ITEM::GetColor(), GetColorUserDefinedListIdx(), GetDefaultUserColor(), BOARD_STACKUP_ITEM::GetEpsilonR(), BOARD_STACKUP_ITEM::GetLayerName(), BOARD::GetLayerName(), BOARD_STACKUP_ITEM::GetLossTangent(), BOARD_STACKUP_ITEM::GetMaterial(), GetStandardColorCount(), GetStandardColorName(), BOARD_STACKUP_ITEM::GetSublayersCount(), BOARD_STACKUP_ITEM::GetThickness(), BOARD_STACKUP_ITEM::GetType(), BOARD_STACKUP_ITEM::GetTypeName(), BOARD_STACKUP_ITEM::HasEpsilonRValue(), BOARD_STACKUP_ITEM::HasLossTangentValue(), ID_ITEM_MATERIAL, ID_ITEM_THICKNESS, ID_ITEM_THICKNESS_LOCKED, BOARD_STACKUP_ITEM::IsColorEditable(), BOARD_STACKUP_ITEM::IsMaterialEditable(), BOARD_STACKUP_ITEM::IsThicknessEditable(), BOARD_STACKUP_ITEM::IsThicknessLocked(), KEY_COPPER, KEY_CORE, m_board, BOARD_STACKUP_ROW_UI_ITEM::m_ColorCtrl, m_controlItemsList, m_core_prepreg_choice, BOARD_STACKUP_ROW_UI_ITEM::m_EpsilonCtrl, PANEL_SETUP_BOARD_STACKUP_BASE::m_fgGridSizer, BOARD_STACKUP_ROW_UI_ITEM::m_Icon, BOARD_STACKUP_ROW_UI_ITEM::m_isEnabled, BOARD_STACKUP_ROW_UI_ITEM::m_LayerName, BOARD_STACKUP_ROW_UI_ITEM::m_LayerTypeCtrl, BOARD_STACKUP_ROW_UI_ITEM::m_LossTgCtrl, BOARD_STACKUP_ROW_UI_ITEM::m_MaterialCtrl, m_numericFieldsSize, m_numericTextCtrlSize, PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin, BOARD_STACKUP_ROW_UI_ITEM::m_ThicknessCtrl, BOARD_STACKUP_ROW_UI_ITEM::m_ThicknessLockCtrl, m_units, BOARD_STACKUP_ROW_UI_ITEM::m_UserColor, onThicknessChange(), BOARD_STACKUP_ITEM::SetLayerName(), and StringFromValue().

Referenced by buildLayerStackPanel().

◆ disconnectEvents()

void PANEL_SETUP_BOARD_STACKUP::disconnectEvents ( )
private

disconnect event handlers connected to wxControl items found in list m_controlItemsList

Definition at line 224 of file panel_board_stackup.cpp.

225{
226 // Disconnect Events connected to items in m_controlItemsList
227 for( wxControl* item: m_controlItemsList )
228 {
229 wxBitmapComboBox* cb = dynamic_cast<wxBitmapComboBox*>( item );
230
231 if( cb )
232 {
233 cb->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED,
234 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onColorSelected ),
235 nullptr, this );
236 }
237
238 wxButton* matButt = dynamic_cast<wxButton*>( item );
239
240 if( matButt )
241 {
242 matButt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED,
243 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onMaterialChange ),
244 nullptr, this );
245 }
246
247 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( item );
248
249 if( textCtrl )
250 {
251 textCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED,
252 wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onThicknessChange ),
253 nullptr, this );
254 }
255 }
256}

References m_controlItemsList, onColorSelected(), onMaterialChange(), and onThicknessChange().

Referenced by rebuildLayerStackPanel(), and ~PANEL_SETUP_BOARD_STACKUP().

◆ getColorIconItem()

wxColor PANEL_SETUP_BOARD_STACKUP::getColorIconItem ( int  aRow)
private
Returns
the color of the BOARD_STACKUP_ITEM at row aRow, to draw a bitmap color according to the selected color or the best default color (for dielectric or copper item)
Parameters
aRowis the row index to find the color.

Definition at line 1430 of file panel_board_stackup.cpp.

1431{
1432 BOARD_STACKUP_ITEM* st_item = dynamic_cast<BOARD_STACKUP_ITEM*>( GetStackupItem( aRow ) );
1433
1434 wxASSERT( st_item );
1435 wxColor color;
1436
1437 if( ! st_item )
1438 return color;
1439
1440 switch( st_item->GetType() )
1441 {
1442 case BS_ITEM_TYPE_COPPER: color = copperColor; break;
1444 case BS_ITEM_TYPE_SOLDERMASK: color = GetSelectedColor( aRow ); break;
1445 case BS_ITEM_TYPE_SILKSCREEN: color = GetSelectedColor( aRow ); break;
1447
1448 default:
1450 wxFAIL_MSG( wxT( "PANEL_SETUP_BOARD_STACKUP::getColorIconItem: unrecognized item type" ) );
1451 break;
1452 }
1453
1454 wxASSERT_MSG( color.IsOk(), wxT( "Invalid color in PCB stackup" ) );
1455
1456 return color;
1457}
int color
Definition: DXF_plotter.cpp:57
@ BS_ITEM_TYPE_UNDEFINED
Definition: board_stackup.h:42
@ BS_ITEM_TYPE_COPPER
Definition: board_stackup.h:43
@ BS_ITEM_TYPE_SOLDERPASTE
Definition: board_stackup.h:46
@ BS_ITEM_TYPE_SOLDERMASK
Definition: board_stackup.h:47
wxColor GetSelectedColor(int aRow) const
Return the color currently selected for the row aRow.
BOARD_STACKUP_ITEM * GetStackupItem(int aRow)
static wxColor pasteColor(200, 200, 200)
static wxColor copperColor(220, 180, 30)
static wxColor dielectricColor(75, 120, 75)

References BS_ITEM_TYPE_COPPER, BS_ITEM_TYPE_DIELECTRIC, BS_ITEM_TYPE_SILKSCREEN, BS_ITEM_TYPE_SOLDERMASK, BS_ITEM_TYPE_SOLDERPASTE, BS_ITEM_TYPE_UNDEFINED, color, copperColor(), dielectricColor(), GetSelectedColor(), GetStackupItem(), BOARD_STACKUP_ITEM::GetType(), and pasteColor().

Referenced by updateIconColor().

◆ GetCopperLayerCount()

int PANEL_SETUP_BOARD_STACKUP::GetCopperLayerCount ( ) const
Returns
the number of copper layers configured for the board stackup

Definition at line 459 of file panel_board_stackup.cpp.

460{
461 return ( m_choiceCopperLayers->GetSelection() + 1 ) * 2;
462}

References PANEL_SETUP_BOARD_STACKUP_BASE::m_choiceCopperLayers.

Referenced by DIALOG_BOARD_SETUP::OnPageChanged(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), and updateCopperLayerCount().

◆ GetSelectedColor()

wxColor PANEL_SETUP_BOARD_STACKUP::GetSelectedColor ( int  aRow) const

Return the color currently selected for the row aRow.

Definition at line 415 of file panel_board_stackup.cpp.

416{
418 const BOARD_STACKUP_ITEM* item = row.m_Item;
419 const wxBitmapComboBox* choice = dynamic_cast<wxBitmapComboBox*>( row.m_ColorCtrl );
420 wxASSERT( choice );
421
422 int idx = choice ? choice->GetSelection() : 0;
423
424 if( IsCustomColorIdx( item->GetType(), idx ) )
425 return m_rowUiItemsList[aRow].m_UserColor.ToColour();
426 else
427 return GetStandardColor( item->GetType(), idx ).ToColour();
428}
BOARD_STACKUP_ITEM * m_Item

References GetStandardColor(), BOARD_STACKUP_ITEM::GetType(), IsCustomColorIdx(), BOARD_STACKUP_ROW_UI_ITEM::m_ColorCtrl, BOARD_STACKUP_ROW_UI_ITEM::m_Item, and m_rowUiItemsList.

Referenced by getColorIconItem().

◆ GetStackup()

BOARD_STACKUP & PANEL_SETUP_BOARD_STACKUP::GetStackup ( )
inline

Definition at line 115 of file panel_board_stackup.h.

115{ return m_stackup; }

References m_stackup.

◆ GetStackupItem()

BOARD_STACKUP_ITEM * PANEL_SETUP_BOARD_STACKUP::GetStackupItem ( int  aRow)
Returns
the BOARD_STACKUP_ITEM managed by the row aRow

Definition at line 1418 of file panel_board_stackup.cpp.

1419{
1420 return m_rowUiItemsList[aRow].m_Item;
1421}

References m_rowUiItemsList.

Referenced by getColorIconItem(), and onThicknessChange().

◆ GetSublayerId()

int PANEL_SETUP_BOARD_STACKUP::GetSublayerId ( int  aRow)
Returns
the BOARD_STACKUP_ITEM sublayermanaged by the row aRow

Definition at line 1424 of file panel_board_stackup.cpp.

1425{
1426 return m_rowUiItemsList[aRow].m_SubItem;
1427}

References m_rowUiItemsList.

Referenced by onThicknessChange().

◆ ImportSettingsFrom()

void PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom ( BOARD aBoard)

Definition at line 1200 of file panel_board_stackup.cpp.

1201{
1202 BOARD* savedBrd = m_board;
1203 BOARD_DESIGN_SETTINGS* savedSettings = m_brdSettings;
1204 m_brdSettings = &aBoard->GetDesignSettings();
1205
1207 synchronizeWithBoard( true );
1208
1211
1212 m_brdSettings = savedSettings;
1213 m_board = savedBrd;
1214}
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:240
void rebuildLayerStackPanel()
Populate m_fgGridSizer with items to handle stackup parameters If previous items are in list,...

References computeBoardThickness(), BOARD::GetDesignSettings(), PANEL_SETUP_LAYERS::GetUILayerMask(), m_board, m_brdSettings, m_enabledLayers, m_panelLayers, rebuildLayerStackPanel(), BOARD_STACKUP::StackupAllowedBrdLayers(), and synchronizeWithBoard().

Referenced by DIALOG_BOARD_SETUP::OnAuxiliaryAction().

◆ onAddDielectricLayer()

void PANEL_SETUP_BOARD_STACKUP::onAddDielectricLayer ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 259 of file panel_board_stackup.cpp.

260{
261 wxArrayString headers;
262 headers.Add( _( "Layers" ) );
263
264 // Build Dielectric layers list:
265 std::vector<wxArrayString> d_list;
266 std::vector<int> rows; // indexes of row values for each selectable item
267 int row = -1;
268
270 {
271 row++;
272
273 if( !item.m_isEnabled )
274 continue;
275
276 BOARD_STACKUP_ITEM* brd_stackup_item = item.m_Item;
277
278 if( brd_stackup_item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
279 {
280 wxArrayString d_item;
281
282 if( brd_stackup_item->GetSublayersCount() > 1 )
283 {
284 d_item.Add( wxString::Format( _( "Layer '%s' (sublayer %d/%d)" ),
285 brd_stackup_item->FormatDielectricLayerName(),
286 item.m_SubItem+1,
287 brd_stackup_item->GetSublayersCount() ) );
288 }
289 else
290 {
291 d_item.Add( brd_stackup_item->FormatDielectricLayerName() );
292 }
293
294 d_list.emplace_back( d_item );
295 rows.push_back( row );
296 }
297 }
298
299 EDA_LIST_DIALOG dlg( m_parentDialog, _( "Add Dielectric Layer" ), headers, d_list );
300 dlg.SetListLabel( _( "Select layer to add:" ) );
301 dlg.HideFilter();
302
303 if( dlg.ShowModal() == wxID_OK && dlg.GetSelection() >= 0 )
304 {
305 row = rows[ dlg.GetSelection() ];
306
307 BOARD_STACKUP_ITEM* brd_stackup_item = m_rowUiItemsList[row].m_Item;
308 int new_sublayer = m_rowUiItemsList[row].m_SubItem;
309
310 // Insert a new item after the selected item
311 brd_stackup_item->AddDielectricPrms( new_sublayer+1 );
312
315 }
316}
void AddDielectricPrms(int aDielectricPrmsIdx)
Add (insert) a DIELECTRIC_PRMS item to m_DielectricPrmsList all values are set to default.
A dialog which shows:
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References _, BOARD_STACKUP_ITEM::AddDielectricPrms(), BS_ITEM_TYPE_DIELECTRIC, computeBoardThickness(), Format(), BOARD_STACKUP_ITEM::FormatDielectricLayerName(), EDA_LIST_DIALOG::GetSelection(), BOARD_STACKUP_ITEM::GetSublayersCount(), BOARD_STACKUP_ITEM::GetType(), EDA_LIST_DIALOG::HideFilter(), m_parentDialog, m_rowUiItemsList, rebuildLayerStackPanel(), and EDA_LIST_DIALOG::SetListLabel().

◆ onAdjustDielectricThickness()

void PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 141 of file panel_board_stackup.cpp.

142{
143 // The list of items that can be modified:
144 std::vector< BOARD_STACKUP_ROW_UI_ITEM* > items_candidate;
145
146 // Some dielectric layers can have a locked thickness, so calculate the min
147 // acceptable thickness
148 int min_thickness = 0;
149
151 {
152 BOARD_STACKUP_ITEM* item = ui_item.m_Item;
153
154 if( !item->IsThicknessEditable() || !ui_item.m_isEnabled )
155 continue;
156
157 // We are looking for locked thickness items only:
158 wxCheckBox* cb_box = dynamic_cast<wxCheckBox*> ( ui_item.m_ThicknessLockCtrl );
159
160 if( cb_box && !cb_box->GetValue() )
161 {
162 items_candidate.push_back( &ui_item );
163 continue;
164 }
165
166 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_ThicknessCtrl );
167 wxString txt = textCtrl->GetValue();
168
169 int item_thickness = ValueFromString( m_frame->GetUserUnits(), txt );
170 min_thickness += item_thickness;
171 }
172
173 wxString title;
174
175 if( min_thickness == 0 )
176 {
177 title.Printf( _( "Enter board thickness in %s:" ),
178 GetAbbreviatedUnitsLabel( m_frame->GetUserUnits() ).Trim( false ) );
179 }
180 else
181 {
182 title.Printf( _( "Enter expected board thickness (min value %s):" ),
183 StringFromValue( m_frame->GetUserUnits(), min_thickness, true ) );
184 }
185
186 wxTextEntryDialog dlg( this, title, _( "Adjust Unlocked Dielectric Layers" ) );
187
188 if( dlg.ShowModal() != wxID_OK )
189 return;
190
191 wxString result = dlg.GetValue();
192
193 int iu_thickness = ValueFromString( m_frame->GetUserUnits(), result );
194
195 if( iu_thickness <= min_thickness )
196 {
197 wxMessageBox( wxString::Format( _("Value too small (min value %s)." ),
198 StringFromValue( m_frame->GetUserUnits(), min_thickness, true ) ) );
199 return;
200 }
201
202 // Now adjust not locked dielectric thickness layers:
203
204 if( items_candidate.size() )
205 {
206 int thickness_layer = ( iu_thickness - min_thickness ) / items_candidate.size();
207 wxString txt = StringFromValue( m_frame->GetUserUnits(), thickness_layer, true );
208
209 for( BOARD_STACKUP_ROW_UI_ITEM* ui_item : items_candidate )
210 {
211 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item->m_ThicknessCtrl );
212 textCtrl->ChangeValue( txt );
213 }
214 }
215 else
216 {
217 wxMessageBox( _( "All dielectric thickness layers are locked" ) );
218 }
219
221}
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnits, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:391

References _, computeBoardThickness(), Format(), GetAbbreviatedUnitsLabel(), EDA_BASE_FRAME::GetUserUnits(), BOARD_STACKUP_ITEM::IsThicknessEditable(), m_frame, m_rowUiItemsList, StringFromValue(), and ValueFromString().

◆ onColorSelected()

void PANEL_SETUP_BOARD_STACKUP::onColorSelected ( wxCommandEvent &  event)
private

Definition at line 1239 of file panel_board_stackup.cpp.

1240{
1241 int idx = event.GetSelection();
1242 int item_id = event.GetId();
1243 int row = item_id - ID_ITEM_COLOR;
1244 BOARD_STACKUP_ITEM* item = m_rowUiItemsList[row].m_Item;
1245
1246 if( idx == GetStandardColorCount( item->GetType()) - 1 ) // Set user color is the last option in list
1247 {
1248 DIALOG_COLOR_PICKER dlg( this, m_rowUiItemsList[row].m_UserColor, true, nullptr,
1249 GetDefaultUserColor( m_rowUiItemsList[row].m_Item->GetType() ) );
1250
1251#ifdef __WXGTK__
1252 // Give a time-slice to close the menu before opening the dialog.
1253 // (Only matters on some versions of GTK.)
1254 wxSafeYield();
1255#endif
1256
1257 if( dlg.ShowModal() == wxID_OK )
1258 {
1259 wxBitmapComboBox* combo = static_cast<wxBitmapComboBox*>( FindWindowById( item_id ) );
1260 COLOR4D color = dlg.GetColor();
1261
1262 m_rowUiItemsList[row].m_UserColor = color;
1263
1264 combo->SetString( idx, color.ToHexString() );
1265
1266 wxBitmap layerbmp( m_colorSwatchesSize.x, m_colorSwatchesSize.y );
1267 LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D( 0, 0, 0, 0 ), color );
1268 combo->SetItemBitmap( combo->GetCount() - 1, layerbmp );
1269
1270 combo->SetSelection( idx );
1271 }
1272 }
1273
1274 updateIconColor( row );
1275}

References color, LAYER_SELECTOR::DrawColorSwatch(), DIALOG_COLOR_PICKER::GetColor(), GetDefaultUserColor(), GetStandardColorCount(), BOARD_STACKUP_ITEM::GetType(), ID_ITEM_COLOR, m_colorSwatchesSize, m_rowUiItemsList, and updateIconColor().

Referenced by createColorBox(), and disconnectEvents().

◆ onCopperLayersSelCount()

void PANEL_SETUP_BOARD_STACKUP::onCopperLayersSelCount ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 132 of file panel_board_stackup.cpp.

133{
137 Layout();
138}
void updateCopperLayerCount()
Updates the enabled copper layers when the dropdown is changed.
void showOnlyActiveLayers()
Show or do not show items in m_fgGridSizer according to the stackup of the current board.

References computeBoardThickness(), showOnlyActiveLayers(), and updateCopperLayerCount().

◆ onExportToClipboard()

void PANEL_SETUP_BOARD_STACKUP::onExportToClipboard ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 394 of file panel_board_stackup.cpp.

395{
397 return;
398
399 // Build a ASCII representation of stackup and copy it in the clipboard
400 wxString report = BuildStackupReport( m_stackup, m_units );
401
402 wxLogNull doNotLog; // disable logging of failed clipboard actions
403
404 if( wxTheClipboard->Open() )
405 {
406 // This data objects are held by the clipboard,
407 // so do not delete them in the app.
408 wxTheClipboard->SetData( new wxTextDataObject( report ) );
409 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
410 wxTheClipboard->Close();
411 }
412}
wxString BuildStackupReport(BOARD_STACKUP &aStackup, EDA_UNITS aUnits)
bool transferDataFromUIToStackup()
Transfer current UI settings to m_stackup but not to the board.

References BuildStackupReport(), m_stackup, m_units, and transferDataFromUIToStackup().

◆ OnLayersOptionsChanged()

void PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged ( LSET  aNewLayerSet)

Must be called if the copper layers count has changed or solder mask, solder paste or silkscreen layers are enabled or disabled Rebuild the Layer Stack Panel if the new layer set differs from the current layet set.

Definition at line 1217 of file panel_board_stackup.cpp.

1218{
1219 // First, verify the list of layers currently in stackup:
1220 // if it does not mach the list of layers set in PANEL_SETUP_LAYERS
1221 // rebuild the panel
1222
1223 // the current enabled layers in PANEL_SETUP_LAYERS
1224 // Note: the number of layer can change, but not the layers properties
1226
1227 if( m_enabledLayers != layersList )
1228 {
1229 m_enabledLayers = layersList;
1230
1231 synchronizeWithBoard( false );
1232
1233 Layout();
1234 Refresh();
1235 }
1236}
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:529
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...

References PANEL_SETUP_LAYERS::GetUILayerMask(), m_enabledLayers, m_panelLayers, Refresh(), BOARD_STACKUP::StackupAllowedBrdLayers(), and synchronizeWithBoard().

Referenced by DIALOG_BOARD_SETUP::OnPageChanged().

◆ onMaterialChange()

void PANEL_SETUP_BOARD_STACKUP::onMaterialChange ( wxCommandEvent &  event)
private

Definition at line 1278 of file panel_board_stackup.cpp.

1279{
1280 // Ensure m_materialList contains all materials already in use in stackup list
1281 // and add it is missing
1283 return;
1284
1285 for( BOARD_STACKUP_ITEM* item : m_stackup.GetList() )
1286 {
1287 DIELECTRIC_SUBSTRATE_LIST* mat_list = nullptr;
1288
1289 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
1290 mat_list = &m_delectricMatList;
1291 else if( item->GetType() == BS_ITEM_TYPE_SOLDERMASK )
1292 mat_list = &m_solderMaskMatList;
1293 else if( item->GetType() == BS_ITEM_TYPE_SILKSCREEN )
1294 mat_list = &m_silkscreenMatList;
1295
1296 else
1297 continue;
1298
1299 for( int ii = 0; ii < item->GetSublayersCount(); ii++ )
1300 {
1301 int idx = mat_list->FindSubstrate( item->GetMaterial( ii ),
1302 item->GetEpsilonR( ii ),
1303 item->GetLossTangent( ii ) );
1304
1305 if( idx < 0 && !item->GetMaterial().IsEmpty() )
1306 {
1307 // This material is not in list: add it
1308 DIELECTRIC_SUBSTRATE new_mat;
1309 new_mat.m_Name = item->GetMaterial( ii );
1310 new_mat.m_EpsilonR = item->GetEpsilonR( ii );
1311 new_mat.m_LossTangent = item->GetLossTangent( ii );
1312 mat_list->AppendSubstrate( new_mat );
1313 }
1314 }
1315 }
1316
1317 int row = event.GetId() - ID_ITEM_MATERIAL;
1318 BOARD_STACKUP_ITEM* item = m_rowUiItemsList[row].m_Item;
1319 int sub_item = m_rowUiItemsList[row].m_SubItem;
1320 DIELECTRIC_SUBSTRATE_LIST* item_mat_list = nullptr;
1321
1322 switch( item->GetType() )
1323 {
1324 case BS_ITEM_TYPE_DIELECTRIC: item_mat_list = &m_delectricMatList; break;
1325 case BS_ITEM_TYPE_SOLDERMASK: item_mat_list = &m_solderMaskMatList; break;
1326 case BS_ITEM_TYPE_SILKSCREEN: item_mat_list = &m_silkscreenMatList; break;
1327 default: item_mat_list = nullptr; break;
1328 }
1329
1330 wxCHECK( item_mat_list, /* void */ );
1331
1332 DIALOG_DIELECTRIC_MATERIAL dlg( this, *item_mat_list );
1333
1334 if( dlg.ShowModal() != wxID_OK )
1335 return;
1336
1337 DIELECTRIC_SUBSTRATE substrate = dlg.GetSelectedSubstrate();
1338
1339 if( substrate.m_Name.IsEmpty() ) // No substrate specified
1340 return;
1341
1342 // Update Name, Epsilon R and Loss tg
1343 item->SetMaterial( substrate.m_Name, sub_item );
1344 item->SetEpsilonR( substrate.m_EpsilonR, sub_item );
1345 item->SetLossTangent( substrate.m_LossTangent, sub_item );
1346
1347 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_MaterialCtrl );
1348 textCtrl->ChangeValue( item->GetMaterial( sub_item ) );
1349
1350 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC
1351 && !item->GetColor().StartsWith( "#" ) /* User defined color */ )
1352 {
1353 if( substrate.m_Name.IsSameAs( "PTFE" )
1354 || substrate.m_Name.IsSameAs( "Teflon" ) )
1355 {
1356 item->SetColor( "PTFE natural" );
1357 }
1358 else if( substrate.m_Name.IsSameAs( "Polyimide" )
1359 || substrate.m_Name.IsSameAs( "Kapton" ) )
1360 {
1361 item->SetColor( "Polyimide" );
1362 }
1363 else if( substrate.m_Name.IsSameAs( "Al" ) )
1364 {
1365 item->SetColor( "Aluminum" );
1366 }
1367 else
1368 {
1369 item->SetColor( "FR4 natural" );
1370 }
1371 }
1372
1373 wxBitmapComboBox* picker = static_cast<wxBitmapComboBox*>( m_rowUiItemsList[row].m_ColorCtrl );
1374
1375 for( int ii = 0; ii < GetStandardColorCount( item->GetType()); ii++ )
1376 {
1377 if( GetStandardColorName( item->GetType(), ii ) == item->GetColor() )
1378 {
1379 picker->SetSelection( ii );
1380 break;
1381 }
1382 }
1383
1384 // some layers have a material choice but not EpsilonR ctrl
1385 if( item->HasEpsilonRValue() )
1386 {
1387 textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_EpsilonCtrl );
1388
1389 if( textCtrl )
1390 textCtrl->ChangeValue( item->FormatEpsilonR( sub_item ) );
1391 }
1392
1393 // some layers have a material choice but not loss tg ctrl
1394 if( item->HasLossTangentValue() )
1395 {
1396 textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_LossTgCtrl );
1397
1398 if( textCtrl )
1399 textCtrl->ChangeValue( item->FormatLossTangent( sub_item ) );
1400 }
1401}
void SetMaterial(const wxString &aName, int aDielectricSubLayer=0)
void SetLossTangent(double aTg, int aDielectricSubLayer=0)
wxString FormatEpsilonR(int aDielectricSubLayer=0) const
void SetEpsilonR(double aEpsilon, int aDielectricSubLayer=0)
void SetColor(const wxString &aColorName)
wxString FormatLossTangent(int aDielectricSubLayer=0) const
a Dialog to select/change/add a dielectric material from a material list
int AppendSubstrate(DIELECTRIC_SUBSTRATE &aItem)
Append a item in list similar to aItem.
int FindSubstrate(DIELECTRIC_SUBSTRATE *aItem)
Find a item in list similar to aItem.

References DIELECTRIC_SUBSTRATE_LIST::AppendSubstrate(), BS_ITEM_TYPE_DIELECTRIC, BS_ITEM_TYPE_SILKSCREEN, BS_ITEM_TYPE_SOLDERMASK, DIELECTRIC_SUBSTRATE_LIST::FindSubstrate(), BOARD_STACKUP_ITEM::FormatEpsilonR(), BOARD_STACKUP_ITEM::FormatLossTangent(), BOARD_STACKUP_ITEM::GetColor(), BOARD_STACKUP::GetList(), BOARD_STACKUP_ITEM::GetMaterial(), DIALOG_DIELECTRIC_MATERIAL::GetSelectedSubstrate(), GetStandardColorCount(), GetStandardColorName(), BOARD_STACKUP_ITEM::GetType(), BOARD_STACKUP_ITEM::HasEpsilonRValue(), BOARD_STACKUP_ITEM::HasLossTangentValue(), ID_ITEM_MATERIAL, m_delectricMatList, DIELECTRIC_SUBSTRATE::m_EpsilonR, DIELECTRIC_SUBSTRATE::m_LossTangent, DIELECTRIC_SUBSTRATE::m_Name, m_rowUiItemsList, m_silkscreenMatList, m_solderMaskMatList, m_stackup, BOARD_STACKUP_ITEM::SetColor(), BOARD_STACKUP_ITEM::SetEpsilonR(), BOARD_STACKUP_ITEM::SetLossTangent(), BOARD_STACKUP_ITEM::SetMaterial(), and transferDataFromUIToStackup().

Referenced by addMaterialChooser(), and disconnectEvents().

◆ onRemoveDielectricLayer()

void PANEL_SETUP_BOARD_STACKUP::onRemoveDielectricLayer ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 319 of file panel_board_stackup.cpp.

320{
321 wxArrayString headers;
322 headers.Add( _( "Layers" ) );
323
324 // Build deletable Dielectric layers list.
325 // A layer can be deleted if there are 2 (or more) dielectric sub-layers
326 // between 2 copper layers
327 std::vector<wxArrayString> d_list;
328 std::vector<int> rows; // indexes of row values for each selectable item
329 int row = 0; // row index in m_rowUiItemsList of items in choice list
330
331 // Build the list of dielectric layers:
332 for( BOARD_STACKUP_ITEM* item : m_stackup.GetList() )
333 {
334 if( !item->IsEnabled() || item->GetType() != BS_ITEM_TYPE_DIELECTRIC ||
335 item->GetSublayersCount() <= 1 )
336 {
337 row++;
338 continue;
339 }
340
341 for( int ii = 0; ii < item->GetSublayersCount(); ii++ )
342 {
343 wxArrayString d_item;
344
345 d_item.Add( wxString::Format( _( "Layer '%s' sublayer %d/%d" ),
346 item->FormatDielectricLayerName(),
347 ii+1,
348 item->GetSublayersCount() ) );
349
350 d_list.emplace_back( d_item );
351 rows.push_back( row++ );
352 }
353 }
354
355 EDA_LIST_DIALOG dlg( m_parentDialog, _( "Remove Dielectric Layer" ), headers, d_list );
356 dlg.SetListLabel( _( "Select layer to remove:" ) );
357 dlg.HideFilter();
358
359 if( dlg.ShowModal() == wxID_OK && dlg.GetSelection() >= 0 )
360 {
361 row = rows[ dlg.GetSelection() ];
362 BOARD_STACKUP_ITEM* brd_stackup_item = m_rowUiItemsList[ row ].m_Item;
363 int sublayer = m_rowUiItemsList[ row ].m_SubItem;
364
365 // Remove the selected sub item for the selected dielectric layer
366 brd_stackup_item->RemoveDielectricPrms( sublayer );
367
370 }
371}
void RemoveDielectricPrms(int aDielectricPrmsIdx)
Remove a DIELECTRIC_PRMS item from m_DielectricPrmsList.

References _, BS_ITEM_TYPE_DIELECTRIC, computeBoardThickness(), Format(), BOARD_STACKUP::GetList(), EDA_LIST_DIALOG::GetSelection(), EDA_LIST_DIALOG::HideFilter(), m_parentDialog, m_rowUiItemsList, m_stackup, rebuildLayerStackPanel(), BOARD_STACKUP_ITEM::RemoveDielectricPrms(), and EDA_LIST_DIALOG::SetListLabel().

◆ onRemoveDielUI()

void PANEL_SETUP_BOARD_STACKUP::onRemoveDielUI ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_BOARD_STACKUP_BASE.

Definition at line 374 of file panel_board_stackup.cpp.

375{
376 // The m_buttonRemoveDielectricLayer wxButton is enabled only if a dielectric
377 // layer can be removed, i.e. if dielectric layers have sublayers
378 for( BOARD_STACKUP_ITEM* item : m_stackup.GetList() )
379 {
380 if( !item->IsEnabled() || item->GetType() != BS_ITEM_TYPE_DIELECTRIC )
381 continue;
382
383 if( item->GetSublayersCount() > 1 )
384 {
385 event.Enable( true );
386 return;
387 }
388 }
389
390 event.Enable( false );
391}

References BS_ITEM_TYPE_DIELECTRIC, BOARD_STACKUP::GetList(), and m_stackup.

◆ onThicknessChange()

void PANEL_SETUP_BOARD_STACKUP::onThicknessChange ( wxCommandEvent &  event)
private

Definition at line 1404 of file panel_board_stackup.cpp.

1405{
1406 int row = event.GetId() - ID_ITEM_THICKNESS;
1407 wxString value = event.GetString();
1408
1409 BOARD_STACKUP_ITEM* item = GetStackupItem( row );
1410 int idx = GetSublayerId( row );
1411
1412 item->SetThickness( ValueFromString( m_frame->GetUserUnits(), value ), idx );
1413
1415}
void SetThickness(int aThickness, int aDielectricSubLayer=0)

References computeBoardThickness(), GetStackupItem(), GetSublayerId(), EDA_BASE_FRAME::GetUserUnits(), ID_ITEM_THICKNESS, m_frame, BOARD_STACKUP_ITEM::SetThickness(), and ValueFromString().

Referenced by createRowData(), and disconnectEvents().

◆ rebuildLayerStackPanel()

void PANEL_SETUP_BOARD_STACKUP::rebuildLayerStackPanel ( )
private

Populate m_fgGridSizer with items to handle stackup parameters If previous items are in list, remove old items New prms are added must be called after adding or deleting a dielectric parameter set.

Definition at line 865 of file panel_board_stackup.cpp.

866{
867 wxWindowUpdateLocker locker( m_scGridWin );
868 m_scGridWin->Hide();
869
870 // Rebuild the stackup for the dialog, after dielectric parameters list is modified
871 // (added/removed):
872
873 // First, delete all ui objects, because wxID values will be no longer valid for many widgets
875 m_controlItemsList.clear();
876
877 // Delete widgets (handled by the wxPanel parent)
879 {
880 // This remove and delete the current ui_item.m_MaterialCtrl sizer
881 ui_item.m_MaterialCtrl->SetSizer( nullptr );
882
883 // Delete other widgets
884 delete ui_item.m_Icon; // Color icon in first column (column 1)
885 delete ui_item.m_LayerName; // string shown in column 2
886 delete ui_item.m_LayerTypeCtrl; // control shown in column 3
887 delete ui_item.m_MaterialCtrl; // control shown in column 4, with m_MaterialButt
888 delete ui_item.m_MaterialButt; // control shown in column 4, with m_MaterialCtrl
889 delete ui_item.m_ThicknessCtrl; // control shown in column 5
890 delete ui_item.m_ThicknessLockCtrl;// control shown in column 6
891 delete ui_item.m_ColorCtrl; // control shown in column 7
892 delete ui_item.m_EpsilonCtrl; // control shown in column 8
893 delete ui_item.m_LossTgCtrl; // control shown in column 9
894 }
895
896 m_rowUiItemsList.clear();
897
898 // In order to recreate a clean grid layer list, we have to delete and
899 // recreate the sizer m_fgGridSizer (just deleting items in this size is not enough)
900 // therefore we also have to add the "old" title items to the newly recreated m_fgGridSizer:
901 m_scGridWin->SetSizer( nullptr ); // This remove and delete the current m_fgGridSizer
902
903 m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 2 );
904 m_fgGridSizer->SetFlexibleDirection( wxHORIZONTAL );
905 m_fgGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
906 m_fgGridSizer->SetHGap( 6 );
907 m_scGridWin->SetSizer( m_fgGridSizer );
908
909 // Re-add "old" title items:
910 const int sizer_flags = wxALIGN_CENTER_VERTICAL | wxALL | wxALIGN_CENTER_HORIZONTAL;
911 m_fgGridSizer->Add( m_staticTextLayer, 0, sizer_flags, 2 );
912 m_fgGridSizer->Add( m_staticTextType, 0, sizer_flags, 2 );
913 m_fgGridSizer->Add( m_staticTextLayerId, 0, sizer_flags, 5 );
914 m_fgGridSizer->Add( m_staticTextMaterial, 0, sizer_flags, 2 );
915 m_fgGridSizer->Add( m_staticTextThickness, 0, sizer_flags, 2 );
916 m_fgGridSizer->Add( m_bitmapLockThickness, 0, sizer_flags, 1 );
917 m_fgGridSizer->Add( m_staticTextColor, 0, sizer_flags, 2 );
918 m_fgGridSizer->Add( m_staticTextEpsilonR, 0, sizer_flags, 2 );
919 m_fgGridSizer->Add( m_staticTextLossTg, 0, sizer_flags, 2 );
920
921
922 // Now, rebuild the widget list from the new m_stackup items:
923 buildLayerStackPanel( false );
924
925 // Now enable/disable stackup items, according to the m_enabledLayers config
927
928 m_scGridWin->Layout();
929 m_scGridWin->Show();
930}

References buildLayerStackPanel(), disconnectEvents(), PANEL_SETUP_BOARD_STACKUP_BASE::m_bitmapLockThickness, m_controlItemsList, PANEL_SETUP_BOARD_STACKUP_BASE::m_fgGridSizer, m_rowUiItemsList, PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextColor, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextEpsilonR, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLayer, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLayerId, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLossTg, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextMaterial, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextThickness, PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextType, and showOnlyActiveLayers().

Referenced by ImportSettingsFrom(), onAddDielectricLayer(), and onRemoveDielectricLayer().

◆ showOnlyActiveLayers()

void PANEL_SETUP_BOARD_STACKUP::showOnlyActiveLayers ( )
private

Show or do not show items in m_fgGridSizer according to the stackup of the current board.

The panel stackup stores all possible layers (because the number of layers is set from an other panel), but only some of them must be actually shown on screen

Definition at line 600 of file panel_board_stackup.cpp.

601{
602
603 // Now enable/disable stackup items, according to the m_enabledLayers config
604 // Calculate copper layer count from m_enabledLayers, and *do not use* brd_stackup
605 // for that, because it is not necessary up to date
606 // (for instance after modifying the layer count from the panel layers in dialog)
608 int copperLayersCount = copperMask.count();
609
611 {
612 bool show_item;
613 BOARD_STACKUP_ITEM* item = ui_row_item.m_Item;
614
615 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
616 // the m_DielectricLayerId is not a copper layer id, it is a dielectric idx from 1
617 show_item = item->GetDielectricLayerId() < copperLayersCount;
618 else
619 show_item = m_enabledLayers[item->GetBrdLayerId()];
620
621 item->SetEnabled( show_item );
622
623 ui_row_item.m_isEnabled = show_item;
624
625 // Show or not items of this row:
626 ui_row_item.m_Icon->Show( show_item );
627 ui_row_item.m_LayerName->Show( show_item );
628 ui_row_item.m_LayerTypeCtrl->Show( show_item );
629 ui_row_item.m_MaterialCtrl->Show( show_item );
630
631 if( ui_row_item.m_MaterialButt )
632 ui_row_item.m_MaterialButt->Show( show_item );
633
634 ui_row_item.m_ThicknessCtrl->Show( show_item );
635 ui_row_item.m_ThicknessLockCtrl->Show( show_item );
636 ui_row_item.m_ColorCtrl->Show( show_item );
637 ui_row_item.m_EpsilonCtrl->Show( show_item );
638 ui_row_item.m_LossTgCtrl->Show( show_item );
639 }
640}
void SetEnabled(bool aEnable)
int GetDielectricLayerId() const
static LSET ExternalCuMask()
Return a mask holding the Front and Bottom layers.
Definition: lset.cpp:801
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:733

References BS_ITEM_TYPE_DIELECTRIC, LSET::ExternalCuMask(), BOARD_STACKUP_ITEM::GetBrdLayerId(), BOARD_STACKUP_ITEM::GetDielectricLayerId(), BOARD_STACKUP_ITEM::GetType(), LSET::InternalCuMask(), m_enabledLayers, m_rowUiItemsList, and BOARD_STACKUP_ITEM::SetEnabled().

Referenced by onCopperLayersSelCount(), rebuildLayerStackPanel(), and synchronizeWithBoard().

◆ synchronizeWithBoard()

void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard ( bool  aFullSync)
private

Synchronize the full stackup shown in m_fgGridSizer according to the stackup of the current board and optionally update the stackup params (thickness, color ... )

Parameters
aFullSync= true to update stackup params, false to only update the list of shown items

Definition at line 479 of file panel_board_stackup.cpp.

480{
481 const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
482
483 if( aFullSync )
484 {
485 m_choiceCopperLayers->SetSelection( ( m_board->GetCopperLayerCount() / 2 ) - 1 );
486 m_impedanceControlled->SetValue( brd_stackup.m_HasDielectricConstrains );
487 }
488
489 for( BOARD_STACKUP_ROW_UI_ITEM& ui_row_item : m_rowUiItemsList )
490 {
491 BOARD_STACKUP_ITEM* item = ui_row_item.m_Item;
492 int sub_item = ui_row_item.m_SubItem;
493
494 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
495 {
496 wxChoice* choice = dynamic_cast<wxChoice*>( ui_row_item.m_LayerTypeCtrl );
497
498 if( choice )
499 choice->SetSelection( item->GetTypeName() == KEY_CORE ? 0 : 1 );
500 }
501
502 if( item->IsMaterialEditable() )
503 {
504 wxTextCtrl* matName = dynamic_cast<wxTextCtrl*>( ui_row_item.m_MaterialCtrl );
505
506 if( matName )
507 {
508 if( IsPrmSpecified( item->GetMaterial( sub_item ) ) )
509 matName->ChangeValue( item->GetMaterial( sub_item ) );
510 else
511 matName->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
512 }
513 }
514
515 if( item->IsThicknessEditable() )
516 {
517 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_ThicknessCtrl );
518
519 if( textCtrl )
520 textCtrl->ChangeValue( StringFromValue( m_units,
521 item->GetThickness( sub_item ), true ) );
522
523 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
524 {
525 wxCheckBox* cb_box = dynamic_cast<wxCheckBox*> ( ui_row_item.m_ThicknessLockCtrl );
526
527 if( cb_box )
528 cb_box->SetValue( item->IsThicknessLocked( sub_item ) );
529 }
530 }
531
532 if( item->IsColorEditable() )
533 {
534 auto bm_combo = dynamic_cast<wxBitmapComboBox*>( ui_row_item.m_ColorCtrl );
535 int selected = 0; // The "not specified" item
536
537 if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color
538 {
539 COLOR4D custom_color( item->GetColor() );
540
541 ui_row_item.m_UserColor = custom_color;
542
543 selected = GetColorUserDefinedListIdx( item->GetType() );
544
545 if( bm_combo ) // Update user color shown in the wxBitmapComboBox
546 {
547 bm_combo->SetString( selected, item->GetColor() );
548 wxBitmap layerbmp( m_colorSwatchesSize.x, m_colorSwatchesSize.y );
549 LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D(), custom_color );
550 bm_combo->SetItemBitmap( selected, layerbmp );
551 }
552 }
553 else
554 {
555 if( bm_combo )
556 {
557 // Note: don't use bm_combo->FindString() because the combo strings are
558 // translated.
559 for( int ii = 0; ii < GetStandardColorCount( item->GetType()); ii++ )
560 {
561 if( GetStandardColorName( item->GetType(), ii ) == item->GetColor() )
562 {
563 selected = ii;
564 break;
565 }
566 }
567 }
568 }
569
570 if( bm_combo )
571 bm_combo->SetSelection( selected );
572 }
573
574 if( item->HasEpsilonRValue() )
575 {
576 wxString txt = Double2Str( item->GetEpsilonR( sub_item ) );
577 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_EpsilonCtrl );
578
579 if( textCtrl )
580 textCtrl->ChangeValue( txt );
581 }
582
583 if( item->HasLossTangentValue() )
584 {
585 wxString txt = Double2Str( item->GetLossTangent( sub_item ) );
586 wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_LossTgCtrl );
587
588 if( textCtrl )
589 textCtrl->ChangeValue( txt );
590 }
591 }
592
593 // Now enable/disable stackup items, according to the m_enabledLayers config
595
597}
bool m_HasDielectricConstrains
True if some layers have impedance controlled tracks or have specific constrains for micro-wave appli...
int GetCopperLayerCount() const
Definition: board.cpp:486

References BS_ITEM_TYPE_DIELECTRIC, Double2Str(), LAYER_SELECTOR::DrawColorSwatch(), BOARD_STACKUP_ITEM::GetColor(), GetColorUserDefinedListIdx(), BOARD::GetCopperLayerCount(), BOARD_STACKUP_ITEM::GetEpsilonR(), BOARD_STACKUP_ITEM::GetLossTangent(), BOARD_STACKUP_ITEM::GetMaterial(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), GetStandardColorCount(), GetStandardColorName(), BOARD_STACKUP_ITEM::GetThickness(), BOARD_STACKUP_ITEM::GetType(), BOARD_STACKUP_ITEM::GetTypeName(), BOARD_STACKUP_ITEM::HasEpsilonRValue(), BOARD_STACKUP_ITEM::HasLossTangentValue(), BOARD_STACKUP_ITEM::IsColorEditable(), BOARD_STACKUP_ITEM::IsMaterialEditable(), IsPrmSpecified(), BOARD_STACKUP_ITEM::IsThicknessEditable(), BOARD_STACKUP_ITEM::IsThicknessLocked(), KEY_CORE, m_board, m_brdSettings, PANEL_SETUP_BOARD_STACKUP_BASE::m_choiceCopperLayers, m_colorSwatchesSize, BOARD_STACKUP::m_HasDielectricConstrains, PANEL_SETUP_BOARD_STACKUP_BASE::m_impedanceControlled, m_rowUiItemsList, m_units, NotSpecifiedPrm(), showOnlyActiveLayers(), StringFromValue(), and updateIconColor().

Referenced by ImportSettingsFrom(), OnLayersOptionsChanged(), and PANEL_SETUP_BOARD_STACKUP().

◆ transferDataFromUIToStackup()

bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup ( )
private

Transfer current UI settings to m_stackup but not to the board.

Definition at line 994 of file panel_board_stackup.cpp.

995{
996 wxString txt;
997 wxString error_msg;
998 bool success = true;
999 double value;
1000 int row = 0;
1001
1003 {
1004 // Skip stackup items useless for the current board
1005 if( !ui_item.m_isEnabled )
1006 {
1007 row++;
1008 continue;
1009 }
1010
1011 BOARD_STACKUP_ITEM* item = ui_item.m_Item;
1012 int sub_item = ui_item.m_SubItem;
1013
1014 // Add sub layer if there is a new sub layer:
1015 while( item->GetSublayersCount() <= sub_item )
1016 item->AddDielectricPrms( item->GetSublayersCount() );
1017
1018 if( sub_item == 0 ) // Name only main layer
1019 item->SetLayerName( ui_item.m_LayerName->GetLabel() );
1020
1021 if( item->HasEpsilonRValue() )
1022 {
1023 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_EpsilonCtrl );
1024 txt = textCtrl->GetValue();
1025
1026 if( txt.ToDouble( &value ) && value >= 0.0 )
1027 item->SetEpsilonR( value, sub_item );
1028 else if( txt.ToCDouble( &value ) && value >= 0.0 )
1029 item->SetEpsilonR( value, sub_item );
1030 else
1031 {
1032 success = false;
1033 error_msg << _( "Incorrect value for Epsilon R (Epsilon R must be positive or "
1034 "null if not used)" );
1035 }
1036 }
1037
1038 if( item->HasLossTangentValue() )
1039 {
1040 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_LossTgCtrl );
1041 txt = textCtrl->GetValue();
1042
1043 if( txt.ToDouble( &value ) && value >= 0.0 )
1044 item->SetLossTangent( value, sub_item );
1045 else if( txt.ToCDouble( &value ) && value >= 0.0 )
1046 item->SetLossTangent( value, sub_item );
1047 else
1048 {
1049 success = false;
1050
1051 if( !error_msg.IsEmpty() )
1052 error_msg << wxT( "\n" );
1053
1054 error_msg << _( "Incorrect value for Loss tg (Loss tg must be positive or null "
1055 "if not used)" );
1056 }
1057 }
1058
1059 if( item->IsMaterialEditable() )
1060 {
1061 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_MaterialCtrl );
1062 item->SetMaterial( textCtrl->GetValue(), sub_item );
1063
1064 // Ensure the not specified mat name is the keyword, not its translation
1065 // to avoid any issue is the language setting changes
1066 if( !IsPrmSpecified( item->GetMaterial( sub_item ) ) )
1067 item->SetMaterial( NotSpecifiedPrm(), sub_item );
1068 }
1069
1070 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
1071 {
1072 // Choice is Core or Prepreg. Sublayers have no choice:
1073 wxChoice* choice = dynamic_cast<wxChoice*>( ui_item.m_LayerTypeCtrl );
1074
1075 if( choice )
1076 {
1077 int idx = choice->GetSelection();
1078
1079 if( idx == 0 )
1080 item->SetTypeName( KEY_CORE );
1081 else
1082 item->SetTypeName( KEY_PREPREG );
1083 }
1084 }
1085
1086 if( item->IsThicknessEditable() )
1087 {
1088 wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item.m_ThicknessCtrl );
1089 txt = textCtrl->GetValue();
1090
1091 int new_thickness = ValueFromString( m_frame->GetUserUnits(), txt );
1092 item->SetThickness( new_thickness, sub_item );
1093
1094 if( new_thickness < 0 )
1095 {
1096 success = false;
1097
1098 if( !error_msg.IsEmpty() )
1099 error_msg << wxT( "\n" );
1100
1101 error_msg << _( "A layer thickness is < 0. Fix it" );
1102 }
1103
1104 if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
1105 {
1106 // Dielectric thickness layer can have a locked thickness:
1107 wxCheckBox* cb_box = static_cast<wxCheckBox*>( ui_item.m_ThicknessLockCtrl );
1108 item->SetThicknessLocked( cb_box && cb_box->GetValue(), sub_item );
1109 }
1110 }
1111
1112 if( sub_item == 0 && item->IsColorEditable() )
1113 {
1114 wxBitmapComboBox* choice = dynamic_cast<wxBitmapComboBox*>( ui_item.m_ColorCtrl );
1115
1116 if( choice )
1117 {
1118 int idx = choice->GetSelection();
1119
1120 if( IsCustomColorIdx( item->GetType(), idx ) )
1121 item->SetColor( ui_item.m_UserColor.ToHexString() );
1122 else
1123 item->SetColor( GetStandardColorName( item->GetType(), idx ) );
1124 }
1125 }
1126
1127 row++;
1128 }
1129
1130 if( !success )
1131 {
1132 wxMessageBox( error_msg, _( "Errors" ) );
1133 return false;
1134 }
1135
1137
1138 return true;
1139}
void SetThicknessLocked(bool aLocked, int aDielectricSubLayer=0)
void SetTypeName(const wxString &aName)
#define KEY_PREPREG

References _, BOARD_STACKUP_ITEM::AddDielectricPrms(), BS_ITEM_TYPE_DIELECTRIC, BOARD_STACKUP_ITEM::GetMaterial(), GetStandardColorName(), BOARD_STACKUP_ITEM::GetSublayersCount(), BOARD_STACKUP_ITEM::GetType(), EDA_BASE_FRAME::GetUserUnits(), BOARD_STACKUP_ITEM::HasEpsilonRValue(), BOARD_STACKUP_ITEM::HasLossTangentValue(), BOARD_STACKUP_ITEM::IsColorEditable(), IsCustomColorIdx(), BOARD_STACKUP_ITEM::IsMaterialEditable(), IsPrmSpecified(), BOARD_STACKUP_ITEM::IsThicknessEditable(), KEY_CORE, KEY_PREPREG, m_frame, BOARD_STACKUP::m_HasDielectricConstrains, PANEL_SETUP_BOARD_STACKUP_BASE::m_impedanceControlled, m_rowUiItemsList, m_stackup, NotSpecifiedPrm(), BOARD_STACKUP_ITEM::SetColor(), BOARD_STACKUP_ITEM::SetEpsilonR(), BOARD_STACKUP_ITEM::SetLayerName(), BOARD_STACKUP_ITEM::SetLossTangent(), BOARD_STACKUP_ITEM::SetMaterial(), BOARD_STACKUP_ITEM::SetThickness(), BOARD_STACKUP_ITEM::SetThicknessLocked(), BOARD_STACKUP_ITEM::SetTypeName(), and ValueFromString().

Referenced by onExportToClipboard(), onMaterialChange(), and TransferDataFromWindow().

◆ TransferDataFromWindow()

bool PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow ( )
override

Definition at line 1142 of file panel_board_stackup.cpp.

1143{
1145 return false;
1146
1147 // NOTE: Copper layer count is transferred via PANEL_SETUP_LAYERS even though it is configured
1148 // on this page, because the logic for confirming deletion of board items on deleted layers is
1149 // on that panel and it doesn't make sense to split it up.
1150
1152
1153 STRING_FORMATTER old_stackup;
1154
1155 // FormatBoardStackup() (using FormatInternalUnits()) expects a "C" locale
1156 // to execute some tests. So switch to the suitable locale
1158 brd_stackup.FormatBoardStackup( &old_stackup, m_board, 0 );
1159
1160 brd_stackup.m_FinishType = m_stackup.m_FinishType;
1165
1166 // copy enabled items to the new board stackup
1167 brd_stackup.RemoveAll();
1168
1169 for( BOARD_STACKUP_ITEM* item : m_stackup.GetList() )
1170 {
1171 if( item->IsEnabled() )
1172 brd_stackup.Add( new BOARD_STACKUP_ITEM( *item ) );
1173 }
1174
1175 STRING_FORMATTER new_stackup;
1176 brd_stackup.FormatBoardStackup( &new_stackup, m_board, 0 );
1177
1178 bool modified = old_stackup.GetString() != new_stackup.GetString();
1179 int thickness = brd_stackup.BuildBoardThicknessFromStackup();
1180
1181 if( m_brdSettings->GetBoardThickness() != thickness )
1182 {
1183 m_brdSettings->SetBoardThickness( thickness );
1184 modified = true;
1185 }
1186
1188 {
1190 modified = true;
1191 }
1192
1193 if( modified )
1194 m_frame->OnModify();
1195
1196 return true;
1197}
int GetBoardThickness() const
The full thickness of the board including copper and masks.
void SetBoardThickness(int aThickness)
void RemoveAll()
Delete all items in list and clear the list.
void FormatBoardStackup(OUTPUTFORMATTER *aFormatter, const BOARD *aBoard, int aNestLevel) const
Write the stackup info on board file.
bool m_CastellatedPads
True if castellated pads exist.
int BuildBoardThicknessFromStackup() const
void Add(BOARD_STACKUP_ITEM *aItem)
Add a new item in stackup layer.
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
wxString m_FinishType
The name of external copper finish.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:41
void OnModify() override
Must be called after a board change to set the modified flag.
Implement an OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:415
const std::string & GetString()
Definition: richio.h:438
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:73

References BOARD_STACKUP::Add(), BOARD_STACKUP::BuildBoardThicknessFromStackup(), dummy(), BOARD_STACKUP::FormatBoardStackup(), BOARD_DESIGN_SETTINGS::GetBoardThickness(), BOARD_STACKUP::GetList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), STRING_FORMATTER::GetString(), m_board, m_brdSettings, BOARD_STACKUP::m_CastellatedPads, BOARD_STACKUP::m_EdgeConnectorConstraints, BOARD_STACKUP::m_EdgePlating, BOARD_STACKUP::m_FinishType, m_frame, BOARD_STACKUP::m_HasDielectricConstrains, BOARD_DESIGN_SETTINGS::m_HasStackup, m_stackup, PCB_EDIT_FRAME::OnModify(), BOARD_STACKUP::RemoveAll(), BOARD_DESIGN_SETTINGS::SetBoardThickness(), and transferDataFromUIToStackup().

◆ updateCopperLayerCount()

void PANEL_SETUP_BOARD_STACKUP::updateCopperLayerCount ( )
private

Updates the enabled copper layers when the dropdown is changed.

Definition at line 465 of file panel_board_stackup.cpp.

466{
467 int copperCount = GetCopperLayerCount();
468
469 wxASSERT( copperCount >= 2 );
470
472 m_enabledLayers &= ~LSET::InternalCuMask();
473
474 for( int i = 1; i < copperCount - 1; i++ )
475 m_enabledLayers.set( F_Cu + i );
476}
@ F_Cu
Definition: layer_ids.h:64

References LSET::ExternalCuMask(), F_Cu, GetCopperLayerCount(), and m_enabledLayers.

Referenced by onCopperLayersSelCount().

◆ updateIconColor()

void PANEL_SETUP_BOARD_STACKUP::updateIconColor ( int  aRow = -1)
private

Update the icons color (swatches in first grid column)

Parameters
aRowis the row (index in m_rowUiItemsList) that manages the icon to update. if -1 all icons will be updated

Definition at line 1460 of file panel_board_stackup.cpp.

1461{
1462 // explicit depth important under MSW. We use R,V,B 24 bits/pixel bitmap
1463 const int bitmap_depth = 24;
1464
1465 if( aRow >= 0 )
1466 {
1467 wxStaticBitmap* st_bitmap = m_rowUiItemsList[aRow].m_Icon;
1468
1469 wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
1470 drawBitmap( bmp, getColorIconItem( aRow ) );
1471 st_bitmap->SetBitmap( bmp );
1472 return;
1473 }
1474
1475 for( unsigned row = 0; row < m_rowUiItemsList.size(); row++ )
1476 {
1477 wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
1478 drawBitmap( bmp, getColorIconItem( row ) );
1479 m_rowUiItemsList[row].m_Icon->SetBitmap( bmp );
1480 }
1481}
static void drawBitmap(wxBitmap &aBitmap, wxColor aColor)

References drawBitmap(), getColorIconItem(), m_colorIconsSize, and m_rowUiItemsList.

Referenced by buildLayerStackPanel(), onColorSelected(), and synchronizeWithBoard().

Member Data Documentation

◆ m_bitmapLockThickness

wxStaticBitmap* PANEL_SETUP_BOARD_STACKUP_BASE::m_bitmapLockThickness
protectedinherited

◆ m_board

BOARD* PANEL_SETUP_BOARD_STACKUP::m_board
private

◆ m_brdSettings

BOARD_DESIGN_SETTINGS* PANEL_SETUP_BOARD_STACKUP::m_brdSettings
private

◆ m_buttonAddDielectricLayer

wxButton* PANEL_SETUP_BOARD_STACKUP_BASE::m_buttonAddDielectricLayer
protectedinherited

◆ m_buttonAdjust

wxButton* PANEL_SETUP_BOARD_STACKUP_BASE::m_buttonAdjust
protectedinherited

◆ m_buttonExport

wxButton* PANEL_SETUP_BOARD_STACKUP_BASE::m_buttonExport
protectedinherited

◆ m_buttonRemoveDielectricLayer

wxButton* PANEL_SETUP_BOARD_STACKUP_BASE::m_buttonRemoveDielectricLayer
protectedinherited

◆ m_choiceCopperLayers

wxChoice* PANEL_SETUP_BOARD_STACKUP_BASE::m_choiceCopperLayers
protectedinherited

◆ m_colorIconsSize

wxSize PANEL_SETUP_BOARD_STACKUP::m_colorIconsSize
private

Definition at line 256 of file panel_board_stackup.h.

Referenced by PANEL_SETUP_BOARD_STACKUP(), and updateIconColor().

◆ m_colorSwatchesSize

wxSize PANEL_SETUP_BOARD_STACKUP::m_colorSwatchesSize
private

◆ m_controlItemsList

std::vector<wxControl*> PANEL_SETUP_BOARD_STACKUP::m_controlItemsList
private

◆ m_core_prepreg_choice

wxArrayString PANEL_SETUP_BOARD_STACKUP::m_core_prepreg_choice
private

Definition at line 254 of file panel_board_stackup.h.

Referenced by createRowData(), and PANEL_SETUP_BOARD_STACKUP().

◆ m_delectricMatList

DIELECTRIC_SUBSTRATE_LIST PANEL_SETUP_BOARD_STACKUP::m_delectricMatList
private

Definition at line 239 of file panel_board_stackup.h.

Referenced by onMaterialChange().

◆ m_enabledLayers

LSET PANEL_SETUP_BOARD_STACKUP::m_enabledLayers
private

◆ m_fgGridSizer

wxFlexGridSizer* PANEL_SETUP_BOARD_STACKUP_BASE::m_fgGridSizer
protectedinherited

◆ m_frame

◆ m_impedanceControlled

wxCheckBox* PANEL_SETUP_BOARD_STACKUP_BASE::m_impedanceControlled
protectedinherited

◆ m_lblCopperLayers

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_lblCopperLayers
protectedinherited

◆ m_numericFieldsSize

wxSize PANEL_SETUP_BOARD_STACKUP::m_numericFieldsSize
private

Definition at line 253 of file panel_board_stackup.h.

Referenced by createRowData(), and PANEL_SETUP_BOARD_STACKUP().

◆ m_numericTextCtrlSize

wxSize PANEL_SETUP_BOARD_STACKUP::m_numericTextCtrlSize
private

◆ m_panelLayers

PANEL_SETUP_LAYERS* PANEL_SETUP_BOARD_STACKUP::m_panelLayers
private

◆ m_parentDialog

PAGED_DIALOG* PANEL_SETUP_BOARD_STACKUP::m_parentDialog
private

◆ m_rowUiItemsList

◆ m_scGridWin

wxScrolledWindow* PANEL_SETUP_BOARD_STACKUP_BASE::m_scGridWin
protectedinherited

◆ m_silkscreenMatList

DIELECTRIC_SUBSTRATE_LIST PANEL_SETUP_BOARD_STACKUP::m_silkscreenMatList
private

Definition at line 243 of file panel_board_stackup.h.

Referenced by onMaterialChange().

◆ m_solderMaskMatList

DIELECTRIC_SUBSTRATE_LIST PANEL_SETUP_BOARD_STACKUP::m_solderMaskMatList
private

Definition at line 241 of file panel_board_stackup.h.

Referenced by onMaterialChange().

◆ m_stackup

◆ m_staticTextColor

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextColor
protectedinherited

◆ m_staticTextCT

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextCT
protectedinherited

◆ m_staticTextEpsilonR

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextEpsilonR
protectedinherited

◆ m_staticTextLayer

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLayer
protectedinherited

◆ m_staticTextLayerId

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLayerId
protectedinherited

◆ m_staticTextLossTg

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextLossTg
protectedinherited

◆ m_staticTextMaterial

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextMaterial
protectedinherited

◆ m_staticTextThickness

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextThickness
protectedinherited

◆ m_staticTextType

wxStaticText* PANEL_SETUP_BOARD_STACKUP_BASE::m_staticTextType
protectedinherited

◆ m_tcCTValue

wxTextCtrl* PANEL_SETUP_BOARD_STACKUP_BASE::m_tcCTValue
protectedinherited

◆ m_units

EDA_UNITS PANEL_SETUP_BOARD_STACKUP::m_units
private

The documentation for this class was generated from the following files: