KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_calculator/transline/twistedpair.cpp
Go to the documentation of this file.
1/*
2 * twistedpair.cpp - twisted pair UI wrapper
3 *
4 * Copyright (C) 2011 Michael Margraf <[email protected]>
5 * Modifications 2011 for Kicad: Jean-Pierre Charras
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this package; see the file COPYING. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25
26#include "twistedpair.h"
27#include "units.h"
28
29
31{
32 m_Name = "TwistedPair";
33 Init();
34}
35
36
38{
40
56
58 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_IN );
59 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
60 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_OUT );
61}
62
63
65{
66 m_calc.Analyse();
67}
68
69
74
75
77{
78 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
79 m_calc.GetAnalysisResults();
80
83
91}
92
93
114
115
117{
118 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
119 m_calc.GetAnalysisResults();
120
121 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
122 setResult( 1, results[TRANSLINE_PARAMETERS::LOSS_CONDUCTOR].first, "dB" );
123 setResult( 2, results[TRANSLINE_PARAMETERS::LOSS_DIELECTRIC].first, "dB" );
124 setResult( 3, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
125}
bool isSelected(enum PRMS_ID aPrmId)
void Init()
Definition transline.cpp:76
void setResult(int, double, const char *)
double m_parameters[EXTRA_PRMS_COUNT]
Definition transline.h:142
virtual void getProperties()
@function getProperties
const char * m_Name
Definition transline.h:93
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
void show_results() override
Shows results.
void calcSynthesize() override
Computation for synthesis.
void showSynthesize() override
Shows analysis results and checks for errors / warnings.
void getProperties() override
@function getProperties
void showAnalyze() override
Shows synthesis results and checks for errors / warnings.
void calcAnalyze() override
Computation for analysis.
#define UNIT_MICRON
@ SIGMA_PRM
Definition transline.h:71
@ DIELECTRIC_MODEL_PRM
Definition transline.h:77
@ EPSILONR_SPEC_FREQ_PRM
Definition transline.h:78
@ TWISTEDPAIR_EPSILONR_ENV_PRM
Definition transline.h:51
@ FREQUENCY_PRM
Definition transline.h:53
@ PHYS_DIAM_OUT_PRM
Definition transline.h:61
@ MURC_PRM
Definition transline.h:52
@ 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
@ TWISTEDPAIR_TWIST_PRM
Definition transline.h:45
@ PHYS_DIAM_IN_PRM
Definition transline.h:59
@ EPSILONR_PRM
Definition transline.h:41