78 for(
auto subgraph : subgraphs )
85 auto labels = subgraph->GetBusLabels();
86 wxASSERT( labels.size() > 1 );
88 for(
auto label : labels )
89 status.
labels.push_back( static_cast<SCH_TEXT*>( label )->GetText() );
108 wxString old = item.labels[0];
109 for(
unsigned j = 1; j < item.labels.size(); j++ )
110 old <<
", " << item.labels[j];
114 m_migration_list->SetItem( i, 0, item.subgraph->m_sheet.PathHumanReadable() );
126 const std::vector<wxString>& aLabelList )
128 int lowest_start = INT_MAX;
129 int highest_end = -1;
134 for(
const wxString& label : aLabelList )
138 int start = conn.VectorStart();
139 int end = conn.VectorEnd();
141 if( start < lowest_start )
142 lowest_start = start;
144 if( end > highest_end )
147 if( end - start + 1 > widest_bus )
148 widest_bus = end - start + 1;
151 std::vector<wxString> proposals;
153 for(
const wxString& label : aLabelList )
155 conn.ConfigureFromLabel( label );
156 wxString proposal = conn.VectorPrefix();
157 proposal <<
"[" << highest_end <<
".." << lowest_start <<
"]";
158 proposals.push_back( proposal );
167 unsigned sel = aEvent.GetIndex();
168 wxASSERT( sel <
m_items.size() );
172 auto subgraph =
m_items[sel].subgraph;
174 auto sheet = subgraph->m_sheet;
175 auto driver = subgraph->m_driver;
179 if( sheet != current )
186 auto pos = driver->GetPosition();
193 for(
const wxString& option :
m_items[sel].possible_labels )
209 auto labels =
m_items[sel].subgraph->GetBusLabels();
211 for(
auto label : labels )
212 static_cast<SCH_TEXT*>( label )->SetText(
m_items[sel].approved_label );
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
CONNECTION_GRAPH * ConnectionGraph() const override
void onItemSelected(wxListEvent &aEvent)
static TOOL_ACTION zoomFitScreen
std::vector< BUS_MIGRATION_STATUS > m_items
void ConfigureFromLabel(const wxString &aLabel)
Configures the connection given a label.
Schematic editor (Eeschema) main window.
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
std::vector< wxString > labels
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
std::vector< wxString > getProposedLabels(const std::vector< wxString > &aLabelList)
wxComboBox * m_cb_new_name
void onAcceptClicked(wxCommandEvent &aEvent)
unsigned m_selected_index
DIALOG_MIGRATE_BUSES(SCH_EDIT_FRAME *aParent)
Migrates buses using legacy multi-label joining behavior.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCHEMATIC & Schematic() const
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
std::vector< wxString > possible_labels
Class DIALOG_MIGRATE_BUSES_BASE.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
const CONNECTION_SUBGRAPH * subgraph
SCH_SHEET_PATH & GetCurrentSheet() const
wxListView * m_migration_list
std::vector< const CONNECTION_SUBGRAPH * > GetBusesNeedingMigration()
Determines which subgraphs have more than one conflicting bus label.