KiCad PCB EDA Suite
DIALOG_SPICE_MODEL Class Reference

#include <dialog_spice_model.h>

Inheritance diagram for DIALOG_SPICE_MODEL:
DIALOG_SPICE_MODEL_BASE DIALOG_SHIM KIWAY_HOLDER

Classes

struct  MODEL
 Models available in the selected library file. More...
 

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 DIALOG_SPICE_MODEL (wxWindow *aParent, SCH_SYMBOL &aSymbol, std::vector< SCH_FIELD > *aSchFields)
 
 DIALOG_SPICE_MODEL (wxWindow *aParent, SCH_SYMBOL &aSymbol, std::vector< LIB_FIELD > *aLibFields)
 
void SetInitialFocus (wxWindow *aWindow)
 Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown. More...
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal () const
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
void SetPosition (const wxPoint &aNewPosition)
 Force the position of the dialog to a new position. More...
 
EDA_UNITS GetUserUnits () const
 
HOLDER_TYPE GetType () const
 
KIWAYKiway () const
 Return a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Return a reference to the PROJECT associated with this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 It is only used for debugging, since "this" is not a wxWindow*. More...
 

Static Public Member Functions

static bool IsCtrl (int aChar, const wxKeyEvent &e)
 
static bool IsShiftCtrl (int aChar, const wxKeyEvent &e)
 

Protected Member Functions

void finishDialogSettings ()
 In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls. More...
 
void setSizeInDU (int x, int y)
 Set the dialog to the given dimensions in "dialog units". More...
 
int horizPixelsFromDU (int x) const
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int vertPixelsFromDU (int y) const
 Convert an integer number of dialog units to pixels, vertically. More...
 
void resetSize ()
 Clear the existing dialog size and position. More...
 
virtual void OnCharHook (wxKeyEvent &aEvt)
 

Protected Attributes

wxNotebook * m_notebook
 
wxPanel * m_passive
 
wxStaticText * m_staticTextPtype
 
wxComboBox * m_pasType
 
wxStaticText * m_staticText62
 
wxStaticText * m_staticTextPvalue
 
wxTextCtrl * m_pasValue
 
wxStaticText * m_staticTextSpVal
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticText32
 
wxStaticText * m_staticText321
 
wxStaticText * m_staticTextF1
 
wxStaticText * m_staticTextF2
 
wxStaticText * m_staticTextF3
 
wxStaticText * m_staticTextP1
 
wxStaticText * m_staticTextP2
 
wxStaticText * m_staticTextP3
 
wxStaticText * m_staticTextN1
 
wxStaticText * m_staticTextN2
 
wxStaticText * m_staticTextN3
 
wxStaticText * m_staticTextU1
 
wxStaticText * m_staticTextU2
 
wxStaticText * m_staticTextU3
 
wxStaticText * m_staticTextM1
 
wxStaticText * m_staticTextM2
 
wxStaticText * m_staticTextM3
 
wxStaticText * m_staticTextK1
 
wxStaticText * m_staticTextK2
 
wxStaticText * m_staticTextK3
 
wxStaticText * m_staticTextMeg1
 
wxStaticText * m_staticTextMeg2
 
wxStaticText * m_staticTextMeg3
 
wxStaticText * m_staticTextG1
 
wxStaticText * m_staticTextG2
 
wxStaticText * m_staticTextG3
 
wxStaticText * m_staticTextT1
 
wxStaticText * m_staticTextT2
 
wxStaticText * m_staticTextT3
 
wxPanel * m_model
 
wxStaticText * m_staticText7
 
wxTextCtrl * m_modelLibrary
 
wxButton * m_selectLibrary
 
wxStaticText * m_staticText5
 
wxComboBox * m_modelName
 
wxStaticText * m_staticText4
 
wxComboBox * m_modelType
 
wxStaticText * m_staticTextNote
 
wxStaticText * m_stInfoNote
 
wxStyledTextCtrl * m_libraryContents
 
wxPanel * m_power
 
wxStaticText * m_staticText10
 
wxTextCtrl * m_genDc
 
wxStaticText * m_staticText113
 
wxStaticText * m_staticText11
 
wxTextCtrl * m_genAcMag
 
wxStaticText * m_staticText111
 
wxStaticText * m_staticText12
 
wxTextCtrl * m_genAcPhase
 
wxStaticText * m_staticText112
 
wxNotebook * m_powerNotebook
 
wxPanel * m_pwrPulse
 
wxStaticText * m_staticText13
 
wxTextCtrl * m_pulseInit
 
wxStaticText * m_staticText131
 
wxStaticText * m_staticText14
 
wxTextCtrl * m_pulseNominal
 
wxStaticText * m_staticText132
 
wxStaticText * m_staticText15
 
wxTextCtrl * m_pulseDelay
 
wxStaticText * m_staticText133
 
wxStaticText * m_staticText16
 
wxTextCtrl * m_pulseRise
 
wxStaticText * m_staticText134
 
wxStaticText * m_staticText17
 
wxTextCtrl * m_pulseFall
 
wxStaticText * m_staticText135
 
wxStaticText * m_staticText18
 
wxTextCtrl * m_pulseWidth
 
wxStaticText * m_staticText136
 
wxStaticText * m_staticText20
 
wxTextCtrl * m_pulsePeriod
 
wxStaticText * m_staticText137
 
wxPanel * m_pwrSin
 
wxStaticText * m_staticText21
 
wxTextCtrl * m_sinOffset
 
wxStaticText * m_staticText211
 
wxStaticText * m_staticText22
 
wxTextCtrl * m_sinAmplitude
 
wxStaticText * m_staticText212
 
wxStaticText * m_staticText23
 
wxTextCtrl * m_sinFreq
 
wxStaticText * m_staticText213
 
wxStaticText * m_staticText24
 
wxTextCtrl * m_sinDelay
 
wxStaticText * m_staticText214
 
wxStaticText * m_staticText25
 
wxTextCtrl * m_sinDampFactor
 
wxStaticText * m_staticText215
 
wxPanel * m_pwrExp
 
wxStaticText * m_staticText26
 
wxTextCtrl * m_expInit
 
wxStaticText * m_staticText261
 
wxStaticText * m_staticText27
 
wxTextCtrl * m_expPulsed
 
wxStaticText * m_staticText262
 
wxStaticText * m_staticText28
 
wxTextCtrl * m_expRiseDelay
 
wxStaticText * m_staticText263
 
wxStaticText * m_staticText29
 
wxTextCtrl * m_expRiseConst
 
wxStaticText * m_staticText264
 
wxStaticText * m_staticText30
 
wxTextCtrl * m_expFallDelay
 
wxStaticText * m_staticText265
 
wxStaticText * m_staticText31
 
wxTextCtrl * m_expFallConst
 
wxStaticText * m_staticText266
 
wxPanel * m_pwrPwl
 
wxStaticText * m_staticText34
 
wxTextCtrl * m_pwlTime
 
wxStaticText * m_staticText342
 
wxStaticText * m_staticText35
 
wxTextCtrl * m_pwlValue
 
wxStaticText * m_staticText343
 
wxButton * m_pwlAddButton
 
wxListCtrl * m_pwlValList
 
wxButton * m_pwlRemoveBtn
 
wxPanel * m_pwrFm
 
wxStaticText * m_staticText138
 
wxTextCtrl * m_fmOffset
 
wxStaticText * m_staticText1311
 
wxStaticText * m_staticText141
 
wxTextCtrl * m_fmAmplitude
 
wxStaticText * m_staticText1321
 
wxStaticText * m_staticText151
 
wxTextCtrl * m_fmFcarrier
 
wxStaticText * m_staticText1331
 
wxStaticText * m_staticText161
 
wxTextCtrl * m_fmModIndex
 
wxStaticText * m_staticText1341
 
wxStaticText * m_staticText171
 
wxTextCtrl * m_fmFsignal
 
wxStaticText * m_staticText1351
 
wxStaticText * m_staticText181
 
wxTextCtrl * m_fmPhaseC
 
wxStaticText * m_staticText1361
 
wxStaticText * m_staticText201
 
wxTextCtrl * m_fmPhaseS
 
wxStaticText * m_staticText1371
 
wxPanel * m_pwrAm
 
wxStaticText * m_staticText1381
 
wxTextCtrl * m_amAmplitude
 
wxStaticText * m_staticText13111
 
wxStaticText * m_staticText1411
 
wxTextCtrl * m_amOffset
 
wxStaticText * m_staticText13211
 
wxStaticText * m_staticText1511
 
wxTextCtrl * m_amModulatingFreq
 
wxStaticText * m_staticText13311
 
wxStaticText * m_staticText1611
 
wxTextCtrl * m_amCarrierFreq
 
wxStaticText * m_staticText13411
 
wxStaticText * m_staticText1711
 
wxTextCtrl * m_amSignalDelay
 
wxStaticText * m_staticText13511
 
wxStaticText * m_staticText1811
 
wxTextCtrl * m_amPhase
 
wxStaticText * m_staticText13611
 
wxPanel * m_pwrTransNoise
 
wxPanel * m_pwrRandom
 
wxStaticText * m_staticText27111
 
wxChoice * m_rnType
 
wxStaticText * m_staticText26711
 
wxTextCtrl * m_rnTS
 
wxStaticText * m_staticText262111
 
wxStaticText * m_staticText28111
 
wxTextCtrl * m_rnTD
 
wxStaticText * m_staticText263111
 
wxStaticText * m_rnParam1Text
 
wxTextCtrl * m_rnParam1
 
wxStaticText * m_rnParam2Text
 
wxTextCtrl * m_rnParam2
 
wxPanel * m_pwrExtData
 
wxRadioBox * m_pwrType
 
wxStaticLine * m_staticline2
 
wxCheckBox * m_disabled
 
wxCheckBox * m_nodeSeqCheck
 
wxTextCtrl * m_nodeSeqVal
 
wxStaticLine * m_staticline3
 
wxStdDialogButtonSizer * m_sdbSizer
 
wxButton * m_sdbSizerOK
 
wxButton * m_sdbSizerCancel
 
EDA_UNITS m_units
 
std::string m_hash_key
 
bool m_useCalculatedSize
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 
EDA_BASE_FRAMEm_parentFrame
 
std::vector< wxWindow * > m_tabOrder
 
wxSize m_initialSize
 

Private Member Functions

bool parsePowerSource (const wxString &aModel)
 Parse a string describing a power source, so appropriate settings are checked in the dialog. More...
 
bool generatePowerSource (wxString &aTarget)
 Generate a string to describe power source parameters, basing on the current selection. More...
 
void loadLibrary (const wxString &aFilePath)
 Load a list of components (.model and .subckt) from a spice library file and add them to a combo box. More...
 
SCH_FIELDgetSchField (int aFieldType)
 Return or create a field in the edited schematic fields vector. More...
 
LIB_FIELDgetLibField (int aFieldType)
 
bool addPwlValue (const wxString &aTime, const wxString &aValue)
 Add a value to the PWL values list. More...
 
virtual bool TransferDataFromWindow () override
 
virtual bool TransferDataToWindow () override
 
virtual bool Validate () override
 
virtual void onInitDlg (wxInitDialogEvent &event) override
 
void Init ()
 Initialize the internal settings. More...
 
void showPinOrderNote (int aModelType)
 Display a note info about pin order. More...
 
void onSelectLibrary (wxCommandEvent &event) override
 
void onModelSelected (wxCommandEvent &event) override
 
void onPwlAdd (wxCommandEvent &event) override
 
void onPwlRemove (wxCommandEvent &event) override
 
void onRandomSourceType (wxCommandEvent &event) override
 
void onTypeSelected (wxCommandEvent &event) override
 Edited symbol. More...
 

Private Attributes

SCH_SYMBOLm_symbol
 Fields from the symbol properties dialog. More...
 
std::vector< SCH_FIELD > * m_schfields
 
std::vector< LIB_FIELD > * m_libfields
 
bool m_useSchFields
 Temporary field values. More...
 
std::map< int, wxString > m_fieldsTmp
 
std::map< wxString, MODELm_models
 Column identifiers for PWL power source value list. More...
 
long m_pwlTimeCol
 
long m_pwlValueCol
 
SPICE_VALIDATOR m_spiceValidator
 
SPICE_VALIDATOR m_spiceEmptyValidator
 
wxTextValidator m_notEmptyValidator
 

Detailed Description

Definition at line 40 of file dialog_spice_model.h.

Member Enumeration Documentation

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 39 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ DIALOG_SPICE_MODEL() [1/2]

DIALOG_SPICE_MODEL::DIALOG_SPICE_MODEL ( wxWindow *  aParent,
SCH_SYMBOL aSymbol,
std::vector< SCH_FIELD > *  aSchFields 
)

◆ DIALOG_SPICE_MODEL() [2/2]

DIALOG_SPICE_MODEL::DIALOG_SPICE_MODEL ( wxWindow *  aParent,
SCH_SYMBOL aSymbol,
std::vector< LIB_FIELD > *  aLibFields 
)

Definition at line 122 of file dialog_spice_model.cpp.

123  :
124  DIALOG_SPICE_MODEL_BASE( aParent ),
125  m_symbol( aSymbol ),
126  m_schfields( nullptr ),
127  m_libfields( aFields ),
128  m_useSchFields( false ),
129  m_spiceEmptyValidator( true ),
130  m_notEmptyValidator( wxFILTER_EMPTY )
131 {
132  Init();
133 }
void Init()
Initialize the internal settings.
std::vector< LIB_FIELD > * m_libfields
bool m_useSchFields
Temporary field values.
SCH_SYMBOL & m_symbol
Fields from the symbol properties dialog.
wxTextValidator m_notEmptyValidator
DIALOG_SPICE_MODEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Spice Model Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
std::vector< SCH_FIELD > * m_schfields
SPICE_VALIDATOR m_spiceEmptyValidator

References Init().

Member Function Documentation

◆ addPwlValue()

bool DIALOG_SPICE_MODEL::addPwlValue ( const wxString &  aTime,
const wxString &  aValue 
)
private

Add a value to the PWL values list.

Parameters
aTimeis the time value.
aValueis the source value at the given time.
Returns
True if request has completed successfully, false if the data is invalid.

Definition at line 981 of file dialog_spice_model.cpp.

982 {
983  // TODO execute validators
984  if( aTime.IsEmpty() || aValue.IsEmpty() )
985  return false;
986 
987  long idx = m_pwlValList->InsertItem( m_pwlTimeCol, aTime );
988  m_pwlValList->SetItem( idx, m_pwlValueCol, aValue );
989 
990  // There is no wxString::ToFloat, but we need to guarantee it fits in 4 bytes
991  double timeD;
992  float timeF;
993  m_pwlTime->GetValue().ToDouble( &timeD );
994  timeF = timeD;
995  long data;
996  std::memcpy( &data, &timeF, sizeof( timeF ) );
997 
998  // Store the time value, so the entries can be sorted
999  m_pwlValList->SetItemData( idx, data );
1000 
1001  // Sort items by timestamp
1002  m_pwlValList->SortItems( comparePwlValues, -1 );
1003 
1004  return true;
1005 }
static int wxCALLBACK comparePwlValues(wxIntPtr aItem1, wxIntPtr aItem2, wxIntPtr WXUNUSED(aSortData))

References comparePwlValues(), DIALOG_SPICE_MODEL_BASE::m_pwlTime, m_pwlTimeCol, DIALOG_SPICE_MODEL_BASE::m_pwlValList, and m_pwlValueCol.

Referenced by onPwlAdd(), and parsePowerSource().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 312 of file dialog_shim.cpp.

313 {
314  // so we can do logging of this state change:
315  return wxDialog::Enable( enable );
316 }

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 473 of file dialog_shim.cpp.

474 {
475  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
476  // handle validation in the same way as other dialogs.
477  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
478  return;
479 
480  SetReturnCode( retCode );
481 
482  if( !IsQuasiModal() )
483  {
484  wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
485  "wasn't called" );
486  return;
487  }
488 
489  if( m_qmodal_loop )
490  {
491  if( m_qmodal_loop->IsRunning() )
492  m_qmodal_loop->Exit( 0 );
493  else
494  m_qmodal_loop->ScheduleExit( 0 );
495 
496  m_qmodal_loop = nullptr;
497  }
498 
500  m_qmodal_parent_disabler = nullptr;
501 
502  Show( false );
503 }
bool IsQuasiModal() const
Definition: dialog_shim.h:106
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:211
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:214

References DIALOG_SHIM::IsQuasiModal(), DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, and DIALOG_SHIM::Show().

Referenced by NETLIST_DIALOG::OnAddGenerator(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_SYMBOLS_LIBID::onCancel(), DIALOG_LIB_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), NETLIST_DIALOG::OnDelGenerator(), DIALOG_SYMBOL_PROPERTIES::OnEditLibrarySymbol(), DIALOG_SYMBOL_PROPERTIES::OnEditSymbol(), DIALOG_SYMBOL_PROPERTIES::OnExchangeSymbol(), PCB_ONE_LAYER_SELECTOR::OnLeftGridCellClick(), PCB_ONE_LAYER_SELECTOR::OnRightGridCellClick(), DIALOG_SYMBOL_PROPERTIES::OnUpdateSymbol(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ finishDialogSettings()

void DIALOG_SHIM::finishDialogSettings ( )
protectedinherited

In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls.

finishDialogSettings must be called from derived classes after all widgets have been initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at the end of TransferDataToWindow, or better yet, at end of a wxInitDialogEvent handler.

Definition at line 151 of file dialog_shim.cpp.

152 {
153  // must be called from the constructor of derived classes,
154  // when all widgets are initialized, and therefore their size fixed
155 
156  // SetSizeHints fixes the minimal size of sizers in the dialog
157  // (SetSizeHints calls Fit(), so no need to call it)
158  GetSizer()->SetSizeHints( this );
159 }

Referenced by DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOM::DIALOG_BOM(), DIALOG_BUS_MANAGER::DIALOG_BUS_MANAGER(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_DRC::DIALOG_DRC(), DIALOG_EDIT_SYMBOLS_LIBID::DIALOG_EDIT_SYMBOLS_LIBID(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LINE_WIRE_BUS_PROPERTIES::DIALOG_LINE_WIRE_BUS_PROPERTIES(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_REGULATOR_FORM::DIALOG_REGULATOR_FORM(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), DIALOG_CONSTRAINTS_REPORTER::FinishInitialization(), PAGED_DIALOG::finishInitialization(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SHEET_PROPERTIES::OnInitDlg(), DIALOG_SYMBOL_PROPERTIES::OnInitDlg(), onInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_BOARD_STATISTICS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

◆ generatePowerSource()

bool DIALOG_SPICE_MODEL::generatePowerSource ( wxString &  aTarget)
private

Generate a string to describe power source parameters, basing on the current selection.

If there are missing fields, it will not modify the target string.

Parameters
aTargetis the destination for the generated string.
Returns
True if the string was saved successfully.

DC / AC section

Transient section

Definition at line 654 of file dialog_spice_model.cpp.

655 {
656  wxString acdc, trans;
657  wxWindow* page = m_powerNotebook->GetCurrentPage();
658  bool useTrans = true; // shall we use the transient command part?
659 
660  // Variables for generic processing
661  bool genericProcessing = false;
662  unsigned int genericReqParamsCount = 0;
663  std::vector<wxTextCtrl*> genericControls;
664 
666  // If SPICE_VALUE can be properly constructed, then it is a valid value
667  try
668  {
669  if( !empty( m_genDc ) )
670  acdc += wxString::Format( "dc %s ",
671  SPICE_VALUE( m_genDc->GetValue() ).ToSpiceString() );
672  }
673  catch( ... )
674  {
675  DisplayError( this, wxT( "Invalid DC value" ) );
676  return false;
677  }
678 
679  try
680  {
681  if( !empty( m_genAcMag ) )
682  {
683  acdc += wxString::Format( "ac %s ",
684  SPICE_VALUE( m_genAcMag->GetValue() ).ToSpiceString() );
685 
686  if( !empty( m_genAcPhase ) )
687  acdc += wxString::Format( "%s ",
688  SPICE_VALUE( m_genAcPhase->GetValue() ).ToSpiceString() );
689  }
690  }
691  catch( ... )
692  {
693  DisplayError( this, wxT( "Invalid AC magnitude or phase" ) );
694  return false;
695  }
696 
698  if( page == m_pwrPulse )
699  {
700  if( !m_pwrPulse->Validate() )
701  return false;
702 
703  genericProcessing = true;
704  trans += "pulse(";
705  genericReqParamsCount = 2;
706  genericControls = { m_pulseInit, m_pulseNominal, m_pulseDelay,
708  }
709  else if( page == m_pwrSin )
710  {
711  if( !m_pwrSin->Validate() )
712  return false;
713 
714  genericProcessing = true;
715  trans += "sin(";
716  genericReqParamsCount = 2;
718  }
719  else if( page == m_pwrExp )
720  {
721  if( !m_pwrExp->Validate() )
722  return false;
723 
724  genericProcessing = true;
725  trans += "exp(";
726  genericReqParamsCount = 2;
727  genericControls = { m_expInit, m_expPulsed,
729  }
730  else if( page == m_pwrPwl )
731  {
732  if( m_pwlValList->GetItemCount() > 0 )
733  {
734  trans += "pwl(";
735 
736  for( int i = 0; i < m_pwlValList->GetItemCount(); ++i )
737  {
738  trans += wxString::Format( "%s %s ", m_pwlValList->GetItemText( i, m_pwlTimeCol ),
739  m_pwlValList->GetItemText( i, m_pwlValueCol ) );
740  }
741 
742  trans.Trim();
743  trans += ")";
744  }
745  }
746  else if( page == m_pwrFm )
747  {
748  if( !m_pwrFm->Validate() )
749  return false;
750 
751  genericProcessing = true;
752  trans += "sffm(";
753  genericReqParamsCount = 4;
756  }
757  else if( page == m_pwrAm )
758  {
759  if( !m_pwrAm->Validate() )
760  return false;
761 
762  genericProcessing = true;
763  trans += "am(";
764  genericReqParamsCount = 5;
767  }
768  else if( page == m_pwrRandom )
769  {
770  if( !m_pwrRandom->Validate() )
771  return false;
772 
773  // first parameter must be retrieved from drop-down list selection
774  trans += "trrandom(";
775  trans.Append( wxString::Format( wxT( "%i " ), ( m_rnType->GetSelection() + 1 ) ) );
776 
777  genericProcessing = true;
778  genericReqParamsCount = 4;
779  genericControls = { m_rnTS, m_rnTD, m_rnParam1, m_rnParam2 };
780  }
781  if( genericProcessing )
782  {
783  auto first_empty = std::find_if( genericControls.begin(), genericControls.end(), empty );
784  auto first_not_empty = std::find_if( genericControls.begin(), genericControls.end(),
785  []( const wxTextCtrl* c ){ return !empty( c ); } );
786 
787  if( std::distance( first_not_empty, genericControls.end() ) == 0 )
788  {
789  // all empty
790  useTrans = false;
791  }
792  else if( std::distance( genericControls.begin(),
793  first_empty ) < (int)genericReqParamsCount )
794  {
795  DisplayError( nullptr,
796  wxString::Format( _( "You need to specify at least the "
797  "first %d parameters for the transient source" ),
798  genericReqParamsCount ) );
799 
800  return false;
801  }
802  else if( std::find_if_not( first_empty, genericControls.end(),
803  empty ) != genericControls.end() )
804  {
805  DisplayError( nullptr, _( "You cannot leave interleaved empty fields "
806  "when defining a transient source" ) );
807  return false;
808  }
809  else
810  {
811  std::for_each( genericControls.begin(), first_empty, [&trans] ( wxTextCtrl* ctrl ) {
812  trans += wxString::Format( "%s ", ctrl->GetValue() );
813  } );
814  }
815 
816  trans.Trim();
817  trans += ")";
818  }
819 
820  aTarget = acdc;
821 
822  if( useTrans )
823  aTarget += trans;
824 
825  // Remove whitespaces from left and right side
826  aTarget.Trim( false );
827  aTarget.Trim( true );
828 
829  return true;
830 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:279
static bool empty(const wxTextCtrl *aCtrl)
< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg) Helper class to recognize Spi...
Definition: spice_value.h:34
#define _(s)
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References _, DisplayError(), distance(), empty(), Format(), DIALOG_SPICE_MODEL_BASE::m_amAmplitude, DIALOG_SPICE_MODEL_BASE::m_amCarrierFreq, DIALOG_SPICE_MODEL_BASE::m_amModulatingFreq, DIALOG_SPICE_MODEL_BASE::m_amOffset, DIALOG_SPICE_MODEL_BASE::m_amPhase, DIALOG_SPICE_MODEL_BASE::m_amSignalDelay, DIALOG_SPICE_MODEL_BASE::m_expFallConst, DIALOG_SPICE_MODEL_BASE::m_expFallDelay, DIALOG_SPICE_MODEL_BASE::m_expInit, DIALOG_SPICE_MODEL_BASE::m_expPulsed, DIALOG_SPICE_MODEL_BASE::m_expRiseConst, DIALOG_SPICE_MODEL_BASE::m_expRiseDelay, DIALOG_SPICE_MODEL_BASE::m_fmAmplitude, DIALOG_SPICE_MODEL_BASE::m_fmFcarrier, DIALOG_SPICE_MODEL_BASE::m_fmFsignal, DIALOG_SPICE_MODEL_BASE::m_fmModIndex, DIALOG_SPICE_MODEL_BASE::m_fmOffset, DIALOG_SPICE_MODEL_BASE::m_fmPhaseC, DIALOG_SPICE_MODEL_BASE::m_fmPhaseS, DIALOG_SPICE_MODEL_BASE::m_genAcMag, DIALOG_SPICE_MODEL_BASE::m_genAcPhase, DIALOG_SPICE_MODEL_BASE::m_genDc, DIALOG_SPICE_MODEL_BASE::m_powerNotebook, DIALOG_SPICE_MODEL_BASE::m_pulseDelay, DIALOG_SPICE_MODEL_BASE::m_pulseFall, DIALOG_SPICE_MODEL_BASE::m_pulseInit, DIALOG_SPICE_MODEL_BASE::m_pulseNominal, DIALOG_SPICE_MODEL_BASE::m_pulsePeriod, DIALOG_SPICE_MODEL_BASE::m_pulseRise, DIALOG_SPICE_MODEL_BASE::m_pulseWidth, m_pwlTimeCol, DIALOG_SPICE_MODEL_BASE::m_pwlValList, m_pwlValueCol, DIALOG_SPICE_MODEL_BASE::m_pwrAm, DIALOG_SPICE_MODEL_BASE::m_pwrExp, DIALOG_SPICE_MODEL_BASE::m_pwrFm, DIALOG_SPICE_MODEL_BASE::m_pwrPulse, DIALOG_SPICE_MODEL_BASE::m_pwrPwl, DIALOG_SPICE_MODEL_BASE::m_pwrRandom, DIALOG_SPICE_MODEL_BASE::m_pwrSin, DIALOG_SPICE_MODEL_BASE::m_rnParam1, DIALOG_SPICE_MODEL_BASE::m_rnParam2, DIALOG_SPICE_MODEL_BASE::m_rnTD, DIALOG_SPICE_MODEL_BASE::m_rnTS, DIALOG_SPICE_MODEL_BASE::m_rnType, DIALOG_SPICE_MODEL_BASE::m_sinAmplitude, DIALOG_SPICE_MODEL_BASE::m_sinDampFactor, DIALOG_SPICE_MODEL_BASE::m_sinDelay, DIALOG_SPICE_MODEL_BASE::m_sinFreq, and DIALOG_SPICE_MODEL_BASE::m_sinOffset.

Referenced by TransferDataFromWindow().

◆ getLibField()

LIB_FIELD & DIALOG_SPICE_MODEL::getLibField ( int  aFieldType)
private

Definition at line 956 of file dialog_spice_model.cpp.

957 {
958  const wxString& spiceField =
960 
961  auto fieldIt = std::find_if( m_libfields->begin(), m_libfields->end(),
962  [&]( const LIB_FIELD& f )
963  {
964  return f.GetName() == spiceField;
965  } );
966 
967  // Found one, so return it
968  if( fieldIt != m_libfields->end() )
969  return *fieldIt;
970 
971  // Create a new field with requested name
972  LIB_FIELD new_field( m_libfields->size() );
973  m_libfields->front().Copy( &new_field );
974  new_field.SetName( spiceField );
975 
976  m_libfields->push_back( new_field );
977  return m_libfields->back();
978 }
std::vector< LIB_FIELD > * m_libfields
Field object used in symbol libraries.
Definition: lib_field.h:59
static const wxString & GetSpiceFieldName(SPICE_FIELD aField)
Return a string used for a particular component field related to Spice simulation.

References NETLIST_EXPORTER_PSPICE::GetSpiceFieldName(), and m_libfields.

Referenced by TransferDataFromWindow().

◆ getSchField()

SCH_FIELD & DIALOG_SPICE_MODEL::getSchField ( int  aFieldType)
private

Return or create a field in the edited schematic fields vector.

Parameters
aFieldTypeis an SPICE_FIELD enum value.
Returns
Requested field.

Definition at line 935 of file dialog_spice_model.cpp.

936 {
937  const wxString& spiceField =
939 
940  auto fieldIt = std::find_if( m_schfields->begin(), m_schfields->end(),
941  [&]( const SCH_FIELD& f )
942  {
943  return f.GetName() == spiceField;
944  } );
945 
946  // Found one, so return it
947  if( fieldIt != m_schfields->end() )
948  return *fieldIt;
949 
950  // Create a new field with requested name
951  m_schfields->emplace_back( wxPoint(), m_schfields->size(), &m_symbol, spiceField );
952  return m_schfields->back();
953 }
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
static const wxString & GetSpiceFieldName(SPICE_FIELD aField)
Return a string used for a particular component field related to Spice simulation.
SCH_SYMBOL & m_symbol
Fields from the symbol properties dialog.
std::vector< SCH_FIELD > * m_schfields

References NETLIST_EXPORTER_PSPICE::GetSpiceFieldName(), m_schfields, and m_symbol.

Referenced by TransferDataFromWindow().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( ) const
inlineinherited

Definition at line 46 of file kiway_holder.h.

46 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:76

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

◆ horizPixelsFromDU()

int DIALOG_SHIM::horizPixelsFromDU ( int  x) const
protectedinherited

Convert an integer number of dialog units to pixels, horizontally.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 169 of file dialog_shim.cpp.

170 {
171  wxSize sz( x, 0 );
172  return ConvertDialogToPixels( sz ).x;
173 }

Referenced by DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL().

◆ Init()

void DIALOG_SPICE_MODEL::Init ( )
private

Initialize the internal settings.

Definition at line 136 of file dialog_spice_model.cpp.

137 {
138  m_pasValue->SetValidator( m_spiceValidator );
139 
140  m_modelType->SetValidator( m_notEmptyValidator );
141  m_modelType->Clear();
142 
143  // Create a list of handled models
144  for( const auto& model : modelTypes )
145  m_modelType->Append( model.description );
146 
147  m_modelName->SetValidator( m_notEmptyValidator );
148 
149  m_genDc->SetValidator( m_spiceEmptyValidator );
150  m_genAcMag->SetValidator( m_spiceEmptyValidator );
151  m_genAcPhase->SetValidator( m_spiceEmptyValidator );
152 
153  m_pulseInit->SetValidator( m_spiceEmptyValidator );
154  m_pulseNominal->SetValidator( m_spiceEmptyValidator );
155  m_pulseDelay->SetValidator( m_spiceEmptyValidator );
156  m_pulseRise->SetValidator( m_spiceEmptyValidator );
157  m_pulseFall->SetValidator( m_spiceEmptyValidator );
158  m_pulseWidth->SetValidator( m_spiceEmptyValidator );
159  m_pulsePeriod->SetValidator( m_spiceEmptyValidator );
160 
161  m_sinOffset->SetValidator( m_spiceEmptyValidator );
162  m_sinAmplitude->SetValidator( m_spiceEmptyValidator );
163  m_sinFreq->SetValidator( m_spiceEmptyValidator );
164  m_sinDelay->SetValidator( m_spiceEmptyValidator );
165  m_sinDampFactor->SetValidator( m_spiceEmptyValidator );
166 
167  m_expInit->SetValidator( m_spiceEmptyValidator );
168  m_expPulsed->SetValidator( m_spiceEmptyValidator );
169  m_expRiseDelay->SetValidator( m_spiceEmptyValidator );
170  m_expRiseConst->SetValidator( m_spiceEmptyValidator );
171  m_expFallDelay->SetValidator( m_spiceEmptyValidator );
172  m_expFallConst->SetValidator( m_spiceEmptyValidator );
173 
174  m_fmOffset->SetValidator( m_spiceEmptyValidator );
175  m_fmAmplitude->SetValidator( m_spiceEmptyValidator );
176  m_fmFcarrier->SetValidator( m_spiceEmptyValidator );
177  m_fmModIndex->SetValidator( m_spiceEmptyValidator );
178  m_fmFsignal->SetValidator( m_spiceEmptyValidator );
179  m_fmPhaseC->SetValidator( m_spiceEmptyValidator );
180  m_fmPhaseS->SetValidator( m_spiceEmptyValidator );
181 
182  m_amAmplitude->SetValidator( m_spiceEmptyValidator );
183  m_amOffset->SetValidator( m_spiceEmptyValidator );
184  m_amModulatingFreq->SetValidator( m_spiceEmptyValidator );
185  m_amCarrierFreq->SetValidator( m_spiceEmptyValidator );
186  m_amSignalDelay->SetValidator( m_spiceEmptyValidator );
187  m_amPhase->SetValidator( m_spiceEmptyValidator );
188 
189  m_rnTS->SetValidator( m_spiceEmptyValidator );
190  m_rnTD->SetValidator( m_spiceEmptyValidator );
191  m_rnParam1->SetValidator( m_spiceEmptyValidator );
192  m_rnParam2->SetValidator( m_spiceEmptyValidator );
193 
194  m_pwlTimeCol = m_pwlValList->AppendColumn( "Time [s]", wxLIST_FORMAT_LEFT, 100 );
195  m_pwlValueCol = m_pwlValList->AppendColumn( "Value [V/A]", wxLIST_FORMAT_LEFT, 100 );
196 
197  m_sdbSizerOK->SetDefault();
198 
199  m_staticTextF1->SetLabel( wxS( "f" ) );
200  m_staticTextP1->SetLabel( wxS( "p" ) );
201  m_staticTextN1->SetLabel( wxS( "n" ) );
202  m_staticTextU1->SetLabel( wxS( "u" ) );
203  m_staticTextM1->SetLabel( wxS( "m" ) );
204  m_staticTextK1->SetLabel( wxS( "k" ) );
205  m_staticTextMeg1->SetLabel( wxS( "meg" ) );
206  m_staticTextG1->SetLabel( wxS( "g" ) );
207  m_staticTextT1->SetLabel( wxS( "t" ) );
208 
209  m_staticTextF2->SetLabel( wxS( "femto" ) );
210  m_staticTextP2->SetLabel( wxS( "pico" ) );
211  m_staticTextN2->SetLabel( wxS( "nano" ) );
212  m_staticTextU2->SetLabel( wxS( "micro" ) );
213  m_staticTextM2->SetLabel( wxS( "milli" ) );
214  m_staticTextK2->SetLabel( wxS( "kilo" ) );
215  m_staticTextMeg2->SetLabel( wxS( "mega" ) );
216  m_staticTextG2->SetLabel( wxS( "giga" ) );
217  m_staticTextT2->SetLabel( wxS( "terra" ) );
218 
219  m_staticTextF3->SetLabel( wxS( "1e-15" ) );
220  m_staticTextP3->SetLabel( wxS( "1e-12" ) );
221  m_staticTextN3->SetLabel( wxS( "1e-9" ) );
222  m_staticTextU3->SetLabel( wxS( "1e-6" ) );
223  m_staticTextM3->SetLabel( wxS( "1e-3" ) );
224  m_staticTextK3->SetLabel( wxS( "1e3" ) );
225  m_staticTextMeg3->SetLabel( wxS( "1e6" ) );
226  m_staticTextG3->SetLabel( wxS( "1e9" ) );
227  m_staticTextT3->SetLabel( wxS( "1e12" ) );
228 
229  // Hide pages that aren't fully implemented yet
230  // wxPanel::Hide() isn't enough on some platforms
231  m_powerNotebook->RemovePage( m_powerNotebook->FindPage( m_pwrTransNoise ) );
232  m_powerNotebook->RemovePage( m_powerNotebook->FindPage( m_pwrExtData ) );
233 }
SPICE_VALIDATOR m_spiceValidator
wxTextValidator m_notEmptyValidator
SPICE_VALIDATOR m_spiceEmptyValidator
static const std::vector< SPICE_MODEL_INFO > modelTypes

References DIALOG_SPICE_MODEL_BASE::m_amAmplitude, DIALOG_SPICE_MODEL_BASE::m_amCarrierFreq, DIALOG_SPICE_MODEL_BASE::m_amModulatingFreq, DIALOG_SPICE_MODEL_BASE::m_amOffset, DIALOG_SPICE_MODEL_BASE::m_amPhase, DIALOG_SPICE_MODEL_BASE::m_amSignalDelay, DIALOG_SPICE_MODEL_BASE::m_expFallConst, DIALOG_SPICE_MODEL_BASE::m_expFallDelay, DIALOG_SPICE_MODEL_BASE::m_expInit, DIALOG_SPICE_MODEL_BASE::m_expPulsed, DIALOG_SPICE_MODEL_BASE::m_expRiseConst, DIALOG_SPICE_MODEL_BASE::m_expRiseDelay, DIALOG_SPICE_MODEL_BASE::m_fmAmplitude, DIALOG_SPICE_MODEL_BASE::m_fmFcarrier, DIALOG_SPICE_MODEL_BASE::m_fmFsignal, DIALOG_SPICE_MODEL_BASE::m_fmModIndex, DIALOG_SPICE_MODEL_BASE::m_fmOffset, DIALOG_SPICE_MODEL_BASE::m_fmPhaseC, DIALOG_SPICE_MODEL_BASE::m_fmPhaseS, DIALOG_SPICE_MODEL_BASE::m_genAcMag, DIALOG_SPICE_MODEL_BASE::m_genAcPhase, DIALOG_SPICE_MODEL_BASE::m_genDc, DIALOG_SPICE_MODEL_BASE::m_modelName, DIALOG_SPICE_MODEL_BASE::m_modelType, m_notEmptyValidator, DIALOG_SPICE_MODEL_BASE::m_pasValue, DIALOG_SPICE_MODEL_BASE::m_powerNotebook, DIALOG_SPICE_MODEL_BASE::m_pulseDelay, DIALOG_SPICE_MODEL_BASE::m_pulseFall, DIALOG_SPICE_MODEL_BASE::m_pulseInit, DIALOG_SPICE_MODEL_BASE::m_pulseNominal, DIALOG_SPICE_MODEL_BASE::m_pulsePeriod, DIALOG_SPICE_MODEL_BASE::m_pulseRise, DIALOG_SPICE_MODEL_BASE::m_pulseWidth, m_pwlTimeCol, DIALOG_SPICE_MODEL_BASE::m_pwlValList, m_pwlValueCol, DIALOG_SPICE_MODEL_BASE::m_pwrExtData, DIALOG_SPICE_MODEL_BASE::m_pwrTransNoise, DIALOG_SPICE_MODEL_BASE::m_rnParam1, DIALOG_SPICE_MODEL_BASE::m_rnParam2, DIALOG_SPICE_MODEL_BASE::m_rnTD, DIALOG_SPICE_MODEL_BASE::m_rnTS, DIALOG_SPICE_MODEL_BASE::m_sdbSizerOK, DIALOG_SPICE_MODEL_BASE::m_sinAmplitude, DIALOG_SPICE_MODEL_BASE::m_sinDampFactor, DIALOG_SPICE_MODEL_BASE::m_sinDelay, DIALOG_SPICE_MODEL_BASE::m_sinFreq, DIALOG_SPICE_MODEL_BASE::m_sinOffset, m_spiceEmptyValidator, m_spiceValidator, DIALOG_SPICE_MODEL_BASE::m_staticTextF1, DIALOG_SPICE_MODEL_BASE::m_staticTextF2, DIALOG_SPICE_MODEL_BASE::m_staticTextF3, DIALOG_SPICE_MODEL_BASE::m_staticTextG1, DIALOG_SPICE_MODEL_BASE::m_staticTextG2, DIALOG_SPICE_MODEL_BASE::m_staticTextG3, DIALOG_SPICE_MODEL_BASE::m_staticTextK1, DIALOG_SPICE_MODEL_BASE::m_staticTextK2, DIALOG_SPICE_MODEL_BASE::m_staticTextK3, DIALOG_SPICE_MODEL_BASE::m_staticTextM1, DIALOG_SPICE_MODEL_BASE::m_staticTextM2, DIALOG_SPICE_MODEL_BASE::m_staticTextM3, DIALOG_SPICE_MODEL_BASE::m_staticTextMeg1, DIALOG_SPICE_MODEL_BASE::m_staticTextMeg2, DIALOG_SPICE_MODEL_BASE::m_staticTextMeg3, DIALOG_SPICE_MODEL_BASE::m_staticTextN1, DIALOG_SPICE_MODEL_BASE::m_staticTextN2, DIALOG_SPICE_MODEL_BASE::m_staticTextN3, DIALOG_SPICE_MODEL_BASE::m_staticTextP1, DIALOG_SPICE_MODEL_BASE::m_staticTextP2, DIALOG_SPICE_MODEL_BASE::m_staticTextP3, DIALOG_SPICE_MODEL_BASE::m_staticTextT1, DIALOG_SPICE_MODEL_BASE::m_staticTextT2, DIALOG_SPICE_MODEL_BASE::m_staticTextT3, DIALOG_SPICE_MODEL_BASE::m_staticTextU1, DIALOG_SPICE_MODEL_BASE::m_staticTextU2, DIALOG_SPICE_MODEL_BASE::m_staticTextU3, and modelTypes.

Referenced by DIALOG_SPICE_MODEL().

◆ IsCtrl()

static bool DIALOG_SHIM::IsCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 124 of file dialog_shim.h.

125  {
126  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
127  !e.ShiftDown() && !e.MetaDown();
128  }

◆ IsQuasiModal()

◆ IsShiftCtrl()

static bool DIALOG_SHIM::IsShiftCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 130 of file dialog_shim.h.

131  {
132  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
133  e.ShiftDown() && !e.MetaDown();
134  }

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Return a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 53 of file kiway_holder.h.

54  {
55  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
56  return *m_kiway;
57  }
KIWAY * m_kiway
Definition: kiway_holder.h:75

References KIWAY_HOLDER::m_kiway.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SYMBOL_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_SYMBOL::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), BACK_ANNOTATE::FetchNetlistFromPCB(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), SCRIPTING_TOOL::Init(), EDA_DRAW_FRAME::IsScriptingConsoleVisible(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), SYMBOL_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_FIELD_PROPERTIES::OnTextValueSelectButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), SCH_BASE_FRAME::PickSymbolFromLibBrowser(), KIWAY_HOLDER::Prj(), SCH_EDIT_TOOL::Properties(), BACK_ANNOTATE::PushNewLinksToPCB(), FOOTPRINT_WIZARD_FRAME::PythonPluginsReload(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), SYMBOL_EDIT_FRAME::Save(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), EDA_DRAW_FRAME::ScriptingConsoleEnableDisable(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), SYMBOL_EDIT_FRAME::SetCurSymbol(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ loadLibrary()

void DIALOG_SPICE_MODEL::loadLibrary ( const wxString &  aFilePath)
private

Load a list of components (.model and .subckt) from a spice library file and add them to a combo box.

Parameters
aComboBoxis the target combo box
aFilePathis path to the library file

Definition at line 833 of file dialog_spice_model.cpp.

834 {
835  //First, expand env vars, if any
836  wxString libname = ExpandEnvVarSubstitutions( aFilePath, &Prj() );
837 
838  // Make path absolute, especially if it is relative to the project path
839  libname = Prj().AbsolutePath( libname );
840 
841  wxString curModel = m_modelName->GetValue();
842  m_models.clear();
843  wxFileName filePath( libname );
844  bool in_subckt = false; // flag indicating that the parser is inside a .subckt section
845 
846  if( !filePath.Exists() )
847  return;
848 
849  // Display the library contents
850  wxWindowUpdateLocker updateLock( this );
851 
852  m_libraryContents->SetReadOnly( false );
853  m_libraryContents->Clear();
854  wxTextFile file;
855  file.Open( filePath.GetFullPath() );
856  int line_nr = 0;
857 
858  // Stores the library content. It will be displayed after reading the full library
859  wxString fullText;
860 
861  // Process the file, looking for symbols.
862  while( !file.Eof() )
863  {
864  const wxString& line = line_nr == 0 ? file.GetFirstLine() : file.GetNextLine();
865  fullText << line << '\n';
866 
867  wxStringTokenizer tokenizer( line );
868 
869  while( tokenizer.HasMoreTokens() )
870  {
871  wxString token = tokenizer.GetNextToken().Lower();
872 
873  // some subckts contain .model clauses inside,
874  // skip them as they are a part of the subckt, not another model
875  if( token == ".model" && !in_subckt )
876  {
877  wxString name = tokenizer.GetNextToken();
878 
879  if( name.IsEmpty() )
880  break;
881 
882  token = tokenizer.GetNextToken();
883  SPICE_PRIMITIVE type = MODEL::parseModelType( token );
884 
885  if( type != SP_UNKNOWN )
886  m_models.emplace( name, MODEL( line_nr, type ) );
887  }
888  else if( token == ".subckt" )
889  {
890  wxASSERT( !in_subckt );
891  in_subckt = true;
892 
893  wxString name = tokenizer.GetNextToken();
894 
895  if( name.IsEmpty() )
896  break;
897 
898  m_models.emplace( name, MODEL( line_nr, SP_SUBCKT ) );
899  }
900  else if( token == ".ends" )
901  {
902  wxASSERT( in_subckt );
903  in_subckt = false;
904  }
905  }
906 
907  ++line_nr;
908  }
909 
910  // display the full library content:
911  m_libraryContents->AppendText( fullText );
912  m_libraryContents->SetReadOnly( true );
913 
914  wxArrayString modelsList;
915 
916  // Refresh the model name combobox values
917  m_modelName->Clear();
918 
919  for( const auto& model : m_models )
920  {
921  m_modelName->Append( model.first );
922  modelsList.Add( model.first );
923  }
924 
925  m_modelName->AutoComplete( modelsList );
926 
927  // Restore the previous value or if there is none - pick the first one from the loaded library
928  if( !curModel.IsEmpty() )
929  m_modelName->SetValue( curModel );
930  else if( m_modelName->GetCount() > 0 )
931  m_modelName->SetSelection( 0 );
932 }
static SPICE_PRIMITIVE parseModelType(const wxString &aValue)
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:267
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:269
wxStyledTextCtrl * m_libraryContents
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
const char * name
Definition: DXF_plotter.cpp:56
std::map< wxString, MODEL > m_models
Column identifiers for PWL power source value list.

References PROJECT::AbsolutePath(), ExpandEnvVarSubstitutions(), DIALOG_SPICE_MODEL_BASE::m_libraryContents, DIALOG_SPICE_MODEL_BASE::m_modelName, m_models, MODEL, name, DIALOG_SPICE_MODEL::MODEL::parseModelType(), KIWAY_HOLDER::Prj(), SP_SUBCKT, and SP_UNKNOWN.

Referenced by onSelectLibrary(), and TransferDataToWindow().

◆ OnCharHook()

void DIALOG_SHIM::OnCharHook ( wxKeyEvent &  aEvt)
protectedvirtualinherited

Reimplemented in DIALOG_CHOOSE_SYMBOL, HK_PROMPT_DIALOG, and HTML_MESSAGE_BOX.

Definition at line 563 of file dialog_shim.cpp.

564 {
565  if( aEvt.GetKeyCode() == 'U' && aEvt.GetModifiers() == wxMOD_CONTROL )
566  {
567  if( m_parentFrame )
568  {
570  return;
571  }
572  }
573  // shift-return (Mac default) or Ctrl-Return (GTK) for OK
574  else if( aEvt.GetKeyCode() == WXK_RETURN && ( aEvt.ShiftDown() || aEvt.ControlDown() ) )
575  {
576  wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
577  return;
578  }
579  else if( aEvt.GetKeyCode() == WXK_TAB && !aEvt.ControlDown() )
580  {
581  wxWindow* currentWindow = wxWindow::FindFocus();
582  int currentIdx = -1;
583  int delta = aEvt.ShiftDown() ? -1 : 1;
584 
585  auto advance = [&]( int& idx )
586  {
587  // Wrap-around modulus
588  int size = m_tabOrder.size();
589  idx = ( ( idx + delta ) % size + size ) % size;
590  };
591 
592  for( size_t i = 0; i < m_tabOrder.size(); ++i )
593  {
594  if( m_tabOrder[i] == currentWindow )
595  {
596  currentIdx = (int) i;
597  break;
598  }
599  }
600 
601  if( currentIdx >= 0 )
602  {
603  advance( currentIdx );
604 
605  //todo: We don't currently have non-textentry dialog boxes but this will break if
606  // we add them.
607 #ifdef __APPLE__
608  while( dynamic_cast<wxTextEntry*>( m_tabOrder[ currentIdx ] ) == nullptr )
609  advance( currentIdx );
610 #endif
611 
612  m_tabOrder[ currentIdx ]->SetFocus();
613  return;
614  }
615  }
616 
617  aEvt.Skip();
618 }
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:218
EDA_BASE_FRAME * m_parentFrame
Definition: dialog_shim.h:216
virtual void ToggleUserUnits()
constexpr int delta

References delta, DIALOG_SHIM::m_parentFrame, DIALOG_SHIM::m_tabOrder, and EDA_BASE_FRAME::ToggleUserUnits().

Referenced by DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), and DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES().

◆ onInitDlg()

virtual void DIALOG_SPICE_MODEL::onInitDlg ( wxInitDialogEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 106 of file dialog_spice_model.h.

107  {
108  // Call the default wxDialog handler of a wxInitDialogEvent
110 
111  // Now all widgets have the size fixed, call FinishDialogSettings
113  }
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual bool TransferDataToWindow() override

References DIALOG_SHIM::finishDialogSettings(), and TransferDataToWindow().

◆ onModelSelected()

void DIALOG_SPICE_MODEL::onModelSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1042 of file dialog_spice_model.cpp.

1043 {
1044  // autoselect the model type
1045  auto it = m_models.find( m_modelName->GetValue() );
1046 
1047  if( it != m_models.end() )
1048  {
1049  m_modelType->SetSelection( getModelTypeIdx( it->second.model ) );
1050 
1051  // scroll to the bottom, so the model definition is shown in the first line
1052  m_libraryContents->ShowPosition(
1053  m_libraryContents->XYToPosition( 0, m_libraryContents->GetNumberOfLines() ) );
1054  m_libraryContents->ShowPosition( m_libraryContents->XYToPosition( 0, it->second.line ) );
1055  }
1056  else
1057  {
1058  m_libraryContents->ShowPosition( 0 );
1059  }
1060 }
static int getModelTypeIdx(char aPrimitive)
wxStyledTextCtrl * m_libraryContents
std::map< wxString, MODEL > m_models
Column identifiers for PWL power source value list.

References getModelTypeIdx(), DIALOG_SPICE_MODEL_BASE::m_libraryContents, DIALOG_SPICE_MODEL_BASE::m_modelName, m_models, and DIALOG_SPICE_MODEL_BASE::m_modelType.

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 380 of file dialog_shim.cpp.

381 {
382  if( m_firstPaintEvent )
383  {
385 
386  selectAllInTextCtrls( GetChildren() );
387 
390  else
391  KIPLATFORM::UI::ForceFocus( this ); // Focus the dialog itself
392 
393  m_firstPaintEvent = false;
394  }
395 
396  event.Skip();
397 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:209
bool m_firstPaintEvent
Definition: dialog_shim.h:208
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: gtk/ui.cpp:44
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:71
static void selectAllInTextCtrls(wxWindowList &children)

References KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision(), KIPLATFORM::UI::ForceFocus(), DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ onPwlAdd()

void DIALOG_SPICE_MODEL::onPwlAdd ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1071 of file dialog_spice_model.cpp.

1072 {
1073  addPwlValue( m_pwlTime->GetValue(), m_pwlValue->GetValue() );
1074 }
bool addPwlValue(const wxString &aTime, const wxString &aValue)
Add a value to the PWL values list.

References addPwlValue(), DIALOG_SPICE_MODEL_BASE::m_pwlTime, and DIALOG_SPICE_MODEL_BASE::m_pwlValue.

◆ onPwlRemove()

void DIALOG_SPICE_MODEL::onPwlRemove ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1077 of file dialog_spice_model.cpp.

1078 {
1079  long idx = m_pwlValList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
1080  m_pwlValList->DeleteItem( idx );
1081 }

References DIALOG_SPICE_MODEL_BASE::m_pwlValList.

◆ onRandomSourceType()

void DIALOG_SPICE_MODEL::onRandomSourceType ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1084 of file dialog_spice_model.cpp.

1085 {
1086  switch( m_rnType->GetSelection() )
1087  {
1088  case TRRANDOM_UNIFORM:
1089  // uniform white noise
1090  m_rnParam1Text->SetLabel( _( "Range:" ) );
1091  m_rnParam2Text->SetLabel( _( "Offset:" ) );
1092  break;
1093 
1094  case TRRANDOM_GAUSSIAN:
1095  // Gaussian
1096  m_rnParam1Text->SetLabel( _( "Standard deviation:" ) );
1097  m_rnParam2Text->SetLabel( _( "Mean:" ) );
1098  break;
1099 
1100  case TRRANDOM_EXPONENTIAL:
1101  // exponential
1102  m_rnParam1Text->SetLabel( _( "Mean:" ) );
1103  m_rnParam2Text->SetLabel( _( "Offset:" ) );
1104  break;
1105 
1106  case TRRANDOM_POISSON:
1107  // Poisson
1108  m_rnParam1Text->SetLabel( _( "Lambda:" ) );
1109  m_rnParam2Text->SetLabel( _( "Offset:" ) );
1110  break;
1111 
1112  default:
1113  wxFAIL_MSG( _( "type of random generator for source is invalid" ) );
1114  break;
1115  }
1116 }
#define _(s)

References _, DIALOG_SPICE_MODEL_BASE::m_rnParam1Text, DIALOG_SPICE_MODEL_BASE::m_rnParam2Text, DIALOG_SPICE_MODEL_BASE::m_rnType, TRRANDOM_EXPONENTIAL, TRRANDOM_GAUSSIAN, TRRANDOM_POISSON, and TRRANDOM_UNIFORM.

Referenced by parsePowerSource().

◆ onSelectLibrary()

void DIALOG_SPICE_MODEL::onSelectLibrary ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1008 of file dialog_spice_model.cpp.

1009 {
1010  //First, expand env vars, if any, in lib path
1011  wxString libname = ExpandEnvVarSubstitutions( m_modelLibrary->GetValue(), &Prj() );
1012 
1013  // Make path absolute, especially if it is relative to the project path
1014  libname = Prj().AbsolutePath( libname );
1015 
1016  wxString searchPath = wxFileName( libname ).GetPath();
1017 
1018  if( searchPath.IsEmpty() )
1019  searchPath = Prj().GetProjectPath();
1020 
1021  wxString wildcards = SpiceLibraryFileWildcard() + "|" + AllFilesWildcard();
1022  wxFileDialog openDlg( this, _( "Select library" ), searchPath, "", wildcards,
1023  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1024 
1025  if( openDlg.ShowModal() == wxID_CANCEL )
1026  return;
1027 
1028  wxFileName libPath( openDlg.GetPath() );
1029 
1030  // Try to convert the path to relative to project
1031  if( libPath.MakeRelativeTo( Prj().GetProjectPath() )
1032  && !libPath.GetFullPath().StartsWith( ".." ) )
1033  m_modelLibrary->SetValue( libPath.GetFullPath() );
1034  else
1035  m_modelLibrary->SetValue( openDlg.GetPath() );
1036 
1037  loadLibrary( openDlg.GetPath() );
1038  m_modelName->Popup();
1039 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:267
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:122
wxString AllFilesWildcard()
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:269
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
#define _(s)
void loadLibrary(const wxString &aFilePath)
Load a list of components (.model and .subckt) from a spice library file and add them to a combo box.
wxString SpiceLibraryFileWildcard()

References _, PROJECT::AbsolutePath(), AllFilesWildcard(), ExpandEnvVarSubstitutions(), PROJECT::GetProjectPath(), loadLibrary(), DIALOG_SPICE_MODEL_BASE::m_modelLibrary, DIALOG_SPICE_MODEL_BASE::m_modelName, KIWAY_HOLDER::Prj(), and SpiceLibraryFileWildcard().

◆ onTypeSelected()

void DIALOG_SPICE_MODEL::onTypeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Edited symbol.

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 1063 of file dialog_spice_model.cpp.

1064 {
1065  int type = m_modelType->GetSelection();
1066  int primitive = type >= 0 ? modelTypes[type].type : SP_SUBCKT;
1067  showPinOrderNote( primitive );
1068 }
void showPinOrderNote(int aModelType)
Display a note info about pin order.
static const std::vector< SPICE_MODEL_INFO > modelTypes

References DIALOG_SPICE_MODEL_BASE::m_modelType, modelTypes, showPinOrderNote(), and SP_SUBCKT.

◆ parsePowerSource()

bool DIALOG_SPICE_MODEL::parsePowerSource ( const wxString &  aModel)
private

Parse a string describing a power source, so appropriate settings are checked in the dialog.

Parameters
aModelcontains the string to be parse (e.g. sin(0 1 10k))
Returns
True if the input string was parsed without errors.

Definition at line 474 of file dialog_spice_model.cpp.

475 {
476  if( aModel.IsEmpty() )
477  return false;
478 
479  wxStringTokenizer tokenizer( aModel, " ()" );
480  wxString tkn = tokenizer.GetNextToken().Lower();
481 
482  while( tokenizer.HasMoreTokens() )
483  {
484  // Variables used for generic values processing (filling out wxTextCtrls in sequence)
485  bool genericProcessing = false;
486  unsigned int genericReqParamsCount = 0;
487  std::vector<wxTextCtrl*> genericControls;
488 
489  if( tkn == "dc" )
490  {
491  // There might be an optional "dc" or "trans" directive, skip it
492  if( tkn == "dc" || tkn == "trans" )
493  tkn = tokenizer.GetNextToken().Lower();
494 
495  // DC value
496  try
497  {
498  m_genDc->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
499  }
500  catch( ... )
501  {
502  return false;
503  }
504  }
505  else if( tkn == "ac" )
506  {
507  // AC magnitude
508  try
509  {
510  tkn = tokenizer.GetNextToken().Lower();
511  m_genAcMag->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
512  }
513  catch( ... )
514  {
515  return false;
516  }
517 
518  // AC phase (optional)
519  try
520  {
521  tkn = tokenizer.GetNextToken().Lower();
522  m_genAcPhase->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
523  }
524  catch( ... )
525  {
526  continue; // perhaps another directive
527  }
528  }
529  else if( tkn == "pulse" )
530  {
531  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrPulse ) );
532 
533  genericProcessing = true;
534  genericReqParamsCount = 2;
535  genericControls = { m_pulseInit, m_pulseNominal, m_pulseDelay,
537  }
538  else if( tkn == "sin" )
539  {
540  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrSin ) );
541 
542  genericProcessing = true;
543  genericReqParamsCount = 2;
544  genericControls = { m_sinOffset, m_sinAmplitude, m_sinFreq, m_sinDelay,
545  m_sinDampFactor };
546  }
547  else if( tkn == "exp" )
548  {
549  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrExp ) );
550 
551  genericProcessing = true;
552  genericReqParamsCount = 2;
553  genericControls = { m_expInit, m_expPulsed,
555  }
556  else if( tkn == "pwl" )
557  {
558  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrPwl ) );
559 
560  try
561  {
562  while( tokenizer.HasMoreTokens() )
563  {
564  tkn = tokenizer.GetNextToken();
565  SPICE_VALUE time( tkn );
566 
567  tkn = tokenizer.GetNextToken();
568  SPICE_VALUE value( tkn );
569 
570  addPwlValue( time.ToSpiceString(), value.ToSpiceString() );
571  }
572  }
573  catch( ... )
574  {
575  return false;
576  }
577  }
578  else if( tkn == "sffm" )
579  {
580  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrFm ) );
581 
582  genericProcessing = true;
583  genericReqParamsCount = 4;
586  }
587  else if( tkn == "am" )
588  {
589  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrAm ) );
590 
591  genericProcessing = true;
592  genericReqParamsCount = 5;
595  }
596  else if( tkn == "trrandom" )
597  {
598  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrRandom ) );
599 
600  // first token will configure drop-down list
601  if( !tokenizer.HasMoreTokens() )
602  return false;
603 
604  tkn = tokenizer.GetNextToken().Lower();
605  long type;
606  if( !tkn.ToLong( &type ) )
607  return false;
608 
609  m_rnType->SetSelection( type - 1 );
610  wxCommandEvent dummy;
612 
613  // remaining parameters can be handled in generic way
614  genericProcessing = true;
615  genericReqParamsCount = 4;
616  genericControls = { m_rnTS, m_rnTD, m_rnParam1, m_rnParam2 };
617  }
618  else
619  {
620  // Unhandled power source type
621  wxASSERT_MSG( false, "Unhandled power source type" );
622  return false;
623  }
624 
625  if( genericProcessing )
626  {
627  try
628  {
629  for( unsigned int i = 0; i < genericControls.size(); ++i )
630  {
631  // If there are no more tokens, let's check if we got at least required fields
632  if( !tokenizer.HasMoreTokens() )
633  return ( i >= genericReqParamsCount );
634 
635  tkn = tokenizer.GetNextToken().Lower();
636  genericControls[i]->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
637  }
638  }
639  catch( ... )
640  {
641  return false;
642  }
643  }
644 
645  // Get the next token now, so if any of the branches catches an exception, try to
646  // process it in another branch
647  tkn = tokenizer.GetNextToken().Lower();
648  }
649 
650  return true;
651 }
bool addPwlValue(const wxString &aTime, const wxString &aValue)
Add a value to the PWL values list.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
void onRandomSourceType(wxCommandEvent &event) override
< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg) Helper class to recognize Spi...
Definition: spice_value.h:34

References addPwlValue(), dummy(), DIALOG_SPICE_MODEL_BASE::m_amAmplitude, DIALOG_SPICE_MODEL_BASE::m_amCarrierFreq, DIALOG_SPICE_MODEL_BASE::m_amModulatingFreq, DIALOG_SPICE_MODEL_BASE::m_amOffset, DIALOG_SPICE_MODEL_BASE::m_amPhase, DIALOG_SPICE_MODEL_BASE::m_amSignalDelay, DIALOG_SPICE_MODEL_BASE::m_expFallConst, DIALOG_SPICE_MODEL_BASE::m_expFallDelay, DIALOG_SPICE_MODEL_BASE::m_expInit, DIALOG_SPICE_MODEL_BASE::m_expPulsed, DIALOG_SPICE_MODEL_BASE::m_expRiseConst, DIALOG_SPICE_MODEL_BASE::m_expRiseDelay, DIALOG_SPICE_MODEL_BASE::m_fmAmplitude, DIALOG_SPICE_MODEL_BASE::m_fmFcarrier, DIALOG_SPICE_MODEL_BASE::m_fmFsignal, DIALOG_SPICE_MODEL_BASE::m_fmModIndex, DIALOG_SPICE_MODEL_BASE::m_fmOffset, DIALOG_SPICE_MODEL_BASE::m_fmPhaseC, DIALOG_SPICE_MODEL_BASE::m_fmPhaseS, DIALOG_SPICE_MODEL_BASE::m_genAcMag, DIALOG_SPICE_MODEL_BASE::m_genAcPhase, DIALOG_SPICE_MODEL_BASE::m_genDc, DIALOG_SPICE_MODEL_BASE::m_powerNotebook, DIALOG_SPICE_MODEL_BASE::m_pulseDelay, DIALOG_SPICE_MODEL_BASE::m_pulseFall, DIALOG_SPICE_MODEL_BASE::m_pulseInit, DIALOG_SPICE_MODEL_BASE::m_pulseNominal, DIALOG_SPICE_MODEL_BASE::m_pulsePeriod, DIALOG_SPICE_MODEL_BASE::m_pulseRise, DIALOG_SPICE_MODEL_BASE::m_pulseWidth, DIALOG_SPICE_MODEL_BASE::m_pwrAm, DIALOG_SPICE_MODEL_BASE::m_pwrExp, DIALOG_SPICE_MODEL_BASE::m_pwrFm, DIALOG_SPICE_MODEL_BASE::m_pwrPulse, DIALOG_SPICE_MODEL_BASE::m_pwrPwl, DIALOG_SPICE_MODEL_BASE::m_pwrRandom, DIALOG_SPICE_MODEL_BASE::m_pwrSin, DIALOG_SPICE_MODEL_BASE::m_rnParam1, DIALOG_SPICE_MODEL_BASE::m_rnParam2, DIALOG_SPICE_MODEL_BASE::m_rnTD, DIALOG_SPICE_MODEL_BASE::m_rnTS, DIALOG_SPICE_MODEL_BASE::m_rnType, DIALOG_SPICE_MODEL_BASE::m_sinAmplitude, DIALOG_SPICE_MODEL_BASE::m_sinDampFactor, DIALOG_SPICE_MODEL_BASE::m_sinDelay, DIALOG_SPICE_MODEL_BASE::m_sinFreq, DIALOG_SPICE_MODEL_BASE::m_sinOffset, onRandomSourceType(), and SPICE_VALUE::ToSpiceString().

Referenced by TransferDataToWindow().

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Return a reference to the PROJECT associated with this KIWAY.

Definition at line 36 of file kiway_holder.cpp.

37 {
38  return Kiway().Prj();
39 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition: kiway.cpp:190

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), SCH_EDIT_FRAME::AppendSchematic(), AskSaveBoardFileName(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLibrariesListBox(), SIM_PLOT_FRAME::canCloseWindow(), PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath(), KICAD_MANAGER_FRAME::CloseProject(), DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::createNewLibrary(), PCB_BASE_EDIT_FRAME::CreateNewProjectLibrary(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprint(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doAutoSave(), PCB_BASE_EDIT_FRAME::doCloseWindow(), FOOTPRINT_EDIT_FRAME::doCloseWindow(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), BOARD_EDITOR_CONTROL::ExportNetlist(), DIALOG_EXPORT_SVG::ExportSVGFile(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), SYMBOL_EDITOR_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), SYMBOL_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SIM_PLOT_FRAME::getDefaultFilename(), SIM_PLOT_FRAME::getDefaultPath(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), SCH_BASE_FRAME::GetLibSymbol(), DIALOG_PLOT_SCHEMATIC::getOutputPath(), KICAD_MANAGER_FRAME::GetProjectFileName(), SCH_EDIT_FRAME::GetSchematicJunctionSize(), SYMBOL_VIEWER_FRAME::GetSelectedSymbol(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SCH_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), CVPCB_MAINFRAME::LoadFootprintFiles(), loadLibrary(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectSettings(), PCB_EDIT_FRAME::LoadProjectSettings(), SIM_PLOT_FRAME::LoadSettings(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), EDA_BASE_FRAME::LoadWindowState(), SIM_PLOT_FRAME::loadWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbookAs(), PANEL_FP_PROPERTIES_3D_MODEL::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), DIALOG_EXPORT_STEP::onExportButton(), DIALOG_GENDRILL::OnGenReportFile(), KICAD_MANAGER_FRAME::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_SCHEMATIC_SETUP::OnPageChange(), DIALOG_BOARD_SETUP::OnPageChange(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded(), PROPERTIES_FRAME::onScintillaCharAdded(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), onSelectLibrary(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_CONTROL::PasteFootprint(), SCH_BASE_FRAME::PickSymbolFromLibTree(), DIALOG_PLOT::Plot(), DIALOG_PLOT_SCHEMATIC::plotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetHpgl(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), EDA_DRAW_FRAME::PrintDrawingSheet(), SCH_EDIT_FRAME::PrintPage(), KICAD_MANAGER_FRAME::PrintPrjInfo(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SYMBOL_VIEWER_FRAME::ReCreateSymbolList(), PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint(), EDA_3D_VIEWER_FRAME::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_EDIT_FRAME::saveSchematicFile(), SIM_PLOT_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), SYMBOL_EDIT_FRAME::saveSymbolAs(), SCH_BASE_FRAME::saveSymbolLibTables(), SIM_PLOT_FRAME::saveWorkbook(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), PCB_BASE_FRAME::SelectLibrary(), SYMBOL_EDIT_FRAME::SelectLibraryFromList(), PCB_BASE_EDIT_FRAME::selectLibTable(), SYMBOL_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), SYMBOL_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), SYMBOL_EDIT_FRAME::SetCurSymbol(), GERBVIEW_FRAME::SetPageSettings(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_SYMBOL::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), SYMBOL_VIEWER_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SYMBOL_LIBRARY_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER_FRAME::takeScreenshot(), PANEL_SETUP_RULES::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), SCH_EDIT_FRAME::updateAutoSaveFile(), DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), SIM_PLOT_FRAME::updateTitle(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), SCH_EDIT_FRAME::UpdateTitle(), PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES(), PANEL_FP_PROPERTIES_3D_MODEL::~PANEL_FP_PROPERTIES_3D_MODEL(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ resetSize()

void DIALOG_SHIM::resetSize ( )
protectedinherited

Clear the existing dialog size and position.

This will cause the dialog size to be clear so the next time the dialog is shown the sizers will layout the dialog accordingly. This useful when there are dialog windows that size changes due to layout dependency hidden controls.

Definition at line 287 of file dialog_shim.cpp.

288 {
289  const char* hash_key;
290 
291  if( m_hash_key.size() )
292  {
293  // a special case like EDA_LIST_DIALOG, which has multiple uses.
294  hash_key = m_hash_key.c_str();
295  }
296  else
297  {
298  hash_key = typeid(*this).name();
299  }
300 
301  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
302 
303  if( it == class_map.end() )
304  return;
305 
306  wxRect rect = it->second;
307  rect.SetSize( wxSize( 0, 0 ) );
308  class_map[ hash_key ] = rect;
309 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map

References class_map, and DIALOG_SHIM::m_hash_key.

Referenced by DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES().

◆ SetInitialFocus()

void DIALOG_SHIM::SetInitialFocus ( wxWindow *  aWindow)
inlineinherited

Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.

Definition at line 97 of file dialog_shim.h.

98  {
99  m_initialFocusTarget = aWindow;
100  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:209

References DIALOG_SHIM::m_initialFocusTarget.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_FIND::DIALOG_FIND(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LINE_WIRE_BUS_PROPERTIES::DIALOG_LINE_WIRE_BUS_PROPERTIES(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), EDA_VIEW_SWITCHER::EDA_VIEW_SWITCHER(), HK_PROMPT_DIALOG::HK_PROMPT_DIALOG(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_EDIT_FRAME::saveSymbolAs(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), and WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

It is only used for debugging, since "this" is not a wxWindow*.

"this" is a KIWAY_HOLDER mix-in.

Parameters
aDestis the recipient of aKiway pointer.
aKiwayis often from a parent window or from KIFACE::CreateWindow().

Definition at line 43 of file kiway_holder.cpp.

44 {
45 #if defined(DEBUG)
46  // offer a trap point for debugging most any window
47  wxASSERT( aDest );
48  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
49  {
50  int breakhere=1;
51  ignore_unused( breakhere );
52  }
53 #endif
54 
55  ignore_unused( aDest );
56 
57  m_kiway = aKiway;
58 }
KIWAY * m_kiway
Definition: kiway_holder.h:75
const char * name
Definition: DXF_plotter.cpp:56
void ignore_unused(const T &)
Definition: ignore.h:24

References ignore_unused(), KIWAY_HOLDER::m_kiway, and name.

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), PCB::IFACE::CreateWindow(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetPosition()

void DIALOG_SHIM::SetPosition ( const wxPoint &  aNewPosition)
inherited

Force the position of the dialog to a new position.

Parameters
aNewPositionis the new forced position

Definition at line 190 of file dialog_shim.cpp.

191 {
192  wxDialog::SetPosition( aNewPosition );
193 
194  // Now update the stored position:
195  const char* hash_key;
196 
197  if( m_hash_key.size() )
198  {
199  // a special case like EDA_LIST_DIALOG, which has multiple uses.
200  hash_key = m_hash_key.c_str();
201  }
202  else
203  {
204  hash_key = typeid(*this).name();
205  }
206 
207  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
208 
209  if( it == class_map.end() )
210  return;
211 
212  wxRect rect = it->second;
213  rect.SetPosition( aNewPosition );
214 
215  class_map[ hash_key ] = rect;
216 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)

References class_map, DIALOG_SHIM::m_hash_key, and PCAD2KICAD::SetPosition().

Referenced by PCB_BASE_FRAME::SelectOneLayer().

◆ setSizeInDU()

void DIALOG_SHIM::setSizeInDU ( int  x,
int  y 
)
protectedinherited

Set the dialog to the given dimensions in "dialog units".

These are units equivalent to 4* the average character width and 8* the average character height, allowing a dialog to be sized in a way that scales it with the system font.

Definition at line 162 of file dialog_shim.cpp.

163 {
164  wxSize sz( x, y );
165  SetSize( ConvertDialogToPixels( sz ) );
166 }

Referenced by DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 219 of file dialog_shim.cpp.

220 {
221  bool ret;
222  const char* hash_key;
223 
224  if( m_hash_key.size() )
225  {
226  // a special case like EDA_LIST_DIALOG, which has multiple uses.
227  hash_key = m_hash_key.c_str();
228  }
229  else
230  {
231  hash_key = typeid(*this).name();
232  }
233 
234  // Show or hide the window. If hiding, save current position and size.
235  // If showing, use previous position and size.
236  if( show )
237  {
238 #ifndef __WINDOWS__
239  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
240 #endif
241  ret = wxDialog::Show( show );
242 
243  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
244  wxRect savedDialogRect = class_map[ hash_key ];
245 
246  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
247  {
248  if( m_useCalculatedSize )
249  {
250  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
251  wxDialog::GetSize().x, wxDialog::GetSize().y, 0 );
252  }
253  else
254  {
255  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
256  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
257  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
258  0 );
259  }
260  }
261  else if( m_initialSize != wxDefaultSize )
262  SetSize( m_initialSize );
263 
264  // Be sure that the dialog appears in a visible area
265  // (the dialog position might have been stored at the time when it was
266  // shown on another display)
267  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
268  Centre();
269  }
270  else
271  {
272  // Save the dialog's position & size before hiding, using classname as key
273  class_map[ hash_key ] = wxRect( wxDialog::GetPosition(), wxDialog::GetSize() );
274 
275 #ifdef __WXMAC__
276  if ( m_eventLoop )
277  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
278 #endif
279 
280  ret = wxDialog::Show( show );
281  }
282 
283  return ret;
284 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map
bool m_useCalculatedSize
Definition: dialog_shim.h:203
wxSize m_initialSize
Definition: dialog_shim.h:221

References class_map, DIALOG_SHIM::m_hash_key, DIALOG_SHIM::m_initialSize, and DIALOG_SHIM::m_useCalculatedSize.

Referenced by FOOTPRINT_EDITOR_CONTROL::CheckFootprint(), DRC_TOOL::CrossProbe(), DIALOG_SHIM::EndQuasiModal(), GROUP_TOOL::GroupProperties(), EE_INSPECTION_TOOL::NextMarker(), DRC_TOOL::NextMarker(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_DRC::OnDRCItemDClick(), DIALOG_ERC::OnERCItemDClick(), DIALOG_CLEANUP_GRAPHICS::OnLeftDClickItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), DIALOG_FOOTPRINT_CHECKER::OnLeftDClickItem(), GROUP_TOOL::PickNewMember(), POSITION_RELATIVE_TOOL::PositionRelative(), EE_INSPECTION_TOOL::PrevMarker(), DRC_TOOL::PrevMarker(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), EDA_VIEW_SWITCHER::Show(), DIALOG_PAD_PROPERTIES::Show(), DRC_TOOL::ShowDRCDialog(), EE_INSPECTION_TOOL::ShowERCDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), HTML_MESSAGE_BOX::ShowModeless(), DIALOG_SHIM::ShowQuasiModal(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

◆ showPinOrderNote()

void DIALOG_SPICE_MODEL::showPinOrderNote ( int  aModelType)
private

Display a note info about pin order.

Definition at line 437 of file dialog_spice_model.cpp.

438 {
439  // Display a note info about pin order, according to aModelType
440  wxString msg;
441 
442  msg = _( "Symbol pin numbering don't always match the required SPICE pin order\n"
443  "Check the symbol and use \"Alternate node sequence\" to reorder the pins"
444  ", if necessary" );
445 
446  msg += '\n';
447 
448  switch( aModelType )
449  {
450  case SP_DIODE:
451  msg += _( "For a Diode, pin order is anode, cathode" );
452  break;
453 
454  case SP_BJT:
455  msg += _( "For a BJT, pin order is collector, base, emitter, substrate (optional)" );
456  break;
457 
458  case SP_MOSFET:
459  msg += _( "For a MOSFET, pin order is drain, gate, source" );
460  break;
461 
462  case SP_JFET:
463  msg += _( "For a JFET, pin order is drain, gate, source" );
464  break;
465 
466  default:
467  break;
468  }
469 
470  m_stInfoNote->SetLabel( msg );
471 }
#define _(s)

References _, DIALOG_SPICE_MODEL_BASE::m_stInfoNote, SP_BJT, SP_DIODE, SP_JFET, and SP_MOSFET.

Referenced by onTypeSelected(), and TransferDataToWindow().

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 423 of file dialog_shim.cpp.

424 {
425  // This is an exception safe way to zero a pointer before returning.
426  // Yes, even though DismissModal() clears this first normally, this is
427  // here in case there's an exception before the dialog is dismissed.
428  struct NULLER
429  {
430  void*& m_what;
431  NULLER( void*& aPtr ) : m_what( aPtr ) {}
432  ~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
433  } clear_this( (void*&) m_qmodal_loop );
434 
435  // release the mouse if it's currently captured as the window having it
436  // will be disabled when this dialog is shown -- but will still keep the
437  // capture making it impossible to do anything in the modal dialog itself
438  wxWindow* win = wxWindow::GetCapture();
439  if( win )
440  win->ReleaseMouse();
441 
442  // Get the optimal parent
443  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
444 
445  wxASSERT_MSG( !m_qmodal_parent_disabler,
446  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
447 
448  // quasi-modal: disable only my "optimal" parent
450 
451  // Apple in its infinite wisdom will raise a disabled window before even passing
452  // us the event, so we have no way to stop it. Instead, we must set an order on
453  // the windows so that the quasi-modal will be pushed in front of the disabled
454  // window when it is raised.
456 
457  Show( true );
458 
459  m_qmodal_showing = true;
460 
461  WX_EVENT_LOOP event_loop;
462 
463  m_qmodal_loop = &event_loop;
464 
465  event_loop.Run();
466 
467  m_qmodal_showing = false;
468 
469  return GetReturnCode();
470 }
bool m_qmodal_showing
Definition: dialog_shim.h:213
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:211
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:214
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:44
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:65

References DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, KIPLATFORM::UI::ReparentQuasiModal(), DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by SCH_EDIT_TOOL::ChangeSymbols(), S3D::Configure3DPaths(), COMMON_CONTROL::ConfigurePaths(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), SCH_DRAWING_TOOLS::createNewText(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), SCH_EDIT_TOOL::editFieldText(), SCH_EDITOR_CONTROL::EditSymbolFields(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), GLOBAL_EDIT_TOOL::EditTracksAndVias(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), InvokeCopperZonesEditor(), InvokeDialogCreateBOM(), InvokeDialogEditSymbolsLibId(), InvokeDialogRescueEach(), InvokeNonCopperZonesEditor(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDITOR_CONTROL::RemapSymbols(), S3D::Select3DModel(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), PCB_EDIT_FRAME::ShowDimensionPropertiesDialog(), PCB_EDIT_FRAME::ShowExchangeFootprintsDialog(), PCB_EDIT_FRAME::ShowFootprintPropertiesDialog(), PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog(), PCB_BASE_FRAME::ShowPadPropertiesDialog(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), and PCB_BASE_EDIT_FRAME::ShowTextPropertiesDialog().

◆ TransferDataFromWindow()

bool DIALOG_SPICE_MODEL::TransferDataFromWindow ( )
overrideprivatevirtual

Definition at line 236 of file dialog_spice_model.cpp.

237 {
238  if( !DIALOG_SPICE_MODEL_BASE::TransferDataFromWindow() )
239  return false;
240 
241  wxWindow* page = m_notebook->GetCurrentPage();
242 
243  // Passive
244  if( page == m_passive )
245  {
246  if( !m_disabled->GetValue() && !m_passive->Validate() )
247  return false;
248 
249  switch( m_pasType->GetSelection() )
250  {
251  case 0: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_RESISTOR; break;
252  case 1: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_CAPACITOR; break;
253  case 2: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_INDUCTOR; break;
254 
255  default:
256  wxASSERT_MSG( false, "Unhandled passive type" );
257  return false;
258  break;
259  }
260 
261  m_fieldsTmp[SF_MODEL] = m_pasValue->GetValue();
262  }
263  else if( page == m_model ) // Model
264  {
265  if( !m_model->Validate() )
266  return false;
267 
268  int modelIdx = m_modelType->GetSelection();
269 
270  if( modelIdx >= 0 && modelIdx < (int) modelTypes.size() )
271  m_fieldsTmp[SF_PRIMITIVE] = static_cast<char>( modelTypes[modelIdx].type );
272 
273  m_fieldsTmp[SF_MODEL] = m_modelName->GetValue();
274 
275  if( !empty( m_modelLibrary ) )
276  m_fieldsTmp[SF_LIB_FILE] = m_modelLibrary->GetValue();
277  }
278  else if( page == m_power ) // Power source
279  {
280  wxString model;
281 
282  if( !generatePowerSource( model ) )
283  return false;
284 
285  m_fieldsTmp[SF_PRIMITIVE] = (char)( m_pwrType->GetSelection() ? SP_ISOURCE : SP_VSOURCE );
286  m_fieldsTmp[SF_MODEL] = model;
287  }
288  else
289  {
290  wxASSERT_MSG( false, "Unhandled model type" );
291  return false;
292  }
293 
294  m_fieldsTmp[SF_ENABLED] = !m_disabled->GetValue() ? "Y" : "N"; // note bool inversion
295  m_fieldsTmp[SF_NODE_SEQUENCE] = m_nodeSeqCheck->IsChecked() ? m_nodeSeqVal->GetValue() : "";
296 
297  // Apply the settings
298  for( int i = 0; i < SF_END; ++i )
299  {
300  if( m_fieldsTmp.count( (SPICE_FIELD) i ) > 0 && !m_fieldsTmp.at( i ).IsEmpty() )
301  {
302  if( m_useSchFields )
303  getSchField( i ).SetText( m_fieldsTmp[i] );
304  else
305  getLibField( i ).SetText( m_fieldsTmp[i] );
306  }
307  else
308  {
309  // Erase empty fields (having empty fields causes a warning in the properties dialog)
310  const wxString& spiceField =
312 
313  if( m_useSchFields )
314  {
315  alg::delete_if( *m_schfields, [&]( const SCH_FIELD& f )
316  {
317  return f.GetName() == spiceField;
318  } );
319  }
320  else
321  {
322  alg::delete_if( *m_libfields, [&]( const LIB_FIELD& f )
323  {
324  return f.GetName() == spiceField;
325  } );
326  }
327  }
328  }
329 
330  return true;
331 }
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:49
std::vector< LIB_FIELD > * m_libfields
bool m_useSchFields
Temporary field values.
Field object used in symbol libraries.
Definition: lib_field.h:59
static const wxString & GetSpiceFieldName(SPICE_FIELD aField)
Return a string used for a particular component field related to Spice simulation.
LIB_FIELD & getLibField(int aFieldType)
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
Definition: lib_field.cpp:362
static bool empty(const wxTextCtrl *aCtrl)
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:114
SCH_FIELD & getSchField(int aFieldType)
Return or create a field in the edited schematic fields vector.
bool generatePowerSource(wxString &aTarget)
Generate a string to describe power source parameters, basing on the current selection.
std::map< int, wxString > m_fieldsTmp
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
Definition: sch_field.cpp:582
void delete_if(_Container &__c, _Function &&__f)
Deletes all values from __c for which __f returns true.
Definition: kicad_algo.h:173
std::vector< SCH_FIELD > * m_schfields
static const std::vector< SPICE_MODEL_INFO > modelTypes

References alg::delete_if(), empty(), generatePowerSource(), getLibField(), LIB_FIELD::GetName(), SCH_FIELD::GetName(), getSchField(), NETLIST_EXPORTER_PSPICE::GetSpiceFieldName(), DIALOG_SPICE_MODEL_BASE::m_disabled, m_fieldsTmp, m_libfields, DIALOG_SPICE_MODEL_BASE::m_model, DIALOG_SPICE_MODEL_BASE::m_modelLibrary, DIALOG_SPICE_MODEL_BASE::m_modelName, DIALOG_SPICE_MODEL_BASE::m_modelType, DIALOG_SPICE_MODEL_BASE::m_nodeSeqCheck, DIALOG_SPICE_MODEL_BASE::m_nodeSeqVal, DIALOG_SPICE_MODEL_BASE::m_notebook, DIALOG_SPICE_MODEL_BASE::m_passive, DIALOG_SPICE_MODEL_BASE::m_pasType, DIALOG_SPICE_MODEL_BASE::m_pasValue, DIALOG_SPICE_MODEL_BASE::m_power, DIALOG_SPICE_MODEL_BASE::m_pwrType, m_schfields, m_useSchFields, modelTypes, EDA_TEXT::SetText(), SF_ENABLED, SF_END, SF_LIB_FILE, SF_MODEL, SF_NODE_SEQUENCE, SF_PRIMITIVE, SP_CAPACITOR, SP_INDUCTOR, SP_ISOURCE, SP_RESISTOR, and SP_VSOURCE.

◆ TransferDataToWindow()

bool DIALOG_SPICE_MODEL::TransferDataToWindow ( )
overrideprivatevirtual

Definition at line 334 of file dialog_spice_model.cpp.

335 {
336  const auto& spiceFields = NETLIST_EXPORTER_PSPICE::GetSpiceFields();
337 
338  // Fill out the working buffer
339  for( unsigned int idx = 0; idx < spiceFields.size(); ++idx )
340  {
341  const wxString& spiceField = spiceFields[idx];
342 
344  (SPICE_FIELD ) idx, &m_symbol,
346 
347  // Do not modify the existing value, just add missing fields with default values
348  if( m_useSchFields && m_schfields )
349  {
350  for( const auto& field : *m_schfields )
351  {
352  if( field.GetName() == spiceField && !field.GetText().IsEmpty() )
353  {
354  m_fieldsTmp[idx] = field.GetText();
355  break;
356  }
357  }
358  }
359  else if( m_libfields )
360  {
361  // TODO: There must be a good way to template out these repetitive calls
362  for( const LIB_FIELD& field : *m_libfields )
363  {
364  if( field.GetName() == spiceField && !field.GetText().IsEmpty() )
365  {
366  m_fieldsTmp[idx] = field.GetText();
367  break;
368  }
369  }
370  }
371  }
372 
373  // Analyze the symbol fields to fill out the dialog.
374  unsigned int primitive = toupper( m_fieldsTmp[SF_PRIMITIVE][0] );
375 
376  switch( primitive )
377  {
378  case SP_RESISTOR:
379  case SP_CAPACITOR:
380  case SP_INDUCTOR:
381  m_notebook->SetSelection( m_notebook->FindPage( m_passive ) );
382  m_pasType->SetSelection( primitive == SP_RESISTOR ? 0
383  : primitive == SP_CAPACITOR ? 1
384  : primitive == SP_INDUCTOR ? 2
385  : -1 );
386  m_pasValue->SetValue( m_fieldsTmp[SF_MODEL] );
387  break;
388 
389  case SP_DIODE:
390  case SP_BJT:
391  case SP_MOSFET:
392  case SP_JFET:
393  case SP_SUBCKT:
394  m_notebook->SetSelection( m_notebook->FindPage( m_model ) );
395  m_modelType->SetSelection( getModelTypeIdx( primitive ) );
396  m_modelName->SetValue( m_fieldsTmp[SF_MODEL] );
397  m_modelLibrary->SetValue( m_fieldsTmp[SF_LIB_FILE] );
398 
399  if( !empty( m_modelLibrary ) )
400  {
401  const wxString& libFile = m_modelLibrary->GetValue();
402  m_fieldsTmp[SF_LIB_FILE] = libFile;
403  loadLibrary( libFile );
404  }
405  break;
406 
407  case SP_VSOURCE:
408  case SP_ISOURCE:
410  return false;
411 
412  m_notebook->SetSelection( m_notebook->FindPage( m_power ) );
413  m_pwrType->SetSelection( primitive == SP_ISOURCE ? 1 : 0 );
414  break;
415 
416  default:
417  //wxASSERT_MSG( false, "Unhandled Spice primitive type" );
418  break;
419  }
420 
422 
423  // Check if node sequence is different than the default one
426  {
427  m_nodeSeqCheck->SetValue( true );
429  }
430 
431  showPinOrderNote( primitive );
432 
433  return DIALOG_SPICE_MODEL_BASE::TransferDataToWindow();
434 }
std::vector< LIB_FIELD > * m_libfields
bool m_useSchFields
Temporary field values.
Field object used in symbol libraries.
Definition: lib_field.h:59
static bool StringToBool(const wxString &aStr)
Convert typical boolean string values (no/yes, true/false, 1/0) to a boolean value.
bool parsePowerSource(const wxString &aModel)
Parse a string describing a power source, so appropriate settings are checked in the dialog.
static int getModelTypeIdx(char aPrimitive)
SCH_SYMBOL & m_symbol
Fields from the symbol properties dialog.
static bool empty(const wxTextCtrl *aCtrl)
void showPinOrderNote(int aModelType)
Display a note info about pin order.
static wxString GetSpiceFieldDefVal(SPICE_FIELD aField, SCH_SYMBOL *aSymbol, unsigned aCtl)
Retrieve the default value for a given field.
std::map< int, wxString > m_fieldsTmp
void loadLibrary(const wxString &aFilePath)
Load a list of components (.model and .subckt) from a spice library file and add them to a combo box.
static const std::vector< wxString > & GetSpiceFields()
Return a vector of component field names related to Spice simulation.
std::vector< SCH_FIELD > * m_schfields

References empty(), getModelTypeIdx(), NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal(), NETLIST_EXPORTER_PSPICE::GetSpiceFields(), loadLibrary(), DIALOG_SPICE_MODEL_BASE::m_disabled, m_fieldsTmp, m_libfields, DIALOG_SPICE_MODEL_BASE::m_model, DIALOG_SPICE_MODEL_BASE::m_modelLibrary, DIALOG_SPICE_MODEL_BASE::m_modelName, DIALOG_SPICE_MODEL_BASE::m_modelType, DIALOG_SPICE_MODEL_BASE::m_nodeSeqCheck, DIALOG_SPICE_MODEL_BASE::m_nodeSeqVal, DIALOG_SPICE_MODEL_BASE::m_notebook, DIALOG_SPICE_MODEL_BASE::m_passive, DIALOG_SPICE_MODEL_BASE::m_pasType, DIALOG_SPICE_MODEL_BASE::m_pasValue, DIALOG_SPICE_MODEL_BASE::m_power, DIALOG_SPICE_MODEL_BASE::m_pwrType, m_schfields, m_symbol, m_useSchFields, NET_ADJUST_INCLUDE_PATHS, NET_ADJUST_PASSIVE_VALS, parsePowerSource(), SF_ENABLED, SF_LIB_FILE, SF_MODEL, SF_NODE_SEQUENCE, SF_PRIMITIVE, showPinOrderNote(), SP_BJT, SP_CAPACITOR, SP_DIODE, SP_INDUCTOR, SP_ISOURCE, SP_JFET, SP_MOSFET, SP_RESISTOR, SP_SUBCKT, SP_VSOURCE, and NETLIST_EXPORTER_PSPICE::StringToBool().

Referenced by onInitDlg().

◆ Validate()

virtual bool DIALOG_SPICE_MODEL::Validate ( )
inlineoverrideprivatevirtual

Definition at line 101 of file dialog_spice_model.h.

102  {
103  return true;
104  }

◆ vertPixelsFromDU()

int DIALOG_SHIM::vertPixelsFromDU ( int  y) const
protectedinherited

Convert an integer number of dialog units to pixels, vertically.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 176 of file dialog_shim.cpp.

177 {
178  wxSize sz( 0, y );
179  return ConvertDialogToPixels( sz ).y;
180 }

Referenced by DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL().

Member Data Documentation

◆ m_amAmplitude

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amAmplitude
protectedinherited

◆ m_amCarrierFreq

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amCarrierFreq
protectedinherited

◆ m_amModulatingFreq

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amModulatingFreq
protectedinherited

◆ m_amOffset

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amOffset
protectedinherited

◆ m_amPhase

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amPhase
protectedinherited

◆ m_amSignalDelay

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_amSignalDelay
protectedinherited

◆ m_disabled

wxCheckBox* DIALOG_SPICE_MODEL_BASE::m_disabled
protectedinherited

◆ m_expFallConst

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expFallConst
protectedinherited

◆ m_expFallDelay

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expFallDelay
protectedinherited

◆ m_expInit

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expInit
protectedinherited

◆ m_expPulsed

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expPulsed
protectedinherited

◆ m_expRiseConst

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expRiseConst
protectedinherited

◆ m_expRiseDelay

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expRiseDelay
protectedinherited

◆ m_fieldsTmp

std::map<int, wxString> DIALOG_SPICE_MODEL::m_fieldsTmp
private

Definition at line 142 of file dialog_spice_model.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 208 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_fmAmplitude

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmAmplitude
protectedinherited

◆ m_fmFcarrier

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmFcarrier
protectedinherited

◆ m_fmFsignal

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmFsignal
protectedinherited

◆ m_fmModIndex

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmModIndex
protectedinherited

◆ m_fmOffset

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmOffset
protectedinherited

◆ m_fmPhaseC

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmPhaseC
protectedinherited

◆ m_fmPhaseS

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_fmPhaseS
protectedinherited

◆ m_genAcMag

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genAcMag
protectedinherited

◆ m_genAcPhase

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genAcPhase
protectedinherited

◆ m_genDc

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genDc
protectedinherited

◆ m_hash_key

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 209 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint(), and DIALOG_SHIM::SetInitialFocus().

◆ m_initialSize

wxSize DIALOG_SHIM::m_initialSize
protectedinherited

Definition at line 221 of file dialog_shim.h.

Referenced by DIALOG_SHIM::Show().

◆ m_libfields

std::vector<LIB_FIELD>* DIALOG_SPICE_MODEL::m_libfields
private

Definition at line 138 of file dialog_spice_model.h.

Referenced by getLibField(), TransferDataFromWindow(), and TransferDataToWindow().

◆ m_libraryContents

wxStyledTextCtrl* DIALOG_SPICE_MODEL_BASE::m_libraryContents
protectedinherited

◆ m_model

wxPanel* DIALOG_SPICE_MODEL_BASE::m_model
protectedinherited

◆ m_modelLibrary

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_modelLibrary
protectedinherited

◆ m_modelName

◆ m_models

std::map<wxString, MODEL> DIALOG_SPICE_MODEL::m_models
private

Column identifiers for PWL power source value list.

Definition at line 162 of file dialog_spice_model.h.

Referenced by loadLibrary(), and onModelSelected().

◆ m_modelType

◆ m_nodeSeqCheck

wxCheckBox* DIALOG_SPICE_MODEL_BASE::m_nodeSeqCheck
protectedinherited

◆ m_nodeSeqVal

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_nodeSeqVal
protectedinherited

◆ m_notebook

wxNotebook* DIALOG_SPICE_MODEL_BASE::m_notebook
protectedinherited

◆ m_notEmptyValidator

wxTextValidator DIALOG_SPICE_MODEL::m_notEmptyValidator
private

Definition at line 169 of file dialog_spice_model.h.

Referenced by Init().

◆ m_parentFrame

EDA_BASE_FRAME* DIALOG_SHIM::m_parentFrame
protectedinherited

◆ m_passive

wxPanel* DIALOG_SPICE_MODEL_BASE::m_passive
protectedinherited

◆ m_pasType

wxComboBox* DIALOG_SPICE_MODEL_BASE::m_pasType
protectedinherited

◆ m_pasValue

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pasValue
protectedinherited

◆ m_power

wxPanel* DIALOG_SPICE_MODEL_BASE::m_power
protectedinherited

◆ m_powerNotebook

wxNotebook* DIALOG_SPICE_MODEL_BASE::m_powerNotebook
protectedinherited

◆ m_pulseDelay

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseDelay
protectedinherited

◆ m_pulseFall

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseFall
protectedinherited

◆ m_pulseInit

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseInit
protectedinherited

◆ m_pulseNominal

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseNominal
protectedinherited

◆ m_pulsePeriod

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulsePeriod
protectedinherited

◆ m_pulseRise

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseRise
protectedinherited

◆ m_pulseWidth

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseWidth
protectedinherited

◆ m_pwlAddButton

wxButton* DIALOG_SPICE_MODEL_BASE::m_pwlAddButton
protectedinherited

◆ m_pwlRemoveBtn

wxButton* DIALOG_SPICE_MODEL_BASE::m_pwlRemoveBtn
protectedinherited

◆ m_pwlTime

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlTime
protectedinherited

◆ m_pwlTimeCol

long DIALOG_SPICE_MODEL::m_pwlTimeCol
private

Definition at line 165 of file dialog_spice_model.h.

Referenced by addPwlValue(), generatePowerSource(), and Init().

◆ m_pwlValList

wxListCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlValList
protectedinherited

◆ m_pwlValue

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlValue
protectedinherited

◆ m_pwlValueCol

long DIALOG_SPICE_MODEL::m_pwlValueCol
private

Definition at line 165 of file dialog_spice_model.h.

Referenced by addPwlValue(), generatePowerSource(), and Init().

◆ m_pwrAm

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrAm
protectedinherited

◆ m_pwrExp

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrExp
protectedinherited

◆ m_pwrExtData

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrExtData
protectedinherited

◆ m_pwrFm

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrFm
protectedinherited

◆ m_pwrPulse

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrPulse
protectedinherited

◆ m_pwrPwl

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrPwl
protectedinherited

◆ m_pwrRandom

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrRandom
protectedinherited

◆ m_pwrSin

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrSin
protectedinherited

◆ m_pwrTransNoise

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrTransNoise
protectedinherited

◆ m_pwrType

wxRadioBox* DIALOG_SPICE_MODEL_BASE::m_pwrType
protectedinherited

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 211 of file dialog_shim.h.

Referenced by DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_qmodal_parent_disabler

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited

◆ m_qmodal_showing

bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 213 of file dialog_shim.h.

Referenced by DIALOG_SHIM::IsQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_rnParam1

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_rnParam1
protectedinherited

◆ m_rnParam1Text

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_rnParam1Text
protectedinherited

◆ m_rnParam2

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_rnParam2
protectedinherited

◆ m_rnParam2Text

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_rnParam2Text
protectedinherited

◆ m_rnTD

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_rnTD
protectedinherited

◆ m_rnTS

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_rnTS
protectedinherited

◆ m_rnType

◆ m_schfields

std::vector<SCH_FIELD>* DIALOG_SPICE_MODEL::m_schfields
private

Definition at line 137 of file dialog_spice_model.h.

Referenced by getSchField(), TransferDataFromWindow(), and TransferDataToWindow().

◆ m_sdbSizer

wxStdDialogButtonSizer* DIALOG_SPICE_MODEL_BASE::m_sdbSizer
protectedinherited

◆ m_sdbSizerCancel

wxButton* DIALOG_SPICE_MODEL_BASE::m_sdbSizerCancel
protectedinherited

◆ m_sdbSizerOK

wxButton* DIALOG_SPICE_MODEL_BASE::m_sdbSizerOK
protectedinherited

◆ m_selectLibrary

wxButton* DIALOG_SPICE_MODEL_BASE::m_selectLibrary
protectedinherited

◆ m_sinAmplitude

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinAmplitude
protectedinherited

◆ m_sinDampFactor

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinDampFactor
protectedinherited

◆ m_sinDelay

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinDelay
protectedinherited

◆ m_sinFreq

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinFreq
protectedinherited

◆ m_sinOffset

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinOffset
protectedinherited

◆ m_spiceEmptyValidator

SPICE_VALIDATOR DIALOG_SPICE_MODEL::m_spiceEmptyValidator
private

Definition at line 168 of file dialog_spice_model.h.

Referenced by Init().

◆ m_spiceValidator

SPICE_VALIDATOR DIALOG_SPICE_MODEL::m_spiceValidator
private

Definition at line 167 of file dialog_spice_model.h.

Referenced by Init().

◆ m_staticline1

wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline1
protectedinherited

◆ m_staticline2

wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline2
protectedinherited

◆ m_staticline3

wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline3
protectedinherited

◆ m_staticText10

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText10
protectedinherited

◆ m_staticText11

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText11
protectedinherited

◆ m_staticText111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText111
protectedinherited

◆ m_staticText112

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText112
protectedinherited

◆ m_staticText113

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText113
protectedinherited

◆ m_staticText12

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText12
protectedinherited

◆ m_staticText13

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13
protectedinherited

◆ m_staticText131

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText131
protectedinherited

◆ m_staticText1311

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1311
protectedinherited

◆ m_staticText13111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13111
protectedinherited

◆ m_staticText132

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText132
protectedinherited

◆ m_staticText1321

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1321
protectedinherited

◆ m_staticText13211

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13211
protectedinherited

◆ m_staticText133

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText133
protectedinherited

◆ m_staticText1331

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1331
protectedinherited

◆ m_staticText13311

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13311
protectedinherited

◆ m_staticText134

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText134
protectedinherited

◆ m_staticText1341

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1341
protectedinherited

◆ m_staticText13411

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13411
protectedinherited

◆ m_staticText135

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText135
protectedinherited

◆ m_staticText1351

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1351
protectedinherited

◆ m_staticText13511

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13511
protectedinherited

◆ m_staticText136

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText136
protectedinherited

◆ m_staticText1361

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1361
protectedinherited

◆ m_staticText13611

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13611
protectedinherited

◆ m_staticText137

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText137
protectedinherited

◆ m_staticText1371

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1371
protectedinherited

◆ m_staticText138

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText138
protectedinherited

◆ m_staticText1381

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1381
protectedinherited

◆ m_staticText14

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText14
protectedinherited

◆ m_staticText141

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText141
protectedinherited

◆ m_staticText1411

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1411
protectedinherited

◆ m_staticText15

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText15
protectedinherited

◆ m_staticText151

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText151
protectedinherited

◆ m_staticText1511

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1511
protectedinherited

◆ m_staticText16

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText16
protectedinherited

◆ m_staticText161

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText161
protectedinherited

◆ m_staticText1611

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1611
protectedinherited

◆ m_staticText17

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText17
protectedinherited

◆ m_staticText171

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText171
protectedinherited

◆ m_staticText1711

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1711
protectedinherited

◆ m_staticText18

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText18
protectedinherited

◆ m_staticText181

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText181
protectedinherited

◆ m_staticText1811

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText1811
protectedinherited

◆ m_staticText20

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText20
protectedinherited

◆ m_staticText201

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText201
protectedinherited

◆ m_staticText21

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText21
protectedinherited

◆ m_staticText211

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText211
protectedinherited

◆ m_staticText212

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText212
protectedinherited

◆ m_staticText213

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText213
protectedinherited

◆ m_staticText214

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText214
protectedinherited

◆ m_staticText215

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText215
protectedinherited

◆ m_staticText22

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText22
protectedinherited

◆ m_staticText23

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText23
protectedinherited

◆ m_staticText24

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText24
protectedinherited

◆ m_staticText25

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText25
protectedinherited

◆ m_staticText26

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText26
protectedinherited

◆ m_staticText261

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText261
protectedinherited

◆ m_staticText262

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText262
protectedinherited

◆ m_staticText262111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText262111
protectedinherited

◆ m_staticText263

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText263
protectedinherited

◆ m_staticText263111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText263111
protectedinherited

◆ m_staticText264

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText264
protectedinherited

◆ m_staticText265

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText265
protectedinherited

◆ m_staticText266

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText266
protectedinherited

◆ m_staticText26711

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText26711
protectedinherited

◆ m_staticText27

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText27
protectedinherited

◆ m_staticText27111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText27111
protectedinherited

◆ m_staticText28

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText28
protectedinherited

◆ m_staticText28111

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText28111
protectedinherited

◆ m_staticText29

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText29
protectedinherited

◆ m_staticText30

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText30
protectedinherited

◆ m_staticText31

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText31
protectedinherited

◆ m_staticText32

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText32
protectedinherited

◆ m_staticText321

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText321
protectedinherited

◆ m_staticText34

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText34
protectedinherited

◆ m_staticText342

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText342
protectedinherited

◆ m_staticText343

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText343
protectedinherited

◆ m_staticText35

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText35
protectedinherited

◆ m_staticText4

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText4
protectedinherited

◆ m_staticText5

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText5
protectedinherited

◆ m_staticText62

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText62
protectedinherited

◆ m_staticText7

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText7
protectedinherited

◆ m_staticTextF1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextF1
protectedinherited

◆ m_staticTextF2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextF2
protectedinherited

◆ m_staticTextF3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextF3
protectedinherited

◆ m_staticTextG1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextG1
protectedinherited

◆ m_staticTextG2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextG2
protectedinherited

◆ m_staticTextG3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextG3
protectedinherited

◆ m_staticTextK1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextK1
protectedinherited

◆ m_staticTextK2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextK2
protectedinherited

◆ m_staticTextK3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextK3
protectedinherited

◆ m_staticTextM1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextM1
protectedinherited

◆ m_staticTextM2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextM2
protectedinherited

◆ m_staticTextM3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextM3
protectedinherited

◆ m_staticTextMeg1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextMeg1
protectedinherited

◆ m_staticTextMeg2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextMeg2
protectedinherited

◆ m_staticTextMeg3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextMeg3
protectedinherited

◆ m_staticTextN1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextN1
protectedinherited

◆ m_staticTextN2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextN2
protectedinherited

◆ m_staticTextN3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextN3
protectedinherited

◆ m_staticTextNote

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextNote
protectedinherited

◆ m_staticTextP1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextP1
protectedinherited

◆ m_staticTextP2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextP2
protectedinherited

◆ m_staticTextP3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextP3
protectedinherited

◆ m_staticTextPtype

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextPtype
protectedinherited

◆ m_staticTextPvalue

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextPvalue
protectedinherited

◆ m_staticTextSpVal

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextSpVal
protectedinherited

◆ m_staticTextT1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextT1
protectedinherited

◆ m_staticTextT2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextT2
protectedinherited

◆ m_staticTextT3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextT3
protectedinherited

◆ m_staticTextU1

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextU1
protectedinherited

◆ m_staticTextU2

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextU2
protectedinherited

◆ m_staticTextU3

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticTextU3
protectedinherited

◆ m_stInfoNote

wxStaticText* DIALOG_SPICE_MODEL_BASE::m_stInfoNote
protectedinherited

◆ m_symbol

SCH_SYMBOL& DIALOG_SPICE_MODEL::m_symbol
private

Fields from the symbol properties dialog.

Definition at line 134 of file dialog_spice_model.h.

Referenced by getSchField(), and TransferDataToWindow().

◆ m_tabOrder

◆ m_units

◆ m_useCalculatedSize

bool DIALOG_SHIM::m_useCalculatedSize
protectedinherited

◆ m_useSchFields

bool DIALOG_SPICE_MODEL::m_useSchFields
private

Temporary field values.

Definition at line 139 of file dialog_spice_model.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().


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