00001 /*************************************************************************** 00002 * Copyright (C) 2003-2004 by David Saxton * 00003 * david@bluehaze.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef VOLTAGESIGNAL_H 00012 #define VOLTAGESIGNAL_H 00013 00014 #include "reactive.h" 00015 #include "elementsignal.h" 00016 00021 class VoltageSignal : public Reactive, public ElementSignal 00022 { 00023 public: 00024 VoltageSignal( const double delta, const double voltage ); 00025 virtual ~VoltageSignal(); 00026 00027 virtual Element::Type type() const { return Element_VoltageSignal; } 00028 void setVoltage( const double voltage ); 00029 double voltage() { return m_voltage; } 00030 virtual void time_step(); 00031 virtual void add_map(); 00032 00033 protected: 00034 virtual void updateCurrents(); 00035 virtual void add_initial_dc(); 00036 00037 private: 00038 double m_voltage; // Voltage 00039 }; 00040 00041 #endif
1.5.1