00001 #ifndef _GenrPowerListener_h_ 00002 #define _GenrPowerListener_h_ 00003 #include <fstream> 00004 #include "adevs.h" 00005 #include "ElectricalModel.h" 00006 00010 class GenrPowerListener: 00011 public adevs::EventListener<adevs::PortValue<BasicEvent*> > 00012 { 00013 public: 00020 GenrPowerListener(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 ~GenrPowerListener(); 00024 private: 00025 const double cint; 00026 std::ofstream fout; 00027 double t_last; 00028 ElectricalModel* src; 00029 }; 00030 00031 #endif 00032