Exemplo n.º 1
0
from GoogleMercatorProjection import LatLng
from PyQt4.QtGui import QColor


# LOCATION(S)
# Further radar configuration (zoom, marker location) can be
# completed under the RADAR section
# primary_coordinates = -27.646381, 152.886692  # Home
primary_coordinates = -27.395281, 153.119996  # Brisbane Airport

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(primary_coordinates[0], primary_coordinates[1])
primary_location = LatLng(primary_coordinates[0], primary_coordinates[1])
noaastream = 'http://audioplayer.wunderground.com:80/tim273/edina'
background = 'images/grey.jpg'
squares1 = ''
squares2 = ''
icons = 'icons-lightblue'
textcolor = '#bef'
clockface = 'images/clockface3.png'
hourhand = 'images/hourhand.png'
minhand = 'images/minhand.png'
sechand = 'images/sechand.png'


digital = 1             # 1 = Digtal Clock, 0 = Analog Clock

# Goes with light blue config (like the default one)
digitalcolor = "#50CBEB"
digitalformat = "{0:%H:%M.%S}"  # The format of the time
digitalsize = 120
Exemplo n.º 2
0
from GoogleMercatorProjection import LatLng
from PyQt4.QtGui import QColor

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(44.9764016,-93.2486732)
noaastream = 'http://audioplayer.wunderground.com:80/tim273/edina'
background = 'images/bb.jpg'
squares1 = 'images/squares1-green.png'
squares2 = 'images/squares2-green.png'
icons = 'icons-darkgreen'
textcolor = '#206225'
clockface = 'images/clockface3-darkgreen.png'
hourhand = 'images/hourhand-darkgreen.png'
minhand = 'images/minhand-darkgreen.png'
sechand = 'images/sechand-darkgreen.png'

metric = 0
radar_refresh = 10
weather_refresh = 30

fontattr = 'font-weight: bold; '
dimcolor = QColor('#103125')
dimcolor.setAlpha(192)

radar1 = {
    'center' : LatLng(44.9764016,-93.2486732),
    'zoom' : 7,
    'markers' : (
        {
        'location' : LatLng(44.9764016,-93.2486732),
        'color' : 'red',
Exemplo n.º 3
0
    def __init__(self, parent, radar, rect, myname):
        global xscale, yscale
        self.myname = myname
        self.rect = rect
        self.anim = 5
        self.zoom = radar["zoom"]
        self.point = radar["center"]
        self.radar = radar
        self.baseurl = self.mapurl(radar, rect)
        print "map base url: " + self.baseurl
        QtGui.QLabel.__init__(self, parent)
        self.interval = Config.radar_refresh * 60
        self.lastwx = 0
        self.retries = 0
        self.corners = getCorners(self.point, self.zoom, rect.width(),
                                  rect.height())
        self.baseTime = 0
        self.cornerTiles = {
            "NW":
            getTileXY(LatLng(self.corners["N"], self.corners["W"]), self.zoom),
            "NE":
            getTileXY(LatLng(self.corners["N"], self.corners["E"]), self.zoom),
            "SE":
            getTileXY(LatLng(self.corners["S"], self.corners["E"]), self.zoom),
            "SW":
            getTileXY(LatLng(self.corners["S"], self.corners["W"]), self.zoom)
        }
        self.tiles = []
        self.tiletails = []
        self.totalWidth = 0
        self.totalHeight = 0
        self.tilesWidth = 0
        self.tilesHeight = 0

        self.setObjectName("radar")
        self.setGeometry(rect)
        self.setStyleSheet("#radar { background-color: grey; }")
        self.setAlignment(Qt.AlignCenter)

        self.wwx = QtGui.QLabel(self)
        self.wwx.setObjectName("wx")
        self.wwx.setStyleSheet("#wx { background-color: transparent; }")
        self.wwx.setGeometry(0, 0, rect.width(), rect.height())

        self.wmk = QtGui.QLabel(self)
        self.wmk.setObjectName("mk")
        self.wmk.setStyleSheet("#mk { background-color: transparent; }")
        self.wmk.setGeometry(0, 0, rect.width(), rect.height())

        for y in range(int(self.cornerTiles["NW"]["Y"]),
                       int(self.cornerTiles["SW"]["Y"]) + 1):
            self.totalHeight += 256
            self.tilesHeight += 1
            for x in range(int(self.cornerTiles["NW"]["X"]),
                           int(self.cornerTiles["NE"]["X"]) + 1):
                tile = {"X": x, "Y": y}
                self.tiles.append(tile)
                tail = "/256/%d/%d/%d.png?color=3" % (self.zoom, x, y)
                self.tiletails.append(tail)
        for x in range(int(self.cornerTiles["NW"]["X"]),
                       int(self.cornerTiles["NE"]["X"]) + 1):
            self.totalWidth += 256
            self.tilesWidth += 1
        self.frameImages = []
        self.frameIndex = 0
        self.displayedFrame = 0
        self.ticker = 0
        self.lastget = 0
Exemplo n.º 4
0
# -*- coding: utf-8 -*-
from GoogleMercatorProjection import LatLng
from PyQt4.QtGui import QColor

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(52.5074559, 13.144557)
noaastream = ''
background = 'images/berlin-at-night-mrwallpaper.jpg'
squares1 = 'images/squares1-kevin.png'
squares2 = 'images/squares2-kevin.png'
icons = 'icons-lightblue'
textcolor = '#bef'
clockface = 'images/clockface3.png'
hourhand = 'images/hourhand.png'
minhand = 'images/minhand.png'
sechand = 'images/sechand.png'

metric = 1  #0 = English, 1 = Metric
radar_refresh = 10  # minutes
weather_refresh = 30  # minutes
wind_degrees = 1  # Wind in degrees instead of cardinal
satellite = 0  # show satellite image (clouds) instead of radar 0 = radar, 1 = satellite

fontattr = ''  # gives all text additional attributes using QT style notation
# example: fontattr = 'font-weight: bold; '

dimcolor = QColor('#000000')  # These are to dim the radar images, if needed.
dimcolor.setAlpha(0)  # see and try Config-Example-Bedside.py

# Language Specific wording
wuLanguage = "DL"  # Weather Undeground Language code (https://www.wunderground.com/weather/api/d/docs?d=language-support&MR=1)
Exemplo n.º 5
0
from GoogleMercatorProjection import LatLng
from PyQt4.QtGui import QColor


# LOCATION(S) 
# Further radar configuration (zoom, marker location) can be completed under the RADAR section
primary_coordinates = 44.9764016,-93.2486732 # Change to your Lat/Lon

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(primary_coordinates[0],primary_coordinates[1]) # Location for weather report
primary_location = LatLng(primary_coordinates[0],primary_coordinates[1]) # Default radar location
noaastream = 'http://audioplayer.wunderground.com:80/tim273/edina'
background = 'images/clockbackground-kevin.png'
squares1 = 'images/squares1-kevin.png'
squares2 = 'images/squares2-kevin.png'
icons = 'icons-lightblue'
textcolor = '#bef'
clockface = 'images/clockface3.png'
hourhand = 'images/hourhand.png'
minhand = 'images/minhand.png'
sechand = 'images/sechand.png'


digital = 0             # 1 = Digtal Clock, 0 = Analog Clock
 
digitalcolor = "#50CBEB"            # Goes with light blue config (like the default one)
digitalformat = "{0:%I:%M\n%S %p}"  # The format of the time
digitalsize = 200
# The above example shows in this way: https://github.com/n0bel/PiClock/blob/master/Documentation/Digital%20Clock%20v1.jpg
# ( specifications of the time string are documented here: https://docs.python.org/2/library/time.html#time.strftime )
Exemplo n.º 6
0
ynab_refresh = 15  # minutes

#Drive Time Settings

origin = "555 Main St., Someplace, CA 55555"  # Address of the starting point for drive time calculation
dest = {}
dest[
    "My Work"] = "555 Main St., Someplace, CA 55555"  # Name and address of destination point. Can add multiple destinations to the dest dictionary
dest["Another Work"] = "555 Main St., Someplace, CA 55555"

traffic_refresh = 5  # minutes

#Weather Settings

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(32.58240, 83.238592)  #Example: LatLng(32.58240,83.238592)
textcolor = '#bef'

metric = 0  #0 = English, 1 = Metric
radar_refresh = 10  # minutes
weather_refresh = 30  # minutes
wind_degrees = 0  # Wind in degrees instead of cardinal 0 = cardinal, 1 = degrees
satellite = 0  # Depreciated: use 'satellite' key in radar section, on a per radar basis
# if this is used, all radar blocks will get satellite images

fontattr = ''  # gives all text additional attributes using QT style notation
# example: fontattr = 'font-weight: bold; '

dimcolor = QColor('#000000')  # These are to dim the radar images, if needed.
dimcolor.setAlpha(0)  # see and try Config-Example-Bedside.py
Exemplo n.º 7
0
from GoogleMercatorProjection import LatLng
from PyQt4.QtGui import QColor

wuprefix = 'http://api.wunderground.com/api/'
wulocation = LatLng(44.9764016, -93.2486732)
noaastream = 'http://audioplayer.wunderground.com:80/tim273/edina'
background = 'images/clockbackground-kevin.png'
squares1 = 'images/squares1-kevin.png'
squares2 = 'images/squares2-kevin.png'
icons = 'icons-lightblue'
textcolor = '#bef'
clockface = 'images/clockface3.png'
hourhand = 'images/hourhand.png'
minhand = 'images/minhand.png'
sechand = 'images/sechand.png'

metric = 0  #0 = English, 1 = Metric
radar_refresh = 10  # minutes
weather_refresh = 30  # minutes
wind_degrees = 0  # Wind in degrees instead of cardinal 0 = cardinal, 1 = degrees
satellite = 0  # Depreciated: use 'satellite' key in radar section, on a per radar basis
# if this is used, all radar blocks will get satellite images

fontattr = ''  # gives all text additional attributes using QT style notation
# example: fontattr = 'font-weight: bold; '

dimcolor = QColor('#000000')  # These are to dim the radar images, if needed.
dimcolor.setAlpha(0)  # see and try Config-Example-Bedside.py

# Language Specific wording
wuLanguage = "EN"  # Weather Undeground Language code (https://www.wunderground.com/weather/api/d/docs?d=language-support&MR=1)
Exemplo n.º 8
0
def tick():
    global hourpixmap, minpixmap, secpixmap
    global hourpixmap2, minpixmap2, secpixmap2
    global lastmin, lastday, lasttimestr
    global clockrect
    global datex, datex2, datey2, pdy, callsign, latlon, gridsquare
    global gpsd
    #global Config
    global mapsloaded
    global radar1rect

    if Config.DateLocale != "":
        try:
            locale.setlocale(locale.LC_TIME, Config.DateLocale)
        except:
            pass

    if Config.usegps == 1:
        Config.cur_lat = gpsd.fix.latitude
        Config.cur_lon = gpsd.fix.longitude
        Config.primary_coordinates = gpsd.fix.latitude, gpsd.fix.longitude
        Config.wulocation = LatLng(Config.primary_coordinates[0],
                                   Config.primary_coordinates[1])
        Config.primary_location = LatLng(Config.primary_coordinates[0],
                                         Config.primary_coordinates[1])
        Config.radar1['center'] = Config.primary_location


#        Config.wulocation = LatLng(gpsd.fix.latitude, gpsd.fix.longitude)

    now = datetime.datetime.now()
    timestr = Config.digitalformat.format(now)
    if Config.digitalformat.find("%I") > -1:
        if timestr[0] == '0':
            timestr = timestr[1:99]
    if lasttimestr != timestr:
        clockface.setText(timestr.lower())
        callsign.setText(Config.callsign.upper())
        latlon.setText(str(Config.cur_lat) + ' /\n' + str(Config.cur_lon))
        gridsquare.setText(to_grid(Config.cur_lat, Config.cur_lon))
        utmloc = utm.from_latlon(Config.cur_lat, Config.cur_lon)
        utmsquare.setText(
            str(utmloc[2]) + utmloc[3] + " " + str(format(utmloc[0], '.2f')) +
            "\n" + str(format(utmloc[1], '.2f')))

    lasttimestr = timestr

    dy = "{0:%I}".format(now)
    if dy != pdy:
        pdy = dy
        datey2.setText(dy)

    if now.day != lastday:
        lastday = now.day
        # date
        sup = 'th'
        if (now.day == 1 or now.day == 21 or now.day == 31):
            sup = 'st'
        if (now.day == 2 or now.day == 22):
            sup = 'nd'
        if (now.day == 3 or now.day == 23):
            sup = 'rd'
        if Config.DateLocale != "":
            sup = ""
        ds = "{0:%A %B} {0.day}<sup>{1}</sup> {0.year}".format(now, sup)
        datex.setText(ds)
        datex2.setText(ds)

    if Config.cur_lat != 0 and mapsloaded == False:
        objradar1.reseturls(Config.radar1, radar1rect)
        objradar1.start(Config.radar_refresh * 60)
        objradar1.wxstart()
        objradar2.reseturls(Config.radar2, radar2rect)
        objradar2.start(Config.radar_refresh * 60)
        objradar2.wxstart()
        getwx()
        mapsloaded = True