KiCad PCB EDA Suite
Loading...
Searching...
No Matches
twistedpair.cpp
Go to the documentation of this file.
1/*
2 * twistedpair.h - twisted pair class definition
3 *
4 * Copyright (C) 2011 Michael Margraf <[email protected]>
5 * Modifications 2011 for Kicad: Jean-Pierre Charras
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this package; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24
25#include <cmath>
26#include <cstdio>
27#include <cstdlib>
28#include <cstring>
29
30#include "twistedpair.h"
31#include "units.h"
32
34{
35 m_Name = "TwistedPair";
36 Init();
37}
38
39
97
98
99// -------------------------------------------------------------------
107
109{
112
113 // Check for errors
114 if( !std::isfinite( m_parameters[Z0_PRM] ) || m_parameters[Z0_PRM] < 0 )
116
117 if( !std::isfinite( m_parameters[ANG_L_PRM] ) || m_parameters[ANG_L_PRM] < 0 )
119
120 // Find warnings to display - physical parameters
121 if( !std::isfinite( m_parameters[PHYS_DIAM_IN_PRM] ) || m_parameters[PHYS_DIAM_IN_PRM] <= 0.0 )
123
124 if( !std::isfinite( m_parameters[PHYS_DIAM_OUT_PRM] )
126 {
128 }
129
131 {
134 }
135
136 if( !std::isfinite( m_parameters[PHYS_LEN_PRM] ) || m_parameters[PHYS_LEN_PRM] < 0.0 )
138}
139
141{
144 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
146
148
149 // Check for errors
150 if( !std::isfinite( m_parameters[PHYS_DIAM_IN_PRM] ) || m_parameters[PHYS_DIAM_IN_PRM] <= 0.0 )
151 {
154 else
156 }
157
158 if( !std::isfinite( m_parameters[PHYS_DIAM_OUT_PRM] )
160 {
163 else
165 }
166
168 {
171 else if( isSelected( PHYS_DIAM_OUT_PRM ) )
173 }
174
175 if( !std::isfinite( m_parameters[PHYS_LEN_PRM] ) || m_parameters[PHYS_LEN_PRM] < 0.0 )
177
178 // Check for warnings
179 if( !std::isfinite( m_parameters[Z0_PRM] ) || m_parameters[Z0_PRM] < 0 )
181
182 if( !std::isfinite( m_parameters[ANG_L_PRM] ) || m_parameters[ANG_L_PRM] < 0 )
184}
185
186
187#define MAX_ERROR 0.000001
188
189// -------------------------------------------------------------------
bool isSelected(enum PRMS_ID aPrmId)
void Init()
Definition transline.cpp:87
void setResult(int, double, const char *)
bool minimizeZ0Error1D(double *)
@function minimizeZ0Error1D
double m_parameters[EXTRA_PRMS_COUNT]
Definition transline.h:133
const char * m_Name
Definition transline.h:86
void setProperty(enum PRMS_ID aPrmId, double aValue)
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
void showAnalyze() override
Shows synthesis results and checks for errors / warnings.
void showSynthesize() override
Shows analysis results and checks for errors / warnings.
void show_results() override
Shows results.
void calcSynthesize() override
Computation for synthesis.
void calcAnalyze() override
double acosh(double x)
#define UNIT_MICRON
#define M_PI
@ LOSS_DIELECTRIC_PRM
Definition transline.h:73
@ EPSILON_EFF_PRM
Definition transline.h:76
@ LOSS_CONDUCTOR_PRM
Definition transline.h:74
@ SIGMA_PRM
Definition transline.h:71
@ SKIN_DEPTH_PRM
Definition transline.h:72
@ TWISTEDPAIR_EPSILONR_ENV_PRM
Definition transline.h:51
@ FREQUENCY_PRM
Definition transline.h:53
@ PHYS_DIAM_OUT_PRM
Definition transline.h:61
@ 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
#define TRANSLINE_WARNING
Definition transline.h:32
#define TRANSLINE_ERROR
Definition transline.h:33