38 std::shared_ptr<TIME_DOMAIN_PARAMETERS> aTimeDomainParameters ) :
40 m_timeDomainParameters(
std::
move( aTimeDomainParameters ) ), m_frame( aFrame ), m_board( aFrame->
GetBoard() )
68 wxEVT_GRID_CELL_CHANGING,
80 std::vector<int> viaColIds;
103 wxEVT_GRID_CELL_CHANGING,
122 addViaRow( profile.m_ProfileName, viaOverride );
171 if( col < m_tracePropagationGrid->GetNumberCols() )
185 std::map<PCB_LAYER_ID, int> propDelays;
228 std::swap( signalLayerIdFrom, signalLayerIdTo );
231 std::swap( viaLayerIdFrom, viaLayerIdTo );
250 for(
const auto& layer :
LSET::AllCuMask( aNumCopperLayers ).CuStack() )
297 if( newCopperLayers < curCopperLayers )
301 curCopperLayers - newCopperLayers );
303 else if( newCopperLayers > curCopperLayers )
308 std::vector<int> copperColIds;
319 copperColIds.push_back( colIdx );
331 wxArrayString layerNames;
333 [&layerNames](
const wxString& aLayerName )
335 layerNames.push_back( aLayerName );
339 std::vector<wxString> currentSignalLayersFrom;
340 std::vector<wxString> currentSignalLayersTo;
341 std::vector<wxString> currentViaLayersFrom;
342 std::vector<wxString> currentViaLayersTo;
353 wxGridCellAttr* attr =
new wxGridCellAttr;
354 attr->SetEditor(
new wxGridCellChoiceEditor( layerNames,
false ) );
357 attr =
new wxGridCellAttr;
358 attr->SetEditor(
new wxGridCellChoiceEditor( layerNames,
false ) );
361 attr =
new wxGridCellAttr;
362 attr->SetEditor(
new wxGridCellChoiceEditor( layerNames,
false ) );
365 attr =
new wxGridCellAttr;
366 attr->SetEditor(
new wxGridCellChoiceEditor( layerNames,
false ) );
464 const wxString msg =
_(
"No delay profiles to override" );
504 wxString newName =
event.GetString();
505 newName.Trim(
true ).Trim(
false );
507 if( !oldName.IsEmpty() )
536 const wxString& aNewName )
const
538 wxArrayString profileNames;
544 if( profileName == aOldName )
545 profileName = aNewName;
547 profileNames.push_back( profileName );
550 std::ranges::sort( profileNames,
551 [](
const wxString& a,
const wxString& b )
553 return a.CmpNoCase( b ) < 0;
556 wxGridCellAttr* attr =
new wxGridCellAttr;
557 attr->SetEditor(
new wxGridCellChoiceEditor( profileNames,
false ) );
564 wxString tmp = aName;
570 const wxString msg =
_(
"Tuning profile must have a name" );
579 const wxString msg =
_(
"Tuning profile name already in use" );
614 std::map<wxString, std::set<DELAY_PROFILE_VIA_OVERRIDE_ENTRY>> rowCache;
620 std::set<DELAY_PROFILE_VIA_OVERRIDE_ENTRY>& viaOverrides = rowCache[profileName];
622 if( viaOverrides.contains( entry ) )
624 const wxString msg =
_(
"Via override configuration is duplicated" );
630 viaOverrides.insert( entry );
640 std::vector<wxString> profileNames;
645 profileNames.emplace_back( profileName );
648 std::ranges::sort( profileNames,
649 [](
const wxString& a,
const wxString& b )
651 return a.CmpNoCase( b ) < 0;
659 const std::shared_ptr<TIME_DOMAIN_PARAMETERS>& aOtherParameters )
677 profileName.Trim(
true ).Trim(
false );
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Information pertinent to a Pcbnew printed circuit board.
int GetCopperLayerCount() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
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_TIME_DOMAIN_PARAMETERS_BASE.
STD_BITMAP_BUTTON * m_removeDelayProfileButton
WX_GRID * m_viaPropagationGrid
STD_BITMAP_BUTTON * m_removeViaOverrideButton
STD_BITMAP_BUTTON * m_addDelayProfileButton
STD_BITMAP_BUTTON * m_addViaOverrideButton
wxSplitterWindow * m_splitter
WX_GRID * m_tracePropagationGrid
WX_PANEL * m_timeDomainParametersPane
wxString getProfileNameForProfileGridRow(int aRow) const
Gets the profile name for the given profile grid row.
std::map< wxString, PCB_LAYER_ID > m_prevLayerNamesToIDs
std::map< wxString, PCB_LAYER_ID > m_layerNamesToIDs
bool TransferDataFromWindow() override
Save parameter data to the settings object.
void updateViaGridColumns()
Update the dynamic (per-layer) columns in the via overrides grid.
void OnAddViaOverrideClick(wxCommandEvent &event) override
Adds a new via override profile entry to the via overrides grid.
PCB_EDIT_FRAME * m_frame
The active edit frame.
std::vector< wxString > m_layerNames
std::map< int, PCB_LAYER_ID > m_copperColumnsToLayerId
void OnRemoveViaOverrideClick(wxCommandEvent &event) override
Removes a via override profile entry from the via overrides grid.
void OnAddDelayProfileClick(wxCommandEvent &event) override
Adds a new tuning profile entry to the tuning profile grid.
void addProfileRow(const DELAY_PROFILE &aDelayProfile)
Adds a tuning profile row with the given persisted parameters.
PANEL_SETUP_TIME_DOMAIN_PARAMETERS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame, BOARD *aBoard, std::shared_ptr< TIME_DOMAIN_PARAMETERS > aTimeDomainParameters)
bool Validate() override
Validates all data.
void setColumnWidths()
Optimise grid columns to fit titles and content.
void addViaRow(const wxString &aProfileName, const DELAY_PROFILE_VIA_OVERRIDE_ENTRY &aViaOverrideEntry) const
Adds a via override row with the given persisted parameters.
void ImportSettingsFrom(const std::shared_ptr< TIME_DOMAIN_PARAMETERS > &aOtherParameters)
Load configuration from the given settings object.
~PANEL_SETUP_TIME_DOMAIN_PARAMETERS() override
@ PROFILE_GRID_PROFILE_NAME
@ PROFILE_GRID_NUM_REQUIRED_COLS
@ PROFILE_GRID_VIA_PROP_DELAY
@ VIA_GRID_VIA_LAYER_FROM
@ VIA_GRID_SIGNAL_LAYER_FROM
@ VIA_GRID_SIGNAL_LAYER_TO
bool validateDelayProfileName(int aRow, const wxString &aName, bool focusFirst=true)
Validates a tuning profile name (checks for not empty and not duplicated)
void updateProfileGridColumns()
Update the dynamic (per-layer) columns in the tuning profiles grid.
DELAY_PROFILE getProfileRow(int aRow)
Gets a tuning profile row as a set of persistable parameters.
BOARD * m_board
The current board.
std::shared_ptr< TIME_DOMAIN_PARAMETERS > m_timeDomainParameters
The parameters object to load / save data from / to.
void updateViaProfileNamesEditor(const wxString &aOldName=wxEmptyString, const wxString &aNewName=wxEmptyString) const
Updates the via override tuning profile name dropdown lists Updates entries if aOldName and aNewName ...
bool validateViaRows()
Validates all via override rows.
void OnDelayProfileGridCellChanging(wxGridEvent &event)
Validates a tuning profile row data.
DELAY_PROFILE_VIA_OVERRIDE_ENTRY getViaRow(int aRow)
Gets a via override row as a set of persistable parameters.
void OnRemoveDelayProfileClick(wxCommandEvent &event) override
Removes a tuning profile entry from the tuning profile grid.
bool TransferDataToWindow() override
Load parameter data from the settings object.
std::map< PCB_LAYER_ID, int > m_copperLayerIdsToColumns
void SyncCopperLayers(int aNumCopperLayers)
Called when switching to this tab to make sure that any changes to the copper layer count made on the...
std::unique_ptr< UNITS_PROVIDER > m_unitsProvider
std::vector< wxString > GetDelayProfileNames() const
Returns all configured tuning profile names. Used by the netclass setup panel.
The main frame for Pcbnew.
EDA_UNITS GetUserUnits() const
void SetAutoEvalColUnits(int col, EDA_UNITS aUnit, EDA_DATA_TYPE aUnitType)
Set the unit and unit data type to use for a given column.
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 EnsureColLabelsVisible()
Ensure the height of the row displaying the column labels is enough, even if labels are multiline tex...
void SetAutoEvalCols(const std::vector< int > &aCols)
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a EUNITS_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 SetBorders(bool aLeft, bool aRight, bool aTop, bool aBottom)
bool IsCopperLayerLowerThan(PCB_LAYER_ID aLayerA, PCB_LAYER_ID aLayerB)
Return true if copper aLayerA is placed lower than aLayerB, false otherwise.
PCB_LAYER_ID
A quick note on layer IDs:
Represents a single line in the time domain configuration via overrides configuration grid.
PCB_LAYER_ID m_SignalLayerFrom
PCB_LAYER_ID m_ViaLayerFrom
PCB_LAYER_ID m_SignalLayerTo
PCB_LAYER_ID m_ViaLayerTo
Represents a single line in the time domain configuration net class configuration grid.
std::vector< DELAY_PROFILE_VIA_OVERRIDE_ENTRY > m_ViaOverrides
std::map< PCB_LAYER_ID, int > m_LayerPropagationDelays
int m_ViaPropagationDelay