KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LEGACY_RESCUER Class Reference

#include <project_rescue.h>

Inheritance diagram for LEGACY_RESCUER:
RESCUER

Public Member Functions

 LEGACY_RESCUER (PROJECT &aProject, SCHEMATIC *aSchematic, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType)
 
virtual ~LEGACY_RESCUER ()=default
 
virtual void FindCandidates () override
 Populate the RESCUER with all possible candidates.
 
virtual void InvokeDialog (wxWindow *aParent, bool aAskShowAgain) override
 Display a dialog to allow the user to select rescues.
 
virtual void OpenRescueLibrary () override
 
virtual bool WriteRescueLibrary (wxWindow *aParent) override
 Write the rescue library.
 
virtual void AddSymbol (LIB_SYMBOL *aNewSymbol) override
 
void RemoveDuplicates ()
 Filter out duplicately named rescue candidates.
 
size_t GetCandidateCount ()
 Return the number of rescue candidates found.
 
size_t GetChosenCandidateCount ()
 Get the number of rescue candidates chosen by the user.
 
std::vector< SCH_SYMBOL * > * GetSymbols ()
 Get the list of symbols that need rescued.
 
PROJECTGetPrj ()
 Return the #SCH_PROJECT object for access to the symbol libraries.
 
SCHEMATICSchematic ()
 
void LogRescue (SCH_SYMBOL *aSymbol, const wxString &aOldName, const wxString &aNewName)
 Used by individual RESCUE_CANDIDATE objects to log a rescue for undoing.
 
bool DoRescues ()
 Perform all chosen rescue actions, logging them to be undone if necessary.
 
void UndoRescues ()
 Reverse the effects of all rescues on the project.
 

Static Public Member Functions

static bool RescueProject (wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
 

Protected Attributes

std::vector< SCH_SYMBOL * > m_symbols
 
PROJECTm_prj
 
SCHEMATICm_schematic
 
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galBackEndType
 
SCH_SHEET_PATHm_currentSheet
 
boost::ptr_vector< RESCUE_CANDIDATEm_all_candidates
 
std::vector< RESCUE_CANDIDATE * > m_chosen_candidates
 
std::vector< RESCUE_LOGm_rescue_log
 

Private Attributes

std::unique_ptr< SYMBOL_LIBm_rescue_lib
 

Detailed Description

Definition at line 343 of file project_rescue.h.

Constructor & Destructor Documentation

◆ LEGACY_RESCUER()

LEGACY_RESCUER::LEGACY_RESCUER ( PROJECT & aProject,
SCHEMATIC * aSchematic,
SCH_SHEET_PATH * aCurrentSheet,
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType )
inline

Definition at line 346 of file project_rescue.h.

References RESCUER::RESCUER().

◆ ~LEGACY_RESCUER()

virtual LEGACY_RESCUER::~LEGACY_RESCUER ( )
virtualdefault

Member Function Documentation

◆ AddSymbol()

void LEGACY_RESCUER::AddSymbol ( LIB_SYMBOL * aNewSymbol)
overridevirtual

Implements RESCUER.

Definition at line 741 of file project_rescue.cpp.

References m_rescue_lib, and LIB_SYMBOL::SetLib().

◆ DoRescues()

bool RESCUER::DoRescues ( )
inherited

Perform all chosen rescue actions, logging them to be undone if necessary.

Returns
True on success

Definition at line 517 of file project_rescue.cpp.

References m_chosen_candidates.

Referenced by RescueProject().

◆ FindCandidates()

void LEGACY_RESCUER::FindCandidates ( )
overridevirtual

Populate the RESCUER with all possible candidates.

Implements RESCUER.

Definition at line 619 of file project_rescue.cpp.

References RESCUE_CACHE_CANDIDATE::FindRescues(), RESCUE_CASE_CANDIDATE::FindRescues(), and RESCUER::m_all_candidates.

◆ GetCandidateCount()

size_t RESCUER::GetCandidateCount ( )
inlineinherited

Return the number of rescue candidates found.

Definition at line 289 of file project_rescue.h.

References m_all_candidates.

Referenced by RescueProject(), and SCH_EDITOR_CONTROL::rescueProject().

◆ GetChosenCandidateCount()

size_t RESCUER::GetChosenCandidateCount ( )
inlineinherited

Get the number of rescue candidates chosen by the user.

Definition at line 294 of file project_rescue.h.

References m_chosen_candidates.

Referenced by RescueProject().

◆ GetPrj()

PROJECT * RESCUER::GetPrj ( )
inlineinherited

Return the #SCH_PROJECT object for access to the symbol libraries.

Definition at line 304 of file project_rescue.h.

References m_prj.

Referenced by RESCUE_CACHE_CANDIDATE::FindRescues(), RESCUE_CASE_CANDIDATE::FindRescues(), and RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues().

◆ GetSymbols()

◆ InvokeDialog()

void LEGACY_RESCUER::InvokeDialog ( wxWindow * aParent,
bool aAskShowAgain )
overridevirtual

Display a dialog to allow the user to select rescues.

Parameters
aAskShowAgain- whether the "Never Show Again" button should be visible

Implements RESCUER.

Definition at line 626 of file project_rescue.cpp.

References InvokeDialogRescueEach(), RESCUER::m_currentSheet, RESCUER::m_galBackEndType, and RESCUER::RESCUER().

◆ LogRescue()

void RESCUER::LogRescue ( SCH_SYMBOL * aSymbol,
const wxString & aOldName,
const wxString & aNewName )
inherited

◆ OpenRescueLibrary()

void LEGACY_RESCUER::OpenRescueLibrary ( )
overridevirtual

◆ RemoveDuplicates()

void RESCUER::RemoveDuplicates ( )
inherited

Filter out duplicately named rescue candidates.

Definition at line 588 of file project_rescue.cpp.

References m_all_candidates.

Referenced by RescueProject().

◆ RescueProject()

bool RESCUER::RescueProject ( wxWindow * aParent,
RESCUER & aRescuer,
bool aRunningOnDemand )
staticinherited

◆ Schematic()

SCHEMATIC * RESCUER::Schematic ( )
inlineinherited

Definition at line 306 of file project_rescue.h.

References m_schematic.

Referenced by RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues().

◆ UndoRescues()

void RESCUER::UndoRescues ( )
inherited

Reverse the effects of all rescues on the project.

Definition at line 529 of file project_rescue.cpp.

References m_rescue_log, and LIB_ID::SetLibItemName().

Referenced by RescueProject().

◆ WriteRescueLibrary()

bool LEGACY_RESCUER::WriteRescueLibrary ( wxWindow * aParent)
overridevirtual

Write the rescue library.

Called after successful PerformAction()s. If this fails, undo the actions.

Returns
True on success.

Implements RESCUER.

Definition at line 663 of file project_rescue.cpp.

References _, DisplayError(), SYMBOL_LIBS::GetLibNamesAndPaths(), SYMBOL_LIBS::LoadAllLibraries(), RESCUER::m_prj, m_rescue_lib, RESCUER::m_schematic, PROJECT::SCH_SYMBOL_LIBS, SYMBOL_LIBS::SetLibNamesAndPaths(), and SCH_SCREENS::UpdateSymbolLinks().

Member Data Documentation

◆ m_all_candidates

boost::ptr_vector<RESCUE_CANDIDATE> RESCUER::m_all_candidates
protectedinherited

◆ m_chosen_candidates

std::vector<RESCUE_CANDIDATE*> RESCUER::m_chosen_candidates
protectedinherited

Definition at line 337 of file project_rescue.h.

Referenced by DoRescues(), and GetChosenCandidateCount().

◆ m_currentSheet

SCH_SHEET_PATH* RESCUER::m_currentSheet
protectedinherited

◆ m_galBackEndType

EDA_DRAW_PANEL_GAL::GAL_TYPE RESCUER::m_galBackEndType
protectedinherited

◆ m_prj

◆ m_rescue_lib

std::unique_ptr<SYMBOL_LIB> LEGACY_RESCUER::m_rescue_lib
private

Definition at line 365 of file project_rescue.h.

Referenced by AddSymbol(), OpenRescueLibrary(), and WriteRescueLibrary().

◆ m_rescue_log

std::vector<RESCUE_LOG> RESCUER::m_rescue_log
protectedinherited

Definition at line 339 of file project_rescue.h.

Referenced by LogRescue(), and UndoRescues().

◆ m_schematic

◆ m_symbols

std::vector<SCH_SYMBOL*> RESCUER::m_symbols
protectedinherited

Definition at line 330 of file project_rescue.h.

Referenced by GetSymbols(), and RESCUER().


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