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() )
93 m_filesStack.push_back( symbolEmbeddedFiles );
95 if constexpr (std::is_same_v<T, SCH_SYMBOL>)
97 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( &aSymbol );
98 symbol->GetLibSymbolRef()->AppendParentEmbeddedFiles( m_filesStack );
100 else if constexpr (std::is_same_v<T, LIB_SYMBOL>)
107 m_libraryModelsMgr.SetFilesStack( m_filesStack );
108 m_builtinModelsMgr.SetFilesStack( m_filesStack );
113 if( !pin->GetParentSymbol()->IsMultiBodyStyle() || pin->GetBodyStyle() < 2 )
114 m_sortedPartPins.push_back( pin );
117 std::sort( m_sortedPartPins.begin(), m_sortedPartPins.end(),
121 return StrNumCmp( lhs->GetNumber(), rhs->GetNumber(), true ) < 0;
124 m_waveformChoice->Clear();
125 m_deviceChoice->Clear();
126 m_deviceSubtypeChoice->Clear();
128 m_scintillaTricksCode =
new SCINTILLA_TRICKS( m_codePreview, wxT(
"{}" ),
false );
129 m_scintillaTricksSubckt =
new SCINTILLA_TRICKS( m_subckt, wxT(
"()" ),
false );
133 wxPropertyGrid*
grid = m_paramGrid->GetGrid();
134 grid->SetCellDisabledTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
138 grid->DedicateKey( WXK_RETURN );
139 grid->DedicateKey( WXK_NUMPAD_ENTER );
140 grid->DedicateKey( WXK_UP );
141 grid->DedicateKey( WXK_DOWN );
143#if wxCHECK_VERSION( 3, 3, 0 )
144 grid->AddActionTrigger( wxPGKeyboardAction::Edit, WXK_RETURN );
145 grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_RETURN );
146 grid->AddActionTrigger( wxPGKeyboardAction::Edit, WXK_NUMPAD_ENTER );
147 grid->AddActionTrigger( wxPGKeyboardAction::NextProperty, WXK_NUMPAD_ENTER );
149 grid->AddActionTrigger( wxPG_ACTION_EDIT, WXK_RETURN );
150 grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN );
151 grid->AddActionTrigger( wxPG_ACTION_EDIT, WXK_NUMPAD_ENTER );
152 grid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_NUMPAD_ENTER );
155 m_pinAssignmentsGrid->ClearRows();
156 m_pinAssignmentsGrid->PushEventHandler(
new GRID_TRICKS( m_pinAssignmentsGrid ) );
159 finishDialogSettings();
168 for( wxPropertyGridIterator it =
m_paramGrid->GetIterator(); !it.AtEnd(); ++it )
185 wxCommandEvent dummyEvent;
188 wxString modelParams;
190 bool storeInValue =
false;
196 &deviceType, &modelType, &modelParams, &pinMap ) )
200 if( !modelType.IsEmpty() )
215 wxFileName tmp( libraryFilename );
217 if( !tmp.GetFullName().IsEmpty() )
241 if( modelIdx == wxNOT_FOUND )
243 m_infoBar->ShowMessage( wxString::Format(
_(
"No model named '%s' in library." ),
275 for(
const std::pair<std::string, std::string>& strs : ibismodel->
GetIbisPins() )
281 ibismodel->
ChangePin( *ibisLibrary, strs.first );
288 if( i <
static_cast<int>( ibismodel->
GetIbisPins().size() ) )
322 for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
347 curModel().SetIsStoredInValue(
true );
352 return DIALOG_SIM_MODEL_BASE::TransferDataToWindow();
362 if( !
m_paramGrid->GetGrid()->CommitChangesFromEditor() )
365 if( !DIALOG_SIM_MODEL_BASE::TransferDataFromWindow() )
375 wxFileName fn(
path );
378 && !fn.GetFullPath().StartsWith(
".." ) )
380 path = fn.GetFullPath();
407 std::string differential;
410 pins = ibismodel->GetIbisPins().at(
m_pinCombobox->GetSelection() ).first;
421 if(
model.GetType() == SIM_MODEL::TYPE::RAWSPICE )
426 wxString code =
m_codePreview->GetText().Trim(
true ).Trim(
false );
427 model.SetParamValue(
"model", std::string( code.ToUTF8() ) );
438 std::string( symbolPinName.ToUTF8() ) );
494 SendSizeEvent( wxSEND_EVENT_POST );
518 for( SIM_MODEL::TYPE type : { SIM_MODEL::TYPE::KIBIS_DEVICE,
519 SIM_MODEL::TYPE::KIBIS_DRIVER_DC,
520 SIM_MODEL::TYPE::KIBIS_DRIVER_RECT,
521 SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS } )
531 if( type == aModel->
GetType() )
554 for( SIM_MODEL::DEVICE_T deviceType : SIM_MODEL::DEVICE_T_ITERATOR() )
565 for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
567 if( type == SIM_MODEL::TYPE::KIBIS_DEVICE
568 || type == SIM_MODEL::TYPE::KIBIS_DRIVER_DC
569 || type == SIM_MODEL::TYPE::KIBIS_DRIVER_RECT
570 || type == SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS )
583 if( type == aModel->
GetType() )
640 m_paramGrid->Append(
new wxPropertyCategory(
"AC" ) );
643 m_paramGrid->Append(
new wxPropertyCategory(
"DC" ) );
646 m_paramGrid->Append(
new wxPropertyCategory(
"S-Parameters" ) );
649 m_paramGrid->Append(
new wxPropertyCategory(
"Capacitance" ) );
652 m_paramGrid->Append(
new wxPropertyCategory(
"Temperature" ) );
655 m_paramGrid->Append(
new wxPropertyCategory(
"Noise" ) );
658 m_paramGrid->Append(
new wxPropertyCategory(
"Distributed Quantities" ) );
659 m_paramGrid->HideProperty(
"Distributed Quantities" );
661 m_paramGrid->Append(
new wxPropertyCategory(
"Waveform" ) );
664 m_paramGrid->Append(
new wxPropertyCategory(
"Limiting Values" ) );
667 m_paramGrid->Append(
new wxPropertyCategory(
"Advanced" ) );
670 m_paramGrid->Append(
new wxPropertyCategory(
"Flags" ) );
687 for( wxPropertyGridIterator it =
m_paramGrid->GetIterator(); !it.AtEnd(); ++it )
689 wxColour bgCol =
m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetBgCol();
690 wxColour fgCol =
m_paramGrid->GetGrid()->GetPropertyDefaultCell().GetFgCol();
694 ( *it )->GetCell( col ).SetBgCol( bgCol );
695 ( *it )->GetCell( col ).SetFgCol( fgCol );
709 ( *it )->SetValueFromString( param.
value );
750 aForceRefreshFromModel =
true;
753 if( aForceRefreshFromModel )
760 for(
int modelPinIndex = 0; modelPinIndex < aModel->
GetPinCount(); ++modelPinIndex )
764 if( symbolPinNumber ==
"" )
769 if( symbolPinRow == -1 )
780 std::vector<BITMAPS> modelPinIcons;
781 wxArrayString modelPinChoices;
783 for(
int jj = 0; jj < aModel->
GetPinCount(); ++jj )
794 modelPinChoices.Add(
_(
"Not Connected" ) );
803 if( modelPinIndex >= 0 )
809 if( aModel->
GetType() == SIM_MODEL::TYPE::SUBCKT )
855 wxArrayString emptyArray;
868 for(
const auto& [baseModelName, baseModel] :
library()->GetModels() )
870 if( baseModelName == modelName )
878 wxArrayString modelNames;
880 bool modelNameExists =
false;
883 modelNames.Add(
name );
886 if(
name == modelName )
887 modelNameExists =
true;
895 if( !modelNameExists )
897 m_infoBar->ShowMessage( wxString::Format(
_(
"No model named '%s' in '%s'." ),
905 wxArrayString emptyArray;
942 case CATEGORY::S_PARAM:
943 m_paramGrid->HideProperty(
"S-Parameters",
false );
947 case CATEGORY::CAPACITANCE:
952 case CATEGORY::TEMPERATURE:
957 case CATEGORY::NOISE:
962 case CATEGORY::DISTRIBUTED_QUANTITIES:
963 m_paramGrid->HideProperty(
"Distributed Quantities",
false );
967 case CATEGORY::WAVEFORM:
972 case CATEGORY::GEOMETRY:
977 case CATEGORY::LIMITING_VALUES:
978 m_paramGrid->HideProperty(
"Limiting Values",
false );
982 case CATEGORY::ADVANCED:
987 case CATEGORY::FLAGS:
996 case CATEGORY::INITIAL_CONDITIONS:
997 case CATEGORY::SUPERFLUOUS:
1003template <
typename T>
1007 wxString paramDescription;
1010 paramDescription = wxString::Format(
"%s", param.
info.
name );
1014 wxPGProperty* prop =
nullptr;
1021 prop->SetAttribute( wxPG_BOOL_USE_CHECKBOX,
true );
1043 wxArrayString inductors;
1054 if( item.model->GetDeviceType() == SIM_MODEL::DEVICE_T::L )
1055 inductors.push_back( item.refName );
1059 [](
const wxString& a,
const wxString& b ) ->
int
1065 if( inductors.empty() )
1083 wxArrayString values;
1086 values.Add(
string );
1094 prop =
new wxStringProperty( paramDescription, param.
info.
name );
1098 prop->SetAttribute( wxPG_ATTR_UNITS, wxString::FromUTF8( param.
info.
unit.c_str() ) );
1124template <
typename T>
1127 for(
int row = 0; row < static_cast<int>(
m_sortedPartPins.size() ); ++row )
1131 if(
pin->GetNumber() == aSymbolPinNumber )
1139template <
typename T>
1164template <
typename T>
1174template <
typename T>
1183 pinNumber =
pin->GetShownNumber();
1184 pinName =
pin->GetShownName();
1187 if( !pinName.IsEmpty() && pinName != pinNumber )
1188 pinNumber += wxString::Format( wxT(
" (\"%s\")" ), pinName );
1194template <
typename T>
1197 wxString modelPinName;
1199 if( aModelPinIndex >= 0 && aModelPinIndex < aModel->GetPinCount() )
1202 wxString modelPinNumber = wxString::Format(
"%d", aModelPinIndex + 1 );
1204 if( !modelPinName.IsEmpty() && modelPinName != modelPinNumber )
1205 modelPinNumber += wxString::Format( wxT(
" (\"%s\")" ), modelPinName );
1207 return modelPinNumber;
1211template <
typename T>
1214 if( aModelPinString ==
"Not Connected" )
1217 int length = aModelPinString.Find(
" " );
1219 if( length == wxNOT_FOUND )
1220 length =
static_cast<int>( aModelPinString.Length() );
1223 aModelPinString.Mid( 0, length ).ToCLong( &
result );
1225 return static_cast<int>(
result - 1 );
1229template <
typename T>
1237template <
typename T>
1244template <
typename T>
1261template <
typename T>
1271 wxCommandEvent
dummy;
1279template <
typename T>
1282 static wxString s_mruPath;
1285 wxFileDialog dlg(
this,
_(
"Browse Models" ),
path );
1288 dlg.SetCustomizeHook( customize );
1292 if( dlg.ShowModal() == wxID_CANCEL )
1297 path = dlg.GetPath();
1298 wxFileName fn(
path );
1299 s_mruPath = fn.GetPath();
1306 else if( fn.MakeRelativeTo(
Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS(
".." ) ) )
1308 path = fn.GetFullPath();
1322template <
typename T>
1335 switch( aKeyStroke.GetKeyCode() )
1338 if( sel == wxNOT_FOUND )
1341 sel = std::max( sel - 1, 0 );
1346 if( sel == wxNOT_FOUND )
1349 sel = std::min( sel + 1, count - 1 );
1354 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
1366template <
typename T>
1372 wxArrayString modelNames;
1378 wxString wx_name(
name );
1380 if( wx_name.Matches(
filter ) )
1381 modelNames.Add( wx_name );
1397template <
typename T>
1402 wxArrayString pinLabels;
1405 wxCHECK2( modelkibis,
return );
1407 for( std::pair<wxString, wxString> strs : modelkibis->
GetIbisPins() )
1408 pinLabels.Add( strs.first + wxT(
" - " ) + strs.second );
1412 wxArrayString emptyArray;
1421 wxArrayString lines = wxSplit( fallback->GetSpiceCode(),
'\n' );
1424 for(
const wxString& line : lines )
1426 if( !line.StartsWith(
'*' ) )
1428 if( !code.IsEmpty() )
1435 m_infoBar->ShowMessage( wxString::Format(
_(
"Failed to parse:\n\n"
1437 "Using generic SPICE model." ),
1449template <
typename T>
1452 wxArrayString modelLabels;
1456 std::vector<std::pair<std::string, std::string>> strs = ibisModel.
GetIbisPins();
1457 std::string pinNumber = strs.at(
m_pinCombobox->GetSelection() ).first;
1461 ibisModel.
ChangePin( *ibisLibrary, pinNumber );
1466 modelLabels.Add( modelName );
1479template <
typename T>
1488template <
typename T>
1495template <
typename T>
1502template <
typename T>
1508 modelibis->SwitchSingleEndedDiff( diff );
1515template <
typename T>
1520 for( SIM_MODEL::DEVICE_T deviceType : SIM_MODEL::DEVICE_T_ITERATOR() )
1533template <
typename T>
1536 SIM_MODEL::DEVICE_T deviceType =
curModel().GetDeviceType();
1539 for( SIM_MODEL::TYPE type : { SIM_MODEL::TYPE::KIBIS_DEVICE,
1540 SIM_MODEL::TYPE::KIBIS_DRIVER_DC,
1541 SIM_MODEL::TYPE::KIBIS_DRIVER_RECT,
1542 SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS } )
1555 m_libraryModelsMgr.SetModel( idx, std::make_unique<SIM_MODEL_IBIS>( type, baseModel ) );
1576template <
typename T>
1579 SIM_MODEL::DEVICE_T deviceType =
curModel().GetDeviceType();
1582 for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
1597template <
typename T>
1604template <
typename T>
1607 int symbolPinIndex = aEvent.GetRow();
1608 wxString oldModelPinName = aEvent.GetString();
1609 wxString modelPinName =
m_pinAssignmentsGrid->GetCellValue( aEvent.GetRow(), aEvent.GetCol() );
1615 curModel().AssignSymbolPinNumberToModelPin( oldModelPinIndex,
"" );
1630template <
typename T>
1643template <
typename T>
1650 wxPGProperty* selected =
grid->GetSelection();
1653 selected =
grid->wxPropertyGridInterface::GetFirst();
1655#if wxCHECK_VERSION( 3, 3, 0 )
1657 grid->DoSelectProperty( selected, wxPGSelectPropertyFlags::Focus );
1660 grid->DoSelectProperty( selected, wxPG_SEL_FOCUS );
1667template <
typename T>
1673 if(
grid->GetSelection() &&
grid->GetSelection()->IsCategory() )
1675 wxPGProperty* selection =
grid->GetSelection();
1680 wxPropertyGridIterator it =
grid->GetIterator( wxPG_ITERATE_VISIBLE, selection );
1683 wxKeyEvent* keyEvent =
new wxKeyEvent( wxEVT_KEY_DOWN );
1687 if( !selection->IsExpanded() )
1689 grid->Expand( selection );
1690 keyEvent->m_keyCode = WXK_DOWN;
1691 wxQueueEvent(
grid, keyEvent );
1699 keyEvent->m_keyCode = WXK_UP;
1700 wxQueueEvent(
grid, keyEvent );
1705 if( !selection->IsExpanded() )
1706 grid->Expand( selection );
1708 keyEvent->m_keyCode = WXK_DOWN;
1709 wxQueueEvent(
grid, keyEvent );
1716 wxWindow* editorControl =
grid->GetEditorControl();
1718 if( !editorControl )
1725 editorControl->SetFocus();
1730template <
typename T>
1742 wxTextCtrl* ctrl =
grid->GetEditorTextCtrl();
1746 wxRect ctrlRect = ctrl->GetScreenRect();
1747 wxRect gridRect =
grid->GetScreenRect();
1749 if( ctrlRect.GetTop() < gridRect.GetTop() || ctrlRect.GetBottom() > gridRect.GetBottom() )
1750 grid->ClearSelection();
1756template <
typename T>
1769 std::vector<int> colWidths;
1771 for(
size_t ii = 0; ii <
grid->GetColumnCount(); ii++ )
1774 colWidths.push_back(
grid->GetState()->GetColumnWidth( ii ) + margin + indent );
1776 colWidths.push_back( std::max( 72,
grid->GetState()->GetColumnWidth( ii ) ) + margin );
1778 colWidths.push_back( 60 + margin );
1780 aWidth -= colWidths[ ii ];
1783 for(
size_t ii = 0; ii <
grid->GetColumnCount(); ii++ )
1784 grid->SetColumnProportion( ii, colWidths[ ii ] );
1786 grid->ResetColumnSizes();
1787 grid->RefreshEditor();
1792template <
typename T>
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
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.
Define a library symbol object.
void AppendParentEmbeddedFiles(std::vector< EMBEDDED_FILES * > &aStack) const
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.
const 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
const SIM_MODEL_PIN & GetPin(unsigned aIndex) const
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)
void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue, bool aIsVisible=true, const SCH_SHEET_PATH *aSheetPath=nullptr, const wxString &aVariantName=wxEmptyString)
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
#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.