00001
00002
00003
00004 #ifndef _REGULATOR_H
00005 #define _REGULATOR_H
00006
00007 #include "powerflow.h"
00008 #include "link.h"
00009 #include "regulator_configuration.h"
00010
00011 #define tap_A tap[0]
00012 #define tap_B tap[1]
00013 #define tap_C tap[2]
00014
00015 class regulator : public link
00016 {
00017 public:
00018 double VtapChange;
00019 double tapChangePer;
00020 double Vlow;
00021 double Vhigh;
00022 complex V2[3], Vcomp[3];
00023 int16 tap[3];
00024 int16 prev_tap[3];
00025 complex volt[3];
00026 complex D_mat[3][3];
00027 complex W_mat[3][3];
00028 complex curr[3];
00029 OBJECT *RemoteNode;
00030
00031
00032
00033 protected:
00034 int64 mech_t_next[3];
00035 int64 dwell_t_next[3];
00036 int64 next_time;
00037 int16 mech_flag[3];
00038 int16 dwell_flag[3];
00039 int16 first_run_flag[3];
00040 complex check_voltage[3];
00041 void get_monitored_voltage();
00042
00043 private:
00044 bool offnominal_time;
00045 public:
00046 static CLASS *oclass;
00047 static CLASS *pclass;
00048
00049 public:
00050 OBJECT *configuration;
00051 regulator(MODULE *mod);
00052 inline regulator(CLASS *cl=oclass):link(cl){};
00053 int create(void);
00054 int init(OBJECT *parent);
00055 TIMESTAMP presync(TIMESTAMP t0);
00056 TIMESTAMP postsync(TIMESTAMP t0);
00057 int isa(char *classname);
00058 };
00059
00060 #endif // _REGULATOR_H