pcb_calculator rework: move board class panel to its own files panel_board_class_xx

This commit is contained in:
jean-pierre charras 2021-10-05 10:59:32 +02:00
parent c7faeeabea
commit 187c685c64
11 changed files with 610 additions and 422 deletions

View File

@ -9,13 +9,13 @@ include_directories(
set( PCB_CALCULATOR_SRCS
eserie.cpp
board_classes_values.cpp
common_data.cpp
params_read_write.cpp
pcb_calculator_frame.cpp
pcb_calculator_settings.cpp
datafile_read_write.cpp
panel_attenuators.cpp
panel_board_class.cpp
panel_color_code.cpp
panel_electrical_spacing.cpp
panel_regulator.cpp
@ -37,6 +37,7 @@ set( PCB_CALCULATOR_SRCS
dialogs/dialog_regulator_form_base.cpp
dialogs/dialog_regulator_form.cpp
dialogs/panel_attenuators_base.cpp
dialogs/panel_board_class_base.cpp
dialogs/panel_regulator_base.cpp
dialogs/panel_color_code_base.cpp
dialogs/panel_via_size_base.cpp

View File

@ -0,0 +1,44 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-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 3
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef PANEL_BOARD_CLASS_H
#define PANEL_BOARD_CLASS_H
#include "panel_board_class_base.h"
class PCB_CALCULATOR_SETTINGS;
class PANEL_BOARD_CLASS : public PANEL_BOARD_CLASS_BASE
{
public:
PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_BOARD_CLASS();
void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg );
void OnBoardClassesUnitsSelection( wxCommandEvent& event ) override;
void BoardClassesUpdateData( double aUnitScale );
};
#endif

View File

@ -0,0 +1,106 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/unit_selector.h"
#include "panel_board_class_base.h"
///////////////////////////////////////////////////////////////////////////
PANEL_BOARD_CLASS_BASE::PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bSizerBoardClass;
bSizerBoardClass = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerUnitsMargins;
bSizerUnitsMargins = new wxBoxSizer( wxVERTICAL );
wxArrayString m_BoardClassesUnitsSelectorChoices;
m_BoardClassesUnitsSelector = new UNIT_SELECTOR_LEN( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_BoardClassesUnitsSelectorChoices, 0 );
m_BoardClassesUnitsSelector->SetSelection( 0 );
bSizerUnitsMargins->Add( m_BoardClassesUnitsSelector, 0, wxTOP|wxBOTTOM|wxRIGHT, 32 );
bSizerBoardClass->Add( bSizerUnitsMargins, 0, wxLEFT, 10 );
wxBoxSizer* brdclsSizerRight;
brdclsSizerRight = new wxBoxSizer( wxVERTICAL );
m_staticTextBrdClass = new wxStaticText( this, wxID_ANY, _("Note: Values are minimal values"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBrdClass->Wrap( -1 );
m_staticTextBrdClass->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
brdclsSizerRight->Add( m_staticTextBrdClass, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_gridClassesValuesDisplay = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridClassesValuesDisplay->CreateGrid( 5, 6 );
m_gridClassesValuesDisplay->EnableEditing( false );
m_gridClassesValuesDisplay->EnableGridLines( true );
m_gridClassesValuesDisplay->EnableDragGridSize( false );
m_gridClassesValuesDisplay->SetMargins( 0, 0 );
// Columns
m_gridClassesValuesDisplay->SetColSize( 0, 100 );
m_gridClassesValuesDisplay->SetColSize( 1, 100 );
m_gridClassesValuesDisplay->SetColSize( 2, 100 );
m_gridClassesValuesDisplay->SetColSize( 3, 100 );
m_gridClassesValuesDisplay->SetColSize( 4, 100 );
m_gridClassesValuesDisplay->SetColSize( 5, 100 );
m_gridClassesValuesDisplay->EnableDragColMove( false );
m_gridClassesValuesDisplay->EnableDragColSize( true );
m_gridClassesValuesDisplay->SetColLabelSize( 30 );
m_gridClassesValuesDisplay->SetColLabelValue( 0, _("Class 1") );
m_gridClassesValuesDisplay->SetColLabelValue( 1, _("Class 2") );
m_gridClassesValuesDisplay->SetColLabelValue( 2, _("Class 3") );
m_gridClassesValuesDisplay->SetColLabelValue( 3, _("Class 4") );
m_gridClassesValuesDisplay->SetColLabelValue( 4, _("Class 5") );
m_gridClassesValuesDisplay->SetColLabelValue( 5, _("Class 6") );
m_gridClassesValuesDisplay->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_gridClassesValuesDisplay->SetRowSize( 0, 24 );
m_gridClassesValuesDisplay->SetRowSize( 1, 24 );
m_gridClassesValuesDisplay->SetRowSize( 2, 24 );
m_gridClassesValuesDisplay->SetRowSize( 3, 24 );
m_gridClassesValuesDisplay->SetRowSize( 4, 24 );
m_gridClassesValuesDisplay->EnableDragRowSize( false );
m_gridClassesValuesDisplay->SetRowLabelSize( 160 );
m_gridClassesValuesDisplay->SetRowLabelValue( 0, _("Lines width") );
m_gridClassesValuesDisplay->SetRowLabelValue( 1, _("Min clearance") );
m_gridClassesValuesDisplay->SetRowLabelValue( 2, _("Via: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 3, _("Plated Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 4, _("NP Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_gridClassesValuesDisplay->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
brdclsSizerRight->Add( m_gridClassesValuesDisplay, 0, wxALL|wxEXPAND, 5 );
m_panelShowClassPrms = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
brdclsSizerRight->Add( m_panelShowClassPrms, 1, wxALL|wxEXPAND, 5 );
bSizerBoardClass->Add( brdclsSizerRight, 1, wxEXPAND, 5 );
this->SetSizer( bSizerBoardClass );
this->Layout();
// Connect Events
m_BoardClassesUnitsSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_BOARD_CLASS_BASE::OnBoardClassesUnitsSelection ), NULL, this );
}
PANEL_BOARD_CLASS_BASE::~PANEL_BOARD_CLASS_BASE()
{
// Disconnect Events
m_BoardClassesUnitsSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_BOARD_CLASS_BASE::OnBoardClassesUnitsSelection ), NULL, this );
}

View File

@ -0,0 +1,353 @@
<?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_class_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_class_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_BOARD_CLASS_BASE</property>
<property name="pos"></property>
<property name="size">701,347</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>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerBoardClass</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerUnitsMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">32</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</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_BoardClassesUnitsSelector</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">UNIT_SELECTOR_LEN; widgets/unit_selector.h</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>
<event name="OnChoice">OnBoardClassesUnitsSelection</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">brdclsSizerRight</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</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">,93,92,-1,70,0</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Note: Values are minimal values</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_staticTextBrdClass</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"></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">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxGrid" 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="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_CENTER</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">30</property>
<property name="col_label_values">&quot;Class 1&quot; &quot;Class 2&quot; &quot;Class 3&quot; &quot;Class 4&quot; &quot;Class 5&quot; &quot;Class 6&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">6</property>
<property name="column_sizes">100,100,100,100,100,100</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="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">0</property>
<property name="editing">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">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_gridClassesValuesDisplay</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="row_label_horiz_alignment">wxALIGN_RIGHT</property>
<property name="row_label_size">160</property>
<property name="row_label_values">&quot;Lines width&quot; &quot;Min clearance&quot; &quot;Via: (diam - drill)&quot; &quot;Plated Pad: (diam - drill)&quot; &quot;NP Pad: (diam - drill)&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes">24,24,24,24,24</property>
<property name="rows">5</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></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>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxPanel" 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="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_panelShowClassPrms</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="subclass"></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">wxTAB_TRAVERSAL</property>
</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>
class UNIT_SELECTOR_LEN;
#include <wx/string.h>
#include <wx/choice.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/grid.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_BOARD_CLASS_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_BOARD_CLASS_BASE : public wxPanel
{
private:
protected:
UNIT_SELECTOR_LEN* m_BoardClassesUnitsSelector;
wxStaticText* m_staticTextBrdClass;
wxGrid* m_gridClassesValuesDisplay;
wxPanel* m_panelShowClassPrms;
// Virtual event handlers, overide them in your derived class
virtual void OnBoardClassesUnitsSelection( wxCommandEvent& event ) { event.Skip(); }
public:
PANEL_BOARD_CLASS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 701,347 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_BOARD_CLASS_BASE();
};

View File

@ -680,88 +680,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_Notebook->AddPage( m_panelTrackWidth, _("Track Width"), false );
m_panelElectricalSpacing = new PANEL_ELECTRICAL_SPACING( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_Notebook->AddPage( m_panelElectricalSpacing, _("Electrical Spacing"), false );
m_panelBoardClass = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerBoardClass;
bSizerBoardClass = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerUnitsMargins;
bSizerUnitsMargins = new wxBoxSizer( wxVERTICAL );
wxArrayString m_BoardClassesUnitsSelectorChoices;
m_BoardClassesUnitsSelector = new UNIT_SELECTOR_LEN( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_BoardClassesUnitsSelectorChoices, 0 );
m_BoardClassesUnitsSelector->SetSelection( 0 );
bSizerUnitsMargins->Add( m_BoardClassesUnitsSelector, 0, wxTOP|wxBOTTOM|wxRIGHT, 32 );
bSizerBoardClass->Add( bSizerUnitsMargins, 0, wxLEFT, 10 );
wxBoxSizer* brdclsSizerRight;
brdclsSizerRight = new wxBoxSizer( wxVERTICAL );
m_staticTextBrdClass = new wxStaticText( m_panelBoardClass, wxID_ANY, _("Note: Values are minimal values"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBrdClass->Wrap( -1 );
m_staticTextBrdClass->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
brdclsSizerRight->Add( m_staticTextBrdClass, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_gridClassesValuesDisplay = new wxGrid( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridClassesValuesDisplay->CreateGrid( 5, 6 );
m_gridClassesValuesDisplay->EnableEditing( false );
m_gridClassesValuesDisplay->EnableGridLines( true );
m_gridClassesValuesDisplay->EnableDragGridSize( false );
m_gridClassesValuesDisplay->SetMargins( 0, 0 );
// Columns
m_gridClassesValuesDisplay->SetColSize( 0, 100 );
m_gridClassesValuesDisplay->SetColSize( 1, 100 );
m_gridClassesValuesDisplay->SetColSize( 2, 100 );
m_gridClassesValuesDisplay->SetColSize( 3, 100 );
m_gridClassesValuesDisplay->SetColSize( 4, 100 );
m_gridClassesValuesDisplay->SetColSize( 5, 100 );
m_gridClassesValuesDisplay->EnableDragColMove( false );
m_gridClassesValuesDisplay->EnableDragColSize( true );
m_gridClassesValuesDisplay->SetColLabelSize( 30 );
m_gridClassesValuesDisplay->SetColLabelValue( 0, _("Class 1") );
m_gridClassesValuesDisplay->SetColLabelValue( 1, _("Class 2") );
m_gridClassesValuesDisplay->SetColLabelValue( 2, _("Class 3") );
m_gridClassesValuesDisplay->SetColLabelValue( 3, _("Class 4") );
m_gridClassesValuesDisplay->SetColLabelValue( 4, _("Class 5") );
m_gridClassesValuesDisplay->SetColLabelValue( 5, _("Class 6") );
m_gridClassesValuesDisplay->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_gridClassesValuesDisplay->SetRowSize( 0, 24 );
m_gridClassesValuesDisplay->SetRowSize( 1, 24 );
m_gridClassesValuesDisplay->SetRowSize( 2, 24 );
m_gridClassesValuesDisplay->SetRowSize( 3, 24 );
m_gridClassesValuesDisplay->SetRowSize( 4, 24 );
m_gridClassesValuesDisplay->EnableDragRowSize( false );
m_gridClassesValuesDisplay->SetRowLabelSize( 160 );
m_gridClassesValuesDisplay->SetRowLabelValue( 0, _("Lines width") );
m_gridClassesValuesDisplay->SetRowLabelValue( 1, _("Min clearance") );
m_gridClassesValuesDisplay->SetRowLabelValue( 2, _("Via: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 3, _("Plated Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelValue( 4, _("NP Pad: (diam - drill)") );
m_gridClassesValuesDisplay->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_gridClassesValuesDisplay->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
brdclsSizerRight->Add( m_gridClassesValuesDisplay, 0, wxALL|wxEXPAND, 5 );
m_panelShowClassPrms = new wxPanel( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
brdclsSizerRight->Add( m_panelShowClassPrms, 1, wxALL|wxEXPAND, 5 );
bSizerBoardClass->Add( brdclsSizerRight, 1, wxEXPAND, 5 );
m_panelBoardClass->SetSizer( bSizerBoardClass );
m_panelBoardClass->Layout();
bSizerBoardClass->Fit( m_panelBoardClass );
m_panelBoardClass = new PANEL_BOARD_CLASS( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_Notebook->AddPage( m_panelBoardClass, _("Board Classes"), false );
bmainFrameSizer->Add( m_Notebook, 1, wxEXPAND, 5 );
@ -790,7 +709,6 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_SynthetizeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTransLineResetButtonClick ), NULL, this );
m_BoardClassesUnitsSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnBoardClassesUnitsSelection ), NULL, this );
}
PCB_CALCULATOR_FRAME_BASE::~PCB_CALCULATOR_FRAME_BASE()
@ -812,6 +730,5 @@ PCB_CALCULATOR_FRAME_BASE::~PCB_CALCULATOR_FRAME_BASE()
m_SynthetizeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_bpButtonSynthetize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTranslineSynthetize ), NULL, this );
m_buttonTransLineReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnTransLineResetButtonClick ), NULL, this );
m_BoardClassesUnitsSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PCB_CALCULATOR_FRAME_BASE::OnBoardClassesUnitsSelection ), NULL, this );
}

View File

@ -7881,11 +7881,11 @@
<property name="window_style">wxTAB_TRAVERSAL</property>
</object>
</object>
<object class="notebookpage" expanded="0">
<object class="notebookpage" expanded="1">
<property name="bitmap"></property>
<property name="label">Board Classes</property>
<property name="select">0</property>
<object class="wxPanel" expanded="0">
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -7901,7 +7901,7 @@
<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="context_menu">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
@ -7930,311 +7930,12 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="subclass">PANEL_BOARD_CLASS; panel_board_class.h; Not 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">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizerBoardClass</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizerUnitsMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">32</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</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_BoardClassesUnitsSelector</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">UNIT_SELECTOR_LEN; widgets/unit_selector.h</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>
<event name="OnChoice">OnBoardClassesUnitsSelection</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">brdclsSizerRight</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</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">,93,92,-1,70,0</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Note: Values are minimal values</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_staticTextBrdClass</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"></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">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxGrid" 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="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_CENTER</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">30</property>
<property name="col_label_values">&quot;Class 1&quot; &quot;Class 2&quot; &quot;Class 3&quot; &quot;Class 4&quot; &quot;Class 5&quot; &quot;Class 6&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">6</property>
<property name="column_sizes">100,100,100,100,100,100</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="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">0</property>
<property name="editing">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">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_gridClassesValuesDisplay</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="row_label_horiz_alignment">wxALIGN_RIGHT</property>
<property name="row_label_size">160</property>
<property name="row_label_values">&quot;Lines width&quot; &quot;Min clearance&quot; &quot;Via: (diam - drill)&quot; &quot;Plated Pad: (diam - drill)&quot; &quot;NP Pad: (diam - drill)&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes">24,24,24,24,24</property>
<property name="rows">5</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></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>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxPanel" 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="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_panelShowClassPrms</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="subclass"></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">wxTAB_TRAVERSAL</property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>

View File

@ -21,6 +21,7 @@ class UNIT_SELECTOR_RESISTOR;
#include "panel_via_size.h"
#include "panel_track_width.h"
#include "panel_electrical_spacing.h"
#include "panel_board_class.h"
#include "kiway_player.h"
#include <wx/string.h>
#include <wx/menu.h>
@ -44,7 +45,6 @@ class UNIT_SELECTOR_RESISTOR;
#include <wx/statbmp.h>
#include <wx/choice.h>
#include <wx/bmpbuttn.h>
#include <wx/grid.h>
#include <wx/notebook.h>
#include <wx/frame.h>
@ -178,11 +178,7 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER
PANEL_VIA_SIZE* m_panelViaSize;
PANEL_TRACK_WIDTH* m_panelTrackWidth;
PANEL_ELECTRICAL_SPACING* m_panelElectricalSpacing;
wxPanel* m_panelBoardClass;
UNIT_SELECTOR_LEN* m_BoardClassesUnitsSelector;
wxStaticText* m_staticTextBrdClass;
wxGrid* m_gridClassesValuesDisplay;
wxPanel* m_panelShowClassPrms;
PANEL_BOARD_CLASS* m_panelBoardClass;
// Virtual event handlers, overide them in your derived class
virtual void OnClosePcbCalc( wxCloseEvent& event ) { event.Skip(); }
@ -196,7 +192,6 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER
virtual void OnTranslineAnalyse( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTranslineSynthetize( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTransLineResetButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBoardClassesUnitsSelection( wxCommandEvent& event ) { event.Skip(); }
public:

View File

@ -1,8 +1,8 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2015 jean-pierre.charras
* Copyright (C) 2015 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2011 jean-pierre.charras
* Copyright (C) 1992-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
@ -18,12 +18,40 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wx/app.h>
#include <wx/msgdlg.h>
#include "pcb_calculator_frame.h"
//#include <string_utils.h>
#include "pcb_calculator_settings.h"
#include <panel_board_class.h>
#include <widgets/unit_selector.h>
#include "units_scales.h"
PANEL_BOARD_CLASS::PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style, const wxString& name ) :
PANEL_BOARD_CLASS_BASE( parent, id, pos, size, style, name )
{
// Autosize the row label column to be sure label are not truncated
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
}
PANEL_BOARD_CLASS::~PANEL_BOARD_CLASS()
{
}
void PANEL_BOARD_CLASS::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
aCfg->m_BoardClassUnits = m_BoardClassesUnitsSelector->GetSelection();
}
void PANEL_BOARD_CLASS::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{
m_BoardClassesUnitsSelector->SetSelection( aCfg->m_BoardClassUnits );
BoardClassesUpdateData( m_BoardClassesUnitsSelector->GetUnitScale() );
}
// A helper class to handle min values
// Values are in meters.
// Note : use -1.0 when a value is irrelevant in a class
@ -83,52 +111,52 @@ static BOARD_MIN_SIZE_VALUES clist[BRDCLASS_COUNT] =
};
void PCB_CALCULATOR_FRAME::OnBoardClassesUnitsSelection( wxCommandEvent& event )
void PANEL_BOARD_CLASS::OnBoardClassesUnitsSelection( wxCommandEvent& event )
{
BoardClassesUpdateData( m_BoardClassesUnitsSelector->GetUnitScale() );
}
void PCB_CALCULATOR_FRAME::BoardClassesUpdateData( double aUnitScale )
void PANEL_BOARD_CLASS::BoardClassesUpdateData( double aUnitScale )
{
wxString txt;
#define FMT wxT("%g")
#define NOVAL wxT("--")
#define NO_VALUE wxT("--")
for( int ii = 0; ii < BRDCLASS_COUNT; ii ++ )
{
// Display min tracks width
if( clist[ii].m_Lines > -1.0 )
txt.Printf( FMT, clist[ii].m_Lines / aUnitScale);
else
txt = NOVAL;
txt = NO_VALUE;
m_gridClassesValuesDisplay->SetCellValue(0, ii, txt );
// Display min clearance
if( clist[ii].m_Clearance > -1.0 )
txt.Printf( FMT, clist[ii].m_Clearance / aUnitScale);
else
txt = NOVAL;
txt = NO_VALUE;
m_gridClassesValuesDisplay->SetCellValue(1, ii, txt );
// Display min Via diam diff
if( clist[ii].m_ViaDiamDiff > -1.0 )
txt.Printf( FMT, clist[ii].m_ViaDiamDiff / aUnitScale);
else
txt = NOVAL;
txt = NO_VALUE;
m_gridClassesValuesDisplay->SetCellValue(2, ii, txt );
// Display min Pad diam diff (plated)
if( clist[ii].m_PadDiamDiffPlated > -1.0 )
txt.Printf( FMT, clist[ii].m_PadDiamDiffPlated / aUnitScale);
else
txt = NOVAL;
txt = NO_VALUE;
m_gridClassesValuesDisplay->SetCellValue(3, ii, txt );
// Display min Pad diam diff (non plated)
if( clist[ii].m_PadDiamDiffNotPlated > -1.0 )
txt.Printf( FMT, clist[ii].m_PadDiamDiffNotPlated / aUnitScale);
else
txt = NOVAL;
txt = NO_VALUE;
m_gridClassesValuesDisplay->SetCellValue(4, ii, txt );
}
}
}

View File

@ -76,8 +76,6 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
initESeriesPanel();
BoardClassesUpdateData( m_BoardClassesUnitsSelector->GetUnitScale() );
// Give an icon
wxIcon icon;
wxIconBundle icon_bundle;
@ -91,9 +89,6 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetIcons( icon_bundle );
// Autosize the row label column to be sure label are not truncated
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
GetSizer()->SetSizeHints( this );
// Set previous size and position
@ -220,7 +215,6 @@ void PCB_CALCULATOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
m_currTransLineType = static_cast<TRANSLINE_TYPE_ID>( cfg->m_TransLine.type );
m_Notebook->ChangeSelection( cfg->m_LastPage );
m_BoardClassesUnitsSelector->SetSelection( cfg->m_BoardClassUnits );
// Attenuators panel config:
m_panelAttenuators->LoadSettings( cfg );
@ -237,6 +231,7 @@ void PCB_CALCULATOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
m_panelViaSize->LoadSettings( cfg );
m_panelTrackWidth->LoadSettings( cfg );
m_panelElectricalSpacing->LoadSettings( cfg );
m_panelBoardClass->LoadSettings( cfg );
}
@ -254,7 +249,6 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
{
cfg->m_LastPage = m_Notebook->GetSelection();
cfg->m_TransLine.type = m_currTransLineType;
cfg->m_BoardClassUnits = m_BoardClassesUnitsSelector->GetSelection();
m_panelRegulators->Regulators_WriteConfig( cfg );
m_panelAttenuators->SaveSettings( cfg );
@ -262,6 +256,7 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
m_panelViaSize->SaveSettings( cfg );
m_panelTrackWidth->SaveSettings( cfg );
m_panelElectricalSpacing->SaveSettings( cfg );
m_panelBoardClass->SaveSettings( cfg );
}

View File

@ -79,10 +79,6 @@ public:
*/
bool IsPrmSelected( enum PRMS_ID aPrmId ) const;
// Board classes panel:
void OnBoardClassesUnitsSelection( wxCommandEvent& event ) override;
void BoardClassesUpdateData( double aUnitScale );
// Calculator doesn't host a tool framework
wxWindow* GetToolCanvas() const override
{