Coding policy fixes.

This commit is contained in:
Wayne Stambaugh 2025-06-03 09:26:30 -04:00
parent 1cef61c34f
commit fe20f685c2
2 changed files with 15 additions and 10 deletions

View File

@ -142,8 +142,7 @@ void DIALOG_SYNC_SHEET_PINS::EndPlaceItem( EDA_ITEM* aNewItem )
} }
else else
{ {
m_currentTemplate = m_currentTemplate = *m_placementTemplateSet.begin();
*m_placementTemplateSet.begin();
} }
} ); } );
@ -177,8 +176,10 @@ void DIALOG_SYNC_SHEET_PINS::EndPlaceItem( EDA_ITEM* aNewItem )
panel->GetModel( SHEET_SYNCHRONIZATION_MODEL::HIRE_LABEL )->DoNotify(); panel->GetModel( SHEET_SYNCHRONIZATION_MODEL::HIRE_LABEL )->DoNotify();
} }
} }
void DIALOG_SYNC_SHEET_PINS::PreparePlacementTemplate(
SCH_SHEET* aSheet, PlaceItemKind aKind, std::set<EDA_ITEM*> const& aPlacementTemplateSet )
void DIALOG_SYNC_SHEET_PINS::PreparePlacementTemplate( SCH_SHEET* aSheet, PlaceItemKind aKind,
std::set<EDA_ITEM*> const& aPlacementTemplateSet )
{ {
if( aPlacementTemplateSet.empty() ) if( aPlacementTemplateSet.empty() )
return; return;
@ -189,6 +190,7 @@ void DIALOG_SYNC_SHEET_PINS::PreparePlacementTemplate(
m_currentTemplate = *m_placementTemplateSet.begin(); m_currentTemplate = *m_placementTemplateSet.begin();
} }
SCH_HIERLABEL* DIALOG_SYNC_SHEET_PINS::GetPlacementTemplate() const SCH_HIERLABEL* DIALOG_SYNC_SHEET_PINS::GetPlacementTemplate() const
{ {
if( !m_currentTemplate ) if( !m_currentTemplate )
@ -197,11 +199,13 @@ SCH_HIERLABEL* DIALOG_SYNC_SHEET_PINS::GetPlacementTemplate() const
return static_cast<SCH_HIERLABEL*>( m_currentTemplate ); return static_cast<SCH_HIERLABEL*>( m_currentTemplate );
} }
bool DIALOG_SYNC_SHEET_PINS::CanPlaceMore() const bool DIALOG_SYNC_SHEET_PINS::CanPlaceMore() const
{ {
return !m_placementTemplateSet.empty(); return !m_placementTemplateSet.empty();
} }
void DIALOG_SYNC_SHEET_PINS::EndPlacement() void DIALOG_SYNC_SHEET_PINS::EndPlacement()
{ {
m_placementTemplateSet.clear(); m_placementTemplateSet.clear();

View File

@ -56,9 +56,10 @@ public:
void OnClose( wxCloseEvent& aEvent ); void OnClose( wxCloseEvent& aEvent );
/** /**
* @brief Either selected HIERLABELs or SHEET_PINs will be used as templates for placing the new ones. * Either the selected #HIERLABEL or #SHEET_PIN will be used as templates for placing the new ones.
* *
* @param aSheet The sheet where the new HIERLABELs or SHEET_PINs will be placed. For SHEET_PINs, it's the corresponding sheet symbol * @param aSheet The sheet where the new #HIERLABEL or #SHEET_PIN will be placed. For #SHEET_PIN,
* it's the corresponding sheet symbol.
* @param aKind Either PlaceItemKind::HIERLABEL or PlaceItemKind::SHEET_PIN * @param aKind Either PlaceItemKind::HIERLABEL or PlaceItemKind::SHEET_PIN
* @param aPlacementTemplateSet All the selected HIERLABELs or SHEET_PINs * @param aPlacementTemplateSet All the selected HIERLABELs or SHEET_PINs
*/ */
@ -73,25 +74,25 @@ public:
SCH_HIERLABEL* GetPlacementTemplate() const; SCH_HIERLABEL* GetPlacementTemplate() const;
/** /**
* @brief End place a new #HIERLABEL/#SHEET_PIN , and add the new item to the corresponding table. * End place a new #HIERLABEL/#SHEET_PIN , and add the new item to the corresponding table.
* *
* @param aNewItem The new #HIERLABEL/#SHEET_PIN to be placed. * @param aNewItem The new #HIERLABEL/#SHEET_PIN to be placed.
*/ */
void EndPlaceItem( EDA_ITEM* aNewItem ); void EndPlaceItem( EDA_ITEM* aNewItem );
/** /**
* @brief Check if there are more items to be placed. * Check if there are more items to be placed.
*/ */
bool CanPlaceMore() const; bool CanPlaceMore() const;
void EndPlacement(); void EndPlacement();
private: private:
//It's the agent that performs modification and placement /// It's the agent that performs modification and placement.
std::shared_ptr<SHEET_SYNCHRONIZATION_AGENT> m_agent; std::shared_ptr<SHEET_SYNCHRONIZATION_AGENT> m_agent;
SCH_SHEET* m_lastEditSheet; SCH_SHEET* m_lastEditSheet;
//The same sheet may have mutiple instances /// The same sheet may have multiple instances.
std::unordered_map<SCH_SHEET*, PANEL_SYNC_SHEET_PINS*> m_panels; std::unordered_map<SCH_SHEET*, PANEL_SYNC_SHEET_PINS*> m_panels;
PlaceItemKind m_placeItemKind; PlaceItemKind m_placeItemKind;
EDA_ITEM* m_currentTemplate; EDA_ITEM* m_currentTemplate;