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. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#include "coax.h"
24#include "transline.h"
25#include "units.h"
26
27
29{
30 m_Name = "Coax";
31 Init();
32}
33
34
36{
38
53
55 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_IN );
56 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
57 m_calc.SetSynthesizeTarget( TRANSLINE_PARAMETERS::PHYS_DIAM_OUT );
58}
59
60
62{
63 m_calc.Analyse();
64}
65
66
71
72
74{
75 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
76 m_calc.GetAnalysisResults();
77
80
88}
89
90
111
112
114{
115 std::unordered_map<TRANSLINE_PARAMETERS, std::pair<double, TRANSLINE_STATUS>>& results =
116 m_calc.GetAnalysisResults();
117
118 setResult( 0, results[TRANSLINE_PARAMETERS::EPSILONR].first, "" );
119 setResult( 1, results[TRANSLINE_PARAMETERS::LOSS_CONDUCTOR].first, "dB" );
120 setResult( 2, results[TRANSLINE_PARAMETERS::LOSS_DIELECTRIC].first, "dB" );
121
122 std::string teText = m_calc.GetTEModes();
123 std::string tmText = m_calc.GetTMModes();
124
125 if( teText.empty() )
126 teText = "none";
127
128 if( tmText.empty() )
129 tmText = "none";
130
131 setResult( 3, teText.c_str() );
132 setResult( 4, tmText.c_str() );
133}
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: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
@ 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
@ PHYS_DIAM_OUT_PRM
Definition transline.h:59
@ 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
@ PHYS_DIAM_IN_PRM
Definition transline.h:57
@ EPSILONR_PRM
Definition transline.h:39