← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Separate ElectricPinType and TypeSheetLabel

 

Le 16/02/2016 19:34, Simon Richter a écrit :
> 
> These enums are silently treated as equivalent in the ERC, because the
> values are casted to integers. This works for the most part, because the
> values are similar, but this is in no way enforced, and there is a small
> inconsistency (NET_UNSPECIFIED vs PIN_PASSIVE).
> 
> This turns the storage into a discriminated union, and provides an accessor
> method that checks that a meaningful value can be returned and returns an
> ElectricPinType in any case.
> ---
>  eeschema/class_netlist_object.cpp | 36 ++++++++++++++++++++++++++++++++++--
>  eeschema/class_netlist_object.h   |  3 +++
>  eeschema/erc.cpp                  |  8 ++++----
>  3 files changed, 41 insertions(+), 6 deletions(-)

Simon,
Thanks for your patch.

However, I committed a different change, because ElectricPinType enum
(now ELECTRICAL_PINTYPE enum) is not used by ERC for sheet labels.

So I removed the useless and questionable copy of Sheet label shape to
the m_Eectrical_Type member of NETLIST_OBJECT, and ELECTRICAL_PINTYPE
enum is no more casted to int in code.


-- 
Jean-Pierre CHARRAS


References