Added RPOLYH & RPOLY2PH types to ResistorFamily.
This commit is contained in:
parent
f38945d200
commit
5f53487036
|
@ -53,6 +53,8 @@ extern "C" {
|
|||
|
||||
DirectGetBoolAttribute (PyResistorFamily_isLOWRES ,isLOWRES ,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)
|
||||
DirectGetLongAttribute (PyResistorFamily_getW ,getW ,PyResistorFamily,ResistorFamily)
|
||||
DirectGetLongAttribute (PyResistorFamily_getL ,getL ,PyResistorFamily,ResistorFamily)
|
||||
|
@ -78,6 +80,10 @@ extern "C" {
|
|||
, "Returns True if it is a LOWRES resistor." }
|
||||
, { "isHIRES" , (PyCFunction)PyResistorFamily_isHIRES , METH_NOARGS
|
||||
, "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
|
||||
, "Self explanatory." }
|
||||
, { "getW" , (PyCFunction)PyResistorFamily_getW , METH_NOARGS
|
||||
|
@ -128,6 +134,8 @@ extern "C" {
|
|||
|
||||
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::LOWRES ,"LOWRES" );
|
||||
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::HIRES ,"HIRES" );
|
||||
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::RPOLYH ,"RPOLYH" );
|
||||
LoadObjectConstant(PyTypeResistorFamily.tp_dict,ResistorFamily::RPOLY2PH,"RPOLY2PH");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace Analog {
|
|||
public:
|
||||
typedef Device Super;
|
||||
|
||||
enum Type { LOWRES=1, HIRES };
|
||||
enum Type { LOWRES=1, HIRES, RPOLYH, RPOLY2PH };
|
||||
public:
|
||||
inline MetaResistor* getReferenceResistor ();
|
||||
inline const MetaResistor* getReferenceResistor () const;
|
||||
|
@ -42,6 +42,8 @@ namespace Analog {
|
|||
// Geometrical (layout) parameters commons to all resistors.
|
||||
inline bool isLOWRES () const;
|
||||
inline bool isHIRES () const;
|
||||
inline bool isRPOLYH () const;
|
||||
inline bool isRPOLY2PH () const;
|
||||
inline int getBends () const;
|
||||
inline DbU::Unit getW () const;
|
||||
inline DbU::Unit getL () const;
|
||||
|
@ -79,6 +81,8 @@ namespace Analog {
|
|||
inline void ResistorFamily::setReferenceResistor ( MetaResistor* mr ) { _referenceResistor = mr; }
|
||||
inline bool ResistorFamily::isLOWRES () const { return getType() == LOWRES; }
|
||||
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.
|
||||
inline void ResistorFamily::setR ( float r ) { _secureGetReferenceResistor()->setR (r ); _r ->setValue(r ); }
|
||||
inline void ResistorFamily::setBends ( int bends ) { _secureGetReferenceResistor()->setBends(bends); _bends->setValue(bends); }
|
||||
|
|
Loading…
Reference in New Issue