KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_transline.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KICAD, a free EDA CAD application.
3 *
4 * Copyright (C) 2011 jean-pierre.charras
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21
22#include "transline_ident.h"
23#include <bitmaps.h>
28#include <properties/property.h>
29
30
31PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id, const wxPoint& pos,
32 const wxSize& size, long style, const wxString& name ) :
33 PANEL_TRANSLINE_BASE( parent, id, pos, size, style, name ),
34 m_currTransLine( nullptr ),
36{
39
40
41 // Populate transline list ordered like in dialog menu list
42 const static TRANSLINE_TYPE_ID tltype_list[9] = { MICROSTRIP_TYPE, C_MICROSTRIP_TYPE, STRIPLINE_TYPE,
45
46 for( int ii = 0; ii < 9; ii++ )
47 m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
48
49 m_EpsilonR_label->SetLabel( wxT( "εr" ) );
50 m_substrate_prm3_labelUnit->SetLabel( wxT( "Ω ∙ m" ) );
51}
52
53
55{
56 for( TRANSLINE_IDENT* transline : m_transline_list )
57 delete transline;
58}
59
60
68
69
71{
72 // Ensure parameters from current selection are up to date before saving
73 if( m_currTransLine )
75
77
78 for( TRANSLINE_IDENT* transline : m_transline_list )
79 transline->WriteConfig();
80}
81
82
84{
86
87 for( TRANSLINE_IDENT* transline : m_transline_list )
88 transline->ReadConfig();
89
92
93 // Needed on wxWidgets 3.0 to ensure sizers are correctly set
94 // It also remove a minor cosmetic issue on wxWidgets 3.5 on MSW
95 // Called here after the current selected transline bitmaps are enabled/disabled
96 GetSizer()->SetSizeHints( this );
97}
98
99
100
101void PANEL_TRANSLINE::OnTranslineAnalyse( wxCommandEvent& event )
102{
103 if( m_currTransLine )
104 {
106 m_currTransLine->analyze();
107 }
108}
109
110
111void PANEL_TRANSLINE::OnTranslineSynthetize( wxCommandEvent& event )
112{
113 if( m_currTransLine )
114 {
116 m_currTransLine->synthesize();
117 }
118}
const char * name
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:110
PANEL_TRANSLINE_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)
wxStaticText * m_EpsilonR_label
wxStaticText * m_substrate_prm3_labelUnit
wxStaticBitmap * m_translineBitmap
STD_BITMAP_BUTTON * m_bpButtonSynthetize
STD_BITMAP_BUTTON * m_bpButtonAnalyze
void OnTranslineSynthetize(wxCommandEvent &event) override
Run a new synthesis for the current transline with current parameters and displays the geometrical pa...
TRANSLINE * m_currTransLine
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
Must be called after selection of a new transline.
void TransfDlgDataToTranslineParams()
Read values entered in dialog frame, and transfer these values in current transline parameters,...
std::vector< TRANSLINE_IDENT * > m_transline_list
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
PANEL_TRANSLINE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
enum TRANSLINE_TYPE_ID m_currTransLineType
void OnTranslineAnalyse(wxCommandEvent &event) override
Run a new analyze for the current transline with current parameters and displays the electrical param...
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
A class to handle a list of parameters of a given transline.
TRANSLINE_TYPE_ID
@ RECTWAVEGUIDE_TYPE
@ MICROSTRIP_TYPE
@ CPW_TYPE
@ GROUNDED_CPW_TYPE
@ C_MICROSTRIP_TYPE
@ COAX_TYPE
@ TWISTEDPAIR_TYPE
@ STRIPLINE_TYPE
@ DEFAULT_TYPE
@ C_STRIPLINE_TYPE