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

#include <project_rescue.h>

Inheritance diagram for RESCUE_CACHE_CANDIDATE:
RESCUE_CANDIDATE

Public Member Functions

 RESCUE_CACHE_CANDIDATE (const wxString &aRequestedName, const wxString &aNewName, LIB_SYMBOL *aCacheCandidate, LIB_SYMBOL *aLibCandidate, int aUnit=0, int aConvert=0)
 Create a RESCUE_CACHE_CANDIDATE.
 
 RESCUE_CACHE_CANDIDATE ()
 
virtual LIB_SYMBOLGetCacheCandidate () const override
 Get the part that can be loaded from the project cache, if possible, or else NULL.
 
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 GetRequestedName () const
 Get the name that was originally requested in the schematic.
 
virtual wxString GetNewName () const
 Get the name we're proposing changing it to.
 
virtual LIB_SYMBOLGetLibCandidate () const
 Get the part the would be loaded from the libraries, if possible, or else NULL.
 
int GetUnit () const
 
int GetConvert () const
 

Static Public Member Functions

static void FindRescues (RESCUER &aRescuer, boost::ptr_vector< RESCUE_CANDIDATE > &aCandidates)
 Grab all possible RESCUE_CACHE_CANDIDATE objects into a vector.
 

Protected Attributes

wxString m_requested_name
 
wxString m_new_name
 
LIB_SYMBOLm_lib_candidate
 
int m_unit
 
int m_convert
 

Private Attributes

LIB_SYMBOLm_cache_candidate
 

Detailed Description

Definition at line 147 of file project_rescue.h.

Constructor & Destructor Documentation

◆ RESCUE_CACHE_CANDIDATE() [1/2]

RESCUE_CACHE_CANDIDATE::RESCUE_CACHE_CANDIDATE ( const wxString &  aRequestedName,
const wxString &  aNewName,
LIB_SYMBOL aCacheCandidate,
LIB_SYMBOL aLibCandidate,
int  aUnit = 0,
int  aConvert = 0 
)

Create a RESCUE_CACHE_CANDIDATE.

Parameters
aRequestedNameis the name the schematic asks for.
aNewNameis the name we want to change it to.
aCacheCandidateis the part from the cache.
aLibCandidateis the part that would be loaded from the library.
aUnitis the unit of the rescued symbol.
aConvertis the body style of the rescued symbol.

Definition at line 228 of file project_rescue.cpp.

References m_cache_candidate, RESCUE_CANDIDATE::m_convert, RESCUE_CANDIDATE::m_lib_candidate, RESCUE_CANDIDATE::m_new_name, RESCUE_CANDIDATE::m_requested_name, and RESCUE_CANDIDATE::m_unit.

◆ RESCUE_CACHE_CANDIDATE() [2/2]

RESCUE_CACHE_CANDIDATE::RESCUE_CACHE_CANDIDATE ( )

Definition at line 244 of file project_rescue.cpp.

References m_cache_candidate, and RESCUE_CANDIDATE::m_lib_candidate.

Referenced by FindRescues().

Member Function Documentation

◆ FindRescues()

void RESCUE_CACHE_CANDIDATE::FindRescues ( RESCUER aRescuer,
boost::ptr_vector< RESCUE_CANDIDATE > &  aCandidates 
)
static

Grab all possible RESCUE_CACHE_CANDIDATE objects into a vector.

Parameters
aRescueris the working RESCUER instance.
aCandidatesis the vector the will hold the candidates.

Definition at line 251 of file project_rescue.cpp.

References findSymbol(), LIB_SYMBOL::GetLibId(), RESCUER::GetPrj(), RESCUER::GetSymbols(), LIB_ID::GetUniStringLibItemName(), SCH_ITEM::GetUnit(), LIB_ID::IsValid(), LIB_SYMBOL::PinsConflictWith(), RESCUE_CACHE_CANDIDATE(), and PROJECT_SCH::SchLibs().

Referenced by LEGACY_RESCUER::FindCandidates().

◆ GetActionDescription()

wxString RESCUE_CACHE_CANDIDATE::GetActionDescription ( ) const
overridevirtual

Get a description of the action proposed, for displaying in the UI.

Implements RESCUE_CANDIDATE.

Definition at line 313 of file project_rescue.cpp.

References _, m_cache_candidate, RESCUE_CANDIDATE::m_lib_candidate, RESCUE_CANDIDATE::m_new_name, and RESCUE_CANDIDATE::m_requested_name.

◆ GetCacheCandidate()

virtual LIB_SYMBOL * RESCUE_CACHE_CANDIDATE::GetCacheCandidate ( ) const
inlineoverridevirtual

Get the part that can be loaded from the project cache, if possible, or else NULL.

Reimplemented from RESCUE_CANDIDATE.

Definition at line 176 of file project_rescue.h.

References m_cache_candidate.

◆ GetConvert()

int RESCUE_CANDIDATE::GetConvert ( ) const
inlineinherited

Definition at line 93 of file project_rescue.h.

References RESCUE_CANDIDATE::m_convert.

Referenced by DIALOG_RESCUE_EACH::displayItemsInConflict().

◆ GetLibCandidate()

virtual LIB_SYMBOL * RESCUE_CANDIDATE::GetLibCandidate ( ) const
inlinevirtualinherited

Get the part the would be loaded from the libraries, if possible, or else NULL.

Definition at line 89 of file project_rescue.h.

References RESCUE_CANDIDATE::m_lib_candidate.

Referenced by DIALOG_RESCUE_EACH::displayItemsInConflict().

◆ GetNewName()

virtual wxString RESCUE_CANDIDATE::GetNewName ( ) const
inlinevirtualinherited

Get the name we're proposing changing it to.

Definition at line 77 of file project_rescue.h.

References RESCUE_CANDIDATE::m_new_name.

◆ GetRequestedName()

virtual wxString RESCUE_CANDIDATE::GetRequestedName ( ) const
inlinevirtualinherited

Get the name that was originally requested in the schematic.

Definition at line 72 of file project_rescue.h.

References RESCUE_CANDIDATE::m_requested_name.

Referenced by DIALOG_RESCUE_EACH::PopulateConflictList(), and DIALOG_RESCUE_EACH::PopulateInstanceList().

◆ GetUnit()

int RESCUE_CANDIDATE::GetUnit ( ) const
inlineinherited

Definition at line 91 of file project_rescue.h.

References RESCUE_CANDIDATE::m_unit.

Referenced by DIALOG_RESCUE_EACH::displayItemsInConflict().

◆ PerformAction()

bool RESCUE_CACHE_CANDIDATE::PerformAction ( RESCUER aRescuer)
overridevirtual

Perform the actual rescue action.

If successful, this must log the rescue using RESCUER::LogRescue to allow it to be reversed.

Returns
True on success.

Implements RESCUE_CANDIDATE.

Definition at line 331 of file project_rescue.cpp.

References RESCUER::AddSymbol(), LIB_SYMBOL::Flatten(), RESCUER::GetSymbols(), RESCUER::LogRescue(), m_cache_candidate, RESCUE_CANDIDATE::m_lib_candidate, RESCUE_CANDIDATE::m_new_name, RESCUE_CANDIDATE::m_requested_name, and LIB_ID::SetLibItemName().

Member Data Documentation

◆ m_cache_candidate

LIB_SYMBOL* RESCUE_CACHE_CANDIDATE::m_cache_candidate
private

◆ m_convert

◆ m_lib_candidate

◆ m_new_name

◆ m_requested_name

◆ m_unit


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