25#ifndef _LIB_CACHE_RESCUE_H_ 
   26#define _LIB_CACHE_RESCUE_H_ 
   68                      LIB_SYMBOL* aLibCandidate, 
int aUnit, 
int aBodyStyle ) :
 
 
 
  133    static void FindRescues( 
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
 
  145                           LIB_SYMBOL* aLibCandidate, 
int aUnit = 0, 
int aBodyStyle = 0 );
 
 
  168    static void FindRescues( 
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
 
  182                            int aUnit = 0, 
int aBodyStyle = 0 ) :
 
  183            RESCUE_CANDIDATE( aRequestedName, aNewName, aLibCandidate, aUnit, aBodyStyle ),
 
 
 
  209    static void FindRescues( 
RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
 
  223                                       int aUnit = 0, 
int aBodyStyle = 0 );
 
 
  280    virtual void InvokeDialog( wxWindow* aParent, 
bool aAskShowAgain ) = 0;
 
 
  349        RESCUER( aProject, aSchematic, aCurrentSheet, aGalBackEndType )
 
 
  357    virtual void InvokeDialog( wxWindow* aParent, 
bool aAskShowAgain ) 
override;
 
 
  381    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 ~LEGACY_RESCUER()=default
 
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< LEGACY_SYMBOL_LIB > m_rescue_lib
 
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
 
friend class DIALOG_RESCUE_EACH
 
virtual bool WriteRescueLibrary(wxWindow *aParent)=0
Write the rescue library.
 
std::vector< RESCUE_LOG > m_rescue_log
 
virtual ~RESCUER()=default
 
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
 
RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType)
 
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.
 
RESCUE_CACHE_CANDIDATE(const wxString &aRequestedName, const wxString &aNewName, LIB_SYMBOL *aCacheCandidate, LIB_SYMBOL *aLibCandidate, int aUnit=0, int aBodyStyle=0)
Create a RESCUE_CACHE_CANDIDATE.
 
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.
 
RESCUE_CANDIDATE(const wxString &aRequestedName, const wxString &aNewName, LIB_SYMBOL *aLibCandidate, int aUnit, int aBodyStyle)
 
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.
 
RESCUE_CASE_CANDIDATE(const wxString &aRequestedName, const wxString &aNewName, LIB_SYMBOL *aLibCandidate, int aUnit=0, int aBodyStyle=0)
Create a RESCUE_CANDIDATE.
 
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.
 
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE(const LIB_ID &aRequestedId, const LIB_ID &aNewId, LIB_SYMBOL *aCacheCandidate, LIB_SYMBOL *aLibCandidate, int aUnit=0, int aBodyStyle=0)
Create RESCUE_CANDIDATE.
 
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 bool WriteRescueLibrary(wxWindow *aParent) override
Write the rescue library.
 
SYMBOL_LIB_TABLE_RESCUER(PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType)
 
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 ~SYMBOL_LIB_TABLE_RESCUER()=default
 
virtual void AddSymbol(LIB_SYMBOL *aNewSymbol) override
 
std::vector< std::unique_ptr< LIB_SYMBOL > > m_rescueLibSymbols