KiCad PCB EDA Suite
Loading...
Searching...
No Matches
transline.h
Go to the documentation of this file.
1/*
2 * transline.h - base for a transmission line class definition
3 *
4 * Copyright (C) 2005 Stefan Jahn <[email protected]>
5 * Modifications 2018 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
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU 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#ifndef __TRANSLINE_H
26#define __TRANSLINE_H
27
28#include <gal/color4d.h>
30
31#define TRANSLINE_OK 0
32#define TRANSLINE_WARNING 1
33#define TRANSLINE_ERROR 2
34
35// IDs for lines parameters used in calculation:
36// (Used to retrieve these parameters from UI.
37// DUMMY_PRM is used to skip a param line in dialogs. It is not really a parameter
39{
41 EPSILONR_PRM, // dielectric constant
42 TAND_PRM, // Dielectric Loss Tangent
43 RHO_PRM, // Conductivity of conductor
44 H_PRM, // height of substrate
45 TWISTEDPAIR_TWIST_PRM, // Twists per length
47 STRIPLINE_A_PRM, // Stripline : distance from line to top metal
48 T_PRM, // thickness of top metal
50 MUR_PRM, // magnetic permeability of substrate
52 MURC_PRM, // magnetic permeability of conductor
53 FREQUENCY_PRM, // Frequency of operation
54 Z0_PRM, // characteristic impedance
57 ANG_L_PRM, // Electrical length in angle
59 PHYS_DIAM_IN_PRM, // Inner diameter of cable
60 PHYS_S_PRM, // width of gap between line and ground
61 PHYS_DIAM_OUT_PRM, // Outer diameter of cable
62 PHYS_LEN_PRM, // Length of cable
64};
65
66
67// IDs for lines parameters used in calculation that are not given by the UI
69{
71 SIGMA_PRM, // Conductivity of the metal
72 SKIN_DEPTH_PRM, // Skin depth
73 LOSS_DIELECTRIC_PRM, // Loss in dielectric (dB)
74 LOSS_CONDUCTOR_PRM, // Loss in conductors (dB)
75 CUTOFF_FREQUENCY_PRM, // Cutoff frequency for higher order modes
76 EPSILON_EFF_PRM, // Effective dielectric constant
78};
79
81{
82public:
83 TRANSLINE();
84 virtual ~TRANSLINE();
85
86 const char* m_Name;
87 void setProperty( enum PRMS_ID aPrmId, double aValue );
88 double getProperty( enum PRMS_ID aPrmId );
89
90
91 virtual void getProperties();
92 void checkProperties();
93 void setResult( int, double, const char* );
94 void setResult( int, const char* );
95 bool isSelected( enum PRMS_ID aPrmId );
96
97 void Init();
98 virtual void synthesize();
99 virtual void calc() {}
100
104 virtual void calcAnalyze(){};
105
109 virtual void calcSynthesize() {}
110
114 virtual void showAnalyze() {}
115
119 virtual void showSynthesize() {}
120
124 virtual void show_results() {}
125
126 void analyze();
127
128 KIGFX::COLOR4D errCol = KIGFX::COLOR4D( 1, 0.63, 0.63, 1 );
131
132protected:
134
135 bool minimizeZ0Error1D( double* );
136 double skin_depth();
137 void ellipke( double, double&, double& );
138 double ellipk( double );
139 void setErrorLevel( PRMS_ID, char );
140
142 static double calcUnitPropagationDelay( double epsilonEff );
143
145 static char convertParameterStatusCode( TRANSLINE_STATUS aStatus );
146};
147
148#endif /* __TRANSLINE_H */
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
virtual ~TRANSLINE()
Definition: transline.cpp:82
virtual void showSynthesize()
Shows analysis results and checks for errors / warnings.
Definition: transline.h:119
bool isSelected(enum PRMS_ID aPrmId)
Definition: transline.cpp:116
virtual void calc()
Definition: transline.h:99
double ellipk(double)
Definition: transline.cpp:321
KIGFX::COLOR4D warnCol
Definition: transline.h:129
static double calcUnitPropagationDelay(double epsilonEff)
Calculates the unit propagation delay (in ps/cm) for the given effective dielectric constant.
Definition: transline.cpp:443
double getProperty(enum PRMS_ID aPrmId)
Definition: transline.cpp:137
void Init()
Definition: transline.cpp:87
virtual void calcSynthesize()
Computation for synthesis.
Definition: transline.h:109
KIGFX::COLOR4D okCol
Definition: transline.h:130
void setResult(int, double, const char *)
Definition: transline.cpp:130
bool minimizeZ0Error1D(double *)
@function minimizeZ0Error1D
Definition: transline.cpp:346
double m_parameters[EXTRA_PRMS_COUNT]
Definition: transline.h:133
KIGFX::COLOR4D errCol
Definition: transline.h:128
virtual void getProperties()
@function getProperties
Definition: transline.cpp:147
void checkProperties()
@function checkProperties
Definition: transline.cpp:166
void analyze()
Definition: transline.cpp:208
virtual void synthesize()
Definition: transline.cpp:217
void ellipke(double, double &, double &)
Definition: transline.cpp:256
const char * m_Name
Definition: transline.h:86
static char convertParameterStatusCode(TRANSLINE_STATUS aStatus)
Converts a TRANSLINE_PARAMETER status to a PCB Calculation status.
Definition: transline.cpp:449
void setProperty(enum PRMS_ID aPrmId, double aValue)
Definition: transline.cpp:106
virtual void showAnalyze()
Shows synthesis results and checks for errors / warnings.
Definition: transline.h:114
double skin_depth()
@function skin_depth calculate skin depth
Definition: transline.cpp:234
virtual void show_results()
Shows results.
Definition: transline.h:124
virtual void calcAnalyze()
Computation for analysis.
Definition: transline.h:104
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
Definition: transline.cpp:432
EXTRA_PRMS_ID
Definition: transline.h:69
@ 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
@ CUTOFF_FREQUENCY_PRM
Definition: transline.h:75
@ SKIN_DEPTH_PRM
Definition: transline.h:72
@ EXTRA_PRMS_START
Definition: transline.h:70
@ EXTRA_PRMS_COUNT
Definition: transline.h:77
PRMS_ID
Definition: transline.h:39
@ UNKNOWN_ID
Definition: transline.h:40
@ TWISTEDPAIR_EPSILONR_ENV_PRM
Definition: transline.h:51
@ Z0_O_PRM
Definition: transline.h:56
@ FREQUENCY_PRM
Definition: transline.h:53
@ DUMMY_PRM
Definition: transline.h:63
@ RHO_PRM
Definition: transline.h:43
@ PHYS_DIAM_OUT_PRM
Definition: transline.h:61
@ T_PRM
Definition: transline.h:48
@ Z0_E_PRM
Definition: transline.h:55
@ MURC_PRM
Definition: transline.h:52
@ MUR_PRM
Definition: transline.h:50
@ STRIPLINE_A_PRM
Definition: transline.h:47
@ 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
@ H_T_PRM
Definition: transline.h:46
@ TWISTEDPAIR_TWIST_PRM
Definition: transline.h:45
@ PHYS_DIAM_IN_PRM
Definition: transline.h:59
@ ROUGH_PRM
Definition: transline.h:49
@ EPSILONR_PRM
Definition: transline.h:41
@ PHYS_S_PRM
Definition: transline.h:60
@ H_PRM
Definition: transline.h:44
@ PHYS_WIDTH_PRM
Definition: transline.h:58
TRANSLINE_STATUS
Parameter status values.