My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 01, 2009 by chrisys
Labels: Featured
Functions  
Functions included within the ThermdStats class.

Many of these functions depend on the variables in the configuration being assigned and correct.

  • ts_getBeaufort(speed) return the beaufort scale number and description for a given wind speed.
  • ts_windDirection(degrees) return the 16 point compass point given the vane rotation.
  • ts_dryDays() return the number of days since last rainfall.
  • ts_wetDays() return the number of days since last dry day.
  • ts_sinceWetDry() return a string quoting the number of days since last wet or dry day.
  • ts_rainRate() return the current rain rate in units/hr.
  • ts_totalRainfallPeriod(period, offset) return the amount of rain fallen between time-offest and time-offset-period.
  • ts_returnSunrise() return the sunrise time.
  • ts_returnSunset() return the sunset time.
  • ts_cloudCoverIsDark() returns TRUE or FALSE, telling if it is dark. This is based on the sunrise/sunset times and the cloud sensor offset specified in the configuration.
  • ts_cloudCoverCheck() returns the level of cloudiness, based on the defined sensor ID and levels defined in the configuration file.
  • ts_readAllTimeMax(logid) read the all time maximum value of the given log ID.
  • ts_readAllTimeMin(logid) read the all time minimum value of the given log ID.
  • ts_currentTrend(logid,period=3600) return the current trend (U/D/S), of the specified log ID in the given period.
  • ts_getAverage(logid,period=86400,offset=0) return the average value of the specified log ID in the given period.
  • ts_getMaxMin(logid,period=86400,offset=0) return the maximum and minimum values of the specified log ID in the given period.
  • ts_readCurrent(logid,dp=NULL) return the current value of the specified log ID, rounded to the optional number of decimal places.
  • ts_startImage(x,y) start an image ready to add widgets, of the specified x and y dimensions.
  • ts_completeImage() complete the started image - this means sending image headers and the data, before exiting the script.

A couple of other functions are included that are not part of the class, but may be useful.

  • imagestringcentered(img,font,cy,text,color) a wrapper for imagestring, that will centre the text on the page at the given y coordinate.
  • secondsSinceMidnight() return the number of seconds passed since midnight last night.

Sign in to add a comment
Hosted by Google Code