42#include <wx/filedlg.h> 
   43#include <fmt/format.h> 
   48#include <wx/filedlg.h> 
   53#define FORCE_REFRESH_FROM_MODEL true 
   56bool equivalent( SIM_MODEL::DEVICE_T a, SIM_MODEL::DEVICE_T b )
 
 
   67                                       std::vector<SCH_FIELD>& aFields ) :
 
   85    if constexpr (std::is_same_v<T, SCH_SYMBOL>)
 
   91    if( 
EMBEDDED_FILES* symbolEmbeddedFiles = aSymbol.GetEmbeddedFiles() )
 
  100        if( !pin->GetParentSymbol()->IsMultiBodyStyle() || pin->GetBodyStyle() < 2 )
 
  101            m_sortedPartPins.push_back( pin );
 
  108                   return StrNumCmp( lhs->GetNumber(), rhs->GetNumber(), true ) < 0;
 
  121    grid->SetCellDisabledTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
 
  125    grid->DedicateKey( WXK_RETURN );
 
  126    grid->DedicateKey( WXK_NUMPAD_ENTER );
 
  127    grid->DedicateKey( WXK_UP );
 
  128    grid->DedicateKey( WXK_DOWN );
 
  130#if wxCHECK_VERSION( 3, 3, 0 ) 
  131    grid->AddActionTrigger( wxPGKeyboardAction::Edit, WXK_RETURN );
 
  132    grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_RETURN );
 
  133    grid->AddActionTrigger( wxPGKeyboardAction::Edit, WXK_NUMPAD_ENTER );
 
  134    grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_NUMPAD_ENTER );
 
  136    grid->AddActionTrigger( wxPG_ACTION_EDIT, WXK_RETURN );
 
  137    grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN );
 
  138    grid->AddActionTrigger( wxPG_ACTION_EDIT, WXK_NUMPAD_ENTER );
 
  139    grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_NUMPAD_ENTER );
 
 
  155    for( wxPropertyGridIterator it = 
m_paramGrid->GetIterator(); !it.AtEnd(); ++it )
 
 
  172    wxCommandEvent dummyEvent;
 
  175    wxString       modelParams;
 
  177    bool           storeInValue = 
false;
 
  183                                  &deviceType, &modelType, &modelParams, &pinMap ) )
 
  187        if( !modelType.IsEmpty() )
 
  202    wxFileName tmp( libraryFilename );
 
  204    if( !tmp.GetFullName().IsEmpty() )
 
  228            if( modelIdx == wxNOT_FOUND )
 
  230                m_infoBar->ShowMessage( wxString::Format( 
_( 
"No model named '%s' in library." ),
 
  261                for( 
const std::pair<std::string, std::string>& strs : ibismodel->
GetIbisPins() )
 
  267                        ibismodel->
ChangePin( *ibisLibrary, strs.first );
 
  274                if( i < 
static_cast<int>( ibismodel->
GetIbisPins().size() ) )
 
  308    for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
 
  333        curModel().SetIsStoredInValue( 
true );
 
  338    return DIALOG_SIM_MODEL_BASE::TransferDataToWindow();
 
 
  348    if( !
m_paramGrid->GetGrid()->CommitChangesFromEditor() )
 
  351    if( !DIALOG_SIM_MODEL_BASE::TransferDataFromWindow() )
 
  361        wxFileName fn( 
path );
 
  364            && !fn.GetFullPath().StartsWith( 
".." ) )
 
  366            path = fn.GetFullPath();
 
  393            std::string differential;
 
  396                pins = ibismodel->GetIbisPins().at( 
m_pinCombobox->GetSelection() ).first;
 
  407    if( model.
GetType() == SIM_MODEL::TYPE::RAWSPICE )
 
  412        wxString code = 
m_codePreview->GetText().Trim( 
true ).Trim( 
false );
 
  413        model.
SetParamValue( 
"model", std::string( code.ToUTF8() ) );
 
  424                                               std::string( symbolPinName.ToUTF8() ) );
 
 
  480    SendSizeEvent( wxSEND_EVENT_POST );
 
 
  504            for( SIM_MODEL::TYPE type : { SIM_MODEL::TYPE::KIBIS_DEVICE,
 
  505                                          SIM_MODEL::TYPE::KIBIS_DRIVER_DC,
 
  506                                          SIM_MODEL::TYPE::KIBIS_DRIVER_RECT,
 
  507                                          SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS } )
 
  517                    if( type == aModel->
GetType() )
 
 
  540            for( SIM_MODEL::DEVICE_T deviceType : SIM_MODEL::DEVICE_T_ITERATOR() )
 
  551            for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
 
  553                if( type == SIM_MODEL::TYPE::KIBIS_DEVICE
 
  554                        || type == SIM_MODEL::TYPE::KIBIS_DRIVER_DC
 
  555                        || type == SIM_MODEL::TYPE::KIBIS_DRIVER_RECT
 
  556                        || type == SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS )
 
  569                    if( type == aModel->
GetType() )
 
 
  626        m_paramGrid->Append( 
new wxPropertyCategory( 
"AC" ) );
 
  629        m_paramGrid->Append( 
new wxPropertyCategory( 
"DC" ) );
 
  632        m_paramGrid->Append( 
new wxPropertyCategory( 
"S-Parameters" ) );
 
  635        m_paramGrid->Append( 
new wxPropertyCategory( 
"Capacitance" ) );
 
  638        m_paramGrid->Append( 
new wxPropertyCategory( 
"Temperature" ) );
 
  641        m_paramGrid->Append( 
new wxPropertyCategory( 
"Noise" ) );
 
  644        m_paramGrid->Append( 
new wxPropertyCategory( 
"Distributed Quantities" ) );
 
  645        m_paramGrid->HideProperty( 
"Distributed Quantities" );
 
  647        m_paramGrid->Append( 
new wxPropertyCategory( 
"Waveform" ) );
 
  650        m_paramGrid->Append( 
new wxPropertyCategory( 
"Limiting Values" ) );
 
  653        m_paramGrid->Append( 
new wxPropertyCategory( 
"Advanced" ) );
 
  656        m_paramGrid->Append( 
new wxPropertyCategory( 
"Flags" ) );
 
  673    for( wxPropertyGridIterator it = 
m_paramGrid->GetIterator(); !it.AtEnd(); ++it )
 
  675        wxColour bgCol = 
m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetBgCol();
 
  676        wxColour fgCol = 
m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetFgCol();
 
  680            ( *it )->GetCell( col ).SetBgCol( bgCol );
 
  681            ( *it )->GetCell( col ).SetFgCol( fgCol );
 
  695            ( *it )->SetValueFromString( param.
value );
 
 
  736        aForceRefreshFromModel = 
true;
 
  739    if( aForceRefreshFromModel )
 
  746        for( 
int modelPinIndex = 0; modelPinIndex < aModel->
GetPinCount(); ++modelPinIndex )
 
  750            if( symbolPinNumber == 
"" )
 
  755            if( symbolPinRow == -1 )
 
  766        std::vector<BITMAPS> modelPinIcons;
 
  767        wxArrayString        modelPinChoices;
 
  769        for( 
int jj = 0; jj < aModel->
GetPinCount(); ++jj )
 
  780        modelPinChoices.Add( 
_( 
"Not Connected" ) );
 
  789        if( modelPinIndex >= 0 )
 
  795    if( aModel->
GetType() == SIM_MODEL::TYPE::SUBCKT )
 
 
  847    for( 
const auto& [baseModelName, baseModel] : 
library()->GetModels() )
 
  849        if( baseModelName == modelName )
 
  857    wxArrayString modelNames;
 
  859    bool modelNameExists = 
false;
 
  860    for( 
const auto& [
name, model] : 
library()->GetModels() )
 
  862        modelNames.Add( 
name );
 
  865        if( 
name == modelName )
 
  866            modelNameExists = 
true;
 
  874    if( !modelNameExists )
 
  876        m_infoBar->ShowMessage( wxString::Format( 
_( 
"No model named '%s' in '%s'." ),
 
  884        wxArrayString emptyArray;
 
 
  921    case CATEGORY::S_PARAM:
 
  922        m_paramGrid->HideProperty( 
"S-Parameters", 
false );
 
  926    case CATEGORY::CAPACITANCE:
 
  931    case CATEGORY::TEMPERATURE:
 
  936    case CATEGORY::NOISE:
 
  941    case CATEGORY::DISTRIBUTED_QUANTITIES:
 
  942        m_paramGrid->HideProperty( 
"Distributed Quantities", 
false );
 
  946    case CATEGORY::WAVEFORM:
 
  951    case CATEGORY::GEOMETRY:
 
  956    case CATEGORY::LIMITING_VALUES:
 
  957        m_paramGrid->HideProperty( 
"Limiting Values", 
false );
 
  961    case CATEGORY::ADVANCED:
 
  966    case CATEGORY::FLAGS:
 
  975    case CATEGORY::INITIAL_CONDITIONS:
 
  976    case CATEGORY::SUPERFLUOUS:
 
 
  986    wxString paramDescription;
 
  989        paramDescription = wxString::Format( 
"%s", param.
info.
name );
 
  993    wxPGProperty* prop = 
nullptr;
 
 1000        prop->SetAttribute( wxPG_BOOL_USE_CHECKBOX, 
true );
 
 1022            wxArrayString inductors;
 
 1033                    if( item.model->GetDeviceType() == SIM_MODEL::DEVICE_T::L )
 
 1034                        inductors.push_back( item.refName );
 
 1038                        []( 
const wxString& a, 
const wxString& b ) -> 
int 
 1044            if( inductors.empty() )
 
 1062            wxArrayString values;
 
 1065                values.Add( 
string );
 
 1073        prop = 
new wxStringProperty( paramDescription, param.
info.
name );
 
 1077    prop->SetAttribute( wxPG_ATTR_UNITS, wxString::FromUTF8( param.
info.
unit.c_str() ) );
 
 
 1103template <
typename T>
 
 1106    for( 
int row = 0; row < static_cast<int>( 
m_sortedPartPins.size() ); ++row )
 
 1110        if( 
pin->GetNumber() == aSymbolPinNumber )
 
 
 1118template <
typename T>
 
 1138template <
typename T>
 
 1148template <
typename T>
 
 1157        pinNumber = 
pin->GetShownNumber();
 
 1158        pinName = 
pin->GetShownName();
 
 1161    if( !pinName.IsEmpty() && pinName != pinNumber )
 
 1162        pinNumber += wxString::Format( wxT( 
" (\"%s\")" ), pinName );
 
 
 1168template <
typename T>
 
 1171    wxString modelPinName;
 
 1173    if( aModelPinIndex >= 0 && aModelPinIndex < aModel->GetPinCount() )
 
 1176    wxString modelPinNumber = wxString::Format( 
"%d", aModelPinIndex + 1 );
 
 1178    if( !modelPinName.IsEmpty() && modelPinName != modelPinNumber )
 
 1179        modelPinNumber += wxString::Format( wxT( 
" (\"%s\")" ), modelPinName );
 
 1181    return modelPinNumber;
 
 
 1185template <
typename T>
 
 1188    if( aModelPinString == 
"Not Connected" )
 
 1191    int length = aModelPinString.Find( 
" " );
 
 1193    if( length == wxNOT_FOUND )
 
 1194        length = 
static_cast<int>( aModelPinString.Length() );
 
 1197    aModelPinString.Mid( 0, length ).ToCLong( &
result );
 
 1199    return static_cast<int>( 
result - 1 );
 
 
 1203template <
typename T>
 
 1211template <
typename T>
 
 1218template <
typename T>
 
 1235template <
typename T>
 
 1245                wxCommandEvent 
dummy;
 
 
 1253template <
typename T>
 
 1256    static wxString s_mruPath;
 
 1259    wxFileDialog            dlg( 
this, 
_( 
"Browse Models" ), 
path );
 
 1262    dlg.SetCustomizeHook( customize );
 
 1264    if( dlg.ShowModal() == wxID_CANCEL )
 
 1269    path = dlg.GetPath();
 
 1270    wxFileName fn( 
path );
 
 1271    s_mruPath = fn.GetPath();
 
 1278    else if( fn.MakeRelativeTo( 
Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( 
".." ) ) )
 
 1280        path = fn.GetFullPath();
 
 
 1294template <
typename T>
 
 1299    switch( aKeyStroke.GetKeyCode() )
 
 1302        if( sel == wxNOT_FOUND )
 
 1310        if( sel == wxNOT_FOUND )
 
 1318        wxPostEvent( 
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
 
 
 1331template <
typename T>
 
 1337    wxArrayString modelNames;
 
 1341    for( 
const auto& [
name, model] : 
library()->GetModels() )
 
 1343        wxString wx_name( 
name );
 
 1345        if( wx_name.Matches( 
filter ) )
 
 1346            modelNames.Add( wx_name );
 
 
 1362template <
typename T>
 
 1367        wxArrayString    pinLabels;
 
 1370        wxCHECK2( modelkibis, 
return );
 
 1372        for( std::pair<wxString, wxString> strs : modelkibis->
GetIbisPins() )
 
 1373            pinLabels.Add( strs.first + wxT( 
" - " ) + strs.second );
 
 1377        wxArrayString emptyArray;
 
 1386        wxArrayString lines = wxSplit( fallback->GetSpiceCode(), 
'\n' );
 
 1389        for( 
const wxString& line : lines )
 
 1391            if( !line.StartsWith( 
'*' ) )
 
 1393                if( !code.IsEmpty() )
 
 1400        m_infoBar->ShowMessage( wxString::Format( 
_( 
"Failed to parse:\n\n" 
 1402                                                     "Using generic SPICE model." ),
 
 
 1414template <
typename T>
 
 1417    wxArrayString modelLabels;
 
 1421    std::vector<std::pair<std::string, std::string>> strs = ibisModel.
GetIbisPins();
 
 1422    std::string pinNumber = strs.at( 
m_pinCombobox->GetSelection() ).first;
 
 1426    ibisModel.
ChangePin( *ibisLibrary, pinNumber );
 
 1431        modelLabels.Add( modelName );
 
 
 1444template <
typename T>
 
 1453template <
typename T>
 
 1460template <
typename T>
 
 1467template <
typename T>
 
 1473        modelibis->SwitchSingleEndedDiff( diff );
 
 
 1480template <
typename T>
 
 1485    for( SIM_MODEL::DEVICE_T deviceType : SIM_MODEL::DEVICE_T_ITERATOR() )
 
 
 1498template <
typename T>
 
 1501    SIM_MODEL::DEVICE_T deviceType = 
curModel().GetDeviceType();
 
 1504    for( SIM_MODEL::TYPE type : { SIM_MODEL::TYPE::KIBIS_DEVICE,
 
 1505                                  SIM_MODEL::TYPE::KIBIS_DRIVER_DC,
 
 1506                                  SIM_MODEL::TYPE::KIBIS_DRIVER_RECT,
 
 1507                                  SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS } )
 
 1520            m_libraryModelsMgr.SetModel( idx, std::make_unique<SIM_MODEL_IBIS>( type, baseModel ) );
 
 
 1541template <
typename T>
 
 1544    SIM_MODEL::DEVICE_T deviceType = 
curModel().GetDeviceType();
 
 1547    for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
 
 
 1562template <
typename T>
 
 1569template <
typename T>
 
 1572    int      symbolPinIndex = aEvent.GetRow();
 
 1573    wxString oldModelPinName = aEvent.GetString();
 
 1574    wxString modelPinName = 
m_pinAssignmentsGrid->GetCellValue( aEvent.GetRow(), aEvent.GetCol() );
 
 1580        curModel().AssignSymbolPinNumberToModelPin( oldModelPinIndex, 
"" );
 
 
 1595template <
typename T>
 
 1608template <
typename T>
 
 1615    wxPGProperty*   selected = 
grid->GetSelection();
 
 1618        selected = 
grid->wxPropertyGridInterface::GetFirst();
 
 1620#if wxCHECK_VERSION( 3, 3, 0 ) 
 1622        grid->DoSelectProperty( selected, wxPGSelectPropertyFlags::Focus );
 
 1625        grid->DoSelectProperty( selected, wxPG_SEL_FOCUS );
 
 
 1632template <
typename T>
 
 1638    if( 
grid->GetSelection() && 
grid->GetSelection()->IsCategory() )
 
 1640        wxPGProperty* selection = 
grid->GetSelection();
 
 1645        wxPropertyGridIterator it = 
grid->GetIterator( wxPG_ITERATE_VISIBLE, selection );
 
 1648        wxKeyEvent* keyEvent = 
new wxKeyEvent( wxEVT_KEY_DOWN );
 
 1652            if( !selection->IsExpanded() )
 
 1654                grid->Expand( selection );
 
 1655                keyEvent->m_keyCode = WXK_DOWN;
 
 1656                wxQueueEvent( 
grid, keyEvent );
 
 1664                keyEvent->m_keyCode = WXK_UP;
 
 1665                wxQueueEvent( 
grid, keyEvent );
 
 1670            if( !selection->IsExpanded() )
 
 1671                grid->Expand( selection );
 
 1673            keyEvent->m_keyCode = WXK_DOWN;
 
 1674            wxQueueEvent( 
grid, keyEvent );
 
 1681    wxWindow* editorControl = 
grid->GetEditorControl();
 
 1683    if( !editorControl )
 
 1690    editorControl->SetFocus();
 
 
 1695template <
typename T>
 
 1707    wxTextCtrl*     ctrl = 
grid->GetEditorTextCtrl();
 
 1711        wxRect ctrlRect = ctrl->GetScreenRect();
 
 1712        wxRect gridRect = 
grid->GetScreenRect();
 
 1714        if( ctrlRect.GetTop() < gridRect.GetTop() || ctrlRect.GetBottom() > gridRect.GetBottom() )
 
 1715            grid->ClearSelection();
 
 
 1721template <
typename T>
 
 1734        std::vector<int> colWidths;
 
 1736        for( 
size_t ii = 0; ii < 
grid->GetColumnCount(); ii++ )
 
 1739                colWidths.push_back( 
grid->GetState()->GetColumnWidth( ii ) + margin + indent );
 
 1741                colWidths.push_back( std::max( 72, 
grid->GetState()->GetColumnWidth( ii ) ) + margin );
 
 1743                colWidths.push_back( 60 + margin );
 
 1745            aWidth -= colWidths[ ii ];
 
 1748        for( 
size_t ii = 0; ii < 
grid->GetColumnCount(); ii++ )
 
 1749            grid->SetColumnProportion( ii, colWidths[ ii ] );
 
 1751        grid->ResetColumnSizes();
 
 1752        grid->RefreshEditor();
 
 
 1757template <
typename T>
 
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
 
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
 
wxNotebook * m_modelNotebook
 
wxStaticText * m_subcktLabel
 
wxStaticText * m_modelNameLabel
 
wxPropertyGridManager * m_paramGridMgr
 
wxStaticText * m_pathLabel
 
wxRadioButton * m_rbBuiltinModel
 
wxListBox * m_modelListBox
 
wxComboBox * m_pinCombobox
 
DIALOG_SIM_MODEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Simulation Model Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
 
wxChoice * m_deviceSubtypeChoice
 
wxSearchCtrl * m_modelFilter
 
wxStaticText * m_waveformLabel
 
wxTextCtrl * m_libraryPathText
 
wxStaticText * m_pinLabel
 
wxChoice * m_deviceChoice
 
wxComboBox * m_pinModelCombobox
 
wxRadioButton * m_rbLibraryModel
 
wxChoice * m_waveformChoice
 
wxStaticText * m_deviceLabel
 
WX_GRID * m_pinAssignmentsGrid
 
wxStaticText * m_pinModelLabel
 
wxPanel * m_parametersPanel
 
wxStaticText * m_deviceSubtypeLabel
 
wxCheckBox * m_saveInValueCheckbox
 
STD_BITMAP_BUTTON * m_browseButton
 
wxStyledTextCtrl * m_subckt
 
wxPropertyGridPage * m_paramGrid
 
wxPanel * m_pinAssignmentsPanel
 
wxCheckBox * m_differentialCheckbox
 
wxStyledTextCtrl * m_codePreview
 
const SIM_MODEL * m_prevModel
 
void onTypeChoice(wxCommandEvent &aEvent) override
 
void onLibraryPathTextKillFocus(wxFocusEvent &aEvent) override
 
wxString getSymbolPinString(int aSymbolPinNumber) const
 
void updateBuiltinModelWidgets(SIM_MODEL *aModel)
 
void onPinAssignmentsGridCellChange(wxGridEvent &aEvent) override
 
void onFilterCharHook(wxKeyEvent &aKeyStroke) override
 
int findSymbolPinRow(const wxString &aSymbolPinNumber) const
 
void onModelNameChoice(wxCommandEvent &aEvent) override
 
void onRadioButton(wxCommandEvent &aEvent) override
 
SCINTILLA_TRICKS * m_scintillaTricksSubckt
 
bool loadLibrary(const wxString &aLibraryPath, REPORTER &aReporter, bool aForceReload=false)
 
SIM_LIB_MGR m_builtinModelsMgr
 
int getModelPinIndex(const wxString &aModelPinString) const
 
void onModelFilter(wxCommandEvent &aEvent) override
 
void onLibraryPathText(wxCommandEvent &aEvent) override
 
void onDifferentialCheckbox(wxCommandEvent &event) override
 
void onParamGridSelectionChange(wxPropertyGridEvent &aEvent)
 
void removeOrphanedPinAssignments(SIM_MODEL *aModel)
 
void adjustParamGridColumns(int aWidth, bool aForce)
 
std::vector< SCH_FIELD > & m_fields
 
std::vector< SCH_PIN * > m_sortedPartPins
Pins of the current part.
 
wxPGProperty * newParamProperty(SIM_MODEL *aModel, int aParamIndex) const
 
wxPGProperty * m_prevParamGridSelection
 
void onPinModelCombobox(wxCommandEvent &event) override
 
const SIM_LIBRARY * library() const
 
SIM_MODEL & curModel() const
 
SIM_LIB_MGR m_libraryModelsMgr
 
void onBrowseButtonClick(wxCommandEvent &aEvent) override
 
void onPinComboboxTextEnter(wxCommandEvent &event) override
 
void onPinCombobox(wxCommandEvent &event) override
 
wxPGProperty * m_firstCategory
 
SCINTILLA_TRICKS * m_scintillaTricksCode
 
std::map< wxString, int > m_modelListBoxEntryToLibraryIdx
 
void updatePinAssignments(SIM_MODEL *aModel, bool aForceUpdatePins)
 
void onUpdateUI(wxUpdateUIEvent &aEvent)
 
DIALOG_SIM_MODEL(wxWindow *aParent, EDA_BASE_FRAME *aFrame, T &aSymbol, std::vector< SCH_FIELD > &aFields)
 
wxString getModelPinString(SIM_MODEL *aModel, int aModelPinIndex) const
 
void onPinAssignmentsGridSize(wxSizeEvent &aEvent) override
 
void updateIbisWidgets(SIM_MODEL *aModel)
 
void onParamGridSetFocus(wxFocusEvent &aEvent)
 
void updateModelParamsTab(SIM_MODEL *aModel)
 
bool TransferDataFromWindow() override
 
SIM_MODEL::TYPE m_curModelType
 
void updateModelCodeTab(SIM_MODEL *aModel)
 
void onSizeParamGrid(wxSizeEvent &event) override
 
void onPageChanging(wxNotebookEvent &event) override
 
std::vector< EMBEDDED_FILES * > m_filesStack
 
void onWaveformChoice(wxCommandEvent &aEvent) override
 
std::map< SIM_MODEL::DEVICE_T, SIM_MODEL::TYPE > m_curModelTypeOfDeviceType
 
void onPinModelComboboxTextEnter(wxCommandEvent &event) override
 
void onLibraryPathTextEnter(wxCommandEvent &aEvent) override
 
void onDeviceTypeChoice(wxCommandEvent &aEvent) override
 
bool TransferDataToWindow() override
 
void addParamPropertyIfRelevant(SIM_MODEL *aModel, int aParamIndex)
 
The base frame for deriving all KiCad main window classes.
 
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
 
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
 
virtual const wxString What() const
A composite of Problem() and Where()
 
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
 
virtual bool ReadSchematicAndLibraries(unsigned aNetlistOptions, REPORTER &aReporter)
Process the schematic and Spice libraries to create net mapping and a list of SPICE_ITEMs.
 
const std::list< SPICE_ITEM > & GetItems() const
Return the list of items representing schematic symbols in the Spice world.
 
A singleton reporter that reports to nowhere.
 
virtual const wxString GetProjectPath() const
Return the full path of the project.
 
A pure virtual class used to derive REPORTER objects from.
 
virtual bool HasMessageOfSeverity(int aSeverityMask) const
Returns true if the reporter has one or more messages matching the specified severity mask.
 
virtual bool HasMessage() const
Returns true if any messages were reported.
 
EMBEDDED_FILES * GetEmbeddedFiles() override
 
Schematic editor (Eeschema) main window.
 
void SetText(const wxString &aText) override
 
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
 
wxString GetShownNumber() const
 
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
 
static constexpr auto MODEL_FIELD
 
static constexpr auto PIN_FIELD
 
static constexpr auto DIFF_FIELD
 
bool isPinDiff(const std::string &aComp, const std::string &aPinNumber) const
 
static constexpr auto LIBRARY_FIELD
 
static constexpr auto NAME_FIELD
 
std::vector< std::pair< std::string, std::string > > GetIbisPins() const
 
void SwitchSingleEndedDiff(bool aDiff) override
 
bool CanDifferential() const
 
std::vector< std::string > GetIbisModels() const
 
bool ChangePin(const SIM_LIBRARY_IBIS &aLib, const std::string &aPinNumber)
update the list of available models based on the pin number.
 
std::string GetComponentName() const
 
std::string GetSpiceCode() const
 
static INFO TypeInfo(TYPE aType)
 
static bool InferSimModel(T &aSymbol, std::vector< SCH_FIELD > *aFields, bool aResolve, int aDepth, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
 
const SPICE_GENERATOR & SpiceGenerator() const
 
virtual const PARAM & GetParam(unsigned aParamIndex) const
 
static TYPE ReadTypeFromFields(const std::vector< SCH_FIELD > &aFields, bool aResolve, int aDepth, REPORTER &aReporter)
 
int GetParamCount() const
 
void AssignSymbolPinNumberToModelPin(int aPinIndex, const wxString &aSymbolPinNumber)
 
DEVICE_INFO GetDeviceInfo() const
 
DEVICE_T GetDeviceType() const
 
static DEVICE_INFO DeviceInfo(DEVICE_T aDeviceType)
 
virtual bool HasAutofill() const
 
void SetParamValue(int aParamIndex, const std::string &aValue, SIM_VALUE::NOTATION aNotation=SIM_VALUE::NOTATION::SI)
 
const SIM_MODEL_PIN & GetPin(unsigned aIndex) const
 
void SetIsStoredInValue(bool aIsStoredInValue)
 
virtual bool HasPrimaryValue() const
 
const SIM_MODEL::PARAM & GetParam() const
 
Special netlist exporter flavor that allows one to override simulation commands.
 
virtual std::string Preview(const SPICE_ITEM &aItem) const
 
A wrapper for reporting to a wxString object.
 
const wxString & GetMessages() const
 
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
 
This file is part of the common library.
 
static bool empty(const wxTextEntryBase *aCtrl)
 
bool equivalent(SIM_MODEL::DEVICE_T a, SIM_MODEL::DEVICE_T b)
 
#define FORCE_REFRESH_FROM_MODEL
 
SIM_MODEL::PARAM::CATEGORY CATEGORY
 
static const std::string KiCadUriPrefix
 
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
 
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
 
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
 
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
 
void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue, bool aIsVisible=true)
 
#define SIM_REFERENCE_FIELD
 
#define SIM_DEVICE_SUBTYPE_FIELD
 
std::vector< FAB_LAYER_COLOR > dummy
 
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
 
std::vector< std::string > enumValues
 
static constexpr auto NOT_CONNECTED
 
const std::string modelPinName
 
@ REFERENCE
Field Reference of part, i.e. "IC21".
 
@ VALUE
Field Value of part, i.e. "3.3K".
 
wxString result
Test unit parsing edge cases and error handling.