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