00001
00002 #ifndef _ENDUSE_H
00003 #define _ENDUSE_H
00004
00005 #include "class.h"
00006 #include "object.h"
00007 #include "timestamp.h"
00008 #include "loadshape.h"
00009
00010 #define EUC_IS220 0x0001
00011 #define EUC_HEATLOAD 0x0002
00012
00013 typedef struct s_enduse {
00014
00015
00016 complex total;
00017 complex energy;
00018 complex demand;
00019
00020
00021 set config;
00022 double breaker_amps;
00023
00024
00025 complex admittance;
00026 complex current;
00027 complex power;
00028
00029
00030 double impedance_fraction;
00031 double current_fraction;
00032 double power_fraction;
00033 double power_factor;
00034 double voltage_factor;
00035
00036
00037 double heatgain;
00038 double heatgain_fraction;
00039
00040
00041 char *name;
00042 loadshape *shape;
00043 TIMESTAMP t_last;
00044
00045
00046
00047 struct s_object_list *end_obj;
00048
00049 struct s_enduse *next;
00050 #ifdef _DEBUG
00051 unsigned int magic;
00052 #endif
00053 } enduse;
00054
00055 int enduse_create(enduse *addr);
00056 int enduse_init(enduse *e);
00057 int enduse_initall(void);
00058 TIMESTAMP enduse_sync(enduse *e, PASSCONFIG pass, TIMESTAMP t1);
00059 TIMESTAMP enduse_syncall(TIMESTAMP t1);
00060 int convert_to_enduse(char *string, void *data, PROPERTY *prop);
00061 int convert_from_enduse(char *string,int size,void *data, PROPERTY *prop);
00062 int enduse_publish(CLASS *oclass, PROPERTYADDR struct_address, char *prefix);
00063 int enduse_test(void);
00064
00065 #endif