Fix some layout issues in board stackup pane.

Also decided the extra paramaters on the right weren't working out
on smaller screens and so moved Board Finish to its own panel.
This commit is contained in:
Jeff Young 2021-02-24 21:20:11 +00:00
parent fa89263c8f
commit d384316335
12 changed files with 1488 additions and 1388 deletions

View File

@ -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

View File

@ -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 <widgets/paged_dialog.h>
#include <pcb_edit_frame.h>
#include <board_stackup_manager/stackup_predefined_prms.h>
#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;
}

View File

@ -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 <board.h>
#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

View File

@ -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 ) );
}

View File

@ -0,0 +1,468 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_board_finish_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">PANEL_BOARD_FINISH_BASE</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_SETUP_BOARD_FINISH_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnUpdateUI">OnUpdateUI</event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Has castellated pads</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbCastellatedPads</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Plated board edge</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbEgdesPlated</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer2</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Copper finish:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextFinish</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">2</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices"></property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceFinish</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Edge card connectors:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextEdgeConn</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">2</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;None&quot; &quot;Yes&quot; &quot;Yes, bevelled&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceEdgeConn</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Options for edge card connectors.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -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 <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// 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();
};

View File

@ -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 );
}

View File

@ -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 );

File diff suppressed because it is too large Load Diff

View File

@ -10,24 +10,21 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/statline.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/sizer.h>
#include <wx/scrolwin.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/statbox.h>
#include <wx/sizer.h>
#include <wx/statbmp.h>
#include <wx/scrolwin.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
@ -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;

View File

@ -24,6 +24,7 @@
#include <panel_setup_tracks_and_vias.h>
#include <panel_setup_mask_and_paste.h>
#include <../board_stackup_manager/panel_board_stackup.h>
#include <../board_stackup_manager/panel_board_finish.h>
#include <confirm.h>
#include <kiface_i.h>
#include <drc/drc_item.h>
@ -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" ) );

View File

@ -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;