25#ifndef _LIB_CACHE_RESCUE_H_
26#define _LIB_CACHE_RESCUE_H_
124 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
136 LIB_SYMBOL* aLibCandidate,
int aUnit = 0,
int aConvert = 0 );
157 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
171 int aUnit = 0,
int aConvert = 0 );
192 static void FindRescues(
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
206 int aUnit = 0,
int aConvert = 0 );
265 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain ) = 0;
334 RESCUER( aProject, aSchematic, aCurrentSheet, aGalBackEndType )
344 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain )
override;
370 virtual void InvokeDialog( wxWindow* aParent,
bool aAskShowAgain )
override;
virtual void FindCandidates() override
Populate the RESCUER with all possible candidates.
virtual bool WriteRescueLibrary(wxWindow *aParent) override
Write the rescue library.
virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain) override
Display a dialog to allow the user to select rescues.
LEGACY_RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType)
virtual void AddSymbol(LIB_SYMBOL *aNewSymbol) override
std::unique_ptr< SYMBOL_LIB > m_rescue_lib
virtual ~LEGACY_RESCUER()
virtual void OpenRescueLibrary() override
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
Container for project specific data.
virtual void AddSymbol(LIB_SYMBOL *aNewSymbol)=0
virtual bool WriteRescueLibrary(wxWindow *aParent)=0
Write the rescue library.
std::vector< RESCUE_LOG > m_rescue_log
void UndoRescues()
Reverse the effects of all rescues on the project.
bool DoRescues()
Perform all chosen rescue actions, logging them to be undone if necessary.
std::vector< SCH_SYMBOL * > m_symbols
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
void LogRescue(SCH_SYMBOL *aSymbol, const wxString &aOldName, const wxString &aNewName)
Used by individual RESCUE_CANDIDATE objects to log a rescue for undoing.
SCH_SHEET_PATH * m_currentSheet
std::vector< RESCUE_CANDIDATE * > m_chosen_candidates
std::vector< SCH_SYMBOL * > * GetSymbols()
Get the list of symbols that need rescued.
size_t GetCandidateCount()
Return the number of rescue candidates found.
PROJECT * GetPrj()
Return the #SCH_PROJECT object for access to the symbol libraries.
virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain)=0
Display a dialog to allow the user to select rescues.
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galBackEndType
virtual void OpenRescueLibrary()=0
size_t GetChosenCandidateCount()
Get the number of rescue candidates chosen by the user.
boost::ptr_vector< RESCUE_CANDIDATE > m_all_candidates
virtual void FindCandidates()=0
Populate the RESCUER with all possible candidates.
void RemoveDuplicates()
Filter out duplicately named rescue candidates.
LIB_SYMBOL * m_cache_candidate
virtual LIB_SYMBOL * GetCacheCandidate() const override
Get the part that can be loaded from the project cache, if possible, or else NULL.
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_CACHE_CANDIDATE objects into a vector.
virtual wxString GetActionDescription() const override
Get a description of the action proposed, for displaying in the UI.
virtual bool PerformAction(RESCUER *aRescuer) override
Perform the actual rescue action.
virtual wxString GetActionDescription() const =0
Get a description of the action proposed, for displaying in the UI.
virtual LIB_SYMBOL * GetCacheCandidate() const
Get the part that can be loaded from the project cache, if possible, or else NULL.
virtual bool PerformAction(RESCUER *aRescuer)=0
Perform the actual rescue action.
wxString m_requested_name
virtual wxString GetRequestedName() const
Get the name that was originally requested in the schematic.
virtual ~RESCUE_CANDIDATE()
virtual LIB_SYMBOL * GetLibCandidate() const
Get the part the would be loaded from the libraries, if possible, or else NULL.
LIB_SYMBOL * m_lib_candidate
virtual wxString GetNewName() const
Get the name we're proposing changing it to.
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_CASE_CANDIDATE objects into a vector.
virtual wxString GetActionDescription() const override
Get a description of the action proposed, for displaying in the UI.
virtual bool PerformAction(RESCUER *aRescuer) override
Perform the actual rescue action.
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.
LIB_SYMBOL * m_cache_candidate
static void FindRescues(RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
Grab all possible RESCUE_SYMBOL_LIB_TABLE_CANDIDATE objects into a vector.
virtual LIB_SYMBOL * GetCacheCandidate() const override
Get the part that can be loaded from the project cache, if possible, or else NULL.
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE()
Holds all the data relating to one schematic.
Schematic editor (Eeschema) main window.
A SCH_IO derivation for loading schematic files created before the new s-expression file format.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
virtual void OpenRescueLibrary() override
virtual ~SYMBOL_LIB_TABLE_RESCUER()
virtual bool WriteRescueLibrary(wxWindow *aParent) override
Write the rescue library.
virtual void InvokeDialog(wxWindow *aParent, bool aAskShowAgain) override
Display a dialog to allow the user to select rescues.
std::unique_ptr< std::map< std::string, UTF8 > > m_properties
Library plugin properties.
virtual void FindCandidates() override
Populate the RESCUER with all possible candidates.
virtual void AddSymbol(LIB_SYMBOL *aNewSymbol) override
std::vector< std::unique_ptr< LIB_SYMBOL > > m_rescueLibSymbols