79 [
this]( wxCommandEvent& aEvent )
84 [
this]( wxCommandEvent& aEvent )
89 [
this]( wxCommandEvent& aEvent )
94 m_trackWidthsGrid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
95 m_viaSizesGrid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
96 m_diffPairsGrid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
112 int min_linesize =
m_trackWidthsGrid->GetTextExtent( wxT(
"000.000000 mm " ) ).x;
114 for(
int ii = 0; grid_list[ii]; ii++ )
116 WX_GRID* curr_grid = grid_list[ii];
118 for(
int col = 0; col < curr_grid->GetNumberCols(); col++ )
121 int best_w = std::max( min_linesize, min_w );
122 curr_grid->SetColMinimalWidth( col, best_w );
123 curr_grid->SetColSize( col,best_w );
144 std::vector<int> trackWidths;
157 std::sort( trackWidths.begin(), trackWidths.end() );
160 for(
int width : trackWidths )
167 std::vector<VIA_DIMENSION> vias;
186 vias.push_back( via_dim );
190 std::sort( vias.begin(), vias.end() );
201 std::vector<DIFF_PAIR_DIMENSION> diffPairs;
222 diffPairs.push_back( diffPair_dim );
226 std::sort( diffPairs.begin(), diffPairs.end() );
291 std::vector<int> trackWidths;
292 std::vector<VIA_DIMENSION> vias;
293 std::vector<DIFF_PAIR_DIMENSION> diffPairs;
313 vias.push_back( via_dim );
330 diffPairs.push_back( diffPair_dim );
335 sort( trackWidths.begin(), trackWidths.end() );
336 sort( vias.begin(), vias.end() );
337 sort( diffPairs.begin(), diffPairs.end() );
341 trackWidths.insert( trackWidths.begin(), 0 );
344 vias.insert( vias.begin(), { 0, 0 } );
347 diffPairs.insert( diffPairs.begin(), { 0, 0, 0 } );
371 if( !viaDia.IsEmpty() && viaDrill.IsEmpty() )
373 msg =
_(
"No via hole size defined." );
385 if( !dpWidth.IsEmpty() && dpGap.IsEmpty() )
387 msg =
_(
"No differential pair gap defined." );
438 wxArrayInt selectedRows = aGrid->GetSelectedRows();
439 int curRow = aGrid->GetGridCursorRow();
441 if( selectedRows.empty() && curRow >= 0 && curRow < aGrid->GetNumberRows() )
442 selectedRows.Add( curRow );
444 for(
int ii = selectedRows.Count() - 1; ii >= 0; --ii )
446 int row = selectedRows.Item( ii );
447 aGrid->DeleteRows( row, 1 );
448 curRow = std::min( curRow, row );
451 curRow = std::max( 0, curRow - 1 );
452 aGrid->MakeCellVisible( curRow, aGrid->GetGridCursorCol() );
453 aGrid->SetGridCursor( curRow, aGrid->GetGridCursorCol() );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Container for design settings for a BOARD object.
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
std::vector< int > m_TrackWidthList
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Information pertinent to a Pcbnew printed circuit board.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
Class PANEL_SETUP_TRACKS_AND_VIAS_BASE.
STD_BITMAP_BUTTON * m_trackWidthsAddButton
WX_GRID * m_trackWidthsGrid
WX_GRID * m_diffPairsGrid
STD_BITMAP_BUTTON * m_diffPairsAddButton
STD_BITMAP_BUTTON * m_trackWidthsSortButton
STD_BITMAP_BUTTON * m_trackWidthsRemoveButton
STD_BITMAP_BUTTON * m_viaSizesRemoveButton
STD_BITMAP_BUTTON * m_diffPairsSortButton
STD_BITMAP_BUTTON * m_viaSizesAddButton
STD_BITMAP_BUTTON * m_viaSizesSortButton
STD_BITMAP_BUTTON * m_diffPairsRemoveButton
void OnRemoveViaSizesClick(wxCommandEvent &event) override
bool TransferDataToWindow() override
PANEL_SETUP_TRACKS_AND_VIAS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
void OnRemoveDiffPairsClick(wxCommandEvent &event) override
void OnSortTrackWidthsClick(wxCommandEvent &event) override
~PANEL_SETUP_TRACKS_AND_VIAS() override
void onUnitsChanged(wxCommandEvent &aEvent)
void OnSortViaSizesClick(wxCommandEvent &event) override
void AppendTrackWidth(int aWidth)
void OnAddViaSizesClick(wxCommandEvent &event) override
void ImportSettingsFrom(BOARD *aBoard)
void OnSortDiffPairsClick(wxCommandEvent &event) override
void OnRemoveTrackWidthsClick(wxCommandEvent &event) override
bool TransferDataFromWindow() override
void OnAddDiffPairsClick(wxCommandEvent &event) override
BOARD_DESIGN_SETTINGS * m_BrdSettings
void AppendDiffPairs(int aWidth, int aGap, int aViaGap)
void OnAddTrackWidthsClick(wxCommandEvent &event) override
void AppendViaSize(int aSize, int aDrill)
The main frame for Pcbnew.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
void SetUnitValue(int aRow, int aCol, int aValue)
Set a unitized cell's value.
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
void SetAutoEvalCols(const std::vector< int > &aCols)
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a UNITS_PROVIDER to enable use of unit- and eval-based Getters.
void ClearRows()
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number...
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
void removeSelectedRows(WX_GRID *aGrid)
Container to handle a stock of specific differential pairs each with unique track width,...
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...