name.gries.common
Class Astro

java.lang.Object
  extended by name.gries.TC65Terminal
      extended by name.gries.common.Astro

public class Astro
extends TC65Terminal

Astro functionality for daylight control.

Reference: Homepage Volker Quasching

Sunrise and sunset times based on calulations for
location 9°E / 50°N (Germany - near Aschaffenburg)
since internet source does only calculate for none fractual degrees.
Calculated data valid for year 2008.

Ref.: location AF104 - Bad Hersfeld:
9°41?28?E / 50°52?37?N
(9.691384° / 50.876987°)

Since:
2008-08-08
Version:
8.9.10
Author:
Michael Gries
See Also:
AF104

Field Summary
 java.util.Date dWdStart
           
 java.util.Date dWdStop
           
private  boolean lightTime
           
private  boolean nightTime
          Dämmerungschalter.
private  java.lang.String rtcDayLightRiseTime
           
private  java.lang.String rtcDayLightSetTime
           
 java.util.Date rtcStart
           
 java.util.Date rtcStop
           
(package private)  java.util.Hashtable sunRise
          Hashtable of sunrise times for 366 days
(package private)  java.util.Hashtable sunSet
          Hashtable of sunset times for 366 days
private  java.lang.String sWorkdayStartTime
           
private  java.lang.String sWorkdayStopTime
           
 
Fields inherited from class name.gries.TC65Terminal
ata, atLis
 
Constructor Summary
Astro()
          Creates a new instance of Astro.
 
Method Summary
 boolean checkLighttime()
           
 boolean checkNighttime()
           
 boolean checkWeekend()
           
 java.util.Date convertTime(java.lang.String time)
           
static int getRandomOffset()
           
 java.lang.String getSunRise(java.lang.String date)
          gets sunrise time for a given date.
 java.lang.String getSunSet(java.lang.String date)
          gets sunset time for a given date.
 java.lang.String getWorkdayStartTime()
           
 java.lang.String getWorkdayStopTime()
           
 void resetLighttime()
           
 void resetNighttime()
           
 void setLighttime()
           
 void setNighttime()
           
 java.lang.String updateNightTime(java.lang.String day)
           
 
Methods inherited from class name.gries.TC65Terminal
activateATparser, activateGPIO, activatePort10, activatePort5, activatePort7, activatePort8, activatePort9, activateURC, ATCommandOTAP, ATCommandOTAP, ATEvent, checkPort9, checkPrepaid, CONNChanged, DCDChanged, deactivateGPIO, delay, delayTime, deleteMTindex, DSRChanged, getAccount, getADC0, getAT, getATresult, getBattery, getBaudRate, getCaller, getDate, getDay, getDeviceSerial, getFlashPath, getFreeFlashSpace, getGprsConf, getIMEI, getMTsize, getNewSMS, getRingState, getRTC, getSignalQuality, getTc65Status, getTime, gpioTest, handleSmsRTC, init, IsSyncedTime, listFs, pinCode, pollPort9, readProp, resetAussenLicht, resetFlurLicht, resetKlingel, resetPort10, resetPort5, resetPort7, resetPort8, resetSyncedTime, RINGChanged, sendAT, sendSms, setAussenLicht, setDate, setDate, setFlurLicht, setKlingel, setPort10, setPort5, setPort7, setPort8, setProp, setQoSforGRPS, setSyncedTime, shutdownTC65T, testCall, testGPIO, testSMS, toggleKlingel, updateAbwesenheit, uploadFtp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sunRise

java.util.Hashtable sunRise
Hashtable of sunrise times for 366 days


sunSet

java.util.Hashtable sunSet
Hashtable of sunset times for 366 days


nightTime

private boolean nightTime
Dämmerungschalter. Aktiv (True) wenn Dämmerung erreicht ist. Automat Theben xxxx


lightTime

private boolean lightTime

sWorkdayStartTime

private java.lang.String sWorkdayStartTime

sWorkdayStopTime

private java.lang.String sWorkdayStopTime

rtcDayLightRiseTime

private java.lang.String rtcDayLightRiseTime

rtcDayLightSetTime

private java.lang.String rtcDayLightSetTime

rtcStart

public java.util.Date rtcStart

rtcStop

public java.util.Date rtcStop

dWdStart

public java.util.Date dWdStart

dWdStop

public java.util.Date dWdStop
Constructor Detail

Astro

public Astro()
Creates a new instance of Astro.

Initializes both sunrise and sunset times for a complete year (366 day - incl. February, 29th)

Method Detail

setNighttime

public void setNighttime()

resetNighttime

public void resetNighttime()

checkNighttime

public boolean checkNighttime()

setLighttime

public void setLighttime()

resetLighttime

public void resetLighttime()

checkLighttime

public boolean checkLighttime()

updateNightTime

public java.lang.String updateNightTime(java.lang.String day)

getWorkdayStartTime

public java.lang.String getWorkdayStartTime()

getWorkdayStopTime

public java.lang.String getWorkdayStopTime()

checkWeekend

public boolean checkWeekend()

getRandomOffset

public static int getRandomOffset()

convertTime

public java.util.Date convertTime(java.lang.String time)

getSunRise

public java.lang.String getSunRise(java.lang.String date)
gets sunrise time for a given date.

Parameters:
date - in format 'MM/DD'
Returns:
Sunrise time in format 'hh:mm:ss'

getSunSet

public java.lang.String getSunSet(java.lang.String date)
gets sunset time for a given date.

Parameters:
date - in format 'MM/DD'
Returns:
Sunrise time in format 'hh:mm:ss'