Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
|
|
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
2022-08-14 11:03:18 +00:00
|
|
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
#ifndef BOARD_CONNECTED_ITEM_H
|
|
|
|
#define BOARD_CONNECTED_ITEM_H
|
|
|
|
|
2020-11-14 18:11:28 +00:00
|
|
|
#include <board_item.h>
|
2023-05-12 21:03:54 +00:00
|
|
|
#include <teardrop/teardrop_parameters.h>
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
class NETCLASS;
|
2021-06-06 12:45:00 +00:00
|
|
|
class NETINFO_ITEM;
|
2020-11-12 22:30:02 +00:00
|
|
|
class PAD;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* A base class derived from #BOARD_ITEM for items that can be connected and have a net, a
|
|
|
|
* netname, a clearance ...
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
|
|
|
class BOARD_CONNECTED_ITEM : public BOARD_ITEM
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype );
|
|
|
|
|
2016-05-30 08:44:48 +00:00
|
|
|
// Do not create a copy constructor & operator=.
|
|
|
|
// The ones generated by the compiler are adequate.
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2014-06-06 09:44:21 +00:00
|
|
|
static inline bool ClassOf( const EDA_ITEM* aItem )
|
|
|
|
{
|
2021-07-19 23:56:05 +00:00
|
|
|
if( aItem == nullptr )
|
2014-06-12 20:03:57 +00:00
|
|
|
return false;
|
|
|
|
|
2014-06-06 09:44:21 +00:00
|
|
|
switch( aItem->Type() )
|
|
|
|
{
|
2014-06-12 20:03:57 +00:00
|
|
|
case PCB_PAD_T:
|
2014-06-06 09:44:21 +00:00
|
|
|
case PCB_TRACE_T:
|
2019-05-17 00:13:21 +00:00
|
|
|
case PCB_ARC_T:
|
2014-06-06 09:44:21 +00:00
|
|
|
case PCB_VIA_T:
|
2020-11-11 23:05:59 +00:00
|
|
|
case PCB_ZONE_T:
|
2023-07-30 19:39:07 +00:00
|
|
|
case PCB_SHAPE_T:
|
2014-06-06 09:44:21 +00:00
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-27 22:15:38 +00:00
|
|
|
///< @copydoc BOARD_ITEM::IsConnected()
|
2016-09-24 18:53:15 +00:00
|
|
|
bool IsConnected() const override
|
2014-01-28 15:23:08 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Return #NET_INFO object for a given item.
|
2014-02-25 10:40:34 +00:00
|
|
|
*/
|
|
|
|
NETINFO_ITEM* GetNet() const
|
|
|
|
{
|
|
|
|
return m_netinfo;
|
|
|
|
}
|
|
|
|
|
2016-09-05 13:38:01 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Set a NET_INFO object for the item.
|
2016-09-05 13:38:01 +00:00
|
|
|
*/
|
|
|
|
void SetNet( NETINFO_ITEM* aNetInfo )
|
|
|
|
{
|
|
|
|
m_netinfo = aNetInfo;
|
|
|
|
}
|
|
|
|
|
2014-02-25 10:40:34 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* @return the net code.
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2021-06-06 12:45:00 +00:00
|
|
|
int GetNetCode() const;
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
|
BOARD_CONNECTED_ITEMs do not store net code anymore (m_NetCode field), instead net info is stored using a pointer to NETINFO_ITEM.
GetNet() refers to the net code stored in the NETINFO_ITEM. SetNet() finds an appropriate NETINFO_ITEM and uses it.
Removing GetNet() & SetNet() (and the whole net code idea) requires too many changes in the code (~250 references to the mentioned functions).
BOARD_CONNECTED_ITEMs by default get a pointer to NETINFO_ITEM that stores unconnected items. This requires for all BOARD_CONNECTED_ITEMs to have a parent (so BOARD* is accessible). The only orphaned item is BOARD_DESIGN_SETTINGS::m_Pad_Master, but it does not cause any issues so far.
Items that do not have access to a BOARD (do not have set parents) and therefore cannot get net assigned, by default get const static NETINFO_LIST::ORPHANED.
Performed tests:
- loaded .kicad_pcb, KiCad legacy board, Eagle 6.0 board, P-CAD board - all ok
- load a simple project, reload netlist after changing connections in eeschema - ok
- save & reload a board - ok, but still contain empty nets
- remove everything, restore with undo - ok
- remove everything, reload netlist - ok
- changing net names (all possibilites: empty->existing, empty->not existing, existing->empty, existing->not existing) - all ok
- zones: when net is changed to a net that does not have any nodes besides the zone itself, it does not get filled
2014-01-15 17:03:06 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Set net using a net code.
|
|
|
|
*
|
|
|
|
* @note Pads not on copper layers will have their net code always set to 0 (not connected).
|
|
|
|
*
|
|
|
|
* @param aNetCode is a net code for the new net. It has to exist in #NETINFO_LIST held
|
|
|
|
* by #BOARD.
|
|
|
|
* @param aNoAssert if true, do not assert that the net exists. Otherwise, item is assigned
|
|
|
|
* to the unconnected net.
|
2015-06-08 19:28:04 +00:00
|
|
|
* @return true on success, false if the net did not exist
|
BOARD_CONNECTED_ITEMs do not store net code anymore (m_NetCode field), instead net info is stored using a pointer to NETINFO_ITEM.
GetNet() refers to the net code stored in the NETINFO_ITEM. SetNet() finds an appropriate NETINFO_ITEM and uses it.
Removing GetNet() & SetNet() (and the whole net code idea) requires too many changes in the code (~250 references to the mentioned functions).
BOARD_CONNECTED_ITEMs by default get a pointer to NETINFO_ITEM that stores unconnected items. This requires for all BOARD_CONNECTED_ITEMs to have a parent (so BOARD* is accessible). The only orphaned item is BOARD_DESIGN_SETTINGS::m_Pad_Master, but it does not cause any issues so far.
Items that do not have access to a BOARD (do not have set parents) and therefore cannot get net assigned, by default get const static NETINFO_LIST::ORPHANED.
Performed tests:
- loaded .kicad_pcb, KiCad legacy board, Eagle 6.0 board, P-CAD board - all ok
- load a simple project, reload netlist after changing connections in eeschema - ok
- save & reload a board - ok, but still contain empty nets
- remove everything, restore with undo - ok
- remove everything, reload netlist - ok
- changing net names (all possibilites: empty->existing, empty->not existing, existing->empty, existing->not existing) - all ok
- zones: when net is changed to a net that does not have any nodes besides the zone itself, it does not get filled
2014-01-15 17:03:06 +00:00
|
|
|
*/
|
2020-02-05 10:54:25 +00:00
|
|
|
bool SetNetCode( int aNetCode, bool aNoAssert );
|
|
|
|
|
|
|
|
void SetNetCode( int aNetCode )
|
|
|
|
{
|
|
|
|
SetNetCode( aNetCode, false );
|
|
|
|
}
|
2013-05-26 04:36:44 +00:00
|
|
|
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* @return the full netname.
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
*/
|
2021-06-06 12:45:00 +00:00
|
|
|
wxString GetNetname() const;
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
|
2018-01-31 09:08:57 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* @return the full netname or "<no net>" in square braces, followed by "(Not Found)" if the
|
|
|
|
* netcode is undefined.
|
2018-01-31 09:08:57 +00:00
|
|
|
*/
|
2020-10-15 22:39:33 +00:00
|
|
|
wxString GetNetnameMsg() const;
|
2018-01-31 09:08:57 +00:00
|
|
|
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* @return the short netname.
|
Removed D_PAD::SetNetname() function and D_PAD::m_Netname, D_PAD::m_ShortNetname fields.
D_PAD::GetNetname() and D_PAD::GetShortNetname() were moved to BOARD_CONNECTED_ITEM. Now they use the net name stored in NETINFO_ITEM.
Moved some one-line functions from class_board_connected_item.cpp to class_board_connected_item.h.
Added a copyright notice, moved Doxygen comments from class_board_connected_item.cpp to class_board_connected_item.h.
I have some doubts if changes introduced pcbnew/dialogs/dialog_pad_properties.cpp do not break anything, but I could not find a test case that breaks the pcbnew.
Performed tests:
- changed pad's net name from empty to existent - ok, name was changed
- changed pad's net name from empty to nonexistent - ok, error message is displayed, net name stays empty
- changed pad's net name from existent to empty - ok, net name became empty
- changed pad's net name from existent to nonexistent - ok, error message is displayed, net name is not changed
- (re)reading netlists, including net changes - fine, changes are applied, but empty nets are still kept
- loaded pcbnew/pcad2kicadpcb_plugin/examples/CK1202_V1.pcb to test P-CAD import plugin - ok, net names are correct
- imported an Eagle 6.0 board (Arduino Uno; http://arduino.cc/en/uploads/Main/arduino_Uno_Rev3-02-TH.zip) then saved in .kicad_pcb format and reloaded - ok, net names are correct
- saved demos/video/video.kicad_pcb in legacy format and then loaded it again - ok, net names are correct
2014-01-14 09:41:52 +00:00
|
|
|
*/
|
2024-06-14 17:21:48 +00:00
|
|
|
const wxString& GetShortNetname() const;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2023-01-27 15:37:36 +00:00
|
|
|
/**
|
|
|
|
* @return the unescaped short netname.
|
|
|
|
*/
|
2024-06-14 17:21:48 +00:00
|
|
|
const wxString& GetDisplayNetname() const;
|
2023-01-27 15:37:36 +00:00
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Return an item's "own" clearance in internal units.
|
|
|
|
*
|
|
|
|
* @param aLayer the layer in question.
|
|
|
|
* @param aSource [out] optionally reports the source as a user-readable string.
|
|
|
|
* @return the clearance in internal units.
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2020-10-12 17:40:03 +00:00
|
|
|
virtual int GetOwnClearance( PCB_LAYER_ID aLayer, wxString* aSource = nullptr ) const;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2020-05-29 12:36:45 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
|
|
|
|
*
|
|
|
|
* @param aSource [out] optionally reports the source as a user-readable string.
|
|
|
|
* @return the clearance in internal units.
|
2020-05-29 12:36:45 +00:00
|
|
|
*/
|
2020-09-05 16:00:29 +00:00
|
|
|
virtual int GetLocalClearanceOverrides( wxString* aSource ) const { return 0; }
|
2020-05-29 12:36:45 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Return any local clearances set in the "classic" (ie: pre-rule) system. These are
|
|
|
|
* things like zone clearance which are **not** an override.
|
|
|
|
*
|
|
|
|
* @param aSource [out] optionally reports the source as a user readable string.
|
|
|
|
* @return the clearance in internal units.
|
2020-05-29 12:36:45 +00:00
|
|
|
*/
|
2020-09-05 16:00:29 +00:00
|
|
|
virtual int GetLocalClearance( wxString* aSource ) const { return 0; }
|
2020-05-29 12:36:45 +00:00
|
|
|
|
2020-05-18 00:20:16 +00:00
|
|
|
/**
|
2021-01-27 22:15:38 +00:00
|
|
|
* Return the #NETCLASS for this item.
|
2020-05-18 00:20:16 +00:00
|
|
|
*
|
2021-01-27 22:15:38 +00:00
|
|
|
* @note Do **not** return a std::shared_ptr from this. It is used heavily in DRC, and the
|
|
|
|
* std::shared_ptr stuff shows up large in performance profiling.
|
2020-05-18 00:20:16 +00:00
|
|
|
*/
|
2022-08-14 11:03:18 +00:00
|
|
|
virtual NETCLASS* GetEffectiveNetClass() const;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2020-05-23 21:48:24 +00:00
|
|
|
/**
|
2022-08-14 11:03:18 +00:00
|
|
|
* Returns the name of the effective netclass. Primarily for the use of the property system.
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2022-08-14 11:03:18 +00:00
|
|
|
wxString GetNetClassName() const;
|
2014-02-25 10:40:34 +00:00
|
|
|
|
2023-05-12 21:03:54 +00:00
|
|
|
void SetLocalRatsnestVisible( bool aVisible ) { m_localRatsnestVisible = aVisible; }
|
|
|
|
bool GetLocalRatsnestVisible() const { return m_localRatsnestVisible; }
|
2017-03-28 16:30:49 +00:00
|
|
|
|
2023-05-12 21:03:54 +00:00
|
|
|
TEARDROP_PARAMETERS& GetTeardropParams() { return m_teardropParams; }
|
|
|
|
const TEARDROP_PARAMETERS& GetTeardropParams() const { return m_teardropParams; }
|
|
|
|
|
|
|
|
void SetTeardropsEnabled( bool aEnable ) { m_teardropParams.m_Enabled = aEnable; }
|
|
|
|
bool GetTeardropsEnabled() const { return m_teardropParams.m_Enabled; }
|
|
|
|
|
|
|
|
void SetTeardropBestLengthRatio( double aRatio ) { m_teardropParams.m_BestLengthRatio = aRatio; }
|
|
|
|
double GetTeardropBestLengthRatio() const { return m_teardropParams.m_BestLengthRatio; }
|
|
|
|
|
|
|
|
void SetTeardropMaxLength( int aMaxLength ) { m_teardropParams.m_TdMaxLen = aMaxLength; }
|
|
|
|
int GetTeardropMaxLength() const { return m_teardropParams.m_TdMaxLen; }
|
|
|
|
|
|
|
|
void SetTeardropBestWidthRatio( double aRatio ) { m_teardropParams.m_BestWidthRatio = aRatio; }
|
|
|
|
double GetTeardropBestWidthRatio() const { return m_teardropParams.m_BestWidthRatio; }
|
|
|
|
|
|
|
|
void SetTeardropMaxWidth( int aMaxWidth ) { m_teardropParams.m_TdMaxWidth = aMaxWidth; }
|
|
|
|
int GetTeardropMaxWidth() const { return m_teardropParams.m_TdMaxWidth; }
|
|
|
|
|
|
|
|
void SetTeardropCurvePts( int aPointCount ) { m_teardropParams.m_CurveSegCount = aPointCount; }
|
|
|
|
int GetTeardropCurvePts() const { return m_teardropParams.m_CurveSegCount; }
|
|
|
|
|
|
|
|
void SetTeardropPreferZoneConnections( bool aPrefer ) { m_teardropParams.m_TdOnPadsInZones = !aPrefer; }
|
|
|
|
bool GetTeardropPreferZoneConnections() const { return !m_teardropParams.m_TdOnPadsInZones; }
|
|
|
|
|
|
|
|
void SetTeardropAllowSpanTwoTracks( bool aAllow ) { m_teardropParams.m_AllowUseTwoTracks = aAllow; }
|
|
|
|
bool GetTeardropAllowSpanTwoTracks() const { return m_teardropParams.m_AllowUseTwoTracks; }
|
|
|
|
|
|
|
|
void SetTeardropMaxTrackWidth( double aRatio ) { m_teardropParams.m_WidthtoSizeFilterRatio = aRatio; }
|
|
|
|
double GetTeardropMaxTrackWidth() const { return m_teardropParams.m_WidthtoSizeFilterRatio; }
|
2017-03-28 16:30:49 +00:00
|
|
|
|
2014-02-25 10:40:34 +00:00
|
|
|
protected:
|
2021-01-27 22:15:38 +00:00
|
|
|
/// Store all information about the net that item belongs to.
|
2014-02-25 10:40:34 +00:00
|
|
|
NETINFO_ITEM* m_netinfo;
|
|
|
|
|
2023-05-12 21:03:54 +00:00
|
|
|
/// Not all BOARD_CONNECTED_ITEMs support teardrops, but we want those that do to share a
|
|
|
|
/// single section in the property inspector.
|
|
|
|
TEARDROP_PARAMETERS m_teardropParams;
|
|
|
|
|
2014-02-25 10:40:34 +00:00
|
|
|
private:
|
2017-03-28 16:30:49 +00:00
|
|
|
bool m_localRatsnestVisible;
|
2023-05-12 21:03:54 +00:00
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BOARD_CONNECTED_ITEM_H
|