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
 

Public Member Functions

 DIALOG_SPICE_MODEL (wxWindow *aParent, SCH_COMPONENT &aComponent, SCH_FIELDS &aSchFields)
 
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 ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
EDA_UNITS_T GetUserUnits () const override
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

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)
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int VertPixelsFromDU (int y)
 Convert an integer number of dialog units to pixels, vertically. More...
 

Protected Attributes

wxNotebook * m_notebook
 
wxPanel * m_passive
 
wxStaticText * m_staticText2
 
wxComboBox * m_pasType
 
wxStaticText * m_staticText62
 
wxStaticText * m_staticText3
 
wxTextCtrl * m_pasValue
 
wxStaticText * m_staticText63
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticText32
 
wxStaticText * m_staticText321
 
wxStaticText * m_staticText341
 
wxStaticText * m_staticText_femto
 
wxStaticText * m_staticText36
 
wxStaticText * m_staticText37
 
wxStaticText * m_staticText38
 
wxStaticText * m_staticText39
 
wxStaticText * m_staticText40
 
wxStaticText * m_staticText41
 
wxStaticText * m_staticText42
 
wxStaticText * m_staticText43
 
wxStaticText * m_staticText44
 
wxStaticText * m_staticText46
 
wxStaticText * m_staticText47
 
wxStaticText * m_staticText48
 
wxStaticText * m_staticText45
 
wxStaticText * m_staticText49
 
wxStaticText * m_staticText50
 
wxStaticText * m_staticText51
 
wxStaticText * m_staticText52
 
wxStaticText * m_staticText53
 
wxStaticText * m_staticText54
 
wxStaticText * m_staticText55
 
wxStaticText * m_staticText56
 
wxStaticText * m_staticText57
 
wxStaticText * m_staticText58
 
wxStaticText * m_staticText59
 
wxStaticText * m_staticText60
 
wxPanel * m_model
 
wxStaticText * m_staticText7
 
wxTextCtrl * m_modelLibrary
 
wxButton * m_selectLibrary
 
wxStaticText * m_staticText5
 
wxComboBox * m_modelName
 
wxStaticText * m_staticText4
 
wxComboBox * m_modelType
 
wxTextCtrl * 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
 
wxPanel * m_pwrAm
 
wxPanel * m_pwrTransNoise
 
wxPanel * m_pwrRandom
 
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_T m_units
 
std::string m_hash_key
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

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) const
 Generates a string to describe power source parameters, basing on the current selection. More...
 
void loadLibrary (const wxString &aFilePath)
 Loads a list of components (.model and .subckt) from a spice library file and adds them to a combo box. More...
 
SCH_FIELDgetField (int aFieldType)
 Returns or creates a field in the edited schematic fields vector. More...
 
bool addPwlValue (const wxString &aTime, const wxString &aValue)
 Adds 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 onSelectLibrary (wxCommandEvent &event) override
 
void onModelSelected (wxCommandEvent &event) override
 
void onPwlAdd (wxCommandEvent &event) override
 
void onPwlRemove (wxCommandEvent &event) override
 

Private Attributes

SCH_COMPONENTm_component
 

Edited component

More...
 
SCH_FIELDSm_fields
 

Fields from the component properties dialog

More...
 
std::map< int, wxString > m_fieldsTmp
 

Temporary field values

More...
 
std::map< wxString, MODELm_models
 

Models available in the selected library file

More...
 
long m_pwlTimeCol
 

Column identifiers for PWL power source value list

More...
 
long m_pwlValueCol
 
SPICE_VALIDATOR m_spiceValidator
 
SPICE_VALIDATOR m_spiceEmptyValidator
 
wxTextValidator m_notEmptyValidator
 

Detailed Description

Definition at line 36 of file dialog_spice_model.h.

Constructor & Destructor Documentation

DIALOG_SPICE_MODEL::DIALOG_SPICE_MODEL ( wxWindow *  aParent,
SCH_COMPONENT aComponent,
SCH_FIELDS aSchFields 
)

Definition at line 95 of file dialog_spice_model.cpp.

References 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_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_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_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, and m_spiceValidator.

96  : DIALOG_SPICE_MODEL_BASE( aParent ), m_component( aComponent ), m_fields( aFields ),
97  m_spiceEmptyValidator( true ), m_notEmptyValidator( wxFILTER_EMPTY )
98 {
99  m_pasValue->SetValidator( m_spiceValidator );
100 
101  m_modelType->SetValidator( m_notEmptyValidator );
102  m_modelType->Clear();
103 
104  // Create a list of handled models
105  for( const auto& model : modelTypes )
106  m_modelType->Append( model.description );
107 
108  m_modelName->SetValidator( m_notEmptyValidator );
109 
110  m_genDc->SetValidator( m_spiceEmptyValidator );
111  m_genAcMag->SetValidator( m_spiceEmptyValidator );
112  m_genAcPhase->SetValidator( m_spiceEmptyValidator );
113 
114  m_pulseInit->SetValidator( m_spiceEmptyValidator );
115  m_pulseNominal->SetValidator( m_spiceEmptyValidator );
116  m_pulseDelay->SetValidator( m_spiceEmptyValidator );
117  m_pulseRise->SetValidator( m_spiceEmptyValidator );
118  m_pulseFall->SetValidator( m_spiceEmptyValidator );
119  m_pulseWidth->SetValidator( m_spiceEmptyValidator );
120  m_pulsePeriod->SetValidator( m_spiceEmptyValidator );
121 
122  m_sinOffset->SetValidator( m_spiceEmptyValidator );
123  m_sinAmplitude->SetValidator( m_spiceEmptyValidator );
124  m_sinFreq->SetValidator( m_spiceEmptyValidator );
125  m_sinDelay->SetValidator( m_spiceEmptyValidator );
126  m_sinDampFactor->SetValidator( m_spiceEmptyValidator );
127 
128  m_expInit->SetValidator( m_spiceEmptyValidator );
129  m_expPulsed->SetValidator( m_spiceEmptyValidator );
130  m_expRiseDelay->SetValidator( m_spiceEmptyValidator );
131  m_expRiseConst->SetValidator( m_spiceEmptyValidator );
132  m_expFallDelay->SetValidator( m_spiceEmptyValidator );
133  m_expFallConst->SetValidator( m_spiceEmptyValidator );
134 
135  m_pwlTimeCol = m_pwlValList->AppendColumn( "Time [s]", wxLIST_FORMAT_LEFT, 100 );
136  m_pwlValueCol = m_pwlValList->AppendColumn( "Value [V/A]", wxLIST_FORMAT_LEFT, 100 );
137 
138  m_sdbSizerOK->SetDefault();
139 
140 }
SCH_COMPONENT & m_component
Edited component
SPICE_VALIDATOR m_spiceValidator
long m_pwlTimeCol
Column identifiers for PWL power source value list
wxTextValidator m_notEmptyValidator
SCH_FIELDS & m_fields
Fields from the component properties dialog
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)
SPICE_VALIDATOR m_spiceEmptyValidator
static const std::vector< SPICE_MODEL_INFO > modelTypes

Member Function Documentation

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

Adds 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 735 of file dialog_spice_model.cpp.

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

Referenced by onPwlAdd(), and parsePowerSource().

736 {
737  // TODO execute validators
738  if( aTime.IsEmpty() || aValue.IsEmpty() )
739  return false;
740 
741  long idx = m_pwlValList->InsertItem( m_pwlTimeCol, aTime );
742  m_pwlValList->SetItem( idx, m_pwlValueCol, aValue );
743 
744  // There is no wxString::ToFloat, but we need to guarantee it fits in 4 bytes
745  double timeD;
746  float timeF;
747  m_pwlTime->GetValue().ToDouble( &timeD );
748  timeF = timeD;
749 
750  // Store the time value, so the entries can be sorted
751  m_pwlValList->SetItemData( idx, *reinterpret_cast<long*>( &timeF ) );
752 
753  // Sort items by timestamp
754  m_pwlValList->SortItems( comparePwlValues, -1 );
755 
756  return true;
757 }
long m_pwlTimeCol
Column identifiers for PWL power source value list
static int wxCALLBACK comparePwlValues(wxIntPtr aItem1, wxIntPtr aItem2, wxIntPtr WXUNUSED(aSortData))
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 221 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::IsQuasiModal().

222 {
223  // so we can do logging of this state change:
224 
225 #if defined(DEBUG)
226  const char* type_id = typeid( *this ).name();
227  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
228 #endif
229 
230  return wxDialog::Enable( enable );
231 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 381 of file dialog_shim.cpp.

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

Referenced by DIALOG_SHIM::OnButton(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), DIALOG_SHIM::SetInitialFocus(), and DIALOG_SHIM::~DIALOG_SHIM().

382 {
383  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
384  // handle validation in the same way as other dialogs.
385  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
386  return;
387 
388  SetReturnCode( retCode );
389 
390  if( !IsQuasiModal() )
391  {
392  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
393  return;
394  }
395 
396  if( m_qmodal_loop )
397  {
398  if( m_qmodal_loop->IsRunning() )
399  m_qmodal_loop->Exit( 0 );
400  else
401  m_qmodal_loop->ScheduleExit( 0 );
402 
403  m_qmodal_loop = NULL;
404  }
405 
408 
409  Show( false );
410 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:153
bool IsQuasiModal()
Definition: dialog_shim.h:95
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:155
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, when all widgets are initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at end of TransferDataToWindow, or better at end of a wxInitDialogEvent handler

In any case, the best way is to call it in a wxInitDialogEvent handler after calling TransfertDataToWindow(), which is the default wxInitDialogEvent handler wxDialog

Definition at line 120 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), 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_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(), DIALOG_FP_BROWSER_DISPLAY_OPTIONS::DIALOG_FP_BROWSER_DISPLAY_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_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_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_SCH_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), PAGED_DIALOG::finishInitialization(), DIALOG_SHIM::GetUserUnits(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), onInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

121 {
122  // must be called from the constructor of derived classes,
123  // when all widgets are initialized, and therefore their size fixed
124 
125  // SetSizeHints fixes the minimal size of sizers in the dialog
126  // (SetSizeHints calls Fit(), so no need to call it)
127  GetSizer()->SetSizeHints( this );
128 
129  // the default position, when calling the first time the dlg
130  Center();
131 }
bool DIALOG_SPICE_MODEL::generatePowerSource ( wxString &  aTarget) const
private

Generates 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 471 of file dialog_spice_model.cpp.

References DisplayError(), empty(), Format(), i, 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_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_pwrExp, DIALOG_SPICE_MODEL_BASE::m_pwrPulse, DIALOG_SPICE_MODEL_BASE::m_pwrPwl, DIALOG_SPICE_MODEL_BASE::m_pwrSin, 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().

472 {
473  wxString acdc, trans;
474  wxWindow* page = m_powerNotebook->GetCurrentPage();
475  bool useTrans = true; // shall we use the transient command part?
476 
477  // Variables for generic processing
478  bool genericProcessing = false;
479  unsigned int genericReqParamsCount = 0;
480  std::vector<wxTextCtrl*> genericControls;
481 
483  // If SPICE_VALUE can be properly constructed, then it is a valid value
484  try
485  {
486  if( !empty( m_genDc ) )
487  acdc += wxString::Format( "dc %s ", SPICE_VALUE( m_genDc->GetValue() ).ToSpiceString() );
488  }
489  catch( ... )
490  {
491  DisplayError( NULL, wxT( "Invalid DC value" ) );
492  return false;
493  }
494 
495  try
496  {
497  if( !empty( m_genAcMag ) )
498  {
499  acdc += wxString::Format( "ac %s ", SPICE_VALUE( m_genAcMag->GetValue() ).ToSpiceString() );
500 
501  if( !empty( m_genAcPhase ) )
502  acdc += wxString::Format( "%s ", SPICE_VALUE( m_genAcPhase->GetValue() ).ToSpiceString() );
503  }
504  }
505  catch( ... )
506  {
507  DisplayError( NULL, wxT( "Invalid AC magnitude or phase" ) );
508  return false;
509  }
510 
512  if( page == m_pwrPulse )
513  {
514  if( !m_pwrPulse->Validate() )
515  return false;
516 
517  genericProcessing = true;
518  trans += "pulse";
519  genericReqParamsCount = 2;
520  genericControls = { m_pulseInit, m_pulseNominal, m_pulseDelay,
522  }
523 
524 
525  else if( page == m_pwrSin )
526  {
527  if( !m_pwrSin->Validate() )
528  return false;
529 
530  genericProcessing = true;
531  trans += "sin";
532  genericReqParamsCount = 2;
534  }
535 
536 
537  else if( page == m_pwrExp )
538  {
539  if( !m_pwrExp->Validate() )
540  return false;
541 
542  genericProcessing = true;
543  trans += "exp";
544  genericReqParamsCount = 2;
545  genericControls = { m_expInit, m_expPulsed,
547  }
548 
549 
550  else if( page == m_pwrPwl )
551  {
552  if( m_pwlValList->GetItemCount() > 0 )
553  {
554  trans += "pwl(";
555 
556  for( int i = 0; i < m_pwlValList->GetItemCount(); ++i )
557  {
558  trans += wxString::Format( "%s %s ", m_pwlValList->GetItemText( i, m_pwlTimeCol ),
559  m_pwlValList->GetItemText( i, m_pwlValueCol ) );
560  }
561 
562  trans.Trim();
563  trans += ")";
564  }
565  }
566 
567  if( genericProcessing )
568  {
569  trans += "(";
570 
571  auto first_empty = std::find_if( genericControls.begin(), genericControls.end(), empty );
572  auto first_not_empty = std::find_if( genericControls.begin(), genericControls.end(),
573  []( const wxTextCtrl* c ){ return !empty( c ); } );
574 
575  if( std::distance( first_not_empty, genericControls.end() ) == 0 )
576  {
577  // all empty
578  useTrans = false;
579  }
580  else if( std::distance( genericControls.begin(), first_empty ) < (int)genericReqParamsCount )
581  {
582  DisplayError( nullptr,
583  wxString::Format( wxT( "You need to specify at least the "
584  "first %d parameters for the transient source" ),
585  genericReqParamsCount ) );
586 
587  return false;
588  }
589  else if( std::find_if_not( first_empty, genericControls.end(),
590  empty ) != genericControls.end() )
591  {
592  DisplayError( nullptr, wxT( "You cannot leave interleaved empty fields "
593  "when defining a transient source" ) );
594  return false;
595  }
596  else
597  {
598  std::for_each( genericControls.begin(), first_empty,
599  [&trans] ( wxTextCtrl* ctrl ) {
600  trans += wxString::Format( "%s ", ctrl->GetValue() );
601  } );
602  }
603 
604  trans.Trim();
605  trans += ")";
606  }
607 
608  aTarget = acdc;
609 
610  if( useTrans )
611  aTarget += trans;
612 
613  // Remove whitespaces from left and right side
614  aTarget.Trim( false );
615  aTarget.Trim( true );
616 
617  return true;
618 }
long m_pwlTimeCol
Column identifiers for PWL power source value list
static bool empty(const wxTextCtrl *aCtrl)
Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
Definition: spice_value.h:32
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
size_t i
Definition: json11.cpp:597
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
SCH_FIELD & DIALOG_SPICE_MODEL::getField ( int  aFieldType)
private

Returns or creates a field in the edited schematic fields vector.

Parameters
aFieldTypeis an SPICE_FIELD enum value.
Returns
Requested field.

Definition at line 717 of file dialog_spice_model.cpp.

References NETLIST_EXPORTER_PSPICE::GetSpiceFieldName(), m_component, and m_fields.

Referenced by TransferDataFromWindow().

718 {
719  const wxString& spiceField = NETLIST_EXPORTER_PSPICE::GetSpiceFieldName( (SPICE_FIELD) aFieldType );
720 
721  auto fieldIt = std::find_if( m_fields.begin(), m_fields.end(), [&]( const SCH_FIELD& f ) {
722  return f.GetName() == spiceField;
723  } );
724 
725  // Found one, so return it
726  if( fieldIt != m_fields.end() )
727  return *fieldIt;
728 
729  // Create a new field with requested name
730  m_fields.emplace_back( wxPoint(), m_fields.size(), &m_component, spiceField );
731  return m_fields.back();
732 }
Class SCH_FIELD instances are attached to a component and provide a place for the component&#39;s value...
Definition: sch_field.h:56
SCH_COMPONENT & m_component
Edited component
static const wxString & GetSpiceFieldName(SPICE_FIELD aField)
Returns a string used for a particular component field related to Spice simulation.
SCH_FIELDS & m_fields
Fields from the component properties dialog
int DIALOG_SHIM::HorizPixelsFromDU ( int  x)
protectedinherited

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

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 141 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_SHIM::GetUserUnits().

142 {
143  wxSize sz( x, 0 );
144  return ConvertDialogToPixels( sz ).x;
145 }
KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns 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 60 of file kiway_player.h.

References KIWAY_HOLDER::GetUserUnits(), KIWAY_HOLDER::m_kiway, KIWAY_HOLDER::Prj(), KIWAY_HOLDER::SetKiway(), and VTBL_ENTRY.

Referenced by TREEPROJECT_ITEM::Activate(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::KiwayMailIn(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), KICAD_MANAGER_FRAME::OnEditFpLibTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnEditSymLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::refreshSchematic(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), EDA_BASE_FRAME::ShowPreferences(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:94
void DIALOG_SPICE_MODEL::loadLibrary ( const wxString &  aFilePath)
private

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

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

Definition at line 621 of file dialog_spice_model.cpp.

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

Referenced by onSelectLibrary(), and TransferDataToWindow().

622 {
623  wxString curModel = m_modelName->GetValue();
624  m_models.clear();
625  wxFileName filePath( aFilePath );
626  bool in_subckt = false; // flag indicating that the parser is inside a .subckt section
627 
628  // Look for the file in the project path
629  if( !filePath.Exists() )
630  {
631  filePath.SetPath( Prj().GetProjectPath() + filePath.GetPath() );
632 
633  if( !filePath.Exists() )
634  return;
635  }
636 
637  // Display the library contents
638  wxWindowUpdateLocker updateLock( this );
639  m_libraryContents->Clear();
640  wxTextFile file;
641  file.Open( filePath.GetFullPath() );
642  int line_nr = 0;
643 
644  // Process the file, looking for components
645  while( !file.Eof() )
646  {
647  const wxString& line = line_nr == 0 ? file.GetFirstLine() : file.GetNextLine();
648  m_libraryContents->AppendText( line );
649  m_libraryContents->AppendText( "\n" );
650 
651  wxStringTokenizer tokenizer( line );
652 
653  while( tokenizer.HasMoreTokens() )
654  {
655  wxString token = tokenizer.GetNextToken().Lower();
656 
657  // some subckts contain .model clauses inside,
658  // skip them as they are a part of the subckt, not another model
659  if( token == ".model" && !in_subckt )
660  {
661  wxString name = tokenizer.GetNextToken();
662 
663  if( name.IsEmpty() )
664  break;
665 
666  token = tokenizer.GetNextToken();
667  SPICE_PRIMITIVE type = MODEL::parseModelType( token );
668 
669  if( type != SP_UNKNOWN )
670  m_models.emplace( name, MODEL( line_nr, type ) );
671  }
672 
673  else if( token == ".subckt" )
674  {
675  wxASSERT( !in_subckt );
676  in_subckt = true;
677 
678  wxString name = tokenizer.GetNextToken();
679 
680  if( name.IsEmpty() )
681  break;
682 
683  m_models.emplace( name, MODEL( line_nr, SP_SUBCKT ) );
684  }
685 
686  else if( token == ".ends" )
687  {
688  wxASSERT( in_subckt );
689  in_subckt = false;
690  }
691  }
692 
693  ++line_nr;
694  }
695 
696  wxArrayString modelsList;
697 
698  // Refresh the model name combobox values
699  m_modelName->Clear();
700 
701  for( const auto& model : m_models )
702  {
703  m_modelName->Append( model.first );
704  modelsList.Add( model.first );
705  }
706 
707  m_modelName->AutoComplete( modelsList );
708 
709  // Restore the previous value or if there is none - pick the first one from the loaded library
710  if( !curModel.IsEmpty() )
711  m_modelName->SetValue( curModel );
712  else if( m_modelName->GetCount() > 0 )
713  m_modelName->SetSelection( 0 );
714 }
static SPICE_PRIMITIVE parseModelType(const wxString &aValue)
Convert string to model
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const char * name
Definition: DXF_plotter.cpp:61
SPICE_PRIMITIVE
Basic Spice component primitives
std::map< wxString, MODEL > m_models
Models available in the selected library file
virtual void DIALOG_SPICE_MODEL::onInitDlg ( wxInitDialogEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 92 of file dialog_spice_model.h.

References DIALOG_SHIM::FinishDialogSettings(), onModelSelected(), onPwlAdd(), onPwlRemove(), onSelectLibrary(), and TransferDataToWindow().

93  {
94  // Call the default wxDialog handler of a wxInitDialogEvent
96 
97  // Now all widgets have the size fixed, call FinishDialogSettings
99  }
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
void DIALOG_SPICE_MODEL::onModelSelected ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 787 of file dialog_spice_model.cpp.

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

Referenced by onInitDlg().

788 {
789  // autoselect the model type
790  auto it = m_models.find( m_modelName->GetValue() );
791 
792  if( it != m_models.end() )
793  {
794  m_modelType->SetSelection( getModelTypeIdx( it->second.model ) );
795 
796  // scroll to the bottom, so the model definition is shown in the first line
797  m_libraryContents->ShowPosition(
798  m_libraryContents->XYToPosition( 0, m_libraryContents->GetNumberOfLines() ) );
799  m_libraryContents->ShowPosition( m_libraryContents->XYToPosition( 0, it->second.line ) );
800  }
801  else
802  {
803  m_libraryContents->ShowPosition( 0 );
804  }
805 }
static int getModelTypeIdx(char aPrimitive)
std::map< wxString, MODEL > m_models
Models available in the selected library file
void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 283 of file dialog_shim.cpp.

References DIALOG_SHIM::m_firstPaintEvent, and DIALOG_SHIM::m_initialFocusTarget.

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

284 {
285  if( m_firstPaintEvent )
286  {
287 #ifdef __WXMAC__
288  fixOSXCancelButtonIssue( this );
289  selectAllInTextCtrls( GetChildren() );
290 #endif
291 
293  m_initialFocusTarget->SetFocus();
294  else
295  SetFocus(); // Focus the dialog itself
296 
297  m_firstPaintEvent = false;
298  }
299 
300  event.Skip();
301 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
bool m_firstPaintEvent
Definition: dialog_shim.h:149
void DIALOG_SPICE_MODEL::onPwlAdd ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 808 of file dialog_spice_model.cpp.

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

Referenced by onInitDlg().

809 {
810  addPwlValue( m_pwlTime->GetValue(), m_pwlValue->GetValue() );
811 }
bool addPwlValue(const wxString &aTime, const wxString &aValue)
Adds a value to the PWL values list.
void DIALOG_SPICE_MODEL::onPwlRemove ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 814 of file dialog_spice_model.cpp.

References DIALOG_SPICE_MODEL_BASE::m_pwlValList.

Referenced by onInitDlg().

815 {
816  long idx = m_pwlValList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
817  m_pwlValList->DeleteItem( idx );
818 }
void DIALOG_SPICE_MODEL::onSelectLibrary ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_SPICE_MODEL_BASE.

Definition at line 760 of file dialog_spice_model.cpp.

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

Referenced by onInitDlg().

761 {
762  wxString searchPath = wxFileName( m_modelLibrary->GetValue() ).GetPath();
763 
764  if( searchPath.IsEmpty() )
765  searchPath = Prj().GetProjectPath();
766 
767  wxString wildcards = SpiceLibraryFileWildcard() + "|" + AllFilesWildcard;
768  wxFileDialog openDlg( this, _( "Select library" ), searchPath, "", wildcards,
769  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
770 
771  if( openDlg.ShowModal() == wxID_CANCEL )
772  return;
773 
774  wxFileName libPath( openDlg.GetPath() );
775 
776  // Try to convert the path to relative to project
777  if( libPath.MakeRelativeTo( Prj().GetProjectPath() ) && !libPath.GetFullPath().StartsWith( ".." ) )
778  m_modelLibrary->SetValue( libPath.GetFullPath() );
779  else
780  m_modelLibrary->SetValue( openDlg.GetPath() );
781 
782  loadLibrary( openDlg.GetPath() );
783  m_modelName->Popup();
784 }
const wxString AllFilesWildcard
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void loadLibrary(const wxString &aFilePath)
Loads a list of components (.model and .subckt) from a spice library file and adds them to a combo bo...
wxString SpiceLibraryFileWildcard()
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
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 319 of file dialog_spice_model.cpp.

References addPwlValue(), i, 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_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_pwrExp, DIALOG_SPICE_MODEL_BASE::m_pwrPulse, DIALOG_SPICE_MODEL_BASE::m_pwrPwl, DIALOG_SPICE_MODEL_BASE::m_pwrSin, 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, and SPICE_VALUE::ToSpiceString().

Referenced by TransferDataToWindow().

320 {
321  if( aModel.IsEmpty() )
322  return false;
323 
324  wxStringTokenizer tokenizer( aModel, " ()" );
325  wxString tkn = tokenizer.GetNextToken().Lower();
326 
327  while( tokenizer.HasMoreTokens() )
328  {
329  // Variables used for generic values processing (filling out wxTextCtrls in sequence)
330  bool genericProcessing = false;
331  unsigned int genericReqParamsCount = 0;
332  std::vector<wxTextCtrl*> genericControls;
333 
334  if( tkn == "dc" )
335  {
336  // There might be an optional "dc" or "trans" directive, skip it
337  if( tkn == "dc" || tkn == "trans" )
338  tkn = tokenizer.GetNextToken().Lower();
339 
340  // DC value
341  try
342  {
343  m_genDc->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
344  }
345  catch( ... )
346  {
347  return false;
348  }
349  }
350 
351 
352  else if( tkn == "ac" )
353  {
354  // AC magnitude
355  try
356  {
357  tkn = tokenizer.GetNextToken().Lower();
358  m_genAcMag->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
359  }
360  catch( ... )
361  {
362  return false;
363  }
364 
365  // AC phase (optional)
366  try
367  {
368  tkn = tokenizer.GetNextToken().Lower();
369  m_genAcPhase->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
370  }
371  catch( ... )
372  {
373  continue; // perhaps another directive
374  }
375  }
376 
377 
378  else if( tkn == "pulse" )
379  {
380  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrPulse ) );
381 
382  genericProcessing = true;
383  genericReqParamsCount = 2;
384  genericControls = { m_pulseInit, m_pulseNominal, m_pulseDelay,
386  }
387 
388 
389  else if( tkn == "sin" )
390  {
391  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrSin ) );
392 
393  genericProcessing = true;
394  genericReqParamsCount = 2;
396  }
397 
398 
399  else if( tkn == "exp" )
400  {
401  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrExp ) );
402 
403  genericProcessing = true;
404  genericReqParamsCount = 2;
405  genericControls = { m_expInit, m_expPulsed,
407  }
408 
409 
410  else if( tkn == "pwl" )
411  {
412  m_powerNotebook->SetSelection( m_powerNotebook->FindPage( m_pwrPwl ) );
413 
414  try
415  {
416  while( tokenizer.HasMoreTokens() )
417  {
418  tkn = tokenizer.GetNextToken();
419  SPICE_VALUE time( tkn );
420 
421  tkn = tokenizer.GetNextToken();
422  SPICE_VALUE value( tkn );
423 
424  addPwlValue( time.ToSpiceString(), value.ToSpiceString() );
425  }
426  }
427  catch( ... )
428  {
429  return false;
430  }
431  }
432 
433 
434  else
435  {
436  // Unhandled power source type
437  wxASSERT_MSG( false, "Unhandled power source type" );
438  return false;
439  }
440 
441 
442  if( genericProcessing )
443  {
444  try
445  {
446  for( unsigned int i = 0; i < genericControls.size(); ++i )
447  {
448  // If there are no more tokens, let's check if we got at least required fields
449  if( !tokenizer.HasMoreTokens() )
450  return ( i >= genericReqParamsCount );
451 
452  tkn = tokenizer.GetNextToken().Lower();
453  genericControls[i]->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
454  }
455  }
456  catch( ... )
457  {
458  return false;
459  }
460  }
461 
462  // Get the next token now, so if any of the branches catches an expection, try to
463  // process it in another branch
464  tkn = tokenizer.GetNextToken().Lower();
465  }
466 
467  return true;
468 }
bool addPwlValue(const wxString &aTime, const wxString &aValue)
Adds a value to the PWL values list.
Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
Definition: spice_value.h:32
size_t i
Definition: json11.cpp:597
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), LIB_VIEW_FRAME::BestZoom(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::Files_io_from_id(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), KIWAY_HOLDER::Kiway(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), CVPCB_MAINFRAME::OnConfigurePaths(), FOOTPRINT_EDIT_FRAME::OnConfigurePaths(), KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), KICAD_MANAGER_FRAME::OnRunGerbview(), DIALOG_BOM::OnRunPlugin(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), KICAD_MANAGER_FRAME::OnSaveProject(), onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::saveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), KICAD_MANAGER_FRAME::SetProjectFileName(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), LAUNCHER_PANEL::~LAUNCHER_PANEL(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:142
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 86 of file dialog_shim.h.

References DIALOG_SHIM::EndQuasiModal(), DIALOG_SHIM::m_initialFocusTarget, and DIALOG_SHIM::ShowQuasiModal().

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_EDIT_ONE_FIELD::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(), and LIB_EDIT_FRAME::savePartAs().

87  {
88  m_initialFocusTarget = aWindow;
89  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 47 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), InvokePcbLibTableEditor(), KIWAY_HOLDER::Kiway(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

48 {
49 #if defined(DEBUG)
50  // offer a trap point for debugging most any window
51  wxASSERT( aDest );
52  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
53  {
54  int breakhere=1;
55  (void) breakhere;
56  }
57 #endif
58 
59  (void) aDest;
60 
61  m_kiway = aKiway;
62 }
KIWAY * m_kiway
Definition: kiway_player.h:94
const char * name
Definition: DXF_plotter.cpp:61
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 134 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::GetUserUnits(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

135 {
136  wxSize sz( x, y );
137  SetSize( ConvertDialogToPixels( sz ) );
138 }
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 162 of file dialog_shim.cpp.

References class_map, EDA_RECT::GetPosition(), EDA_RECT::GetSize(), DIALOG_SHIM::m_hash_key, max, wxPoint::x, and wxPoint::y.

Referenced by DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), DIALOG_SHIM::IsQuasiModal(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_SCH_FIND::OnCancel(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DRC::ShowDRCDialog(), DIALOG_SHIM::ShowQuasiModal(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

163 {
164  bool ret;
165  const char* hash_key;
166 
167  if( m_hash_key.size() )
168  {
169  // a special case like EDA_LIST_DIALOG, which has multiple uses.
170  hash_key = m_hash_key.c_str();
171  }
172  else
173  {
174  hash_key = typeid(*this).name();
175  }
176 
177  // Show or hide the window. If hiding, save current position and size.
178  // If showing, use previous position and size.
179  if( show )
180  {
181 #ifndef __WINDOWS__
182  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
183 #endif
184  ret = wxDialog::Show( show );
185 
186  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
187  EDA_RECT savedDialogRect = class_map[ hash_key ];
188 
189  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
190  {
191  SetSize( savedDialogRect.GetPosition().x,
192  savedDialogRect.GetPosition().y,
193  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
194  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
195  0 );
196  }
197 
198  // Be sure that the dialog appears in a visible area
199  // (the dialog position might have been stored at the time when it was
200  // shown on another display)
201  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
202  Centre();
203  }
204  else
205  {
206  // Save the dialog's position & size before hiding, using classname as key
207  class_map[ hash_key ] = EDA_RECT( wxDialog::GetPosition(), wxDialog::GetSize() );
208 
209 #ifdef __WXMAC__
210  if ( m_eventLoop )
211  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
212 #endif
213 
214  ret = wxDialog::Show( show );
215  }
216 
217  return ret;
218 }
const wxSize GetSize() const
Definition: eda_rect.h:101
std::string m_hash_key
Definition: dialog_shim.h:144
static RECT_MAP class_map
const wxPoint GetPosition() const
Definition: eda_rect.h:113
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 327 of file dialog_shim.cpp.

References DBG, DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), SCH_EDIT_FRAME::InstallHierarchyFrame(), PCB_BASE_FRAME::InstallPadOptionsFrame(), InvokeDialogEditComponentsLibId(), InvokeDialogUpdateFields(), LIB_EDIT_FRAME::OnEditComponentProperties(), PCB_EDIT_FRAME::OnEditTracksAndVias(), SCH_EDIT_FRAME::OnLaunchBomManager(), SCH_EDIT_FRAME::OnRemapSymbols(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), EDIT_TOOL::Properties(), SCH_BASE_FRAME::SelectComponentFromLibTree(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), and DIALOG_SHIM::SetInitialFocus().

328 {
329  // This is an exception safe way to zero a pointer before returning.
330  // Yes, even though DismissModal() clears this first normally, this is
331  // here in case there's an exception before the dialog is dismissed.
332  struct NULLER
333  {
334  void*& m_what;
335  NULLER( void*& aPtr ) : m_what( aPtr ) {}
336  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
337  } clear_this( (void*&) m_qmodal_loop );
338 
339  // release the mouse if it's currently captured as the window having it
340  // will be disabled when this dialog is shown -- but will still keep the
341  // capture making it impossible to do anything in the modal dialog itself
342  wxWindow* win = wxWindow::GetCapture();
343  if( win )
344  win->ReleaseMouse();
345 
346  // Get the optimal parent
347  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
348 
349  // Show the optimal parent
350  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
351 
352  wxASSERT_MSG( !m_qmodal_parent_disabler,
353  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
354 
355  // quasi-modal: disable only my "optimal" parent
357 
358 #ifdef __WXMAC__
359  // Apple in its infinite wisdom will raise a disabled window before even passing
360  // us the event, so we have no way to stop it. Instead, we must set an order on
361  // the windows so that the quasi-modal will be pushed in front of the disabled
362  // window when it is raised.
363  ReparentQuasiModal();
364 #endif
365  Show( true );
366 
367  m_qmodal_showing = true;
368 
369  WX_EVENT_LOOP event_loop;
370 
371  m_qmodal_loop = &event_loop;
372 
373  event_loop.Run();
374 
375  m_qmodal_showing = false;
376 
377  return GetReturnCode();
378 }
bool m_qmodal_showing
Definition: dialog_shim.h:154
#define WX_EVENT_LOOP
Definition: kiway_player.h:100
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:153
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:155
Toggle a window&#39;s "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:33
#define DBG(x)
Definition: fctsys.h:33
bool DIALOG_SPICE_MODEL::TransferDataFromWindow ( )
overrideprivatevirtual

Definition at line 143 of file dialog_spice_model.cpp.

References empty(), generatePowerSource(), getField(), NETLIST_EXPORTER_PSPICE::GetSpiceFieldName(), i, DIALOG_SPICE_MODEL_BASE::m_disabled, m_fields, m_fieldsTmp, 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, 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.

144 {
145  if( !DIALOG_SPICE_MODEL_BASE::TransferDataFromWindow() )
146  return false;
147 
148  wxWindow* page = m_notebook->GetCurrentPage();
149 
150  // Passive
151  if( page == m_passive )
152  {
153  if( !m_passive->Validate() )
154  return false;
155 
156  switch( m_pasType->GetSelection() )
157  {
158  case 0: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_RESISTOR; break;
159  case 1: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_CAPACITOR; break;
160  case 2: m_fieldsTmp[SF_PRIMITIVE] = (char) SP_INDUCTOR; break;
161 
162  default:
163  wxASSERT_MSG( false, "Unhandled passive type" );
164  return false;
165  break;
166  }
167 
168  m_fieldsTmp[SF_MODEL] = m_pasValue->GetValue();
169  }
170 
171 
172  // Model
173  else if( page == m_model )
174  {
175  if( !m_model->Validate() )
176  return false;
177 
178  int modelIdx = m_modelType->GetSelection();
179 
180  if( modelIdx > 0 && modelIdx < (int)modelTypes.size() )
181  m_fieldsTmp[SF_PRIMITIVE] = static_cast<char>( modelTypes[modelIdx].type );
182 
183  m_fieldsTmp[SF_MODEL] = m_modelName->GetValue();
184 
185  if( !empty( m_modelLibrary ) )
186  m_fieldsTmp[SF_LIB_FILE] = m_modelLibrary->GetValue();
187  }
188 
189  // Power source
190  else if( page == m_power )
191  {
192  wxString model;
193 
194  if( !generatePowerSource( model ) )
195  return false;
196 
197  m_fieldsTmp[SF_PRIMITIVE] = (char)( m_pwrType->GetSelection() ? SP_ISOURCE : SP_VSOURCE );
198  m_fieldsTmp[SF_MODEL] = model;
199  }
200 
201 
202  else
203  {
204  wxASSERT_MSG( false, "Unhandled model type" );
205  return false;
206  }
207 
208  m_fieldsTmp[SF_ENABLED] = !m_disabled->GetValue() ? "Y" : "N"; // note bool inversion
209  m_fieldsTmp[SF_NODE_SEQUENCE] = m_nodeSeqCheck->IsChecked() ? m_nodeSeqVal->GetValue() : "";
210 
211  // Apply the settings
212  for( int i = 0; i < SF_END; ++i )
213  {
214  if( m_fieldsTmp.count( (SPICE_FIELD) i ) > 0 && !m_fieldsTmp.at( i ).IsEmpty() )
215  {
216  getField( i ).SetText( m_fieldsTmp[i] );
217  }
218  else
219  {
220  // Erase empty fields (having empty fields causes a warning in the properties dialog)
221  const wxString& spiceField = NETLIST_EXPORTER_PSPICE::GetSpiceFieldName( (SPICE_FIELD) i );
222 
223  auto fieldIt = std::find_if( m_fields.begin(), m_fields.end(), [&]( const SCH_FIELD& f ) {
224  return f.GetName() == spiceField;
225  } );
226 
227  if( fieldIt != m_fields.end() )
228  m_fields.erase( fieldIt );
229  }
230  }
231 
232  return true;
233 }
Class SCH_FIELD instances are attached to a component and provide a place for the component&#39;s value...
Definition: sch_field.h:56
SCH_FIELD & getField(int aFieldType)
Returns or creates a field in the edited schematic fields vector.
static const wxString & GetSpiceFieldName(SPICE_FIELD aField)
Returns a string used for a particular component field related to Spice simulation.
bool generatePowerSource(wxString &aTarget) const
Generates a string to describe power source parameters, basing on the current selection.
static bool empty(const wxTextCtrl *aCtrl)
std::map< int, wxString > m_fieldsTmp
Temporary field values
SCH_FIELDS & m_fields
Fields from the component properties dialog
size_t i
Definition: json11.cpp:597
static const std::vector< SPICE_MODEL_INFO > modelTypes
virtual void SetText(const wxString &aText)
Definition: eda_text.h:154
bool DIALOG_SPICE_MODEL::TransferDataToWindow ( )
overrideprivatevirtual

Definition at line 236 of file dialog_spice_model.cpp.

References empty(), getModelTypeIdx(), NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal(), NETLIST_EXPORTER_PSPICE::GetSpiceFields(), loadLibrary(), m_component, DIALOG_SPICE_MODEL_BASE::m_disabled, m_fields, m_fieldsTmp, 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, NET_ADJUST_INCLUDE_PATHS, NET_ADJUST_PASSIVE_VALS, parsePowerSource(), SF_ENABLED, SF_LIB_FILE, SF_MODEL, SF_NODE_SEQUENCE, SF_PRIMITIVE, 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().

237 {
238  const auto& spiceFields = NETLIST_EXPORTER_PSPICE::GetSpiceFields();
239 
240  // Fill out the working buffer
241  for( unsigned int idx = 0; idx < spiceFields.size(); ++idx )
242  {
243  const wxString& spiceField = spiceFields[idx];
244 
245  auto fieldIt = std::find_if( m_fields.begin(), m_fields.end(), [&]( const SCH_FIELD& f ) {
246  return f.GetName() == spiceField;
247  } );
248 
249  // Do not modify the existing value, just add missing fields with default values
250  if( fieldIt != m_fields.end() && !fieldIt->GetText().IsEmpty() )
251  m_fieldsTmp[idx] = fieldIt->GetText();
252  else
255  }
256 
257  // Analyze the component fields to fill out the dialog
258  char primitive = toupper( m_fieldsTmp[SF_PRIMITIVE][0] );
259 
260  switch( primitive )
261  {
262  case SP_RESISTOR:
263  case SP_CAPACITOR:
264  case SP_INDUCTOR:
265  m_notebook->SetSelection( m_notebook->FindPage( m_passive ) );
266  m_pasType->SetSelection( primitive == SP_RESISTOR ? 0
267  : primitive == SP_CAPACITOR ? 1
268  : primitive == SP_INDUCTOR ? 2
269  : -1 );
270  m_pasValue->SetValue( m_fieldsTmp[SF_MODEL] );
271  break;
272 
273  case SP_DIODE:
274  case SP_BJT:
275  case SP_MOSFET:
276  case SP_JFET:
277  case SP_SUBCKT:
278  m_notebook->SetSelection( m_notebook->FindPage( m_model ) );
279  m_modelType->SetSelection( getModelTypeIdx( primitive ) );
280  m_modelName->SetValue( m_fieldsTmp[SF_MODEL] );
281  m_modelLibrary->SetValue( m_fieldsTmp[SF_LIB_FILE] );
282 
283  if( !empty( m_modelLibrary ) )
284  {
285  const wxString& libFile = m_modelLibrary->GetValue();
286  m_fieldsTmp[SF_LIB_FILE] = libFile;
287  loadLibrary( libFile );
288  }
289  break;
290 
291  case SP_VSOURCE:
292  case SP_ISOURCE:
293  if( !parsePowerSource( m_fieldsTmp[SF_MODEL] ) )
294  return false;
295 
296  m_notebook->SetSelection( m_notebook->FindPage( m_power ) );
297  m_pwrType->SetSelection( primitive == SP_ISOURCE ? 1 : 0 );
298  break;
299 
300  default:
301  //wxASSERT_MSG( false, "Unhandled Spice primitive type" );
302  break;
303  }
304 
306 
307  // Check if node sequence is different than the default one
310  {
311  m_nodeSeqCheck->SetValue( true );
313  }
314 
315  return DIALOG_SPICE_MODEL_BASE::TransferDataToWindow();
316 }
Class SCH_FIELD instances are attached to a component and provide a place for the component&#39;s value...
Definition: sch_field.h:56
SCH_COMPONENT & m_component
Edited component
static bool StringToBool(const wxString &aStr)
Convertes 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)
static wxString GetSpiceFieldDefVal(SPICE_FIELD aField, SCH_COMPONENT *aComponent, unsigned aCtl)
Retrieves the default value for a given field.
static bool empty(const wxTextCtrl *aCtrl)
std::map< int, wxString > m_fieldsTmp
Temporary field values
SCH_FIELDS & m_fields
Fields from the component properties dialog
void loadLibrary(const wxString &aFilePath)
Loads a list of components (.model and .subckt) from a spice library file and adds them to a combo bo...
static const std::vector< wxString > & GetSpiceFields()
Returns a vector of component field names related to Spice simulation.
virtual bool DIALOG_SPICE_MODEL::Validate ( )
inlineoverrideprivatevirtual

Definition at line 87 of file dialog_spice_model.h.

88  {
89  return true;
90  }
int DIALOG_SHIM::VertPixelsFromDU ( int  y)
protectedinherited

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

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 148 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_SHIM::GetUserUnits().

149 {
150  wxSize sz( 0, y );
151  return ConvertDialogToPixels( sz ).y;
152 }

Member Data Documentation

SCH_COMPONENT& DIALOG_SPICE_MODEL::m_component
private

Edited component

Definition at line 108 of file dialog_spice_model.h.

Referenced by getField(), and TransferDataToWindow().

wxCheckBox* DIALOG_SPICE_MODEL_BASE::m_disabled
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expFallConst
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expFallDelay
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expInit
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expPulsed
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expRiseConst
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_expRiseDelay
protectedinherited
SCH_FIELDS& DIALOG_SPICE_MODEL::m_fields
private

Fields from the component properties dialog

Definition at line 111 of file dialog_spice_model.h.

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

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

Temporary field values

Definition at line 114 of file dialog_spice_model.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 149 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genAcMag
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genAcPhase
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_genDc
protectedinherited
wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 150 of file dialog_shim.h.

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

wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_libraryContents
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_model
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_modelLibrary
protectedinherited
std::map<wxString, MODEL> DIALOG_SPICE_MODEL::m_models
private

Models available in the selected library file

Definition at line 134 of file dialog_spice_model.h.

Referenced by loadLibrary(), and onModelSelected().

wxComboBox* DIALOG_SPICE_MODEL_BASE::m_modelType
protectedinherited
wxCheckBox* DIALOG_SPICE_MODEL_BASE::m_nodeSeqCheck
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_nodeSeqVal
protectedinherited
wxNotebook* DIALOG_SPICE_MODEL_BASE::m_notebook
protectedinherited
wxTextValidator DIALOG_SPICE_MODEL::m_notEmptyValidator
private

Definition at line 141 of file dialog_spice_model.h.

Referenced by DIALOG_SPICE_MODEL().

wxPanel* DIALOG_SPICE_MODEL_BASE::m_passive
protectedinherited
wxComboBox* DIALOG_SPICE_MODEL_BASE::m_pasType
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pasValue
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_power
protectedinherited
wxNotebook* DIALOG_SPICE_MODEL_BASE::m_powerNotebook
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseDelay
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseFall
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseInit
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseNominal
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulsePeriod
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseRise
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pulseWidth
protectedinherited
wxButton* DIALOG_SPICE_MODEL_BASE::m_pwlAddButton
protectedinherited
wxButton* DIALOG_SPICE_MODEL_BASE::m_pwlRemoveBtn
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlTime
protectedinherited
long DIALOG_SPICE_MODEL::m_pwlTimeCol
private

Column identifiers for PWL power source value list

Definition at line 137 of file dialog_spice_model.h.

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

wxListCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlValList
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_pwlValue
protectedinherited
long DIALOG_SPICE_MODEL::m_pwlValueCol
private

Definition at line 137 of file dialog_spice_model.h.

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

wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrAm
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrExp
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrExtData
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrFm
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrPulse
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrPwl
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrRandom
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrSin
protectedinherited
wxPanel* DIALOG_SPICE_MODEL_BASE::m_pwrTransNoise
protectedinherited
wxRadioBox* DIALOG_SPICE_MODEL_BASE::m_pwrType
protectedinherited
WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 153 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 154 of file dialog_shim.h.

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

wxStdDialogButtonSizer* DIALOG_SPICE_MODEL_BASE::m_sdbSizer
protectedinherited
wxButton* DIALOG_SPICE_MODEL_BASE::m_sdbSizerCancel
protectedinherited
wxButton* DIALOG_SPICE_MODEL_BASE::m_sdbSizerOK
protectedinherited
wxButton* DIALOG_SPICE_MODEL_BASE::m_selectLibrary
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinAmplitude
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinDampFactor
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinDelay
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinFreq
protectedinherited
wxTextCtrl* DIALOG_SPICE_MODEL_BASE::m_sinOffset
protectedinherited
SPICE_VALIDATOR DIALOG_SPICE_MODEL::m_spiceEmptyValidator
private

Definition at line 140 of file dialog_spice_model.h.

Referenced by DIALOG_SPICE_MODEL().

SPICE_VALIDATOR DIALOG_SPICE_MODEL::m_spiceValidator
private

Definition at line 139 of file dialog_spice_model.h.

Referenced by DIALOG_SPICE_MODEL().

wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline1
protectedinherited
wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline2
protectedinherited
wxStaticLine* DIALOG_SPICE_MODEL_BASE::m_staticline3
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText10
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText11
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText111
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText112
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText113
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText12
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText13
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText131
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText132
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText133
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText134
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText135
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText136
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText137
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText14
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText15
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText16
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText17
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText18
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText2
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText20
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText21
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText211
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText212
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText213
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText214
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText215
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText22
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText23
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText24
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText25
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText26
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText261
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText262
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText263
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText264
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText265
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText266
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText27
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText28
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText29
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText3
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText30
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText31
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText32
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText321
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText34
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText341
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText342
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText343
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText35
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText36
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText37
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText38
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText39
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText4
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText40
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText41
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText42
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText43
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText44
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText45
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText46
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText47
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText48
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText49
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText5
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText50
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText51
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText52
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText53
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText54
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText55
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText56
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText57
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText58
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText59
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText60
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText62
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText63
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText7
protectedinherited
wxStaticText* DIALOG_SPICE_MODEL_BASE::m_staticText_femto
protectedinherited

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