00001 #ifndef CCapasistor_HH 00002 #define CCapasistor_HH 00003 00004 #include <electro/CElement.hh> 00005 #include <vector> 00006 00007 00011 class CCapasistor : public CElementPasive 00012 { 00013 public: 00023 CCapasistor(std::string name,float c,int x=0,int y=0,int rot=0) : CElementPasive("CAP",name,x,y,rot) { 00024 m_unitSymbol = "F"; 00025 m_valueSymbol = "C"; 00026 m_c=c; 00027 } 00032 ~CCapasistor(){} 00033 00039 void setC(float c){m_c=c;} 00045 float getC(void ){return m_c;} 00052 Complex getZc(double omega){ 00053 if(omega!=0) 00054 return Complex(0,-1/(omega*m_c)); 00055 else 00056 return Complex(0,-MAX_DOUBLE); 00057 } 00064 Complex getYc(double omega){return Complex(0,-omega*m_c);} 00065 00066 00067 double getValue() {return getC();} 00068 void draw(); 00069 00070 protected: 00072 float m_c; 00073 }; 00074 00075 #endif