From c504589b7664565d244c6565636dfcb62c4c7d3f Mon Sep 17 00:00:00 2001
From: Marat Fayzullin
Date: Mon, 5 Dec 2022 22:59:09 -0500
Subject: [PATCH] Adding more details about stationary markers.
---
htdocs/map.js | 30 +++++++++++++++++++++++++-----
owrx/aprs/__init__.py | 2 +-
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/htdocs/map.js b/htdocs/map.js
index 8dac88a..bf6d754 100644
--- a/htdocs/map.js
+++ b/htdocs/map.js
@@ -143,7 +143,11 @@ $(function(){
marker.comment = update.location.comment;
marker.weather = update.location.weather;
marker.altitude = update.location.altitude;
+ marker.height = update.location.height;
+ marker.power = update.location.power;
+ marker.gain = update.location.gain;
marker.device = update.location.device;
+ marker.directivity = update.location.directivity;
if (expectedCallsign && expectedCallsign == update.callsign) {
map.panTo(pos);
@@ -462,24 +466,24 @@ $(function(){
if (marker.weather.rain && (marker.weather.rain.day>0)) {
weatherString += makeListItem('Rain',
- marker.weather.rain.hour + ' mm/h, ' +
- marker.weather.rain.day + ' mm/day'
+ marker.weather.rain.hour.toFixed(0) + ' mm/h, ' +
+ marker.weather.rain.day.toFixed(0) + ' mm/day'
// marker.weather.rain.sincemidnight + ' mm since midnight'
);
}
if (marker.weather.snowfall) {
- weatherString += makeListItem('Snow', marker.weather.snowfall + ' cm');
+ weatherString += makeListItem('Snow', marker.weather.snowfall.toFixed(1) + ' cm');
}
weatherString += '
';
}
- if (marker.altitude || marker.device) {
+ if (marker.altitude || marker.device || marker.power || marker.height || marker.gain || marker.directivity) {
detailsString += '' + makeListTitle('Details');
if (marker.altitude) {
- detailsString += makeListItem('Altitude', marker.altitude + ' m');
+ detailsString += makeListItem('Altitude', marker.altitude.toFixed(0) + ' m');
}
if (marker.device) {
@@ -489,6 +493,22 @@ $(function(){
);
}
+ if (marker.height) {
+ detailsString += makeListItem('Height', marker.height.toFixed(0) + ' m');
+ }
+
+ if (marker.power) {
+ detailsString += makeListItem('Power', marker.power);
+ }
+
+ if (marker.gain) {
+ detailsString += makeListItem('Gain', marker.gain);
+ }
+
+ if (marker.directivity) {
+ detailsString += makeListItem('Direction', marker.directivity);
+ }
+
detailsString += '
';
}
diff --git a/owrx/aprs/__init__.py b/owrx/aprs/__init__.py
index 6dc05a0..633ad1d 100644
--- a/owrx/aprs/__init__.py
+++ b/owrx/aprs/__init__.py
@@ -148,7 +148,7 @@ class AprsLocation(LatLngLocation):
def __dict__(self):
res = super(AprsLocation, self).__dict__()
- for key in ["comment", "symbol", "course", "speed", "altitude", "weather", "device"]:
+ for key in ["comment", "symbol", "course", "speed", "altitude", "weather", "device", "power", "height", "gain", "directivity"]:
if key in self.data:
res[key] = self.data[key]
return res