00001 // $Id: meter.h 1182 2008-12-22 22:08:36Z dchassin $ 00002 // Copyright (C) 2008 Battelle Memorial Institute 00003 00004 #ifndef _METER_H 00005 #define _METER_H 00006 00007 #include "powerflow.h" 00008 #include "node.h" 00009 00010 class meter : public node 00011 { 00012 public: 00013 complex measured_voltage[3]; 00014 complex measured_voltageD[3]; 00015 complex measured_current[3]; 00016 double measured_real_energy; 00017 double measured_reactive_energy; 00018 complex measured_power; 00019 double measured_demand; 00020 double measured_real_power; 00021 double measured_reactive_power; 00022 complex indiv_measured_power[3]; 00023 TIMESTAMP dt; 00024 TIMESTAMP last_t; 00025 00026 #ifdef SUPPORT_OUTAGES 00027 int16 sustained_count; //reliability sustained event counter 00028 int16 momentary_count; //reliability momentary event counter 00029 int16 total_count; //reliability total event counter 00030 int16 s_flag; //reliability flag that gets set if the meter experienced more than n sustained interruptions 00031 int16 t_flag; //reliability flage that gets set if the meter experienced more than n events total 00032 complex pre_load; //the load prior to being interrupted 00033 #endif 00034 00035 public: 00036 static CLASS *oclass; 00037 static CLASS *pclass; 00038 public: 00039 meter(MODULE *mod); 00040 inline meter(CLASS *cl=oclass):node(cl){}; 00041 int create(void); 00042 int init(OBJECT *parent); 00043 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1); 00044 int isa(char *classname); 00045 }; 00046 00047 #endif // _METER_H 00048