64 return aBusesNeedingMigration > 0 && aFileFormatVersionAtLoad < 20200310;
93 auto subgraphs =
m_frame->Schematic().ConnectionGraph()->GetBusesNeedingMigration();
102 std::vector<SCH_ITEM*> labels = subgraph->GetVectorBusLabels();
103 wxASSERT( labels.size() > 1 );
125 wxString old = item.labels[0];
127 for(
unsigned j = 1; j < item.labels.size(); j++ )
128 old <<
", " << item.labels[j];
132 m_migration_list->SetItem( i, 0, item.subgraph->GetSheet().PathHumanReadable() );
145 int lowest_start = INT_MAX;
146 int highest_end = -1;
151 for(
const wxString& label : aLabelList )
158 if( start < lowest_start )
159 lowest_start = start;
161 if(
end > highest_end )
164 if(
end - start + 1 > widest_bus )
165 widest_bus =
end - start + 1;
168 std::vector<wxString> proposals;
170 for(
const wxString& label : aLabelList )
174 proposal <<
"[" << highest_end <<
".." << lowest_start <<
"]";
175 proposals.push_back( proposal );
184 unsigned sel = aEvent.GetIndex();
185 wxASSERT( sel <
m_items.size() );
193 if( sheet !=
m_frame->GetCurrentSheet() )
196 m_frame->Schematic().SetCurrentSheet( sheet );
202 m_frame->GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( pos,
false );
203 m_frame->RedrawScreen( pos,
false );
207 for(
const wxString& option :
m_items[sel].possible_labels )
223 std::vector<SCH_ITEM*> labels =
m_items[sel].subgraph->GetVectorBusLabels();
234 m_frame->GetCanvas()->Refresh();
static TOOL_ACTION zoomFitScreen
A subgraph is a set of items that are electrically connected on a single sheet.
const SCH_ITEM * GetDriver() const
const SCH_SHEET_PATH & GetSheet() const
wxListView * m_migration_list
DIALOG_MIGRATE_BUSES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Migrate Buses"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE)
wxComboBox * m_cb_new_name
void onAcceptClicked(wxCommandEvent &aEvent)
void onItemSelected(wxListEvent &aEvent)
unsigned m_selected_index
std::vector< wxString > getProposedLabels(const std::vector< wxString > &aLabelList)
std::vector< BUS_MIGRATION_STATUS > m_items
static bool ShouldPrompt(int aFileFormatVersionAtLoad, size_t aBusesNeedingMigration)
Multiple differently-named labels on a single bus subgraph were only permitted before KiCad 6....
DIALOG_MIGRATE_BUSES(SCH_EDIT_FRAME *aParent)
void OptOut(wxWindow *aWindow)
Opt out of control state saving.
virtual VECTOR2I GetPosition() const
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void ConfigureFromLabel(const wxString &aLabel)
Configures the connection given a label.
wxString VectorPrefix() const
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
std::vector< wxString > possible_labels
const CONNECTION_SUBGRAPH * subgraph
std::vector< wxString > labels
VECTOR2< int32_t > VECTOR2I