KiCad PCB EDA Suite
SIM_WORKBOOK Class Reference

#include <sim_workbook.h>

Inheritance diagram for SIM_WORKBOOK:

Public Member Functions

 SIM_WORKBOOK ()
 
 SIM_WORKBOOK (wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxAUI_NB_DEFAULT_STYLE)
 
bool AddPage (wxWindow *aPage, const wxString &aCaption, bool aSelect=false, const wxBitmap &aBitmap=wxNullBitmap)
 
bool AddPage (wxWindow *aPage, const wxString &aText, bool aSelect, int aImageId) override
 
bool DeleteAllPages () override
 
bool DeletePage (size_t aPage) override
 
bool AddTrace (SIM_PLOT_PANEL *aPlotPanel, const wxString &aTitle, const wxString &aName, int aPoints, const double *aX, const double *aY, SIM_PLOT_TYPE aType, const wxString &aParam)
 
bool DeleteTrace (SIM_PLOT_PANEL *aPlotPanel, const wxString &aName)
 
void SetSimCommand (SIM_PANEL_BASE *aPlotPanel, const wxString &aSimCommand)
 
const wxString & GetSimCommand (const SIM_PANEL_BASE *aPlotPanel)
 
void ClrModified ()
 
bool IsModified () const
 

Private Member Functions

void setModified (bool value=true)
 Dirty bit, indicates something in the workbook has changed. More...
 

Private Attributes

bool m_modified
 

Detailed Description

Definition at line 33 of file sim_workbook.h.

Constructor & Destructor Documentation

◆ SIM_WORKBOOK() [1/2]

SIM_WORKBOOK::SIM_WORKBOOK ( )

Definition at line 28 of file sim_workbook.cpp.

28  : wxAuiNotebook()
29 {
30  m_modified = false;
31 }

References m_modified.

◆ SIM_WORKBOOK() [2/2]

SIM_WORKBOOK::SIM_WORKBOOK ( wxWindow *  aParent,
wxWindowID  aId = wxID_ANY,
const wxPoint &  aPos = wxDefaultPosition,
const wxSize &  aSize = wxDefaultSize,
long  aStyle = wxAUI_NB_DEFAULT_STYLE 
)

Definition at line 34 of file sim_workbook.cpp.

35  : wxAuiNotebook( aParent, aId, aPos, aSize, aStyle )
36 {
37  m_modified = false;
38 }

References m_modified.

Member Function Documentation

◆ AddPage() [1/2]

bool SIM_WORKBOOK::AddPage ( wxWindow *  aPage,
const wxString &  aCaption,
bool  aSelect = false,
const wxBitmap &  aBitmap = wxNullBitmap 
)

Definition at line 41 of file sim_workbook.cpp.

42 {
43  bool res = wxAuiNotebook::AddPage( page, caption, select, bitmap );
44  setModified( res );
45  return res;
46 }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.

References setModified().

Referenced by SIM_PLOT_FRAME::NewPlotPanel().

◆ AddPage() [2/2]

bool SIM_WORKBOOK::AddPage ( wxWindow *  aPage,
const wxString &  aText,
bool  aSelect,
int  aImageId 
)
override

Definition at line 49 of file sim_workbook.cpp.

50 {
51  bool res = wxAuiNotebook::AddPage( page, text, select, imageId );
52  setModified( res );
53  return res;
54 }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.

References setModified(), and text.

◆ AddTrace()

bool SIM_WORKBOOK::AddTrace ( SIM_PLOT_PANEL aPlotPanel,
const wxString &  aTitle,
const wxString &  aName,
int  aPoints,
const double *  aX,
const double *  aY,
SIM_PLOT_TYPE  aType,
const wxString &  aParam 
)

Definition at line 73 of file sim_workbook.cpp.

76 {
77  bool res = aPlotPanel->addTrace( aTitle, aName, aPoints, aX, aY, aType, aParam );
78  setModified( res );
79  return res;
80 }
bool addTrace(const wxString &aTitle, const wxString &aName, int aPoints, const double *aX, const double *aY, SIM_PLOT_TYPE aType, const wxString &aParam)
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.

References SIM_PLOT_PANEL::addTrace(), and setModified().

Referenced by SIM_PLOT_FRAME::updatePlot().

◆ ClrModified()

void SIM_WORKBOOK::ClrModified ( )

Definition at line 90 of file sim_workbook.cpp.

91 {
92  m_modified = false;
93  wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_CLR_MODIFIED ) );
94 }

References m_modified.

Referenced by SIM_PLOT_FRAME::loadWorkbook(), and SIM_PLOT_FRAME::saveWorkbook().

◆ DeleteAllPages()

bool SIM_WORKBOOK::DeleteAllPages ( )
override

Definition at line 57 of file sim_workbook.cpp.

58 {
59  bool res = wxAuiNotebook::DeleteAllPages();
60  setModified( res );
61  return res;
62 }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.

References setModified().

Referenced by SIM_PLOT_FRAME::loadWorkbook().

◆ DeletePage()

bool SIM_WORKBOOK::DeletePage ( size_t  aPage)
override

Definition at line 65 of file sim_workbook.cpp.

66 {
67  bool res = wxAuiNotebook::DeletePage( page );
68  setModified( res );
69  return res;
70 }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.

References setModified().

◆ DeleteTrace()

bool SIM_WORKBOOK::DeleteTrace ( SIM_PLOT_PANEL aPlotPanel,
const wxString &  aName 
)

Definition at line 83 of file sim_workbook.cpp.

84 {
85  bool res = aPlotPanel->deleteTrace( aName );
86  setModified( res );
87  return res;
88 }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.
bool deleteTrace(const wxString &aName)

References SIM_PLOT_PANEL::deleteTrace(), and setModified().

Referenced by SIM_PLOT_FRAME::removePlot().

◆ GetSimCommand()

const wxString& SIM_WORKBOOK::GetSimCommand ( const SIM_PANEL_BASE aPlotPanel)
inline

Definition at line 62 of file sim_workbook.h.

63  {
64  return aPlotPanel->getSimCommand();
65  }
const wxString & getSimCommand() const

References SIM_PANEL_BASE::getSimCommand().

Referenced by SIM_PLOT_FRAME::getCurrentSimCommand(), SIM_PLOT_FRAME::onSettings(), and SIM_PLOT_FRAME::saveWorkbook().

◆ IsModified()

bool SIM_WORKBOOK::IsModified ( ) const
inline

◆ setModified()

void SIM_WORKBOOK::setModified ( bool  value = true)
private

Dirty bit, indicates something in the workbook has changed.

Definition at line 96 of file sim_workbook.cpp.

97 {
98  m_modified = value;
99  wxPostEvent( GetParent(), wxCommandEvent( EVT_WORKBOOK_MODIFIED ) );
100 }

References m_modified.

Referenced by AddPage(), AddTrace(), DeleteAllPages(), DeletePage(), DeleteTrace(), and SetSimCommand().

◆ SetSimCommand()

void SIM_WORKBOOK::SetSimCommand ( SIM_PANEL_BASE aPlotPanel,
const wxString &  aSimCommand 
)
inline

Definition at line 56 of file sim_workbook.h.

57  {
58  aPlotPanel->setSimCommand( aSimCommand );
59  setModified();
60  }
void setModified(bool value=true)
Dirty bit, indicates something in the workbook has changed.
void setSimCommand(const wxString &aSimCommand)

References setModified(), and SIM_PANEL_BASE::setSimCommand().

Referenced by SIM_PLOT_FRAME::onSettings().

Member Data Documentation

◆ m_modified

bool SIM_WORKBOOK::m_modified
private

Definition at line 74 of file sim_workbook.h.

Referenced by ClrModified(), IsModified(), setModified(), and SIM_WORKBOOK().


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