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, see <https://www.gnu.org/licenses/>.
18 */
19
21
22#define wxUSE_BASE64 1
23#include <wx/base64.h>
24
25#include <wx/ffile.h>
26#include <wx/filedlg.h>
27#include <wx_filename.h>
28#include <kiplatform/ui.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/sch_actions.h>
41#include <scintilla_tricks.h>
44#include <wx/clipbrd.h>
45#include <wx/dataobj.h>
46#include <wx/mstream.h>
47#include <richio.h>
48#include <string_utils.h>
49
50
52{
54 return true;
55}
56
57
59{
61
63 {
64 m_schematicFrame = m_simulatorFrame->GetSchematicFrame();
65 m_circuitModel = m_simulatorFrame->GetCircuitModel();
66 m_simulator = m_simulatorFrame->GetSimulator();
67 }
68}
69
70
72{
75
77 reporter );
78
79 if( reporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR ) )
80 {
81 DisplayErrorMessage( m_simulatorFrame, _( "Errors during netlist generation." ),
82 reporter.GetMessages() );
83 }
84 else if( reporter.HasMessageOfSeverity( RPT_SEVERITY_WARNING ) )
85 {
86 DisplayInfoMessage( m_simulatorFrame, _( "Warnings during netlist generation." ),
87 reporter.GetMessages() );
88 }
89
90 dlg.SetSimCommand( wxS( "*" ) );
92
93 if( dlg.ShowModal() == wxID_OK )
94 {
95 SIM_TAB* tab = m_simulatorFrame->NewSimTab( dlg.GetSimCommand() );
96 dlg.ApplySettings( tab );
97 m_simulatorFrame->OnModify();
98 }
99
100 return 0;
101}
102
103
105{
106 wxFileDialog openDlg( m_simulatorFrame, _( "Open Simulation Workbook" ), getDefaultPath(), "",
107 FILEEXT::WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
108
110
111 if( openDlg.ShowModal() == wxID_CANCEL )
112 return -1;
113
114 m_simulatorFrame->LoadWorkbook( openDlg.GetPath() );
115 return 0;
116}
117
118
120{
121 wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
122
123 if( filename.GetName().IsEmpty() )
124 {
125 if( m_simulatorFrame->Prj().GetProjectName().IsEmpty() )
126 {
127 filename.SetName( _( "noname" ) );
128 filename.SetExt( FILEEXT::WorkbookFileExtension );
129 }
130 else
131 {
132 filename.SetName( m_simulatorFrame->Prj().GetProjectName() );
133 filename.SetExt( FILEEXT::WorkbookFileExtension );
134 }
135 }
136
137 return filename.GetFullName();
138}
139
140
142{
143 wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
144
145 path.Normalize( FN_NORMALIZE_FLAGS|wxPATH_NORM_ENV_VARS,
146 m_simulatorFrame->Prj().GetProjectPath() );
147 return path.GetPath();
148}
149
150
152{
153 wxString filename;
154
155 if( aEvent.IsAction( &SCH_ACTIONS::saveWorkbook ) )
156 filename = m_simulator->Settings()->GetWorkbookFilename();
157
158 if( filename.IsEmpty() )
159 {
160 wxFileDialog saveAsDlg( m_simulatorFrame, _( "Save Simulation Workbook As" ),
163 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
164
166
167 if( saveAsDlg.ShowModal() == wxID_CANCEL )
168 return -1;
169
170 filename = saveAsDlg.GetPath();
171 }
172
173 m_simulatorFrame->SaveWorkbook( m_simulatorFrame->Prj().AbsolutePath( filename ) );
174 return 0;
175}
176
177
179{
180 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
181 {
182 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
183 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
184
186
187 if( saveDlg.ShowModal() == wxID_CANCEL )
188 return -1;
189
190 wxImage screenImage;
191 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
192 screenImage.SaveFile( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
193 }
194
195 return 0;
196}
197
198
200{
201 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
202 {
203 wxImage screenImage;
204 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
205
206 if( wxTheClipboard->Open() )
207 {
208 wxBitmap bm( screenImage );
209
210 wxTheClipboard->SetData( new wxBitmapDataObject( bm ) );
211 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
212 wxTheClipboard->Close();
213 }
214 }
215
216 return 0;
217}
218
219
221{
222 if( m_schematicFrame == nullptr )
223 return -1;
224
225 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
226 {
227 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
228
229 if( blocking_dialog )
230 blocking_dialog->Close( true );
231
232 wxImage screenImage;
233 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
234
235 if( wxTheClipboard->Open() )
236 {
237 // Build a PNG bitmap:
238 wxMemoryOutputStream stream;
239 screenImage.SaveFile( stream, wxBITMAP_TYPE_PNG );
240 stream.Close();
241
242 // Create a SCH_BITMAP data string
243 wxString string;
244 string << "(image (at 0 0)\n";
245 string << " (data\n";
246
247 wxMemoryBuffer buff;
248 buff.GetWriteBuf( stream.GetLength() );
249 stream.CopyTo( buff.GetData(), stream.GetLength() );
250 buff.SetDataLen( stream.GetLength() );
251
252 wxString out;
253 out << wxBase64Encode( buff );
254
255 #define MIME_BASE64_LENGTH 76
256 size_t first = 0;
257
258 while( first < out.Length() )
259 {
260 string << " \"" << TO_UTF8( out( first, MIME_BASE64_LENGTH ) );
261 string << "\"\n";
262 first += MIME_BASE64_LENGTH;
263 }
264 string << " )\n)\n";
265
266 wxTheClipboard->SetData( new wxTextDataObject( string ) );
267 wxTheClipboard->Close();
268
269 m_schematicFrame->GetToolManager()->PostAction( ACTIONS::paste );
270 m_schematicFrame->Raise();
271 }
272 }
273
274 return 0;
275}
276
277
279{
280 return m_simulatorFrame->GetCurrentSimTab();
281}
282
283
285{
286 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
287 {
288 const wxChar SEPARATOR = ';';
289
290 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot Data" ), "", "",
292 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
293
295
296 if( saveDlg.ShowModal() == wxID_CANCEL )
297 return -1;
298
299 wxFFile out( saveDlg.GetPath(), "wb" );
300
301 std::map<wxString, TRACE*> traces = plotTab->GetTraces();
302
303 if( traces.size() == 0 )
304 return -1;
305
306 SIM_TYPE simType = plotTab->GetSimType();
307
308 std::size_t rowCount = traces.begin()->second->GetDataX().size();
309
310 // write column header names on the first row
311 wxString xAxisName( m_simulator->GetXAxis( simType ) );
312 out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
313
314 for( const auto& [name, trace] : traces )
315 out.Write( wxString::Format( wxT( "%s%c" ), trace->GetDisplayName(), SEPARATOR ) );
316
317 out.Write( wxS( "\r\n" ) );
318
319 // write each row's numerical value
320 for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
321 {
322 double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
323 out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
324
325 for( const auto& [name, trace] : traces )
326 {
327 double yAxisValue = trace->GetDataY().at( curRow );
328 out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
329 }
330
331 out.Write( wxS( "\r\n" ) );
332 }
333
334 out.Close();
335 }
336
337 return 0;
338}
339
340
342{
343 m_simulatorFrame->Close();
344 return 0;
345}
346
347
349{
350 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
351 {
352 mpWindow* plot = plotTab->GetPlotWin();
353
354 if( aEvent.IsAction( &ACTIONS::zoomInCenter ) )
355 {
356 plot->ZoomIn();
357 }
358 else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) )
359 {
360 plot->ZoomOut();
361 }
362 else if( aEvent.IsAction( &ACTIONS::zoomInHorizontally ) )
363 {
364 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
365 }
366 else if( aEvent.IsAction( &ACTIONS::zoomOutHorizontally ) )
367 {
368 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
369 }
370 else if( aEvent.IsAction( &ACTIONS::zoomInVertically ) )
371 {
372 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
373 }
374 else if( aEvent.IsAction( &ACTIONS::zoomOutVertically ) )
375 {
376 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
377 }
378 else if( aEvent.IsAction( &ACTIONS::zoomFitScreen ) )
379 {
380 wxCommandEvent dummy;
381 plot->OnFit( dummy );
382 }
383 }
384
385 return 0;
386}
387
388
390{
391 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
392 plotTab->GetPlotWin()->ZoomUndo();
393
394 return 0;
395}
396
397
399{
400 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
401 plotTab->GetPlotWin()->ZoomRedo();
402
403 return 0;
404}
405
406
408{
409 if( m_simulatorFrame )
410 m_simulatorFrame->ToggleSimConsole();
411
412 return 0;
413}
414
415
417{
418 if( m_simulatorFrame )
419 m_simulatorFrame->ToggleSimSidePanel();
420
421 return 0;
422}
423
424
426{
427 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
428 {
429 plotTab->ShowGrid( !plotTab->IsGridShown() );
430 m_simulatorFrame->OnModify();
431 }
432
433 return 0;
434}
435
436
438{
439 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
440 {
441 plotTab->ShowLegend( !plotTab->IsLegendShown() );
442 m_simulatorFrame->OnModify();
443 }
444
445 return 0;
446}
447
448
450{
451 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
452 {
453 plotTab->SetDottedSecondary( !plotTab->GetDottedSecondary() );
454 m_simulatorFrame->OnModify();
455 }
456
457 return 0;
458}
459
460
462{
463 m_simulatorFrame->ToggleDarkModePlots();
464 return 0;
465}
466
467
469{
470 m_simulatorFrame->EditAnalysis();
471 return 0;
472}
473
474
476{
477 if( m_simulator->IsRunning() )
478 {
479 m_simulator->Stop();
480 return 0;
481 }
482
483 if( !getCurrentSimTab() )
484 NewAnalysisTab( aEvent );
485
486 if( !getCurrentSimTab() )
487 return 0;
488
489 m_simulatorFrame->StartSimulation();
490
491 return 0;
492}
493
494
496{
497 if( m_schematicFrame == nullptr )
498 return -1;
499
500 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
501
502 if( blocking_dialog )
503 blocking_dialog->Close( true );
504
505 m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simProbe );
506 m_schematicFrame->Raise();
507
508 return 0;
509}
510
511
513{
514 if( m_schematicFrame == nullptr )
515 return -1;
516
517 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
518
519 if( blocking_dialog )
520 blocking_dialog->Close( true );
521
522 m_schematicFrame->GetToolManager()->PostAction( SCH_ACTIONS::simTune );
523 m_schematicFrame->Raise();
524
525 return 0;
526}
527
528
530{
531public:
532 enum
533 {
535 };
536
537 void onClose( wxCloseEvent& evt )
538 {
539 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
540 }
541
542 NETLIST_VIEW_DIALOG( wxWindow* parent ) :
543 DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
544 wxSize( 800, 800 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
545 m_textCtrl( nullptr ),
546 m_reporter( nullptr )
547 {
548 m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
549 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
550
551 //Avoid the splitter window being assigned as the Parent to additional windows
552 m_splitter->SetExtraStyle( wxWS_EX_TRANSIENT );
553
554 m_textCtrl = new wxStyledTextCtrl( m_splitter, wxID_ANY );
555
556 m_textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
557 m_textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
558 m_textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
559 m_textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
560
561 wxFont fixedFont = KIUI::GetMonospacedUIFont();
562
563 for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
564 m_textCtrl->StyleSetFont( i, fixedFont );
565
566 m_textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
567
568 m_textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
569 m_textCtrl->SetLexer( wxSTC_LEX_SPICE );
570 m_textCtrl->SetMinSize( wxSize( 40, 40 ) );
571 m_textCtrl->SetSize( wxSize( 40, 40 ) );
572
573 m_reporter = new WX_HTML_REPORT_BOX( m_splitter, wxID_ANY );
574 m_reporter->SetMinSize( wxSize( 40, 40 ) );
575 m_reporter->SetSize( wxSize( 40, 40 ) );
576
577 m_splitter->SetMinimumPaneSize( 40 );
578 m_splitter->SetSashPosition( 760 );
579 m_splitter->SetSashGravity( 0.9 );
580 m_splitter->SplitHorizontally( m_textCtrl, m_reporter );
581
582 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
583 sizer->Add( m_splitter, 1, wxEXPAND | wxALL, 5 );
584 SetSizer( sizer );
585 Layout();
586
587 Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
588 nullptr, this );
589
590 m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( m_textCtrl, wxT( "{}" ), false );
591
593 }
594
595 void SetNetlist( const wxString& aSource )
596 {
597 m_textCtrl->SetText( aSource );
598 m_textCtrl->SetEditable( false );
599
600 m_reporter->Flush();
601 }
602
604
605private:
606 wxSplitterWindow* m_splitter;
607 wxStyledTextCtrl* m_textCtrl;
609
610 std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
611};
612
613
615{
616 std::map<int, wxString> userSignals = m_simulatorFrame->UserDefinedSignals();
617
619
620 // QuasiModal required for syntax help and Scintilla auto-complete
621 if( dlg.ShowQuasiModal() == wxID_OK )
622 m_simulatorFrame->SetUserDefinedSignals( userSignals );
623
624 return 0;
625}
626
627
629{
630 if( m_schematicFrame == nullptr || m_simulator == nullptr )
631 return -1;
632
633 STRING_FORMATTER formatter;
635
636 m_circuitModel->GetNetlist( m_simulatorFrame->GetCurrentSimCommand(),
637 m_simulatorFrame->GetCurrentOptions(),
638 &formatter, *dlg.GetReporter() );
639
640 dlg.SetNetlist( wxString( formatter.GetString() ) );
641 dlg.ShowModal();
642
643 return 0;
644}
645
646
648{
649 // clang-format off
658
661
675
681
684 // clang-format on
685}
const char * name
static TOOL_ACTION toggleGrid
Definition actions.h:194
static TOOL_ACTION paste
Definition actions.h:76
static TOOL_ACTION zoomOutCenter
Definition actions.h:132
static TOOL_ACTION zoomRedo
Definition actions.h:144
static TOOL_ACTION zoomOutHorizontally
Definition actions.h:134
static TOOL_ACTION zoomOutVertically
Definition actions.h:136
static TOOL_ACTION zoomInHorizontally
Definition actions.h:133
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
static TOOL_ACTION zoomInCenter
Definition actions.h:131
static TOOL_ACTION zoomInVertically
Definition actions.h:135
static TOOL_ACTION zoomUndo
Definition actions.h:143
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:71
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:418
const std::string & GetString()
Definition richio.h:441
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:182
RESET_REASON
Determine the reason of reset for a tool.
Definition tool_base.h:74
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition tool_base.h:76
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.
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:189
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:245
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
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:448
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:28
#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
IbisParser parser & reporter
Definition of file extensions used in Kicad.
#define SEPARATOR
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition wx_filename.h:35