KiCad PCB EDA Suite
dialog_sim_settings.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016-2021 CERN
5  * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * https://www.gnu.org/licenses/gpl-3.0.html
21  * or you may search the http://www.gnu.org website for the version 3 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include "dialog_sim_settings.h"
28 #include <sim/ngspice.h>
29 
30 #include <confirm.h>
31 
32 #include <wx/tokenzr.h>
33 
34 #include <vector>
35 #include <utility>
36 
38 //so there are a few tabs missing (e.g. pole-zero, distortion, sensitivity)
39 
40 // Helper function to shorten conditions
41 static bool empty( const wxTextEntryBase* aCtrl )
42 {
43  return aCtrl->GetValue().IsEmpty();
44 }
45 
46 
47 static void setStringSelection( wxChoice* aCtrl, const wxString& aStr )
48 {
49  aCtrl->SetSelection( aCtrl->FindString( aStr ) );
50 }
51 
52 
53 static wxString getStringSelection( const wxChoice* aCtrl )
54 {
55  return aCtrl->GetString( aCtrl->GetSelection() );
56 }
57 
58 
60  std::shared_ptr<SPICE_SIMULATOR_SETTINGS>& aSettings ) :
61  DIALOG_SIM_SETTINGS_BASE( aParent ),
62  m_exporter( nullptr ),
63  m_settings( aSettings ),
64  m_spiceEmptyValidator( true )
65 {
66  m_posIntValidator.SetMin( 1 );
67 
68  m_acPointsNumber->SetValidator( m_posIntValidator );
69  m_acFreqStart->SetValidator( m_spiceValidator );
70  m_acFreqStop->SetValidator( m_spiceValidator );
71 
72  m_dcStart1->SetValidator( m_spiceValidator );
73  m_dcStop1->SetValidator( m_spiceValidator );
74  m_dcIncr1->SetValidator( m_spiceValidator );
75 
76  m_dcStart2->SetValidator( m_spiceValidator );
77  m_dcStop2->SetValidator( m_spiceValidator );
78  m_dcIncr2->SetValidator( m_spiceValidator );
79 
80  m_noisePointsNumber->SetValidator( m_posIntValidator );
81  m_noiseFreqStart->SetValidator( m_spiceValidator );
82  m_noiseFreqStop->SetValidator( m_spiceValidator );
83 
84  m_transStep->SetValidator( m_spiceValidator );
85  m_transFinal->SetValidator( m_spiceValidator );
86  m_transInitial->SetValidator( m_spiceEmptyValidator );
87 
89 
90  // Hide pages that aren't fully implemented yet
91  // wxPanel::Hide() isn't enough on some platforms
92  m_simPages->RemovePage( m_simPages->FindPage( m_pgDistortion ) );
93  m_simPages->RemovePage( m_simPages->FindPage( m_pgNoise ) );
94  m_simPages->RemovePage( m_simPages->FindPage( m_pgPoleZero ) );
95  m_simPages->RemovePage( m_simPages->FindPage( m_pgSensitivity ) );
96  m_simPages->RemovePage( m_simPages->FindPage( m_pgTransferFunction ) );
97 
98  if( !dynamic_cast<NGSPICE_SIMULATOR_SETTINGS*>( aSettings.get() ) )
99  m_compatibilityMode->Show( false );
100 
101  m_sdbSizerOK->SetDefault();
103 
104 }
105 
106 wxString DIALOG_SIM_SETTINGS::evaluateDCControls( wxChoice* aDcSource, wxTextCtrl* aDcStart,
107  wxTextCtrl* aDcStop, wxTextCtrl* aDcIncr )
108 {
109  wxString dcSource = aDcSource->GetString( aDcSource->GetSelection() );
110  wxWindow* ctrlWithError = nullptr;
111 
112  if( dcSource.IsEmpty() )
113  {
114  DisplayError( this, _( "You need to select DC source" ) );
115  ctrlWithError = aDcSource;
116  }
118  // hence try..catch below
119  else if( !aDcStart->Validate() )
120  ctrlWithError = aDcStart;
121  else if( !aDcStop->Validate() )
122  ctrlWithError = aDcStop;
123  else if( !aDcIncr->Validate() )
124  ctrlWithError = aDcIncr;
125 
126  if( ctrlWithError )
127  {
128  ctrlWithError->SetFocus();
129  return wxEmptyString;
130  }
131 
132  try
133  {
134  // pick device name from exporter when something different than temperature is selected
135  if( dcSource.Cmp( "TEMP" ) )
136  dcSource = m_exporter->GetSpiceDevice( dcSource );
137 
138  return wxString::Format( "%s %s %s %s", dcSource,
139  SPICE_VALUE( aDcStart->GetValue() ).ToSpiceString(),
140  SPICE_VALUE( aDcStop->GetValue() ).ToSpiceString(),
141  SPICE_VALUE( aDcIncr->GetValue() ).ToSpiceString() );
142  }
143  catch( std::exception& e )
144  {
145  DisplayError( this, e.what() );
146  return wxEmptyString;
147  }
148  catch( const KI_PARAM_ERROR& e )
149  {
150  DisplayError( this, e.What() );
151  return wxEmptyString;
152  }
153  catch( ... )
154  {
155  return wxEmptyString;
156  }
157 }
158 
159 
161 {
162  if( !wxDialog::TransferDataFromWindow() )
163  return false;
164 
165  // The simulator dependent settings always get transferred.
166  NGSPICE_SIMULATOR_SETTINGS* ngspiceSettings =
167  dynamic_cast<NGSPICE_SIMULATOR_SETTINGS*>( m_settings.get() );
168 
169  if( ngspiceSettings )
170  {
171  switch( m_compatibilityModeChoice->GetSelection() )
172  {
173  case 0: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::USER_CONFIG ); break;
174  case 1: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::NGSPICE ); break;
175  case 2: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::PSPICE ); break;
176  case 3: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LTSPICE ); break;
177  case 4: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::LT_PSPICE ); break;
178  case 5: ngspiceSettings->SetModelMode( NGSPICE_MODEL_MODE::HSPICE ); break;
179  }
180  }
181 
182  wxString previousSimCommand = m_simCommand;
183  wxWindow* page = m_simPages->GetCurrentPage();
184 
185  if( page == m_pgAC ) // AC analysis
186  {
187  if( !m_pgAC->Validate() )
188  return false;
189 
190  m_simCommand.Printf( ".ac %s %s %s %s",
191  scaleToString( m_acScale->GetSelection() ),
192  m_acPointsNumber->GetValue(),
193  SPICE_VALUE( m_acFreqStart->GetValue() ).ToSpiceString(),
194  SPICE_VALUE( m_acFreqStop->GetValue() ).ToSpiceString() );
195  }
196  else if( page == m_pgDC ) // DC transfer analysis
197  {
198  wxString simCmd = wxString( ".dc " );
199 
201 
202  if( src1.IsEmpty() )
203  return false;
204  else
205  simCmd += src1;
206 
207  if( m_dcEnable2->IsChecked() )
208  {
210 
211  if( src2.IsEmpty() )
212  return false;
213  else
214  simCmd += " " + src2;
215 
216  if( m_dcSource1->GetSelection() == m_dcSource2->GetSelection() )
217  {
218  DisplayError( this, _( "Source 1 and Source 2 must be different" ) );
219  return false;
220  }
221  }
222 
223  m_simCommand = simCmd;
224  }
225  else if( page == m_pgNoise ) // Noise analysis
226  {
228 
231  {
232  return false;
233  }
234 
235  wxString ref;
236 
237  if( !empty( m_noiseRef ) )
238  ref = wxString::Format( ", %d", netMap.at( m_noiseRef->GetValue() ) );
239 
240  wxString noiseSource = m_exporter->GetSpiceDevice( m_noiseSrc->GetValue() );
241 
242  // Add voltage source prefix if needed
243  if( noiseSource[0] != 'v' && noiseSource[0] != 'V' )
244  noiseSource += 'v' + noiseSource;
245 
246  m_simCommand.Printf( ".noise v(%d%s) %s %s %s %s %s",
247  netMap.at( m_noiseMeas->GetValue() ), ref,
248  noiseSource, scaleToString( m_noiseScale->GetSelection() ),
249  m_noisePointsNumber->GetValue(),
250  SPICE_VALUE( m_noiseFreqStart->GetValue() ).ToSpiceString(),
251  SPICE_VALUE( m_noiseFreqStop->GetValue() ).ToSpiceString() );
252  }
253  else if( page == m_pgOP ) // DC operating point analysis
254  {
255  m_simCommand = wxString( ".op" );
256  }
257  else if( page == m_pgTransient ) // Transient analysis
258  {
259  if( !m_pgTransient->Validate() )
260  return false;
261 
262  wxString initial;
263 
264  if( !empty( m_transInitial ) )
265  initial = SPICE_VALUE( m_transInitial->GetValue() ).ToSpiceString();
266 
267  m_simCommand.Printf( ".tran %s %s %s",
268  SPICE_VALUE( m_transStep->GetValue() ).ToSpiceString(),
269  SPICE_VALUE( m_transFinal->GetValue() ).ToSpiceString(),
270  initial );
271  }
272  else if( page == m_pgCustom ) // Custom directives
273  {
274  m_simCommand = m_customTxt->GetValue();
275  }
276  else
277  {
278  wxString extendedMsg;
279 
280  if( m_simCommand.IsEmpty() )
281  {
282  KIDIALOG dlg( this, _( "No valid simulation is configured." ), _( "Warning" ),
283  wxOK | wxCANCEL | wxICON_EXCLAMATION | wxCENTER );
284 
285  dlg.SetExtendedMessage( _( "A valid simulation can be configured by selecting a "
286  "simulation tab, setting the simulation parameters and "
287  "clicking the OK button with the tab selected." ) );
288  dlg.SetOKCancelLabels(
289  wxMessageDialog::ButtonLabel( _( "Exit Without Valid Simulation" ) ),
290  wxMessageDialog::ButtonLabel( _( "Configure Valid Simulation" ) ) );
291  dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
292 
293  if( dlg.ShowModal() == wxID_OK )
294  return true;
295  }
296 
297  return false;
298  }
299 
300  if( previousSimCommand != m_simCommand )
301  {
302  m_simCommand.Trim();
303  }
304 
306 
307  return true;
308 }
309 
310 
312 {
314  if( empty( m_customTxt ) )
315  loadDirectives();
316 
317  NGSPICE_SIMULATOR_SETTINGS* ngspiceSettings =
318  dynamic_cast<NGSPICE_SIMULATOR_SETTINGS*>( m_settings.get() );
319 
320  if( ngspiceSettings )
321  {
322  switch( ngspiceSettings->GetModelMode() )
323  {
324  case NGSPICE_MODEL_MODE::USER_CONFIG: m_compatibilityModeChoice->SetSelection( 0 ); break;
325  case NGSPICE_MODEL_MODE::NGSPICE: m_compatibilityModeChoice->SetSelection( 1 ); break;
326  case NGSPICE_MODEL_MODE::PSPICE: m_compatibilityModeChoice->SetSelection( 2 ); break;
327  case NGSPICE_MODEL_MODE::LTSPICE: m_compatibilityModeChoice->SetSelection( 3 ); break;
328  case NGSPICE_MODEL_MODE::LT_PSPICE: m_compatibilityModeChoice->SetSelection( 4 ); break;
329  case NGSPICE_MODEL_MODE::HSPICE: m_compatibilityModeChoice->SetSelection( 5 ); break;
330  default:
331  wxFAIL_MSG( wxString::Format( "Unknown NGSPICE_MODEL_MODE %d.",
332  ngspiceSettings->GetModelMode() ) );
333  break;
334  }
335  }
336 
337  if( !m_dcSource1->GetCount() )
338  {
339  wxChar type1 = getStringSelection( m_dcSourceType1 ).Upper().GetChar( 0 );
340  updateDCSources( type1, m_dcSource1 );
341  }
342 
343  if( !m_dcSource2->GetCount() )
344  {
345  wxChar type2 = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
346  updateDCSources( type2, m_dcSource2 );
347  }
348 
349  if( m_simCommand.IsEmpty() && !empty( m_customTxt ) )
350  return parseCommand( m_customTxt->GetValue() );
351 
352  return true;
353 }
354 
355 
357 {
358  // Fill out comboboxes that allows one to select nets
359  // Map comoboxes to their current values
360  std::map<wxComboBox*, wxString> cmbNet = {
361  { m_noiseMeas, m_noiseMeas->GetStringSelection() },
362  { m_noiseRef, m_noiseRef->GetStringSelection() }
363  };
364 
365  for( auto c : cmbNet )
366  c.first->Clear();
367 
368  for( const auto& net : m_exporter->GetNetIndexMap() )
369  {
370  for( auto c : cmbNet )
371  c.first->Append( net.first );
372  }
373 
374  // Try to restore the previous selection, if possible
375  for( auto c : cmbNet )
376  {
377  int idx = c.first->FindString( c.second );
378 
379  if( idx != wxNOT_FOUND )
380  c.first->SetSelection( idx );
381  }
382 
383  return DIALOG_SIM_SETTINGS_BASE::ShowModal();
384 }
385 
386 
387 void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource )
388 {
389  wxString prevSelection;
390 
391  if( aSource->GetCount() )
392  aSource->GetString( aSource->GetSelection() );
393 
394  std::vector<wxString> sourcesList;
395  bool enableSrcSelection = true;
396 
397  if( aType != 'T' )
398  {
399  for( const auto& item : m_exporter->GetSpiceItems() )
400  {
401  if( item.m_primitive == aType )
402  sourcesList.push_back( item.m_refName );
403  }
404 
405  std::sort( sourcesList.begin(), sourcesList.end(),
406  [](wxString& a, wxString& b) -> bool
407  {
408  return a.Len() < b.Len() || b.Cmp( a ) > 0;
409  } );
410 
411  if( aSource == m_dcSource2 && !m_dcEnable2->IsChecked() )
412  enableSrcSelection = false;
413  }
414  else
415  {
416  prevSelection = wxT( "TEMP" );
417  sourcesList.push_back( prevSelection );
418  enableSrcSelection = false;
419  }
420 
421  aSource->Enable( enableSrcSelection );
422 
423  aSource->Clear();
424 
425  for( auto& src : sourcesList )
426  aSource->Append( src );
427 
428  // Try to restore the previous selection, if possible
429  aSource->SetStringSelection( prevSelection );
430 }
431 
432 
433 bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
434 {
435  if( aCommand.IsEmpty() )
436  return false;
437 
438  wxStringTokenizer tokenizer( aCommand, " " );
439  wxString tkn = tokenizer.GetNextToken().Lower();
440 
441  try
442  {
443  if( tkn == ".ac" )
444  {
445  m_simPages->SetSelection( m_simPages->FindPage( m_pgAC ) );
446 
447  tkn = tokenizer.GetNextToken().Lower();
448 
449  if( tkn == "dec" )
450  m_acScale->SetSelection( 0 );
451  if( tkn == "oct" )
452  m_acScale->SetSelection( 1 );
453  if( tkn == "lin" )
454  m_acScale->SetSelection( 2 );
455  else
456  return false;
457 
458  // If the fields below are empty, it will be caught by the exception handler
459  m_acPointsNumber->SetValue( tokenizer.GetNextToken() );
460  m_acFreqStart->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
461  m_acFreqStop->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
462  }
463  else if( tkn == ".dc" )
464  {
465  SPICE_DC_PARAMS src1, src2;
466  src2.m_vincrement = SPICE_VALUE( -1 );
467 
468  if( !m_exporter->ParseDCCommand( aCommand, &src1, &src2 ) )
469  return false;
470 
471  m_simPages->SetSelection( m_simPages->FindPage( m_pgDC ) );
472 
473  if( src1.m_source.IsSameAs( wxT( "TEMP" ), false ) )
474  setStringSelection( m_dcSourceType1, wxT( "TEMP" ) );
475  else
476  setStringSelection( m_dcSourceType1, src1.m_source.GetChar( 0 ) );
477 
478  updateDCSources( src1.m_source.GetChar( 0 ), m_dcSource1 );
479  m_dcSource1->SetStringSelection( src1.m_source );
480  m_dcStart1->SetValue( src1.m_vstart.ToSpiceString() );
481  m_dcStop1->SetValue( src1.m_vend.ToSpiceString() );
482  m_dcIncr1->SetValue( src1.m_vincrement.ToSpiceString() );
483 
484  if( src2.m_vincrement.ToDouble() != -1 )
485  {
486  if( src2.m_source.IsSameAs( wxT( "TEMP" ), false ) )
487  setStringSelection( m_dcSourceType2, wxT( "TEMP" ) );
488  else
489  setStringSelection( m_dcSourceType2, src2.m_source.GetChar( 0 ) );
490 
491  updateDCSources( src2.m_source.GetChar( 0 ), m_dcSource2 );
492  m_dcSource2->SetStringSelection( src2.m_source );
493  m_dcStart2->SetValue( src2.m_vstart.ToSpiceString() );
494  m_dcStop2->SetValue( src2.m_vend.ToSpiceString() );
495  m_dcIncr2->SetValue( src2.m_vincrement.ToSpiceString() );
496 
497  m_dcEnable2->SetValue( true );
498  }
499 
501  }
502  else if( tkn == ".tran" )
503  {
504  m_simPages->SetSelection( m_simPages->FindPage( m_pgTransient ) );
505 
506  // If the fields below are empty, it will be caught by the exception handler
507  m_transStep->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
508  m_transFinal->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
509 
510  // Initial time is an optional field
511  tkn = tokenizer.GetNextToken();
512 
513  if( !tkn.IsEmpty() )
514  m_transInitial->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
515  }
516  else if( tkn == ".op" )
517  {
518  m_simPages->SetSelection( m_simPages->FindPage( m_pgOP ) );
519  }
520  else if( !empty( m_customTxt ) ) // Custom directives
521  {
522  m_simPages->SetSelection( m_simPages->FindPage( m_pgCustom ) );
523  }
524  }
525  catch( ... )
526  {
527  // Nothing really bad has happened
528  return false;
529  }
530 
531  return true;
532 }
533 
534 
535 void DIALOG_SIM_SETTINGS::onSwapDCSources( wxCommandEvent& event )
536 {
537  std::vector<std::pair<wxTextEntry*, wxTextEntry*>> textCtrl = { { m_dcStart1, m_dcStart2 },
538  { m_dcStop1, m_dcStop2 },
539  { m_dcIncr1, m_dcIncr2 } };
540 
541  for( auto& couple : textCtrl )
542  {
543  wxString tmp = couple.first->GetValue();
544  couple.first->SetValue( couple.second->GetValue() );
545  couple.second->SetValue( tmp );
546  }
547 
548  int src1 = m_dcSource1->GetSelection();
549  int src2 = m_dcSource2->GetSelection();
550 
551  int sel = m_dcSourceType1->GetSelection();
552  m_dcSourceType1->SetSelection( m_dcSourceType2->GetSelection() );
553  m_dcSourceType2->SetSelection( sel );
554 
555  wxChar type1 = getStringSelection( m_dcSourceType1 ).Upper().GetChar( 0 );
556  updateDCSources( type1, m_dcSource1 );
557  wxChar type2 = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
558  updateDCSources( type2, m_dcSource2 );
559 
560  m_dcSource1->SetSelection( src2 );
561  m_dcSource2->SetSelection( src1 );
562 
565 }
566 
567 
568 void DIALOG_SIM_SETTINGS::onDCEnableSecondSource( wxCommandEvent& event )
569 {
570  bool is2ndSrcEnabled = m_dcEnable2->IsChecked();
571  wxChar type = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
572 
573  m_dcSourceType2->Enable( is2ndSrcEnabled );
574  m_dcSource2->Enable( is2ndSrcEnabled && type != 'T' );
575  m_dcStart2->Enable( is2ndSrcEnabled );
576  m_dcStop2->Enable( is2ndSrcEnabled );
577  m_dcIncr2->Enable( is2ndSrcEnabled );
578 }
579 
580 
581 void DIALOG_SIM_SETTINGS::updateDCUnits( wxChar aType, wxChoice* aSource,
582  wxStaticText* aStartValUnit, wxStaticText* aEndValUnit,
583  wxStaticText* aStepUnit )
584 {
585  wxString unit;
586 
587  switch( aType )
588  {
589  case 'V': unit = _( "Volts" ); break;
590  case 'I': unit = _( "Amperes" ); break;
591  case 'R': unit = _( "Ohms" ); break;
592  case 'T': unit = wxT( "\u00B0C" ); break;
593  }
594 
595  aStartValUnit->SetLabel( unit );
596  aEndValUnit->SetLabel( unit );
597  aStepUnit->SetLabel( unit );
598 
599  m_pgDC->Refresh();
600 }
601 
602 
604 {
605  if( m_exporter )
606  m_customTxt->SetValue( m_exporter->GetSheetSimCommand() );
607 }
608 
609 
611 {
613 
614  if( !m_fixPassiveVals->IsChecked() )
616 
617  if( !m_fixIncludePaths->IsChecked() )
619 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:252
wxString ToSpiceString() const
Return string value in Spice format (e.g.
const SPICE_ITEM_LIST & GetSpiceItems() const
Return list of items representing schematic components in the Spice world.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Definition: confirm.cpp:55
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > m_settings
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: confirm.h:45
This file is part of the common library.
double ToDouble() const
SPICE_VALIDATOR m_spiceEmptyValidator
wxString evaluateDCControls(wxChoice *aDcSource, wxTextCtrl *aDcStart, wxTextCtrl *aDcStop, wxTextCtrl *aDcIncr)
Read values from one DC sweep source to form a part of simulation command.
static wxString scaleToString(int aOption)
Class DIALOG_SIM_SETTINGS_BASE.
void onSwapDCSources(wxCommandEvent &event) override
SPICE_VALIDATOR m_spiceValidator
wxString GetSheetSimCommand()
Return simulation command directives placed in schematic sheets (if any).
DIALOG_SIM_SETTINGS(wxWindow *aParent, std::shared_ptr< SPICE_SIMULATOR_SETTINGS > &aSettings)
void updateDCSources(wxChar aType, wxChoice *aSource)
Update DC sweep source with symbols from schematic.
< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg) Helper class to recognize Spi...
Definition: spice_value.h:34
wxString GetSpiceDevice(const wxString &aSymbol) const
Return name of Spice device corresponding to a schematic symbol.
bool parseCommand(const wxString &aCommand)
Parse a Spice directive.
const NET_INDEX_MAP & GetNetIndexMap() const
Return a map of circuit nodes to net names.
#define _(s)
static wxString getStringSelection(const wxChoice *aCtrl)
static void setStringSelection(wxChoice *aCtrl, const wxString &aStr)
std::map< wxString, int > NET_INDEX_MAP
bool ParseDCCommand(const wxString &aCmd, SPICE_DC_PARAMS *aSource1, SPICE_DC_PARAMS *aSource2)
Parse a two-source .dc command directive into its symbols.
bool TransferDataFromWindow() override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
NGSPICE_MODEL_MODE GetModelMode() const
const wxString What() const
Definition: ki_exception.h:57
NETLIST_EXPORTER_PSPICE_SIM * m_exporter
bool SetOKCancelLabels(const ButtonLabel &ok, const ButtonLabel &cancel) override
Shows the 'do not show again' checkbox.
Definition: confirm.h:56
Container for Ngspice simulator settings.
bool TransferDataToWindow() override
wxIntegerValidator< int > m_posIntValidator
static bool empty(const wxTextEntryBase *aCtrl)
void updateDCUnits(wxChar aType, wxChoice *aSource, wxStaticText *aStartValUnit, wxStaticText *aEndValUnit, wxStaticText *aStepUnit)
Update units on labels depending on selected source.
int ShowModal() override
Definition: confirm.cpp:99
void SetModelMode(NGSPICE_MODEL_MODE aMode)
void onDCEnableSecondSource(wxCommandEvent &event) override
Hold a translatable error message and may be used when throwing exceptions containing a translated er...
Definition: ki_exception.h:44