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 The 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
25
26#define wxUSE_BASE64 1
27#include <wx/base64.h>
28
29#include <wx/ffile.h>
30#include <wx/filedlg.h>
31#include <wx_filename.h>
32#include <kiplatform/ui.h>
33#include <wx/stc/stc.h>
34
35#include <kiway.h>
36#include <confirm.h>
40#include <sch_edit_frame.h>
41#include <sim/simulator_frame.h>
42#include <sim/sim_plot_tab.h>
43#include <tool/tool_manager.h>
44#include <tools/sch_actions.h>
45#include <scintilla_tricks.h>
48#include <wx/clipbrd.h>
49#include <wx/dataobj.h>
50#include <wx/mstream.h>
51#include <richio.h>
52#include <string_utils.h>
53
54
56{
58 return true;
59}
60
61
63{
65
67 {
68 m_schematicFrame = m_simulatorFrame->GetSchematicFrame();
69 m_circuitModel = m_simulatorFrame->GetCircuitModel();
70 m_simulator = m_simulatorFrame->GetSimulator();
71 }
72}
73
74
76{
78 WX_STRING_REPORTER reporter;
79
81 reporter );
82
84 {
85 DisplayErrorMessage( m_simulatorFrame, _( "Errors during netlist generation." ),
86 reporter.GetMessages() );
87 }
88 else if( reporter.HasMessageOfSeverity( RPT_SEVERITY_WARNING ) )
89 {
90 DisplayInfoMessage( m_simulatorFrame, _( "Warnings during netlist generation." ),
91 reporter.GetMessages() );
92 }
93
94 dlg.SetSimCommand( wxS( "*" ) );
96
97 if( dlg.ShowModal() == wxID_OK )
98 {
99 SIM_TAB* tab = m_simulatorFrame->NewSimTab( dlg.GetSimCommand() );
100 dlg.ApplySettings( tab );
101 m_simulatorFrame->OnModify();
102 }
103
104 return 0;
105}
106
107
109{
110 wxFileDialog openDlg( m_simulatorFrame, _( "Open Simulation Workbook" ), getDefaultPath(), "",
111 FILEEXT::WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
112
114
115 if( openDlg.ShowModal() == wxID_CANCEL )
116 return -1;
117
118 m_simulatorFrame->LoadWorkbook( openDlg.GetPath() );
119 return 0;
120}
121
122
124{
125 wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
126
127 if( filename.GetName().IsEmpty() )
128 {
129 if( m_simulatorFrame->Prj().GetProjectName().IsEmpty() )
130 {
131 filename.SetName( _( "noname" ) );
132 filename.SetExt( FILEEXT::WorkbookFileExtension );
133 }
134 else
135 {
136 filename.SetName( m_simulatorFrame->Prj().GetProjectName() );
137 filename.SetExt( FILEEXT::WorkbookFileExtension );
138 }
139 }
140
141 return filename.GetFullName();
142}
143
144
146{
147 wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
148
149 path.Normalize( FN_NORMALIZE_FLAGS|wxPATH_NORM_ENV_VARS,
150 m_simulatorFrame->Prj().GetProjectPath() );
151 return path.GetPath();
152}
153
154
156{
157 wxString filename;
158
159 if( aEvent.IsAction( &SCH_ACTIONS::saveWorkbook ) )
160 filename = m_simulator->Settings()->GetWorkbookFilename();
161
162 if( filename.IsEmpty() )
163 {
164 wxFileDialog saveAsDlg( m_simulatorFrame, _( "Save Simulation Workbook As" ),
167 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
168
170
171 if( saveAsDlg.ShowModal() == wxID_CANCEL )
172 return -1;
173
174 filename = saveAsDlg.GetPath();
175 }
176
177 m_simulatorFrame->SaveWorkbook( m_simulatorFrame->Prj().AbsolutePath( filename ) );
178 return 0;
179}
180
181
183{
184 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
185 {
186 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
187 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
188
190
191 if( saveDlg.ShowModal() == wxID_CANCEL )
192 return -1;
193
194 wxImage screenImage;
195 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
196 screenImage.SaveFile( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
197 }
198
199 return 0;
200}
201
202
204{
205 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
206 {
207 wxImage screenImage;
208 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
209
210 if( wxTheClipboard->Open() )
211 {
212 wxBitmap bm( screenImage );
213
214 wxTheClipboard->SetData( new wxBitmapDataObject( bm ) );
215 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
216 wxTheClipboard->Close();
217 }
218 }
219
220 return 0;
221}
222
223
225{
226 if( m_schematicFrame == nullptr )
227 return -1;
228
229 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
230 {
231 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
232
233 if( blocking_dialog )
234 blocking_dialog->Close( true );
235
236 wxImage screenImage;
237 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
238
239 if( wxTheClipboard->Open() )
240 {
241 // Build a PNG bitmap:
242 wxMemoryOutputStream stream;
243 screenImage.SaveFile( stream, wxBITMAP_TYPE_PNG );
244 stream.Close();
245
246 // Create a SCH_BITMAP data string
247 wxString string;
248 string << "(image (at 0 0)\n";
249 string << " (data\n";
250
251 wxMemoryBuffer buff;
252 buff.GetWriteBuf( stream.GetLength() );
253 stream.CopyTo( buff.GetData(), stream.GetLength() );
254 buff.SetDataLen( stream.GetLength() );
255
256 wxString out;
257 out << wxBase64Encode( buff );
258
259 #define MIME_BASE64_LENGTH 76
260 size_t first = 0;
261
262 while( first < out.Length() )
263 {
264 string << " \"" << TO_UTF8( out( first, MIME_BASE64_LENGTH ) );
265 string << "\"\n";
266 first += MIME_BASE64_LENGTH;
267 }
268 string << " )\n)\n";
269
270 wxTheClipboard->SetData( new wxTextDataObject( string ) );
271 wxTheClipboard->Close();
272
273 m_schematicFrame->GetToolManager()->PostAction( ACTIONS::paste );
274 m_schematicFrame->Raise();
275 }
276 }
277
278 return 0;
279}
280
281
283{
284 return m_simulatorFrame->GetCurrentSimTab();
285}
286
287
289{
290 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
291 {
292 const wxChar SEPARATOR = ';';
293
294 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot Data" ), "", "",
296 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
297
299
300 if( saveDlg.ShowModal() == wxID_CANCEL )
301 return -1;
302
303 wxFFile out( saveDlg.GetPath(), "wb" );
304
305 std::map<wxString, TRACE*> traces = plotTab->GetTraces();
306
307 if( traces.size() == 0 )
308 return -1;
309
310 SIM_TYPE simType = plotTab->GetSimType();
311
312 std::size_t rowCount = traces.begin()->second->GetDataX().size();
313
314 // write column header names on the first row
315 wxString xAxisName( m_simulator->GetXAxis( simType ) );
316 out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
317
318 for( const auto& [name, trace] : traces )
319 out.Write( wxString::Format( wxT( "%s%c" ), trace->GetDisplayName(), SEPARATOR ) );
320
321 out.Write( wxS( "\r\n" ) );
322
323 // write each row's numerical value
324 for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
325 {
326 double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
327 out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
328
329 for( const auto& [name, trace] : traces )
330 {
331 double yAxisValue = trace->GetDataY().at( curRow );
332 out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
333 }
334
335 out.Write( wxS( "\r\n" ) );
336 }
337
338 out.Close();
339 }
340
341 return 0;
342}
343
344
346{
347 m_simulatorFrame->Close();
348 return 0;
349}
350
351
353{
354 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
355 {
356 mpWindow* plot = plotTab->GetPlotWin();
357
358 if( aEvent.IsAction( &ACTIONS::zoomInCenter ) )
359 {
360 plot->ZoomIn();
361 }
362 else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) )
363 {
364 plot->ZoomOut();
365 }
366 else if( aEvent.IsAction( &ACTIONS::zoomInHorizontally ) )
367 {
368 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
369 }
370 else if( aEvent.IsAction( &ACTIONS::zoomOutHorizontally ) )
371 {
372 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
373 }
374 else if( aEvent.IsAction( &ACTIONS::zoomInVertically ) )
375 {
376 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
377 }
378 else if( aEvent.IsAction( &ACTIONS::zoomOutVertically ) )
379 {
380 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
381 }
382 else if( aEvent.IsAction( &ACTIONS::zoomFitScreen ) )
383 {
384 wxCommandEvent dummy;
385 plot->OnFit( dummy );
386 }
387 }
388
389 return 0;
390}
391
392
394{
395 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
396 plotTab->GetPlotWin()->ZoomUndo();
397
398 return 0;
399}
400
401
403{
404 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
405 plotTab->GetPlotWin()->ZoomRedo();
406
407 return 0;
408}
409
410
412{
413 if( m_simulatorFrame )
414 m_simulatorFrame->ToggleSimConsole();
415
416 return 0;
417}
418
419
421{
422 if( m_simulatorFrame )
423 m_simulatorFrame->ToggleSimSidePanel();
424
425 return 0;
426}
427
428
430{
431 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
432 {
433 plotTab->ShowGrid( !plotTab->IsGridShown() );
434 m_simulatorFrame->OnModify();
435 }
436
437 return 0;
438}
439
440
442{
443 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
444 {
445 plotTab->ShowLegend( !plotTab->IsLegendShown() );
446 m_simulatorFrame->OnModify();
447 }
448
449 return 0;
450}
451
452
454{
455 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
456 {
457 plotTab->SetDottedSecondary( !plotTab->GetDottedSecondary() );
458 m_simulatorFrame->OnModify();
459 }
460
461 return 0;
462}
463
464
466{
467 m_simulatorFrame->ToggleDarkModePlots();
468 return 0;
469}
470
471
473{
474 m_simulatorFrame->EditAnalysis();
475 return 0;
476}
477
478
480{
481 if( m_simulator->IsRunning() )
482 {
483 m_simulator->Stop();
484 return 0;
485 }
486
487 if( !getCurrentSimTab() )
488 NewAnalysisTab( aEvent );
489
490 if( !getCurrentSimTab() )
491 return 0;
492
493 m_simulatorFrame->StartSimulation();
494
495 return 0;
496}
497
498
500{
501 if( m_schematicFrame == nullptr )
502 return -1;
503
504 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
505
506 if( blocking_dialog )
507 blocking_dialog->Close( true );
508
509 m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simProbe );
510 m_schematicFrame->Raise();
511
512 return 0;
513}
514
515
517{
518 if( m_schematicFrame == nullptr )
519 return -1;
520
521 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
522
523 if( blocking_dialog )
524 blocking_dialog->Close( true );
525
526 m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simTune );
527 m_schematicFrame->Raise();
528
529 return 0;
530}
531
532
534{
535public:
536 enum
537 {
539 };
540
541 void onClose( wxCloseEvent& evt )
542 {
543 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
544 }
545
546 NETLIST_VIEW_DIALOG( wxWindow* parent ) :
547 DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
548 wxSize( 800, 800 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
549 m_textCtrl( nullptr ),
550 m_reporter( nullptr )
551 {
552 m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
553 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
554
555 //Avoid the splitter window being assigned as the Parent to additional windows
556 m_splitter->SetExtraStyle( wxWS_EX_TRANSIENT );
557
558 m_textCtrl = new wxStyledTextCtrl( m_splitter, wxID_ANY );
559
560 m_textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
561 m_textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
562 m_textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
563 m_textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
564
565 wxFont fixedFont = KIUI::GetMonospacedUIFont();
566
567 for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
568 m_textCtrl->StyleSetFont( i, fixedFont );
569
570 m_textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
571
572 m_textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
573 m_textCtrl->SetLexer( wxSTC_LEX_SPICE );
574 m_textCtrl->SetMinSize( wxSize( 40, 40 ) );
575 m_textCtrl->SetSize( wxSize( 40, 40 ) );
576
577 m_reporter = new WX_HTML_REPORT_BOX( m_splitter, wxID_ANY );
578 m_reporter->SetMinSize( wxSize( 40, 40 ) );
579 m_reporter->SetSize( wxSize( 40, 40 ) );
580
581 m_splitter->SetMinimumPaneSize( 40 );
582 m_splitter->SetSashPosition( 760 );
583 m_splitter->SetSashGravity( 0.9 );
584 m_splitter->SplitHorizontally( m_textCtrl, m_reporter );
585
586 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
587 sizer->Add( m_splitter, 1, wxEXPAND | wxALL, 5 );
588 SetSizer( sizer );
589 Layout();
590
591 Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
592 nullptr, this );
593
594 m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( m_textCtrl, wxT( "{}" ), false );
595
597 }
598
599 void SetNetlist( const wxString& aSource )
600 {
601 m_textCtrl->SetText( aSource );
602 m_textCtrl->SetEditable( false );
603
604 m_reporter->Flush();
605 }
606
608
609private:
610 wxSplitterWindow* m_splitter;
611 wxStyledTextCtrl* m_textCtrl;
613
614 std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
615};
616
617
619{
620 std::map<int, wxString> userSignals = m_simulatorFrame->UserDefinedSignals();
621
623
624 // QuasiModal required for syntax help and Scintilla auto-complete
625 if( dlg.ShowQuasiModal() == wxID_OK )
626 m_simulatorFrame->SetUserDefinedSignals( userSignals );
627
628 return 0;
629}
630
631
633{
634 if( m_schematicFrame == nullptr || m_simulator == nullptr )
635 return -1;
636
637 STRING_FORMATTER formatter;
639
640 m_circuitModel->GetNetlist( m_simulatorFrame->GetCurrentSimCommand(),
641 m_simulatorFrame->GetCurrentOptions(),
642 &formatter, *dlg.GetReporter() );
643
644 dlg.SetNetlist( wxString( formatter.GetString() ) );
645 dlg.ShowModal();
646
647 return 0;
648}
649
650
652{
653 // clang-format off
662
665
679
685
688 // clang-format on
689}
const char * name
static TOOL_ACTION toggleGrid
Definition actions.h:198
static TOOL_ACTION paste
Definition actions.h:80
static TOOL_ACTION zoomOutCenter
Definition actions.h:136
static TOOL_ACTION zoomRedo
Definition actions.h:148
static TOOL_ACTION zoomOutHorizontally
Definition actions.h:138
static TOOL_ACTION zoomOutVertically
Definition actions.h:140
static TOOL_ACTION zoomInHorizontally
Definition actions.h:137
static TOOL_ACTION zoomFitScreen
Definition actions.h:142
static TOOL_ACTION zoomInCenter
Definition actions.h:135
static TOOL_ACTION zoomInVertically
Definition actions.h:139
static TOOL_ACTION zoomUndo
Definition actions.h:147
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
int ShowModal() override
void SetSimCommand(const wxString &aCommand)
void ApplySettings(SIM_TAB *aTab)
void SetSimOptions(int aOptions)
const wxString & GetSimCommand() const
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
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
virtual bool HasMessageOfSeverity(int aSeverityMask) const
Returns true if the reporter has one or more messages matching the specified severity mask.
Definition reporter.h:143
static TOOL_ACTION toggleSimConsole
static TOOL_ACTION exportPlotToClipboard
static TOOL_ACTION saveWorkbookAs
static TOOL_ACTION toggleSimSidePanel
static TOOL_ACTION exportPlotAsCSV
static TOOL_ACTION simAnalysisProperties
static TOOL_ACTION toggleDottedSecondary
static TOOL_ACTION simTune
static TOOL_ACTION toggleDarkModePlots
static TOOL_ACTION exportPlotAsPNG
static TOOL_ACTION exportPlotToSchematic
static TOOL_ACTION runSimulation
static TOOL_ACTION editUserDefinedSignals
static TOOL_ACTION newAnalysisTab
static TOOL_ACTION simProbe
static TOOL_ACTION showNetlist
static TOOL_ACTION openWorkbook
static TOOL_ACTION saveWorkbook
static TOOL_ACTION toggleLegend
static TOOL_ACTION stopSimulation
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 ToggleSimConsolePanel(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 ToggleSimSidePanel(const TOOL_EVENT &aEvent)
int NewAnalysisTab(const TOOL_EVENT &aEvent)
int Close(const TOOL_EVENT &aEvent)
Implement an OUTPUTFORMATTER to a memory buffer.
Definition richio.h:422
const std::string & GetString()
Definition richio.h:445
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:186
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:171
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
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).
A slimmed down version of WX_HTML_REPORT_PANEL.
A wrapper for reporting to a wxString object.
Definition reporter.h:191
const wxString & GetMessages() const
Definition reporter.cpp:78
Canvas for plotting mpLayer implementations.
Definition mathplot.h:910
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:1195
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition confirm.cpp:230
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:202
This file is part of the common library.
#define _(s)
void Reset() override
static const std::string WorkbookFileExtension
static wxString PngFileWildcard()
static wxString CsvFileWildcard()
static wxString WorkbookFileWildcard()
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:717
KICOMMON_API wxFont GetMonospacedUIFont()
Definition ui_common.cpp:93
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_UNDEFINED
SIM_TYPE
< Possible simulation types
Definition sim_types.h:32
#define MIME_BASE64_LENGTH
std::vector< FAB_LAYER_COLOR > dummy
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
std::string path
Definition of file extensions used in Kicad.
#define SEPARATOR
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition wx_filename.h:39