diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 0b604a4ddb..24bb8f7afe 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -188,6 +188,8 @@ endif() set( PCBNEW_BRDSTACKUP_MGR board_stackup_manager/dielectric_material.cpp board_stackup_manager/stackup_predefined_prms.cpp + board_stackup_manager/panel_board_finish.cpp + board_stackup_manager/panel_board_finish_base.cpp board_stackup_manager/panel_board_stackup.cpp board_stackup_manager/panel_board_stackup_base.cpp board_stackup_manager/board_stackup_reporter.cpp diff --git a/pcbnew/board_stackup_manager/panel_board_finish.cpp b/pcbnew/board_stackup_manager/panel_board_finish.cpp new file mode 100644 index 0000000000..2cd90e2fe0 --- /dev/null +++ b/pcbnew/board_stackup_manager/panel_board_finish.cpp @@ -0,0 +1,106 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include "panel_board_finish.h" + + +PANEL_SETUP_BOARD_FINISH::PANEL_SETUP_BOARD_FINISH( PAGED_DIALOG* aParent, BOARD* aBoard ) : + PANEL_SETUP_BOARD_FINISH_BASE( aParent->GetTreebook() ) +{ + m_parentDialog = aParent; + m_board = aBoard; + m_brdSettings = &m_board->GetDesignSettings(); + + // Get the translated list of choices and init m_choiceFinish + wxArrayString finish_list = GetCopperFinishStandardList( true ); + m_choiceFinish->Append( finish_list ); + m_choiceFinish->SetSelection( 0 ); // Will be correctly set later + + synchronizeWithBoard(); +} + + +PANEL_SETUP_BOARD_FINISH::~PANEL_SETUP_BOARD_FINISH() +{ +} + + +void PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard() +{ + const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); + + m_choiceEdgeConn->SetSelection( brd_stackup.m_EdgeConnectorConstraints ); + m_cbCastellatedPads->SetValue( brd_stackup.m_CastellatedPads ); + m_cbEgdesPlated->SetValue( brd_stackup.m_EdgePlating ); + + // find the choice depending on the initial finish setting + wxArrayString initial_finish_list = GetCopperFinishStandardList( false ); + unsigned idx; + + for( idx = 0; idx < initial_finish_list.GetCount(); idx++ ) + { + if( initial_finish_list[idx] == brd_stackup.m_FinishType ) + break; + } + + // Now init the choice (use last choice: "User defined" if not found ) + if( idx >= initial_finish_list.GetCount() ) + idx = initial_finish_list.GetCount()-1; + + m_choiceFinish->SetSelection( idx ); +} + + +bool PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow() +{ + BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); + + wxArrayString finish_list = GetCopperFinishStandardList( false ); + int finish = m_choiceFinish->GetSelection() >= 0 ? m_choiceFinish->GetSelection() : 0; + brd_stackup.m_FinishType = finish_list[finish]; + + int edge = m_choiceEdgeConn->GetSelection();; + brd_stackup.m_EdgeConnectorConstraints = (BS_EDGE_CONNECTOR_CONSTRAINTS) edge; + + brd_stackup.m_CastellatedPads = m_cbCastellatedPads->GetValue(); + brd_stackup.m_EdgePlating = m_cbEgdesPlated->GetValue(); + + return true; +} + + +void PANEL_SETUP_BOARD_FINISH::ImportSettingsFrom( BOARD* aBoard ) +{ + BOARD* savedBrd = m_board; + BOARD_DESIGN_SETTINGS* savedSettings = m_brdSettings; + m_brdSettings = &aBoard->GetDesignSettings(); + + synchronizeWithBoard(); + + m_brdSettings = savedSettings; + m_board = savedBrd; +} diff --git a/pcbnew/board_stackup_manager/panel_board_finish.h b/pcbnew/board_stackup_manager/panel_board_finish.h new file mode 100644 index 0000000000..15432b122d --- /dev/null +++ b/pcbnew/board_stackup_manager/panel_board_finish.h @@ -0,0 +1,56 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef PANEL_SETUP_BOARD_FINISH_H +#define PANEL_SETUP_BOARD_FINISH_H + + +#include +#include "panel_board_finish_base.h" + +class PAGED_DIALOG; +class PCB_EDIT_FRAME; + + +class PANEL_SETUP_BOARD_FINISH : public PANEL_SETUP_BOARD_FINISH_BASE +{ +public: + PANEL_SETUP_BOARD_FINISH( PAGED_DIALOG* aParent, BOARD* aBoard ); + ~PANEL_SETUP_BOARD_FINISH(); + + void ImportSettingsFrom( BOARD* aBoard ); + + // Called by wxWidgets: transfer current settings stored in m_stackup to the board + bool TransferDataFromWindow() override; + +private: + void synchronizeWithBoard(); + +private: + PAGED_DIALOG* m_parentDialog; + BOARD* m_board; + BOARD_DESIGN_SETTINGS* m_brdSettings; +}; + +#endif // #ifndef PANEL_SETUP_BOARD_FINISH_H diff --git a/pcbnew/board_stackup_manager/panel_board_finish_base.cpp b/pcbnew/board_stackup_manager/panel_board_finish_base.cpp new file mode 100644 index 0000000000..e62c994c73 --- /dev/null +++ b/pcbnew/board_stackup_manager/panel_board_finish_base.cpp @@ -0,0 +1,72 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Oct 26 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "panel_board_finish_base.h" + +/////////////////////////////////////////////////////////////////////////// + +PANEL_SETUP_BOARD_FINISH_BASE::PANEL_SETUP_BOARD_FINISH_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +{ + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxVERTICAL ); + + m_cbCastellatedPads = new wxCheckBox( this, wxID_ANY, _("Has castellated pads"), wxDefaultPosition, wxDefaultSize, 0 ); + bMargins->Add( m_cbCastellatedPads, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_cbEgdesPlated = new wxCheckBox( this, wxID_ANY, _("Plated board edge"), wxDefaultPosition, wxDefaultSize, 0 ); + bMargins->Add( m_cbEgdesPlated, 0, wxBOTTOM|wxLEFT, 5 ); + + wxFlexGridSizer* fgSizer2; + fgSizer2 = new wxFlexGridSizer( 0, 2, 5, 0 ); + fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextFinish = new wxStaticText( this, wxID_ANY, _("Copper finish:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextFinish->Wrap( -1 ); + fgSizer2->Add( m_staticTextFinish, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxArrayString m_choiceFinishChoices; + m_choiceFinish = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceFinishChoices, 0 ); + m_choiceFinish->SetSelection( 0 ); + fgSizer2->Add( m_choiceFinish, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 2 ); + + m_staticTextEdgeConn = new wxStaticText( this, wxID_ANY, _("Edge card connectors:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextEdgeConn->Wrap( -1 ); + fgSizer2->Add( m_staticTextEdgeConn, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxString m_choiceEdgeConnChoices[] = { _("None"), _("Yes"), _("Yes, bevelled") }; + int m_choiceEdgeConnNChoices = sizeof( m_choiceEdgeConnChoices ) / sizeof( wxString ); + m_choiceEdgeConn = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceEdgeConnNChoices, m_choiceEdgeConnChoices, 0 ); + m_choiceEdgeConn->SetSelection( 0 ); + m_choiceEdgeConn->SetToolTip( _("Options for edge card connectors.") ); + + fgSizer2->Add( m_choiceEdgeConn, 0, wxEXPAND, 2 ); + + + bMargins->Add( fgSizer2, 1, wxEXPAND|wxTOP, 10 ); + + + bMainSizer->Add( bMargins, 1, wxEXPAND, 10 ); + + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + // Connect Events + this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_BOARD_FINISH_BASE::OnUpdateUI ) ); +} + +PANEL_SETUP_BOARD_FINISH_BASE::~PANEL_SETUP_BOARD_FINISH_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_BOARD_FINISH_BASE::OnUpdateUI ) ); + +} diff --git a/pcbnew/board_stackup_manager/panel_board_finish_base.fbp b/pcbnew/board_stackup_manager/panel_board_finish_base.fbp new file mode 100644 index 0000000000..36c3b132c0 --- /dev/null +++ b/pcbnew/board_stackup_manager/panel_board_finish_base.fbp @@ -0,0 +1,468 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_board_finish_base + 1000 + none + + 1 + PANEL_BOARD_FINISH_BASE + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_SETUP_BOARD_FINISH_BASE + + -1,-1 + ; ; forward_declare + + + + wxTAB_TRAVERSAL + OnUpdateUI + + + bMainSizer + wxVERTICAL + none + + 10 + wxEXPAND + 1 + + + bMargins + wxVERTICAL + none + + 5 + wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Has castellated pads + + 0 + + + 0 + + 1 + m_cbCastellatedPads + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Plated board edge + + 0 + + + 0 + + 1 + m_cbEgdesPlated + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 10 + wxEXPAND|wxTOP + 1 + + 2 + wxBOTH + + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Copper finish: + 0 + + 0 + + + 0 + + 1 + m_staticTextFinish + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceFinish + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Edge card connectors: + 0 + + 0 + + + 0 + + 1 + m_staticTextEdgeConn + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "None" "Yes" "Yes, bevelled" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceEdgeConn + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Options for edge card connectors. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + diff --git a/pcbnew/board_stackup_manager/panel_board_finish_base.h b/pcbnew/board_stackup_manager/panel_board_finish_base.h new file mode 100644 index 0000000000..af9c145f9e --- /dev/null +++ b/pcbnew/board_stackup_manager/panel_board_finish_base.h @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Oct 26 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class PANEL_SETUP_BOARD_FINISH_BASE +/////////////////////////////////////////////////////////////////////////////// +class PANEL_SETUP_BOARD_FINISH_BASE : public wxPanel +{ + private: + + protected: + wxCheckBox* m_cbCastellatedPads; + wxCheckBox* m_cbEgdesPlated; + wxStaticText* m_staticTextFinish; + wxChoice* m_choiceFinish; + wxStaticText* m_staticTextEdgeConn; + wxChoice* m_choiceEdgeConn; + + // Virtual event handlers, overide them in your derived class + virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } + + + public: + + PANEL_SETUP_BOARD_FINISH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + ~PANEL_SETUP_BOARD_FINISH_BASE(); + +}; + diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.cpp b/pcbnew/board_stackup_manager/panel_board_stackup.cpp index 4700f71610..6617d11c26 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup.cpp @@ -366,27 +366,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) if( aFullSync ) { m_choiceCopperLayers->SetSelection( ( m_board->GetCopperLayerCount() / 2 ) - 1 ); - - m_rbDielectricConstraint->SetSelection( brd_stackup.m_HasDielectricConstrains ? 1 : 0 ); - m_choiceEdgeConn->SetSelection( brd_stackup.m_EdgeConnectorConstraints ); - m_cbCastellatedPads->SetValue( brd_stackup.m_CastellatedPads ); - m_cbEgdesPlated->SetValue( brd_stackup.m_EdgePlating ); - - // find the choice depending on the initial finish setting - wxArrayString initial_finish_list = GetCopperFinishStandardList( false ); - unsigned idx; - - for( idx = 0; idx < initial_finish_list.GetCount(); idx++ ) - { - if( initial_finish_list[idx] == brd_stackup.m_FinishType ) - break; - } - - // Now init the choice (use last choice: "User defined" if not found ) - if( idx >= initial_finish_list.GetCount() ) - idx = initial_finish_list.GetCount()-1; - - m_choiceFinish->SetSelection( idx ); + m_impedanceControlled->SetValue( brd_stackup.m_HasDielectricConstrains ); } int row = 0; @@ -547,7 +527,7 @@ void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser( wxWindowID aId, BOARD_STACKUP_ROW_UI_ITEM& aUiRowItem ) { wxBoxSizer* bSizerMat = new wxBoxSizer( wxHORIZONTAL ); - m_fgGridSizer->Add( bSizerMat, 1, wxEXPAND, 2 ); + m_fgGridSizer->Add( bSizerMat, 1, wxRIGHT|wxEXPAND, 4 ); wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY ); if( aMaterialName ) @@ -559,10 +539,10 @@ void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser( wxWindowID aId, } textCtrl->SetMinSize( m_numericTextCtrlSize ); - bSizerMat->Add( textCtrl, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizerMat->Add( textCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - wxButton* m_buttonMat = new wxButton( m_scGridWin, aId, _("..."), - wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); + wxButton* m_buttonMat = new wxButton( m_scGridWin, aId, _( "..." ), wxDefaultPosition, + wxDefaultSize, wxBU_EXACTFIT ); bSizerMat->Add( m_buttonMat, 0, wxALIGN_CENTER_VERTICAL, 2 ); m_buttonMat->Connect( wxEVT_COMMAND_BUTTON_CLICKED, @@ -578,13 +558,14 @@ void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser( wxWindowID aId, wxControl* PANEL_SETUP_BOARD_STACKUP::addSpacer() { wxStaticText* emptyText = new wxStaticText( m_scGridWin, wxID_ANY, wxEmptyString ); - m_fgGridSizer->Add( emptyText, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND ); + m_fgGridSizer->Add( emptyText, 0, wxALIGN_CENTER_VERTICAL ); return emptyText; } BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, - BOARD_STACKUP_ITEM* aStackupItem, int aSublayerIdx ) + BOARD_STACKUP_ITEM* aStackupItem, + int aSublayerIdx ) { wxASSERT( aStackupItem ); wxASSERT( aSublayerIdx >= 0 && aSublayerIdx < aStackupItem->GetSublayersCount() ); @@ -598,7 +579,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, // Add color swatch icon. The color will be updated later, // when all widgets are initialized wxStaticBitmap* bitmap = new wxStaticBitmap( m_scGridWin, wxID_ANY, wxNullBitmap ); - m_fgGridSizer->Add( bitmap, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT ); + m_fgGridSizer->Add( bitmap, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 4 ); ui_row_item.m_Icon = bitmap; ui_row_item.m_isEnabled = true; @@ -623,18 +604,20 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, wxChoice* choice = new wxChoice( m_scGridWin, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_core_prepreg_choice ); choice->SetSelection( item->GetTypeName() == KEY_CORE ? 0 : 1 ); - m_fgGridSizer->Add( choice, 0, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); + m_fgGridSizer->Add( choice, 1, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_LayerTypeCtrl = choice; } else + { ui_row_item.m_LayerTypeCtrl = addSpacer(); + } } else { item->SetLayerName( m_board->GetLayerName( item->GetBrdLayerId() ) ); wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, item->GetLayerName() ); - m_fgGridSizer->Add( st_text, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1 ); + m_fgGridSizer->Add( st_text, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 1 ); st_text->Show( true ); ui_row_item.m_LayerName = st_text; @@ -716,7 +699,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, wxBitmapComboBox* bm_combo = createBmComboBox( item, row ); m_colorComboSize.y = bm_combo->GetSize().y; bm_combo->SetMinSize( m_colorComboSize ); - m_fgGridSizer->Add( bm_combo, 0, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); + m_fgGridSizer->Add( bm_combo, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); bm_combo->SetSelection( color_idx ); ui_row_item.m_ColorCtrl = bm_combo; } @@ -798,18 +781,17 @@ void PANEL_SETUP_BOARD_STACKUP::rebuildLayerStackPanel() m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 2 ); m_fgGridSizer->SetFlexibleDirection( wxHORIZONTAL ); m_fgGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + m_fgGridSizer->SetHGap( 6 ); m_scGridWin->SetSizer( m_fgGridSizer ); // Re-add "old" title items: - const int sizer_flags = wxALIGN_CENTER_VERTICAL | wxTOP|wxBOTTOM | - wxLEFT | wxALIGN_CENTER_HORIZONTAL; + const int sizer_flags = wxALIGN_CENTER_VERTICAL | wxALL | wxALIGN_CENTER_HORIZONTAL; m_fgGridSizer->Add( m_staticTextLayer, 0, sizer_flags, 2 ); m_fgGridSizer->Add( m_staticTextType, 0, sizer_flags, 2 ); - m_fgGridSizer->Add( m_staticTextLayerId, 0, wxALL|sizer_flags, 5 ); + m_fgGridSizer->Add( m_staticTextLayerId, 0, sizer_flags, 5 ); m_fgGridSizer->Add( m_staticTextMaterial, 0, sizer_flags, 2 ); m_fgGridSizer->Add( m_staticTextThickness, 0, sizer_flags, 2 ); - m_fgGridSizer->Add( m_bitmapLockThickness, 0, - wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_fgGridSizer->Add( m_bitmapLockThickness, 0, sizer_flags, 1 ); m_fgGridSizer->Add( m_staticTextColor, 0, sizer_flags, 2 ); m_fgGridSizer->Add( m_staticTextEpsilonR, 0, sizer_flags, 2 ); m_fgGridSizer->Add( m_staticTextLossTg, 0, sizer_flags, 2 ); @@ -883,14 +865,6 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel( bool aCreatedInitialStacku } } - if( aCreatedInitialStackup ) - { - // Get the translated list of choices and init m_choiceFinish - wxArrayString finish_list = GetCopperFinishStandardList( true ); - m_choiceFinish->Append( finish_list ); - m_choiceFinish->SetSelection( 0 ); // Will be correctly set later - } - updateIconColor(); m_scGridWin->Layout(); } @@ -1043,7 +1017,9 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup() item->SetColor( color.GetAsString( wxC2S_HTML_SYNTAX ) ); } else + { item->SetColor( color_list[idx].m_ColorName ); + } } } @@ -1056,13 +1032,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup() return false; } - wxArrayString finish_list = GetCopperFinishStandardList( false ); - int finish = m_choiceFinish->GetSelection() >= 0 ? m_choiceFinish->GetSelection() : 0; - m_stackup.m_FinishType = finish_list[finish]; - m_stackup.m_HasDielectricConstrains = m_rbDielectricConstraint->GetSelection() == 1; - m_stackup.m_EdgeConnectorConstraints = (BS_EDGE_CONNECTOR_CONSTRAINTS)m_choiceEdgeConn->GetSelection(); - m_stackup.m_CastellatedPads = m_cbCastellatedPads->GetValue(); - m_stackup.m_EdgePlating = m_cbEgdesPlated->GetValue(); + m_stackup.m_HasDielectricConstrains = m_impedanceControlled->GetValue(); return true; } @@ -1241,21 +1211,10 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event ) switch( item->GetType() ) { - case BS_ITEM_TYPE_DIELECTRIC: - item_mat_list = &m_delectricMatList; - break; - - case BS_ITEM_TYPE_SOLDERMASK: - item_mat_list = &m_solderMaskMatList; - break; - - case BS_ITEM_TYPE_SILKSCREEN: - item_mat_list = &m_silkscreenMatList; - break; - - default: - item_mat_list = nullptr; - break; + case BS_ITEM_TYPE_DIELECTRIC: item_mat_list = &m_delectricMatList; break; + case BS_ITEM_TYPE_SOLDERMASK: item_mat_list = &m_solderMaskMatList; break; + case BS_ITEM_TYPE_SILKSCREEN: item_mat_list = &m_silkscreenMatList; break; + default: item_mat_list = nullptr; break; } DIALOG_DIELECTRIC_MATERIAL dlg( this, *item_mat_list ); @@ -1355,7 +1314,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow ) { wxStaticBitmap* st_bitmap = m_rowUiItemsList[aRow].m_Icon; // explicit depth important under MSW - wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 24 ); + wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 ); drawBitmap( bmp, getColorIconItem( aRow ) ); st_bitmap->SetBitmap( bmp ); return; @@ -1364,7 +1323,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow ) for( unsigned row = 0; row < m_rowUiItemsList.size(); row++ ) { // explicit depth important under MSW - wxBitmap bmp(m_colorIconsSize.x, m_colorIconsSize.y / 2, 24); + wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 ); drawBitmap( bmp, getColorIconItem( row ) ); m_rowUiItemsList[row].m_Icon->SetBitmap( bmp ); } @@ -1374,7 +1333,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow ) wxBitmapComboBox* PANEL_SETUP_BOARD_STACKUP::createBmComboBox( BOARD_STACKUP_ITEM* aStackupItem, int aRow ) { - wxBitmapComboBox* combo = new wxBitmapComboBox( m_scGridWin, ID_ITEM_COLOR+aRow, + wxBitmapComboBox* combo = new wxBitmapComboBox( m_scGridWin, ID_ITEM_COLOR + aRow, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY ); // Fills the combo box with choice list + bitmaps @@ -1389,7 +1348,9 @@ wxBitmapComboBox* PANEL_SETUP_BOARD_STACKUP::createBmComboBox( BOARD_STACKUP_ITE // Defined colors have a name, the user color uses the HTML notation ( i.e. #FF0000) if( GetColorStandardListCount()-1 > (int)combo->GetCount() ) + { label = wxGetTranslation( item.m_ColorName ); + } else // Append the user color, if specified, else add a default user color { if( aStackupItem && aStackupItem->GetColor().StartsWith( "#" ) ) @@ -1398,12 +1359,13 @@ wxBitmapComboBox* PANEL_SETUP_BOARD_STACKUP::createBmComboBox( BOARD_STACKUP_ITE label = aStackupItem->GetColor(); } else + { label = curr_color.GetAsString( wxC2S_HTML_SYNTAX ); + } } wxBitmap layerbmp( m_colorSwatchesSize.x, m_colorSwatchesSize.y ); - LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D( 0, 0, 0, 0 ), - COLOR4D( curr_color ) ); + LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D( 0, 0, 0, 0 ), COLOR4D( curr_color ) ); combo->Append( label, layerbmp ); } diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp index bb2e88ca35..42ac34b427 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp @@ -14,17 +14,52 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bMainSizer->Add( m_staticline, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + wxBoxSizer* bTopSizer; + bTopSizer = new wxBoxSizer( wxHORIZONTAL ); - m_sizerStackup = new wxBoxSizer( wxHORIZONTAL ); + m_lblCopperLayers = new wxStaticText( this, wxID_ANY, _("Copper layers:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblCopperLayers->Wrap( -1 ); + m_lblCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); - wxBoxSizer* bSizer5; - bSizer5 = new wxBoxSizer( wxVERTICAL ); + bTopSizer->Add( m_lblCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - m_scGridWin = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + wxString m_choiceCopperLayersChoices[] = { _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16"), _("18"), _("20"), _("22"), _("24"), _("26"), _("28"), _("30"), _("32") }; + int m_choiceCopperLayersNChoices = sizeof( m_choiceCopperLayersChoices ) / sizeof( wxString ); + m_choiceCopperLayers = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCopperLayersNChoices, m_choiceCopperLayersChoices, 0 ); + m_choiceCopperLayers->SetSelection( 0 ); + m_choiceCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); + + bTopSizer->Add( m_choiceCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bTopSizer->Add( 40, 0, 1, wxEXPAND, 5 ); + + m_impedanceControlled = new wxCheckBox( this, wxID_ANY, _("Impedance controlled"), wxDefaultPosition, wxDefaultSize, 0 ); + m_impedanceControlled->SetToolTip( _("If Impedance Controlled option is set,\nLoss tangent and EpsilonR will be added to constraints.") ); + + bTopSizer->Add( m_impedanceControlled, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bTopSizer->Add( 40, 0, 1, wxEXPAND, 5 ); + + m_buttonAddDielectricLayer = new wxButton( this, wxID_ANY, _("Add Dielectric Layer"), wxDefaultPosition, wxDefaultSize, 0 ); + bTopSizer->Add( m_buttonAddDielectricLayer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_buttonRemoveDielectricLayer = new wxButton( this, wxID_ANY, _("Remove Dielectric Layer"), wxDefaultPosition, wxDefaultSize, 0 ); + bTopSizer->Add( m_buttonRemoveDielectricLayer, 0, wxEXPAND|wxALL, 5 ); + + + bMainSizer->Add( bTopSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* m_sizerStackup; + m_sizerStackup = new wxBoxSizer( wxVERTICAL ); + + m_scGridWin = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN|wxHSCROLL|wxVSCROLL ); m_scGridWin->SetScrollRate( 5, 5 ); - m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 2 ); + wxBoxSizer* bMargins; + bMargins = new wxBoxSizer( wxVERTICAL ); + + m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 4 ); m_fgGridSizer->SetFlexibleDirection( wxHORIZONTAL ); m_fgGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -80,129 +115,35 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent m_fgGridSizer->Add( m_staticTextLossTg, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 2 ); - m_scGridWin->SetSizer( m_fgGridSizer ); + bMargins->Add( m_fgGridSizer, 1, wxEXPAND|wxLEFT, 5 ); + + + m_scGridWin->SetSizer( bMargins ); m_scGridWin->Layout(); - m_fgGridSizer->Fit( m_scGridWin ); - bSizer5->Add( m_scGridWin, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + bMargins->Fit( m_scGridWin ); + m_sizerStackup->Add( m_scGridWin, 1, wxEXPAND|wxRIGHT, 10 ); - m_sizerStackup->Add( bSizer5, 3, wxEXPAND, 5 ); + bMainSizer->Add( m_sizerStackup, 3, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); - wxBoxSizer* bSizerRight; - bSizerRight = new wxBoxSizer( wxVERTICAL ); - - wxString m_rbDielectricConstraintChoices[] = { _("No constraint"), _("Impedance controlled") }; - int m_rbDielectricConstraintNChoices = sizeof( m_rbDielectricConstraintChoices ) / sizeof( wxString ); - m_rbDielectricConstraint = new wxRadioBox( this, wxID_ANY, _("Impedance Control"), wxDefaultPosition, wxDefaultSize, m_rbDielectricConstraintNChoices, m_rbDielectricConstraintChoices, 1, wxRA_SPECIFY_COLS ); - m_rbDielectricConstraint->SetSelection( 0 ); - m_rbDielectricConstraint->SetToolTip( _("If Impedance Controlled option is set,\nLoss tangent and EpsilonR will be added to constraints.") ); - - bSizerRight->Add( m_rbDielectricConstraint, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - m_buttonAddDielectricLayer = new wxButton( this, wxID_ANY, _("Add Dielectric Layer"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonAddDielectricLayer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - m_buttonRemoveDielectricLayer = new wxButton( this, wxID_ANY, _("Remove Dielectric Layer"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonRemoveDielectricLayer, 0, wxTOP|wxBOTTOM|wxRIGHT|wxEXPAND, 5 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerRight->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - wxStaticBoxSizer* sbSizerBrdOptions; - sbSizerBrdOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Board Finish") ), wxVERTICAL ); - - m_cbCastellatedPads = new wxCheckBox( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Has castellated pads"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerBrdOptions->Add( m_cbCastellatedPads, 0, wxTOP|wxBOTTOM, 5 ); - - m_cbEgdesPlated = new wxCheckBox( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Plated board edge"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerBrdOptions->Add( m_cbEgdesPlated, 0, wxBOTTOM, 5 ); - - m_staticTextFinish = new wxStaticText( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Copper finish:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextFinish->Wrap( -1 ); - sbSizerBrdOptions->Add( m_staticTextFinish, 0, wxTOP|wxRIGHT, 10 ); - - wxArrayString m_choiceFinishChoices; - m_choiceFinish = new wxChoice( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceFinishChoices, 0 ); - m_choiceFinish->SetSelection( 0 ); - sbSizerBrdOptions->Add( m_choiceFinish, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); - - m_staticTextEdgeConn = new wxStaticText( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Edge card connectors:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextEdgeConn->Wrap( -1 ); - sbSizerBrdOptions->Add( m_staticTextEdgeConn, 0, wxTOP, 10 ); - - wxString m_choiceEdgeConnChoices[] = { _("None"), _("Yes"), _("Yes, bevelled") }; - int m_choiceEdgeConnNChoices = sizeof( m_choiceEdgeConnChoices ) / sizeof( wxString ); - m_choiceEdgeConn = new wxChoice( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceEdgeConnNChoices, m_choiceEdgeConnChoices, 0 ); - m_choiceEdgeConn->SetSelection( 0 ); - m_choiceEdgeConn->SetToolTip( _("Options for edge card connectors.") ); - - sbSizerBrdOptions->Add( m_choiceEdgeConn, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); - - - bSizerRight->Add( sbSizerBrdOptions, 0, wxEXPAND|wxTOP|wxRIGHT, 5 ); - - - bSizerRight->Add( 0, 0, 1, wxEXPAND, 5 ); - - - m_sizerStackup->Add( bSizerRight, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - - bMainSizer->Add( m_sizerStackup, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer6; - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizerBrdThickness; - bSizerBrdThickness = new wxBoxSizer( wxHORIZONTAL ); - - m_lblCopperLayers = new wxStaticText( this, wxID_ANY, _("Copper layers:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lblCopperLayers->Wrap( -1 ); - m_lblCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); - - bSizerBrdThickness->Add( m_lblCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxString m_choiceCopperLayersChoices[] = { _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16"), _("18"), _("20"), _("22"), _("24"), _("26"), _("28"), _("30"), _("32") }; - int m_choiceCopperLayersNChoices = sizeof( m_choiceCopperLayersChoices ) / sizeof( wxString ); - m_choiceCopperLayers = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCopperLayersNChoices, m_choiceCopperLayersChoices, 0 ); - m_choiceCopperLayers->SetSelection( 0 ); - m_choiceCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); - - bSizerBrdThickness->Add( m_choiceCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizerBrdThickness->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bBottomSizer; + bBottomSizer = new wxBoxSizer( wxHORIZONTAL ); m_staticTextCT = new wxStaticText( this, wxID_ANY, _("Board thickness from stackup:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_staticTextCT->Wrap( -1 ); - bSizerBrdThickness->Add( m_staticTextCT, 2, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + bBottomSizer->Add( m_staticTextCT, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_tcCTValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - bSizerBrdThickness->Add( m_tcCTValue, 1, wxALL, 5 ); + bBottomSizer->Add( m_tcCTValue, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( bSizerBrdThickness, 2, wxEXPAND|wxALL, 5 ); - - - bSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer7; - bSizer7 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer7->Add( 0, 0, 1, wxEXPAND, 5 ); + bBottomSizer->Add( 0, 0, 1, wxEXPAND, 5 ); m_buttonExport = new wxButton( this, wxID_ANY, _("Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer7->Add( m_buttonExport, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bBottomSizer->Add( m_buttonExport, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - bSizer7->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer6->Add( bSizer7, 1, wxEXPAND, 5 ); - - - bMainSizer->Add( bSizer6, 0, wxEXPAND, 5 ); + bMainSizer->Add( bBottomSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); this->SetSizer( bMainSizer ); diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp index 03c2606dee..764b7994e2 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp @@ -56,144 +56,453 @@ wxVERTICAL none - 10 - wxEXPAND|wxRIGHT|wxLEFT + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - + + -1,-1 + bTopSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Copper layers: + 0 + + 0 + + + 0 + + 1 + m_lblCopperLayers + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Select the number of copper layers in the stackup + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "2" "4" "6" "8" "10" "12" "14" "16" "18" "20" "22" "24" "26" "28" "30" "32" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceCopperLayers + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Select the number of copper layers in the stackup + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 40 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Impedance controlled + + 0 + + + 0 + + 1 + m_impedanceControlled + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + If Impedance Controlled option is set, Loss tangent and EpsilonR will be added to constraints. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 40 + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Add Dielectric Layer + + 0 + + 0 + + + 0 + + 1 + m_buttonAddDielectricLayer + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onAddDielectricLayer + + + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Remove Dielectric Layer + + 0 + + 0 + + + 0 + + 1 + m_buttonRemoveDielectricLayer + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onRemoveDielectricLayer + onRemoveDielUI + + 5 - wxEXPAND - 1 + wxEXPAND|wxBOTTOM|wxLEFT + 3 m_sizerStackup - wxHORIZONTAL - protected - - 5 - wxEXPAND - 3 - + wxVERTICAL + none + + 10 + wxEXPAND|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 - bSizer5 - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_scGridWin - 1 - - - protected - 1 - - Resizable - 5 - 5 - 1 - - ; ; forward_declare - 0 - - - - wxHSCROLL|wxVSCROLL + 1 + m_scGridWin + 1 + + + protected + 1 + + Resizable + 5 + 5 + 1 + + ; ; forward_declare + 0 + + + + wxBORDER_SUNKEN|wxHSCROLL|wxVSCROLL + + + bMargins + wxVERTICAL + none + + 5 + wxEXPAND|wxLEFT + 1 9 wxHORIZONTAL - 2 + 4 m_fgGridSizer wxFLEX_GROWMODE_SPECIFIED @@ -751,971 +1060,141 @@ - - 5 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - - bSizerRight - wxVERTICAL - none - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "No constraint" "Impedance controlled" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Impedance Control - 1 - - 0 - - - 0 - - 1 - m_rbDielectricConstraint - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - ; ; forward_declare - 0 - If Impedance Controlled option is set, Loss tangent and EpsilonR will be added to constraints. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Add Dielectric Layer - - 0 - - 0 - - - 0 - - 1 - m_buttonAddDielectricLayer - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onAddDielectricLayer - - - - 5 - wxTOP|wxBOTTOM|wxRIGHT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Remove Dielectric Layer - - 0 - - 0 - - - 0 - - 1 - m_buttonRemoveDielectricLayer - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onRemoveDielectricLayer - onRemoveDielUI - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT - 0 - - wxID_ANY - Board Finish - - sbSizerBrdOptions - wxVERTICAL - 1 - none - - 5 - wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Has castellated pads - - 0 - - - 0 - - 1 - m_cbCastellatedPads - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Plated board edge - - 0 - - - 0 - - 1 - m_cbEgdesPlated - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 10 - wxTOP|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copper finish: - 0 - - 0 - - - 0 - - 1 - m_staticTextFinish - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceFinish - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 10 - wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Edge card connectors: - 0 - - 0 - - - 0 - - 1 - m_staticTextEdgeConn - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "None" "Yes" "Yes, bevelled" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceEdgeConn - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - Options for edge card connectors. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 - bSizer6 + bBottomSizer wxHORIZONTAL none - + 5 - wxEXPAND|wxALL - 2 - - -1,-1 - bSizerBrdThickness - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copper layers: - 0 - - 0 - - - 0 - - 1 - m_lblCopperLayers - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Select the number of copper layers in the stackup - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "2" "4" "6" "8" "10" "12" "14" "16" "18" "20" "22" "24" "26" "28" "30" "32" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_choiceCopperLayers - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - Select the number of copper layers in the stackup - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT - 2 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Board thickness from stackup: - 0 - - 0 - - - 0 - - 1 - m_staticTextCT - 1 - - - protected - 1 - - Resizable - 1 - - wxALIGN_RIGHT - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_tcCTValue - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_READONLY - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - onUpdateThicknessValue - - + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Board thickness from stackup: + 0 + + 0 + + + 0 + + 1 + m_staticTextCT + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_RIGHT + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_tcCTValue + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onUpdateThicknessValue @@ -1730,106 +1209,75 @@ 5 - wxEXPAND - 1 - + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Export to Clipboard + + 0 + + 0 + + + 0 - bSizer7 - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Export to Clipboard - - 0 - - 0 - - - 0 - - 1 - m_buttonExport - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onExportToClipboard - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - + 1 + m_buttonExport + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onExportToClipboard diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.h b/pcbnew/board_stackup_manager/panel_board_stackup_base.h index efa19bdc16..d43f4d6876 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.h @@ -10,24 +10,21 @@ #include #include #include -#include +#include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include -#include #include -#include -#include -#include +#include +#include +#include #include #include @@ -42,8 +39,11 @@ class PANEL_SETUP_BOARD_STACKUP_BASE : public wxPanel private: protected: - wxStaticLine* m_staticline; - wxBoxSizer* m_sizerStackup; + wxStaticText* m_lblCopperLayers; + wxChoice* m_choiceCopperLayers; + wxCheckBox* m_impedanceControlled; + wxButton* m_buttonAddDielectricLayer; + wxButton* m_buttonRemoveDielectricLayer; wxScrolledWindow* m_scGridWin; wxFlexGridSizer* m_fgGridSizer; wxStaticText* m_staticTextLayer; @@ -55,18 +55,6 @@ class PANEL_SETUP_BOARD_STACKUP_BASE : public wxPanel wxStaticText* m_staticTextColor; wxStaticText* m_staticTextEpsilonR; wxStaticText* m_staticTextLossTg; - wxRadioBox* m_rbDielectricConstraint; - wxButton* m_buttonAddDielectricLayer; - wxButton* m_buttonRemoveDielectricLayer; - wxStaticLine* m_staticline2; - wxCheckBox* m_cbCastellatedPads; - wxCheckBox* m_cbEgdesPlated; - wxStaticText* m_staticTextFinish; - wxChoice* m_choiceFinish; - wxStaticText* m_staticTextEdgeConn; - wxChoice* m_choiceEdgeConn; - wxStaticText* m_lblCopperLayers; - wxChoice* m_choiceCopperLayers; wxStaticText* m_staticTextCT; wxTextCtrl* m_tcCTValue; wxButton* m_buttonExport; diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index 189ad3e8f6..32effc3115 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -24,6 +24,7 @@ #include #include #include <../board_stackup_manager/panel_board_stackup.h> +#include <../board_stackup_manager/panel_board_finish.h> #include #include #include @@ -58,6 +59,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_tracksAndVias = new PANEL_SETUP_TRACKS_AND_VIAS( this, aFrame, m_constraints ); m_maskAndPaste = new PANEL_SETUP_MASK_AND_PASTE( this, aFrame ); m_physicalStackup = new PANEL_SETUP_BOARD_STACKUP( this, aFrame, m_layers ); + m_boardFinish = new PANEL_SETUP_BOARD_FINISH( this, board ); m_severities = new PANEL_SETUP_SEVERITIES( this, DRC_ITEM::GetItemsWithSeverities(), bds.m_DRCSeverities ); @@ -84,6 +86,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_treebook->AddSubPage( m_physicalStackup, _( "Physical Stackup" ) ); // Change this value if m_physicalStackup is not the page 2 of m_treebook m_physicalStackupPage = 2; // The page number (from 0) to select the m_physicalStackup panel + m_treebook->AddSubPage( m_boardFinish, _( "Board Finish" ) ); m_treebook->AddSubPage( m_maskAndPaste, _( "Solder Mask/Paste" ) ); m_treebook->AddPage( new wxPanel( this ), _( "Text & Graphics" ) ); diff --git a/pcbnew/dialogs/dialog_board_setup.h b/pcbnew/dialogs/dialog_board_setup.h index 13a53d5bf5..65eddb2f6b 100644 --- a/pcbnew/dialogs/dialog_board_setup.h +++ b/pcbnew/dialogs/dialog_board_setup.h @@ -32,6 +32,7 @@ class PANEL_SETUP_RULES; class PANEL_SETUP_TRACKS_AND_VIAS; class PANEL_SETUP_MASK_AND_PASTE; class PANEL_SETUP_BOARD_STACKUP; +class PANEL_SETUP_BOARD_FINISH; class PANEL_SETUP_SEVERITIES; class PANEL_TEXT_VARIABLES; @@ -55,6 +56,7 @@ protected: PANEL_SETUP_TRACKS_AND_VIAS* m_tracksAndVias; PANEL_SETUP_MASK_AND_PASTE* m_maskAndPaste; PANEL_SETUP_BOARD_STACKUP* m_physicalStackup; + PANEL_SETUP_BOARD_FINISH* m_boardFinish; PANEL_SETUP_SEVERITIES* m_severities; PANEL_TEXT_VARIABLES* m_textVars;