KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_calculator/transline/microstrip.cpp
Go to the documentation of this file.
1/*
2 * microstrip.cpp - microstrip class implementation
3 *
4 * Copyright (C) 2001 Gopal Narayanan <[email protected]>
5 * Copyright (C) 2002 Claudio Girardi <[email protected]>
6 * Copyright (C) 2005, 2006 Stefan Jahn <[email protected]>
7 * Modified for Kicad: 2018 Jean-Pierre Charras <jp.charras at wanadoo.fr>
8 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or (at
13 * your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this package; see the file COPYING. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 *
25 */
26
27
28/* microstrip.c - Puts up window for microstrip and
29 * performs the associated calculations
30 * Based on the original microstrip.c by Gopal Narayanan
31 */
32
33#include "microstrip.h"
34#include "transline.h"
35#include "units.h"
36
37
39{
40 m_Name = "MicroStrip";
41 Init();
42}
43
44
46{
47 m_calc.Analyse();
48}
49
50
52{
53 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
54 m_calc.GetAnalysisResults();
55
58
59 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
60 setResult( 1, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY].first, "ps/cm" );
61 setResult( 2, results[TRANSLINE_PARAMETERS::ATTEN_COND].first, "dB" );
62 setResult( 3, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC].first, "dB" );
63 setResult( 4, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
64
69}
70
71
73{
74 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
75 m_calc.GetSynthesisResults();
76
81
82 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
83 setResult( 1, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY].first, "ps/cm" );
84 setResult( 2, results[TRANSLINE_PARAMETERS::ATTEN_COND].first, "dB" );
85 setResult( 3, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC].first, "dB" );
86 setResult( 4, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
87
92}
93
94
116
117
121
122
123/*
124 * synthesis function
125 */
void showSynthesize() override
Shows analysis results and checks for errors / warnings.
void calcAnalyze() override
Computation for analysis.
void getProperties() override
@function getProperties
void showAnalyze() override
Shows synthesis results and checks for errors / warnings.
void calcSynthesize() override
Computation for synthesis.
void show_results() override
Shows results.
void Init()
Definition transline.cpp:87
void setResult(int, double, const char *)
double m_parameters[EXTRA_PRMS_COUNT]
Definition transline.h:133
virtual void getProperties()
@function getProperties
const char * m_Name
Definition transline.h:86
static char convertParameterStatusCode(TRANSLINE_STATUS aStatus)
Converts a TRANSLINE_PARAMETER status to a PCB Calculation status.
void setProperty(enum PRMS_ID aPrmId, double aValue)
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
#define UNIT_MICRON
@ EPSILON_EFF_PRM
Definition transline.h:76
@ SIGMA_PRM
Definition transline.h:71
@ SKIN_DEPTH_PRM
Definition transline.h:72
@ FREQUENCY_PRM
Definition transline.h:53
@ T_PRM
Definition transline.h:48
@ MURC_PRM
Definition transline.h:52
@ MUR_PRM
Definition transline.h:50
@ Z0_PRM
Definition transline.h:54
@ 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
@ H_PRM
Definition transline.h:44
@ PHYS_WIDTH_PRM
Definition transline.h:58