KiCad PCB EDA Suite
DIALOG_SPICE_MODEL::MODEL Struct Reference

Public Member Functions

 MODEL (int aLine, enum SPICE_PRIMITIVE aModel)
 

Static Public Member Functions

static SPICE_PRIMITIVE parseModelType (const wxString &aValue)
 

Convert string to model

More...
 

Public Attributes

int line
 

Line number in the library file

More...
 
SPICE_PRIMITIVE model
 

Type of the device

More...
 

Detailed Description

Definition at line 134 of file dialog_spice_model.h.

Constructor & Destructor Documentation

◆ MODEL()

DIALOG_SPICE_MODEL::MODEL::MODEL ( int  aLine,
enum SPICE_PRIMITIVE  aModel 
)
inline

Definition at line 145 of file dialog_spice_model.h.

146  : line( aLine ), model( aModel )
147  {
148  }
SPICE_PRIMITIVE model
Type of the device
int line
Line number in the library file

Member Function Documentation

◆ parseModelType()

SPICE_PRIMITIVE DIALOG_SPICE_MODEL::MODEL::parseModelType ( const wxString &  aValue)
static

Convert string to model

Definition at line 1072 of file dialog_spice_model.cpp.

1073 {
1074  wxCHECK( !aValue.IsEmpty(), SP_UNKNOWN );
1075  const wxString val( aValue.Lower() );
1076 
1077  for( const auto& model : modelTypes )
1078  {
1079  for( const auto& keyword : model.keywords )
1080  {
1081  if( val.StartsWith( keyword ) )
1082  return model.type;
1083  }
1084  }
1085 
1086  return SP_UNKNOWN;
1087 }
SPICE_PRIMITIVE model
Type of the device
static const std::vector< SPICE_MODEL_INFO > modelTypes

References model, modelTypes, and SP_UNKNOWN.

Referenced by DIALOG_SPICE_MODEL::loadLibrary().

Member Data Documentation

◆ line

int DIALOG_SPICE_MODEL::MODEL::line

Line number in the library file

Definition at line 137 of file dialog_spice_model.h.

◆ model

SPICE_PRIMITIVE DIALOG_SPICE_MODEL::MODEL::model

Type of the device

Definition at line 140 of file dialog_spice_model.h.

Referenced by parseModelType().


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