00001
00009 #ifndef _central_dg_control_H
00010 #define _central_dg_control_H
00011
00012 #include <stdarg.h>
00013 #include "generators.h"
00014
00015 EXPORT STATUS postupdate_central_dg_control(OBJECT *obj, complex *useful_value, unsigned int mode_pass);
00016
00017
00018
00019
00020
00021 class central_dg_control
00022 {
00023 private:
00024 gld_property *pPower_Meas[3];
00025 protected:
00026
00027 public:
00028
00029
00030
00031 char32 controlled_objects;
00032 inverter **inverter_set;
00033 inverter ***battery_inverter_set;
00034 inverter ***solar_inverter_set;
00035 battery **battery_set;
00036 solar **solar_set;
00037 OBJECT *feederhead_meter;
00038 int controlled_count;
00039 int inverter_count;
00040 int battery_count;
00041 int solar_count;
00042 int battery_inverter_count;
00043 int solar_inverter_count;
00044 typedef enum CONTROL_MODE {NO_SETTING=-1, NO_CONTROL=0, CONSTANT_PF=1, PEAK_SHAVING=2} control_mode;
00045 control_mode control_mode_setting[4];
00046 control_mode active_control_mode;
00047 double P[3];
00048 double P_3p;
00049 double Q[3];
00050 double Q_3p;
00051 complex S_3p;
00052 double P_disp_3p;
00053 double Q_disp_3p;
00054 double P_gen[3];
00055 double P_gen_3p;
00056 double Q_gen[3];
00057 double Q_gen_3p;
00058 double P_gen_solar[3];
00059 double P_gen_solar_3p;
00060 double Q_gen_solar[3];
00061 double Q_gen_solar_3p;
00062 double P_gen_battery[3];
00063 double P_gen_battery_3p;
00064 double Q_gen_battery[3];
00065 double Q_gen_battery_3p;
00066 double pf_meas_3p;
00067 double pf_low;
00068 double pf_high;
00069 double S_peak;
00070 double all_inverter_S_rated;
00071 double all_battery_S_rated;
00072 double all_solar_S_rated;
00073
00074 public:
00075
00076 central_dg_control(MODULE *module);
00077 int create(void);
00078 int init(OBJECT *parent);
00079 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00080 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00081 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00082 public:
00083 static CLASS *oclass;
00084 static central_dg_control *defaults;
00085 static CLASS *plcass;
00086 #ifdef OPTIONAL
00087 static CLASS *pclass;
00088 TIMESTAMPP plc(TIMESTAMP t0, TIMESTAMP t1);
00089 #endif
00090 };
00091
00092 #endif