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 (gl_publish_variable(oclass,
00022 PT_double,"temperature[degF]",PADDR(temperature),
00023 PT_double,"humidity[%]",PADDR(humidity),
00024 PT_double,"solar_dir[W/sf]",PADDR(solar_dir),
00025 PT_double,"solar_diff[W/sf]",PADDR(solar_diff),
00026 PT_double,"solar_global[W/sf]",PADDR(solar_global),
00027 PT_double,"wind_speed[mph]", PADDR(wind_speed),
00028 PT_double,"rainfall[in/h]",PADDR(rainfall),
00029 PT_double,"snowdepth[in]",PADDR(snowdepth),
00030 PT_int16,"month",PADDR(month),
00031 PT_int16,"day",PADDR(day),
00032 PT_int16,"hour",PADDR(hour),
00033 PT_int16,"minute",PADDR(minute),
00034 PT_int16,"second",PADDR(second),
00035 NULL)<1) GL_THROW("unable to publish properties in %s",__FILE__);
00036 memset(this,0,sizeof(weather));
00037 }
00038 }
00039
00040 EXPORT int create_weather(OBJECT **obj, OBJECT *parent){
00041 return 1;
00042 }
00043
00045 EXPORT TIMESTAMP sync_weather(OBJECT *obj, TIMESTAMP t0){
00046 return TS_NEVER;
00047 }
00048
00049