Simplify code.
This commit is contained in:
parent
7ca951c89a
commit
f5f98f0174
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 jean-pierre.charras
|
* Copyright (C) 2011 jean-pierre.charras
|
||||||
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -23,9 +23,8 @@
|
||||||
#include <widgets/unit_selector.h>
|
#include <widgets/unit_selector.h>
|
||||||
#include <units_scales.h>
|
#include <units_scales.h>
|
||||||
|
|
||||||
PANEL_BOARD_CLASS::PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id,
|
PANEL_BOARD_CLASS::PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxSize& size, long style, const wxString& name ) :
|
||||||
long style, const wxString& name ) :
|
|
||||||
PANEL_BOARD_CLASS_BASE( parent, id, pos, size, style, name )
|
PANEL_BOARD_CLASS_BASE( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
// Autosize the row label column to be sure label are not truncated
|
// Autosize the row label column to be sure label are not truncated
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* 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.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,9 +29,8 @@ class PANEL_BOARD_CLASS : public PANEL_BOARD_CLASS_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
|
||||||
~PANEL_BOARD_CLASS();
|
~PANEL_BOARD_CLASS();
|
||||||
|
|
||||||
// Methods from CALCULATOR_PANEL that must be overridden
|
// Methods from CALCULATOR_PANEL that must be overridden
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2011 jean-pierre.charras
|
* Copyright (C) 1992-2011 jean-pierre.charras
|
||||||
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -23,9 +23,8 @@
|
||||||
#include <pcb_calculator_settings.h>
|
#include <pcb_calculator_settings.h>
|
||||||
|
|
||||||
|
|
||||||
PANEL_COLOR_CODE::PANEL_COLOR_CODE( wxWindow* parent, wxWindowID id,
|
PANEL_COLOR_CODE::PANEL_COLOR_CODE( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxSize& size, long style, const wxString& name ) :
|
||||||
long style, const wxString& name ) :
|
|
||||||
PANEL_COLOR_CODE_BASE( parent, id, pos, size, style, name )
|
PANEL_COLOR_CODE_BASE( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
ToleranceSelection( m_rbToleranceSelection->GetSelection() );
|
ToleranceSelection( m_rbToleranceSelection->GetSelection() );
|
||||||
|
|
|
@ -28,9 +28,8 @@ class PANEL_COLOR_CODE : public PANEL_COLOR_CODE_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_COLOR_CODE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_COLOR_CODE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
|
||||||
~PANEL_COLOR_CODE();
|
~PANEL_COLOR_CODE();
|
||||||
|
|
||||||
void OnToleranceSelection( wxCommandEvent& event ) override;
|
void OnToleranceSelection( wxCommandEvent& event ) override;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* 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.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,9 +29,9 @@ class PANEL_ELECTRICAL_SPACING : public PANEL_ELECTRICAL_SPACING_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_ELECTRICAL_SPACING( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_ELECTRICAL_SPACING( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
~PANEL_ELECTRICAL_SPACING();
|
~PANEL_ELECTRICAL_SPACING();
|
||||||
|
|
||||||
// Methods from CALCULATOR_PANEL that must be overridden
|
// Methods from CALCULATOR_PANEL that must be overridden
|
||||||
|
|
|
@ -33,8 +33,9 @@ CORROSION_TABLE_ENTRY::CORROSION_TABLE_ENTRY( const wxString& aName, const wxStr
|
||||||
m_potential = aPotential;
|
m_potential = aPotential;
|
||||||
}
|
}
|
||||||
|
|
||||||
PANEL_GALVANIC_CORROSION::PANEL_GALVANIC_CORROSION( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
PANEL_GALVANIC_CORROSION::PANEL_GALVANIC_CORROSION( wxWindow* parent, wxWindowID id,
|
||||||
const wxSize& size, long style, const wxString& name ) :
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
long style, const wxString& name ) :
|
||||||
PANEL_GALVANIC_CORROSION_BASE( parent, id, pos, size, style, name )
|
PANEL_GALVANIC_CORROSION_BASE( parent, id, pos, size, style, name )
|
||||||
{
|
{
|
||||||
m_entries.clear();
|
m_entries.clear();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2011 jean-pierre.charras
|
* Copyright (C) 1992-2011 jean-pierre.charras
|
||||||
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -18,9 +18,6 @@
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
//#include <macros.h>
|
|
||||||
|
|
||||||
#include <wx/choicdlg.h>
|
#include <wx/choicdlg.h>
|
||||||
#include <wx/filedlg.h>
|
#include <wx/filedlg.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
|
@ -37,9 +34,8 @@ extern double DoubleFromString( const wxString& TextValue );
|
||||||
static const wxString DataFileNameExt( wxT( "pcbcalc" ) );
|
static const wxString DataFileNameExt( wxT( "pcbcalc" ) );
|
||||||
|
|
||||||
|
|
||||||
PANEL_REGULATOR::PANEL_REGULATOR( wxWindow* parent, wxWindowID id,
|
PANEL_REGULATOR::PANEL_REGULATOR( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxSize& size, long style, const wxString& name ) :
|
||||||
long style, const wxString& name ) :
|
|
||||||
PANEL_REGULATOR_BASE( parent, id, pos, size, style, name ),
|
PANEL_REGULATOR_BASE( parent, id, pos, size, style, name ),
|
||||||
m_RegulatorListChanged( false )
|
m_RegulatorListChanged( false )
|
||||||
{
|
{
|
||||||
|
@ -155,11 +151,11 @@ void PANEL_REGULATOR::OnDataFileSelection( wxCommandEvent& event )
|
||||||
wxString fullfilename = GetDataFilename();
|
wxString fullfilename = GetDataFilename();
|
||||||
|
|
||||||
wxString wildcard;
|
wxString wildcard;
|
||||||
wildcard.Printf( _("PCB Calculator data file" ) + wxT( " (*.%s)|*.%s"),
|
wildcard.Printf( _( "PCB Calculator data file" ) + wxT( " (*.%s)|*.%s" ),
|
||||||
DataFileNameExt, DataFileNameExt );
|
DataFileNameExt, DataFileNameExt );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _("Select PCB Calculator Data File"),
|
wxFileDialog dlg( this, _( "Select PCB Calculator Data File" ), wxEmptyString, fullfilename,
|
||||||
wxEmptyString, fullfilename, wildcard, wxFD_OPEN );
|
wildcard, wxFD_OPEN );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
@ -190,7 +186,7 @@ void PANEL_REGULATOR::OnDataFileSelection( wxCommandEvent& event )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _("Unable to read data file '%s'."), fullfilename );
|
msg.Printf( _( "Unable to read data file '%s'." ), fullfilename );
|
||||||
wxMessageBox( msg );
|
wxMessageBox( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,7 +214,7 @@ void PANEL_REGULATOR::OnAddRegulator( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxMessageBox( _("This regulator is already in list. Aborted") );
|
wxMessageBox( _( "This regulator is already in list. Aborted" ) );
|
||||||
delete new_item;
|
delete new_item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +246,7 @@ void PANEL_REGULATOR::OnEditRegulator( wxCommandEvent& event )
|
||||||
|
|
||||||
void PANEL_REGULATOR::OnRemoveRegulator( wxCommandEvent& event )
|
void PANEL_REGULATOR::OnRemoveRegulator( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxString name = wxGetSingleChoice( _("Remove Regulator"), wxEmptyString,
|
wxString name = wxGetSingleChoice( _( "Remove Regulator" ), wxEmptyString,
|
||||||
m_RegulatorList.GetRegList() );
|
m_RegulatorList.GetRegList() );
|
||||||
if( name.IsEmpty() )
|
if( name.IsEmpty() )
|
||||||
return;
|
return;
|
||||||
|
@ -335,7 +331,7 @@ void PANEL_REGULATOR::RegulatorsSolve()
|
||||||
// Some tests:
|
// Some tests:
|
||||||
if( vout < vref && id != 2 )
|
if( vout < vref && id != 2 )
|
||||||
{
|
{
|
||||||
m_RegulMessage->SetLabel( _("Vout must be greater than vref" ) );
|
m_RegulMessage->SetLabel( _( "Vout must be greater than vref" ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +343,7 @@ void PANEL_REGULATOR::RegulatorsSolve()
|
||||||
|
|
||||||
if( ( r1 < 0 && id != 0 ) || ( r2 <= 0 && id != 1 ) )
|
if( ( r1 < 0 && id != 0 ) || ( r2 <= 0 && id != 1 ) )
|
||||||
{
|
{
|
||||||
m_RegulMessage->SetLabel( _("Incorrect value for R1 R2" ) );
|
m_RegulMessage->SetLabel( _( "Incorrect value for R1 R2" ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,7 @@ class PANEL_REGULATOR : public PANEL_REGULATOR_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_REGULATOR( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_REGULATOR( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
~PANEL_REGULATOR();
|
~PANEL_REGULATOR();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* 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.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,9 +31,9 @@ class PANEL_RF_ATTENUATORS : public PANEL_RF_ATTENUATORS_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_RF_ATTENUATORS( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_RF_ATTENUATORS( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
~PANEL_RF_ATTENUATORS();
|
~PANEL_RF_ATTENUATORS();
|
||||||
|
|
||||||
wxRadioBox* GetAttenuatorsSelector() { return m_AttenuatorsSelection; }
|
wxRadioBox* GetAttenuatorsSelector() { return m_AttenuatorsSelection; }
|
||||||
|
|
|
@ -29,9 +29,8 @@ class PANEL_TRACK_WIDTH : public PANEL_TRACK_WIDTH_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_TRACK_WIDTH( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_TRACK_WIDTH( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
|
||||||
~PANEL_TRACK_WIDTH();
|
~PANEL_TRACK_WIDTH();
|
||||||
|
|
||||||
// Methods from CALCULATOR_PANEL that must be overridden
|
// Methods from CALCULATOR_PANEL that must be overridden
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 jean-pierre.charras
|
* Copyright (C) 2011 jean-pierre.charras
|
||||||
* Copyright (C) 1992-2022 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -26,9 +26,8 @@
|
||||||
#include <widgets/std_bitmap_button.h>
|
#include <widgets/std_bitmap_button.h>
|
||||||
|
|
||||||
|
|
||||||
PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id,
|
PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxSize& size, long style, const wxString& name ) :
|
||||||
long style, const wxString& name ) :
|
|
||||||
PANEL_TRANSLINE_BASE( parent, id, pos, size, style, name ),
|
PANEL_TRANSLINE_BASE( parent, id, pos, size, style, name ),
|
||||||
m_currTransLine( nullptr ),
|
m_currTransLine( nullptr ),
|
||||||
m_currTransLineType( DEFAULT_TYPE )
|
m_currTransLineType( DEFAULT_TYPE )
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* 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.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,8 +31,7 @@ class PANEL_TRANSLINE : public PANEL_TRANSLINE_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_TRANSLINE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_TRANSLINE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
~PANEL_TRANSLINE();
|
~PANEL_TRANSLINE();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2022 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,9 +29,8 @@ class PANEL_VIA_SIZE : public PANEL_VIA_SIZE_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PANEL_VIA_SIZE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
PANEL_VIA_SIZE( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const wxSize& size = wxDefaultSize,
|
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
||||||
long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
|
|
||||||
~PANEL_VIA_SIZE();
|
~PANEL_VIA_SIZE();
|
||||||
|
|
||||||
// Methods from CALCULATOR_PANEL that must be overridden
|
// Methods from CALCULATOR_PANEL that must be overridden
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||||
_HKI( "You can use the this calculator to check if a small track can handle a large current for a short period of time.<br>\n"
|
_HKI( "You can use this calculator to check if a small track can handle a large current for a short period of time.<br>\n"
|
||||||
"This tool allows you to design a track fuse but should be used as an estimate only.\n"
|
"This tool allows you to design a track fuse but should be used as an estimate only.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"The calculator estimates the energy required to heat the wire up<br>\n"
|
"The calculator estimates the energy required to heat the wire up<br>\n"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2015 jean-pierre.charras
|
* Copyright (C) 1992-2015 jean-pierre.charras
|
||||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -17,7 +17,6 @@
|
||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License along
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <wx/menu.h>
|
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
#include <wx/treebook.h>
|
#include <wx/treebook.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
|
@ -28,7 +27,6 @@
|
||||||
#include <bitmap_store.h>
|
#include <bitmap_store.h>
|
||||||
#include <geometry/shape_poly_set.h>
|
#include <geometry/shape_poly_set.h>
|
||||||
#include <kiface_base.h>
|
#include <kiface_base.h>
|
||||||
|
|
||||||
#include <attenuators/attenuator_classes.h>
|
#include <attenuators/attenuator_classes.h>
|
||||||
#include <pcb_calculator_frame.h>
|
#include <pcb_calculator_frame.h>
|
||||||
#include <pcb_calculator_settings.h>
|
#include <pcb_calculator_settings.h>
|
||||||
|
@ -49,12 +47,9 @@
|
||||||
|
|
||||||
|
|
||||||
PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
KIWAY_PLAYER( aParent, wxID_ANY,
|
KIWAY_PLAYER( aParent, wxID_ANY, _( "Calculator Tools" ), wxDefaultPosition, wxSize( 646, 361 ),
|
||||||
_( "Calculator Tools" ), // Window title
|
wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL,
|
||||||
wxDefaultPosition,
|
wxT( "calculator_tools" ) ),
|
||||||
wxSize( 646,361 ), // Default size
|
|
||||||
wxDEFAULT_FRAME_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE | wxTAB_TRAVERSAL,
|
|
||||||
wxT( "calculator_tools" ) ), // Window name
|
|
||||||
m_lastNotebookPage( -1 )
|
m_lastNotebookPage( -1 )
|
||||||
{
|
{
|
||||||
SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
|
SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
|
||||||
|
@ -64,59 +59,40 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
|
|
||||||
SetSizeHints( wxDefaultSize, wxDefaultSize );
|
SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||||
|
|
||||||
|
|
||||||
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
|
|
||||||
m_treebook = new wxTreebook( this, wxID_ANY );
|
m_treebook = new wxTreebook( this, wxID_ANY );
|
||||||
m_treebook->SetFont( KIUI::GetControlFont( this ) );
|
m_treebook->SetFont( KIUI::GetControlFont( this ) );
|
||||||
m_mainSizer->Add( m_treebook, 1, wxEXPAND | wxLEFT | wxTOP, 0 );
|
m_mainSizer->Add( m_treebook, 1, wxEXPAND | wxLEFT | wxTOP, 0 );
|
||||||
|
|
||||||
|
|
||||||
SetSizer( m_mainSizer );
|
SetSizer( m_mainSizer );
|
||||||
Layout();
|
Layout();
|
||||||
Centre( wxBOTH );
|
Centre( wxBOTH );
|
||||||
|
|
||||||
m_treebook->AddPage( nullptr, _( "General system design" ) );
|
m_treebook->AddPage( nullptr, _( "General system design" ) );
|
||||||
|
|
||||||
AddCalculator( new PANEL_REGULATOR( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_REGULATOR( m_treebook ), _( "Regulators" ) );
|
||||||
_( "Regulators" ) );
|
|
||||||
|
|
||||||
m_treebook->AddPage( nullptr, _( "Power, current and isolation" ) );
|
m_treebook->AddPage( nullptr, _( "Power, current and isolation" ) );
|
||||||
|
|
||||||
AddCalculator( new PANEL_ELECTRICAL_SPACING( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_ELECTRICAL_SPACING( m_treebook ), _( "Electrical Spacing" ) );
|
||||||
_( "Electrical Spacing" ) );
|
AddCalculator( new PANEL_VIA_SIZE( m_treebook ), _( "Via Size" ) );
|
||||||
AddCalculator( new PANEL_VIA_SIZE( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_TRACK_WIDTH( m_treebook ), _( "Track Width" ) );
|
||||||
_( "Via Size" ) );
|
AddCalculator( new PANEL_FUSING_CURRENT( m_treebook ), _( "Fusing Current" ) );
|
||||||
AddCalculator( new PANEL_TRACK_WIDTH( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_CABLE_SIZE( m_treebook ), _( "Cable Size" ) );
|
||||||
_( "Track Width" ) );
|
|
||||||
AddCalculator( new PANEL_FUSING_CURRENT( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
|
||||||
wxTAB_TRAVERSAL ),
|
|
||||||
_( "Fusing Current" ) );
|
|
||||||
AddCalculator( new PANEL_CABLE_SIZE( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
|
||||||
wxTAB_TRAVERSAL ),
|
|
||||||
_( "Cable Size" ) );
|
|
||||||
|
|
||||||
m_treebook->AddPage( nullptr, _( "High speed" ) );
|
m_treebook->AddPage( nullptr, _( "High speed" ) );
|
||||||
|
|
||||||
AddCalculator( new PANEL_WAVELENGTH( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
AddCalculator( new PANEL_WAVELENGTH( m_treebook ), _( "Wavelength" ) );
|
||||||
wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_RF_ATTENUATORS( m_treebook ), _( "RF Attenuators" ) );
|
||||||
_( "Wavelength" ) );
|
AddCalculator( new PANEL_TRANSLINE( m_treebook ), _( "Transmission Lines") );
|
||||||
AddCalculator( new PANEL_RF_ATTENUATORS( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
|
||||||
_( "RF Attenuators" ) );
|
|
||||||
AddCalculator( new PANEL_TRANSLINE( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
|
||||||
_( "Transmission Lines") );
|
|
||||||
|
|
||||||
m_treebook->AddPage( nullptr, _( "Memo" ) );
|
m_treebook->AddPage( nullptr, _( "Memo" ) );
|
||||||
|
|
||||||
AddCalculator( new PANEL_E_SERIES( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_E_SERIES( m_treebook ), _( "E-Series" ) );
|
||||||
_( "E-Series" ) );
|
AddCalculator( new PANEL_COLOR_CODE( m_treebook ), _( "Color Code" ) );
|
||||||
AddCalculator( new PANEL_COLOR_CODE( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
AddCalculator( new PANEL_BOARD_CLASS( m_treebook ), _("Board Classes") );
|
||||||
_( "Color Code" ) );
|
AddCalculator( new PANEL_GALVANIC_CORROSION( m_treebook ), _( "Galvanic Corrosion" ) );
|
||||||
AddCalculator( new PANEL_BOARD_CLASS( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
|
||||||
_("Board Classes") );
|
|
||||||
AddCalculator( new PANEL_GALVANIC_CORROSION( m_treebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ),
|
|
||||||
_( "Galvanic Corrosion" ) );
|
|
||||||
|
|
||||||
LoadSettings( config() );
|
LoadSettings( config() );
|
||||||
|
|
||||||
|
@ -212,7 +188,7 @@ void PCB_CALCULATOR_FRAME::OnUpdateUI( wxUpdateUIEvent& event )
|
||||||
// Kick all the things that wxWidgets can't seem to redraw on its own.
|
// Kick all the things that wxWidgets can't seem to redraw on its own.
|
||||||
// This is getting seriously ridiculous....
|
// This is getting seriously ridiculous....
|
||||||
PANEL_TRANSLINE* translinePanel = GetCalculator<PANEL_TRANSLINE>();
|
PANEL_TRANSLINE* translinePanel = GetCalculator<PANEL_TRANSLINE>();
|
||||||
PANEL_RF_ATTENUATORS* attenPanel = GetCalculator<PANEL_RF_ATTENUATORS>();
|
PANEL_RF_ATTENUATORS* attenPanel = GetCalculator<PANEL_RF_ATTENUATORS>();
|
||||||
PANEL_VIA_SIZE* viaSizePanel = GetCalculator<PANEL_VIA_SIZE>();
|
PANEL_VIA_SIZE* viaSizePanel = GetCalculator<PANEL_VIA_SIZE>();
|
||||||
PANEL_REGULATOR* regulPanel = GetCalculator<PANEL_REGULATOR>();
|
PANEL_REGULATOR* regulPanel = GetCalculator<PANEL_REGULATOR>();
|
||||||
PANEL_ELECTRICAL_SPACING* elecSpacingPanel = GetCalculator<PANEL_ELECTRICAL_SPACING>();
|
PANEL_ELECTRICAL_SPACING* elecSpacingPanel = GetCalculator<PANEL_ELECTRICAL_SPACING>();
|
||||||
|
@ -304,7 +280,7 @@ void PCB_CALCULATOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
m_treebook->ChangeSelection( cfg->m_LastPage );
|
m_treebook->ChangeSelection( cfg->m_LastPage );
|
||||||
|
|
||||||
for( auto& panel : m_panels )
|
for( CALCULATOR_PANEL* panel : m_panels )
|
||||||
panel->LoadSettings( cfg );
|
panel->LoadSettings( cfg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +299,7 @@ void PCB_CALCULATOR_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
{
|
{
|
||||||
cfg->m_LastPage = m_treebook->GetSelection();
|
cfg->m_LastPage = m_treebook->GetSelection();
|
||||||
|
|
||||||
for( auto& panel : m_panels )
|
for( CALCULATOR_PANEL* panel : m_panels )
|
||||||
panel->SaveSettings( cfg );
|
panel->SaveSettings( cfg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue