Added RPOLYH & RPOLY2PH types to ResistorFamily.

This commit is contained in:
Jean-Paul Chaput 2019-11-22 11:32:48 +01:00
parent f38945d200
commit 5f53487036
2 changed files with 32 additions and 20 deletions

View File

@ -53,6 +53,8 @@ extern "C" {
DirectGetBoolAttribute (PyResistorFamily_isLOWRES ,isLOWRES ,PyResistorFamily,ResistorFamily) DirectGetBoolAttribute (PyResistorFamily_isLOWRES ,isLOWRES ,PyResistorFamily,ResistorFamily)
DirectGetBoolAttribute (PyResistorFamily_isHIRES ,isHIRES ,PyResistorFamily,ResistorFamily) DirectGetBoolAttribute (PyResistorFamily_isHIRES ,isHIRES ,PyResistorFamily,ResistorFamily)
DirectGetBoolAttribute (PyResistorFamily_isRPOLYH ,isRPOLYH ,PyResistorFamily,ResistorFamily)
DirectGetBoolAttribute (PyResistorFamily_isRPOLY2PH,isRPOLY2PH,PyResistorFamily,ResistorFamily)
DirectGetIntAttribute (PyResistorFamily_getBends ,getBends ,PyResistorFamily,ResistorFamily) DirectGetIntAttribute (PyResistorFamily_getBends ,getBends ,PyResistorFamily,ResistorFamily)
DirectGetLongAttribute (PyResistorFamily_getW ,getW ,PyResistorFamily,ResistorFamily) DirectGetLongAttribute (PyResistorFamily_getW ,getW ,PyResistorFamily,ResistorFamily)
DirectGetLongAttribute (PyResistorFamily_getL ,getL ,PyResistorFamily,ResistorFamily) DirectGetLongAttribute (PyResistorFamily_getL ,getL ,PyResistorFamily,ResistorFamily)
@ -78,6 +80,10 @@ extern "C" {
, "Returns True if it is a LOWRES resistor." } , "Returns True if it is a LOWRES resistor." }
, { "isHIRES" , (PyCFunction)PyResistorFamily_isHIRES , METH_NOARGS , { "isHIRES" , (PyCFunction)PyResistorFamily_isHIRES , METH_NOARGS
, "Returns True if it is a HIRES resistor." } , "Returns True if it is a HIRES resistor." }
, { "isRPOLYH" , (PyCFunction)PyResistorFamily_isRPOLYH , METH_NOARGS
, "Returns True if it is a RPOLYH resistor." }
, { "isRPOLY2PH" , (PyCFunction)PyResistorFamily_isRPOLY2PH , METH_NOARGS
, "Returns True if it is a RPOLY2PH resistor." }
, { "getBends" , (PyCFunction)PyResistorFamily_getBends , METH_NOARGS , { "getBends" , (PyCFunction)PyResistorFamily_getBends , METH_NOARGS
, "Self explanatory." } , "Self explanatory." }
, { "getW" , (PyCFunction)PyResistorFamily_getW , METH_NOARGS , { "getW" , (PyCFunction)PyResistorFamily_getW , METH_NOARGS
@ -128,6 +134,8 @@ extern "C" {
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::LOWRES ,"LOWRES" ); LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::LOWRES ,"LOWRES" );
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::HIRES ,"HIRES" ); LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::HIRES ,"HIRES" );
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::RPOLYH ,"RPOLYH" );
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::RPOLY2PH,"RPOLY2PH");
} }

View File

@ -34,7 +34,7 @@ namespace Analog {
public: public:
typedef Device Super; typedef Device Super;
enum Type { LOWRES=1, HIRES }; enum Type { LOWRES=1, HIRES, RPOLYH, RPOLY2PH };
public: public:
inline MetaResistor* getReferenceResistor (); inline MetaResistor* getReferenceResistor ();
inline const MetaResistor* getReferenceResistor () const; inline const MetaResistor* getReferenceResistor () const;
@ -42,6 +42,8 @@ namespace Analog {
// Geometrical (layout) parameters commons to all resistors. // Geometrical (layout) parameters commons to all resistors.
inline bool isLOWRES () const; inline bool isLOWRES () const;
inline bool isHIRES () const; inline bool isHIRES () const;
inline bool isRPOLYH () const;
inline bool isRPOLY2PH () const;
inline int getBends () const; inline int getBends () const;
inline DbU::Unit getW () const; inline DbU::Unit getW () const;
inline DbU::Unit getL () const; inline DbU::Unit getL () const;
@ -79,6 +81,8 @@ namespace Analog {
inline void ResistorFamily::setReferenceResistor ( MetaResistor* mr ) { _referenceResistor = mr; } inline void ResistorFamily::setReferenceResistor ( MetaResistor* mr ) { _referenceResistor = mr; }
inline bool ResistorFamily::isLOWRES () const { return getType() == LOWRES; } inline bool ResistorFamily::isLOWRES () const { return getType() == LOWRES; }
inline bool ResistorFamily::isHIRES () const { return getType() == HIRES; } inline bool ResistorFamily::isHIRES () const { return getType() == HIRES; }
inline bool ResistorFamily::isRPOLYH () const { return getType() == RPOLYH; }
inline bool ResistorFamily::isRPOLY2PH () const { return getType() == RPOLY2PH; }
// Mutators. // Mutators.
inline void ResistorFamily::setR ( float r ) { _secureGetReferenceResistor()->setR (r ); _r ->setValue(r ); } inline void ResistorFamily::setR ( float r ) { _secureGetReferenceResistor()->setR (r ); _r ->setValue(r ); }
inline void ResistorFamily::setBends ( int bends ) { _secureGetReferenceResistor()->setBends(bends); _bends->setValue(bends); } inline void ResistorFamily::setBends ( int bends ) { _secureGetReferenceResistor()->setBends(bends); _bends->setValue(bends); }