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. If not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef __TRANSLINE_H
24#define __TRANSLINE_H
25
26#include <gal/color4d.h>
28
29#define TRANSLINE_OK 0
30#define TRANSLINE_WARNING 1
31#define TRANSLINE_ERROR 2
32
33// IDs for lines parameters used in calculation:
34// (Used to retrieve these parameters from UI.
35// DUMMY_PRM is used to skip a param line in dialogs. It is not really a parameter
37{
39 EPSILONR_PRM, // dielectric constant
40 TAND_PRM, // Dielectric Loss Tangent
41 RHO_PRM, // Conductivity of conductor
42 H_PRM, // height of substrate
43 TWISTEDPAIR_TWIST_PRM, // Twists per length
45 STRIPLINE_A_PRM, // Stripline : distance from line to top metal
46 T_PRM, // thickness of top metal
48 MUR_PRM, // magnetic permeability of substrate
50 MURC_PRM, // magnetic permeability of conductor
51 FREQUENCY_PRM, // Frequency of operation
52 Z0_PRM, // characteristic impedance
55 ANG_L_PRM, // Electrical length in angle
57 PHYS_DIAM_IN_PRM, // Inner diameter of cable
58 PHYS_S_PRM, // width of gap between line and ground
59 PHYS_DIAM_OUT_PRM, // Outer diameter of cable
60 PHYS_LEN_PRM, // Length of cable
62};
63
64
65// IDs for lines parameters used in calculation that are not given by the UI
67{
69 SIGMA_PRM, // Conductivity of the metal
70 SKIN_DEPTH_PRM, // Skin depth
71 LOSS_DIELECTRIC_PRM, // Loss in dielectric (dB)
72 LOSS_CONDUCTOR_PRM, // Loss in conductors (dB)
73 CUTOFF_FREQUENCY_PRM, // Cutoff frequency for higher order modes
74 EPSILON_EFF_PRM, // Effective dielectric constant
75 DIELECTRIC_MODEL_PRM, // 0 = CONSTANT, 1 = DJORDJEVIC_SARKAR (panel-level selection)
76 EPSILONR_SPEC_FREQ_PRM, // Frequency (Hz) at which EpsilonR/TanD are specified
77 SOLDERMASK_PRESENT_PRM, // 0 = no mask correction, 1 = apply Wan-Hoorfar 2000 cover.
78 SOLDERMASK_THICKNESS_PRM, // Cured mask thickness in metres. Typical LPI is 15 - 30 um.
79 SOLDERMASK_EPSILONR_PRM, // Mask relative permittivity. Typical LPI 3.3 - 3.8.
80 SOLDERMASK_TAND_PRM, // Mask loss tangent. Typical LPI 0.025 - 0.035.
81 SOLDERMASK_FILLS_GAPS_PRM, // CPW / CBCPW only. 1 = mask fills the coplanar slots.
83};
84
86{
87public:
88 TRANSLINE();
89 virtual ~TRANSLINE();
90
91 const char* m_Name;
92 void setProperty( enum PRMS_ID aPrmId, double aValue );
93 double getProperty( enum PRMS_ID aPrmId );
94
96 void SetExtraParameter( enum EXTRA_PRMS_ID aPrmId, double aValue ) { m_parameters[aPrmId] = aValue; }
97
98
99 virtual void getProperties();
100 void checkProperties();
101 void setResult( int, double, const char* );
102 void setResult( int, const char* );
103 bool isSelected( enum PRMS_ID aPrmId );
104
105 void Init();
106 virtual void synthesize();
107
111 virtual void calcAnalyze(){};
112
116 virtual void calcSynthesize() {}
117
121 virtual void showAnalyze() {}
122
126 virtual void showSynthesize() {}
127
131 virtual void show_results() {}
132
133 void analyze();
134
135 KIGFX::COLOR4D errCol = KIGFX::COLOR4D( 1, 0.63, 0.63, 1 );
138
139protected:
141
142 double skin_depth();
143 void setErrorLevel( PRMS_ID, char );
144
154 bool aIncludeFillsGaps = false ) const;
155
157 static char convertParameterStatusCode( TRANSLINE_STATUS aStatus );
158};
159
160#endif /* __TRANSLINE_H */
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
The base class for all transmission line calculations.
virtual ~TRANSLINE()
Definition transline.cpp:69
virtual void showSynthesize()
Shows analysis results and checks for errors / warnings.
Definition transline.h:126
bool isSelected(enum PRMS_ID aPrmId)
KIGFX::COLOR4D warnCol
Definition transline.h:136
double getProperty(enum PRMS_ID aPrmId)
void Init()
Definition transline.cpp:74
virtual void calcSynthesize()
Computation for synthesis.
Definition transline.h:116
void SetExtraParameter(enum EXTRA_PRMS_ID aPrmId, double aValue)
Setter for panel-level parameters that are shared across every calculator type.
Definition transline.h:96
KIGFX::COLOR4D okCol
Definition transline.h:137
void setResult(int, double, const char *)
double m_parameters[EXTRA_PRMS_COUNT]
Definition transline.h:140
KIGFX::COLOR4D errCol
Definition transline.h:135
virtual void getProperties()
@function getProperties
void checkProperties()
@function checkProperties
void analyze()
virtual void synthesize()
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 pushSoldermaskParameters(TRANSLINE_CALCULATION_BASE &aCalc, bool aIncludeFillsGaps=false) const
Push the mask-eligible subset of soldermask parameters (PRESENT, THICKNESS, EPSILONR,...
virtual void showAnalyze()
Shows synthesis results and checks for errors / warnings.
Definition transline.h:121
double skin_depth()
@function skin_depth calculate skin depth
virtual void show_results()
Shows results.
Definition transline.h:131
virtual void calcAnalyze()
Computation for analysis.
Definition transline.h:111
void setErrorLevel(PRMS_ID, char)
@function setErrorLevel
EXTRA_PRMS_ID
Definition transline.h:67
@ SOLDERMASK_FILLS_GAPS_PRM
Definition transline.h:81
@ LOSS_DIELECTRIC_PRM
Definition transline.h:71
@ EPSILON_EFF_PRM
Definition transline.h:74
@ LOSS_CONDUCTOR_PRM
Definition transline.h:72
@ SOLDERMASK_PRESENT_PRM
Definition transline.h:77
@ SIGMA_PRM
Definition transline.h:69
@ CUTOFF_FREQUENCY_PRM
Definition transline.h:73
@ DIELECTRIC_MODEL_PRM
Definition transline.h:75
@ EPSILONR_SPEC_FREQ_PRM
Definition transline.h:76
@ SKIN_DEPTH_PRM
Definition transline.h:70
@ EXTRA_PRMS_START
Definition transline.h:68
@ SOLDERMASK_TAND_PRM
Definition transline.h:80
@ EXTRA_PRMS_COUNT
Definition transline.h:82
@ SOLDERMASK_EPSILONR_PRM
Definition transline.h:79
@ SOLDERMASK_THICKNESS_PRM
Definition transline.h:78
PRMS_ID
Definition transline.h:37
@ UNKNOWN_ID
Definition transline.h:38
@ TWISTEDPAIR_EPSILONR_ENV_PRM
Definition transline.h:49
@ Z0_O_PRM
Definition transline.h:54
@ FREQUENCY_PRM
Definition transline.h:51
@ DUMMY_PRM
Definition transline.h:61
@ RHO_PRM
Definition transline.h:41
@ PHYS_DIAM_OUT_PRM
Definition transline.h:59
@ T_PRM
Definition transline.h:46
@ Z0_E_PRM
Definition transline.h:53
@ MURC_PRM
Definition transline.h:50
@ MUR_PRM
Definition transline.h:48
@ STRIPLINE_A_PRM
Definition transline.h:45
@ 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
@ H_T_PRM
Definition transline.h:44
@ TWISTEDPAIR_TWIST_PRM
Definition transline.h:43
@ PHYS_DIAM_IN_PRM
Definition transline.h:57
@ ROUGH_PRM
Definition transline.h:47
@ EPSILONR_PRM
Definition transline.h:39
@ PHYS_S_PRM
Definition transline.h:58
@ H_PRM
Definition transline.h:42
@ PHYS_WIDTH_PRM
Definition transline.h:56
TRANSLINE_STATUS
Parameter status values.