00001 #ifndef _BusVoltageListener_h_
00002 #define _BusVoltageListener_h_
00003 #include <fstream>
00004 #include "adevs.h"
00005 #include "ElectricalModel.h"
00006
00010 class BusVoltageListener:
00011 public adevs::EventListener<adevs::PortValue<BasicEvent*> >
00012 {
00013 public:
00020 BusVoltageListener(ElectricalModel* model, double cint = 1E-1, std::string model_name = "");
00021 void outputEvent(adevs::Event<adevs::PortValue<BasicEvent*> >, double){}
00022 void stateChange(adevs::Atomic<adevs::PortValue<BasicEvent*> >* model, double t);
00023 ~BusVoltageListener();
00024 private:
00025 const double cint;
00026 std::ofstream fout;
00027 double t_last_record;
00028 ElectricalModel* src;
00029 };
00030
00031 #endif
00032