KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RESCUER Class Referenceabstract

#include <project_rescue.h>

Inheritance diagram for RESCUER:
LEGACY_RESCUER SYMBOL_LIB_TABLE_RESCUER

Public Member Functions

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

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
 

Friends

class DIALOG_RESCUE_EACH
 

Detailed Description

Definition at line 233 of file project_rescue.h.

Constructor & Destructor Documentation

◆ RESCUER()

RESCUER::RESCUER ( PROJECT aProject,
SCHEMATIC aSchematic,
SCH_SHEET_PATH aCurrentSheet,
EDA_DRAW_PANEL_GAL::GAL_TYPE  aGalBackeEndType 
)

◆ ~RESCUER()

virtual RESCUER::~RESCUER ( )
inlinevirtual

Definition at line 239 of file project_rescue.h.

Member Function Documentation

◆ AddSymbol()

◆ DoRescues()

bool RESCUER::DoRescues ( )

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

Returns
True on success

Definition at line 564 of file project_rescue.cpp.

References m_chosen_candidates.

Referenced by RescueProject().

◆ FindCandidates()

virtual void RESCUER::FindCandidates ( )
pure virtual

Populate the RESCUER with all possible candidates.

Implemented in LEGACY_RESCUER, and SYMBOL_LIB_TABLE_RESCUER.

Referenced by RescueProject().

◆ GetCandidateCount()

size_t RESCUER::GetCandidateCount ( )
inline

Return the number of rescue candidates found.

Definition at line 276 of file project_rescue.h.

References m_all_candidates.

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

◆ GetChosenCandidateCount()

size_t RESCUER::GetChosenCandidateCount ( )
inline

Get the number of rescue candidates chosen by the user.

Definition at line 281 of file project_rescue.h.

References m_chosen_candidates.

Referenced by RescueProject().

◆ GetPrj()

PROJECT * RESCUER::GetPrj ( )
inline

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

Definition at line 291 of file project_rescue.h.

References m_prj.

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

◆ GetSymbols()

◆ InvokeDialog()

virtual void RESCUER::InvokeDialog ( wxWindow *  aParent,
bool  aAskShowAgain 
)
pure virtual

Display a dialog to allow the user to select rescues.

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

Implemented in LEGACY_RESCUER, and SYMBOL_LIB_TABLE_RESCUER.

Referenced by RescueProject().

◆ LogRescue()

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

◆ OpenRescueLibrary()

virtual void RESCUER::OpenRescueLibrary ( )
pure virtual

Implemented in LEGACY_RESCUER, and SYMBOL_LIB_TABLE_RESCUER.

Referenced by RescueProject().

◆ RemoveDuplicates()

void RESCUER::RemoveDuplicates ( )

Filter out duplicately named rescue candidates.

Definition at line 635 of file project_rescue.cpp.

References m_all_candidates.

Referenced by RescueProject().

◆ RescueProject()

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

◆ Schematic()

SCHEMATIC * RESCUER::Schematic ( )
inline

Definition at line 293 of file project_rescue.h.

References m_schematic.

Referenced by RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues().

◆ UndoRescues()

void RESCUER::UndoRescues ( )

Reverse the effects of all rescues on the project.

Definition at line 576 of file project_rescue.cpp.

References m_rescue_log, and LIB_ID::SetLibItemName().

Referenced by RescueProject().

◆ WriteRescueLibrary()

virtual bool RESCUER::WriteRescueLibrary ( wxWindow *  aParent)
pure virtual

Write the rescue library.

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

Returns
True on success.

Implemented in LEGACY_RESCUER, and SYMBOL_LIB_TABLE_RESCUER.

Referenced by RescueProject().

Friends And Related Function Documentation

◆ DIALOG_RESCUE_EACH

friend class DIALOG_RESCUE_EACH
friend

Definition at line 315 of file project_rescue.h.

Member Data Documentation

◆ m_all_candidates

◆ m_chosen_candidates

◆ m_currentSheet

SCH_SHEET_PATH* RESCUER::m_currentSheet
protected

◆ m_galBackEndType

EDA_DRAW_PANEL_GAL::GAL_TYPE RESCUER::m_galBackEndType
protected

◆ m_prj

◆ m_rescue_log

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

Definition at line 326 of file project_rescue.h.

Referenced by LogRescue(), and UndoRescues().

◆ m_schematic

◆ m_symbols

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

Definition at line 317 of file project_rescue.h.

Referenced by GetSymbols(), and RESCUER().


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