KiCad PCB EDA Suite
SIM_PLOT_FRAME Class Reference

Implementing SIM_PLOT_FRAME_BASE. More...

#include <sim_plot_frame.h>

Inheritance diagram for SIM_PLOT_FRAME:
SIM_PLOT_FRAME_BASE KIWAY_PLAYER EDA_BASE_FRAME KIWAY_HOLDER

Classes

struct  PLOT_INFO
 
class  SIGNAL_CONTEXT_MENU
 

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL, SCREEN }
 

Public Member Functions

 SIM_PLOT_FRAME (KIWAY *aKiway, wxWindow *aParent)
 Constructor. More...
 
 ~SIM_PLOT_FRAME ()
 
void StartSimulation ()
 
void StopSimulation ()
 
bool IsSimulationRunning ()
 
SIM_PLOT_PANELNewPlotPanel (SIM_TYPE aSimType)
 Creates a new plot panel for a given simulation type and adds it to the main notebook. More...
 
void AddVoltagePlot (const wxString &aNetName)
 Adds a voltage plot for a given net name. More...
 
void AddCurrentPlot (const wxString &aDeviceName, const wxString &aParam)
 Adds a current plot for a particular device. More...
 
void AddTuner (SCH_COMPONENT *aComponent)
 Adds a tuner for a component. More...
 
void RemoveTuner (TUNER_SLIDER *aTuner, bool aErase=true)
 Removes an existing tuner. More...
 
SIM_PLOT_PANELCurrentPlot () const
 Returns the currently opened plot panel (or NULL if there is none). More...
 
const NETLIST_EXPORTER_PSPICE_SIMGetExporter () const
 Returns the netlist exporter object used for simulations. More...
 
void m_splitterLeftRightOnIdle (wxIdleEvent &)
 
void m_splitterPlotAndConsoleOnIdle (wxIdleEvent &)
 
void m_splitterSignalsOnIdle (wxIdleEvent &)
 
void m_splitterTuneValuesOnIdle (wxIdleEvent &)
 
virtual bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList. More...
 
virtual bool ShowModal (wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
 Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Function KiwayMailIn receives KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool IsModal ()
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). More...
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
EDA_UNITS_T GetUserUnits () const
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS_T aUnits)
 
void ChangeUserUnits (EDA_UNITS_T aUnits)
 
TOOL_MANAGERGetToolManager () const
 Return the MVC controller. More...
 
virtual void PushTool (const std::string &actionName)
 NB: the definition of "tool" is different at the user level. More...
 
virtual void PopTool (const std::string &actionName)
 
bool ToolStackIsEmpty ()
 
std::string CurrentToolName () const
 
bool IsCurrentTool (const TOOL_ACTION &aAction) const
 
virtual void DisplayToolMsg (const wxString &msg)
 
bool GetDoImmediateActions () const
 Indicates that hotkeys should perform an immediate action even if another tool is currently active. More...
 
bool GetDragSelects () const
 Indicates that a drag should draw a selection rectangle, even when started over an item. More...
 
bool GetMoveWarpsCursor () const
 Indicates that a move operation should warp the mouse pointer to the origin of the move object. More...
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
virtual void OnCharHook (wxKeyEvent &event)
 Capture the key event before it is sent to the GUI. More...
 
void OnMenuOpen (wxMenuEvent &event)
 Workaround some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 
void OnKicadAbout (wxCommandEvent &event)
 
void OnPreferences (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
virtual wxConfigBase * config ()
 Returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual void InstallPreferences (PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
 Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
wxString ConfigBaseName ()
 
virtual void SaveProjectSettings (bool aAskForSave)
 Save changes to the project settings to the project (.pro) file. More...
 
void ImportHotkeyConfigFromFile (std::map< std::string, TOOL_ACTION * > aActionMap, const wxString &aDefaultShortname)
 Prompt the user for a hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=NULL)
 Fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, FILE_HISTORY *aFileHistory=NULL)
 Update the list of recently opened files. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual void ReCreateMenuBar ()
 Recreates the menu bar. More...
 
void AddStandardHelpMenu (wxMenuBar *aMenuBar)
 Adds the standard KiCad help menu to the menubar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void UpdateStatusBar ()
 Update the status bar information. More...
 
virtual void SyncToolbars ()
 Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state. More...
 
virtual void ShowChangedLanguage ()
 Redraw the menus and what not in current language. More...
 
virtual void CommonSettingsChanged (bool aEnvVarsChanged)
 Notification event that some of the common (suite-wide) settings have changed. More...
 
virtual void RefreshCanvas ()
 Notification to refresh the drawing canvas (if any). More...
 
const wxString & GetAboutTitle () const
 
HOLDER_TYPE GetType ()
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Member Functions

void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 Function language_change is an event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual void unitsChangeRefresh ()
 Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 

Static Protected Member Functions

static wxString GetBackupSuffix ()
 
static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

wxMenuBar * m_mainMenu
 
wxMenu * m_fileMenu
 
wxMenu * m_simulationMenu
 
wxMenuItem * m_runSimulation
 
wxMenuItem * m_addSignals
 
wxMenuItem * m_probeSignals
 
wxMenuItem * m_tuneValue
 
wxMenuItem * m_showNetlist
 
wxMenuItem * m_settings
 
wxMenu * m_viewMenu
 
wxBoxSizer * m_sizerMain
 
wxToolBar * m_toolBar
 
wxSplitterWindow * m_splitterLeftRight
 
wxPanel * m_panelLeft
 
wxBoxSizer * m_sizer11
 
wxSplitterWindow * m_splitterPlotAndConsole
 
wxPanel * m_plotPanel
 
wxBoxSizer * m_sizerPlot
 
wxAuiNotebook * m_plotNotebook
 
wxPanel * m_welcomePanel
 
wxBoxSizer * m_sizer8
 
wxStaticText * m_staticTextInfo
 
wxPanel * m_panelConsole
 
wxBoxSizer * m_sizerConsole
 
wxTextCtrl * m_simConsole
 
wxPanel * m_sidePanel
 
wxBoxSizer * m_sideSizer
 
wxSplitterWindow * m_splitterSignals
 
wxPanel * m_panelSignals
 
wxStaticText * m_staticText2
 
wxListView * m_signals
 
wxPanel * m_panelCursorsAndTune
 
wxSplitterWindow * m_splitterTuneValues
 
wxPanel * m_panelCursors
 
wxStaticText * m_staticText3
 
wxListCtrl * m_cursors
 
wxPanel * m_tunePanel
 
wxStaticText * m_staticText4
 
wxBoxSizer * m_tuneSizer
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_Ident
 
wxPoint m_FramePos
 
wxSize m_FrameSize
 
wxString m_AboutTitle
 
wxAuiManager m_auimgr
 
wxString m_configName
 
TOOL_MANAGERm_toolManager
 
ACTIONSm_actions
 
std::vector< std::string > m_toolStack
 
bool m_immediateActions
 
bool m_dragSelects
 
bool m_moveWarpsCursor
 
bool m_hasAutoSave
 
bool m_autoSaveState
 
int m_autoSaveInterval
 
wxTimer * m_autoSaveTimer
 
wxString m_perspective
 
wxString m_mruPath
 
EDA_UNITS_T m_userUnits
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 

Default style flags used for wxAUI toolbars

More...
 

Private Types

typedef std::map< wxString, TRACE_DESCTRACE_MAP
 

Private Member Functions

void LoadSettings (wxConfigBase *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void SaveSettings (wxConfigBase *aCfg) override
 Saves common frame parameters to a configuration data file. More...
 
void setIconsForMenuItems ()
 Give icons to menuitems of the main menubar. More...
 
void addPlot (const wxString &aName, SIM_PLOT_TYPE aType, const wxString &aParam)
 Adds a new plot to the current panel. More...
 
void removePlot (const wxString &aPlotName, bool aErase=true)
 Removes a plot with a specific title. More...
 
void updateNetlistExporter ()
 Reloads the current schematic for the netlist exporter. More...
 
bool updatePlot (const TRACE_DESC &aDescriptor, SIM_PLOT_PANEL *aPanel)
 Updates plot in a particular SIM_PLOT_PANEL. More...
 
void updateSignalList ()
 Updates the list of currently plotted signals. More...
 
void updateCursors ()
 Updates the cursor values list. More...
 
void updateTuners ()
 Filters out tuners for components that do not exist anymore. More...
 
void applyTuners ()
 Applies component values specified using tunder sliders to the current netlist. More...
 
bool loadWorkbook (const wxString &aPath)
 Loads plot settings from a file. More...
 
bool saveWorkbook (const wxString &aPath)
 Saves plot settings to a file. More...
 
SIM_PLOT_TYPE GetXAxisType (SIM_TYPE aType) const
 Returns X axis for a given simulation type. More...
 
void menuNewPlot (wxCommandEvent &aEvent) override
 
void menuOpenWorkbook (wxCommandEvent &event) override
 
void menuSaveWorkbook (wxCommandEvent &event) override
 
void menuExit (wxCommandEvent &event) override
 
void menuSaveImage (wxCommandEvent &event) override
 
void menuSaveCsv (wxCommandEvent &event) override
 
void menuZoomIn (wxCommandEvent &event) override
 
void menuZoomOut (wxCommandEvent &event) override
 
void menuZoomFit (wxCommandEvent &event) override
 
void menuShowGrid (wxCommandEvent &event) override
 
void menuShowGridUpdate (wxUpdateUIEvent &event) override
 
void menuShowLegend (wxCommandEvent &event) override
 
void menuShowLegendUpdate (wxUpdateUIEvent &event) override
 
void onPlotChanged (wxAuiNotebookEvent &event) override
 
void onPlotClose (wxAuiNotebookEvent &event) override
 
void onSignalDblClick (wxMouseEvent &event) override
 
void onSignalRClick (wxListEvent &event) override
 
void onSimulate (wxCommandEvent &event)
 
void onSettings (wxCommandEvent &event)
 
void onAddSignal (wxCommandEvent &event)
 
void onProbe (wxCommandEvent &event)
 
void onTune (wxCommandEvent &event)
 
void onShowNetlist (wxCommandEvent &event)
 
void onClose (wxCloseEvent &aEvent)
 
void onCursorUpdate (wxCommandEvent &aEvent)
 
void onSimUpdate (wxCommandEvent &aEvent)
 
void onSimReport (wxCommandEvent &aEvent)
 
void onSimStarted (wxCommandEvent &aEvent)
 
void onSimFinished (wxCommandEvent &aEvent)
 
void setSubWindowsSashSize ()
 

Private Attributes

wxToolBarToolBase * m_toolSimulate
 
wxToolBarToolBase * m_toolAddSignals
 
wxToolBarToolBase * m_toolProbe
 
wxToolBarToolBase * m_toolTune
 
wxToolBarToolBase * m_toolSettings
 
SCH_EDIT_FRAMEm_schematicFrame
 
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIMm_exporter
 
std::shared_ptr< SPICE_SIMULATORm_simulator
 
SIM_THREAD_REPORTERm_reporter
 
std::map< SIM_PLOT_PANEL *, PLOT_INFOm_plots
 

Map of plot panels and associated data

More...
 
std::list< TUNER_SLIDER * > m_tuners
 

List of currently displayed tuners

More...
 
DIALOG_SIM_SETTINGSm_settingsDlg
 
SIM_PLOT_PANELm_lastSimPlot
 

Panel that was used as the most recent one for simulations

More...
 
wxImageList * m_signalsIconColorList
 

imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the corresponding signal traces

More...
 
int m_splitterLeftRightSashPosition
 
int m_splitterPlotAndConsoleSashPosition
 
int m_splitterSignalsSashPosition
 
int m_splitterTuneValuesSashPosition
 

Static Private Attributes

static wxString m_savedWorkbooksPath
 

A string to store the path of saved workbooks during a session

More...
 

Detailed Description

Implementing SIM_PLOT_FRAME_BASE.

Definition at line 109 of file sim_plot_frame.h.

Member Typedef Documentation

◆ TRACE_MAP

typedef std::map<wxString, TRACE_DESC> SIM_PLOT_FRAME::TRACE_MAP
private

Definition at line 301 of file sim_plot_frame.h.

Member Enumeration Documentation

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 
SCREEN 

Definition at line 42 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ SIM_PLOT_FRAME()

SIM_PLOT_FRAME::SIM_PLOT_FRAME ( KIWAY aKiway,
wxWindow *  aParent 
)

Constructor.

Definition at line 119 of file sim_plot_frame.cpp.

120  : SIM_PLOT_FRAME_BASE( aParent ), m_lastSimPlot( nullptr )
121 {
122  SetKiway( this, aKiway );
123  m_signalsIconColorList = NULL;
124 
126 
127  if( m_schematicFrame == NULL )
128  throw std::runtime_error( "There is no schematic window" );
129 
130  // Give an icon
131  wxIcon icon;
132  icon.CopyFromBitmap( KiBitmap( simulator_xpm ) );
133  SetIcon( icon );
134 
135  // Gives a minimal size
136  SetSizeHints( 500, 400, -1, -1, -1, -1 );
137 
138  // Get the previous size and position of windows:
139  LoadSettings( config() );
140 
141  // Give icons to menuitems
143 
145 
146  if( !m_simulator )
147  {
148  throw std::runtime_error( "Could not create simulator instance" );
149  return;
150  }
151 
152  m_simulator->Init();
153 
154  if( m_savedWorkbooksPath.IsEmpty() )
155  {
157  }
158 
159  m_reporter = new SIM_THREAD_REPORTER( this );
160  m_simulator->SetReporter( m_reporter );
161 
163 
164  Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SIM_PLOT_FRAME::onClose ), NULL, this );
165  Connect( EVT_SIM_UPDATE, wxCommandEventHandler( SIM_PLOT_FRAME::onSimUpdate ), NULL, this );
166  Connect( EVT_SIM_REPORT, wxCommandEventHandler( SIM_PLOT_FRAME::onSimReport ), NULL, this );
167  Connect( EVT_SIM_STARTED, wxCommandEventHandler( SIM_PLOT_FRAME::onSimStarted ), NULL, this );
168  Connect( EVT_SIM_FINISHED, wxCommandEventHandler( SIM_PLOT_FRAME::onSimFinished ), NULL, this );
169  Connect( EVT_SIM_CURSOR_UPDATE, wxCommandEventHandler( SIM_PLOT_FRAME::onCursorUpdate ), NULL, this );
170 
171  // Toolbar buttons
172  m_toolSimulate = m_toolBar->AddTool( ID_SIM_RUN, _( "Run/Stop Simulation" ),
173  KiBitmap( sim_run_xpm ), _( "Run Simulation" ), wxITEM_NORMAL );
174  m_toolAddSignals = m_toolBar->AddTool( ID_SIM_ADD_SIGNALS, _( "Add Signals" ),
175  KiBitmap( sim_add_signal_xpm ), _( "Add signals to plot" ), wxITEM_NORMAL );
176  m_toolProbe = m_toolBar->AddTool( ID_SIM_PROBE, _( "Probe" ),
177  KiBitmap( sim_probe_xpm ), _( "Probe signals on the schematic" ), wxITEM_NORMAL );
178  m_toolTune = m_toolBar->AddTool( ID_SIM_TUNE, _( "Tune" ),
179  KiBitmap( sim_tune_xpm ), _( "Tune component values" ), wxITEM_NORMAL );
180  m_toolSettings = m_toolBar->AddTool( wxID_ANY, _( "Settings" ),
181  KiBitmap( sim_settings_xpm ), _( "Simulation settings" ), wxITEM_NORMAL );
182 
183  Connect( m_toolSimulate->GetId(), wxEVT_COMMAND_TOOL_CLICKED,
184  wxCommandEventHandler( SIM_PLOT_FRAME::onSimulate ), NULL, this );
185  Connect( m_toolAddSignals->GetId(), wxEVT_COMMAND_TOOL_CLICKED,
186  wxCommandEventHandler( SIM_PLOT_FRAME::onAddSignal ), NULL, this );
187  Connect( m_toolProbe->GetId(), wxEVT_COMMAND_TOOL_CLICKED,
188  wxCommandEventHandler( SIM_PLOT_FRAME::onProbe ), NULL, this );
189  Connect( m_toolTune->GetId(), wxEVT_COMMAND_TOOL_CLICKED,
190  wxCommandEventHandler( SIM_PLOT_FRAME::onTune ), NULL, this );
191  Connect( m_toolSettings->GetId(), wxEVT_COMMAND_TOOL_CLICKED,
192  wxCommandEventHandler( SIM_PLOT_FRAME::onSettings ), NULL, this );
193 
194  // Bind toolbar buttons event to existing menu event handlers, so they behave the same
195  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onSimulate, this, m_runSimulation->GetId() );
196  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onAddSignal, this, m_addSignals->GetId() );
197  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onProbe, this, m_probeSignals->GetId() );
198  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onTune, this, m_tuneValue->GetId() );
199  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onShowNetlist, this, m_showNetlist->GetId() );
200  Bind( wxEVT_COMMAND_MENU_SELECTED, &SIM_PLOT_FRAME::onSettings, this, m_settings->GetId() );
201 
202  m_toolBar->Realize();
203  m_plotNotebook->SetPageText( 0, _( "Welcome!" ) );
204 
205  // the settings dialog will be created later, on demand.
206  // if created in the ctor, for some obscure reason, there is an issue
207  // on Windows: when open it, the simulator frame is sent to the background.
208  // instead of being behind the dialog frame (as it does)
209  m_settingsDlg = NULL;
210 
211  // resize the subwindows size. At least on Windows, calling wxSafeYield before
212  // resizing the subwindows forces the wxSplitWindows size events automatically generated
213  // by wxWidgets to be executed before our resize code.
214  // Otherwise, the changes made by setSubWindowsSashSize are overwritten by one these
215  // events
216  wxSafeYield();
218 }
void onAddSignal(wxCommandEvent &event)
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
Function SetKiway.
wxToolBarToolBase * m_toolProbe
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
void setIconsForMenuItems()
Give icons to menuitems of the main menubar.
void onSimStarted(wxCommandEvent &aEvent)
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
wxImageList * m_signalsIconColorList
imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the ...
virtual wxConfigBase * config()
Returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
Schematic editor (Eeschema) main window.
void onSimUpdate(wxCommandEvent &aEvent)
SIM_THREAD_REPORTER * m_reporter
std::shared_ptr< SPICE_SIMULATOR > m_simulator
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
wxAuiNotebook * m_plotNotebook
SCH_EDIT_FRAME * m_schematicFrame
void setSubWindowsSashSize()
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
SIM_PLOT_PANEL * m_lastSimPlot
Panel that was used as the most recent one for simulations
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:341
wxMenuItem * m_runSimulation
void onSimReport(wxCommandEvent &aEvent)
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void onSimFinished(wxCommandEvent &aEvent)
void onShowNetlist(wxCommandEvent &event)
wxToolBarToolBase * m_toolAddSignals
static std::shared_ptr< SPICE_SIMULATOR > CreateInstance(const std::string &aName)
Creates a simulator instance of particular type (currently only ngspice is handled)
#define _(s)
void onTune(wxCommandEvent &event)
wxToolBarToolBase * m_toolSimulate
static wxString m_savedWorkbooksPath
A string to store the path of saved workbooks during a session
void onCursorUpdate(wxCommandEvent &aEvent)
DIALOG_SIM_SETTINGS * m_settingsDlg
void updateNetlistExporter()
Reloads the current schematic for the netlist exporter.
void onSimulate(wxCommandEvent &event)
void onProbe(wxCommandEvent &event)
SIM_PLOT_FRAME_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Spice Simulator"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString &name=wxT("SIM_PLOT_FRAME"))
void onSettings(wxCommandEvent &event)
void onClose(wxCloseEvent &aEvent)
wxToolBarToolBase * m_toolTune
wxToolBarToolBase * m_toolSettings

References _, EDA_BASE_FRAME::config(), SPICE_SIMULATOR::CreateInstance(), FRAME_SCH, PROJECT::GetProjectPath(), ID_SIM_ADD_SIGNALS, ID_SIM_PROBE, ID_SIM_RUN, ID_SIM_TUNE, KiBitmap(), KIWAY_HOLDER::Kiway(), LoadSettings(), SIM_PLOT_FRAME_BASE::m_addSignals, SIM_PLOT_FRAME_BASE::m_plotNotebook, SIM_PLOT_FRAME_BASE::m_probeSignals, m_reporter, SIM_PLOT_FRAME_BASE::m_runSimulation, m_savedWorkbooksPath, m_schematicFrame, SIM_PLOT_FRAME_BASE::m_settings, m_settingsDlg, SIM_PLOT_FRAME_BASE::m_showNetlist, m_signalsIconColorList, m_simulator, m_toolAddSignals, SIM_PLOT_FRAME_BASE::m_toolBar, m_toolProbe, m_toolSettings, m_toolSimulate, m_toolTune, SIM_PLOT_FRAME_BASE::m_tuneValue, onAddSignal(), onClose(), onCursorUpdate(), onProbe(), onSettings(), onShowNetlist(), onSimFinished(), onSimReport(), onSimStarted(), onSimulate(), onSimUpdate(), onTune(), KIWAY::Player(), KIWAY_HOLDER::Prj(), setIconsForMenuItems(), KIWAY_HOLDER::SetKiway(), setSubWindowsSashSize(), and updateNetlistExporter().

◆ ~SIM_PLOT_FRAME()

SIM_PLOT_FRAME::~SIM_PLOT_FRAME ( )

Definition at line 221 of file sim_plot_frame.cpp.

222 {
223  m_simulator->SetReporter( nullptr );
224  delete m_reporter;
225  delete m_signalsIconColorList;
226 
227  if( m_settingsDlg )
228  m_settingsDlg->Destroy();
229 }
wxImageList * m_signalsIconColorList
imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the ...
SIM_THREAD_REPORTER * m_reporter
std::shared_ptr< SPICE_SIMULATOR > m_simulator
DIALOG_SIM_SETTINGS * m_settingsDlg

References m_reporter, m_settingsDlg, m_signalsIconColorList, and m_simulator.

Member Function Documentation

◆ AddCurrentPlot()

void SIM_PLOT_FRAME::AddCurrentPlot ( const wxString &  aDeviceName,
const wxString &  aParam 
)

Adds a current plot for a particular device.

Parameters
aDeviceNameis the device name (e.g. R1, C1).
aParamis the current type (e.g. I, Ic, Id).

Definition at line 422 of file sim_plot_frame.cpp.

423 {
424  addPlot( aDeviceName, SPT_CURRENT, aParam );
425 }
void addPlot(const wxString &aName, SIM_PLOT_TYPE aType, const wxString &aParam)
Adds a new plot to the current panel.

References addPlot(), and SPT_CURRENT.

Referenced by DIALOG_SIGNAL_LIST::addSignalToPlotFrame().

◆ addPlot()

void SIM_PLOT_FRAME::addPlot ( const wxString &  aName,
SIM_PLOT_TYPE  aType,
const wxString &  aParam 
)
private

Adds a new plot to the current panel.

Parameters
aNameis the device/net name.
aTypedescribes the type of plot.
aParamis the parameter for the device/net (e.g. I, Id, V).

Definition at line 492 of file sim_plot_frame.cpp.

493 {
494  SIM_TYPE simType = m_exporter->GetSimType();
495 
496  if( simType == ST_UNKNOWN )
497  {
498  m_simConsole->AppendText( _( "Error: simulation type not defined!\n" ) );
499  m_simConsole->SetInsertionPointEnd();
500  return;
501  }
502  else if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
503  {
504  m_simConsole->AppendText( _( "Error: simulation type doesn't support plotting!\n" ) );
505  m_simConsole->SetInsertionPointEnd();
506  return;
507  }
508 
509  // Create a new plot if the current one displays a different type
510  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
511 
512  if( !plotPanel || plotPanel->GetType() != simType )
513  plotPanel = NewPlotPanel( simType );
514 
515  TRACE_DESC descriptor( *m_exporter, aName, aType, aParam );
516 
517  bool updated = false;
518  SIM_PLOT_TYPE xAxisType = GetXAxisType( simType );
519 
520  if( xAxisType == SPT_LIN_FREQUENCY || xAxisType == SPT_LOG_FREQUENCY )
521  {
522  int baseType = descriptor.GetType() & ~( SPT_AC_MAG | SPT_AC_PHASE );
523 
524  // Add two plots: magnitude & phase
525  TRACE_DESC mag_desc( *m_exporter, descriptor, (SIM_PLOT_TYPE)( baseType | SPT_AC_MAG ) );
526  TRACE_DESC phase_desc( *m_exporter, descriptor, (SIM_PLOT_TYPE)( baseType | SPT_AC_PHASE ) );
527 
528  updated |= updatePlot( mag_desc, plotPanel );
529  updated |= updatePlot( phase_desc, plotPanel );
530  }
531  else
532  {
533  updated = updatePlot( descriptor, plotPanel );
534  }
535 
536  if( updated )
537  {
539  }
540 }
static bool IsPlottable(SIM_TYPE aSimType)
Trace descriptor class
bool updatePlot(const TRACE_DESC &aDescriptor, SIM_PLOT_PANEL *aPanel)
Updates plot in a particular SIM_PLOT_PANEL.
SIM_PLOT_TYPE GetXAxisType(SIM_TYPE aType) const
Returns X axis for a given simulation type.
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
#define _(s)
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
void updateSignalList()
Updates the list of currently plotted signals.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
SIM_TYPE GetType() const
SIM_PLOT_TYPE
Possible plot types
Definition: sim_types.h:35
SIM_PLOT_PANEL * NewPlotPanel(SIM_TYPE aSimType)
Creates a new plot panel for a given simulation type and adds it to the main notebook.

References _, CurrentPlot(), TRACE_DESC::GetType(), SIM_PLOT_PANEL::GetType(), GetXAxisType(), SIM_PLOT_PANEL::IsPlottable(), m_exporter, SIM_PLOT_FRAME_BASE::m_simConsole, NewPlotPanel(), SPT_AC_MAG, SPT_AC_PHASE, SPT_LIN_FREQUENCY, SPT_LOG_FREQUENCY, ST_UNKNOWN, updatePlot(), and updateSignalList().

Referenced by AddCurrentPlot(), AddVoltagePlot(), and loadWorkbook().

◆ AddStandardHelpMenu()

void EDA_BASE_FRAME::AddStandardHelpMenu ( wxMenuBar *  aMenuBar)
inherited

Adds the standard KiCad help menu to the menubar.

Definition at line 366 of file eda_base_frame.cpp.

367 {
368  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
369  ACTION_MENU* helpMenu = new ACTION_MENU( false );
370 
371  helpMenu->SetTool( commonControl );
372 
373  helpMenu->Add( ACTIONS::help );
374  helpMenu->Add( ACTIONS::gettingStarted );
375  helpMenu->Add( ACTIONS::listHotKeys );
376  helpMenu->Add( ACTIONS::getInvolved );
377 
378  helpMenu->AppendSeparator();
379  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, about_xpm );
380 
381  aMenuBar->Append( helpMenu, _( "&Help" ) );
382 }
static TOOL_ACTION listHotKeys
Definition: actions.h:167
Class ACTION_MENU.
Definition: action_menu.h:43
Class COMMON_CONTROL.
#define _(s)
static TOOL_ACTION help
Definition: actions.h:166
TOOL_MANAGER * m_toolManager
static TOOL_ACTION getInvolved
Definition: actions.h:168
static TOOL_ACTION gettingStarted
Definition: actions.h:165

References _, ACTIONS::getInvolved, ACTIONS::gettingStarted, TOOL_MANAGER::GetTool(), ACTIONS::help, ACTIONS::listHotKeys, and EDA_BASE_FRAME::m_toolManager.

Referenced by EDA_3D_VIEWER::CreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), LIB_VIEW_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), and PCB_EDIT_FRAME::ReCreateMenuBar().

◆ AddTuner()

void SIM_PLOT_FRAME::AddTuner ( SCH_COMPONENT aComponent)

Adds a tuner for a component.

Definition at line 428 of file sim_plot_frame.cpp.

429 {
430  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
431 
432  if( !plotPanel )
433  return;
434 
435  // For now limit the tuner tool to RLC components
436  char primitiveType = NETLIST_EXPORTER_PSPICE::GetSpiceField( SF_PRIMITIVE, aComponent, 0 )[0];
437 
438  if( primitiveType != SP_RESISTOR && primitiveType != SP_CAPACITOR && primitiveType != SP_INDUCTOR )
439  return;
440 
441  const wxString componentName = aComponent->GetField( REFERENCE )->GetText();
442 
443  // Do not add multiple instances for the same component
444  auto tunerIt = std::find_if( m_tuners.begin(), m_tuners.end(), [&]( const TUNER_SLIDER* t )
445  {
446  return t->GetComponentName() == componentName;
447  }
448  );
449 
450  if( tunerIt != m_tuners.end() )
451  return; // We already have it
452 
453  try
454  {
455  TUNER_SLIDER* tuner = new TUNER_SLIDER( this, m_tunePanel, aComponent );
456  m_tuneSizer->Add( tuner );
457  m_tuners.push_back( tuner );
458  m_tunePanel->Layout();
459  }
460  catch( const KI_PARAM_ERROR& e )
461  {
462  // Sorry, no bonus
463  DisplayError( nullptr, e.What() );
464  }
465 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
std::list< TUNER_SLIDER * > m_tuners
List of currently displayed tuners
Field Reference of part, i.e. "IC21".
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
const wxString What() const
Definition: ki_exception.h:58
static wxString GetSpiceField(SPICE_FIELD aField, SCH_COMPONENT *aComponent, unsigned aCtl)
Retrieves either the requested field value or the default value.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
Custom widget to handle quick component values modification and simulation on the fly.
Definition: tuner_slider.h:40
virtual const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:124
class KI_PARAM_ERROR is a class used to hold a translatable error message and may be used when throwi...
Definition: ki_exception.h:45

References CurrentPlot(), DisplayError(), SCH_COMPONENT::GetField(), NETLIST_EXPORTER_PSPICE::GetSpiceField(), EDA_TEXT::GetText(), SIM_PLOT_FRAME_BASE::m_tunePanel, m_tuners, SIM_PLOT_FRAME_BASE::m_tuneSizer, REFERENCE, SF_PRIMITIVE, SP_CAPACITOR, SP_INDUCTOR, SP_RESISTOR, and KI_PARAM_ERROR::What().

◆ AddVoltagePlot()

void SIM_PLOT_FRAME::AddVoltagePlot ( const wxString &  aNetName)

Adds a voltage plot for a given net name.

Parameters
aNetNameis the net name for which a voltage plot should be created.

Definition at line 416 of file sim_plot_frame.cpp.

417 {
418  addPlot( aNetName, SPT_VOLTAGE, "V" );
419 }
void addPlot(const wxString &aName, SIM_PLOT_TYPE aType, const wxString &aParam)
Adds a new plot to the current panel.

References addPlot(), and SPT_VOLTAGE.

Referenced by DIALOG_SIGNAL_LIST::addSelectionToPlotFrame(), and DIALOG_SIGNAL_LIST::addSignalToPlotFrame().

◆ applyTuners()

void SIM_PLOT_FRAME::applyTuners ( )
private

Applies component values specified using tunder sliders to the current netlist.

Todo:
no ngspice hardcoding

Definition at line 786 of file sim_plot_frame.cpp.

787 {
788  for( auto& tuner : m_tuners )
789  {
791  std::string command( "alter @" + tuner->GetSpiceName()
792  + "=" + tuner->GetValue().ToSpiceString() );
793 
794  m_simulator->Command( command );
795  }
796 }
std::list< TUNER_SLIDER * > m_tuners
List of currently displayed tuners
std::shared_ptr< SPICE_SIMULATOR > m_simulator

References m_simulator, and m_tuners.

Referenced by onSimUpdate(), and StartSimulation().

◆ ChangeUserUnits()

void EDA_BASE_FRAME::ChangeUserUnits ( EDA_UNITS_T  aUnits)
inlineinherited

Definition at line 214 of file eda_base_frame.h.

215  {
216  SetUserUnits( aUnits );
218  }
void SetUserUnits(EDA_UNITS_T aUnits)
virtual void unitsChangeRefresh()
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...

References EDA_BASE_FRAME::SetUserUnits(), and EDA_BASE_FRAME::unitsChangeRefresh().

Referenced by COMMON_TOOLS::ImperialUnits(), COMMON_TOOLS::MetricUnits(), and COMMON_TOOLS::ToggleUnits().

◆ CheckForAutoSaveFile()

void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName)
inherited

Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 689 of file eda_base_frame.cpp.

690 {
691  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
692 
693  wxFileName autoSaveFileName = aFileName;
694 
695  // Check for auto save file.
696  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
697 
698  wxLogTrace( traceAutoSave,
699  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
700 
701  if( !autoSaveFileName.FileExists() )
702  return;
703 
704  wxString msg = wxString::Format( _(
705  "Well this is potentially embarrassing!\n"
706  "It appears that the last time you were editing the file\n"
707  "\"%s\"\n"
708  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
709  GetChars( aFileName.GetFullName() )
710  );
711 
712  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
713 
714  // Make a backup of the current file, delete the file, and rename the auto save file to
715  // the file name.
716  if( response == wxYES )
717  {
718  // Get the backup file name.
719  wxFileName backupFileName = aFileName;
720  backupFileName.SetExt( aFileName.GetExt() + GetBackupSuffix() );
721 
722  // If an old backup file exists, delete it. If an old copy of the file exists, rename
723  // it to the backup file name
724  if( aFileName.FileExists() )
725  {
726  // Rename the old file to the backup file name.
727  if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath(), true ) )
728  {
729  msg.Printf( _( "Could not create backup file \"%s\"" ),
730  GetChars( backupFileName.GetFullPath() ) );
731  wxMessageBox( msg );
732  }
733  }
734 
735  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
736  {
737  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
738  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
739  }
740  }
741  else
742  {
743  wxLogTrace( traceAutoSave,
744  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
745 
746  // Remove the auto save file when using the previous file as is.
747  wxRemoveFile( autoSaveFileName.GetFullPath() );
748  }
749 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
static wxString GetBackupSuffix()
#define _(s)
static wxString GetAutoSaveFilePrefix()
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References _, Format(), EDA_BASE_FRAME::GetAutoSaveFilePrefix(), EDA_BASE_FRAME::GetBackupSuffix(), GetChars(), Pgm(), and traceAutoSave.

Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ CommonSettingsChanged()

void EDA_BASE_FRAME::CommonSettingsChanged ( bool  aEnvVarsChanged)
virtualinherited

Notification event that some of the common (suite-wide) settings have changed.

Update menus, toolbars, local variables, etc.

Reimplemented in SCH_EDIT_FRAME, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, PCB_BASE_FRAME, FOOTPRINT_EDIT_FRAME, EDA_3D_VIEWER, KICAD_MANAGER_FRAME, EDA_DRAW_FRAME, FOOTPRINT_VIEWER_FRAME, and LIB_VIEW_FRAME.

Definition at line 395 of file eda_base_frame.cpp.

396 {
397  if( GetToolManager() )
399 
400  if( GetMenuBar() )
401  {
402  // For icons in menus, icon scaling & hotkeys
403  ReCreateMenuBar();
404  GetMenuBar()->Refresh();
405  }
406 
407  wxConfigBase* settings = Pgm().CommonSettings();
408 
409  settings->Read( WARP_MOUSE_ON_MOVE_KEY, &m_moveWarpsCursor );
410  settings->Read( PREFER_SELECT_TO_DRAG_KEY, &m_dragSelects );
411  settings->Read( IMMEDIATE_ACTIONS_KEY, &m_immediateActions );
412 }
#define IMMEDIATE_ACTIONS_KEY
Definition: pgm_base.h:58
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
#define PREFER_SELECT_TO_DRAG_KEY
Definition: pgm_base.h:59
void UpdateHotKeys(bool aFullUpdate)
Function UpdateHotKeys() Optionally reads the hotkey config files and then rebuilds the internal hotk...
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:194
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:163
#define WARP_MOUSE_ON_MOVE_KEY
Definition: pgm_base.h:57
virtual void ReCreateMenuBar()
Recreates the menu bar.

References PGM_BASE::CommonSettings(), TOOL_MANAGER::GetActionManager(), EDA_BASE_FRAME::GetToolManager(), IMMEDIATE_ACTIONS_KEY, EDA_BASE_FRAME::m_dragSelects, EDA_BASE_FRAME::m_immediateActions, EDA_BASE_FRAME::m_moveWarpsCursor, Pgm(), PREFER_SELECT_TO_DRAG_KEY, EDA_BASE_FRAME::ReCreateMenuBar(), ACTION_MANAGER::UpdateHotKeys(), and WARP_MOUSE_ON_MOVE_KEY.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged(), EDA_3D_VIEWER::CommonSettingsChanged(), and KIWAY::CommonSettingsChanged().

◆ config()

wxConfigBase * EDA_BASE_FRAME::config ( )
virtualinherited

Returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 538 of file eda_base_frame.cpp.

539 {
540  // KICAD_MANAGER_FRAME overrides this
541  wxConfigBase* ret = Kiface().KifaceSettings();
542  //wxASSERT( ret );
543  return ret;
544 }
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52

References Kiface(), and KIFACE_I::KifaceSettings().

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), PCB_EDIT_FRAME::GetSettings(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), onClose(), FOOTPRINT_WIZARD_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), SIM_PLOT_FRAME(), and EDA_BASE_FRAME::windowClosing().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineinherited
Returns
a base name prefix used in Load/Save settings to build the full name of keys used in config. This is usually the name of the frame set by CTOR, except for frames shown in multiple modes in which case the m_configName must be set to the base name so that a single config can be used.

Definition at line 338 of file eda_base_frame.h.

339  {
340  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
341  return baseCfgName;
342  }
wxString m_configName

References EDA_BASE_FRAME::m_configName.

Referenced by DISPLAY_FOOTPRINTS_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), DISPLAY_FOOTPRINTS_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), and ACTION_MANAGER::UpdateHotKeys().

◆ CurrentPlot()

SIM_PLOT_PANEL * SIM_PLOT_FRAME::CurrentPlot ( ) const

Returns the currently opened plot panel (or NULL if there is none).

Definition at line 478 of file sim_plot_frame.cpp.

479 {
480  wxWindow* curPage = m_plotNotebook->GetCurrentPage();
481 
482  return ( curPage == m_welcomePanel ) ? nullptr : static_cast<SIM_PLOT_PANEL*>( curPage );
483 }
wxAuiNotebook * m_plotNotebook

References SIM_PLOT_FRAME_BASE::m_plotNotebook, and SIM_PLOT_FRAME_BASE::m_welcomePanel.

Referenced by addPlot(), AddTuner(), menuNewPlot(), menuSaveCsv(), menuSaveImage(), menuSaveWorkbook(), menuShowGrid(), menuShowGridUpdate(), menuShowLegend(), menuShowLegendUpdate(), menuZoomFit(), menuZoomIn(), menuZoomOut(), onAddSignal(), onCursorUpdate(), onSettings(), onSimFinished(), onSimUpdate(), removePlot(), SIM_PLOT_FRAME::SIGNAL_CONTEXT_MENU::SIGNAL_CONTEXT_MENU(), StartSimulation(), and updateSignalList().

◆ CurrentToolName()

std::string EDA_BASE_FRAME::CurrentToolName ( ) const
inherited

Definition at line 221 of file eda_base_frame.cpp.

222 {
223  if( m_toolStack.empty() )
224  return ACTIONS::selectionTool.GetName();
225  else
226  return m_toolStack.back();
227 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:143

References EDA_BASE_FRAME::m_toolStack, and ACTIONS::selectionTool.

◆ Destroy()

◆ DismissModal()

void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
inherited

Definition at line 160 of file kiway_player.cpp.

161 {
162  m_modal_ret_val = aRetVal;
163  m_modal_string = aResult;
164 
165  if( m_modal_loop )
166  {
167  m_modal_loop->Exit();
168  m_modal_loop = 0; // this marks it as dismissed.
169  }
170 
171  Show( false );
172 }
bool m_modal_ret_val
Definition: kiway_player.h:192
wxString m_modal_string
Definition: kiway_player.h:191
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:189

References KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_ret_val, and KIWAY_PLAYER::m_modal_string.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint(), LIB_VIEW_FRAME::FinishModal(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ DisplayToolMsg()

virtual void EDA_BASE_FRAME::DisplayToolMsg ( const wxString &  msg)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 238 of file eda_base_frame.h.

238 {};

Referenced by EDA_BASE_FRAME::PopTool(), and EDA_BASE_FRAME::PushTool().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

This should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 304 of file eda_base_frame.cpp.

305 {
306  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
307 }

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 468 of file eda_base_frame.h.

468 { return m_AboutTitle; }
wxString m_AboutTitle

References EDA_BASE_FRAME::m_AboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT().

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited
Returns
the string to prepend to a file name for automatic save.

Definition at line 167 of file eda_base_frame.h.

168  {
169  return wxT( "_autosave-" );
170  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::Files_io_from_id(), SCH_EDIT_FRAME::OnCloseWindow(), PCB_EDIT_FRAME::OnExportSTEP(), SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 283 of file eda_base_frame.h.

283 { return m_autoSaveInterval; }

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetBackupSuffix()

static wxString EDA_BASE_FRAME::GetBackupSuffix ( )
inlinestaticprotectedinherited
Returns
the suffix to be appended to the file extension on backup

Definition at line 159 of file eda_base_frame.h.

160  {
161  return wxT( "-bak" );
162  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), PCB_EDIT_FRAME::createBackupFile(), PCB_EDIT_FRAME::Files_io_from_id(), and SCH_EDIT_FRAME::SaveEEFile().

◆ GetDoImmediateActions()

bool EDA_BASE_FRAME::GetDoImmediateActions ( ) const
inlineinherited

Indicates that hotkeys should perform an immediate action even if another tool is currently active.

If false, the first hotkey should select the relevant tool.

Definition at line 244 of file eda_base_frame.h.

244 { return m_immediateActions; }

References EDA_BASE_FRAME::m_immediateActions.

◆ GetDragSelects()

bool EDA_BASE_FRAME::GetDragSelects ( ) const
inlineinherited

Indicates that a drag should draw a selection rectangle, even when started over an item.

Definition at line 250 of file eda_base_frame.h.

250 { return m_dragSelects; }

References EDA_BASE_FRAME::m_dragSelects.

Referenced by EE_SELECTION_TOOL::Main().

◆ GetExporter()

const NETLIST_EXPORTER_PSPICE_SIM * SIM_PLOT_FRAME::GetExporter ( ) const

Returns the netlist exporter object used for simulations.

Definition at line 486 of file sim_plot_frame.cpp.

487 {
488  return m_exporter.get();
489 }
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter

References m_exporter.

Referenced by TUNER_SLIDER::TUNER_SLIDER().

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
FILE_HISTORY aFileHistory = NULL 
)
inherited

Fetches the file name from the file history list.

This removes the selected file, if this file does not exist. The menu is also updated, if FILE_HISTORY::UseMenu was called at init time

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe FILE_HISTORY in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 576 of file eda_base_frame.cpp.

578 {
579  FILE_HISTORY* fileHistory = aFileHistory;
580 
581  if( !fileHistory )
582  fileHistory = &Kiface().GetFileHistory();
583 
584  int baseId = fileHistory->GetBaseId();
585 
586  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
587 
588  unsigned i = cmdId - baseId;
589 
590  if( i < fileHistory->GetCount() )
591  {
592  wxString fn = fileHistory->GetHistoryFile( i );
593 
594  if( wxFileName::FileExists( fn ) )
595  return fn;
596  else
597  {
598  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
599  wxMessageBox( msg );
600 
601  fileHistory->RemoveFileFromHistory( i );
602  }
603  }
604 
605  return wxEmptyString;
606 }
This class implements a file history object to store a list of files, that can then be added to a men...
Definition: filehistory.h:40
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123
size_t i
Definition: json11.cpp:649

References _, Format(), KIFACE_I::GetFileHistory(), i, and Kiface().

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetMoveWarpsCursor()

bool EDA_BASE_FRAME::GetMoveWarpsCursor ( ) const
inlineinherited

Indicates that a move operation should warp the mouse pointer to the origin of the move object.

This improves snapping, but some users are alergic to mouse warping.

Definition at line 256 of file eda_base_frame.h.

256 { return m_moveWarpsCursor; }

References EDA_BASE_FRAME::m_moveWarpsCursor.

Referenced by SCH_MOVE_TOOL::Main(), and LIB_MOVE_TOOL::Main().

◆ GetMruPath()

◆ GetToolManager()

TOOL_MANAGER* EDA_BASE_FRAME::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 223 of file eda_base_frame.h.

223 { return m_toolManager; }
TOOL_MANAGER * m_toolManager

References EDA_BASE_FRAME::m_toolManager.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), LIB_CONTROL::AddSymbolToSchematic(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), EDA_BASE_FRAME::CommonSettingsChanged(), DIALOG_DRC_CONTROL::DelDRCMarkers(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_DRC_CONTROL::doSelectionMenu(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), DIALOG_DRC_CONTROL::focusOnItem(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), KICAD_MANAGER_FRAME::InstallPreferences(), PL_EDITOR_FRAME::InstallPreferences(), FOOTPRINT_EDIT_FRAME::InstallPreferences(), LIB_EDIT_FRAME::InstallPreferences(), GERBVIEW_FRAME::InstallPreferences(), PCB_EDIT_FRAME::InstallPreferences(), SCH_EDIT_FRAME::InstallPreferences(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_INSPECTOR::onCellClicked(), onClose(), SYMBOL_TREE_PANE::onComponentSelected(), DIALOG_DRC_CONTROL::OnDeleteOneClick(), DIALOG_ERC::OnLeftClickMarkersList(), FOOTPRINTS_LISTBOX::OnLeftDClick(), onProbe(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem(), DIALOG_PLOT::onRunDRC(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), onTune(), DIALOG_PLOT::Plot(), EDA_BASE_FRAME::PopTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), DIALOG_FIND::search(), PCB_BASE_FRAME::SetFastGrid1(), PCB_BASE_FRAME::SetFastGrid2(), CVPCB_MAINFRAME::setupEventHandlers(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), DIALOG_SET_GRID::TransferDataFromWindow(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), EDA_DRAW_FRAME::UpdateMsgPanel(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( )
inlineinherited

Definition at line 49 of file kiway_holder.h.

49 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:82

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), PL_EDITOR_FRAME::SaveSettings(), and GERBVIEW_FRAME::SaveSettings().

◆ GetUserUnits()

EDA_UNITS_T EDA_BASE_FRAME::GetUserUnits ( ) const
inlineinherited

Return the user units currently in use.

Definition at line 211 of file eda_base_frame.h.

211 { return m_userUnits; }
EDA_UNITS_T m_userUnits

References EDA_BASE_FRAME::m_userUnits.

Referenced by PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), PCB_EDIT_FRAME::Create_MuWaveComponent(), MWAVE::CreateMicrowaveInductor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), GERBER_FILE_IMAGE::DisplayImageInfo(), MARKER_BASE::DisplayMarkerInfo(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), LIB_EDIT_TOOL::editGraphicProperties(), LIB_PIN_TOOL::EditPinProperties(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_MODEDIT_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), PANEL_SETUP_NETCLASSES::getNetclassValue(), GetUserUnits(), GRID_MENU::GRID_MENU(), PCB_INSPECTION_TOOL::highlightNet(), GERBVIEW_FRAME::Liste_D_Codes(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), PANEL_SETUP_BOARD_STACKUP::onUpdateThicknessValue(), PANEL_PREV_3D::PANEL_PREV_3D(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), POSITION_RELATIVE_TOOL::PositionRelative(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), DRC::Reset(), CONNECTION_SUBGRAPH::ResolveDrivers(), DISPLAY_FOOTPRINTS_FRAME::SyncToolbars(), FOOTPRINT_EDIT_FRAME::SyncToolbars(), LIB_EDIT_FRAME::SyncToolbars(), GERBVIEW_FRAME::SyncToolbars(), PCB_EDIT_FRAME::SyncToolbars(), SCH_EDIT_FRAME::SyncToolbars(), DRC::testDrilledHoles(), DRC::testUnconnected(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), PANEL_EESCHEMA_SETTINGS::TransferDataToWindow(), PANEL_MODEDIT_SETTINGS::TransferDataToWindow(), PANEL_GERBVIEW_SETTINGS::TransferDataToWindow(), PANEL_PCBNEW_SETTINGS::TransferDataToWindow(), PANEL_SETUP_NETCLASSES::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), GRID_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), GERBVIEW_FRAME::updateDCodeSelectBox(), GERBVIEW_FRAME::updateGridSelectBox(), PCB_BASE_FRAME::UpdateGridSelectBox(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCBNEW_CONTROL::UpdateMessagePanel(), DRC::updatePointers(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), PANEL_SETUP_TRACKS_AND_VIAS::validateData(), and PANEL_SETUP_NETCLASSES::validateData().

◆ GetXAxisType()

SIM_PLOT_TYPE SIM_PLOT_FRAME::GetXAxisType ( SIM_TYPE  aType) const
private

Returns X axis for a given simulation type.

Todo:
SPT_LOG_FREQUENCY

Definition at line 905 of file sim_plot_frame.cpp.

906 {
907  switch( aType )
908  {
909  case ST_AC:
910  return SPT_LIN_FREQUENCY;
912 
913  case ST_DC:
914  return SPT_SWEEP;
915 
916  case ST_TRANSIENT:
917  return SPT_TIME;
918 
919  default:
920  wxASSERT_MSG( false, "Unhandled simulation type" );
921  return (SIM_PLOT_TYPE) 0;
922  }
923 }
SIM_PLOT_TYPE
Possible plot types
Definition: sim_types.h:35

References SPT_LIN_FREQUENCY, SPT_SWEEP, SPT_TIME, ST_AC, ST_DC, and ST_TRANSIENT.

Referenced by addPlot().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
virtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 553 of file eda_base_frame.cpp.

554 {
555  return Kiface().GetHelpFileName();
556 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
const wxString & GetHelpFileName() const
Function GetHelpFileName returns just the basename portion of the current help file.
Definition: kiface_i.h:121

References KIFACE_I::GetHelpFileName(), and Kiface().

Referenced by COMMON_CONTROL::ShowHelp().

◆ ImportHotkeyConfigFromFile()

void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( std::map< std::string, TOOL_ACTION * >  aActionMap,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for a hotkey file to read, and read it.

Parameters
aActionMap= current hotkey map (over which the imported hotkeys will be applied)
aDefaultShortname= a default short name (extension not needed) like eechema, kicad...

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG ,
PANEL_HOTKEYS_EDITOR  
)
inlinevirtualinherited

Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences dialog.

Parameters
aParenta paged dialog into which the preference panels should be installed

Reimplemented in SCH_EDIT_FRAME, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, PL_EDITOR_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 312 of file eda_base_frame.h.

312 { }

Referenced by EDA_BASE_FRAME::OnPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 182 of file eda_base_frame.h.

182 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsCurrentTool()

bool EDA_BASE_FRAME::IsCurrentTool ( const TOOL_ACTION aAction) const
inherited

Definition at line 230 of file eda_base_frame.cpp.

231 {
232  if( m_toolStack.empty() )
233  return &aAction == &ACTIONS::selectionTool;
234  else
235  return m_toolStack.back() == aAction.GetName();
236 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:143
const std::string & GetName() const
Function GetName() Returns name of the action.
Definition: tool_action.h:78

References TOOL_ACTION::GetName(), EDA_BASE_FRAME::m_toolStack, and ACTIONS::selectionTool.

Referenced by PCB_INSPECTION_TOOL::HighlightNetTool(), SCH_EDIT_TOOL::Init(), PCB_EDITOR_CONTROL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), DISPLAY_FOOTPRINTS_FRAME::SyncToolbars(), and LIB_EDIT_FRAME::SyncToolbars().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
inherited

Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal().

IOW, it will return true if the dialog is not modal or if it is modal and has been dismissed.

Definition at line 154 of file kiway_player.cpp.

155 {
156  return !m_modal_loop;
157 }
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:189

References KIWAY_PLAYER::m_modal_loop.

Referenced by LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), and FOOTPRINT_WIZARD_FRAME::OnCloseWindow().

◆ IsModal()

◆ IsSimulationRunning()

bool SIM_PLOT_FRAME::IsSimulationRunning ( )

Definition at line 388 of file sim_plot_frame.cpp.

389 {
390  return m_simulator ? m_simulator->IsRunning() : false;
391 }
std::shared_ptr< SPICE_SIMULATOR > m_simulator

References m_simulator.

Referenced by loadWorkbook(), onClose(), onSimFinished(), onSimulate(), and onSimUpdate().

◆ IsType()

bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited

Definition at line 285 of file eda_base_frame.h.

285 { return m_Ident == aType; }

References EDA_BASE_FRAME::m_Ident.

Referenced by LIB_CONTROL::AddLibrary(), PCBNEW_CONTROL::AddLibrary(), LIB_CONTROL::AddSymbol(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), BOARD_COMMIT::BOARD_COMMIT(), LIB_CONTROL::CutCopyDelete(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), KIGFX::SCH_VIEW::DisplaySheet(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), LIB_CONTROL::DuplicateSymbol(), LIB_CONTROL::EditSymbol(), LIB_CONTROL::ExportSymbol(), LIB_CONTROL::Init(), DIALOG_EDIT_ONE_FIELD::init(), SELECTION_TOOL::Init(), DIALOG_PAD_PROPERTIES::initValues(), PICKER_TOOL::Main(), LIB_CONTROL::OnDeMorgan(), PCB_LAYER_WIDGET::OnRenderEnable(), PCBNEW_CONTROL::Paste(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), LIB_CONTROL::Revert(), EE_INSPECTION_TOOL::RunERC(), LIB_CONTROL::Save(), PCBNEW_CONTROL::Show3DViewer(), LIB_CONTROL::ShowComponentTree(), EE_INSPECTION_TOOL::ShowDatasheet(), and COMMON_TOOLS::ZoomFitScreen().

◆ IsWritable()

bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 645 of file eda_base_frame.cpp.

646 {
647  wxString msg;
648  wxFileName fn = aFileName;
649 
650  // Check for absence of a file path with a file name. Unfortunately KiCad
651  // uses paths relative to the current project path without the ./ part which
652  // confuses wxFileName. Making the file name path absolute may be less than
653  // elegant but it solves the problem.
654  if( fn.GetPath().IsEmpty() && fn.HasName() )
655  fn.MakeAbsolute();
656 
657  wxCHECK_MSG( fn.IsOk(), false,
658  wxT( "File name object is invalid. Bad programmer!" ) );
659  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
660  wxT( "File name object path <" ) + fn.GetFullPath() +
661  wxT( "> is not set. Bad programmer!" ) );
662 
663  if( fn.IsDir() && !fn.IsDirWritable() )
664  {
665  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
666  GetChars( fn.GetPath() ) );
667  }
668  else if( !fn.FileExists() && !fn.IsDirWritable() )
669  {
670  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
671  GetChars( fn.GetFullName() ), GetChars( fn.GetPath() ) );
672  }
673  else if( fn.FileExists() && !fn.IsFileWritable() )
674  {
675  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
676  GetChars( fn.GetFullPath() ) );
677  }
678 
679  if( !msg.IsEmpty() )
680  {
681  wxMessageBox( msg );
682  return false;
683  }
684 
685  return true;
686 }
#define _(s)
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101

References _, and GetChars().

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), LIB_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), CVPCB_MAINFRAME::SaveProjectFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

57  {
58  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
59  return *m_kiway;
60  }
KIWAY * m_kiway
Definition: kiway_holder.h:81

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), SCH_EDIT_FRAME::CreateScreens(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), CVPCB_MAINFRAME::DisplayStatus(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::EditFpInFpEditor(), SCH_EDIT_FRAME::EditSheet(), SCH_EDITOR_CONTROL::EditWithLibEdit(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadSheetFromFile(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), LIB_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 175 of file kiway_player.cpp.

176 {
177  // logging support
178  KiwayMailIn( aEvent ); // call the virtual, override in derived.
179 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.

Merely override it in derived classes.

Reimplemented in LIB_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, PCB_EDIT_FRAME, SCH_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 69 of file kiway_player.cpp.

70 {
71  // override this in derived classes.
72 }

Referenced by KIWAY_PLAYER::kiway_express(), and KIWAY::ProcessEvent().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

Function language_change is an event handler called on a language menu selection.

Definition at line 182 of file kiway_player.cpp.

183 {
184  int id = event.GetId();
185 
186  // tell all the KIWAY_PLAYERs about the language change.
187  Kiway().SetLanguage( id );
188 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY void SetLanguage(int aLanguage)
Function SetLanguage changes the language and then calls ShowChangedLanguage() on all KIWAY_PLAYERs.
Definition: kiway.cpp:435

References KIWAY_HOLDER::Kiway(), and KIWAY::SetLanguage().

◆ LoadSettings()

void SIM_PLOT_FRAME::LoadSettings ( wxConfigBase *  aCfg)
overrideprivatevirtual

Load common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 249 of file sim_plot_frame.cpp.

250 {
251  // Read main frame size and position:
253  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
254 
255  // Read subwindows sizes (should be > 0 )
260 }
#define SIGNALS_PANEL_HEIGHT_ENTRY
int m_splitterPlotAndConsoleSashPosition
#define PLOT_PANEL_WIDTH_ENTRY
#define CURSORS_PANEL_HEIGHT_ENTRY
virtual void LoadSettings(wxConfigBase *aCfg)
Load common frame parameters from a configuration file.
int m_splitterTuneValuesSashPosition
#define PLOT_PANEL_HEIGHT_ENTRY
int m_splitterSignalsSashPosition
int m_splitterLeftRightSashPosition

References CURSORS_PANEL_HEIGHT_ENTRY, EDA_BASE_FRAME::LoadSettings(), EDA_BASE_FRAME::m_FramePos, EDA_BASE_FRAME::m_FrameSize, m_splitterLeftRightSashPosition, m_splitterPlotAndConsoleSashPosition, m_splitterSignalsSashPosition, m_splitterTuneValuesSashPosition, PLOT_PANEL_HEIGHT_ENTRY, PLOT_PANEL_WIDTH_ENTRY, and SIGNALS_PANEL_HEIGHT_ENTRY.

Referenced by SIM_PLOT_FRAME().

◆ loadWorkbook()

bool SIM_PLOT_FRAME::loadWorkbook ( const wxString &  aPath)
private

Loads plot settings from a file.

Parameters
aPathis the file name.
Returns
True if successful.

Definition at line 799 of file sim_plot_frame.cpp.

800 {
801  m_plots.clear();
802  m_plotNotebook->DeleteAllPages();
803 
804  wxTextFile file( aPath );
805 
806  if( !file.Open() )
807  return false;
808 
809  long plotsCount;
810 
811  if( !file.GetFirstLine().ToLong( &plotsCount ) ) // GetFirstLine instead of GetNextLine
812  return false;
813 
814  for( long i = 0; i < plotsCount; ++i )
815  {
816  long plotType, tracesCount;
817 
818  if( !file.GetNextLine().ToLong( &plotType ) )
819  return false;
820 
821  SIM_PLOT_PANEL* plotPanel = NewPlotPanel( (SIM_TYPE) plotType );
822  m_plots[plotPanel].m_simCommand = file.GetNextLine();
823  StartSimulation();
824 
825  // Perform simulation, so plots can be added with values
826  do
827  {
828  wxThread::This()->Sleep( 50 );
829  }
830  while( IsSimulationRunning() );
831 
832  if( !file.GetNextLine().ToLong( &tracesCount ) )
833  return false;
834 
835  for( long j = 0; j < tracesCount; ++j )
836  {
837  long traceType;
838  wxString name, param;
839 
840  if( !file.GetNextLine().ToLong( &traceType ) )
841  return false;
842 
843  name = file.GetNextLine();
844  param = file.GetNextLine();
845 
846  if( name.IsEmpty() || param.IsEmpty() )
847  return false;
848 
849  addPlot( name, (SIM_PLOT_TYPE) traceType, param );
850  }
851  }
852 
853  return true;
854 }
wxAuiNotebook * m_plotNotebook
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
bool IsSimulationRunning()
const char * name
Definition: DXF_plotter.cpp:61
size_t i
Definition: json11.cpp:649
SIM_PLOT_TYPE
Possible plot types
Definition: sim_types.h:35
void addPlot(const wxString &aName, SIM_PLOT_TYPE aType, const wxString &aParam)
Adds a new plot to the current panel.
SIM_PLOT_PANEL * NewPlotPanel(SIM_TYPE aSimType)
Creates a new plot panel for a given simulation type and adds it to the main notebook.

References addPlot(), i, IsSimulationRunning(), SIM_PLOT_FRAME_BASE::m_plotNotebook, m_plots, name, NewPlotPanel(), and StartSimulation().

Referenced by menuOpenWorkbook().

◆ m_splitterLeftRightOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ( wxIdleEvent &  )
inlineinherited

Definition at line 120 of file sim_plot_frame_base.h.

121  {
122  m_splitterLeftRight->SetSashPosition( 700 );
123  m_splitterLeftRight->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
124  }
void m_splitterLeftRightOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterLeftRight

References SIM_PLOT_FRAME_BASE::m_splitterLeftRight.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_splitterPlotAndConsoleOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ( wxIdleEvent &  )
inlineinherited

Definition at line 126 of file sim_plot_frame_base.h.

127  {
128  m_splitterPlotAndConsole->SetSashPosition( 500 );
129  m_splitterPlotAndConsole->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
130  }
void m_splitterPlotAndConsoleOnIdle(wxIdleEvent &)
wxSplitterWindow * m_splitterPlotAndConsole

References SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_splitterSignalsOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ( wxIdleEvent &  )
inlineinherited

Definition at line 132 of file sim_plot_frame_base.h.

133  {
134  m_splitterSignals->SetSashPosition( 0 );
135  m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
136  }
wxSplitterWindow * m_splitterSignals
void m_splitterSignalsOnIdle(wxIdleEvent &)

References SIM_PLOT_FRAME_BASE::m_splitterSignals.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_splitterTuneValuesOnIdle()

void SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ( wxIdleEvent &  )
inlineinherited

Definition at line 138 of file sim_plot_frame_base.h.

139  {
140  m_splitterTuneValues->SetSashPosition( 0 );
141  m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
142  }
wxSplitterWindow * m_splitterTuneValues
void m_splitterTuneValuesOnIdle(wxIdleEvent &)

References SIM_PLOT_FRAME_BASE::m_splitterTuneValues.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ menuExit()

void SIM_PLOT_FRAME::menuExit ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 246 of file sim_plot_frame.h.

247  {
248  Close();
249  }

◆ menuNewPlot()

void SIM_PLOT_FRAME::menuNewPlot ( wxCommandEvent &  aEvent)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 926 of file sim_plot_frame.cpp.

927 {
928  SIM_TYPE type = m_exporter->GetSimType();
929 
930  if( SIM_PLOT_PANEL::IsPlottable( type ) )
931  {
932  SIM_PLOT_PANEL* prevPlot = CurrentPlot();
933  SIM_PLOT_PANEL* newPlot = NewPlotPanel( type );
934 
935  // If the previous plot had the same type, copy the simulation command
936  if( prevPlot )
937  m_plots[newPlot].m_simCommand = m_plots[prevPlot].m_simCommand;
938  }
939 }
static bool IsPlottable(SIM_TYPE aSimType)
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
SIM_PLOT_PANEL * NewPlotPanel(SIM_TYPE aSimType)
Creates a new plot panel for a given simulation type and adds it to the main notebook.

References CurrentPlot(), SIM_PLOT_PANEL::IsPlottable(), m_exporter, m_plots, and NewPlotPanel().

◆ menuOpenWorkbook()

void SIM_PLOT_FRAME::menuOpenWorkbook ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 942 of file sim_plot_frame.cpp.

943 {
944  wxFileDialog openDlg( this, _( "Open simulation workbook" ), m_savedWorkbooksPath, "",
945  WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
946 
947  if( openDlg.ShowModal() == wxID_CANCEL )
948  return;
949 
950  m_savedWorkbooksPath = openDlg.GetDirectory();
951 
952  if( !loadWorkbook( openDlg.GetPath() ) )
953  DisplayError( this, _( "There was an error while opening the workbook file" ) );
954 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
#define _(s)
bool loadWorkbook(const wxString &aPath)
Loads plot settings from a file.
static wxString m_savedWorkbooksPath
A string to store the path of saved workbooks during a session
wxString WorkbookFileWildcard()

References _, DisplayError(), loadWorkbook(), m_savedWorkbooksPath, and WorkbookFileWildcard().

◆ menuSaveCsv()

void SIM_PLOT_FRAME::menuSaveCsv ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 990 of file sim_plot_frame.cpp.

991 {
992  if( !CurrentPlot() )
993  return;
994 
995  const wxChar SEPARATOR = ';';
996 
997  wxFileDialog saveDlg( this, _( "Save Plot Data" ), "", "",
998  CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
999 
1000  if( saveDlg.ShowModal() == wxID_CANCEL )
1001  return;
1002 
1003  wxFile out( saveDlg.GetPath(), wxFile::write );
1004  bool timeWritten = false;
1005 
1006  for( const auto& t : CurrentPlot()->GetTraces() )
1007  {
1008  const TRACE* trace = t.second;
1009 
1010  if( !timeWritten )
1011  {
1012  out.Write( wxString::Format( "Time%c", SEPARATOR ) );
1013 
1014  for( double v : trace->GetDataX() )
1015  out.Write( wxString::Format( "%f%c", v, SEPARATOR ) );
1016 
1017  out.Write( "\r\n" );
1018  timeWritten = true;
1019  }
1020 
1021  out.Write( wxString::Format( "%s%c", t.first, SEPARATOR ) );
1022 
1023  for( double v : trace->GetDataY() )
1024  out.Write( wxString::Format( "%f%c", v, SEPARATOR ) );
1025 
1026  out.Write( "\r\n" );
1027  }
1028 
1029  out.Close();
1030 }
const std::vector< double > & GetDataX() const
wxString CsvFileWildcard()
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
const std::vector< double > & GetDataY() const
const std::map< wxString, TRACE * > & GetTraces() const

References _, CsvFileWildcard(), CurrentPlot(), Format(), TRACE::GetDataX(), TRACE::GetDataY(), and SIM_PLOT_PANEL::GetTraces().

◆ menuSaveImage()

void SIM_PLOT_FRAME::menuSaveImage ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 975 of file sim_plot_frame.cpp.

976 {
977  if( !CurrentPlot() )
978  return;
979 
980  wxFileDialog saveDlg( this, _( "Save Plot as Image" ), "", "",
981  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
982 
983  if( saveDlg.ShowModal() == wxID_CANCEL )
984  return;
985 
986  CurrentPlot()->SaveScreenshot( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
987 }
#define _(s)
wxString PngFileWildcard()
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
bool SaveScreenshot(const wxString &filename, wxBitmapType type=wxBITMAP_TYPE_BMP, wxSize imageSize=wxDefaultSize, bool fit=false)
Draw the window on a wxBitmap, then save it to a file.
Definition: mathplot.cpp:3083

References _, CurrentPlot(), PngFileWildcard(), and mpWindow::SaveScreenshot().

◆ menuSaveWorkbook()

void SIM_PLOT_FRAME::menuSaveWorkbook ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 957 of file sim_plot_frame.cpp.

958 {
959  if( !CurrentPlot() )
960  return;
961 
962  wxFileDialog saveDlg( this, _( "Save Simulation Workbook" ), m_savedWorkbooksPath, "",
963  WorkbookFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
964 
965  if( saveDlg.ShowModal() == wxID_CANCEL )
966  return;
967 
968  m_savedWorkbooksPath = saveDlg.GetDirectory();
969 
970  if( !saveWorkbook( saveDlg.GetPath() ) )
971  DisplayError( this, _( "There was an error while saving the workbook file" ) );
972 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
bool saveWorkbook(const wxString &aPath)
Saves plot settings to a file.
#define _(s)
static wxString m_savedWorkbooksPath
A string to store the path of saved workbooks during a session
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
wxString WorkbookFileWildcard()

References _, CurrentPlot(), DisplayError(), m_savedWorkbooksPath, saveWorkbook(), and WorkbookFileWildcard().

◆ menuShowGrid()

void SIM_PLOT_FRAME::menuShowGrid ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1054 of file sim_plot_frame.cpp.

1055 {
1056  SIM_PLOT_PANEL* plot = CurrentPlot();
1057 
1058  if( plot )
1059  plot->ShowGrid( !plot->IsGridShown() );
1060 }
bool IsGridShown() const
void ShowGrid(bool aEnable)
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), SIM_PLOT_PANEL::IsGridShown(), and SIM_PLOT_PANEL::ShowGrid().

◆ menuShowGridUpdate()

void SIM_PLOT_FRAME::menuShowGridUpdate ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1063 of file sim_plot_frame.cpp.

1064 {
1065  SIM_PLOT_PANEL* plot = CurrentPlot();
1066 
1067  event.Check( plot ? plot->IsGridShown() : false );
1068 }
bool IsGridShown() const
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), and SIM_PLOT_PANEL::IsGridShown().

◆ menuShowLegend()

void SIM_PLOT_FRAME::menuShowLegend ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1071 of file sim_plot_frame.cpp.

1072 {
1073  SIM_PLOT_PANEL* plot = CurrentPlot();
1074 
1075  if( plot )
1076  plot->ShowLegend( !plot->IsLegendShown() );
1077 }
bool IsLegendShown() const
void ShowLegend(bool aEnable)
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), SIM_PLOT_PANEL::IsLegendShown(), and SIM_PLOT_PANEL::ShowLegend().

◆ menuShowLegendUpdate()

void SIM_PLOT_FRAME::menuShowLegendUpdate ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1080 of file sim_plot_frame.cpp.

1081 {
1082  SIM_PLOT_PANEL* plot = CurrentPlot();
1083  event.Check( plot ? plot->IsLegendShown() : false );
1084 }
bool IsLegendShown() const
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), and SIM_PLOT_PANEL::IsLegendShown().

◆ menuZoomFit()

void SIM_PLOT_FRAME::menuZoomFit ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1047 of file sim_plot_frame.cpp.

1048 {
1049  if( CurrentPlot() )
1050  CurrentPlot()->Fit();
1051 }
void Fit() override
Set view to fit global bounding box of all plot layers and refresh display.
Definition: mathplot.cpp:2031
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), and mpWindow::Fit().

◆ menuZoomIn()

void SIM_PLOT_FRAME::menuZoomIn ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1033 of file sim_plot_frame.cpp.

1034 {
1035  if( CurrentPlot() )
1036  CurrentPlot()->ZoomIn();
1037 }
void ZoomIn(const wxPoint &centerPoint=wxDefaultPosition)
Zoom into current view and refresh display.
Definition: mathplot.cpp:2276
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), and mpWindow::ZoomIn().

◆ menuZoomOut()

void SIM_PLOT_FRAME::menuZoomOut ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1040 of file sim_plot_frame.cpp.

1041 {
1042  if( CurrentPlot() )
1043  CurrentPlot()->ZoomOut();
1044 }
void ZoomOut(const wxPoint &centerPoint=wxDefaultPosition)
Zoom out current view and refresh display.
Definition: mathplot.cpp:2339
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References CurrentPlot(), and mpWindow::ZoomOut().

◆ NewPlotPanel()

SIM_PLOT_PANEL * SIM_PLOT_FRAME::NewPlotPanel ( SIM_TYPE  aSimType)

Creates a new plot panel for a given simulation type and adds it to the main notebook.

Parameters
aSimTypeis requested simulation type.
Returns
The new plot panel.

Definition at line 394 of file sim_plot_frame.cpp.

395 {
396  SIM_PLOT_PANEL* plotPanel = new SIM_PLOT_PANEL( aSimType, m_plotNotebook, wxID_ANY );
397 
398  plotPanel->EnableMouseWheelPan(
400 
401  if( m_welcomePanel )
402  {
403  m_plotNotebook->DeletePage( 0 );
404  m_welcomePanel = nullptr;
405  }
406 
407  m_plotNotebook->AddPage( plotPanel, wxString::Format( _( "Plot%u" ),
408  (unsigned int) m_plotNotebook->GetPageCount() + 1 ), true );
409 
410  m_plots[plotPanel] = PLOT_INFO();
411 
412  return plotPanel;
413 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
void EnableMouseWheelPan(bool enabled)
Enable/disable trackpad friendly panning (2-axis scroll wheel)
Definition: mathplot.h:1213
wxAuiNotebook * m_plotNotebook
SCH_EDIT_FRAME * m_schematicFrame
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual bool IsMousewheelPanEnabled() const
Function IsMousewheelPanEnabled()

References _, mpWindow::EnableMouseWheelPan(), Format(), SCH_BASE_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetViewControls(), KIGFX::VIEW_CONTROLS::IsMousewheelPanEnabled(), SIM_PLOT_FRAME_BASE::m_plotNotebook, m_plots, m_schematicFrame, and SIM_PLOT_FRAME_BASE::m_welcomePanel.

Referenced by addPlot(), loadWorkbook(), menuNewPlot(), onSettings(), and onSimFinished().

◆ onAddSignal()

void SIM_PLOT_FRAME::onAddSignal ( wxCommandEvent &  event)
private

Definition at line 1186 of file sim_plot_frame.cpp.

1187 {
1188  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1189 
1190  if( !plotPanel || !m_exporter || plotPanel->GetType() != m_exporter->GetSimType() )
1191  {
1192  DisplayInfoMessage( this, _( "You need to run simulation first." ) );
1193  return;
1194  }
1195 
1196  DIALOG_SIGNAL_LIST dialog( this, m_exporter.get() );
1197  dialog.ShowModal();
1198 }
#define _(s)
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
SIM_TYPE GetType() const
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:264

References _, CurrentPlot(), DisplayInfoMessage(), SIM_PLOT_PANEL::GetType(), and m_exporter.

Referenced by SIM_PLOT_FRAME().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 297 of file eda_base_frame.cpp.

298 {
299  if( !doAutoSave() )
300  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
301 }
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
wxTimer * m_autoSaveTimer

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

◆ OnCharHook()

void EDA_BASE_FRAME::OnCharHook ( wxKeyEvent &  event)
virtualinherited

Capture the key event before it is sent to the GUI.

The basic frame does not capture this event. Editor frames should override this event function to capture and filter these keys when they are used as hotkeys, and skip it if the key is not used as hotkey (otherwise the key events will be not sent to menus).

Reimplemented in FOOTPRINT_VIEWER_FRAME.

Definition at line 310 of file eda_base_frame.cpp.

311 {
312  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
313  // Key events can be filtered here.
314  // Currently no filtering is made.
315  event.Skip();
316 }
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.

References dump(), and kicadTraceKeyEvent.

◆ onClose()

void SIM_PLOT_FRAME::onClose ( wxCloseEvent &  aEvent)
private

Definition at line 1271 of file sim_plot_frame.cpp.

1272 {
1273  SaveSettings( config() );
1274 
1275  if( IsSimulationRunning() )
1276  m_simulator->Stop();
1277 
1278  // Cancel a running simProbe or simTune tool
1280 
1281  Destroy();
1282 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
virtual wxConfigBase * config()
Returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
std::shared_ptr< SPICE_SIMULATOR > m_simulator
SCH_EDIT_FRAME * m_schematicFrame
bool IsSimulationRunning()
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.

References ACTIONS::cancelInteractive, EDA_BASE_FRAME::config(), KIWAY_PLAYER::Destroy(), EDA_BASE_FRAME::GetToolManager(), IsSimulationRunning(), m_schematicFrame, m_simulator, TOOL_MANAGER::RunAction(), and SaveSettings().

Referenced by onShowNetlist(), and SIM_PLOT_FRAME().

◆ onCursorUpdate()

void SIM_PLOT_FRAME::onCursorUpdate ( wxCommandEvent &  aEvent)
private

Definition at line 1285 of file sim_plot_frame.cpp.

1286 {
1287  wxSize size = m_cursors->GetClientSize();
1288  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1289  m_cursors->ClearAll();
1290 
1291  if( !plotPanel )
1292  return;
1293 
1295  m_cursors->SetImageList(m_signalsIconColorList, wxIMAGE_LIST_SMALL);
1296 
1297  // Fill the signals listctrl
1298  m_cursors->AppendColumn( _( "Signal" ), wxLIST_FORMAT_LEFT, size.x / 2 );
1299  const long X_COL = m_cursors->AppendColumn( plotPanel->GetLabelX(), wxLIST_FORMAT_LEFT, size.x / 4 );
1300 
1301  wxString labelY1 = plotPanel->GetLabelY1();
1302  wxString labelY2 = plotPanel->GetLabelY2();
1303  wxString labelY;
1304 
1305  if( !labelY2.IsEmpty() )
1306  labelY = labelY1 + " / " + labelY2;
1307  else
1308  labelY = labelY1;
1309 
1310  const long Y_COL = m_cursors->AppendColumn( labelY, wxLIST_FORMAT_LEFT, size.x / 4 );
1311 
1312  // Update cursor values
1313  int itemidx = 0;
1314  for( const auto& trace : plotPanel->GetTraces() )
1315  {
1316  if( CURSOR* cursor = trace.second->GetCursor() )
1317  {
1318  // Find the right icon color in list.
1319  // It is the icon used in m_signals list for the same trace
1320  long iconColor = m_signals->FindItem( -1, trace.first );
1321 
1322  const wxRealPoint coords = cursor->GetCoords();
1323  long idx = m_cursors->InsertItem( itemidx++, trace.first, iconColor );
1324  m_cursors->SetItem( idx, X_COL, SPICE_VALUE( coords.x ).ToSpiceString() );
1325  m_cursors->SetItem( idx, Y_COL, SPICE_VALUE( coords.y ).ToSpiceString() );
1326  }
1327  }
1328 }
wxString ToSpiceString() const
Returns string value in Spice format (e.g.
wxImageList * m_signalsIconColorList
imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the ...
wxString GetLabelY1() const
wxString GetLabelX() const
wxString GetLabelY2() const
Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
Definition: spice_value.h:32
#define _(s)
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
const std::map< wxString, TRACE * > & GetTraces() const
Cursor attached to a trace to follow its values:

References _, CurrentPlot(), SIM_PLOT_PANEL::GetLabelX(), SIM_PLOT_PANEL::GetLabelY1(), SIM_PLOT_PANEL::GetLabelY2(), SIM_PLOT_PANEL::GetTraces(), SIM_PLOT_FRAME_BASE::m_cursors, SIM_PLOT_FRAME_BASE::m_signals, m_signalsIconColorList, and SPICE_VALUE::ToSpiceString().

Referenced by SIM_PLOT_FRAME().

◆ OnKicadAbout()

void EDA_BASE_FRAME::OnKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 609 of file eda_base_frame.cpp.

610 {
611  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
612  ShowAboutDialog( this );
613 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ OnMenuOpen()

void EDA_BASE_FRAME::OnMenuOpen ( wxMenuEvent &  event)
inherited

Workaround some issues in wxWidgets where the menu events aren't captured by the menus themselves.

Definition at line 319 of file eda_base_frame.cpp.

320 {
321  //
322  // wxWidgets has several issues that we have to work around:
323  //
324  // 1) wxWidgets 3.0.x Windows has a bug where wxEVT_MENU_OPEN and wxEVT_MENU_HIGHLIGHT
325  // events are not captured by the ACTON_MENU menus. So we forward them here.
326  // (FWIW, this one is fixed in wxWidgets 3.1.x.)
327  //
328  // 2) wxWidgets doesn't pass the menu pointer for wxEVT_MENU_HIGHLIGHT events. So we
329  // store the menu pointer from the wxEVT_MENU_OPEN call.
330  //
331  // 3) wxWidgets has no way to tell whether a command is from a menu selection or a
332  // hotkey. So we keep track of menu highlighting so we can differentiate.
333  //
334 
335  static ACTION_MENU* currentMenu;
336 
337  if( event.GetEventType() == wxEVT_MENU_OPEN )
338  {
339  currentMenu = dynamic_cast<ACTION_MENU*>( event.GetMenu() );
340 
341  if( currentMenu )
342  currentMenu->OnMenuEvent( event );
343  }
344  else if( event.GetEventType() == wxEVT_MENU_HIGHLIGHT )
345  {
346  if( currentMenu )
347  currentMenu->OnMenuEvent( event );
348  }
349  else if( event.GetEventType() == wxEVT_MENU_CLOSE )
350  {
351  if( currentMenu )
352  currentMenu->OnMenuEvent( event );
353 
354  currentMenu = nullptr;
355  }
356 
357  event.Skip();
358 }
Class ACTION_MENU.
Definition: action_menu.h:43
void OnMenuEvent(wxMenuEvent &aEvent)

References ACTION_MENU::OnMenuEvent().

◆ onPlotChanged()

void SIM_PLOT_FRAME::onPlotChanged ( wxAuiNotebookEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1105 of file sim_plot_frame.cpp.

1106 {
1107  updateSignalList();
1108  updateCursors();
1109 }
void updateCursors()
Updates the cursor values list.
void updateSignalList()
Updates the list of currently plotted signals.

References updateCursors(), and updateSignalList().

◆ onPlotClose()

void SIM_PLOT_FRAME::onPlotClose ( wxAuiNotebookEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1087 of file sim_plot_frame.cpp.

1088 {
1089  int idx = event.GetSelection();
1090 
1091  if( idx == wxNOT_FOUND )
1092  return;
1093 
1094  SIM_PLOT_PANEL* plotPanel = dynamic_cast<SIM_PLOT_PANEL*>( m_plotNotebook->GetPage( idx ) );
1095 
1096  if( !plotPanel )
1097  return;
1098 
1099  m_plots.erase( plotPanel );
1100  updateSignalList();
1101  updateCursors();
1102 }
void updateCursors()
Updates the cursor values list.
wxAuiNotebook * m_plotNotebook
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
void updateSignalList()
Updates the list of currently plotted signals.

References SIM_PLOT_FRAME_BASE::m_plotNotebook, m_plots, updateCursors(), and updateSignalList().

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Definition at line 616 of file eda_base_frame.cpp.

617 {
618  PAGED_DIALOG dlg( this, _( "Preferences" ) );
619  wxTreebook* book = dlg.GetTreebook();
620 
621  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
622 
623  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
624  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
625 
626  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
627  {
628  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
629 
630  if( frame )
631  frame->InstallPreferences( &dlg, hotkeysPanel );
632  }
633 
634  // The Kicad manager frame is not a player so we have to add it by hand
635  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
636 
637  if( manager )
638  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
639 
640  if( dlg.ShowModal() == wxID_OK )
641  dlg.Kiway().CommonSettingsChanged( false );
642 }
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:59
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:341
#define _(s)
#define KICAD_MANAGER_FRAME_NAME
size_t i
Definition: json11.cpp:649
virtual void InstallPreferences(PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
Function InstallPreferences Allow a frame to load its preference panels (if any) into the preferences...

References _, KIWAY::CommonSettingsChanged(), PAGED_DIALOG::GetTreebook(), i, EDA_BASE_FRAME::InstallPreferences(), KICAD_MANAGER_FRAME_NAME, KIWAY_HOLDER::Kiway(), KIWAY_PLAYER_COUNT, and KIWAY::Player().

◆ onProbe()

void SIM_PLOT_FRAME::onProbe ( wxCommandEvent &  event)
private

Definition at line 1201 of file sim_plot_frame.cpp.

1202 {
1203  if( m_schematicFrame == NULL )
1204  return;
1205 
1207  m_schematicFrame->Raise();
1208 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
SCH_EDIT_FRAME * m_schematicFrame
static TOOL_ACTION simProbe
Definition: ee_actions.h:198

References EDA_BASE_FRAME::GetToolManager(), m_schematicFrame, TOOL_MANAGER::RunAction(), and EE_ACTIONS::simProbe.

Referenced by SIM_PLOT_FRAME().

◆ onSettings()

void SIM_PLOT_FRAME::onSettings ( wxCommandEvent &  event)
private

Definition at line 1149 of file sim_plot_frame.cpp.

1150 {
1151  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1152 
1153  // Initial processing is required to e.g. display a list of power sources
1155 
1156  if( !m_exporter->ProcessNetlist( NET_ALL_FLAGS ) )
1157  {
1158  DisplayError( this, _( "There were errors during netlist export, aborted." ) );
1159  return;
1160  }
1161 
1162  if( !m_settingsDlg )
1163  m_settingsDlg = new DIALOG_SIM_SETTINGS( this );
1164 
1165  if( plotPanel )
1166  m_settingsDlg->SetSimCommand( m_plots[plotPanel].m_simCommand );
1167 
1169 
1170  if( m_settingsDlg->ShowModal() == wxID_OK )
1171  {
1172  wxString newCommand = m_settingsDlg->GetSimCommand();
1173  SIM_TYPE newSimType = NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType( newCommand );
1174 
1175  // If it is a new simulation type, open a new plot
1176  if( !plotPanel || ( plotPanel && plotPanel->GetType() != newSimType ) )
1177  {
1178  plotPanel = NewPlotPanel( newSimType );
1179  }
1180 
1181  m_plots[plotPanel].m_simCommand = newCommand;
1182  }
1183 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
bool SetSimCommand(const wxString &aCommand)
static SIM_TYPE CommandToSimType(const wxString &aCmd)
Returns simulation type basing on a simulation command directive.
const wxString & GetSimCommand() const
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
#define _(s)
void SetNetlistExporter(NETLIST_EXPORTER_PSPICE_SIM *aExporter)
DIALOG_SIM_SETTINGS * m_settingsDlg
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
void updateNetlistExporter()
Reloads the current schematic for the netlist exporter.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
SIM_TYPE GetType() const
SIM_PLOT_PANEL * NewPlotPanel(SIM_TYPE aSimType)
Creates a new plot panel for a given simulation type and adds it to the main notebook.

References _, NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType(), CurrentPlot(), DisplayError(), DIALOG_SIM_SETTINGS::GetSimCommand(), SIM_PLOT_PANEL::GetType(), m_exporter, m_plots, m_settingsDlg, NET_ALL_FLAGS, NewPlotPanel(), DIALOG_SIM_SETTINGS::SetNetlistExporter(), DIALOG_SIM_SETTINGS::SetSimCommand(), DIALOG_SIM_SETTINGS::ShowModal(), and updateNetlistExporter().

Referenced by SIM_PLOT_FRAME().

◆ onShowNetlist()

void SIM_PLOT_FRAME::onShowNetlist ( wxCommandEvent &  event)
private

Definition at line 1220 of file sim_plot_frame.cpp.

1221 {
1222  class NETLIST_VIEW_DIALOG : public wxDialog
1223  {
1224  public:
1225  enum
1226  {
1227  MARGIN_LINE_NUMBERS
1228  };
1229 
1230  void onClose( wxCloseEvent& evt )
1231  {
1232  EndModal( GetReturnCode() );
1233  }
1234 
1235  NETLIST_VIEW_DIALOG(wxWindow* parent, wxString source) :
1236  wxDialog(parent, wxID_ANY, "SPICE Netlist",
1237  wxDefaultPosition, wxSize(1500,900),
1238  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
1239  {
1240  wxStyledTextCtrl* text = new wxStyledTextCtrl( this, wxID_ANY );
1241 
1242  text->SetMarginWidth( MARGIN_LINE_NUMBERS, 50 );
1243  text->StyleSetForeground( wxSTC_STYLE_LINENUMBER, wxColour( 75, 75, 75 ) );
1244  text->StyleSetBackground( wxSTC_STYLE_LINENUMBER, wxColour( 220, 220, 220 ) );
1245  text->SetMarginType( MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER );
1246 
1247  text->SetWrapMode( wxSTC_WRAP_WORD );
1248 
1249  text->SetText( source );
1250 
1251  text->StyleClearAll();
1252  text->SetLexer( wxSTC_LEX_SPICE );
1253 
1254  wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
1255  sizer->Add( text, 1, wxEXPAND );
1256  SetSizer( sizer );
1257 
1258  Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( NETLIST_VIEW_DIALOG::onClose ), NULL,
1259  this );
1260  }
1261  };
1262 
1263  if( m_schematicFrame == NULL || m_simulator == NULL )
1264  return;
1265 
1266  NETLIST_VIEW_DIALOG dlg( this, m_simulator->GetNetlist() );
1267  dlg.ShowModal();
1268 }
std::shared_ptr< SPICE_SIMULATOR > m_simulator
SCH_EDIT_FRAME * m_schematicFrame
void onClose(wxCloseEvent &aEvent)

References m_schematicFrame, m_simulator, and onClose().

Referenced by SIM_PLOT_FRAME().

◆ onSignalDblClick()

void SIM_PLOT_FRAME::onSignalDblClick ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1112 of file sim_plot_frame.cpp.

1113 {
1114  // Remove signal from the plot panel when double clicked
1115  long idx = m_signals->GetFocusedItem();
1116 
1117  if( idx != wxNOT_FOUND )
1118  removePlot( m_signals->GetItemText( idx, 0 ) );
1119 }
void removePlot(const wxString &aPlotName, bool aErase=true)
Removes a plot with a specific title.

References SIM_PLOT_FRAME_BASE::m_signals, and removePlot().

◆ onSignalRClick()

void SIM_PLOT_FRAME::onSignalRClick ( wxListEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 1122 of file sim_plot_frame.cpp.

1123 {
1124  int idx = event.GetIndex();
1125 
1126  if( idx != wxNOT_FOUND )
1127  m_signals->Select( idx );
1128 
1129  idx = m_signals->GetFirstSelected();
1130 
1131  if( idx != wxNOT_FOUND )
1132  {
1133  const wxString& netName = m_signals->GetItemText( idx, 0 );
1134  SIGNAL_CONTEXT_MENU ctxMenu( netName, this );
1135  m_signals->PopupMenu( &ctxMenu );
1136  }
1137 }

References SIM_PLOT_FRAME_BASE::m_signals.

◆ onSimFinished()

void SIM_PLOT_FRAME::onSimFinished ( wxCommandEvent &  aEvent)
private
Todo:
do not make it hardcoded for ngspice

Definition at line 1338 of file sim_plot_frame.cpp.

1339 {
1340  m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( sim_run_xpm ) );
1341  SetCursor( wxCURSOR_ARROW );
1342 
1343  SIM_TYPE simType = m_exporter->GetSimType();
1344 
1345  if( simType == ST_UNKNOWN )
1346  return;
1347 
1348  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1349 
1350  if( !plotPanel || plotPanel->GetType() != simType )
1351  plotPanel = NewPlotPanel( simType );
1352 
1353  if( IsSimulationRunning() )
1354  return;
1355 
1356  // If there are any signals plotted, update them
1357  if( SIM_PLOT_PANEL::IsPlottable( simType ) )
1358  {
1359  TRACE_MAP& traceMap = m_plots[plotPanel].m_traces;
1360 
1361  for( auto it = traceMap.begin(); it != traceMap.end(); /* iteration occurs in the loop */)
1362  {
1363  if( !updatePlot( it->second, plotPanel ) )
1364  {
1365  removePlot( it->first, false );
1366  it = traceMap.erase( it ); // remove a plot that does not exist anymore
1367  }
1368  else
1369  {
1370  ++it;
1371  }
1372  }
1373 
1374  updateSignalList();
1375  plotPanel->UpdateAll();
1376  plotPanel->ResetScales();
1377  }
1378  else
1379  {
1381  for( const auto& net : m_exporter->GetNetIndexMap() )
1382  {
1383  int node = net.second;
1384 
1385  if( node > 0 )
1386  m_simulator->Command( wxString::Format( "print v(%d)", node ).ToStdString() );
1387  }
1388  }
1389 }
static bool IsPlottable(SIM_TYPE aSimType)
std::shared_ptr< SPICE_SIMULATOR > m_simulator
bool updatePlot(const TRACE_DESC &aDescriptor, SIM_PLOT_PANEL *aPanel)
Updates plot in a particular SIM_PLOT_PANEL.
void UpdateAll()
Refresh display.
Definition: mathplot.cpp:2853
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
void ResetScales()
Resets scale ranges to fit the current traces
bool IsSimulationRunning()
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void updateSignalList()
Updates the list of currently plotted signals.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
std::map< wxString, TRACE_DESC > TRACE_MAP
SIM_TYPE GetType() const
void removePlot(const wxString &aPlotName, bool aErase=true)
Removes a plot with a specific title.
SIM_PLOT_PANEL * NewPlotPanel(SIM_TYPE aSimType)
Creates a new plot panel for a given simulation type and adds it to the main notebook.

References CurrentPlot(), Format(), SIM_PLOT_PANEL::GetType(), ID_SIM_RUN, SIM_PLOT_PANEL::IsPlottable(), IsSimulationRunning(), KiBitmap(), m_exporter, m_plots, m_simulator, SIM_PLOT_FRAME_BASE::m_toolBar, NewPlotPanel(), removePlot(), SIM_PLOT_PANEL::ResetScales(), ST_UNKNOWN, mpWindow::UpdateAll(), updatePlot(), and updateSignalList().

Referenced by SIM_PLOT_FRAME().

◆ onSimReport()

void SIM_PLOT_FRAME::onSimReport ( wxCommandEvent &  aEvent)
private

Definition at line 1414 of file sim_plot_frame.cpp.

1415 {
1416  m_simConsole->AppendText( aEvent.GetString() + "\n" );
1417  m_simConsole->SetInsertionPointEnd();
1418 }

References SIM_PLOT_FRAME_BASE::m_simConsole.

Referenced by SIM_PLOT_FRAME().

◆ onSimStarted()

void SIM_PLOT_FRAME::onSimStarted ( wxCommandEvent &  aEvent)
private

Definition at line 1331 of file sim_plot_frame.cpp.

1332 {
1333  m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( sim_stop_xpm ) );
1334  SetCursor( wxCURSOR_ARROWWAIT );
1335 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79

References ID_SIM_RUN, KiBitmap(), and SIM_PLOT_FRAME_BASE::m_toolBar.

Referenced by SIM_PLOT_FRAME().

◆ onSimulate()

void SIM_PLOT_FRAME::onSimulate ( wxCommandEvent &  event)
private

Definition at line 1140 of file sim_plot_frame.cpp.

1141 {
1142  if( IsSimulationRunning() )
1143  StopSimulation();
1144  else
1145  StartSimulation();
1146 }
bool IsSimulationRunning()

References IsSimulationRunning(), StartSimulation(), and StopSimulation().

Referenced by SIM_PLOT_FRAME().

◆ onSimUpdate()

void SIM_PLOT_FRAME::onSimUpdate ( wxCommandEvent &  aEvent)
private

Definition at line 1392 of file sim_plot_frame.cpp.

1393 {
1394  if( IsSimulationRunning() )
1395  StopSimulation();
1396 
1397  if( CurrentPlot() != m_lastSimPlot )
1398  {
1399  // We need to rerun simulation, as the simulator currently stores
1400  // results for another plot
1401  StartSimulation();
1402  }
1403  else
1404  {
1405  // Incremental update
1406  m_simConsole->Clear();
1407  // Do not export netlist, it is already stored in the simulator
1408  applyTuners();
1409  m_simulator->Run();
1410  }
1411 }
void applyTuners()
Applies component values specified using tunder sliders to the current netlist.
std::shared_ptr< SPICE_SIMULATOR > m_simulator
SIM_PLOT_PANEL * m_lastSimPlot
Panel that was used as the most recent one for simulations
bool IsSimulationRunning()
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References applyTuners(), CurrentPlot(), IsSimulationRunning(), m_lastSimPlot, SIM_PLOT_FRAME_BASE::m_simConsole, m_simulator, StartSimulation(), and StopSimulation().

Referenced by SIM_PLOT_FRAME().

◆ onTune()

void SIM_PLOT_FRAME::onTune ( wxCommandEvent &  event)
private

Definition at line 1211 of file sim_plot_frame.cpp.

1212 {
1213  if( m_schematicFrame == NULL )
1214  return;
1215 
1217  m_schematicFrame->Raise();
1218 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
SCH_EDIT_FRAME * m_schematicFrame
static TOOL_ACTION simTune
Definition: ee_actions.h:199

References EDA_BASE_FRAME::GetToolManager(), m_schematicFrame, TOOL_MANAGER::RunAction(), and EE_ACTIONS::simTune.

Referenced by SIM_PLOT_FRAME().

◆ OpenProjectFiles()

virtual bool KIWAY_PLAYER::OpenProjectFiles ( const std::vector< wxString > &  aFileList,
int  aCtl = 0 
)
inlinevirtualinherited

Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList.

This is generalized in the direction of worst case. In a typical case aFileList will only hold a single file, like "myboard.kicad_pcb", because any KIWAY_PLAYER is only in one KIWAY and the KIWAY owns the PROJECT. Therefore opening files from multiple projects into the same KIWAY_PLAYER is precluded.

Each derived class should handle this in a way specific to its needs. No filename prompting is done inside here for any file or project. There should be no need to call this with aFileList which is empty. However, calling it with a single filename which does not exist should indicate to the implementor that a new session is being started and that the given name is the desired name for the data file at time of save.

This function does not support "appending". Use a different function for that. Any prior project data tree should be cleared before loading the new stuff.

Therefore, one of the first things an implementation should do is test for existence of the first file in the list, and if it does not exist, treat it as a new session, possibly with a UI notification to that effect.

After loading the window should update its Title as part of this operation. If the KIWAY_PLAYER needs to, it can load the *.pro file as part of this operation.

If the KIWAY_PLAYER cannot load any of the file(s) in the list, then it should say why through some GUI interface, and return false.

Parameters
aFileListincludes files that this frame should open according to the knowledge in the derived wxFrame. In almost every case, the list will have only a single file in it.
aCtlis a set of bit flags ORed together from the set of KICTL_* #defined above.
Returns
bool - true if all requested files were opened OK, else false.

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, GERBVIEW_FRAME, CVPCB_MAINFRAME, and PL_EDITOR_FRAME.

Definition at line 118 of file kiway_player.h.

119  {
120  // overload me for your wxFrame type.
121 
122  // Any overload should probably do this also:
123  // Prj().MaybeLoadProjectSettings();
124 
125  // Then update the window title.
126 
127  return false;
128  }

Referenced by PCB_EDIT_FRAME::FetchNetlistFromSchematic(), PGM_SINGLE_TOP::MacOpenFile(), SCH_EDIT_FRAME::OnOpenPcbnew(), PGM_SINGLE_TOP::OnPgmInit(), SCH_EDIT_FRAME::OnUpdatePCB(), and PCB_EDIT_FRAME::RunEeschema().

◆ PopTool()

void EDA_BASE_FRAME::PopTool ( const std::string &  actionName)
virtualinherited

Definition at line 183 of file eda_base_frame.cpp.

184 {
185  // Push/pop events can get out of order (such as when they're generated by the Simulator
186  // frame but not processed until the mouse is back in the Schematic frame), so make sure
187  // we're popping the right stack frame.
188 
189  for( int i = m_toolStack.size() - 1; i >= 0; --i )
190  {
191  if( m_toolStack[ i ] == actionName )
192  {
193  m_toolStack.erase( m_toolStack.begin() + i );
194 
195  // If there's something underneath us, and it's now the top of the stack, then
196  // re-activate it
197  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
198  {
199  std::string back = m_toolStack[ i ];
201 
202  if( action )
203  {
204  // Pop the action as running it will push it back onto the stack
205  m_toolStack.pop_back();
206 
207  TOOL_EVENT evt = action->MakeEvent();
208  evt.SetHasPosition( false );
209  GetToolManager()->PostEvent( evt );
210  }
211  }
212  else
214 
215  return;
216  }
217  }
218 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
virtual void DisplayToolMsg(const wxString &msg)
Class TOOL_EVENT.
Definition: tool_event.h:171
std::vector< std::string > m_toolStack
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:163
Class TOOL_ACTION.
Definition: tool_action.h:46
size_t i
Definition: json11.cpp:649
TOOL_EVENT MakeEvent() const
Function MakeEvent() Returns the event associated with the action (i.e.
Definition: tool_action.h:107
TOOL_MANAGER * m_toolManager
void PostEvent(const TOOL_EVENT &aEvent)
Puts an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:237
static TOOL_ACTION selectionTool
Definition: actions.h:143
void SetHasPosition(bool aHasPosition)
Definition: tool_event.h:261

References EDA_BASE_FRAME::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), EDA_BASE_FRAME::GetToolManager(), i, EDA_BASE_FRAME::m_toolManager, EDA_BASE_FRAME::m_toolStack, TOOL_ACTION::MakeEvent(), TOOL_MANAGER::PostEvent(), ACTIONS::selectionTool, and TOOL_EVENT::SetHasPosition().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ PrintMsg()

void EDA_BASE_FRAME::PrintMsg ( const wxString &  text)
inherited

Definition at line 559 of file eda_base_frame.cpp.

560 {
561  SetStatusText( text );
562 }

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 34 of file kiway_holder.cpp.

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:171

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), LIB_CONTROL::AddSymbolToSchematic(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PCB_EDIT_FRAME::doAutoSave(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectFile(), CVPCB_MAINFRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), DIALOG_SCH_SHEET_PROPS::OnBrowseClicked(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OnCloseWindow(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_BOM::OnRunGenerator(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDITOR_CONTROL::Paste(), MODULE_EDITOR_TOOLS::PasteFootprint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), SCH_DRAWING_TOOLS::PlaceComponent(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Print(), SCH_EDIT_FRAME::PrintPage(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), LIB_EDIT_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), KICAD_MANAGER_FRAME::SetProjectFileName(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary(), updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

◆ ProcessEvent()

bool EDA_BASE_FRAME::ProcessEvent ( wxEvent &  aEvent)
overrideinherited

Override the default process event handler to implement the auto save feature.

Warning
If you override this function in a derived class, make sure you call down to this or the auto save feature will be disabled.

Definition at line 239 of file eda_base_frame.cpp.

240 {
241 #ifdef __WXMAC__
242  // Apple in its infinite wisdom will raise a disabled window before even passing
243  // us the event, so we have no way to stop it. Instead, we have to catch an
244  // improperly ordered disabled window and quasi-modal dialog here and reorder
245  // them.
246  if( !IsEnabled() && IsActive() )
247  {
248  wxWindow* dlg = findQuasiModalDialog();
249  if( dlg )
250  dlg->Raise();
251  }
252 #endif
253 
254  if( !wxFrame::ProcessEvent( aEvent ) )
255  return false;
256 
257  if( IsShown() && m_hasAutoSave && IsActive() &&
259  {
260  if( !m_autoSaveState )
261  {
262  wxLogTrace( traceAutoSave, wxT( "Starting auto save timer." ) );
263  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
264  m_autoSaveState = true;
265  }
266  else if( m_autoSaveTimer->IsRunning() )
267  {
268  wxLogTrace( traceAutoSave, wxT( "Stopping auto save timer." ) );
269  m_autoSaveTimer->Stop();
270  m_autoSaveState = false;
271  }
272  }
273 
274  return true;
275 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
virtual bool isAutoSaveRequired() const
Return the auto save status of the application.
wxTimer * m_autoSaveTimer
wxWindow * findQuasiModalDialog()

References EDA_BASE_FRAME::findQuasiModalDialog(), EDA_BASE_FRAME::isAutoSaveRequired(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, EDA_BASE_FRAME::m_autoSaveTimer, EDA_BASE_FRAME::m_hasAutoSave, and traceAutoSave.

Referenced by COMMON_TOOLS::GridProperties(), LIB_VIEW_FRAME::onSelectNextSymbol(), LIB_VIEW_FRAME::onSelectPreviousSymbol(), KIWAY::ProcessEvent(), and LIB_VIEW_FRAME::ReCreateListCmp().

◆ PushTool()

void EDA_BASE_FRAME::PushTool ( const std::string &  actionName)
virtualinherited

NB: the definition of "tool" is different at the user level.

The implementation uses a single TOOL_BASE derived class to implement several user "tools", such as rectangle and circle, or wire and bus. So each user-level tool is actually a TOOL_ACTION.

Definition at line 166 of file eda_base_frame.cpp.

167 {
168  m_toolStack.push_back( actionName );
169 
170  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
171  if( m_toolStack.size() > 3 )
172  m_toolStack.erase( m_toolStack.begin() );
173 
174  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
175 
176  if( action )
177  DisplayToolMsg( action->GetLabel() );
178  else
179  DisplayToolMsg( actionName );
180 }
TOOL_ACTION * FindAction(const std::string &aActionName) const
Function FindAction() Finds an action with a given name (if there is one available).
virtual void DisplayToolMsg(const wxString &msg)
wxString GetLabel() const
Definition: tool_action.cpp:69
std::vector< std::string > m_toolStack
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:163
Class TOOL_ACTION.
Definition: tool_action.h:46
TOOL_MANAGER * m_toolManager

References EDA_BASE_FRAME::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), TOOL_ACTION::GetLabel(), EDA_BASE_FRAME::m_toolManager, and EDA_BASE_FRAME::m_toolStack.

Referenced by PCB_TOOL_BASE::doInteractiveItemPlacement(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), LIB_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), ZOOM_TOOL::Main(), PL_EDIT_TOOL::Main(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), EDIT_TOOL::MeasureTool(), EDIT_TOOL::Move(), LIB_DRAWING_TOOLS::PlaceAnchor(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), LIB_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ ReCreateMenuBar()

void EDA_BASE_FRAME::ReCreateMenuBar ( )
virtualinherited

◆ RefreshCanvas()

virtual void EDA_BASE_FRAME::RefreshCanvas ( )
inlinevirtualinherited

Notification to refresh the drawing canvas (if any).

Reimplemented in EDA_DRAW_FRAME.

Definition at line 466 of file eda_base_frame.h.

466 { };

Referenced by TOOL_MANAGER::ProcessEvent().

◆ removePlot()

void SIM_PLOT_FRAME::removePlot ( const wxString &  aPlotName,
bool  aErase = true 
)
private

Removes a plot with a specific title.

Parameters
aPlotNameis the full plot title (e.g. I(Net-C1-Pad1)).
aErasedecides if plot should be removed from corresponding TRACE_MAP (see m_plots).

Definition at line 543 of file sim_plot_frame.cpp.

544 {
545  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
546 
547  if( !plotPanel )
548  return;
549 
550  if( aErase )
551  {
552  auto& traceMap = m_plots[plotPanel].m_traces;
553  auto traceIt = traceMap.find( aPlotName );
554  wxASSERT( traceIt != traceMap.end() );
555  traceMap.erase( traceIt );
556  }
557 
558  wxASSERT( plotPanel->TraceShown( aPlotName ) );
559  plotPanel->DeleteTrace( aPlotName );
560  plotPanel->Fit();
561 
563  updateCursors();
564 }
void updateCursors()
Updates the cursor values list.
bool DeleteTrace(const wxString &aName)
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
void Fit() override
Set view to fit global bounding box of all plot layers and refresh display.
Definition: mathplot.cpp:2031
void updateSignalList()
Updates the list of currently plotted signals.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
bool TraceShown(const wxString &aName) const

References CurrentPlot(), SIM_PLOT_PANEL::DeleteTrace(), mpWindow::Fit(), m_plots, SIM_PLOT_PANEL::TraceShown(), updateCursors(), and updateSignalList().

Referenced by onSignalDblClick(), and onSimFinished().

◆ RemoveTuner()

void SIM_PLOT_FRAME::RemoveTuner ( TUNER_SLIDER aTuner,
bool  aErase = true 
)

Removes an existing tuner.

Parameters
aTuneris the tuner to be removed.
aErasedecides whether the tuner should be also removed from the tuners list. Otherwise it is removed only from the SIM_PLOT_FRAME pane.

Definition at line 468 of file sim_plot_frame.cpp.

469 {
470  if( aErase )
471  m_tuners.remove( aTuner );
472 
473  aTuner->Destroy();
474  m_tunePanel->Layout();
475 }
std::list< TUNER_SLIDER * > m_tuners
List of currently displayed tuners

References SIM_PLOT_FRAME_BASE::m_tunePanel, and m_tuners.

Referenced by TUNER_SLIDER::onClose(), and updateTuners().

◆ SaveProjectSettings()

virtual void EDA_BASE_FRAME::SaveProjectSettings ( bool  aAskForSave)
inlinevirtualinherited

Save changes to the project settings to the project (.pro) file.

The method is virtual so you can override it to call the suitable save method. The base method do nothing

Parameters
aAskForSave= true to open a dialog before saving the settings

Reimplemented in PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 351 of file eda_base_frame.h.

351 {};

Referenced by DIALOG_PAGES_SETTINGS::OnOkClick().

◆ SaveSettings()

void SIM_PLOT_FRAME::SaveSettings ( wxConfigBase *  aCfg)
overrideprivatevirtual

Saves common frame parameters to a configuration data file.

Don't forget to call the base class's SaveSettings() from your derived SaveSettings() otherwise the frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 236 of file sim_plot_frame.cpp.

237 {
238  // Save main frame size and position:
240 
241  // Save subwindows sizes
242  aCfg->Write( PLOT_PANEL_WIDTH_ENTRY, m_splitterLeftRight->GetSashPosition() );
243  aCfg->Write( PLOT_PANEL_HEIGHT_ENTRY, m_splitterPlotAndConsole->GetSashPosition() );
244  aCfg->Write( SIGNALS_PANEL_HEIGHT_ENTRY, m_splitterSignals->GetSashPosition() );
245  aCfg->Write( CURSORS_PANEL_HEIGHT_ENTRY, m_splitterTuneValues->GetSashPosition() );
246 }
wxSplitterWindow * m_splitterSignals
#define SIGNALS_PANEL_HEIGHT_ENTRY
virtual void SaveSettings(wxConfigBase *aCfg)
Saves common frame parameters to a configuration data file.
wxSplitterWindow * m_splitterTuneValues
#define PLOT_PANEL_WIDTH_ENTRY
wxSplitterWindow * m_splitterLeftRight
#define CURSORS_PANEL_HEIGHT_ENTRY
#define PLOT_PANEL_HEIGHT_ENTRY
wxSplitterWindow * m_splitterPlotAndConsole

References CURSORS_PANEL_HEIGHT_ENTRY, SIM_PLOT_FRAME_BASE::m_splitterLeftRight, SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole, SIM_PLOT_FRAME_BASE::m_splitterSignals, SIM_PLOT_FRAME_BASE::m_splitterTuneValues, PLOT_PANEL_HEIGHT_ENTRY, PLOT_PANEL_WIDTH_ENTRY, EDA_BASE_FRAME::SaveSettings(), and SIGNALS_PANEL_HEIGHT_ENTRY.

Referenced by onClose().

◆ saveWorkbook()

bool SIM_PLOT_FRAME::saveWorkbook ( const wxString &  aPath)
private

Saves plot settings to a file.

Parameters
aPathis the file name.
Returns
True if successful.

Definition at line 857 of file sim_plot_frame.cpp.

858 {
859 
860  wxString savePath = aPath;
861 
862  if( !savePath.Lower().EndsWith(".wbk"))
863  {
864  savePath += ".wbk";
865  };
866 
867 
868  wxTextFile file( savePath );
869 
870  if( file.Exists() )
871  {
872  if( !file.Open() )
873  return false;
874 
875  file.Clear();
876  }
877  else
878  {
879  file.Create();
880  }
881 
882  file.AddLine( wxString::Format( "%lu", m_plots.size() ) );
883 
884  for( const auto& plot : m_plots )
885  {
886  file.AddLine( wxString::Format( "%d", plot.first->GetType() ) );
887  file.AddLine( plot.second.m_simCommand );
888  file.AddLine( wxString::Format( "%lu", plot.second.m_traces.size() ) );
889 
890  for( const auto& trace : plot.second.m_traces )
891  {
892  file.AddLine( wxString::Format( "%d", trace.second.GetType() ) );
893  file.AddLine( trace.second.GetName() );
894  file.AddLine( trace.second.GetParam() );
895  }
896  }
897 
898  bool res = file.Write();
899  file.Close();
900 
901  return res;
902 }
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), and m_plots.

Referenced by menuSaveWorkbook().

◆ SetAutoSaveInterval()

void EDA_BASE_FRAME::SetAutoSaveInterval ( int  aInterval)
inherited

Definition at line 278 of file eda_base_frame.cpp.

279 {
280  m_autoSaveInterval = aInterval;
281 
282  if( m_autoSaveTimer->IsRunning() )
283  {
284  if( m_autoSaveInterval > 0 )
285  {
286  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
287  }
288  else
289  {
290  m_autoSaveTimer->Stop();
291  m_autoSaveState = false;
292  }
293  }
294 }
wxTimer * m_autoSaveTimer

References EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_autoSaveState, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged().

◆ setIconsForMenuItems()

void SIM_PLOT_FRAME::setIconsForMenuItems ( )
private

Give icons to menuitems of the main menubar.

Definition at line 271 of file sim_plot_frame.cpp.

272 {
273  // Give icons to menuitems of the main menubar
274  BM_MENU_INIT_ITEM bm_list[]
275  {
276  // File menu:
277  { wxID_NEW, simulator_xpm },
278  { wxID_OPEN,directory_browser_xpm },
279  { wxID_SAVE, directory_xpm},
280  { ID_SAVE_AS_IMAGE, export_xpm},
281  { ID_SAVE_AS_CSV, export_xpm},
282  { wxID_CLOSE, exit_xpm},
283 
284  // simulator menu:
285  { ID_MENU_RUN_SIM, sim_run_xpm},
286  { ID_MENU_ADD_SIGNAL, sim_add_signal_xpm},
287  { ID_MENU_PROBE_SIGNALS, sim_probe_xpm},
288  { ID_MENU_TUNE_SIGNALS, sim_tune_xpm},
289  { ID_MENU_SHOW_NETLIST, netlist_xpm},
290  { ID_MENU_SET_SIMUL, sim_settings_xpm},
291 
292  // View menu
293  { wxID_ZOOM_IN, zoom_in_xpm},
294  { wxID_ZOOM_OUT, zoom_out_xpm},
295  { wxID_ZOOM_FIT, zoom_fit_in_page_xpm},
296  { ID_MENU_SHOW_GRID, grid_xpm},
298 
299  { 0, nullptr } // Sentinel
300  };
301 
302  // wxMenuItems are already created and attached to the m_mainMenu wxMenuBar.
303  // A problem is the fact setting bitmaps in wxMenuItems after they are attached
304  // to a wxMenu do not work in all cases.
305  // So the trick is:
306  // Remove the wxMenuItem from its wxMenu
307  // Set the bitmap
308  // Insert the modified wxMenuItem to its previous place
309  for( int ii = 0; bm_list[ii].m_MenuId; ++ii )
310  {
311  wxMenuItem* item = m_mainMenu->FindItem( bm_list[ii].m_MenuId );
312 
313  if( !item || !bm_list[ii].m_Bitmap)
314  continue;
315 
316  wxMenu* menu = item->GetMenu();
317  // Calculate the initial index of item inside the wxMenu parent
318  wxMenuItemList& mlist = menu->GetMenuItems();
319  int mpos = mlist.IndexOf( item );
320 
321  if( mpos >= 0 ) // Should be always the case
322  {
323  // Modify the bitmap
324  menu->Remove( item );
325  AddBitmapToMenuItem( item, KiBitmap( bm_list[ii].m_Bitmap ) );
326  // Insert item to its the initial index
327  menu->Insert( mpos, item );
328  }
329  }
330 }
#define ID_MENU_PROBE_SIGNALS
#define ID_SAVE_AS_IMAGE
#define ID_SAVE_AS_CSV
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
#define ID_MENU_SHOW_NETLIST
#define ID_MENU_TUNE_SIGNALS
#define ID_MENU_SHOW_LEGEND
#define ID_MENU_SET_SIMUL
#define ID_MENU_ADD_SIGNAL
#define ID_MENU_SHOW_GRID
static const char * text_xpm[]
#define ID_MENU_RUN_SIM

References AddBitmapToMenuItem(), ID_MENU_ADD_SIGNAL, ID_MENU_PROBE_SIGNALS, ID_MENU_RUN_SIM, ID_MENU_SET_SIMUL, ID_MENU_SHOW_GRID, ID_MENU_SHOW_LEGEND, ID_MENU_SHOW_NETLIST, ID_MENU_TUNE_SIGNALS, ID_SAVE_AS_CSV, ID_SAVE_AS_IMAGE, KiBitmap(), SIM_PLOT_FRAME_BASE::m_mainMenu, and text_xpm.

Referenced by SIM_PLOT_FRAME().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 41 of file kiway_holder.cpp.

42 {
43 #if defined(DEBUG)
44  // offer a trap point for debugging most any window
45  wxASSERT( aDest );
46  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
47  {
48  int breakhere=1;
49  (void) breakhere;
50  }
51 #endif
52 
53  (void) aDest;
54 
55  m_kiway = aKiway;
56 }
KIWAY * m_kiway
Definition: kiway_holder.h:81
const char * name
Definition: DXF_plotter.cpp:61

References KIWAY_HOLDER::m_kiway, and name.

Referenced by InvokePcbLibTableEditor(), and SIM_PLOT_FRAME().

◆ SetModal()

void KIWAY_PLAYER::SetModal ( bool  aIsModal)
inlineinherited

Definition at line 164 of file kiway_player.h.

164 { m_modal = aIsModal; }

References KIWAY_PLAYER::m_modal.

Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), and LIB_VIEW_FRAME::LIB_VIEW_FRAME().

◆ SetMruPath()

void EDA_BASE_FRAME::SetMruPath ( const wxString &  aPath)
inlineinherited

Definition at line 391 of file eda_base_frame.h.

391 { m_mruPath = aPath; }
wxString m_mruPath

References EDA_BASE_FRAME::m_mruPath.

Referenced by PANEL_HOTKEYS_EDITOR::ImportHotKeys(), and KICAD_MANAGER_FRAME::LoadProject().

◆ setSubWindowsSashSize()

void SIM_PLOT_FRAME::setSubWindowsSashSize ( )
private

Definition at line 333 of file sim_plot_frame.cpp.

334 {
337 
340 
343 
346 }
wxSplitterWindow * m_splitterSignals
int m_splitterPlotAndConsoleSashPosition
wxSplitterWindow * m_splitterTuneValues
wxSplitterWindow * m_splitterLeftRight
int m_splitterTuneValuesSashPosition
int m_splitterSignalsSashPosition
int m_splitterLeftRightSashPosition
wxSplitterWindow * m_splitterPlotAndConsole

References SIM_PLOT_FRAME_BASE::m_splitterLeftRight, m_splitterLeftRightSashPosition, SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole, m_splitterPlotAndConsoleSashPosition, SIM_PLOT_FRAME_BASE::m_splitterSignals, m_splitterSignalsSashPosition, SIM_PLOT_FRAME_BASE::m_splitterTuneValues, and m_splitterTuneValuesSashPosition.

Referenced by SIM_PLOT_FRAME().

◆ SetUserUnits()

◆ ShowChangedLanguage()

void EDA_BASE_FRAME::ShowChangedLanguage ( )
virtualinherited

◆ ShowModal()

bool KIWAY_PLAYER::ShowModal ( wxString *  aResult = NULL,
wxWindow *  aResultantFocusWindow = NULL 
)
virtualinherited

Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal().

That is, behavior is similar to a modal dialog window. Not all KIWAY_PLAYERs use this interface, so don't call this unless the implementation knows how to call DismissModal() on a button click or double click or some special event which ends the modal behavior.

Parameters
aResultif not NULL, indicates a place to put a resultant string.
aResultantFocusWindowif not NULL, indicates what window to pass focus to on return.
Returns
bool - true if frame implementation called KIWAY_PLAYER::DismissModal() with aRetVal of true.

Reimplemented in FOOTPRINT_VIEWER_FRAME, and LIB_VIEW_FRAME.

Definition at line 75 of file kiway_player.cpp.

76 {
77  wxASSERT_MSG( IsModal(), wxT( "ShowModal() shouldn't be called on non-modal frame" ) );
78 
79  /*
80  This function has a nice interface but a necessarily unsightly implementation.
81  Now the implementation is encapsulated, localizing future changes.
82 
83  It works in tandem with DismissModal(). But only ShowModal() is in the
84  vtable and therefore cross-module capable.
85  */
86 
87  // This is an exception safe way to zero a pointer before returning.
88  // Yes, even though DismissModal() clears this first normally, this is
89  // here in case there's an exception before the dialog is dismissed.
90  struct NULLER
91  {
92  void*& m_what;
93  NULLER( void*& aPtr ) : m_what( aPtr ) {}
94  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
95  } clear_this( (void*&) m_modal_loop );
96 
97 
98  m_modal_resultant_parent = aResultantFocusWindow;
99 
100  Show( true );
101  Raise(); // Needed on some Window managers to always display the frame
102 
103  SetFocus();
104 
105  {
106  // We have to disable all frames but the the modal one.
107  // wxWindowDisabler does that, but it also disables all top level windows
108  // We do not want to disable top level windows which are child of the modal one,
109  // if they are enabled.
110  // An example is an aui toolbar which was moved
111  // or a dialog or another frame or miniframe opened by the modal one.
112  wxWindowList wlist = GetChildren();
113  std::vector<wxWindow*> enabledTopLevelWindows;
114 
115  for( unsigned ii = 0; ii < wlist.size(); ii++ )
116  if( wlist[ii]->IsTopLevel() && wlist[ii]->IsEnabled() )
117  enabledTopLevelWindows.push_back( wlist[ii] );
118 
119  // exception safe way to disable all top level windows except the modal one,
120  // re-enables only those that were disabled on exit
121  wxWindowDisabler toggle( this );
122 
123  for( unsigned ii = 0; ii < enabledTopLevelWindows.size(); ii++ )
124  enabledTopLevelWindows[ii]->Enable( true );
125 
126  WX_EVENT_LOOP event_loop;
127  m_modal_loop = &event_loop;
128  event_loop.Run();
129 
130  } // End of scope for some variables.
131  // End nesting before setting focus below.
132 
133  if( aResult )
134  *aResult = m_modal_string;
135 
136  if( aResultantFocusWindow )
137  {
138  aResultantFocusWindow->Raise();
139 
140  // have the final say, after wxWindowDisabler reenables my parent and
141  // the events settle down, set the focus
142  wxSafeYield();
143  aResultantFocusWindow->SetFocus();
144  }
145 
146  return m_modal_ret_val;
147 }
bool m_modal_ret_val
Definition: kiway_player.h:192
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
wxWindow * m_modal_resultant_parent
Definition: kiway_player.h:190
wxString m_modal_string
Definition: kiway_player.h:191
bool IsModal()
Definition: kiway_player.h:163
WX_EVENT_LOOP * m_modal_loop
Definition: kiway_player.h:189

References KIWAY_PLAYER::IsModal(), KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_resultant_parent, KIWAY_PLAYER::m_modal_ret_val, KIWAY_PLAYER::m_modal_string, and WX_EVENT_LOOP.

Referenced by FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ StartSimulation()

void SIM_PLOT_FRAME::StartSimulation ( )

Definition at line 349 of file sim_plot_frame.cpp.

350 {
351  STRING_FORMATTER formatter;
352  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
353 
354  if( !m_settingsDlg )
355  m_settingsDlg = new DIALOG_SIM_SETTINGS( this );
356 
357  m_simConsole->Clear();
359 
360  if( plotPanel )
361  m_exporter->SetSimCommand( m_plots[plotPanel].m_simCommand );
362 
363  if( !m_exporter->Format( &formatter, m_settingsDlg->GetNetlistOptions() ) )
364  {
365  DisplayError( this, _( "There were errors during netlist export, aborted." ) );
366  return;
367  }
368 
369  if( m_exporter->GetSimType() == ST_UNKNOWN )
370  {
371  DisplayInfoMessage( this, _( "You need to select the simulation settings first." ) );
372  return;
373  }
374 
375  m_simulator->LoadNetlist( formatter.GetString() );
376  updateTuners();
377  applyTuners();
378  m_simulator->Run();
379 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
void applyTuners()
Applies component values specified using tunder sliders to the current netlist.
std::shared_ptr< SPICE_SIMULATOR > m_simulator
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
const std::string & GetString()
Definition: richio.h:475
#define _(s)
DIALOG_SIM_SETTINGS * m_settingsDlg
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
void updateNetlistExporter()
Reloads the current schematic for the netlist exporter.
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:264
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
void updateTuners()
Filters out tuners for components that do not exist anymore.

References _, applyTuners(), CurrentPlot(), DisplayError(), DisplayInfoMessage(), DIALOG_SIM_SETTINGS::GetNetlistOptions(), STRING_FORMATTER::GetString(), m_exporter, m_plots, m_settingsDlg, SIM_PLOT_FRAME_BASE::m_simConsole, m_simulator, ST_UNKNOWN, updateNetlistExporter(), and updateTuners().

Referenced by loadWorkbook(), onSimulate(), and onSimUpdate().

◆ StopSimulation()

void SIM_PLOT_FRAME::StopSimulation ( )

Definition at line 382 of file sim_plot_frame.cpp.

383 {
384  m_simulator->Stop();
385 }
std::shared_ptr< SPICE_SIMULATOR > m_simulator

References m_simulator.

Referenced by onSimulate(), and onSimUpdate().

◆ SyncToolbars()

virtual void EDA_BASE_FRAME::SyncToolbars ( )
inlinevirtualinherited

Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.

Reimplemented in SCH_EDIT_FRAME, PCB_EDIT_FRAME, GERBVIEW_FRAME, LIB_EDIT_FRAME, CVPCB_MAINFRAME, FOOTPRINT_EDIT_FRAME, PL_EDITOR_FRAME, KICAD_MANAGER_FRAME, LIB_VIEW_FRAME, and DISPLAY_FOOTPRINTS_FRAME.

Definition at line 450 of file eda_base_frame.h.

450 { };

Referenced by EDA_DRAW_FRAME::RecreateToolbars(), PCB_BASE_EDIT_FRAME::SetGridVisibility(), and TOOL_MANAGER::UpdateUI().

◆ sys_search()

const SEARCH_STACK & EDA_BASE_FRAME::sys_search ( )
virtualinherited

Return a SEARCH_STACK pertaining to entire program.

This is overloaded in KICAD_MANAGER_FRAME

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 547 of file eda_base_frame.cpp.

548 {
549  return Kiface().KifaceSearch();
550 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
Definition: kiface_i.h:127

References Kiface(), and KIFACE_I::KifaceSearch().

Referenced by COMMON_CONTROL::ShowHelp().

◆ ToolStackIsEmpty()

◆ unitsChangeRefresh()

virtual void EDA_BASE_FRAME::unitsChangeRefresh ( )
inlineprotectedvirtualinherited

Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them.

The default version only updates the status bar. Don't forget to call the default in your derived class or the status bar will not get updated properly.

Reimplemented in PCB_BASE_EDIT_FRAME, GERBVIEW_FRAME, EDA_DRAW_FRAME, and PCB_BASE_FRAME.

Definition at line 197 of file eda_base_frame.h.

197 { }

Referenced by EDA_BASE_FRAME::ChangeUserUnits().

◆ updateCursors()

void SIM_PLOT_FRAME::updateCursors ( )
private

Updates the cursor values list.

Definition at line 754 of file sim_plot_frame.cpp.

755 {
756  wxQueueEvent( this, new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
757 }

Referenced by onPlotChanged(), onPlotClose(), and removePlot().

◆ UpdateFileHistory()

void EDA_BASE_FRAME::UpdateFileHistory ( const wxString &  FullFileName,
FILE_HISTORY aFileHistory = NULL 
)
inherited

Update the list of recently opened files.

The menu is also updated, if FILE_HISTORY::UseMenu was called at init time.

Parameters
FullFileNameThe full file name including the path.
aFileHistoryThe FILE_HISTORY in use. If NULL, the main application file history is used.

Definition at line 565 of file eda_base_frame.cpp.

566 {
567  FILE_HISTORY* fileHistory = aFileHistory;
568 
569  if( !fileHistory )
570  fileHistory = &Kiface().GetFileHistory();
571 
572  fileHistory->AddFileToHistory( FullFileName );
573 }
This class implements a file history object to store a list of files, that can then be added to a men...
Definition: filehistory.h:40
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
void AddFileToHistory(const wxString &aFile) override
Adds a file to the history.
Definition: filehistory.cpp:53
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123

References FILE_HISTORY::AddFileToHistory(), KIFACE_I::GetFileHistory(), and Kiface().

Referenced by SCH_EDIT_FRAME::importFile(), GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadGerberJobFile(), GERBVIEW_FRAME::loadListOfGerberAndDrillFiles(), PL_EDITOR_FRAME::LoadPageLayoutDescrFile(), KICAD_MANAGER_FRAME::LoadProject(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::SavePcbFile(), and GERBVIEW_FRAME::unarchiveFiles().

◆ updateNetlistExporter()

void SIM_PLOT_FRAME::updateNetlistExporter ( )
private

Reloads the current schematic for the netlist exporter.

Definition at line 567 of file sim_plot_frame.cpp.

568 {
570 }
NETLIST_OBJECT_LIST * BuildNetListBase(bool updateStatusText=true)
Create a flat list which stores all connected objects.
SCH_EDIT_FRAME * m_schematicFrame
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
Special netlist exporter flavor that allows one to override simulation commands.

References SCH_EDIT_FRAME::BuildNetListBase(), m_exporter, m_schematicFrame, and KIWAY_HOLDER::Prj().

Referenced by onSettings(), SIM_PLOT_FRAME(), and StartSimulation().

◆ updatePlot()

bool SIM_PLOT_FRAME::updatePlot ( const TRACE_DESC aDescriptor,
SIM_PLOT_PANEL aPanel 
)
private

Updates plot in a particular SIM_PLOT_PANEL.

If the panel does not contain the plot, it will be added.

Parameters
aDescriptorcontains the plot description.
aPanelis the panel that should receive the update.
Returns
True if a plot was successfully added/updated.

Definition at line 573 of file sim_plot_frame.cpp.

574 {
575  SIM_TYPE simType = m_exporter->GetSimType();
576  wxString spiceVector = m_exporter->GetSpiceVector( aDescriptor.GetName(),
577  aDescriptor.GetType(), aDescriptor.GetParam() );
578 
579  if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
580  {
581  // There is no plot to be shown
582  m_simulator->Command( wxString::Format( "print %s", spiceVector ).ToStdString() );
583 
584  return false;
585  }
586 
587  // First, handle the x axis
588  wxString xAxisName( m_simulator->GetXAxis( simType ) );
589 
590  if( xAxisName.IsEmpty() )
591  return false;
592 
593  auto data_x = m_simulator->GetMagPlot( (const char*) xAxisName.c_str() );
594  unsigned int size = data_x.size();
595 
596  if( data_x.empty() )
597  return false;
598 
599  SIM_PLOT_TYPE plotType = aDescriptor.GetType();
600  std::vector<double> data_y;
601 
602  // Now, Y axis data
603  switch( m_exporter->GetSimType() )
604  {
605  case ST_AC:
606  {
607  wxASSERT_MSG( !( ( plotType & SPT_AC_MAG ) && ( plotType & SPT_AC_PHASE ) ),
608  "Cannot set both AC_PHASE and AC_MAG bits" );
609 
610  if( plotType & SPT_AC_MAG )
611  data_y = m_simulator->GetMagPlot( (const char*) spiceVector.c_str() );
612  else if( plotType & SPT_AC_PHASE )
613  data_y = m_simulator->GetPhasePlot( (const char*) spiceVector.c_str() );
614  else
615  wxASSERT_MSG( false, "Plot type missing AC_PHASE or AC_MAG bit" );
616  }
617  break;
618 
619  case ST_NOISE:
620  case ST_DC:
621  case ST_TRANSIENT:
622  {
623  data_y = m_simulator->GetMagPlot( (const char*) spiceVector.c_str() );
624  }
625  break;
626 
627  default:
628  wxASSERT_MSG( false, "Unhandled plot type" );
629  return false;
630  }
631 
632  if( data_y.size() != size )
633  return false;
634 
635  // If we did a two-source DC analysis, we need to split the resulting vector and add traces
636  // for each input step
637  SPICE_DC_PARAMS source1, source2;
638 
639  if( m_exporter->GetSimType() == ST_DC &&
640  m_exporter->ParseDCCommand( m_exporter->GetUsedSimCommand(), &source1, &source2 ) )
641  {
642  if( !source2.m_source.IsEmpty() )
643  {
644  // Source 1 is the inner loop, so lets add traces for each Source 2 (outer loop) step
645  SPICE_VALUE v = source2.m_vstart;
646  wxString name;
647 
648  size_t offset = 0;
649  size_t outer = ( size_t )( ( source2.m_vend - v ) / source2.m_vincrement ).ToDouble();
650  size_t inner = data_x.size() / ( outer + 1 );
651 
652  wxASSERT( data_x.size() % ( outer + 1 ) == 0 );
653 
654  for( size_t idx = 0; idx <= outer; idx++ )
655  {
656  name = wxString::Format( "%s (%s = %s V)", aDescriptor.GetTitle(),
657  source2.m_source, v.ToString() );
658 
659  std::vector<double> sub_x( data_x.begin() + offset,
660  data_x.begin() + offset + inner );
661  std::vector<double> sub_y( data_y.begin() + offset,
662  data_y.begin() + offset + inner );
663 
664  if( aPanel->AddTrace( name, inner,
665  sub_x.data(), sub_y.data(), aDescriptor.GetType() ) )
666  {
667  m_plots[aPanel].m_traces.insert( std::make_pair( name, aDescriptor ) );
668  }
669 
670  v = v + source2.m_vincrement;
671  offset += inner;
672  }
673 
674  return true;
675  }
676  }
677 
678  if( aPanel->AddTrace( aDescriptor.GetTitle(), size,
679  data_x.data(), data_y.data(), aDescriptor.GetType() ) )
680  {
681  m_plots[aPanel].m_traces.insert( std::make_pair( aDescriptor.GetTitle(), aDescriptor ) );
682  }
683 
684  return true;
685 }
const wxString & GetTitle() const
static bool IsPlottable(SIM_TYPE aSimType)
SIM_PLOT_TYPE GetType() const
std::shared_ptr< SPICE_SIMULATOR > m_simulator
const wxString & GetParam() const
wxString ToString() const
Returns string value as when converting double to string (e.g.
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
Definition: spice_value.h:32
SIM_TYPE
Possible simulation types
Definition: sim_types.h:29
bool AddTrace(const wxString &aName, int aPoints, const double *aX, const double *aY, SIM_PLOT_TYPE aFlags)
const wxString & GetName() const
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
const char * name
Definition: DXF_plotter.cpp:61
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
SIM_PLOT_TYPE
Possible plot types
Definition: sim_types.h:35

References SIM_PLOT_PANEL::AddTrace(), Format(), TRACE_DESC::GetName(), TRACE_DESC::GetParam(), TRACE_DESC::GetTitle(), TRACE_DESC::GetType(), SIM_PLOT_PANEL::IsPlottable(), m_exporter, m_plots, m_simulator, SPICE_DC_PARAMS::m_source, SPICE_DC_PARAMS::m_vend, SPICE_DC_PARAMS::m_vincrement, SPICE_DC_PARAMS::m_vstart, name, SPT_AC_MAG, SPT_AC_PHASE, ST_AC, ST_DC, ST_NOISE, ST_TRANSIENT, and SPICE_VALUE::ToString().

Referenced by addPlot(), and onSimFinished().

◆ updateSignalList()

void SIM_PLOT_FRAME::updateSignalList ( )
private

Updates the list of currently plotted signals.

Definition at line 688 of file sim_plot_frame.cpp.

689 {
690  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
691 
692  if( !plotPanel )
693  return;
694 
695  m_signals->ClearAll();
696 
697  wxSize size = m_signals->GetClientSize();
698  m_signals->AppendColumn( _( "Signal" ), wxLIST_FORMAT_LEFT, size.x );
699 
700  // Build an image list, to show the color of the corresponding trace
701  // in the plot panel
702  // This image list is used for trace and cursor lists
703  wxMemoryDC bmDC;
704  const int isize = bmDC.GetCharHeight();
705 
706  if( m_signalsIconColorList == NULL )
707  m_signalsIconColorList = new wxImageList( isize, isize, false );
708  else
709  m_signalsIconColorList->RemoveAll();
710 
711  for( const auto& trace : CurrentPlot()->GetTraces() )
712  {
713  wxBitmap bitmap( isize, isize );
714  bmDC.SelectObject( bitmap );
715  wxColour tcolor = trace.second->GetTraceColour();
716 
717  wxColour bgColor = m_signals->wxWindow::GetBackgroundColour();
718  bmDC.SetPen( wxPen( bgColor ) );
719  bmDC.SetBrush( wxBrush( bgColor ) );
720  bmDC.DrawRectangle( 0, 0, isize, isize ); // because bmDC.Clear() does not work in wxGTK
721 
722  bmDC.SetPen( wxPen( tcolor ) );
723  bmDC.SetBrush( wxBrush( tcolor ) );
724  bmDC.DrawRectangle( 0, isize / 4 + 1, isize, isize / 2 );
725 
726  bmDC.SelectObject( wxNullBitmap ); // Needed to initialize bitmap
727 
728  bitmap.SetMask( new wxMask( bitmap, *wxBLACK ) );
729  m_signalsIconColorList->Add( bitmap );
730  }
731 
732  if( bmDC.IsOk() )
733  {
734  bmDC.SetBrush( wxNullBrush );
735  bmDC.SetPen( wxNullPen );
736  }
737 
738  m_signals->SetImageList( m_signalsIconColorList, wxIMAGE_LIST_SMALL );
739 
740  // Fill the signals listctrl. Keep the order of names and
741  // the order of icon color identical, because the icons
742  // are also used in cursor list, and the color index is
743  // calculated from the trace name index
744  int imgidx = 0;
745 
746  for( const auto& trace : m_plots[plotPanel].m_traces )
747  {
748  m_signals->InsertItem( imgidx, trace.first, imgidx );
749  imgidx++;
750  }
751 }
wxImageList * m_signalsIconColorList
imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the ...
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
#define _(s)
SIM_PLOT_PANEL * CurrentPlot() const
Returns the currently opened plot panel (or NULL if there is none).

References _, CurrentPlot(), m_plots, SIM_PLOT_FRAME_BASE::m_signals, and m_signalsIconColorList.

Referenced by addPlot(), onPlotChanged(), onPlotClose(), onSimFinished(), and removePlot().

◆ UpdateStatusBar()

virtual void EDA_BASE_FRAME::UpdateStatusBar ( )
inlinevirtualinherited

Update the status bar information.

The status bar can draw itself. This is not a drawing function per se, but rather updates lines of text held by the components within the status bar which is owned by the wxFrame.

Reimplemented in EDA_DRAW_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, SCH_BASE_FRAME, and PL_EDITOR_FRAME.

Definition at line 444 of file eda_base_frame.h.

444 { }

Referenced by TOOL_MANAGER::UpdateUI().

◆ updateTuners()

void SIM_PLOT_FRAME::updateTuners ( )
private

Filters out tuners for components that do not exist anymore.

Decisions are based on the current NETLIST_EXPORTER data.

Definition at line 760 of file sim_plot_frame.cpp.

761 {
762  const auto& spiceItems = m_exporter->GetSpiceItems();
763 
764  for( auto it = m_tuners.begin(); it != m_tuners.end(); /* iteration inside the loop */ )
765  {
766  const wxString& ref = (*it)->GetComponentName();
767 
768  if( std::find_if( spiceItems.begin(), spiceItems.end(), [&]( const SPICE_ITEM& item )
769  {
770  return item.m_refName == ref;
771  }) == spiceItems.end() )
772  {
773  // The component does not exist anymore, remove the associated tuner
774  TUNER_SLIDER* tuner = *it;
775  it = m_tuners.erase( it );
776  RemoveTuner( tuner, false );
777  }
778  else
779  {
780  ++it;
781  }
782  }
783 }
void RemoveTuner(TUNER_SLIDER *aTuner, bool aErase=true)
Removes an existing tuner.
Structure to represent a schematic component in the Spice simulation.
std::list< TUNER_SLIDER * > m_tuners
List of currently displayed tuners
std::unique_ptr< NETLIST_EXPORTER_PSPICE_SIM > m_exporter
Custom widget to handle quick component values modification and simulation on the fly.
Definition: tuner_slider.h:40

References m_exporter, m_tuners, and RemoveTuner().

Referenced by StartSimulation().

Member Data Documentation

◆ KICAD_AUI_TB_STYLE

◆ m_AboutTitle

wxString EDA_BASE_FRAME::m_AboutTitle
protectedinherited

◆ m_actions

◆ m_addSignals

wxMenuItem* SIM_PLOT_FRAME_BASE::m_addSignals
protectedinherited

◆ m_auimgr

wxAuiManager EDA_BASE_FRAME::m_auimgr
protectedinherited

◆ m_autoSaveInterval

◆ m_autoSaveState

bool EDA_BASE_FRAME::m_autoSaveState
protectedinherited

◆ m_autoSaveTimer

wxTimer* EDA_BASE_FRAME::m_autoSaveTimer
protectedinherited

◆ m_configName

wxString EDA_BASE_FRAME::m_configName
protectedinherited

◆ m_cursors

wxListCtrl* SIM_PLOT_FRAME_BASE::m_cursors
protectedinherited

◆ m_dragSelects

bool EDA_BASE_FRAME::m_dragSelects
protectedinherited

◆ m_exporter

◆ m_fileMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_fileMenu
protectedinherited

Definition at line 55 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_FramePos

◆ m_FrameSize

◆ m_hasAutoSave

bool EDA_BASE_FRAME::m_hasAutoSave
protectedinherited

◆ m_Ident

FRAME_T EDA_BASE_FRAME::m_Ident
protectedinherited

◆ m_immediateActions

bool EDA_BASE_FRAME::m_immediateActions
protectedinherited

◆ m_lastSimPlot

SIM_PLOT_PANEL* SIM_PLOT_FRAME::m_lastSimPlot
private

Panel that was used as the most recent one for simulations

Definition at line 345 of file sim_plot_frame.h.

Referenced by onSimUpdate().

◆ m_mainMenu

wxMenuBar* SIM_PLOT_FRAME_BASE::m_mainMenu
protectedinherited

◆ m_modal

bool KIWAY_PLAYER::m_modal
protectedinherited

Definition at line 188 of file kiway_player.h.

Referenced by KIWAY_PLAYER::IsModal(), and KIWAY_PLAYER::SetModal().

◆ m_modal_loop

WX_EVENT_LOOP* KIWAY_PLAYER::m_modal_loop
protectedinherited

◆ m_modal_resultant_parent

wxWindow* KIWAY_PLAYER::m_modal_resultant_parent
protectedinherited

Definition at line 190 of file kiway_player.h.

Referenced by KIWAY_PLAYER::ShowModal().

◆ m_modal_ret_val

bool KIWAY_PLAYER::m_modal_ret_val
protectedinherited

◆ m_modal_string

wxString KIWAY_PLAYER::m_modal_string
protectedinherited

Definition at line 191 of file kiway_player.h.

Referenced by KIWAY_PLAYER::DismissModal(), and KIWAY_PLAYER::ShowModal().

◆ m_moveWarpsCursor

bool EDA_BASE_FRAME::m_moveWarpsCursor
protectedinherited

◆ m_mruPath

◆ m_panelConsole

wxPanel* SIM_PLOT_FRAME_BASE::m_panelConsole
protectedinherited

Definition at line 76 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_panelCursors

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursors
protectedinherited

Definition at line 87 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_panelCursorsAndTune

wxPanel* SIM_PLOT_FRAME_BASE::m_panelCursorsAndTune
protectedinherited

Definition at line 85 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_panelLeft

wxPanel* SIM_PLOT_FRAME_BASE::m_panelLeft
protectedinherited

Definition at line 67 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_panelSignals

wxPanel* SIM_PLOT_FRAME_BASE::m_panelSignals
protectedinherited

Definition at line 82 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_perspective

wxString EDA_BASE_FRAME::m_perspective
protectedinherited

Definition at line 147 of file eda_base_frame.h.

Referenced by EDA_BASE_FRAME::LoadSettings().

◆ m_plotNotebook

wxAuiNotebook* SIM_PLOT_FRAME_BASE::m_plotNotebook
protectedinherited

◆ m_plotPanel

wxPanel* SIM_PLOT_FRAME_BASE::m_plotPanel
protectedinherited

Definition at line 70 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_plots

std::map<SIM_PLOT_PANEL*, PLOT_INFO> SIM_PLOT_FRAME::m_plots
private

◆ m_probeSignals

wxMenuItem* SIM_PLOT_FRAME_BASE::m_probeSignals
protectedinherited

◆ m_reporter

SIM_THREAD_REPORTER* SIM_PLOT_FRAME::m_reporter
private

Definition at line 299 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME(), and ~SIM_PLOT_FRAME().

◆ m_runSimulation

wxMenuItem* SIM_PLOT_FRAME_BASE::m_runSimulation
protectedinherited

◆ m_savedWorkbooksPath

wxString SIM_PLOT_FRAME::m_savedWorkbooksPath
staticprivate

A string to store the path of saved workbooks during a session

Definition at line 352 of file sim_plot_frame.h.

Referenced by menuOpenWorkbook(), menuSaveWorkbook(), and SIM_PLOT_FRAME().

◆ m_schematicFrame

SCH_EDIT_FRAME* SIM_PLOT_FRAME::m_schematicFrame
private

◆ m_settings

wxMenuItem* SIM_PLOT_FRAME_BASE::m_settings
protectedinherited

◆ m_settingsDlg

DIALOG_SIM_SETTINGS* SIM_PLOT_FRAME::m_settingsDlg
private

Definition at line 322 of file sim_plot_frame.h.

Referenced by onSettings(), SIM_PLOT_FRAME(), StartSimulation(), and ~SIM_PLOT_FRAME().

◆ m_showNetlist

wxMenuItem* SIM_PLOT_FRAME_BASE::m_showNetlist
protectedinherited

◆ m_sidePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_sidePanel
protectedinherited

Definition at line 79 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_sideSizer

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sideSizer
protectedinherited

Definition at line 80 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_signals

wxListView* SIM_PLOT_FRAME_BASE::m_signals
protectedinherited

◆ m_signalsIconColorList

wxImageList* SIM_PLOT_FRAME::m_signalsIconColorList
private

imagelists uset to add a small coloured icon to signal names and cursors name, the same color as the corresponding signal traces

Definition at line 349 of file sim_plot_frame.h.

Referenced by onCursorUpdate(), SIM_PLOT_FRAME(), updateSignalList(), and ~SIM_PLOT_FRAME().

◆ m_simConsole

wxTextCtrl* SIM_PLOT_FRAME_BASE::m_simConsole
protectedinherited

◆ m_simulationMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_simulationMenu
protectedinherited

Definition at line 56 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_simulator

◆ m_sizer11

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer11
protectedinherited

Definition at line 68 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_sizer8

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizer8
protectedinherited

Definition at line 74 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_sizerConsole

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerConsole
protectedinherited

Definition at line 77 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_sizerMain

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerMain
protectedinherited

Definition at line 64 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_sizerPlot

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_sizerPlot
protectedinherited

Definition at line 71 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_splitterLeftRight

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterLeftRight
protectedinherited

◆ m_splitterLeftRightSashPosition

int SIM_PLOT_FRAME::m_splitterLeftRightSashPosition
private

Definition at line 355 of file sim_plot_frame.h.

Referenced by LoadSettings(), and setSubWindowsSashSize().

◆ m_splitterPlotAndConsole

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsole
protectedinherited

◆ m_splitterPlotAndConsoleSashPosition

int SIM_PLOT_FRAME::m_splitterPlotAndConsoleSashPosition
private

Definition at line 356 of file sim_plot_frame.h.

Referenced by LoadSettings(), and setSubWindowsSashSize().

◆ m_splitterSignals

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterSignals
protectedinherited

◆ m_splitterSignalsSashPosition

int SIM_PLOT_FRAME::m_splitterSignalsSashPosition
private

Definition at line 357 of file sim_plot_frame.h.

Referenced by LoadSettings(), and setSubWindowsSashSize().

◆ m_splitterTuneValues

wxSplitterWindow* SIM_PLOT_FRAME_BASE::m_splitterTuneValues
protectedinherited

◆ m_splitterTuneValuesSashPosition

int SIM_PLOT_FRAME::m_splitterTuneValuesSashPosition
private

Definition at line 358 of file sim_plot_frame.h.

Referenced by LoadSettings(), and setSubWindowsSashSize().

◆ m_staticText2

wxStaticText* SIM_PLOT_FRAME_BASE::m_staticText2
protectedinherited

Definition at line 83 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_staticText3

wxStaticText* SIM_PLOT_FRAME_BASE::m_staticText3
protectedinherited

Definition at line 88 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_staticText4

wxStaticText* SIM_PLOT_FRAME_BASE::m_staticText4
protectedinherited

Definition at line 91 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_staticTextInfo

wxStaticText* SIM_PLOT_FRAME_BASE::m_staticTextInfo
protectedinherited

Definition at line 75 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_toolAddSignals

wxToolBarToolBase* SIM_PLOT_FRAME::m_toolAddSignals
private

Definition at line 291 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME().

◆ m_toolBar

wxToolBar* SIM_PLOT_FRAME_BASE::m_toolBar
protectedinherited

◆ m_toolManager

TOOL_MANAGER* EDA_BASE_FRAME::m_toolManager
protectedinherited

Definition at line 129 of file eda_base_frame.h.

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_FRAME::ActivateGalCanvas(), SCH_EDIT_FRAME::AddJunction(), EDA_BASE_FRAME::AddStandardHelpMenu(), EDA_DRAW_FRAME::AddStandardSubMenus(), SCH_EDIT_FRAME::AppendSchematic(), GERBVIEW_FRAME::Clear_DrawLayers(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::ConvertTextType(), EDA_3D_VIEWER::CreateMenuBar(), LIB_EDIT_FRAME::CreateNewPart(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), LIB_VIEW_FRAME::DClickOnCmpList(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_FRAME::DisplayCurrentSheet(), LIB_EDIT_FRAME::emptyScreen(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), EDA_BASE_FRAME::GetToolManager(), PL_EDITOR_FRAME::HardRedraw(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::KiwayMailIn(), PCB_EDIT_FRAME::KiwayMailIn(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), LIB_EDIT_FRAME::LoadOneLibraryPartAux(), LIB_EDIT_FRAME::LoadOneSymbol(), GERBVIEW_FRAME::OnCloseWindow(), LIB_EDIT_FRAME::OnExportBody(), LIB_EDIT_FRAME::OnImportBody(), PL_EDITOR_FRAME::OnNewPageLayout(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), EDA_DRAW_FRAME::OnSelectGrid(), LIB_EDIT_FRAME::OnSelectUnit(), EDA_DRAW_FRAME::OnSelectZoom(), SCH_EDIT_FRAME::OpenProjectFiles(), EDA_BASE_FRAME::PopTool(), EDA_BASE_FRAME::PushTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), LIB_VIEW_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), SCH_BASE_FRAME::RefreshSelection(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), LIB_EDIT_FRAME::RollbackPartFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_EDIT_FRAME::saveLibrary(), SCH_EDIT_FRAME::SchematicCleanUp(), GERBVIEW_FRAME::SetActiveLayer(), PCB_BASE_EDIT_FRAME::SetBoard(), LIB_EDIT_FRAME::SetCurPart(), SCH_BASE_FRAME::SetScreen(), LIB_VIEW_FRAME::SetSelectedComponent(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), LIB_VIEW_FRAME::setupTools(), GERBVIEW_FRAME::setupTools(), LIB_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::updateView(), EDA_DRAW_FRAME::Zoom_Automatique(), CVPCB_MAINFRAME::~CVPCB_MAINFRAME(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), EDA_DRAW_FRAME::~EDA_DRAW_FRAME(), FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME(), and KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().

◆ m_toolProbe

wxToolBarToolBase* SIM_PLOT_FRAME::m_toolProbe
private

Definition at line 292 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME().

◆ m_toolSettings

wxToolBarToolBase* SIM_PLOT_FRAME::m_toolSettings
private

Definition at line 294 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME().

◆ m_toolSimulate

wxToolBarToolBase* SIM_PLOT_FRAME::m_toolSimulate
private

Definition at line 290 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME().

◆ m_toolStack

std::vector<std::string> EDA_BASE_FRAME::m_toolStack
protectedinherited

◆ m_toolTune

wxToolBarToolBase* SIM_PLOT_FRAME::m_toolTune
private

Definition at line 293 of file sim_plot_frame.h.

Referenced by SIM_PLOT_FRAME().

◆ m_tunePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_tunePanel
protectedinherited

◆ m_tuners

std::list<TUNER_SLIDER*> SIM_PLOT_FRAME::m_tuners
private

List of currently displayed tuners

Definition at line 316 of file sim_plot_frame.h.

Referenced by AddTuner(), applyTuners(), RemoveTuner(), and updateTuners().

◆ m_tuneSizer

wxBoxSizer* SIM_PLOT_FRAME_BASE::m_tuneSizer
protectedinherited

Definition at line 92 of file sim_plot_frame_base.h.

Referenced by AddTuner(), and SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_tuneValue

wxMenuItem* SIM_PLOT_FRAME_BASE::m_tuneValue
protectedinherited

◆ m_userUnits

◆ m_viewMenu

wxMenu* SIM_PLOT_FRAME_BASE::m_viewMenu
protectedinherited

Definition at line 63 of file sim_plot_frame_base.h.

Referenced by SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE().

◆ m_welcomePanel

wxPanel* SIM_PLOT_FRAME_BASE::m_welcomePanel
protectedinherited

The documentation for this class was generated from the following files: