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
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 <wx/stc/stc.h>
33
34#include <kiway.h>
35#include <confirm.h>
39#include <sch_edit_frame.h>
40#include <sim/simulator_frame.h>
41#include <sim/sim_plot_tab.h>
42#include <tool/tool_manager.h>
43#include <tools/ee_actions.h>
44#include <scintilla_tricks.h>
47#include <wx/clipbrd.h>
48#include <wx/dataobj.h>
49#include <wx/mstream.h>
50#include <richio.h>
51#include <string_utils.h>
52
53
55{
57 return true;
58}
59
60
62{
63 m_simulatorFrame = getEditFrame<SIMULATOR_FRAME>();
64
66 {
70 }
71}
72
73
75{
77 WX_STRING_REPORTER reporter;
78
80 reporter );
81
83 {
84 DisplayErrorMessage( m_simulatorFrame, _( "Errors during netlist generation." ),
85 reporter.GetMessages() );
86 }
87 else if( reporter.HasMessageOfSeverity( RPT_SEVERITY_WARNING ) )
88 {
89 DisplayInfoMessage( m_simulatorFrame, _( "Warnings during netlist generation." ),
90 reporter.GetMessages() );
91 }
92
93 dlg.SetSimCommand( wxS( "*" ) );
95
96 if( dlg.ShowModal() == wxID_OK )
97 {
99 dlg.ApplySettings( tab );
101 }
102
103 return 0;
104}
105
106
108{
109 wxFileDialog openDlg( m_simulatorFrame, _( "Open Simulation Workbook" ), getDefaultPath(), "",
110 FILEEXT::WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
111
112 if( openDlg.ShowModal() == wxID_CANCEL )
113 return -1;
114
115 m_simulatorFrame->LoadWorkbook( openDlg.GetPath() );
116 return 0;
117}
118
119
121{
122 wxFileName filename = m_simulator->Settings()->GetWorkbookFilename();
123
124 if( filename.GetName().IsEmpty() )
125 {
126 if( m_simulatorFrame->Prj().GetProjectName().IsEmpty() )
127 {
128 filename.SetName( _( "noname" ) );
129 filename.SetExt( FILEEXT::WorkbookFileExtension );
130 }
131 else
132 {
133 filename.SetName( m_simulatorFrame->Prj().GetProjectName() );
134 filename.SetExt( FILEEXT::WorkbookFileExtension );
135 }
136 }
137
138 return filename.GetFullName();
139}
140
141
143{
144 wxFileName path = m_simulator->Settings()->GetWorkbookFilename();
145
146 path.Normalize( FN_NORMALIZE_FLAGS|wxPATH_NORM_ENV_VARS,
148 return path.GetPath();
149}
150
151
153{
154 wxString filename;
155
156 if( aEvent.IsAction( &EE_ACTIONS::saveWorkbook ) )
157 filename = m_simulator->Settings()->GetWorkbookFilename();
158
159 if( filename.IsEmpty() )
160 {
161 wxFileDialog saveAsDlg( m_simulatorFrame, _( "Save Simulation Workbook As" ),
164 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
165
166 if( saveAsDlg.ShowModal() == wxID_CANCEL )
167 return -1;
168
169 filename = saveAsDlg.GetPath();
170 }
171
173 return 0;
174}
175
176
178{
179 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
180 {
181 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "",
182 FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
183
184 if( saveDlg.ShowModal() == wxID_CANCEL )
185 return -1;
186
187 wxImage screenImage;
188 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
189 screenImage.SaveFile( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
190 }
191
192 return 0;
193}
194
195
197{
198 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
199 {
200 wxImage screenImage;
201 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
202
203 if( wxTheClipboard->Open() )
204 {
205 wxBitmap bm( screenImage );
206
207 wxTheClipboard->SetData( new wxBitmapDataObject( bm ) );
208 wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
209 wxTheClipboard->Close();
210 }
211 }
212
213 return 0;
214}
215
216
218{
219 if( m_schematicFrame == nullptr )
220 return -1;
221
222 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
223 {
224 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
225
226 if( blocking_dialog )
227 blocking_dialog->Close( true );
228
229 wxImage screenImage;
230 plotTab->GetPlotWin()->SaveScreenshot( screenImage );
231
232 if( wxTheClipboard->Open() )
233 {
234 // Build a PNG bitmap:
235 wxMemoryOutputStream stream;
236 screenImage.SaveFile( stream, wxBITMAP_TYPE_PNG );
237 stream.Close();
238
239 // Create a SCH_BITMAP data string
240 wxString string;
241 string << "(image (at 0 0)\n";
242 string << " (data\n";
243
244 wxMemoryBuffer buff;
245 buff.GetWriteBuf( stream.GetLength() );
246 stream.CopyTo( buff.GetData(), stream.GetLength() );
247 buff.SetDataLen( stream.GetLength() );
248
249 wxString out;
250 out << wxBase64Encode( buff );
251
252 #define MIME_BASE64_LENGTH 76
253 size_t first = 0;
254
255 while( first < out.Length() )
256 {
257 string << " \"" << TO_UTF8( out( first, MIME_BASE64_LENGTH ) );
258 string << "\"\n";
259 first += MIME_BASE64_LENGTH;
260 }
261 string << " )\n)\n";
262
263 wxTheClipboard->SetData( new wxTextDataObject( string ) );
264 wxTheClipboard->Close();
265
267 m_schematicFrame->Raise();
268 }
269 }
270
271 return 0;
272}
273
274
276{
278}
279
280
282{
283 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
284 {
285 const wxChar SEPARATOR = ';';
286
287 wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot Data" ), "", "",
289 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
290
291 if( saveDlg.ShowModal() == wxID_CANCEL )
292 return -1;
293
294 wxFFile out( saveDlg.GetPath(), "wb" );
295
296 std::map<wxString, TRACE*> traces = plotTab->GetTraces();
297
298 if( traces.size() == 0 )
299 return -1;
300
301 SIM_TYPE simType = plotTab->GetSimType();
302
303 std::size_t rowCount = traces.begin()->second->GetDataX().size();
304
305 // write column header names on the first row
306 wxString xAxisName( m_simulator->GetXAxis( simType ) );
307 out.Write( wxString::Format( wxT( "%s%c" ), xAxisName, SEPARATOR ) );
308
309 for( const auto& [name, trace] : traces )
310 out.Write( wxString::Format( wxT( "%s%c" ), trace->GetDisplayName(), SEPARATOR ) );
311
312 out.Write( wxS( "\r\n" ) );
313
314 // write each row's numerical value
315 for ( std::size_t curRow=0; curRow < rowCount; curRow++ )
316 {
317 double xAxisValue = traces.begin()->second->GetDataX().at( curRow );
318 out.Write( wxString::Format( wxT( "%g%c" ), xAxisValue, SEPARATOR ) );
319
320 for( const auto& [name, trace] : traces )
321 {
322 double yAxisValue = trace->GetDataY().at( curRow );
323 out.Write( wxString::Format( wxT( "%g%c" ), yAxisValue, SEPARATOR ) );
324 }
325
326 out.Write( wxS( "\r\n" ) );
327 }
328
329 out.Close();
330 }
331
332 return 0;
333}
334
335
337{
338 m_simulatorFrame->Close();
339 return 0;
340}
341
342
344{
345 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
346 {
347 mpWindow* plot = plotTab->GetPlotWin();
348
349 if( aEvent.IsAction( &ACTIONS::zoomInCenter ) )
350 {
351 plot->ZoomIn();
352 }
353 else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) )
354 {
355 plot->ZoomOut();
356 }
357 else if( aEvent.IsAction( &ACTIONS::zoomInHorizontally ) )
358 {
359 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
360 }
361 else if( aEvent.IsAction( &ACTIONS::zoomOutHorizontally ) )
362 {
363 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxHORIZONTAL );
364 }
365 else if( aEvent.IsAction( &ACTIONS::zoomInVertically ) )
366 {
367 plot->ZoomIn( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
368 }
369 else if( aEvent.IsAction( &ACTIONS::zoomOutVertically ) )
370 {
371 plot->ZoomOut( wxDefaultPosition, mpWindow::zoomIncrementalFactor, wxVERTICAL );
372 }
373 else if( aEvent.IsAction( &ACTIONS::zoomFitScreen ) )
374 {
375 wxCommandEvent dummy;
376 plot->OnFit( dummy );
377 }
378 }
379
380 return 0;
381}
382
383
385{
386 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
387 plotTab->GetPlotWin()->ZoomUndo();
388
389 return 0;
390}
391
392
394{
395 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
396 plotTab->GetPlotWin()->ZoomRedo();
397
398 return 0;
399}
400
401
403{
404 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
405 {
406 plotTab->ShowGrid( !plotTab->IsGridShown() );
408 }
409
410 return 0;
411}
412
413
415{
416 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
417 {
418 plotTab->ShowLegend( !plotTab->IsLegendShown() );
420 }
421
422 return 0;
423}
424
425
427{
428 if( SIM_PLOT_TAB* plotTab = dynamic_cast<SIM_PLOT_TAB*>( getCurrentSimTab() ) )
429 {
430 plotTab->SetDottedSecondary( !plotTab->GetDottedSecondary() );
432 }
433
434 return 0;
435}
436
437
439{
441 return 0;
442}
443
444
446{
448 return 0;
449}
450
451
453{
454 if( m_simulator->IsRunning() )
455 {
456 m_simulator->Stop();
457 return 0;
458 }
459
460 if( !getCurrentSimTab() )
461 NewAnalysisTab( aEvent );
462
463 if( !getCurrentSimTab() )
464 return 0;
465
467
468 return 0;
469}
470
471
473{
474 if( m_schematicFrame == nullptr )
475 return -1;
476
477 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
478
479 if( blocking_dialog )
480 blocking_dialog->Close( true );
481
483 m_schematicFrame->Raise();
484
485 return 0;
486}
487
488
490{
491 if( m_schematicFrame == nullptr )
492 return -1;
493
494 wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
495
496 if( blocking_dialog )
497 blocking_dialog->Close( true );
498
500 m_schematicFrame->Raise();
501
502 return 0;
503}
504
505
507{
508public:
509 enum
510 {
512 };
513
514 void onClose( wxCloseEvent& evt )
515 {
516 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL ) );
517 }
518
519 NETLIST_VIEW_DIALOG( wxWindow* parent ) :
520 DIALOG_SHIM( parent, wxID_ANY, _( "SPICE Netlist" ), wxDefaultPosition,
521 wxSize( 800, 800 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
522 m_textCtrl( nullptr ),
523 m_reporter( nullptr )
524 {
525 m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
526 wxSP_LIVE_UPDATE | wxSP_NOBORDER | wxSP_3DSASH );
527
528 //Avoid the splitter window being assigned as the Parent to additional windows
529 m_splitter->SetExtraStyle( wxWS_EX_TRANSIENT );
530
531 m_textCtrl = new wxStyledTextCtrl( m_splitter, wxID_ANY );
532
533 m_textCtrl->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
534 m_textCtrl->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
535 m_textCtrl->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
536 m_textCtrl->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
537
538 wxFont fixedFont = KIUI::GetMonospacedUIFont();
539
540 for( int i = 0; i < wxSTC_STYLE_MAX; ++i )
541 m_textCtrl->StyleSetFont( i, fixedFont );
542
543 m_textCtrl->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
544
545 m_textCtrl->SetWrapMode( wxSTC_WRAP_WORD );
546 m_textCtrl->SetLexer( wxSTC_LEX_SPICE );
547 m_textCtrl->SetMinSize( wxSize( 40, 40 ) );
548 m_textCtrl->SetSize( wxSize( 40, 40 ) );
549
550 m_reporter = new WX_HTML_REPORT_BOX( m_splitter, wxID_ANY );
551 m_reporter->SetMinSize( wxSize( 40, 40 ) );
552 m_reporter->SetSize( wxSize( 40, 40 ) );
553
554 m_splitter->SetMinimumPaneSize( 40 );
555 m_splitter->SetSashPosition( 760 );
556 m_splitter->SetSashGravity( 0.9 );
557 m_splitter->SplitHorizontally( m_textCtrl, m_reporter );
558
559 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
560 sizer->Add( m_splitter, 1, wxEXPAND | wxALL, 5 );
561 SetSizer( sizer );
562 Layout();
563
564 Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ),
565 nullptr, this );
566
567 m_scintillaTricks = std::make_unique<SCINTILLA_TRICKS>( m_textCtrl, wxT( "{}" ), false );
568
570 }
571
572 void SetNetlist( const wxString& aSource )
573 {
574 m_textCtrl->SetText( aSource );
575 m_textCtrl->SetEditable( false );
576
577 m_reporter->Flush();
578 }
579
581
582private:
583 wxSplitterWindow* m_splitter;
584 wxStyledTextCtrl* m_textCtrl;
586
587 std::unique_ptr<SCINTILLA_TRICKS> m_scintillaTricks;
588};
589
590
592{
593 std::map<int, wxString> userSignals = m_simulatorFrame->UserDefinedSignals();
594
596
597 // QuasiModal required for syntax help and Scintilla auto-complete
598 if( dlg.ShowQuasiModal() == wxID_OK )
600
601 return 0;
602}
603
604
606{
607 if( m_schematicFrame == nullptr || m_simulator == nullptr )
608 return -1;
609
610 STRING_FORMATTER formatter;
612
615 &formatter, *dlg.GetReporter() );
616
617 dlg.SetNetlist( wxString( formatter.GetString() ) );
618 dlg.ShowModal();
619
620 return 0;
621}
622
623
625{
634
636
650
656
659}
const char * name
Definition: DXF_plotter.cpp:57
static TOOL_ACTION toggleGrid
Definition: actions.h:187
static TOOL_ACTION paste
Definition: actions.h:73
static TOOL_ACTION zoomOutCenter
Definition: actions.h:128
static TOOL_ACTION zoomRedo
Definition: actions.h:140
static TOOL_ACTION zoomOutHorizontally
Definition: actions.h:130
static TOOL_ACTION zoomOutVertically
Definition: actions.h:132
static TOOL_ACTION zoomInHorizontally
Definition: actions.h:129
static TOOL_ACTION quit
Definition: actions.h:59
static TOOL_ACTION zoomFitScreen
Definition: actions.h:134
static TOOL_ACTION zoomInCenter
Definition: actions.h:127
static TOOL_ACTION zoomInVertically
Definition: actions.h:131
static TOOL_ACTION zoomUndo
Definition: actions.h:139
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:88
int ShowQuasiModal()
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int ShowModal() override
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:301
static TOOL_ACTION editUserDefinedSignals
Definition: ee_actions.h:304
static TOOL_ACTION openWorkbook
Definition: ee_actions.h:288
static TOOL_ACTION stopSimulation
Definition: ee_actions.h:303
static TOOL_ACTION toggleLegend
Definition: ee_actions.h:298
static TOOL_ACTION saveWorkbook
Definition: ee_actions.h:289
static TOOL_ACTION saveWorkbookAs
Definition: ee_actions.h:290
static TOOL_ACTION exportPlotAsCSV
Definition: ee_actions.h:292
static TOOL_ACTION simTune
Definition: ee_actions.h:297
static TOOL_ACTION toggleDarkModePlots
Definition: ee_actions.h:300
static TOOL_ACTION exportPlotAsPNG
Definition: ee_actions.h:291
static TOOL_ACTION showNetlist
Definition: ee_actions.h:305
static TOOL_ACTION simProbe
Definition: ee_actions.h:296
static TOOL_ACTION toggleDottedSecondary
Definition: ee_actions.h:299
static TOOL_ACTION exportPlotToSchematic
Definition: ee_actions.h:294
static TOOL_ACTION runSimulation
Definition: ee_actions.h:302
static TOOL_ACTION newAnalysisTab
Definition: ee_actions.h:287
static TOOL_ACTION exportPlotToClipboard
Definition: ee_actions.h:293
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:359
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
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:436
const std::string & GetString()
Definition: richio.h:459
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:235
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:171
bool HasMessageOfSeverity(int aSeverityMask) const override
Returns true if the reporter has one or more messages matching the specified severity mask.
Definition: reporter.cpp:103
const wxString & GetMessages() const
Definition: reporter.cpp:84
Canvas for plotting mpLayer implementations.
Definition: mathplot.h:908
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:1193
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:222
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:195
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:92
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_UNDEFINED
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:398
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