00001
00011 #ifndef SWITCH_OBJECT_H
00012 #define SWITCH_OBJECT_H
00013
00014 #include "powerflow.h"
00015 #include "link.h"
00016
00017 class switch_object : public link
00018 {
00019 public:
00020 static CLASS *oclass;
00021 static CLASS *pclass;
00022
00023 public:
00024 typedef enum {OPEN=0, CLOSED=1} SWITCHSTATE;
00025 typedef enum {INDIVIDUAL_SW=0, BANKED_SW=1} SWITCHBANK;
00026 unsigned char prev_full_status;
00027
00028 int create(void);
00029 int init(OBJECT *parent);
00030 TIMESTAMP sync(TIMESTAMP t0);
00031 switch_object(MODULE *mod);
00032 inline switch_object(CLASS *cl=oclass):link(cl){};
00033 int isa(char *classname);
00034
00035 void set_switch(bool desired_status);
00036 void set_switch_full(char desired_status_A, char desired_status_B, char desired_status_C);
00037
00038 TIMESTAMP prev_SW_time;
00039
00040 SWITCHBANK switch_banked_mode;
00041
00042 unsigned char phased_switch_status;
00043 SWITCHSTATE phase_A_state;
00044 SWITCHSTATE phase_B_state;
00045 SWITCHSTATE phase_C_state;
00046 };
00047
00048 #endif // SWITCH_OBJECT_H
00049