Warning, file /sdk/ktechlab/src/electronics/simulation/currentsignal.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 CURRENTSIGNAL_H
0012 #define CURRENTSIGNAL_H
0013 
0014 #include "elementsignal.h"
0015 #include "reactive.h"
0016 
0017 /**
0018 @short CurrentSignal
0019 @author David saxton
0020 */
0021 class CurrentSignal : public Reactive, public ElementSignal
0022 {
0023 public:
0024     CurrentSignal(double delta, double current);
0025     ~CurrentSignal() override;
0026 
0027     Element::Type type() const override
0028     {
0029         return Element_CurrentSignal;
0030     }
0031     void setCurrent(double current);
0032     double current()
0033     {
0034         return m_current;
0035     }
0036     void time_step() override;
0037 
0038 protected:
0039     void updateCurrents() override;
0040     void add_initial_dc() override;
0041 
0042     void addCurrents();
0043 
0044     double m_current;    // Current
0045     double m_oldCurrent; // Old calculated current
0046     double m_newCurrent; // New calculated current
0047 };
0048 
0049 #endif