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 <[email protected]>
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"
27#include <sim/ngspice_helpers.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
41static bool empty( const wxTextEntryBase* aCtrl )
42{
43 return aCtrl->GetValue().IsEmpty();
44}
45
46
47static void setStringSelection( wxChoice* aCtrl, const wxString& aStr )
48{
49 aCtrl->SetSelection( aCtrl->FindString( aStr ) );
50}
51
52
53static wxString getStringSelection( const wxChoice* aCtrl )
54{
55 return aCtrl->GetString( aCtrl->GetSelection() );
56}
57
58
60 std::shared_ptr<NGSPICE_CIRCUIT_MODEL> aCircuitModel,
61 std::shared_ptr<SPICE_SIMULATOR_SETTINGS>& aSettings ) :
62 DIALOG_SIM_SETTINGS_BASE( aParent ),
63 m_circuitModel( aCircuitModel ),
64 m_settings( aSettings ),
65 m_spiceEmptyValidator( true )
66{
67 m_posIntValidator.SetMin( 1 );
68
69 m_acPointsNumber->SetValidator( m_posIntValidator );
70 m_acFreqStart->SetValidator( m_spiceValidator );
71 m_acFreqStop->SetValidator( m_spiceValidator );
72
73 m_dcStart1->SetValidator( m_spiceValidator );
74 m_dcStop1->SetValidator( m_spiceValidator );
75 m_dcIncr1->SetValidator( m_spiceValidator );
76
77 m_dcStart2->SetValidator( m_spiceValidator );
78 m_dcStop2->SetValidator( m_spiceValidator );
79 m_dcIncr2->SetValidator( m_spiceValidator );
80
82 m_noiseFreqStart->SetValidator( m_spiceValidator );
83 m_noiseFreqStop->SetValidator( m_spiceValidator );
84
85 m_transStep->SetValidator( m_spiceValidator );
86 m_transFinal->SetValidator( m_spiceValidator );
88
90
91 // Hide pages that aren't fully implemented yet
92 // wxPanel::Hide() isn't enough on some platforms
93 m_simPages->RemovePage( m_simPages->FindPage( m_pgDistortion ) );
94 m_simPages->RemovePage( m_simPages->FindPage( m_pgNoise ) );
95 m_simPages->RemovePage( m_simPages->FindPage( m_pgPoleZero ) );
96 m_simPages->RemovePage( m_simPages->FindPage( m_pgSensitivity ) );
97 m_simPages->RemovePage( m_simPages->FindPage( m_pgTransferFunction ) );
98
99 if( !dynamic_cast<NGSPICE_SIMULATOR_SETTINGS*>( aSettings.get() ) )
100 m_compatibilityMode->Show( false );
101
104}
105
106wxString 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_circuitModel->GetItemName( std::string( dcSource.ToUTF8() ) );
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->GetStringSelection() == m_dcSource2->GetStringSelection() )
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 {
227 /*const std::map<wxString, int>& netMap = m_circuitModel->GetNetIndexMap();
228
229 if( empty( m_noiseMeas ) || empty( m_noiseSrc ) || empty( m_noisePointsNumber )
230 || empty( m_noiseFreqStart ) || empty( m_noiseFreqStop ) )
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_circuitModel->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 if( m_simCommand.IsEmpty() )
279 {
280 KIDIALOG dlg( this, _( "No valid simulation is configured." ), _( "Warning" ),
281 wxOK | wxCANCEL | wxICON_EXCLAMATION | wxCENTER );
282
283 dlg.SetExtendedMessage( _( "A valid simulation can be configured by selecting a "
284 "simulation tab, setting the simulation parameters and "
285 "clicking the OK button with the tab selected." ) );
287 wxMessageDialog::ButtonLabel( _( "Exit Without Valid Simulation" ) ),
288 wxMessageDialog::ButtonLabel( _( "Configure Valid Simulation" ) ) );
289 dlg.DoNotShowCheckbox( __FILE__, __LINE__ );
290
291 if( dlg.ShowModal() == wxID_OK )
292 return true;
293 }
294
295 return false;
296 }
297
298 if( previousSimCommand != m_simCommand )
299 m_simCommand.Trim();
300
302
305
306 return true;
307}
308
309
311{
313 if( empty( m_customTxt ) )
315
316 m_fixPassiveVals->SetValue( m_settings->GetFixPassiveVals() );
317 m_fixIncludePaths->SetValue( m_settings->GetFixIncludePaths() );
319
320 NGSPICE_SIMULATOR_SETTINGS* ngspiceSettings =
321 dynamic_cast<NGSPICE_SIMULATOR_SETTINGS*>( m_settings.get() );
322
323 if( ngspiceSettings )
324 {
325 switch( ngspiceSettings->GetModelMode() )
326 {
327 case NGSPICE_MODEL_MODE::USER_CONFIG: m_compatibilityModeChoice->SetSelection( 0 ); break;
328 case NGSPICE_MODEL_MODE::NGSPICE: m_compatibilityModeChoice->SetSelection( 1 ); break;
329 case NGSPICE_MODEL_MODE::PSPICE: m_compatibilityModeChoice->SetSelection( 2 ); break;
330 case NGSPICE_MODEL_MODE::LTSPICE: m_compatibilityModeChoice->SetSelection( 3 ); break;
331 case NGSPICE_MODEL_MODE::LT_PSPICE: m_compatibilityModeChoice->SetSelection( 4 ); break;
332 case NGSPICE_MODEL_MODE::HSPICE: m_compatibilityModeChoice->SetSelection( 5 ); break;
333 default:
334 wxFAIL_MSG( wxString::Format( "Unknown NGSPICE_MODEL_MODE %d.",
335 ngspiceSettings->GetModelMode() ) );
336 break;
337 }
338 }
339
340 if( !m_dcSource1->GetCount() )
341 {
342 wxChar type1 = getStringSelection( m_dcSourceType1 ).Upper().GetChar( 0 );
344 }
345
346 if( !m_dcSource2->GetCount() )
347 {
348 wxChar type2 = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
350 }
351
352 if( m_simCommand.IsEmpty() && !empty( m_customTxt ) )
353 return parseCommand( m_customTxt->GetValue() );
354
355 return true;
356}
357
358
360{
361 // Fill out comboboxes that allows one to select nets
362 // Map comoboxes to their current values
363 std::map<wxComboBox*, wxString> cmbNet = {
364 { m_noiseMeas, m_noiseMeas->GetStringSelection() },
365 { m_noiseRef, m_noiseRef->GetStringSelection() }
366 };
367
368 for( auto& c : cmbNet )
369 c.first->Clear();
370
371 for( const auto& net : m_circuitModel->GetNets() )
372 {
373 for( auto& c : cmbNet )
374 c.first->Append( net );
375 }
376
377 // Try to restore the previous selection, if possible
378 for( auto& c : cmbNet )
379 {
380 int idx = c.first->FindString( c.second );
381
382 if( idx != wxNOT_FOUND )
383 c.first->SetSelection( idx );
384 }
385
386 return DIALOG_SIM_SETTINGS_BASE::ShowModal();
387}
388
389
390void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource )
391{
392 wxString prevSelection;
393
394 if( !aSource->IsEmpty() )
395 prevSelection = aSource->GetString( aSource->GetSelection() );
396
397 std::set<wxString> sourcesList;
398 bool enableSrcSelection = true;
399
400 if( aType != 'T' )
401 {
402 for( const auto& item : m_circuitModel->GetItems() )
403 {
404 if( ( aType == 'R' && item.model->GetDeviceType() == SIM_MODEL::DEVICE_TYPE_::R )
405 || ( aType == 'C' && item.model->GetDeviceType() == SIM_MODEL::DEVICE_TYPE_::C )
406 || ( aType == 'L' && item.model->GetDeviceType() == SIM_MODEL::DEVICE_TYPE_::L ) )
407 {
408 // TODO: VSOURCE, ISOURCE.
409 sourcesList.insert( item.refName );
410 }
411 }
412
413 if( aSource == m_dcSource2 && !m_dcEnable2->IsChecked() )
414 enableSrcSelection = false;
415 }
416 else
417 {
418 prevSelection = wxT( "TEMP" );
419 sourcesList.insert( prevSelection );
420 enableSrcSelection = false;
421 }
422
423 aSource->Enable( enableSrcSelection );
424
425 aSource->Clear();
426
427 for( const wxString& src : sourcesList )
428 aSource->Append( src );
429
430 // Try to restore the previous selection, if possible
431 aSource->SetStringSelection( prevSelection );
432}
433
434
435bool DIALOG_SIM_SETTINGS::parseCommand( const wxString& aCommand )
436{
437 if( aCommand.IsEmpty() )
438 return false;
439
440 wxStringTokenizer tokenizer( aCommand, " " );
441 wxString tkn = tokenizer.GetNextToken().Lower();
442
443 try
444 {
445 if( tkn == ".ac" )
446 {
447 m_simPages->SetSelection( m_simPages->FindPage( m_pgAC ) );
448
449 tkn = tokenizer.GetNextToken().Lower();
450
451 if( tkn == "dec" )
452 m_acScale->SetSelection( 0 );
453 if( tkn == "oct" )
454 m_acScale->SetSelection( 1 );
455 if( tkn == "lin" )
456 m_acScale->SetSelection( 2 );
457 else
458 return false;
459
460 // If the fields below are empty, it will be caught by the exception handler
461 m_acPointsNumber->SetValue( tokenizer.GetNextToken() );
462 m_acFreqStart->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
463 m_acFreqStop->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
464 }
465 else if( tkn == ".dc" )
466 {
467 SPICE_DC_PARAMS src1, src2;
468 src2.m_vincrement = SPICE_VALUE( -1 );
469
470 if( !m_circuitModel->ParseDCCommand( aCommand, &src1, &src2 ) )
471 return false;
472
473 m_simPages->SetSelection( m_simPages->FindPage( m_pgDC ) );
474
475 if( src1.m_source.IsSameAs( wxT( "TEMP" ), false ) )
476 setStringSelection( m_dcSourceType1, wxT( "TEMP" ) );
477 else
478 setStringSelection( m_dcSourceType1, src1.m_source.GetChar( 0 ) );
479
480 updateDCSources( src1.m_source.GetChar( 0 ), m_dcSource1 );
481 m_dcSource1->SetStringSelection( src1.m_source );
482 m_dcStart1->SetValue( src1.m_vstart.ToSpiceString() );
483 m_dcStop1->SetValue( src1.m_vend.ToSpiceString() );
484 m_dcIncr1->SetValue( src1.m_vincrement.ToSpiceString() );
485
486 if( src2.m_vincrement.ToDouble() != -1 )
487 {
488 if( src2.m_source.IsSameAs( wxT( "TEMP" ), false ) )
489 setStringSelection( m_dcSourceType2, wxT( "TEMP" ) );
490 else
491 setStringSelection( m_dcSourceType2, src2.m_source.GetChar( 0 ) );
492
493 updateDCSources( src2.m_source.GetChar( 0 ), m_dcSource2 );
494 m_dcSource2->SetStringSelection( src2.m_source );
495 m_dcStart2->SetValue( src2.m_vstart.ToSpiceString() );
496 m_dcStop2->SetValue( src2.m_vend.ToSpiceString() );
497 m_dcIncr2->SetValue( src2.m_vincrement.ToSpiceString() );
498
499 m_dcEnable2->SetValue( true );
500 }
501
503 }
504 else if( tkn == ".tran" )
505 {
506 m_simPages->SetSelection( m_simPages->FindPage( m_pgTransient ) );
507
508 // If the fields below are empty, it will be caught by the exception handler
509 m_transStep->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
510 m_transFinal->SetValue( SPICE_VALUE( tokenizer.GetNextToken() ).ToSpiceString() );
511
512 // Initial time is an optional field
513 tkn = tokenizer.GetNextToken();
514
515 if( !tkn.IsEmpty() )
516 m_transInitial->SetValue( SPICE_VALUE( tkn ).ToSpiceString() );
517 }
518 else if( tkn == ".op" )
519 {
520 m_simPages->SetSelection( m_simPages->FindPage( m_pgOP ) );
521 }
522 else if( !empty( m_customTxt ) ) // Custom directives
523 {
524 m_simPages->SetSelection( m_simPages->FindPage( m_pgCustom ) );
525 }
526 }
527 catch( ... )
528 {
529 // Nothing really bad has happened
530 return false;
531 }
532
533 return true;
534}
535
536
537void DIALOG_SIM_SETTINGS::onSwapDCSources( wxCommandEvent& event )
538{
539 std::vector<std::pair<wxTextEntry*, wxTextEntry*>> textCtrl = { { m_dcStart1, m_dcStart2 },
540 { m_dcStop1, m_dcStop2 },
541 { m_dcIncr1, m_dcIncr2 } };
542
543 for( auto& couple : textCtrl )
544 {
545 wxString tmp = couple.first->GetValue();
546 couple.first->SetValue( couple.second->GetValue() );
547 couple.second->SetValue( tmp );
548 }
549
550 int src1 = m_dcSource1->GetSelection();
551 int src2 = m_dcSource2->GetSelection();
552
553 int sel = m_dcSourceType1->GetSelection();
554 m_dcSourceType1->SetSelection( m_dcSourceType2->GetSelection() );
555 m_dcSourceType2->SetSelection( sel );
556
557 wxChar type1 = getStringSelection( m_dcSourceType1 ).Upper().GetChar( 0 );
559 wxChar type2 = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
561
562 m_dcSource1->SetSelection( src2 );
563 m_dcSource2->SetSelection( src1 );
564
567}
568
569
571{
572 bool is2ndSrcEnabled = m_dcEnable2->IsChecked();
573 wxChar type = getStringSelection( m_dcSourceType2 ).Upper().GetChar( 0 );
574
575 m_dcSourceType2->Enable( is2ndSrcEnabled );
576 m_dcSource2->Enable( is2ndSrcEnabled && type != 'T' );
577 m_dcStart2->Enable( is2ndSrcEnabled );
578 m_dcStop2->Enable( is2ndSrcEnabled );
579 m_dcIncr2->Enable( is2ndSrcEnabled );
580}
581
582
583void DIALOG_SIM_SETTINGS::updateDCUnits( wxChar aType, wxChoice* aSource,
584 wxStaticText* aStartValUnit, wxStaticText* aEndValUnit,
585 wxStaticText* aStepUnit )
586{
587 wxString unit;
588
589 switch( aType )
590 {
591 case 'V': unit = _( "Volts" ); break;
592 case 'I': unit = _( "Amperes" ); break;
593 case 'R': unit = _( "Ohms" ); break;
594 case 'T': unit = wxT( "\u00B0C" ); break;
595 }
596
597 aStartValUnit->SetLabel( unit );
598 aEndValUnit->SetLabel( unit );
599 aStepUnit->SetLabel( unit );
600
601 m_pgDC->Refresh();
602}
603
604
606{
607 if( m_circuitModel )
608 m_customTxt->SetValue( m_circuitModel->GetSheetSimCommand() );
609}
610
611
613{
615
616 if( !m_fixPassiveVals->IsChecked() )
617 m_netlistOpts &= ~NETLIST_EXPORTER_SPICE::OPTION_ADJUST_PASSIVE_VALS;
618
619 if( !m_fixIncludePaths->IsChecked() )
620 m_netlistOpts &= ~NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS;
621}
void SetupStandardButtons(std::map< int, wxString > aLabels={})
Class DIALOG_SIM_SETTINGS_BASE.
bool TransferDataToWindow() override
wxIntegerValidator< int > m_posIntValidator
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > m_settings
SPICE_VALIDATOR m_spiceEmptyValidator
void updateDCUnits(wxChar aType, wxChoice *aSource, wxStaticText *aStartValUnit, wxStaticText *aEndValUnit, wxStaticText *aStepUnit)
Update units on labels depending on selected source.
void onDCEnableSecondSource(wxCommandEvent &event) override
bool TransferDataFromWindow() override
static wxString scaleToString(int aOption)
void updateDCSources(wxChar aType, wxChoice *aSource)
Update DC sweep source with symbols from schematic.
DIALOG_SIM_SETTINGS(wxWindow *aParent, std::shared_ptr< NGSPICE_CIRCUIT_MODEL > aCircuitModel, std::shared_ptr< SPICE_SIMULATOR_SETTINGS > &aSettings)
SPICE_VALIDATOR m_spiceValidator
bool parseCommand(const wxString &aCommand)
Parse a Spice directive.
std::shared_ptr< NGSPICE_CIRCUIT_MODEL > m_circuitModel
void onSwapDCSources(wxCommandEvent &event) override
wxString evaluateDCControls(wxChoice *aDcSource, wxTextCtrl *aDcStart, wxTextCtrl *aDcStop, wxTextCtrl *aDcIncr)
Read values from one DC sweep source to form a part of simulation command.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: confirm.h:46
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Definition: confirm.cpp:56
bool SetOKCancelLabels(const ButtonLabel &ok, const ButtonLabel &cancel) override
Shows the 'do not show again' checkbox.
Definition: confirm.h:56
int ShowModal() override
Definition: confirm.cpp:100
Hold a translatable error message and may be used when throwing exceptions containing a translated er...
Definition: ki_exception.h:45
Container for Ngspice simulator settings.
void SetModelMode(NGSPICE_MODEL_MODE aMode)
NGSPICE_MODEL_MODE GetModelMode() const
< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg) Helper class to recognize Spi...
Definition: spice_value.h:35
wxString ToSpiceString() const
Return string value in Spice format (e.g.
double ToDouble() const
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:280
This file is part of the common library.
static void setStringSelection(wxChoice *aCtrl, const wxString &aStr)
static wxString getStringSelection(const wxChoice *aCtrl)
static bool empty(const wxTextEntryBase *aCtrl)
#define _(s)
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
#define R()
SPICE_VALUE m_vstart
SPICE_VALUE m_vincrement
SPICE_VALUE m_vend