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, wxFileHistory *aFileHistory=NULL)
 Fetches the file name from the file history list. More...
 
void UpdateFileHistory (const wxString &FullFileName, wxFileHistory *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:321
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 419 of file sim_plot_frame.cpp.

420 {
421  addPlot( aDeviceName, SPT_CURRENT, aParam );
422 }
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::addSelectionToPlotFrame().

◆ 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 489 of file sim_plot_frame.cpp.

490 {
491  SIM_TYPE simType = m_exporter->GetSimType();
492 
493  if( simType == ST_UNKNOWN )
494  {
495  m_simConsole->AppendText( _( "Error: simulation type not defined!\n" ) );
496  m_simConsole->SetInsertionPointEnd();
497  return;
498  }
499  else if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
500  {
501  m_simConsole->AppendText( _( "Error: simulation type doesn't support plotting!\n" ) );
502  m_simConsole->SetInsertionPointEnd();
503  return;
504  }
505 
506  // Create a new plot if the current one displays a different type
507  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
508 
509  if( !plotPanel || plotPanel->GetType() != simType )
510  plotPanel = NewPlotPanel( simType );
511 
512  TRACE_DESC descriptor( *m_exporter, aName, aType, aParam );
513 
514  bool updated = false;
515  SIM_PLOT_TYPE xAxisType = GetXAxisType( simType );
516 
517  if( xAxisType == SPT_LIN_FREQUENCY || xAxisType == SPT_LOG_FREQUENCY )
518  {
519  int baseType = descriptor.GetType() & ~( SPT_AC_MAG | SPT_AC_PHASE );
520 
521  // Add two plots: magnitude & phase
522  TRACE_DESC mag_desc( *m_exporter, descriptor, (SIM_PLOT_TYPE)( baseType | SPT_AC_MAG ) );
523  TRACE_DESC phase_desc( *m_exporter, descriptor, (SIM_PLOT_TYPE)( baseType | SPT_AC_PHASE ) );
524 
525  updated |= updatePlot( mag_desc, plotPanel );
526  updated |= updatePlot( phase_desc, plotPanel );
527  }
528  else
529  {
530  updated = updatePlot( descriptor, plotPanel );
531  }
532 
533  if( updated )
534  {
536  }
537 }
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 364 of file eda_base_frame.cpp.

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

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 425 of file sim_plot_frame.cpp.

426 {
427  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
428 
429  if( !plotPanel )
430  return;
431 
432  // For now limit the tuner tool to RLC components
433  char primitiveType = NETLIST_EXPORTER_PSPICE::GetSpiceField( SF_PRIMITIVE, aComponent, 0 )[0];
434 
435  if( primitiveType != SP_RESISTOR && primitiveType != SP_CAPACITOR && primitiveType != SP_INDUCTOR )
436  return;
437 
438  const wxString componentName = aComponent->GetField( REFERENCE )->GetText();
439 
440  // Do not add multiple instances for the same component
441  auto tunerIt = std::find_if( m_tuners.begin(), m_tuners.end(), [&]( const TUNER_SLIDER* t )
442  {
443  return t->GetComponentName() == componentName;
444  }
445  );
446 
447  if( tunerIt != m_tuners.end() )
448  return; // We already have it
449 
450  try
451  {
452  TUNER_SLIDER* tuner = new TUNER_SLIDER( this, m_tunePanel, aComponent );
453  m_tuneSizer->Add( tuner );
454  m_tuners.push_back( tuner );
455  m_tunePanel->Layout();
456  }
457  catch( const KI_PARAM_ERROR& e )
458  {
459  // Sorry, no bonus
460  DisplayError( nullptr, e.What() );
461  }
462 }
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
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243
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 413 of file sim_plot_frame.cpp.

414 {
415  addPlot( aNetName, SPT_VOLTAGE, "V" );
416 }
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().

◆ 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 783 of file sim_plot_frame.cpp.

784 {
785  for( auto& tuner : m_tuners )
786  {
788  std::string command( "alter @" + tuner->GetSpiceName()
789  + "=" + tuner->GetValue().ToSpiceString() );
790 
791  m_simulator->Command( command );
792  }
793 }
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 213 of file eda_base_frame.h.

214  {
215  SetUserUnits( aUnits );
217  }
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 687 of file eda_base_frame.cpp.

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

Definition at line 393 of file eda_base_frame.cpp.

394 {
396 
397  if( GetMenuBar() )
398  {
399  // For icons in menus, icon scaling & hotkeys
400  ReCreateMenuBar();
401  GetMenuBar()->Refresh();
402  }
403 
404  wxConfigBase* settings = Pgm().CommonSettings();
405 
406  settings->Read( WARP_MOUSE_ON_MOVE_KEY, &m_moveWarpsCursor );
407  settings->Read( PREFER_SELECT_TO_DRAG_KEY, &m_dragSelects );
408  settings->Read( IMMEDIATE_ACTIONS_KEY, &m_immediateActions );
409 }
#define IMMEDIATE_ACTIONS_KEY
Definition: pgm_base.h:59
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
#define PREFER_SELECT_TO_DRAG_KEY
Definition: pgm_base.h:60
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:65
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:204
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:154
#define WARP_MOUSE_ON_MOVE_KEY
Definition: pgm_base.h:58
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 535 of file eda_base_frame.cpp.

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

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 337 of file eda_base_frame.h.

338  {
339  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
340  return baseCfgName;
341  }
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 475 of file sim_plot_frame.cpp.

476 {
477  wxWindow* curPage = m_plotNotebook->GetCurrentPage();
478 
479  return ( curPage == m_welcomePanel ) ? nullptr : static_cast<SIM_PLOT_PANEL*>( curPage );
480 }
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 219 of file eda_base_frame.cpp.

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

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 237 of file eda_base_frame.h.

237 {};

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 302 of file eda_base_frame.cpp.

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

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 467 of file eda_base_frame.h.

467 { 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 166 of file eda_base_frame.h.

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

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 282 of file eda_base_frame.h.

282 { 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 158 of file eda_base_frame.h.

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

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 243 of file eda_base_frame.h.

243 { 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 249 of file eda_base_frame.h.

249 { 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 483 of file sim_plot_frame.cpp.

484 {
485  return m_exporter.get();
486 }
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,
wxFileHistory *  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 wxFileHistory::UseMenu was called at init time

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

Definition at line 574 of file eda_base_frame.cpp.

576 {
577  wxFileHistory* fileHistory = aFileHistory;
578 
579  if( !fileHistory )
580  fileHistory = &Kiface().GetFileHistory();
581 
582  int baseId = fileHistory->GetBaseId();
583 
584  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) fileHistory->GetCount() );
585 
586  unsigned i = cmdId - baseId;
587 
588  if( i < fileHistory->GetCount() )
589  {
590  wxString fn = fileHistory->GetHistoryFile( i );
591 
592  if( wxFileName::FileExists( fn ) )
593  return fn;
594  else
595  {
596  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
597  wxMessageBox( msg );
598 
599  fileHistory->RemoveFileFromHistory( i );
600  }
601  }
602 
603  return wxEmptyString;
604 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
#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:597

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 255 of file eda_base_frame.h.

255 { return m_moveWarpsCursor; }

References EDA_BASE_FRAME::m_moveWarpsCursor.

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

◆ GetMruPath()

wxString EDA_BASE_FRAME::GetMruPath ( ) const
inlineinherited

◆ GetToolManager()

TOOL_MANAGER* EDA_BASE_FRAME::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 222 of file eda_base_frame.h.

222 { 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(), SCH_EDIT_FRAME::DisplayCurrentSheet(), 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(), 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_FIND::onButtonFindItemClick(), DIALOG_FIND::onButtonFindMarkerClick(), 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(), BOARD_COMMIT::Push(), SCH_EDIT_FRAME::PutDataInPreviousState(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), 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 210 of file eda_base_frame.h.

210 { 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(), DRAWING_TOOL::DrawDimension(), 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_PREV_3D::PANEL_PREV_3D(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), DRC::Reset(), CONNECTION_SUBGRAPH::ResolveDrivers(), DIALOG_BOARD_STATISTICS::saveReportClicked(), 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_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(), DIALOG_BOARD_STATISTICS::updateWidets(), 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 902 of file sim_plot_frame.cpp.

903 {
904  switch( aType )
905  {
906  case ST_AC:
907  return SPT_LIN_FREQUENCY;
909 
910  case ST_DC:
911  return SPT_SWEEP;
912 
913  case ST_TRANSIENT:
914  return SPT_TIME;
915 
916  default:
917  wxASSERT_MSG( false, "Unhandled simulation type" );
918  return (SIM_PLOT_TYPE) 0;
919  }
920 }
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 550 of file eda_base_frame.cpp.

551 {
552  return Kiface().GetHelpFileName();
553 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
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, and KICAD_MANAGER_FRAME.

Definition at line 311 of file eda_base_frame.h.

311 { }

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 181 of file eda_base_frame.h.

181 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsCurrentTool()

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

Definition at line 228 of file eda_base_frame.cpp.

229 {
230  if( m_toolStack.empty() )
231  return &aAction == &ACTIONS::selectionTool;
232  else
233  return m_toolStack.back() == aAction.GetName();
234 }
std::vector< std::string > m_toolStack
static TOOL_ACTION selectionTool
Definition: actions.h:142
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 284 of file eda_base_frame.h.

284 { 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_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 643 of file eda_base_frame.cpp.

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

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 796 of file sim_plot_frame.cpp.

797 {
798  m_plots.clear();
799  m_plotNotebook->DeleteAllPages();
800 
801  wxTextFile file( aPath );
802 
803  if( !file.Open() )
804  return false;
805 
806  long plotsCount;
807 
808  if( !file.GetFirstLine().ToLong( &plotsCount ) ) // GetFirstLine instead of GetNextLine
809  return false;
810 
811  for( long i = 0; i < plotsCount; ++i )
812  {
813  long plotType, tracesCount;
814 
815  if( !file.GetNextLine().ToLong( &plotType ) )
816  return false;
817 
818  SIM_PLOT_PANEL* plotPanel = NewPlotPanel( (SIM_TYPE) plotType );
819  m_plots[plotPanel].m_simCommand = file.GetNextLine();
820  StartSimulation();
821 
822  // Perform simulation, so plots can be added with values
823  do
824  {
825  wxThread::This()->Sleep( 50 );
826  }
827  while( IsSimulationRunning() );
828 
829  if( !file.GetNextLine().ToLong( &tracesCount ) )
830  return false;
831 
832  for( long j = 0; j < tracesCount; ++j )
833  {
834  long traceType;
835  wxString name, param;
836 
837  if( !file.GetNextLine().ToLong( &traceType ) )
838  return false;
839 
840  name = file.GetNextLine();
841  param = file.GetNextLine();
842 
843  if( name.IsEmpty() || param.IsEmpty() )
844  return false;
845 
846  addPlot( name, (SIM_PLOT_TYPE) traceType, param );
847  }
848  }
849 
850  return true;
851 }
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:597
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 121 of file sim_plot_frame_base.h.

122  {
123  m_splitterLeftRight->SetSashPosition( 700 );
124  m_splitterLeftRight->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this );
125  }
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 127 of file sim_plot_frame_base.h.

128  {
129  m_splitterPlotAndConsole->SetSashPosition( 500 );
130  m_splitterPlotAndConsole->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this );
131  }
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 133 of file sim_plot_frame_base.h.

134  {
135  m_splitterSignals->SetSashPosition( 0 );
136  m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this );
137  }
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 139 of file sim_plot_frame_base.h.

140  {
141  m_splitterTuneValues->SetSashPosition( 0 );
142  m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this );
143  }
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 923 of file sim_plot_frame.cpp.

924 {
925  SIM_TYPE type = m_exporter->GetSimType();
926 
927  if( SIM_PLOT_PANEL::IsPlottable( type ) )
928  {
929  SIM_PLOT_PANEL* prevPlot = CurrentPlot();
930  SIM_PLOT_PANEL* newPlot = NewPlotPanel( type );
931 
932  // If the previous plot had the same type, copy the simulation command
933  if( prevPlot )
934  m_plots[newPlot].m_simCommand = m_plots[prevPlot].m_simCommand;
935  }
936 }
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 939 of file sim_plot_frame.cpp.

940 {
941  wxFileDialog openDlg( this, _( "Open simulation workbook" ), m_savedWorkbooksPath, "",
942  WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
943 
944  if( openDlg.ShowModal() == wxID_CANCEL )
945  return;
946 
947  m_savedWorkbooksPath = openDlg.GetDirectory();
948 
949  if( !loadWorkbook( openDlg.GetPath() ) )
950  DisplayError( this, _( "There was an error while opening the workbook file" ) );
951 }
#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()
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243

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 987 of file sim_plot_frame.cpp.

988 {
989  if( !CurrentPlot() )
990  return;
991 
992  const wxChar SEPARATOR = ';';
993 
994  wxFileDialog saveDlg( this, _( "Save Plot Data" ), "", "",
995  CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
996 
997  if( saveDlg.ShowModal() == wxID_CANCEL )
998  return;
999 
1000  wxFile out( saveDlg.GetPath(), wxFile::write );
1001  bool timeWritten = false;
1002 
1003  for( const auto& t : CurrentPlot()->GetTraces() )
1004  {
1005  const TRACE* trace = t.second;
1006 
1007  if( !timeWritten )
1008  {
1009  out.Write( wxString::Format( "Time%c", SEPARATOR ) );
1010 
1011  for( double v : trace->GetDataX() )
1012  out.Write( wxString::Format( "%f%c", v, SEPARATOR ) );
1013 
1014  out.Write( "\r\n" );
1015  timeWritten = true;
1016  }
1017 
1018  out.Write( wxString::Format( "%s%c", t.first, SEPARATOR ) );
1019 
1020  for( double v : trace->GetDataY() )
1021  out.Write( wxString::Format( "%f%c", v, SEPARATOR ) );
1022 
1023  out.Write( "\r\n" );
1024  }
1025 
1026  out.Close();
1027 }
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 972 of file sim_plot_frame.cpp.

973 {
974  if( !CurrentPlot() )
975  return;
976 
977  wxFileDialog saveDlg( this, _( "Save Plot as Image" ), "", "",
978  PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
979 
980  if( saveDlg.ShowModal() == wxID_CANCEL )
981  return;
982 
983  CurrentPlot()->SaveScreenshot( saveDlg.GetPath(), wxBITMAP_TYPE_PNG );
984 }
#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:3033

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

◆ menuSaveWorkbook()

void SIM_PLOT_FRAME::menuSaveWorkbook ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from SIM_PLOT_FRAME_BASE.

Definition at line 954 of file sim_plot_frame.cpp.

955 {
956  if( !CurrentPlot() )
957  return;
958 
959  wxFileDialog saveDlg( this, _( "Save Simulation Workbook" ), m_savedWorkbooksPath, "",
960  WorkbookFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
961 
962  if( saveDlg.ShowModal() == wxID_CANCEL )
963  return;
964 
965  m_savedWorkbooksPath = saveDlg.GetDirectory();
966 
967  if( !saveWorkbook( saveDlg.GetPath() ) )
968  DisplayError( this, _( "There was an error while saving the workbook file" ) );
969 }
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()
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243

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 1051 of file sim_plot_frame.cpp.

1052 {
1053  SIM_PLOT_PANEL* plot = CurrentPlot();
1054 
1055  if( plot )
1056  plot->ShowGrid( !plot->IsGridShown() );
1057 }
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 1060 of file sim_plot_frame.cpp.

1061 {
1062  SIM_PLOT_PANEL* plot = CurrentPlot();
1063 
1064  event.Check( plot ? plot->IsGridShown() : false );
1065 }
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 1068 of file sim_plot_frame.cpp.

1069 {
1070  SIM_PLOT_PANEL* plot = CurrentPlot();
1071 
1072  if( plot )
1073  plot->ShowLegend( !plot->IsLegendShown() );
1074 }
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 1077 of file sim_plot_frame.cpp.

1078 {
1079  SIM_PLOT_PANEL* plot = CurrentPlot();
1080  event.Check( plot ? plot->IsLegendShown() : false );
1081 }
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 1044 of file sim_plot_frame.cpp.

1045 {
1046  if( CurrentPlot() )
1047  CurrentPlot()->Fit();
1048 }
void Fit() override
Set view to fit global bounding box of all plot layers and refresh display.
Definition: mathplot.cpp:1995
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 1030 of file sim_plot_frame.cpp.

1031 {
1032  if( CurrentPlot() )
1033  CurrentPlot()->ZoomIn();
1034 }
void ZoomIn(const wxPoint &centerPoint=wxDefaultPosition)
Zoom into current view and refresh display.
Definition: mathplot.cpp:2238
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 1037 of file sim_plot_frame.cpp.

1038 {
1039  if( CurrentPlot() )
1040  CurrentPlot()->ZoomOut();
1041 }
void ZoomOut(const wxPoint &centerPoint=wxDefaultPosition)
Zoom out current view and refresh display.
Definition: mathplot.cpp:2295
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  if( m_welcomePanel )
399  {
400  m_plotNotebook->DeletePage( 0 );
401  m_welcomePanel = nullptr;
402  }
403 
404  m_plotNotebook->AddPage( plotPanel, wxString::Format( _( "Plot%u" ),
405  (unsigned int) m_plotNotebook->GetPageCount() + 1 ), true );
406 
407  m_plots[plotPanel] = PLOT_INFO();
408 
409  return plotPanel;
410 }
wxAuiNotebook * m_plotNotebook
std::map< SIM_PLOT_PANEL *, PLOT_INFO > m_plots
Map of plot panels and associated data
#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

References _, Format(), SIM_PLOT_FRAME_BASE::m_plotNotebook, m_plots, 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 1183 of file sim_plot_frame.cpp.

1184 {
1185  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1186 
1187  if( !plotPanel || !m_exporter || plotPanel->GetType() != m_exporter->GetSimType() )
1188  {
1189  DisplayInfoMessage( this, _( "You need to run simulation first." ) );
1190  return;
1191  }
1192 
1193  DIALOG_SIGNAL_LIST dialog( this, m_exporter.get() );
1194  dialog.ShowModal();
1195 }
#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:276

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 295 of file eda_base_frame.cpp.

296 {
297  if( !doAutoSave() )
298  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
299 }
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).

Definition at line 308 of file eda_base_frame.cpp.

309 {
310  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
311  // Key events can be filtered here.
312  // Currently no filtering is made.
313  event.Skip();
314 }
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 1268 of file sim_plot_frame.cpp.

1269 {
1270  SaveSettings( config() );
1271 
1272  if( IsSimulationRunning() )
1273  m_simulator->Stop();
1274 
1275  // Cancel a running simProbe or simTune tool
1277 
1278  Destroy();
1279 }
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 1282 of file sim_plot_frame.cpp.

1283 {
1284  wxSize size = m_cursors->GetClientSize();
1285  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1286  m_cursors->ClearAll();
1287 
1288  if( !plotPanel )
1289  return;
1290 
1292  m_cursors->SetImageList(m_signalsIconColorList, wxIMAGE_LIST_SMALL);
1293 
1294  // Fill the signals listctrl
1295  m_cursors->AppendColumn( _( "Signal" ), wxLIST_FORMAT_LEFT, size.x / 2 );
1296  const long X_COL = m_cursors->AppendColumn( plotPanel->GetLabelX(), wxLIST_FORMAT_LEFT, size.x / 4 );
1297 
1298  wxString labelY1 = plotPanel->GetLabelY1();
1299  wxString labelY2 = plotPanel->GetLabelY2();
1300  wxString labelY;
1301 
1302  if( !labelY2.IsEmpty() )
1303  labelY = labelY1 + " / " + labelY2;
1304  else
1305  labelY = labelY1;
1306 
1307  const long Y_COL = m_cursors->AppendColumn( labelY, wxLIST_FORMAT_LEFT, size.x / 4 );
1308 
1309  // Update cursor values
1310  int itemidx = 0;
1311  for( const auto& trace : plotPanel->GetTraces() )
1312  {
1313  if( CURSOR* cursor = trace.second->GetCursor() )
1314  {
1315  // Find the right icon color in list.
1316  // It is the icon used in m_signals list for the same trace
1317  long iconColor = m_signals->FindItem( -1, trace.first );
1318 
1319  const wxRealPoint coords = cursor->GetCoords();
1320  long idx = m_cursors->InsertItem( itemidx++, trace.first, iconColor );
1321  m_cursors->SetItem( idx, X_COL, SPICE_VALUE( coords.x ).ToSpiceString() );
1322  m_cursors->SetItem( idx, Y_COL, SPICE_VALUE( coords.y ).ToSpiceString() );
1323  }
1324  }
1325 }
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 607 of file eda_base_frame.cpp.

608 {
609  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
610  ShowAboutDialog( this );
611 }
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 317 of file eda_base_frame.cpp.

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

1103 {
1104  updateSignalList();
1105  updateCursors();
1106 }
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 1084 of file sim_plot_frame.cpp.

1085 {
1086  int idx = event.GetSelection();
1087 
1088  if( idx == wxNOT_FOUND )
1089  return;
1090 
1091  SIM_PLOT_PANEL* plotPanel = dynamic_cast<SIM_PLOT_PANEL*>( m_plotNotebook->GetPage( idx ) );
1092 
1093  if( !plotPanel )
1094  return;
1095 
1096  m_plots.erase( plotPanel );
1097  updateSignalList();
1098  updateCursors();
1099 }
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 614 of file eda_base_frame.cpp.

615 {
616  PAGED_DIALOG dlg( this, _( "Preferences" ) );
617  wxTreebook* book = dlg.GetTreebook();
618 
619  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
620 
621  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
622  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
623 
624  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
625  {
626  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
627 
628  if( frame )
629  frame->InstallPreferences( &dlg, hotkeysPanel );
630  }
631 
632  // The Kicad manager frame is not a player so we have to add it by hand
633  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
634 
635  if( manager )
636  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
637 
638  if( dlg.ShowModal() == wxID_OK )
639  dlg.Kiway().CommonSettingsChanged( false );
640 }
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:321
#define _(s)
#define KICAD_MANAGER_FRAME_NAME
size_t i
Definition: json11.cpp:597
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 1198 of file sim_plot_frame.cpp.

1199 {
1200  if( m_schematicFrame == NULL )
1201  return;
1202 
1204  m_schematicFrame->Raise();
1205 }
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 1146 of file sim_plot_frame.cpp.

1147 {
1148  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1149 
1150  // Initial processing is required to e.g. display a list of power sources
1152 
1153  if( !m_exporter->ProcessNetlist( NET_ALL_FLAGS ) )
1154  {
1155  DisplayError( this, _( "There were errors during netlist export, aborted." ) );
1156  return;
1157  }
1158 
1159  if( !m_settingsDlg )
1160  m_settingsDlg = new DIALOG_SIM_SETTINGS( this );
1161 
1162  if( plotPanel )
1163  m_settingsDlg->SetSimCommand( m_plots[plotPanel].m_simCommand );
1164 
1166 
1167  if( m_settingsDlg->ShowModal() == wxID_OK )
1168  {
1169  wxString newCommand = m_settingsDlg->GetSimCommand();
1170  SIM_TYPE newSimType = NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType( newCommand );
1171 
1172  // If it is a new simulation type, open a new plot
1173  if( !plotPanel || ( plotPanel && plotPanel->GetType() != newSimType ) )
1174  {
1175  plotPanel = NewPlotPanel( newSimType );
1176  }
1177 
1178  m_plots[plotPanel].m_simCommand = newCommand;
1179  }
1180 }
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
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243
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 1217 of file sim_plot_frame.cpp.

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

1110 {
1111  // Remove signal from the plot panel when double clicked
1112  long idx = m_signals->GetFocusedItem();
1113 
1114  if( idx != wxNOT_FOUND )
1115  removePlot( m_signals->GetItemText( idx, 0 ) );
1116 }
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 1119 of file sim_plot_frame.cpp.

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

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 1335 of file sim_plot_frame.cpp.

1336 {
1337  m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( sim_run_xpm ) );
1338  SetCursor( wxCURSOR_ARROW );
1339 
1340  SIM_TYPE simType = m_exporter->GetSimType();
1341 
1342  if( simType == ST_UNKNOWN )
1343  return;
1344 
1345  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
1346 
1347  if( !plotPanel || plotPanel->GetType() != simType )
1348  plotPanel = NewPlotPanel( simType );
1349 
1350  if( IsSimulationRunning() )
1351  return;
1352 
1353  // If there are any signals plotted, update them
1354  if( SIM_PLOT_PANEL::IsPlottable( simType ) )
1355  {
1356  TRACE_MAP& traceMap = m_plots[plotPanel].m_traces;
1357 
1358  for( auto it = traceMap.begin(); it != traceMap.end(); /* iteration occurs in the loop */)
1359  {
1360  if( !updatePlot( it->second, plotPanel ) )
1361  {
1362  removePlot( it->first, false );
1363  it = traceMap.erase( it ); // remove a plot that does not exist anymore
1364  }
1365  else
1366  {
1367  ++it;
1368  }
1369  }
1370 
1371  updateSignalList();
1372  plotPanel->UpdateAll();
1373  plotPanel->ResetScales();
1374  }
1375  else
1376  {
1378  for( const auto& net : m_exporter->GetNetIndexMap() )
1379  {
1380  int node = net.second;
1381 
1382  if( node > 0 )
1383  m_simulator->Command( wxString::Format( "print v(%d)", node ).ToStdString() );
1384  }
1385  }
1386 }
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:2803
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 1411 of file sim_plot_frame.cpp.

1412 {
1413  m_simConsole->AppendText( aEvent.GetString() + "\n" );
1414  m_simConsole->SetInsertionPointEnd();
1415 }

References SIM_PLOT_FRAME_BASE::m_simConsole.

Referenced by SIM_PLOT_FRAME().

◆ onSimStarted()

void SIM_PLOT_FRAME::onSimStarted ( wxCommandEvent &  aEvent)
private

Definition at line 1328 of file sim_plot_frame.cpp.

1329 {
1330  m_toolBar->SetToolNormalBitmap( ID_SIM_RUN, KiBitmap( sim_stop_xpm ) );
1331  SetCursor( wxCURSOR_ARROWWAIT );
1332 }
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 1137 of file sim_plot_frame.cpp.

1138 {
1139  if( IsSimulationRunning() )
1140  StopSimulation();
1141  else
1142  StartSimulation();
1143 }
bool IsSimulationRunning()

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

Referenced by SIM_PLOT_FRAME().

◆ onSimUpdate()

void SIM_PLOT_FRAME::onSimUpdate ( wxCommandEvent &  aEvent)
private

Definition at line 1389 of file sim_plot_frame.cpp.

1390 {
1391  if( IsSimulationRunning() )
1392  StopSimulation();
1393 
1394  if( CurrentPlot() != m_lastSimPlot )
1395  {
1396  // We need to rerun simulation, as the simulator currently stores
1397  // results for another plot
1398  StartSimulation();
1399  }
1400  else
1401  {
1402  // Incremental update
1403  m_simConsole->Clear();
1404  // Do not export netlist, it is already stored in the simulator
1405  applyTuners();
1406  m_simulator->Run();
1407  }
1408 }
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 1208 of file sim_plot_frame.cpp.

1209 {
1210  if( m_schematicFrame == NULL )
1211  return;
1212 
1214  m_schematicFrame->Raise();
1215 }
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 181 of file eda_base_frame.cpp.

182 {
183  // Push/pop events can get out of order (such as when they're generated by the Simulator
184  // frame but not processed until the mouse is back in the Schematic frame), so make sure
185  // we're popping the right stack frame.
186 
187  for( int i = m_toolStack.size() - 1; i >= 0; --i )
188  {
189  if( m_toolStack[ i ] == actionName )
190  {
191  m_toolStack.erase( m_toolStack.begin() + i );
192 
193  // If there's something underneath us, and it's now the top of the stack, then
194  // re-activate it
195  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
196  {
197  std::string back = m_toolStack[ i ];
199 
200  if( action )
201  {
202  // Pop the action as running it will push it back onto the stack
203  m_toolStack.pop_back();
204 
205  TOOL_EVENT evt = action->MakeEvent();
206  evt.SetHasPosition( false );
207  GetToolManager()->PostEvent( evt );
208  }
209  }
210  else
212 
213  return;
214  }
215  }
216 }
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:168
std::vector< std::string > m_toolStack
ACTION_MANAGER * GetActionManager()
Definition: tool_manager.h:154
Class TOOL_ACTION.
Definition: tool_action.h:46
size_t i
Definition: json11.cpp:597
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:228
static TOOL_ACTION selectionTool
Definition: actions.h:142
void SetHasPosition(bool aHasPosition)
Definition: tool_event.h:258

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(), PCBNEW_PICKER_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 556 of file eda_base_frame.cpp.

557 {
558  SetStatusText( text );
559 }

◆ 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:163

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(), LIB_VIEW_FRAME::BestZoom(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), 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::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedAlias(), 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(), 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 237 of file eda_base_frame.cpp.

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

165 {
166  m_toolStack.push_back( actionName );
167 
168  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
169  if( m_toolStack.size() > 3 )
170  m_toolStack.erase( m_toolStack.begin() );
171 
172  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
173 
174  if( action )
175  DisplayToolMsg( action->GetLabel() );
176  else
177  DisplayToolMsg( actionName );
178 }
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:154
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(), PCBNEW_PICKER_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 465 of file eda_base_frame.h.

465 { };

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 540 of file sim_plot_frame.cpp.

541 {
542  SIM_PLOT_PANEL* plotPanel = CurrentPlot();
543 
544  if( !plotPanel )
545  return;
546 
547  if( aErase )
548  {
549  auto& traceMap = m_plots[plotPanel].m_traces;
550  auto traceIt = traceMap.find( aPlotName );
551  wxASSERT( traceIt != traceMap.end() );
552  traceMap.erase( traceIt );
553  }
554 
555  wxASSERT( plotPanel->TraceShown( aPlotName ) );
556  plotPanel->DeleteTrace( aPlotName );
557  plotPanel->Fit();
558 
560  updateCursors();
561 }
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:1995
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 465 of file sim_plot_frame.cpp.

466 {
467  if( aErase )
468  m_tuners.remove( aTuner );
469 
470  aTuner->Destroy();
471  m_tunePanel->Layout();
472 }
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 350 of file eda_base_frame.h.

350 {};

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 854 of file sim_plot_frame.cpp.

855 {
856 
857  wxString savePath = aPath;
858 
859  if( !savePath.Lower().EndsWith(".wbk"))
860  {
861  savePath += ".wbk";
862  };
863 
864 
865  wxTextFile file( savePath );
866 
867  if( file.Exists() )
868  {
869  if( !file.Open() )
870  return false;
871 
872  file.Clear();
873  }
874  else
875  {
876  file.Create();
877  }
878 
879  file.AddLine( wxString::Format( "%lu", m_plots.size() ) );
880 
881  for( const auto& plot : m_plots )
882  {
883  file.AddLine( wxString::Format( "%d", plot.first->GetType() ) );
884  file.AddLine( plot.second.m_simCommand );
885  file.AddLine( wxString::Format( "%lu", plot.second.m_traces.size() ) );
886 
887  for( const auto& trace : plot.second.m_traces )
888  {
889  file.AddLine( wxString::Format( "%d", trace.second.GetType() ) );
890  file.AddLine( trace.second.GetName() );
891  file.AddLine( trace.second.GetParam() );
892  }
893  }
894 
895  bool res = file.Write();
896  file.Close();
897 
898  return res;
899 }
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 276 of file eda_base_frame.cpp.

277 {
278  m_autoSaveInterval = aInterval;
279 
280  if( m_autoSaveTimer->IsRunning() )
281  {
282  if( m_autoSaveInterval > 0 )
283  {
284  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
285  }
286  else
287  {
288  m_autoSaveTimer->Stop();
289  m_autoSaveState = false;
290  }
291  }
292 }
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 390 of file eda_base_frame.h.

390 { 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(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), 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 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:276
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:243
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 449 of file eda_base_frame.h.

449 { };

Referenced by EDA_DRAW_FRAME::RecreateToolbars(), 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 544 of file eda_base_frame.cpp.

545 {
546  return Kiface().KifaceSearch();
547 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
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 196 of file eda_base_frame.h.

196 { }

Referenced by EDA_BASE_FRAME::ChangeUserUnits().

◆ updateCursors()

void SIM_PLOT_FRAME::updateCursors ( )
private

Updates the cursor values list.

Definition at line 751 of file sim_plot_frame.cpp.

752 {
753  wxQueueEvent( this, new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
754 }

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

◆ UpdateFileHistory()

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

Update the list of recently opened files.

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

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

Definition at line 562 of file eda_base_frame.cpp.

564 {
565  wxFileHistory* fileHistory = aFileHistory;
566 
567  if( !fileHistory )
568  fileHistory = &Kiface().GetFileHistory();
569 
570  fileHistory->AddFileToHistory( FullFileName );
571 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
FILE_HISTORY & GetFileHistory()
Definition: kiface_i.h:123

References 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 564 of file sim_plot_frame.cpp.

565 {
567 }
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 570 of file sim_plot_frame.cpp.

571 {
572  SIM_TYPE simType = m_exporter->GetSimType();
573  wxString spiceVector = m_exporter->GetSpiceVector( aDescriptor.GetName(),
574  aDescriptor.GetType(), aDescriptor.GetParam() );
575 
576  if( !SIM_PLOT_PANEL::IsPlottable( simType ) )
577  {
578  // There is no plot to be shown
579  m_simulator->Command( wxString::Format( "print %s", spiceVector ).ToStdString() );
580 
581  return false;
582  }
583 
584  // First, handle the x axis
585  wxString xAxisName( m_simulator->GetXAxis( simType ) );
586 
587  if( xAxisName.IsEmpty() )
588  return false;
589 
590  auto data_x = m_simulator->GetMagPlot( (const char*) xAxisName.c_str() );
591  unsigned int size = data_x.size();
592 
593  if( data_x.empty() )
594  return false;
595 
596  SIM_PLOT_TYPE plotType = aDescriptor.GetType();
597  std::vector<double> data_y;
598 
599  // Now, Y axis data
600  switch( m_exporter->GetSimType() )
601  {
602  case ST_AC:
603  {
604  wxASSERT_MSG( !( ( plotType & SPT_AC_MAG ) && ( plotType & SPT_AC_PHASE ) ),
605  "Cannot set both AC_PHASE and AC_MAG bits" );
606 
607  if( plotType & SPT_AC_MAG )
608  data_y = m_simulator->GetMagPlot( (const char*) spiceVector.c_str() );
609  else if( plotType & SPT_AC_PHASE )
610  data_y = m_simulator->GetPhasePlot( (const char*) spiceVector.c_str() );
611  else
612  wxASSERT_MSG( false, "Plot type missing AC_PHASE or AC_MAG bit" );
613  }
614  break;
615 
616  case ST_NOISE:
617  case ST_DC:
618  case ST_TRANSIENT:
619  {
620  data_y = m_simulator->GetMagPlot( (const char*) spiceVector.c_str() );
621  }
622  break;
623 
624  default:
625  wxASSERT_MSG( false, "Unhandled plot type" );
626  return false;
627  }
628 
629  if( data_y.size() != size )
630  return false;
631 
632  // If we did a two-source DC analysis, we need to split the resulting vector and add traces
633  // for each input step
634  SPICE_DC_PARAMS source1, source2;
635 
636  if( m_exporter->GetSimType() == ST_DC &&
637  m_exporter->ParseDCCommand( m_exporter->GetUsedSimCommand(), &source1, &source2 ) )
638  {
639  if( !source2.m_source.IsEmpty() )
640  {
641  // Source 1 is the inner loop, so lets add traces for each Source 2 (outer loop) step
642  SPICE_VALUE v = source2.m_vstart;
643  wxString name;
644 
645  size_t offset = 0;
646  size_t outer = ( size_t )( ( source2.m_vend - v ) / source2.m_vincrement ).ToDouble();
647  size_t inner = data_x.size() / ( outer + 1 );
648 
649  wxASSERT( data_x.size() % ( outer + 1 ) == 0 );
650 
651  for( size_t idx = 0; idx <= outer; idx++ )
652  {
653  name = wxString::Format( "%s (%s = %s V)", aDescriptor.GetTitle(),
654  source2.m_source, v.ToString() );
655 
656  std::vector<double> sub_x( data_x.begin() + offset,
657  data_x.begin() + offset + inner );
658  std::vector<double> sub_y( data_y.begin() + offset,
659  data_y.begin() + offset + inner );
660 
661  if( aPanel->AddTrace( name, inner,
662  sub_x.data(), sub_y.data(), aDescriptor.GetType() ) )
663  {
664  m_plots[aPanel].m_traces.insert( std::make_pair( name, aDescriptor ) );
665  }
666 
667  v = v + source2.m_vincrement;
668  offset += inner;
669  }
670 
671  return true;
672  }
673  }
674 
675  if( aPanel->AddTrace( aDescriptor.GetTitle(), size,
676  data_x.data(), data_y.data(), aDescriptor.GetType() ) )
677  {
678  m_plots[aPanel].m_traces.insert( std::make_pair( aDescriptor.GetTitle(), aDescriptor ) );
679  }
680 
681  return true;
682 }
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 685 of file sim_plot_frame.cpp.

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

443 { }

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 757 of file sim_plot_frame.cpp.

758 {
759  const auto& spiceItems = m_exporter->GetSpiceItems();
760 
761  for( auto it = m_tuners.begin(); it != m_tuners.end(); /* iteration inside the loop */ )
762  {
763  const wxString& ref = (*it)->GetComponentName();
764 
765  if( std::find_if( spiceItems.begin(), spiceItems.end(), [&]( const SPICE_ITEM& item )
766  {
767  return item.m_refName == ref;
768  }) == spiceItems.end() )
769  {
770  // The component does not exist anymore, remove the associated tuner
771  TUNER_SLIDER* tuner = *it;
772  it = m_tuners.erase( it );
773  RemoveTuner( tuner, false );
774  }
775  else
776  {
777  ++it;
778  }
779  }
780 }
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

◆ 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 56 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 77 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 88 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 86 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 68 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 83 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 146 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 71 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 80 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 81 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 57 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 69 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 75 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 78 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 65 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 72 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 84 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 89 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 92 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 76 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 128 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::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(), 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 93 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 64 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: