mirror of
https://github.com/liberatedsystems/Sideband_CE.git
synced 2024-09-03 04:13:27 +02:00
Fixed typos
This commit is contained in:
parent
f8a97e5b36
commit
7a4a5a3938
@ -3938,7 +3938,7 @@ class SidebandApp(MDApp):
|
|||||||
if hasattr(self, "map") and self.map:
|
if hasattr(self, "map") and self.map:
|
||||||
mz = 16
|
mz = 16
|
||||||
lat = location["latitude"]
|
lat = location["latitude"]
|
||||||
lon = location["longtitude"]
|
lon = location["longitude"]
|
||||||
if mz > self.map.map_source.max_zoom: mz = self.map.map_source.max_zoom
|
if mz > self.map.map_source.max_zoom: mz = self.map.map_source.max_zoom
|
||||||
if mz < self.map.map_source.min_zoom: mz = self.map.map_source.min_zoom
|
if mz < self.map.map_source.min_zoom: mz = self.map.map_source.min_zoom
|
||||||
self.map.zoom = mz
|
self.map.zoom = mz
|
||||||
@ -4033,7 +4033,7 @@ class SidebandApp(MDApp):
|
|||||||
l = telemetry["location"]
|
l = telemetry["location"]
|
||||||
a_icon = appearance[0]
|
a_icon = appearance[0]
|
||||||
a_fg = appearance[1]; a_bg = appearance[2]
|
a_fg = appearance[1]; a_bg = appearance[2]
|
||||||
marker = CustomMapMarker(lat=l["latitude"], lon=l["longtitude"], icon_bg=a_bg)
|
marker = CustomMapMarker(lat=l["latitude"], lon=l["longitude"], icon_bg=a_bg)
|
||||||
marker.app = self
|
marker.app = self
|
||||||
marker.source_dest = source
|
marker.source_dest = source
|
||||||
marker.location_time = l["last_update"]
|
marker.location_time = l["last_update"]
|
||||||
@ -4094,7 +4094,7 @@ class SidebandApp(MDApp):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if own_telemetry != None and "location" in own_telemetry and own_telemetry["location"] != None and own_telemetry["location"]["latitude"] != None and own_telemetry["location"]["longtitude"] != None:
|
if own_telemetry != None and "location" in own_telemetry and own_telemetry["location"] != None and own_telemetry["location"]["latitude"] != None and own_telemetry["location"]["longitude"] != None:
|
||||||
retain_own = True
|
retain_own = True
|
||||||
|
|
||||||
if not own_address in self.map_markers:
|
if not own_address in self.map_markers:
|
||||||
@ -4110,7 +4110,7 @@ class SidebandApp(MDApp):
|
|||||||
if o["last_update"] > marker.location_time or (hasattr(self, "own_appearance_changed") and self.own_appearance_changed):
|
if o["last_update"] > marker.location_time or (hasattr(self, "own_appearance_changed") and self.own_appearance_changed):
|
||||||
marker.location_time = o["last_update"]
|
marker.location_time = o["last_update"]
|
||||||
marker.lat = o["latitude"]
|
marker.lat = o["latitude"]
|
||||||
marker.lon = o["longtitude"]
|
marker.lon = o["longitude"]
|
||||||
marker.icon.icon = own_appearance[0]
|
marker.icon.icon = own_appearance[0]
|
||||||
marker.icon.icon_color = own_appearance[1]
|
marker.icon.icon_color = own_appearance[1]
|
||||||
marker.icon.md_bg_color = own_appearance[2]
|
marker.icon.md_bg_color = own_appearance[2]
|
||||||
@ -4158,7 +4158,7 @@ class SidebandApp(MDApp):
|
|||||||
t = Telemeter.from_packed(telemetry_data)
|
t = Telemeter.from_packed(telemetry_data)
|
||||||
if t != None:
|
if t != None:
|
||||||
telemetry = t.read_all()
|
telemetry = t.read_all()
|
||||||
if "location" in telemetry and telemetry["location"] != None and telemetry["location"]["latitude"] != None and telemetry["location"]["longtitude"] != None:
|
if "location" in telemetry and telemetry["location"] != None and telemetry["location"]["latitude"] != None and telemetry["location"]["longitude"] != None:
|
||||||
latest_viewable = telemetry
|
latest_viewable = telemetry
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -4174,7 +4174,7 @@ class SidebandApp(MDApp):
|
|||||||
marker = self.map_markers[telemetry_source]
|
marker = self.map_markers[telemetry_source]
|
||||||
marker.location_time = latest_viewable["time"]["utc"]
|
marker.location_time = latest_viewable["time"]["utc"]
|
||||||
marker.lat = l["latitude"]
|
marker.lat = l["latitude"]
|
||||||
marker.lon = l["longtitude"]
|
marker.lon = l["longitude"]
|
||||||
appearance = self.sideband.peer_appearance(telemetry_source)
|
appearance = self.sideband.peer_appearance(telemetry_source)
|
||||||
marker.icon.icon = appearance[0]
|
marker.icon.icon = appearance[0]
|
||||||
marker.icon.icon_color = appearance[1]
|
marker.icon.icon_color = appearance[1]
|
||||||
|
@ -1105,8 +1105,8 @@ class SidebandCore():
|
|||||||
lt = self.latest_telemetry
|
lt = self.latest_telemetry
|
||||||
if "location" in lt and lt["location"] != None:
|
if "location" in lt and lt["location"] != None:
|
||||||
l = lt["location"]
|
l = lt["location"]
|
||||||
if "latitude" in l and "longtitude" in l:
|
if "latitude" in l and "longitude" in l:
|
||||||
if l["latitude"] != None and l["longtitude"] != None:
|
if l["latitude"] != None and l["longitude"] != None:
|
||||||
return l
|
return l
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -1120,8 +1120,8 @@ class SidebandCore():
|
|||||||
t = Telemeter.from_packed(pt[1]).read_all()
|
t = Telemeter.from_packed(pt[1]).read_all()
|
||||||
if "location" in t and t["location"] != None:
|
if "location" in t and t["location"] != None:
|
||||||
l = t["location"]
|
l = t["location"]
|
||||||
if "latitude" in l and "longtitude" in l:
|
if "latitude" in l and "longitude" in l:
|
||||||
if l["latitude"] != None and l["longtitude"] != None:
|
if l["latitude"] != None and l["longitude"] != None:
|
||||||
return l
|
return l
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -1636,12 +1636,12 @@ class SidebandCore():
|
|||||||
remote_telemeter.sensors["received"].via = source_dest
|
remote_telemeter.sensors["received"].via = source_dest
|
||||||
|
|
||||||
rl = remote_telemeter.read("location")
|
rl = remote_telemeter.read("location")
|
||||||
if rl and "latitude" in rl and "longtitude" in rl and "altitude" in rl:
|
if rl and "latitude" in rl and "longitude" in rl and "altitude" in rl:
|
||||||
if self.latest_telemetry != None and "location" in self.latest_telemetry:
|
if self.latest_telemetry != None and "location" in self.latest_telemetry:
|
||||||
ol = self.latest_telemetry["location"]
|
ol = self.latest_telemetry["location"]
|
||||||
if "latitude" in ol and "longtitude" in ol and "altitude" in ol:
|
if "latitude" in ol and "longitude" in ol and "altitude" in ol:
|
||||||
olat = ol["latitude"]; olon = ol["longtitude"]; oalt = ol["altitude"]
|
olat = ol["latitude"]; olon = ol["longitude"]; oalt = ol["altitude"]
|
||||||
rlat = rl["latitude"]; rlon = rl["longtitude"]; ralt = rl["altitude"]
|
rlat = rl["latitude"]; rlon = rl["longitude"]; ralt = rl["altitude"]
|
||||||
if olat != None and olon != None and oalt != None:
|
if olat != None and olon != None and oalt != None:
|
||||||
if rlat != None and rlon != None and ralt != None:
|
if rlat != None and rlon != None and ralt != None:
|
||||||
remote_telemeter.sensors["received"].set_distance(
|
remote_telemeter.sensors["received"].set_distance(
|
||||||
@ -2319,7 +2319,7 @@ class SidebandCore():
|
|||||||
if self.config["telemetry_s_fixed_location"]:
|
if self.config["telemetry_s_fixed_location"]:
|
||||||
self.telemeter.synthesize("location")
|
self.telemeter.synthesize("location")
|
||||||
self.telemeter.sensors["location"].latitude = self.config["telemetry_s_fixed_latlon"][0]
|
self.telemeter.sensors["location"].latitude = self.config["telemetry_s_fixed_latlon"][0]
|
||||||
self.telemeter.sensors["location"].longtitude = self.config["telemetry_s_fixed_latlon"][1]
|
self.telemeter.sensors["location"].longitude = self.config["telemetry_s_fixed_latlon"][1]
|
||||||
self.telemeter.sensors["location"].altitude = self.config["telemetry_s_fixed_altitude"]
|
self.telemeter.sensors["location"].altitude = self.config["telemetry_s_fixed_altitude"]
|
||||||
self.telemeter.sensors["location"].stale_time = 30
|
self.telemeter.sensors["location"].stale_time = 30
|
||||||
|
|
||||||
|
@ -39,13 +39,13 @@ def ellipsoid_radius_at(latitude):
|
|||||||
)
|
)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def euclidian_point(latitude, longtitude, altitude=0, ellipsoid=True):
|
def euclidian_point(latitude, longitude, altitude=0, ellipsoid=True):
|
||||||
# Convert latitude and longtitude to radians
|
# Convert latitude and longitude to radians
|
||||||
# and get ellipsoid or sphere radius
|
# and get ellipsoid or sphere radius
|
||||||
lat = radians(latitude); lon = radians(longtitude)
|
lat = radians(latitude); lon = radians(longitude)
|
||||||
r = ellipsoid_radius_at(latitude) if ellipsoid else mean_earth_radius
|
r = ellipsoid_radius_at(latitude) if ellipsoid else mean_earth_radius
|
||||||
|
|
||||||
# Calculate euclidian coordinates from longtitude
|
# Calculate euclidian coordinates from longitude
|
||||||
# and geocentric latitude.
|
# and geocentric latitude.
|
||||||
gclat = radians(geocentric_latitude(latitude)) if ellipsoid else lat
|
gclat = radians(geocentric_latitude(latitude)) if ellipsoid else lat
|
||||||
x = cos(lon)*cos(gclat)*r
|
x = cos(lon)*cos(gclat)*r
|
||||||
|
@ -589,7 +589,7 @@ class Location(Sensor):
|
|||||||
self._accuracy_target = Location.ACCURACY_TARGET
|
self._accuracy_target = Location.ACCURACY_TARGET
|
||||||
|
|
||||||
self.latitude = None
|
self.latitude = None
|
||||||
self.longtitude = None
|
self.longitude = None
|
||||||
self.altitude = None
|
self.altitude = None
|
||||||
self.speed = None
|
self.speed = None
|
||||||
self.bearing = None
|
self.bearing = None
|
||||||
@ -632,7 +632,7 @@ class Location(Sensor):
|
|||||||
self.gps.stop()
|
self.gps.stop()
|
||||||
|
|
||||||
self.latitude = None
|
self.latitude = None
|
||||||
self.longtitude = None
|
self.longitude = None
|
||||||
self.altitude = None
|
self.altitude = None
|
||||||
self.speed = None
|
self.speed = None
|
||||||
self.bearing = None
|
self.bearing = None
|
||||||
@ -646,7 +646,7 @@ class Location(Sensor):
|
|||||||
def update_data(self):
|
def update_data(self):
|
||||||
try:
|
try:
|
||||||
if self.synthesized:
|
if self.synthesized:
|
||||||
if self.latitude != None and self.longtitude != None:
|
if self.latitude != None and self.longitude != None:
|
||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if self._last_update == None:
|
if self._last_update == None:
|
||||||
@ -660,7 +660,7 @@ class Location(Sensor):
|
|||||||
if self.bearing == None: self.bearing = 0.0
|
if self.bearing == None: self.bearing = 0.0
|
||||||
self.data = {
|
self.data = {
|
||||||
"latitude": round(self.latitude, 6),
|
"latitude": round(self.latitude, 6),
|
||||||
"longtitude": round(self.longtitude, 6),
|
"longitude": round(self.longitude, 6),
|
||||||
"altitude": round(self.altitude, 2),
|
"altitude": round(self.altitude, 2),
|
||||||
"speed": round(self.speed, 2),
|
"speed": round(self.speed, 2),
|
||||||
"bearing": round(self.bearing, 2),
|
"bearing": round(self.bearing, 2),
|
||||||
@ -672,7 +672,7 @@ class Location(Sensor):
|
|||||||
if "lat" in self._raw:
|
if "lat" in self._raw:
|
||||||
self.latitude = self._raw["lat"]
|
self.latitude = self._raw["lat"]
|
||||||
if "lon" in self._raw:
|
if "lon" in self._raw:
|
||||||
self.longtitude = self._raw["lon"]
|
self.longitude = self._raw["lon"]
|
||||||
if "altitude" in self._raw:
|
if "altitude" in self._raw:
|
||||||
self.altitude = self._raw["altitude"]
|
self.altitude = self._raw["altitude"]
|
||||||
if "speed" in self._raw:
|
if "speed" in self._raw:
|
||||||
@ -689,7 +689,7 @@ class Location(Sensor):
|
|||||||
if self.accuracy != None and self.accuracy <= self._accuracy_target:
|
if self.accuracy != None and self.accuracy <= self._accuracy_target:
|
||||||
self.data = {
|
self.data = {
|
||||||
"latitude": round(self.latitude, 6),
|
"latitude": round(self.latitude, 6),
|
||||||
"longtitude": round(self.longtitude, 6),
|
"longitude": round(self.longitude, 6),
|
||||||
"altitude": round(self.altitude, 2),
|
"altitude": round(self.altitude, 2),
|
||||||
"speed": round(self.speed, 2),
|
"speed": round(self.speed, 2),
|
||||||
"bearing": round(self.bearing, 2),
|
"bearing": round(self.bearing, 2),
|
||||||
@ -708,7 +708,7 @@ class Location(Sensor):
|
|||||||
try:
|
try:
|
||||||
return [
|
return [
|
||||||
struct.pack("!i", int(round(d["latitude"], 6)*1e6)),
|
struct.pack("!i", int(round(d["latitude"], 6)*1e6)),
|
||||||
struct.pack("!i", int(round(d["longtitude"], 6)*1e6)),
|
struct.pack("!i", int(round(d["longitude"], 6)*1e6)),
|
||||||
struct.pack("!I", int(round(d["altitude"], 2)*1e2)),
|
struct.pack("!I", int(round(d["altitude"], 2)*1e2)),
|
||||||
struct.pack("!I", int(round(d["speed"], 2)*1e2)),
|
struct.pack("!I", int(round(d["speed"], 2)*1e2)),
|
||||||
struct.pack("!I", int(round(d["bearing"], 2)*1e2)),
|
struct.pack("!I", int(round(d["bearing"], 2)*1e2)),
|
||||||
@ -726,7 +726,7 @@ class Location(Sensor):
|
|||||||
else:
|
else:
|
||||||
return {
|
return {
|
||||||
"latitude": struct.unpack("!i", packed[0])[0]/1e6,
|
"latitude": struct.unpack("!i", packed[0])[0]/1e6,
|
||||||
"longtitude": struct.unpack("!i", packed[1])[0]/1e6,
|
"longitude": struct.unpack("!i", packed[1])[0]/1e6,
|
||||||
"altitude": struct.unpack("!I", packed[2])[0]/1e2,
|
"altitude": struct.unpack("!I", packed[2])[0]/1e2,
|
||||||
"speed": struct.unpack("!I", packed[3])[0]/1e2,
|
"speed": struct.unpack("!I", packed[3])[0]/1e2,
|
||||||
"bearing": struct.unpack("!I", packed[4])[0]/1e2,
|
"bearing": struct.unpack("!I", packed[4])[0]/1e2,
|
||||||
@ -742,8 +742,8 @@ class Location(Sensor):
|
|||||||
|
|
||||||
obj_ath = None
|
obj_ath = None
|
||||||
obj_rh = None
|
obj_rh = None
|
||||||
if self.data["altitude"] != None and self.data["latitude"] != None and self.data["longtitude"] != None:
|
if self.data["altitude"] != None and self.data["latitude"] != None and self.data["longitude"] != None:
|
||||||
coords = (self.data["latitude"], self.data["longtitude"], self.data["altitude"])
|
coords = (self.data["latitude"], self.data["longitude"], self.data["altitude"])
|
||||||
obj_ath = angle_to_horizon(coords)
|
obj_ath = angle_to_horizon(coords)
|
||||||
obj_rh = radio_horizon(self.data["altitude"])
|
obj_rh = radio_horizon(self.data["altitude"])
|
||||||
|
|
||||||
@ -752,7 +752,7 @@ class Location(Sensor):
|
|||||||
"name": "Location",
|
"name": "Location",
|
||||||
"values": {
|
"values": {
|
||||||
"latitude": self.data["latitude"],
|
"latitude": self.data["latitude"],
|
||||||
"longtitude": self.data["longtitude"],
|
"longitude": self.data["longitude"],
|
||||||
"altitude": self.data["altitude"],
|
"altitude": self.data["altitude"],
|
||||||
"speed": self.data["speed"],
|
"speed": self.data["speed"],
|
||||||
"heading": self.data["bearing"],
|
"heading": self.data["bearing"],
|
||||||
@ -764,14 +764,14 @@ class Location(Sensor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if relative_to != None and "location" in relative_to.sensors:
|
if relative_to != None and "location" in relative_to.sensors:
|
||||||
slat = self.data["latitude"]; slon = self.data["longtitude"]
|
slat = self.data["latitude"]; slon = self.data["longitude"]
|
||||||
salt = self.data["altitude"];
|
salt = self.data["altitude"];
|
||||||
if salt == None: salt = 0
|
if salt == None: salt = 0
|
||||||
if slat != None and slon != None:
|
if slat != None and slon != None:
|
||||||
s = relative_to.sensors["location"]
|
s = relative_to.sensors["location"]
|
||||||
d = s.data
|
d = s.data
|
||||||
if "latitude" in d and "longtitude" in d and "altitude" in d:
|
if "latitude" in d and "longitude" in d and "altitude" in d:
|
||||||
lat = d["latitude"]; lon = d["longtitude"]; alt = d["altitude"]
|
lat = d["latitude"]; lon = d["longitude"]; alt = d["altitude"]
|
||||||
if lat != None and lon != None:
|
if lat != None and lon != None:
|
||||||
if alt == None: alt = 0
|
if alt == None: alt = 0
|
||||||
cs = (slat, slon, salt); cr = (lat, lon, alt)
|
cs = (slat, slon, salt); cr = (lat, lon, alt)
|
||||||
|
@ -405,7 +405,7 @@ class RVDetails(MDRecycleView):
|
|||||||
formatted_values = q_str+rssi_str+snr_str
|
formatted_values = q_str+rssi_str+snr_str
|
||||||
elif name == "Location":
|
elif name == "Location":
|
||||||
lat = s["values"]["latitude"]
|
lat = s["values"]["latitude"]
|
||||||
lon = s["values"]["longtitude"]
|
lon = s["values"]["longitude"]
|
||||||
alt = s["values"]["altitude"]
|
alt = s["values"]["altitude"]
|
||||||
speed = s["values"]["speed"]
|
speed = s["values"]["speed"]
|
||||||
heading = s["values"]["heading"]
|
heading = s["values"]["heading"]
|
||||||
|
@ -1266,7 +1266,7 @@ MDScreen:
|
|||||||
MDTextField:
|
MDTextField:
|
||||||
id: telemetry_s_fixed_latlon
|
id: telemetry_s_fixed_latlon
|
||||||
size_hint: [0.618, None]
|
size_hint: [0.618, None]
|
||||||
hint_text: "Latitude, longtitude"
|
hint_text: "Latitude, longitude"
|
||||||
text: ""
|
text: ""
|
||||||
font_size: dp(24)
|
font_size: dp(24)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user