KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_calculator/transline/coax.cpp
Go to the documentation of this file.
1/*
2 * coax.cpp - coaxial 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 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this package; see the file COPYING. If not, write to
21 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 */
24
25#include "coax.h"
26#include "transline.h"
27#include "units.h"
28
29
31{
32 m_Name = "Coax";
33 Init();
34}
35
36
38{
40
55
57 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_IN );
58 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
59 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_OUT );
60}
61
62
64{
65 m_calc.Analyse();
66}
67
68
73
74
76{
77 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
78 m_calc.GetAnalysisResults();
79
82
90}
91
92
113
114
116{
117 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
118 m_calc.GetAnalysisResults();
119
120 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILONR].first, "" );
121 setResult( 1, results[TRANSLINE_PARAMETERS::LOSS_CONDUCTOR].first, "dB" );
122 setResult( 2, results[TRANSLINE_PARAMETERS::LOSS_DIELECTRIC].first, "dB" );
123
124 std::string teText = m_calc.GetTEModes();
125 std::string tmText = m_calc.GetTMModes();
126
127 if( teText.empty() )
128 teText = "none";
129
130 if( tmText.empty() )
131 tmText = "none";
132
133 setResult( 3, teText.c_str() );
134 setResult( 4, tmText.c_str() );
135}
void show_results() override
Shows results.
void calcAnalyze() override
Computation for analysis.
void getProperties() override
@function getProperties
void showSynthesize() override
Shows analysis results and checks for errors / warnings.
void showAnalyze() override
Shows synthesis results and checks for errors / warnings.
void calcSynthesize() override
Computation for synthesis.
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
@ SIGMA_PRM
Definition transline.h:71
@ DIELECTRIC_MODEL_PRM
Definition transline.h:77
@ EPSILONR_SPEC_FREQ_PRM
Definition transline.h:78
@ SKIN_DEPTH_PRM
Definition transline.h:72
@ FREQUENCY_PRM
Definition transline.h:53
@ PHYS_DIAM_OUT_PRM
Definition transline.h:61
@ 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
@ PHYS_DIAM_IN_PRM
Definition transline.h:59
@ EPSILONR_PRM
Definition transline.h:41