Skip to content

Commit

Permalink
Use true course along with updated pyavtools that renders runways wih…
Browse files Browse the repository at this point in the history
… true bearing so virtual VFR renders closer to reality
  • Loading branch information
e100 committed Jul 17, 2024
1 parent d828a01 commit 50e766a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
"geomag==0.9.2015",
"geopy==2.4.1",
# Until this revision is published to PyPy get it from git:
"pyavtools @ git+https://github.com/makerplane/pyAvTools/@b00273a9016e9a4b975f8efe51d63405103d58fb",
"pyavtools @ git+https://github.com/makerplane/pyAvTools/@51c381b26ab47c9a975be8db4261a5483a73bf77",
"pycond==20230212",
"PyQt5==5.15.10",
"PyYAML==6.0.1",
Expand All @@ -62,8 +61,8 @@ Source = "https://github.com/makerplane/pyEfis"
[tool.pytest.ini_options]
qt_api="pyqt5"
env = [
"QT_QPA_PLATFORM = offscreen:size=1000x1000"
# "QT_QPA_PLATFORM = xcb:size=1000,1000"
# "QT_QPA_PLATFORM = offscreen:size=1000x1000"
"QT_QPA_PLATFORM = xcb:size=1000,1000"
]
filterwarnings = [
# I belive this is warning that pyqt needs updated if you update to python 3.12
Expand Down
2 changes: 1 addition & 1 deletion src/pyefis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2.0.25"
__version__ = "2.0.26"

21 changes: 2 additions & 19 deletions src/pyefis/instruments/ai/VirtualVfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import yaml
import datetime

from geomag import declination

from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
Expand Down Expand Up @@ -71,7 +69,7 @@ def __init__(self, parent=None, font_percent=None, font_family="DejaVu Sans Cond

self.lng_item = fix.db.get_item("LONG")
self.lat_item = fix.db.get_item("LAT")
self.head_item = fix.db.get_item("HEAD")
self.head_item = fix.db.get_item("COURSE")
self.alt_item = fix.db.get_item("ALT")
self.gsi_item = fix.db.get_item("GSI")
self._VFROld['LONG'] = self.lng_item.old
Expand Down Expand Up @@ -107,8 +105,6 @@ def __init__(self, parent=None, font_percent=None, font_family="DejaVu Sans Cond
self._VFRFail['ALT'] = self.alt_item.fail
self.altitude = self.alt_item.value

self.last_mag_update = 0
self.magnetic_declination = None
self.missing_lat = self.lat == 0.0
self.missing_lng = self.lng == 0.0

Expand Down Expand Up @@ -562,20 +558,7 @@ def setAltitude(self, alt):
self.pov.render(self)
self.update()
def setHeading(self, heading):
curtime = time.time()
#log.debug(f"setHeading( {heading} ): curtime:{curtime} self.last_mag_update:{self.last_mag_update} self.magnetic_declination:{self.magnetic_declination}")
if curtime - self.last_mag_update > 60 or self.magnetic_declination is None:
# update every minute at the most
#log.debug(f"self.missing_lat:{self.missing_lat} self.missing_lng:{self.missing_lng}")
if not (self.missing_lat or self.missing_lng):
#log.debug("Updated declination")
self.last_mag_update = curtime
self.magnetic_declination = declination (self.lat, self.lng, self.altitude)
md = self.magnetic_declination
if md is None:
md = 0
#log.debug(f"heading:{heading} md:{md}")
self.pov.update_heading (heading + md)
self.pov.update_heading (heading)
if not self.rendering_prohibited():
#log.debug("Rendering")
self.pov.render(self)
Expand Down

0 comments on commit 50e766a

Please sign in to comment.