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. If not, see <https://www.gnu.org/licenses/>.
22 *
23 */
24
25
26/* microstrip.c - Puts up window for microstrip and
27 * performs the associated calculations
28 * Based on the original microstrip.c by Gopal Narayanan
29 */
30
31#include "microstrip.h"
32#include "transline.h"
33#include "units.h"
34
35
37{
38 m_Name = "MicroStrip";
39 Init();
40}
41
42
44{
45 m_calc.Analyse();
46}
47
48
50{
51 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
52 m_calc.GetAnalysisResults();
53
56
57 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
58 setResult( 1, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY].first, "ps/cm" );
59 setResult( 2, results[TRANSLINE_PARAMETERS::ATTEN_COND].first, "dB" );
60 setResult( 3, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC].first, "dB" );
61 setResult( 4, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
62
67}
68
69
71{
72 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
73 m_calc.GetSynthesisResults();
74
79
80 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
81 setResult( 1, results[TRANSLINE_PARAMETERS::UNIT_PROP_DELAY].first, "ps/cm" );
82 setResult( 2, results[TRANSLINE_PARAMETERS::ATTEN_COND].first, "dB" );
83 setResult( 3, results[TRANSLINE_PARAMETERS::ATTEN_DILECTRIC].first, "dB" );
84 setResult( 4, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
85
90}
91
92
94{
96
116}
117
118
122
123
124/*
125 * synthesis function
126 */
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:74
void setResult(int, double, const char *)
double m_parameters[EXTRA_PRMS_COUNT]
Definition transline.h:140
virtual void getProperties()
@function getProperties
const char * m_Name
Definition transline.h:91
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 pushSoldermaskParameters(TRANSLINE_CALCULATION_BASE &aCalc, bool aIncludeFillsGaps=false) const
Push the mask-eligible subset of soldermask parameters (PRESENT, THICKNESS, EPSILONR,...
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
#define UNIT_MICRON
@ EPSILON_EFF_PRM
Definition transline.h:74
@ SIGMA_PRM
Definition transline.h:69
@ DIELECTRIC_MODEL_PRM
Definition transline.h:75
@ EPSILONR_SPEC_FREQ_PRM
Definition transline.h:76
@ SKIN_DEPTH_PRM
Definition transline.h:70
@ FREQUENCY_PRM
Definition transline.h:51
@ T_PRM
Definition transline.h:46
@ MURC_PRM
Definition transline.h:50
@ MUR_PRM
Definition transline.h:48
@ Z0_PRM
Definition transline.h:52
@ TAND_PRM
Definition transline.h:40
@ PHYS_LEN_PRM
Definition transline.h:60
@ ANG_L_PRM
Definition transline.h:55
@ H_T_PRM
Definition transline.h:44
@ ROUGH_PRM
Definition transline.h:47
@ EPSILONR_PRM
Definition transline.h:39
@ H_PRM
Definition transline.h:42
@ PHYS_WIDTH_PRM
Definition transline.h:56