KiCad PCB EDA Suite
Loading...
Searching...
No Matches
tuning_profile_parameters_user_defined.h
Go to the documentation of this file.
1/*
2* This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
21#define PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
22
23
26
28{
29public:
31 TUNING_PROFILE_PARAMETERS_IFACE( aBoard, aCalculation )
32 {
33 }
34
39 void OnSettingsChanged() override;
40
48 std::vector<int64_t> GetPropagationDelays( const std::vector<LENGTH_DELAY_CALCULATION_ITEM>& aItems,
49 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
50
58 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
59
69 int64_t GetViaPropagationDelay( const PCB_LAYER_ID aSignalStartLayer, const PCB_LAYER_ID aSignalEndLayer,
70 const PCB_LAYER_ID aViaStartLayer, const PCB_LAYER_ID aViaEndLayer,
71 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) const override;
72
80 int64_t GetTrackLengthForPropagationDelay( int64_t aDelay,
81 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
82
88 bool CanCalculateLengthForDelay( const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) const override;
89
97 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
98
99private:
100 void rebuildCaches();
101
104 {
109
110 bool operator<( const VIA_OVERRIDE_CACHE_KEY& aOther ) const
111 {
112 if( SignalStart < aOther.SignalStart )
113 return true;
114 if( aOther.SignalStart < SignalStart )
115 return false;
116 if( SignalEnd < aOther.SignalEnd )
117 return true;
118 if( aOther.SignalEnd < SignalEnd )
119 return false;
120 if( ViaStart < aOther.ViaStart )
121 return true;
122 if( aOther.ViaStart < ViaStart )
123 return false;
124 return ViaEnd < aOther.ViaEnd;
125 }
126 };
127
141 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext,
142 const TUNING_PROFILE* aDelayProfile ) const;
143
153 int64_t getViaPropagationDelay( const PCB_LAYER_ID aSignalStartLayer, const PCB_LAYER_ID aSignalEndLayer,
154 const PCB_LAYER_ID aViaStartLayer, const PCB_LAYER_ID aViaEndLayer,
155 const TUNING_PROFILE* aTuningProfile ) const;
156
163 const TUNING_PROFILE* GetTuningProfile( const wxString& aDelayProfileName ) const;
164
171 double getTrackDelayPerMM( const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) const;
172
174 std::map<wxString, const TUNING_PROFILE*> m_delayProfilesCache;
175
177 std::map<wxString, std::map<VIA_OVERRIDE_CACHE_KEY, int64_t>> m_viaOverridesCache;
178};
179
180#endif //PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
Lightweight class which holds a pad, via, or a routed trace outline.
Class which calculates lengths (and associated routing statistics) in a BOARD context.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
TUNING_PROFILE_PARAMETERS_IFACE(BOARD *aBoard, LENGTH_DELAY_CALCULATION *aCalculation)
std::map< wxString, const TUNING_PROFILE * > m_delayProfilesCache
Cached map of tuning profile names to per-layer time domain parameters.
int64_t GetTrackLengthForPropagationDelay(int64_t aDelay, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) override
Gets the track length (in internal distance units) required for the given propagation delay (in inter...
int64_t getViaPropagationDelay(const PCB_LAYER_ID aSignalStartLayer, const PCB_LAYER_ID aSignalEndLayer, const PCB_LAYER_ID aViaStartLayer, const PCB_LAYER_ID aViaEndLayer, const TUNING_PROFILE *aTuningProfile) const
Gets the via propagation delay for the given via layer geometry.
int64_t CalculatePropagationDelayForShapeLineChain(const SHAPE_LINE_CHAIN &aShape, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) override
Gets the propagation delay for the given shape line chain.
std::map< wxString, std::map< VIA_OVERRIDE_CACHE_KEY, int64_t > > m_viaOverridesCache
Cached per-tuning profile via overrides.
bool CanCalculateLengthForDelay(const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) const override
Returns true if the net class tuning profile defines a non-zero track delay for the context layer.
int64_t GetPropagationDelay(const LENGTH_DELAY_CALCULATION_ITEM &aItem, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) override
Gets the propagation delay (in internal units) for the given item in the given geometry context.
const TUNING_PROFILE * GetTuningProfile(const wxString &aDelayProfileName) const
Gets the tuning profile pointer for the given tuning profile name.
double getTrackDelayPerMM(const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) const
Gets the track propagation delay per millimetre for the given geometry context.
void OnSettingsChanged() override
Event called by the length and time calculation architecture if netclass definitions have changed.
std::vector< int64_t > GetPropagationDelays(const std::vector< LENGTH_DELAY_CALCULATION_ITEM > &aItems, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) override
Gets the propagation delays (in internal units) for the given items in the given geometry context.
int64_t getPropagationDelay(const LENGTH_DELAY_CALCULATION_ITEM &aItem, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext, const TUNING_PROFILE *aDelayProfile) const
Gets the propagation delay (in internal units) for the given item in the given geometry context,...
TUNING_PROFILE_PARAMETERS_USER_DEFINED(BOARD *aBoard, LENGTH_DELAY_CALCULATION *aCalculation)
int64_t GetViaPropagationDelay(const PCB_LAYER_ID aSignalStartLayer, const PCB_LAYER_ID aSignalEndLayer, const PCB_LAYER_ID aViaStartLayer, const PCB_LAYER_ID aViaEndLayer, const TUNING_PROFILE_GEOMETRY_CONTEXT &aContext) const override
Gets the via propagation delay for the given via layer geometry.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
A data structure to contain basic geometry data which can affect signal propagation calculations.
Represents a single line in the tuning profile configuration grid.