00001
00007 #include "weather.h"
00008
00009 CLASS *weather::oclass = 0;
00010
00011
00012 weather::weather(){
00013 memset(this, 0, sizeof(weather));
00014 }
00015
00016 weather::weather(MODULE *module){
00017 memset(this, 0, sizeof(weather));
00018 if (oclass==NULL)
00019 {
00020 oclass = gl_register_class(module,"weather",sizeof(weather),NULL);
00021 if (oclass==NULL)
00022 throw "unable to register class weather";
00023 else
00024 oclass->trl = TRL_CONCEPT;
00025
00026 if (gl_publish_variable(oclass,
00027 PT_double,"temperature[degF]",PADDR(temperature),
00028 PT_double,"humidity[%]",PADDR(humidity),
00029 PT_double,"solar_dir[W/sf]",PADDR(solar_dir),
00030 PT_double,"solar_direct[W/sf]",PADDR(solar_dir),
00031 PT_double,"solar_diff[W/sf]",PADDR(solar_diff),
00032 PT_double,"solar_diffuse[W/sf]",PADDR(solar_diff),
00033 PT_double,"solar_global[W/sf]",PADDR(solar_global),
00034 PT_double,"global_horizontal_extra[W/sf]",PADDR(global_horizontal_extra),
00035 PT_double,"wind_speed[mph]", PADDR(wind_speed),
00036 PT_double,"wind_dir[deg]", PADDR(wind_dir),
00037 PT_double,"opq_sky_cov[pu]",PADDR(opq_sky_cov),
00038 PT_double,"tot_sky_cov[pu]",PADDR(tot_sky_cov),
00039 PT_double,"rainfall[in/h]",PADDR(rainfall),
00040 PT_double,"snowdepth[in]",PADDR(snowdepth),
00041 PT_double,"pressure[mbar]",PADDR(pressure),
00042 PT_int16,"month",PADDR(month),
00043 PT_int16,"day",PADDR(day),
00044 PT_int16,"hour",PADDR(hour),
00045 PT_int16,"minute",PADDR(minute),
00046 PT_int16,"second",PADDR(second),
00047 NULL)<1) GL_THROW("unable to publish properties in %s",__FILE__);
00048 memset(this,0,sizeof(weather));
00049 }
00050 }
00051
00052 EXPORT int create_weather(OBJECT **obj, OBJECT *parent){
00053 return 1;
00054 }
00055
00057 EXPORT TIMESTAMP sync_weather(OBJECT *obj, TIMESTAMP t0){
00058 return TS_NEVER;
00059 }
00060
00061