KiCad PCB EDA Suite
TRANSLINE_IDENT Class Reference

#include <transline_ident.h>

Public Member Functions

 TRANSLINE_IDENT (enum TRANSLINE_TYPE_ID aType)
 
 ~TRANSLINE_IDENT ()
 
void AddPrm (TRANSLINE_PRM *aParam)
 
TRANSLINE_PRMGetPrm (unsigned aIdx)
 
unsigned GetPrmsCount ()
 
void ReadConfig ()
 
void WriteConfig ()
 

Public Attributes

enum TRANSLINE_TYPE_ID m_Type
 
wxBitmap * m_Icon
 
TRANSLINEm_TLine
 
wxArrayString m_Messages
 
bool m_HasPrmSelection
 

Private Attributes

std::vector< TRANSLINE_PRM * > m_prms_List
 

Detailed Description

Definition at line 94 of file transline_ident.h.

Constructor & Destructor Documentation

◆ TRANSLINE_IDENT()

TRANSLINE_IDENT::TRANSLINE_IDENT ( enum TRANSLINE_TYPE_ID  aType)

Definition at line 109 of file transline_ident.cpp.

110 {
111  m_Type = aType; // The type of transline handled
112  m_Icon = NULL; // An xpm icon to display in dialogs
113  m_TLine = NULL; // The TRANSLINE itself
114  m_HasPrmSelection = false; // true if selection of parameters must be enabled in dialog menu
115 
116  // Add common prms:
117  // Default values are for FR4
119  "Er", _( "Er" ),
120  _( "Epsilon R: substrate relative dielectric constant" ),
121  4.6, false ) );
123  "TanD", _( "TanD" ),
124  _( "Tangent delta: dielectric loss factor." ), 2e-2,
125  false ) );
126 
127  // Default value is for copper
129  "Rho", _( "Rho" ),
130  _( "Electrical resistivity or specific electrical resistance of conductor (Ohm*meter)" ),
131  1.72e-8, false ) );
132 
133  // Default value is in GHz
135  "Frequency", _( "Frequency" ),
136  _( "Frequency of the input signal" ), 1.0, true ) );
137 
138 
139  switch( m_Type )
140  {
141  case MICROSTRIP_TYPE: // microstrip
142  m_TLine = new MICROSTRIP();
143  m_Icon = new wxBitmap( microstrip_xpm );
144 
145  m_Messages.Add( _( "ErEff:" ) );
146  m_Messages.Add( _( "Conductor Losses:" ) );
147  m_Messages.Add( _( "Dielectric Losses:" ) );
148  m_Messages.Add( _( "Skin Depth:" ) );
149 
151  "H", "H", _( "Height of Substrate" ), 0.2, true ) );
153  "H_t", "H_t", _( "Height of Box Top" ), 1e20, true ) );
155  "T", "T",
156  _( "Strip Thickness" ), 0.035, true ) );
158  "Rough", _( "Rough" ),
159  _( "Conductor Roughness" ), 0.0, true ) );
161  "mu Rel S",_( "mu Rel S" ),
162  _( "Relative Permeability (mu) of Substrate" ), 1, false ) );
164  "mu Rel C", _( "mu Rel C" ),
165  _( "Relative Permeability (mu) of Conductor" ), 1,
166  false ) );
167 
169  "W", "W", _( "Line Width" ), 0.2, true ) );
171  "L", "L", _( "Line Length" ), 50.0, true ) );
172 
174  "Z0", "Z0", _( "Characteristic Impedance" ), 50.0, true ) );
177  "Ang_l", "Ang_l", _( "Electrical Length" ), 0.0, true ) );
178  break;
179 
180  case CPW_TYPE: // coplanar waveguide
181  m_TLine = new COPLANAR();
182  m_Icon = new wxBitmap( cpw_xpm );
183  m_HasPrmSelection = true;
184 
185  m_Messages.Add( _( "ErEff:" ) );
186  m_Messages.Add( _( "Conductor Losses:" ) );
187  m_Messages.Add( _( "Dielectric Losses:" ) );
188  m_Messages.Add( _( "Skin Depth:" ) );
189 
191  "H", "H", _( "Height of Substrate" ), 0.2, true ) );
193  "T", "T", _( "Strip Thickness" ), 0.035, true ) );
195  "mu Rel C", _( "mu Rel C" ),
196  _( "Relative Permeability (mu) of Conductor" ), 1,
197  false ) );
198 
200  "W", "W", _( "Line Width" ), 0.2, true ) );
202  "S", "S", _( "Gap Width" ), 0.2, true ) );
204  "L", "L", _( "Line Length" ), 50.0, true ) );
205 
207  "Z0", "Z0", _( "Characteristic Impedance" ), 50.0, true ) );
210  "Ang_l", "Ang_l", _( "Electrical Length" ), 0.0, true ) );
211  break;
212 
213  case GROUNDED_CPW_TYPE: // grounded coplanar waveguide
214  m_TLine = new GROUNDEDCOPLANAR();
215  m_Icon = new wxBitmap( cpw_back_xpm );
216  m_HasPrmSelection = true;
217 
218  m_Messages.Add( _( "ErEff:" ) );
219  m_Messages.Add( _( "Conductor Losses:" ) );
220  m_Messages.Add( _( "Dielectric Losses:" ) );
221  m_Messages.Add( _( "Skin Depth:" ) );
222 
224  "H", "H", _( "Height of Substrate" ), 0.2, true ) );
226  "T", "T", _( "Strip Thickness" ), 0.035, true ) );
228  "mu Rel C", "mu Rel C",
229  _( "Relative Permeability (mu) of Conductor" ), 1,
230  false ) );
231 
233  "W", "W", _( "Line Width" ), 0.2, true ) );
235  "S", "S", _( "Gap Width" ), 0.2, true ) );
237  "L", "L", _( "Line Length" ), 50.0, true ) );
238 
240  "Z0", "Z0", _( "Characteristic Impedance" ), 50.0, true ) );
243  "Ang_l", "Ang_l", _( "Electrical Length" ), 0, true ) );
244  break;
245 
246 
247  case RECTWAVEGUIDE_TYPE: // rectangular waveguide
248  m_TLine = new RECTWAVEGUIDE();
249  m_Icon = new wxBitmap( rectwaveguide_xpm );
250  m_HasPrmSelection = true;
251 
252  m_Messages.Add( _( "ZF(H10) = Ey / Hx:" ) );
253  m_Messages.Add( _( "ErEff:" ) );
254  m_Messages.Add( _( "Conductor Losses:" ) );
255  m_Messages.Add( _( "Dielectric Losses:" ) );
256  m_Messages.Add( _( "TE-Modes:" ) );
257  m_Messages.Add( _( "TM-Modes:" ) );
258 
260  "mu Rel I",_( "mu Rel I" ),
261  _( "Relative Permeability (mu) of Insulator" ), 1, false ) );
263  "mu Rel C",_( "mu Rel C" ),
264  _( "Relative Permeability (mu) of Conductor" ), 1,
265  false ) );
266 
268  "a", "a", _( "Width of Waveguide" ), 10.0, true ) );
270  "b", "b", _( "Height of Waveguide" ), 5.0, true ) );
272  "L", "L", _( "Waveguide Length" ), 50.0, true ) );
273 
275  "Z0", "Z0", _( "Characteristic Impedance" ), 50.0, true ) );
278  "Ang_l", "Ang_l", _( "Electrical Length" ), 0, true ) );
279  break;
280 
281  case COAX_TYPE: // coaxial cable
282  m_TLine = new COAX();
283  m_Icon = new wxBitmap( coax_xpm );
284  m_HasPrmSelection = true;
285 
286  m_Messages.Add( _( "ErEff:" ) );
287  m_Messages.Add( _( "Conductor Losses:" ) );
288  m_Messages.Add( _( "Dielectric Losses:" ) );
289  m_Messages.Add( _( "TE-Modes:" ) );
290  m_Messages.Add( _( "TM-Modes:" ) );
291 
293  "mu Rel I", _( "mu Rel I" ),
294  _( "Relative Permeability (mu) of Insulator" ), 1, false ) );
296  "mu Rel C", _( "mu Rel C" ),
297  _( "Relative Permeability (mu) of Conductor" ), 1,
298  false ) );
299 
301  "Din", _( "Din" ),
302  _( "Inner Diameter (conductor)" ), 1.0, true ) );
304  "Dout", _( "Dout" ),
305  _( "Outer Diameter (insulator)" ), 8.0, true ) );
307  "L", "L",
308  _( "Line Length" ), 50.0, true ) );
309 
311  "Z0", "Z0",
312  _( "Characteristic Impedance" ), 50.0, true ) );
315  "Ang_l", "Ang_l",
316  _( "Electrical Length" ), 0.0, true ) );
317  break;
318 
319  case C_MICROSTRIP_TYPE: // coupled microstrip
320  m_TLine = new C_MICROSTRIP();
321  m_Icon = new wxBitmap( c_microstrip_xpm );
322  m_HasPrmSelection = true;
323 
324  m_Messages.Add( _( "ErEff Even:" ) );
325  m_Messages.Add( _( "ErEff Odd:" ) );
326  m_Messages.Add( _( "Conductor Losses Even:" ) );
327  m_Messages.Add( _( "Conductor Losses Odd:" ) );
328  m_Messages.Add( _( "Dielectric Losses Even:" ) );
329  m_Messages.Add( _( "Dielectric Losses Odd:" ) );
330  m_Messages.Add( _( "Skin Depth:" ) );
331 
333  "H", "H",
334  _( "Height of Substrate" ), 0.2, true ) );
336  "H_t", "H_t",
337  _( "Height of Box Top" ), 1e20, true ) );
339  "T", "T",
340  _( "Strip Thickness" ), 0.035, true ) );
342  "Rough", _( "Rough" ),
343  _( "Conductor Roughness" ), 0.0, true ) );
345  "mu Rel C", _( "mu Rel C" ),
346  _( "Relative Permeability (mu) of Conductor" ), 1,
347  false ) );
348 
350  "W", "W",
351  _( "Line Width" ), 0.2, true ) );
353  "S", "S",
354  _( "Gap Width" ), 0.2, true ) );
356  "L", "L",
357  _( "Line Length" ), 50.0, true ) );
358 
360  "Zeven", _( "Zeven" ),
361  _( "Even mode impedance (lines driven by common voltages)" ), 50.0, true ) );
363  "Zodd", _( "Zodd" ),
364  _( "Odd mode impedance (lines driven by opposite (differential) voltages)" ), 50.0, true ) );
366  "Ang_l", "Ang_l",
367  _( "Electrical Length" ), 0.0, true ) );
368  break;
369 
370  case STRIPLINE_TYPE: // stripline
371  m_TLine = new STRIPLINE();
372  m_Icon = new wxBitmap( stripline_xpm );
373 
374  m_Messages.Add( _( "ErEff:" ) );
375  m_Messages.Add( _( "Conductor Losses:" ) );
376  m_Messages.Add( _( "Dielectric Losses:" ) );
377  m_Messages.Add( _( "Skin Depth:" ) );
378 
380  "H", "H",
381  _( "Height of Substrate" ), 0.2, true ) );
383  "a", "a",
384  _( "distance between strip and top metal" ), 0.2,
385  true ) );
387  "T", "T",
388  _( "Strip Thickness" ), 0.035, true ) );
390  "mu Rel C", _( "mu Rel C" ),
391  _( "Relative Permeability (mu) of Conductor" ), 1,
392  false ) );
393 
395  "W", "W",
396  _( "Line Width" ), 0.2, true ) );
398  "L", "L",
399  _( "Line Length" ), 50.0, true ) );
400 
402  "Z0", "Z0",
403  _( "Characteristic Impedance" ), 50, true ) );
406  "Ang_l", "Ang_l",
407  _( "Electrical Length" ), 0, true ) );
408  break;
409 
410  case TWISTEDPAIR_TYPE: // twisted pair
411  m_TLine = new TWISTEDPAIR();
412  m_Icon = new wxBitmap( twistedpair_xpm );
413  m_HasPrmSelection = true;
414 
415  m_Messages.Add( _( "ErEff:" ) );
416  m_Messages.Add( _( "Conductor Losses:" ) );
417  m_Messages.Add( _( "Dielectric Losses:" ) );
418  m_Messages.Add( _( "Skin Depth:" ) );
419 
421  "Twists", _( "Twists" ),
422  _( "Number of Twists per Length" ), 0.0, false ) );
424  "mu Rel C", _( "mu Rel C" ),
425  _( "Relative Permeability (mu) of Conductor" ), 1,
426  false ) );
428  "ErEnv", _( "ErEnv" ),
429  _( "Relative Permittivity of Environment" ), 1,
430  false ) );
432  "Din", _( "Din" ),
433  _( "Inner Diameter (conductor)" ), 1.0, true ) );
435  "Dout", _( "Dout" ),
436  _( "Outer Diameter (insulator)" ), 8.0, true ) );
438  "L", "L",
439  _( "Cable Length" ), 50.0, true ) );
440 
442  "Z0", "Z0",
443  _( "Characteristic Impedance" ), 50.0, true ) );
446  "Ang_l", "Ang_l",
447  _( "Electrical Length" ), 0.0, true ) );
448  break;
449 
450  case END_OF_LIST_TYPE: // Not really used
451  break;
452  }
453 }
wxBitmap * m_Icon
void AddPrm(TRANSLINE_PRM *aParam)
wxArrayString m_Messages
enum TRANSLINE_TYPE_ID m_Type
#define NULL
Definition: coax.h:30
#define _(s)
Definition: 3d_actions.cpp:33
TRANSLINE * m_TLine

References _, AddPrm(), ANG_L_PRM, C_MICROSTRIP_TYPE, COAX_TYPE, CPW_TYPE, DUMMY_PRM, END_OF_LIST_TYPE, EPSILONR_PRM, FREQUENCY_PRM, GROUNDED_CPW_TYPE, H_PRM, H_T_PRM, m_HasPrmSelection, m_Icon, m_Messages, m_TLine, m_Type, MICROSTRIP_TYPE, MUR_PRM, MURC_PRM, NULL, PHYS_DIAM_IN_PRM, PHYS_DIAM_OUT_PRM, PHYS_LEN_PRM, PHYS_S_PRM, PHYS_WIDTH_PRM, PRM_TYPE_ELEC, PRM_TYPE_FREQUENCY, PRM_TYPE_PHYS, PRM_TYPE_SUBS, RECTWAVEGUIDE_TYPE, RHO_PRM, ROUGH_PRM, STRIPLINE_A_PRM, STRIPLINE_TYPE, T_PRM, TAND_PRM, TWISTEDPAIR_EPSILONR_ENV_PRM, TWISTEDPAIR_TWIST_PRM, TWISTEDPAIR_TYPE, Z0_E_PRM, Z0_O_PRM, and Z0_PRM.

◆ ~TRANSLINE_IDENT()

TRANSLINE_IDENT::~TRANSLINE_IDENT ( )

Definition at line 455 of file transline_ident.cpp.

456 {
457  delete m_TLine;
458  delete m_Icon;
459 
460  for( auto& ii : m_prms_List )
461  delete ii;
462 
463  m_prms_List.clear();
464 }
wxBitmap * m_Icon
std::vector< TRANSLINE_PRM * > m_prms_List
TRANSLINE * m_TLine

References m_Icon, m_prms_List, and m_TLine.

Member Function Documentation

◆ AddPrm()

void TRANSLINE_IDENT::AddPrm ( TRANSLINE_PRM aParam)
inline

Definition at line 111 of file transline_ident.h.

112  {
113  m_prms_List.push_back( aParam );
114  }
std::vector< TRANSLINE_PRM * > m_prms_List

References m_prms_List.

Referenced by TRANSLINE_IDENT().

◆ GetPrm()

TRANSLINE_PRM* TRANSLINE_IDENT::GetPrm ( unsigned  aIdx)
inline

Definition at line 117 of file transline_ident.h.

118  {
119  if( aIdx < m_prms_List.size() )
120  return m_prms_List[aIdx];
121  else
122  return NULL;
123  }
#define NULL
std::vector< TRANSLINE_PRM * > m_prms_List

References m_prms_List, and NULL.

Referenced by PCB_CALCULATOR_FRAME::GetPrmValue(), PCB_CALCULATOR_FRAME::SetPrmBgColor(), PCB_CALCULATOR_FRAME::SetPrmValue(), PCB_CALCULATOR_FRAME::TransfDlgDataToTranslineParams(), and PCB_CALCULATOR_FRAME::TranslineTypeSelection().

◆ GetPrmsCount()

unsigned TRANSLINE_IDENT::GetPrmsCount ( )
inline

◆ ReadConfig()

void TRANSLINE_IDENT::ReadConfig ( )

Definition at line 467 of file transline_ident.cpp.

468 {
469  auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
470  std::string name( m_TLine->m_Name );
471 
472  if( cfg->m_TransLine.param_values.count( name ) )
473  {
474  wxASSERT( cfg->m_TransLine.param_units.count( name ) );
475 
476  for( auto& param : m_prms_List )
477  {
478  try
479  {
480  param->m_Value =
481  cfg->m_TransLine.param_values.at( name ).at( param->m_KeyWord );
482  param->m_UnitSelection =
483  cfg->m_TransLine.param_units.at( name ).at( param->m_KeyWord );
484  }
485  catch( ... )
486  {}
487  }
488  }
489 }
std::vector< TRANSLINE_PRM * > m_prms_List
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
const char * m_Name
Definition: transline.h:85
const char * name
Definition: DXF_plotter.cpp:60
TRANSLINE * m_TLine

References Kiface(), TRANSLINE::m_Name, m_prms_List, m_TLine, and name.

◆ WriteConfig()

void TRANSLINE_IDENT::WriteConfig ( )

Definition at line 492 of file transline_ident.cpp.

493 {
494  auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
495  std::string name( m_TLine->m_Name );
496 
497  for( auto& param : m_prms_List )
498  {
499  if( !std::isfinite( param->m_Value ) )
500  {
501  param->m_Value = 0;
502  }
503 
504  cfg->m_TransLine.param_values[ name ][ param->m_KeyWord ] = param->m_Value;
505  cfg->m_TransLine.param_units[ name ][ param->m_KeyWord ] = param->m_UnitSelection;
506  }
507 }
std::vector< TRANSLINE_PRM * > m_prms_List
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
const char * m_Name
Definition: transline.h:85
const char * name
Definition: DXF_plotter.cpp:60
TRANSLINE * m_TLine

References Kiface(), TRANSLINE::m_Name, m_prms_List, m_TLine, and name.

Member Data Documentation

◆ m_HasPrmSelection

bool TRANSLINE_IDENT::m_HasPrmSelection

◆ m_Icon

wxBitmap* TRANSLINE_IDENT::m_Icon

◆ m_Messages

wxArrayString TRANSLINE_IDENT::m_Messages

◆ m_prms_List

std::vector<TRANSLINE_PRM*> TRANSLINE_IDENT::m_prms_List
private

◆ m_TLine

◆ m_Type

enum TRANSLINE_TYPE_ID TRANSLINE_IDENT::m_Type

Definition at line 97 of file transline_ident.h.

Referenced by TRANSLINE_IDENT().


The documentation for this class was generated from the following files: