KiCad PCB EDA Suite
Loading...
Searching...
No Matches
simulator_control.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) 2023-2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23#define wxUSE_BASE64 1
24#include <wx/base64.h>
25
26#include <wx/ffile.h>
27#include <wx/filedlg.h>
28#include <wx_filename.h>
29#include <wx/stc/stc.h>
30
31#include <kiway.h>
32#include <confirm.h>
36#include <sch_edit_frame.h>
37#include <sim/simulator_frame.h>
38#include <sim/sim_plot_tab.h>
39#include <tool/tool_manager.h>
40#include <tools/ee_actions.h>
42#include <scintilla_tricks.h>
45#include <wx/clipbrd.h>
46#include <wx/dataobj.h>
47#include <wx/mstream.h>
48#include <string_utils.h>
49
50
52{
54 return true;
55}
56
57
59{
60 m_simulatorFrame = getEditFrame<SIMULATOR_FRAME>();
61
63 {
67 }
68}
69
70
72{
74 wxString errors;
75 WX_STRING_REPORTER reporter( &errors );
76
77 if( !m_circuitModel->ReadSchematicAndLibraries( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS,
78 reporter ) )
79 {
81 _( "Errors during netlist generation.\n\n" ) + errors );
82 }
83
84 dlg.SetSimCommand( wxS( "*" ) );
86
87 if( dlg.ShowModal() == wxID_OK )
88 {
90 dlg.ApplySettings( tab );
92 }
93
94 return 0;
95}
96
97
99{
100 wxFileDialog openDlg( m_simulatorFrame, _( "Open Simulation Workbook" ), getDefaultPath(), "",
101 FILEEXT::WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
102
103 if( openDlg.ShowModal() == wxID_CANCEL )
104 return -1;
105
106 m_simulatorFrame->LoadWorkbook( openDlg.GetPath() );
107 return 0;
108}
109
110
112{
113 wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
114
115 if( filename.GetName().IsEmpty() )
116 {
117 if( m_simulatorFrame->Prj().GetProjectName().IsEmpty() )
118 {
119 filename.SetName( _( "noname" ) );
120 filename.SetExt( FILEEXT::WorkbookFileExtension );
121 }
122 else
123 {
124 filename.SetName( m_simulatorFrame->Prj().GetProjectName() );
125 filename.SetExt( FILEEXT::WorkbookFileExtension );
126 }
127 }
128
129 return filename.GetFullName();
130}
131
132
134{
135 wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
136
137 path.Normalize( FN_NORMALIZE_FLAGS|wxPATH_NORM_ENV_VARS,
139 return path.GetPath();
140}
141
142
144{
145 wxString filename;
146
147 if( aEvent.IsAction( &EE_ACTIONS::saveWorkbook ) )
148 filename = m_simulator->Settings()->GetWorkbookFilename();
149
150 if( filename.IsEmpty() )
151 {
152 wxFileDialog saveAsDlg( m_simulatorFrame, _( "Save Simulation Workbook As" ),
155 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
156
157 if( saveAsDlg.ShowModal() == wxID_CANCEL )
158 return -1;
159
160 filename = saveAsDlg.GetPath();
161 }
162
164 return 0;
165}
166
167
169{
170 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
171 {
172 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
173 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
174
175 if( saveDlg.ShowModal() == wxID_CANCEL )
176 return -1;
177
178 wxImage screenImage;
179 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
180 screenImage.SaveFile( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
181 }
182
183 return 0;
184}
185
186
188{
189 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
190 {
191 wxImage screenImage;
192 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
193
194 if( wxTheClipboard->Open() )
195 {
196 wxBitmap bm( screenImage );
197
198 wxTheClipboard->SetData( new wxBitmapDataObject( bm ) );
199 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
200 wxTheClipboard->Close();
201 }
202 }
203
204 return 0;
205}
206
207
209{
210 if( m_schematicFrame == nullptr )
211 return -1;
212
213 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
214 {
215 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
216
217 if( blocking_dialog )
218 blocking_dialog->Close( true );
219
220 wxImage screenImage;
221 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
222
223 if( wxTheClipboard->Open() )
224 {
225 // Build a PNG bitmap:
226 wxMemoryOutputStream stream;
227 screenImage.SaveFile( stream, wxBITMAP_TYPE_PNG );
228 stream.Close();
229
230 // Create a SCH_BITMAP data string
231 wxString string;
232 string << "(image (at 0 0)\n";
233 string << " (data\n";
234
235 wxMemoryBuffer buff;
236 buff.GetWriteBuf( stream.GetLength() );
237 stream.CopyTo( buff.GetData(), stream.GetLength() );
238 buff.SetDataLen( stream.GetLength() );
239
240 wxString out;
241 out << wxBase64Encode( buff );
242
243 #define MIME_BASE64_LENGTH 76
244 size_t first = 0;
245
246 while( first < out.Length() )
247 {
248 string << " \"" << TO_UTF8( out( first, MIME_BASE64_LENGTH ) );
249 string << "\"\n";
250 first += MIME_BASE64_LENGTH;
251 }
252 string << " )\n)\n";
253
254 wxTheClipboard->SetData( new wxTextDataObject( string ) );
255 wxTheClipboard->Close();
256
258 m_schematicFrame->Raise();
259 }
260 }
261
262 return 0;
263}
264
265
267{
269}
270
271
273{
274 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
275 {
276 const wxChar SEPARATOR = ';';
277
278 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot Data" ), "", "",
280 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
281
282 if( saveDlg.ShowModal() == wxID_CANCEL )
283 return -1;
284
285 wxFFile out( saveDlg.GetPath(), "wb" );
286
287 std::map<wxString, TRACE*> traces = plotTab->GetTraces();
288
289 if( traces.size() == 0 )
290 return -1;
291
292 SIM_TYPE simType = plotTab->GetSimType();
293
294 std::size_t rowCount = traces.begin()->second->GetDataX().size();
295
296 // write column header names on the first row
297 wxString xAxisName( m_simulator->GetXAxis( simType ) );
298 out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
299
300 for( const auto& [name, trace] : traces )
301 out.Write( wxString::Format( wxT( "%s%c" ), name, SEPARATOR ) );
302
303 out.Write( wxS( "\r\n" ) );
304
305 // write each row's numerical value
306 for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
307 {
308 double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
309 out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
310
311 for( const auto& [name, trace] : traces )
312 {
313 double yAxisValue = trace->GetDataY().at( curRow );
314 out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
315 }
316
317 out.Write( wxS( "\r\n" ) );
318 }
319
320 out.Close();
321 }
322
323 return 0;
324}
325
326
328{
329 m_simulatorFrame->Close();
330 return 0;
331}
332
333
335{
336 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
337 {
338 mpWindow* plot = plotTab->GetPlotWin();
339
340 if( aEvent.IsAction( &ACTIONS::zoomInCenter ) )
341 {
342 plot->ZoomIn();
343 }
344 else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) )
345 {
346 plot->ZoomOut();
347 }
348 else if( aEvent.IsAction( &ACTIONS::zoomInHorizontally ) )
349 {
350 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
351 }
352 else if( aEvent.IsAction( &ACTIONS::zoomOutHorizontally ) )
353 {
354 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
355 }
356 else if( aEvent.IsAction( &ACTIONS::zoomInVertically ) )
357 {
358 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
359 }
360 else if( aEvent.IsAction( &ACTIONS::zoomOutVertically ) )
361 {
362 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
363 }
364 else if( aEvent.IsAction( &ACTIONS::zoomFitScreen ) )
365 {
366 wxCommandEvent dummy;
367 plot->OnFit( dummy );
368 }
369 }
370
371 return 0;
372}
373
374
376{
377 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
378 plotTab->GetPlotWin()->ZoomUndo();
379
380 return 0;
381}
382
383
385{
386 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
387 plotTab->GetPlotWin()->ZoomRedo();
388
389 return 0;
390}
391
392
394{
395 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
396 {
397 plotTab->ShowGrid( !plotTab->IsGridShown() );
399 }
400
401 return 0;
402}
403
404
406{
407 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
408 {
409 plotTab->ShowLegend( !plotTab->IsLegendShown() );
411 }
412
413 return 0;
414}
415
416
418{
419 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
420 {
421 plotTab->SetDottedSecondary( !plotTab->GetDottedSecondary() );
423 }
424
425 return 0;
426}
427
428
430{
432 return 0;
433}
434
435
437{
439 return 0;
440}
441
442
444{
445 if( m_simulator->IsRunning() )
446 {
447 m_simulator->Stop();
448 return 0;
449 }
450
451 if( !getCurrentSimTab() )
452 NewAnalysisTab( aEvent );
453
454 if( !getCurrentSimTab() )
455 return 0;
456
458
459 return 0;
460}
461
462
464{
465 if( m_schematicFrame == nullptr )
466 return -1;
467
468 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
469
470 if( blocking_dialog )
471 blocking_dialog->Close( true );
472
474 m_schematicFrame->Raise();
475
476 return 0;
477}
478
479
481{
482 if( m_schematicFrame == nullptr )
483 return -1;
484
485 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
486
487 if( blocking_dialog )
488 blocking_dialog->Close( true );
489
491 m_schematicFrame->Raise();
492
493 return 0;
494}
495
496
498{
499public:
500 enum
501 {
503 };
504
505 void onClose( wxCloseEvent& evt )
506 {
507 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
508 }
509
510 NETLIST_VIEW_DIALOG( wxWindow* parent ) :
511 DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
512 wxSize( 800, 800 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
513 m_textCtrl( nullptr ),
514 m_reporter( nullptr )
515 {
516 m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
517 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
518
519 //Avoid the splitter window being assigned as the Parent to additional windows
520 m_splitter->SetExtraStyle( wxWS_EX_TRANSIENT );
521
522 m_textCtrl = new wxStyledTextCtrl( m_splitter, wxID_ANY );
523
524 m_textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
525 m_textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
526 m_textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
527 m_textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
528
529 wxFont fixedFont = KIUI::GetMonospacedUIFont();
530
531 for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
532 m_textCtrl->StyleSetFont( i, fixedFont );
533
534 m_textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
535
536 m_textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
537 m_textCtrl->SetLexer( wxSTC_LEX_SPICE );
538 m_textCtrl->SetMinSize( wxSize( 40, 40 ) );
539 m_textCtrl->SetSize( wxSize( 40, 40 ) );
540
541 m_reporter = new WX_HTML_REPORT_BOX( m_splitter, wxID_ANY );
542 m_reporter->SetMinSize( wxSize( 40, 40 ) );
543 m_reporter->SetSize( wxSize( 40, 40 ) );
544
545 m_splitter->SetMinimumPaneSize( 40 );
546 m_splitter->SetSashPosition( 760 );
547 m_splitter->SetSashGravity( 0.9 );
548 m_splitter->SplitHorizontally( m_textCtrl, m_reporter );
549
550 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
551 sizer->Add( m_splitter, 1, wxEXPAND | wxALL, 5 );
552 SetSizer( sizer );
553 Layout();
554
555 Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
556 nullptr, this );
557
558 m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( m_textCtrl, wxT( "{}" ), false );
559
561 }
562
563 void SetNetlist( const wxString& aSource )
564 {
565 m_textCtrl->SetText( aSource );
566 m_textCtrl->SetEditable( false );
567
568 m_reporter->Flush();
569 }
570
572
573private:
574 wxSplitterWindow* m_splitter;
575 wxStyledTextCtrl* m_textCtrl;
577
578 std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
579};
580
581
583{
584 std::map<int, wxString> userSignals = m_simulatorFrame->UserDefinedSignals();
585
587
588 // QuasiModal required for syntax help and Scintilla auto-complete
589 if( dlg.ShowQuasiModal() == wxID_OK )
591
592 return 0;
593}
594
595
597{
598 if( m_schematicFrame == nullptr || m_simulator == nullptr )
599 return -1;
600
601 STRING_FORMATTER formatter;
603
606 &formatter, *dlg.GetReporter() );
607
608 dlg.SetNetlist( wxString( formatter.GetString() ) );
609 dlg.ShowModal();
610
611 return 0;
612}
613
614
616{
625
627
641
647
650}
const char * name
Definition: DXF_plotter.cpp:57
static TOOL_ACTION toggleGrid
Definition: actions.h:172
static TOOL_ACTION paste
Definition: actions.h:70
static TOOL_ACTION zoomOutCenter
Definition: actions.h:118
static TOOL_ACTION zoomRedo
Definition: actions.h:129
static TOOL_ACTION zoomOutHorizontally
Definition: actions.h:120
static TOOL_ACTION zoomOutVertically
Definition: actions.h:122
static TOOL_ACTION zoomInHorizontally
Definition: actions.h:119
static TOOL_ACTION quit
Definition: actions.h:59
static TOOL_ACTION zoomFitScreen
Definition: actions.h:124
static TOOL_ACTION zoomInCenter
Definition: actions.h:117
static TOOL_ACTION zoomInVertically
Definition: actions.h:121
static TOOL_ACTION zoomUndo
Definition: actions.h:128
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:84
int ShowQuasiModal()
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetSimCommand(const wxString &aCommand)
void ApplySettings(SIM_TAB *aTab)
void SetSimOptions(int aOptions)
const wxString & GetSimCommand() const
static TOOL_ACTION simAnalysisProperties
Definition: ee_actions.h:282
static TOOL_ACTION editUserDefinedSignals
Definition: ee_actions.h:285
static TOOL_ACTION openWorkbook
Definition: ee_actions.h:269
static TOOL_ACTION stopSimulation
Definition: ee_actions.h:284
static TOOL_ACTION toggleLegend
Definition: ee_actions.h:279
static TOOL_ACTION saveWorkbook
Definition: ee_actions.h:270
static TOOL_ACTION saveWorkbookAs
Definition: ee_actions.h:271
static TOOL_ACTION exportPlotAsCSV
Definition: ee_actions.h:273
static TOOL_ACTION simTune
Definition: ee_actions.h:278
static TOOL_ACTION toggleDarkModePlots
Definition: ee_actions.h:281
static TOOL_ACTION exportPlotAsPNG
Definition: ee_actions.h:272
static TOOL_ACTION showNetlist
Definition: ee_actions.h:286
static TOOL_ACTION simProbe
Definition: ee_actions.h:277
static TOOL_ACTION toggleDottedSecondary
Definition: ee_actions.h:280
static TOOL_ACTION exportPlotToSchematic
Definition: ee_actions.h:275
static TOOL_ACTION runSimulation
Definition: ee_actions.h:283
static TOOL_ACTION newAnalysisTab
Definition: ee_actions.h:268
static TOOL_ACTION exportPlotToClipboard
Definition: ee_actions.h:274
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:55
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
Definition: kiway.cpp:669
WX_HTML_REPORT_BOX * m_reporter
void SetNetlist(const wxString &aSource)
std::unique_ptr< SCINTILLA_TRICKS > m_scintillaTricks
void onClose(wxCloseEvent &evt)
wxStyledTextCtrl * m_textCtrl
NETLIST_VIEW_DIALOG(wxWindow *parent)
wxSplitterWindow * m_splitter
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition: project.cpp:135
virtual const wxString GetProjectName() const
Return the short name of the project.
Definition: project.cpp:147
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:320
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
int ExportPlotAsPNG(const TOOL_EVENT &aEvent)
wxString getDefaultPath()
Return the default path to be used in file browser dialog.
SCH_EDIT_FRAME * m_schematicFrame
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int ToggleLegend(const TOOL_EVENT &aEvent)
int RedoZoom(const TOOL_EVENT &aEvent)
int ShowNetlist(const TOOL_EVENT &aEvent)
int ExportPlotToClipboard(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int ToggleDarkModePlots(const TOOL_EVENT &aEvent)
int Tune(const TOOL_EVENT &aEvent)
wxString getDefaultFilename()
Return the default filename (with extension) to be used in file browser dialog.
SIMULATOR_FRAME * m_simulatorFrame
bool Init() override
Init() is called once upon a registration of the tool.
int SaveWorkbook(const TOOL_EVENT &aEvent)
int RunSimulation(const TOOL_EVENT &aEvent)
SIM_TAB * getCurrentSimTab()
Set up handlers for various events.
int OpenWorkbook(const TOOL_EVENT &aEvent)
int EditUserDefinedSignals(const TOOL_EVENT &aEvent)
std::shared_ptr< SPICE_CIRCUIT_MODEL > m_circuitModel
int ToggleGrid(const TOOL_EVENT &aEvent)
int Zoom(const TOOL_EVENT &aEvent)
int EditAnalysisTab(const TOOL_EVENT &aEvent)
int ToggleDottedSecondary(const TOOL_EVENT &aEvent)
std::shared_ptr< SPICE_SIMULATOR > m_simulator
int ExportPlotAsCSV(const TOOL_EVENT &aEvent)
int UndoZoom(const TOOL_EVENT &aEvent)
int ExportPlotToSchematic(const TOOL_EVENT &aEvent)
int Probe(const TOOL_EVENT &aEvent)
int NewAnalysisTab(const TOOL_EVENT &aEvent)
int Close(const TOOL_EVENT &aEvent)
SIM_TAB * GetCurrentSimTab() const
Return the current tab (or NULL if there is none).
wxString GetCurrentSimCommand() const
std::shared_ptr< SPICE_CIRCUIT_MODEL > GetCircuitModel() const
void OnModify() override
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
bool SaveWorkbook(const wxString &aPath)
Save plot, signal, cursor, measurement, etc.
SCH_EDIT_FRAME * GetSchematicFrame() const
void ToggleDarkModePlots()
Toggle dark-mode of the plot tabs.
SIM_TAB * NewSimTab(const wxString &aSimCommand)
Create a new plot tab for a given simulation type.
bool EditAnalysis()
Shows a dialog for editing the current tab's simulation command, or creating a new tab with a differe...
int GetCurrentOptions() const
bool LoadWorkbook(const wxString &aPath)
Load plot, signal, cursor, measurement, etc.
const std::map< int, wxString > & UserDefinedSignals()
std::shared_ptr< SPICE_SIMULATOR > GetSimulator() const
void SetUserDefinedSignals(const std::map< int, wxString > &aSignals)
Implement an OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:433
const std::string & GetString()
Definition: richio.h:456
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition: tool_base.h:80
Generic, UI-independent tool event.
Definition: tool_event.h:167
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:82
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
bool PostAction(const std::string &aActionName, T aParam)
Run the specified action after the current action (coroutine) ends.
Definition: tool_manager.h:230
A slimmed down version of WX_HTML_REPORT_PANEL.
void Flush()
Build the HTML messages page.
A wrapper for reporting to a wxString object.
Definition: reporter.h:164
Canvas for plotting mpLayer implementations.
Definition: mathplot.h:906
static double zoomIncrementalFactor
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse...
Definition: mathplot.h:1191
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:305
This file is part of the common library.
#define MIME_BASE64_LENGTH
#define _(s)
void Reset() override
static const std::string WorkbookFileExtension
static wxString PngFileWildcard()
static wxString CsvFileWildcard()
static wxString WorkbookFileWildcard()
KICOMMON_API wxFont GetMonospacedUIFont()
Definition: ui_common.cpp:89
SIM_TYPE
< Possible simulation types
Definition: sim_types.h:32
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:391
Definition of file extensions used in Kicad.
#define SEPARATOR
Definition: wx_combobox.cpp:27
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition: wx_filename.h:39