48 if( item && aProperty->
Name() ==
_HKI(
"Locked" ) )
53 aCommit->
Modify( generator );
57 generator->SetLocked(
false );
58 generator->SetLocked( item->
IsLocked() );
73 generator->EditStart(
this,
board(), commit );
74 generator->Update(
this,
board(), commit );
75 generator->EditFinish(
this,
board(), commit );
102 auto tuningPatternCondition =
109 if( generator->GetGeneratorType() == wxS(
"tuning_pattern" ) )
177 wxString generatorType = aEvent.
Parameter<wxString>();
182 if( generatorType == wxS(
"*" ) )
183 commitMsg =
_(
"Regenerate All" );
187 if( generatorType == wxS(
"*" ) || generator->GetGeneratorType() == generatorType )
189 if( commitMsg.IsEmpty() )
190 commitMsg.Printf(
_(
"Update %s" ), generator->GetPluralName() );
192 generator->EditStart(
this,
board(), &commit );
193 generator->Update(
this,
board(), &commit );
194 generator->EditFinish(
this,
board(), &commit );
196 commit.Push( commitMsg, commitFlags );
201 frame()->RefreshCanvas();
214 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
219 aCollector.
Remove( item );
223 std::vector<BOARD_ITEM*> items;
227 if( item->IsBOARD_ITEM() )
228 items.push_back(
static_cast<BOARD_ITEM*
>( item ) );
231 std::vector<BOARD_ITEM*> members;
237 if( error.IsEmpty() )
239 error =
_(
"A microvia stack needs two or more microvias on the same net, each spanning "
240 "one layer step, with no gap between them." );
243 frame()->ShowInfoBarWarning( error );
255 if(
EDA_GROUP* existingGroup = item->GetParentGroup() )
262 commit.
Push(
_(
"Create Microvia Stack" ) );
266 frame()->RefreshCanvas();
283 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
288 aCollector.
Remove( item );
297 generators.push_back( gen );
300#ifdef GENERATOR_ORDER
301 std::sort( generators.begin(), generators.end(),
304 return a->GetUpdateOrder() < b->GetUpdateOrder();
310 gen->EditStart(
this,
board(), &commit );
311 gen->Update(
this,
board(), &commit );
312 gen->EditFinish(
this,
board(), &commit );
314 commit.
Push(
_(
"Regenerate Selected" ), commitFlags );
318 frame()->RefreshCanvas();
335 frame()->RefreshCanvas();
344 wxCHECK( commit, 0 );
375 std::set<KIID> selected;
380 selected.insert( item->m_Uuid );
384 if( !
frame()->ToolStackIsEmpty() )
390 std::vector<PCB_TUNING_PATTERN*> emptyPatterns;
394 if( selected.contains(
id ) )
399 if( pattern && !pattern->IsLocked() && !pattern->HasFlag(
IN_EDIT ) && !pattern->HasMeanders() )
400 emptyPatterns.push_back( pattern );
410 pattern->Remove(
this,
board(), &commit );
411 commit.
Push(
_(
"Remove Empty Tuning Pattern" ), commitFlags );
static TOOL_ACTION selectionClear
Clear the current selection.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool IsLocked() const override
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Represent a set of changes (additions, deletions or modifications) of a data model (e....
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
A set of EDA_ITEMs (i.e., without duplicates).
void AddItem(EDA_ITEM *aItem)
Add item to group.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual EDA_GROUP * GetParentGroup() const
KICAD_T Type() const
Returns the type of object.
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected item had a property changed (except movement)
static const TOOL_EVENT UnselectedEvent
Used when the right click button is pressed, or when the select tool is in effect.
Class that other classes need to inherit from, in order to be inspectable.
static TOOL_ACTION genFinishEdit
static TOOL_ACTION genStartEdit
static TOOL_ACTION genRemove
static TOOL_ACTION genCancelEdit
static TOOL_ACTION generatorsShowManager
static TOOL_ACTION genUpdateEdit
static TOOL_ACTION regenerateAll
static TOOL_ACTION regenerateAllTuning
Generator tool.
static TOOL_ACTION makeViaStack
static TOOL_ACTION regenerateSelected
The main frame for Pcbnew.
virtual void Remove(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit)=0
virtual void EditCancel(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit)=0
virtual wxString GetCommitMessage() const =0
virtual void EditStart(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit)=0
virtual bool Update(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit)=0
virtual void EditFinish(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit)=0
A microvia stack: several single hop microvias, plus connecting traces for staggered stacks,...
static PCB_VIA_STACK * CreateFromItems(const std::vector< BOARD_ITEM * > &aItems, BOARD *aBoard, std::vector< BOARD_ITEM * > *aMembers=nullptr, wxString *aError=nullptr)
Build a stack from existing board items (microvias plus optional connecting traces).
const wxString & Name() const
static PROPERTY_MANAGER & Instance()
class PROPERTY_LISTENER_SUBSCRIPTION RegisterListener(TYPE_ID aType, PROPERTY_LISTENER aListenerFunc)
Register a listener for the given type and return a move-only subscription that auto-unregisters in i...
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
#define IN_EDIT
Item currently edited.
std::deque< PCB_GENERATOR * > GENERATORS
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
HYPERLINK_DV_RENDERER::RUN RUN
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I