File indexing completed on 2024-04-28 05:43:15
0001 /*************************************************************************** 0002 * Copyright (C) 2003-2004 by David Saxton * 0003 * david@bluehaze.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 ***************************************************************************/ 0010 0011 #ifndef CURRENTSOURCE_H 0012 #define CURRENTSOURCE_H 0013 0014 #include "element.h" 0015 0016 /** 0017 cnode n0 has current flowing otu of it, cnode n1 has current flowing into it 0018 @author David Saxton 0019 @short Current Source 0020 */ 0021 class CurrentSource : public Element 0022 { 0023 public: 0024 CurrentSource(const double current); 0025 ~CurrentSource() override; 0026 0027 Type type() const override 0028 { 0029 return Element_CurrentSource; 0030 } 0031 void setCurrent(const double i); 0032 0033 protected: 0034 void updateCurrents() override; 0035 void add_initial_dc() override; 0036 0037 private: 0038 double m_i; // Current 0039 }; 0040 0041 #endif