25 #ifndef _LIB_CACHE_RESCUE_H_ 26 #define _LIB_CACHE_RESCUE_H_ 41 #include <wx/string.h> 42 #include <boost/ptr_container/ptr_vector.hpp> 127 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
138 LIB_PART* aLibCandidate,
int aUnit = 0,
int aConvert = 0 );
159 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
172 int aUnit = 0,
int aConvert = 0 );
197 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
210 int aUnit = 0,
int aConvert = 0 );
277 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain ) = 0;
310 const wxString& aNewName );
336 RESCUER( aProject, aSchematic, aCurrentSheet, aGalBackEndType )
346 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain )
override;
374 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain )
override;
383 #endif // _LIB_CACHE_RESCUE_H_ virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain) override
Display a dialog to allow the user to select rescues.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galBackEndType
virtual void FindCandidates() override
Populate the RESCUER with all possible candidates.
virtual bool WriteRescueLibrary(wxWindow *aParent)=0
Writes out the rescue library.
virtual wxString GetActionDescription() const override
Get a description of the action proposed, for displaying in the UI.
virtual void FindCandidates()=0
Populate the RESCUER with all possible candidates.
size_t GetChosenCandidateCount()
Get the number of resuce candidates chosen by the user.
virtual LIB_PART * GetLibCandidate() const
Get the part the would be loaded from the libraries, if possible, or else NULL.
LIB_PART * m_cache_candidate
Container for project specific data.
PROJECT * GetPrj()
Return the #SCH_PROJECT object for access to the symbol libraries.
virtual wxString GetNewName() const
Get the name we're proposing changing it to.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType)
virtual wxString GetActionDescription() const =0
Get a description of the action proposed, for displaying in the UI.
virtual wxString GetRequestedName() const
Get the name that was originally requested in the schematic.
LIB_PART * m_cache_candidate
virtual void OpenRescueLibrary() override
virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain)=0
Display a dialog to allow the user to select rescues.
Schematic editor (Eeschema) main window.
virtual ~RESCUE_CANDIDATE()
A logical library item identifier and consists of various portions much like a URI.
LEGACY_RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType)
SYMBOL_LIB_TABLE_RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType)
LIB_PART * m_lib_candidate
SCH_COMPONENT * component
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE()
boost::ptr_vector< RESCUE_CANDIDATE > m_all_candidates
void RemoveDuplicates()
Filter out duplicately named rescue candidates.
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
SCH_SHEET_PATH * m_currentSheet
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_CACHE_CANDIDATE objectss into a vector.
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi
virtual bool PerformAction(RESCUER *aRescuer) override
Perform the actual rescue action.
virtual wxString GetActionDescription() const override
Get a description of the action proposed, for displaying in the UI.
size_t GetCandidateCount()
Returen the number of rescue candidates found.
virtual ~SYMBOL_LIB_TABLE_RESCUER()
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_SYMBOL_LIB_TABLE_CANDIDATE objects into a vector.
virtual wxString GetActionDescription() const override
Get a description of the action proposed, for displaying in the UI.
std::unique_ptr< PROPERTIES > m_properties
Library plugin properties.
virtual LIB_PART * GetCacheCandidate() const
Get the part that can be loaded from the project cache, if possible, or else NULL.
Define a library symbol object.
std::vector< SCH_COMPONENT * > m_components
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
virtual void OpenRescueLibrary()=0
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
virtual LIB_PART * GetCacheCandidate() const override
Get the part that can be loaded from the project cache, if possible, or else NULL.
std::vector< RESCUE_CANDIDATE * > m_chosen_candidates
virtual bool WriteRescueLibrary(wxWindow *aParent) override
Writes out the rescue library.
std::unique_ptr< PART_LIB > m_rescue_lib
virtual void OpenRescueLibrary() override
virtual LIB_PART * GetCacheCandidate() const override
Get the part that can be loaded from the project cache, if possible, or else NULL.
bool DoRescues()
Perform all chosen rescue actions, logging them to be undone if necessary.
virtual ~LEGACY_RESCUER()
virtual void AddPart(LIB_PART *aNewPart)=0
virtual bool WriteRescueLibrary(wxWindow *aParent) override
Writes out the rescue library.
std::vector< SCH_COMPONENT * > * GetComponents()
Get the list of symbols that need rescued.
std::vector< RESCUE_LOG > m_rescue_log
void LogRescue(SCH_COMPONENT *aComponent, const wxString &aOldName, const wxString &aNewName)
Used by individual RESCUE_CANDIDATE objects to log a rescue for undoing.
wxString m_requested_name
virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain) override
Display a dialog to allow the user to select rescues.
virtual bool PerformAction(RESCUER *aRescuer) override
Perform the actual rescue action.
virtual void AddPart(LIB_PART *aNewPart) override
virtual bool PerformAction(RESCUER *aRescuer)=0
Perform the actual rescue action.
virtual bool PerformAction(RESCUER *aRescuer) override
Perform the actual rescue action.
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_CASE_CANDIDATE objects into a vector.
virtual void AddPart(LIB_PART *aNewPart) override
void UndoRescues()
Reverse the effects of all rescues on the project.
virtual void FindCandidates() override
Populate the RESCUER with all possible candidates.