Arch: Draw solar diagrams for timezones other than UTC and UTC-3

Use the value of tz parameter to set a timezone instead of -3 constant.

Make updates to TimeZone property trigger redrawing of a solar diagram.
This commit is contained in:
Łukasz Stelmach
2021-06-21 13:33:24 +02:00
parent 08c3a6b3e7
commit 7c26d67ebf

View File

@@ -130,7 +130,7 @@ def makeSolarDiagram(longitude,latitude,scale=1,complete=False,tz=None):
else:
oldversion = True
if tz:
tz = datetime.timezone(datetime.timedelta(hours=-3))
tz = datetime.timezone(datetime.timedelta(hours=tz))
else:
tz = datetime.timezone.utc
else:
@@ -994,7 +994,7 @@ class _ViewProviderSite:
The name of the property that has changed.
"""
if prop in ["Longitude","Latitude"]:
if prop in ["Longitude","Latitude","TimeZone"]:
self.onChanged(obj.ViewObject,"SolarDiagram")
elif prop == "Declination":
self.onChanged(obj.ViewObject,"SolarDiagramPosition")