49 if( item && aProperty->
Name() ==
_HKI(
"Locked" ) )
54 aCommit->
Modify( generator );
58 generator->SetLocked(
false );
59 generator->SetLocked( item->
IsLocked() );
73 generator->EditStart(
this,
board(), commit );
74 generator->Update(
this,
board(), commit );
75 generator->EditFinish(
this,
board(), commit );
94 auto tuningPatternCondition =
101 if( generator->GetGeneratorType() == wxS(
"tuning_pattern" ) )
169 wxString generatorType = aEvent.
Parameter<wxString>();
174 if( generatorType == wxS(
"*" ) )
175 commitMsg =
_(
"Regenerate All" );
179 if( generatorType == wxS(
"*" ) || generator->GetGeneratorType() == generatorType )
181 if( commitMsg.IsEmpty() )
182 commitMsg.Printf(
_(
"Update %s" ), generator->GetPluralName() );
184 generator->EditStart(
this,
board(), &commit );
185 generator->Update(
this,
board(), &commit );
186 generator->EditFinish(
this,
board(), &commit );
188 commit.Push( commitMsg, commitFlags );
193 frame()->RefreshCanvas();
209 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
214 aCollector.
Remove( item );
218 GENERATORS generators;
223 generators.push_back( gen );
226#ifdef GENERATOR_ORDER
227 std::sort( generators.begin(), generators.end(),
230 return a->GetUpdateOrder() < b->GetUpdateOrder();
236 gen->EditStart(
this,
board(), &commit );
237 gen->Update(
this,
board(), &commit );
238 gen->EditFinish(
this,
board(), &commit );
240 commit.
Push(
_(
"Regenerate Selected" ), commitFlags );
244 frame()->RefreshCanvas();
261 frame()->RefreshCanvas();
270 wxCHECK( commit, 0 );
virtual 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
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.
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
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.
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 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
const wxString & Name() const
static PROPERTY_MANAGER & Instance()
void RegisterListener(TYPE_ID aType, PROPERTY_LISTENER aListenerFunc)
Registers a listener for the given type.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
VECTOR2< int32_t > VECTOR2I