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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
25#define PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
26
27
30
32{
33public:
35 TUNING_PROFILE_PARAMETERS_IFACE( aBoard, aCalculation )
36 {
37 }
38
43 void OnSettingsChanged() override;
44
52 std::vector<int64_t> GetPropagationDelays( const std::vector<LENGTH_DELAY_CALCULATION_ITEM>& aItems,
53 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
54
62 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
63
71 int64_t GetTrackLengthForPropagationDelay( int64_t aDelay,
72 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
73
81 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext ) override;
82
83private:
84 void rebuildCaches();
85
88 {
93
94 bool operator<( const VIA_OVERRIDE_CACHE_KEY& aOther ) const
95 {
96 if( SignalStart < aOther.SignalStart )
97 return true;
98 if( aOther.SignalStart < SignalStart )
99 return false;
100 if( SignalEnd < aOther.SignalEnd )
101 return true;
102 if( aOther.SignalEnd < SignalEnd )
103 return false;
104 if( ViaStart < aOther.ViaStart )
105 return true;
106 if( aOther.ViaStart < ViaStart )
107 return false;
108 return ViaEnd < aOther.ViaEnd;
109 }
110 };
111
125 const TUNING_PROFILE_GEOMETRY_CONTEXT& aContext,
126 const TUNING_PROFILE* aDelayProfile ) const;
127
134 const TUNING_PROFILE* GetTuningProfile( const wxString& aDelayProfileName );
135
137 std::map<wxString, const TUNING_PROFILE*> m_delayProfilesCache;
138
140 std::map<wxString, std::map<VIA_OVERRIDE_CACHE_KEY, int64_t>> m_viaOverridesCache;
141};
142
143#endif //PCB_NEW_TUNING_PROFILE_PARAMETERS_USER_DEFINED_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
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...
const TUNING_PROFILE * GetTuningProfile(const wxString &aDelayProfileName)
Gets the tuning profile pointer for the given tuning profile name.
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.
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.
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)
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
A data structure to contain basic geometry data which can affect signal propagation calculations.
Represents a single line in the tuning profile configuration grid.