KiCad PCB EDA Suite
Loading...
Searching...
No Matches
c_microstrip.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002 Claudio Girardi <[email protected]>
3 * Copyright (C) 2005, 2006 Stefan Jahn <[email protected]>
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this package; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22
23#include "c_microstrip.h"
24#include "transline.h"
25#include "units.h"
26
27
29{
30 m_Name = "Coupled_MicroStrip";
31 Init();
32}
33
34
36{
38}
39
40
42{
43 m_calc.Synthesize( SYNTHESIZE_OPTS::DEFAULT );
44}
45
46
48{
49 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
51
52 setProperty( Z0_E_PRM, results[TRANSLINE_PARAMETERS::Z0_E].first );
53 setProperty( Z0_O_PRM, results[TRANSLINE_PARAMETERS::Z0_O].first );
54 setProperty( ANG_L_PRM, results[TRANSLINE_PARAMETERS::ANG_L].first );
55
56 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF_EVEN].first, "" );
57 setResult( 1, results[TRANSLINE_PARAMETERS::EPSILON_EFF_ODD].first, "" );
58 setResult( 2, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY_EVEN].first, "ps/cm" );
59 setResult( 3, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY_ODD].first, "ps/cm" );
60 setResult( 4, results[TRANSLINE_PARAMETERS::ATTEN_COND_EVEN].first, "dB" );
61 setResult( 5, results[TRANSLINE_PARAMETERS::ATTEN_COND_ODD].first, "dB" );
62 setResult( 6, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC_EVEN].first, "dB" );
63 setResult( 7, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC_ODD].first, "dB" );
64 setResult( 8, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
65 setResult( 9, results[TRANSLINE_PARAMETERS::Z_DIFF].first, "Ω" );
66
67 setErrorLevel( Z0_E_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::Z0_E].second ) );
68 setErrorLevel( Z0_O_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::Z0_O].second ) );
69 setErrorLevel( ANG_L_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::ANG_L].second ) );
70 setErrorLevel( PHYS_WIDTH_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_WIDTH].second ) );
71 setErrorLevel( PHYS_LEN_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_LEN].second ) );
72 setErrorLevel( PHYS_S_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_S].second ) );
73}
74
75
77{
78 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
80
81 setProperty( PHYS_WIDTH_PRM, results[TRANSLINE_PARAMETERS::PHYS_WIDTH].first );
82 setProperty( PHYS_S_PRM, results[TRANSLINE_PARAMETERS::PHYS_S].first );
83 setProperty( PHYS_LEN_PRM, results[TRANSLINE_PARAMETERS::PHYS_LEN].first );
84
85 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF_EVEN].first, "" );
86 setResult( 1, results[TRANSLINE_PARAMETERS::EPSILON_EFF_ODD].first, "" );
87 setResult( 2, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY_EVEN].first, "ps/cm" );
88 setResult( 3, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY_ODD].first, "ps/cm" );
89 setResult( 4, results[TRANSLINE_PARAMETERS::ATTEN_COND_EVEN].first, "dB" );
90 setResult( 5, results[TRANSLINE_PARAMETERS::ATTEN_COND_ODD].first, "dB" );
91 setResult( 6, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC_EVEN].first, "dB" );
92 setResult( 7, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC_ODD].first, "dB" );
93 setResult( 8, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
94 setResult( 9, results[TRANSLINE_PARAMETERS::Z_DIFF].first, "Ω" );
95
96 setErrorLevel( Z0_E_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::Z0_E].second ) );
97 setErrorLevel( Z0_O_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::Z0_O].second ) );
98 setErrorLevel( ANG_L_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::ANG_L].second ) );
99 setErrorLevel( PHYS_WIDTH_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_WIDTH].second ) );
100 setErrorLevel( PHYS_LEN_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_LEN].second ) );
101 setErrorLevel( PHYS_S_PRM, convertParameterStatusCode( results[TRANSLINE_PARAMETERS::PHYS_S].second ) );
102}
103
104
106{
108
109 m_calc.SetParameter( TRANSLINE_PARAMETERS::Z0_E, m_parameters[Z0_E_PRM] );
110 m_calc.SetParameter( TRANSLINE_PARAMETERS::Z0_O, m_parameters[Z0_O_PRM] );
111 m_calc.SetParameter( TRANSLINE_PARAMETERS::EPSILONR, m_parameters[EPSILONR_PRM] );
112 m_calc.SetParameter( TRANSLINE_PARAMETERS::PHYS_WIDTH, m_parameters[PHYS_WIDTH_PRM] );
113 m_calc.SetParameter( TRANSLINE_PARAMETERS::PHYS_LEN, m_parameters[PHYS_LEN_PRM] );
114 m_calc.SetParameter( TRANSLINE_PARAMETERS::PHYS_S, m_parameters[PHYS_S_PRM] );
115 m_calc.SetParameter( TRANSLINE_PARAMETERS::H, m_parameters[H_PRM] );
116 m_calc.SetParameter( TRANSLINE_PARAMETERS::T, m_parameters[T_PRM] );
117 m_calc.SetParameter( TRANSLINE_PARAMETERS::H_T, m_parameters[H_T_PRM] );
118 m_calc.SetParameter( TRANSLINE_PARAMETERS::FREQUENCY, m_parameters[FREQUENCY_PRM] );
119 m_calc.SetParameter( TRANSLINE_PARAMETERS::MURC, m_parameters[MURC_PRM] );
120 m_calc.SetParameter( TRANSLINE_PARAMETERS::SKIN_DEPTH, m_parameters[SKIN_DEPTH_PRM] );
121 m_calc.SetParameter( TRANSLINE_PARAMETERS::SIGMA, m_parameters[SIGMA_PRM] );
122 m_calc.SetParameter( TRANSLINE_PARAMETERS::ROUGH, m_parameters[ROUGH_PRM] );
123 m_calc.SetParameter( TRANSLINE_PARAMETERS::TAND, m_parameters[TAND_PRM] );
124 m_calc.SetParameter( TRANSLINE_PARAMETERS::ANG_L, m_parameters[ANG_L_PRM] );
125}
126
128{
129}
void Analyse() override
Analyse track geometry parameters to output Z0 and Ang_L.
bool Synthesize(SYNTHESIZE_OPTS aOpts) override
Synthesis track geometry parameters to match given Z0.
void show_results() override
Shows results.
void calcAnalyze() override
Computation for analysis.
void getProperties() override
@function getProperties
void showAnalyze() override
Shows synthesis results and checks for errors / warnings.
void showSynthesize() override
Shows analysis results and checks for errors / warnings.
void calcSynthesize() override
Computation for synthesis.
COUPLED_MICROSTRIP m_calc
Definition: c_microstrip.h:46
void SetParameter(const TRANSLINE_PARAMETERS aParam, const double aValue)
Sets the given calculation property.
std::unordered_map< TRANSLINE_PARAMETERS, std::pair< double, TRANSLINE_STATUS > > & GetAnalysisResults()
Gets the output parameters following analysis.
void Init()
Definition: transline.cpp:87
void setResult(int, double, const char *)
Definition: transline.cpp:130
double m_parameters[EXTRA_PRMS_COUNT]
Definition: transline.h:133
virtual void getProperties()
@function getProperties
Definition: transline.cpp:147
const char * m_Name
Definition: transline.h:86
static char convertParameterStatusCode(TRANSLINE_STATUS aStatus)
Converts a TRANSLINE_PARAMETER status to a PCB Calculation status.
Definition: transline.cpp:449
void setProperty(enum PRMS_ID aPrmId, double aValue)
Definition: transline.cpp:106
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
Definition: transline.cpp:432
#define UNIT_MICRON
@ SIGMA_PRM
Definition: transline.h:71
@ SKIN_DEPTH_PRM
Definition: transline.h:72
@ Z0_O_PRM
Definition: transline.h:56
@ FREQUENCY_PRM
Definition: transline.h:53
@ T_PRM
Definition: transline.h:48
@ Z0_E_PRM
Definition: transline.h:55
@ MURC_PRM
Definition: transline.h:52
@ TAND_PRM
Definition: transline.h:42
@ PHYS_LEN_PRM
Definition: transline.h:62
@ ANG_L_PRM
Definition: transline.h:57
@ H_T_PRM
Definition: transline.h:46
@ ROUGH_PRM
Definition: transline.h:49
@ EPSILONR_PRM
Definition: transline.h:41
@ PHYS_S_PRM
Definition: transline.h:60
@ H_PRM
Definition: transline.h:44
@ PHYS_WIDTH_PRM
Definition: transline.h:58