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. If not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#include "twistedpair.h"
25#include "units.h"
26
27
29{
30 m_Name = "TwistedPair";
31 Init();
32}
33
34
36{
38
54
56 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_IN );
57 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
58 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_OUT );
59}
60
61
63{
64 m_calc.Analyse();
65}
66
67
72
73
75{
76 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
77 m_calc.GetAnalysisResults();
78
81
89}
90
91
112
113
115{
116 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
117 m_calc.GetAnalysisResults();
118
119 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILON_EFF].first, "" );
120 setResult( 1, results[TRANSLINE_PARAMETERS::LOSS_CONDUCTOR].first, "dB" );
121 setResult( 2, results[TRANSLINE_PARAMETERS::LOSS_DIELECTRIC].first, "dB" );
122 setResult( 3, results[TRANSLINE_PARAMETERS::SKIN_DEPTH].first / UNIT_MICRON, "µm" );
123}
bool isSelected(enum PRMS_ID aPrmId)
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 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:69
@ DIELECTRIC_MODEL_PRM
Definition transline.h:75
@ EPSILONR_SPEC_FREQ_PRM
Definition transline.h:76
@ TWISTEDPAIR_EPSILONR_ENV_PRM
Definition transline.h:49
@ FREQUENCY_PRM
Definition transline.h:51
@ PHYS_DIAM_OUT_PRM
Definition transline.h:59
@ MURC_PRM
Definition transline.h:50
@ 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
@ TWISTEDPAIR_TWIST_PRM
Definition transline.h:43
@ PHYS_DIAM_IN_PRM
Definition transline.h:57
@ EPSILONR_PRM
Definition transline.h:39