From 40288999e03964c14a790e6e9e52daaa2c11bc17 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 8 Jul 2025 11:50:51 +0200 Subject: [PATCH 1/2] Use displayname incase LoTW name is not set (yet) --- application/models/Satellite_model.php | 4 ++-- application/views/satellite/flightpath.php | 2 +- assets/js/sections/flightpath.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index 899ce0ad7..527fd700b 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -28,7 +28,7 @@ class Satellite_model extends CI_Model { } function get_all_satellites_with_tle() { - $sql = "select satellite.id, satellite.name as satname, tle.tle + $sql = "select satellite.id, satellite.name as satname, satellite.displayname as displayname, tle.tle from satellite join tle on satellite.id = tle.satelliteid order by satellite.name @@ -189,7 +189,7 @@ class Satellite_model extends CI_Model { } function get_tle($sat) { - $this->db->select('satellite.name AS satellite, tle.tle, tle.updated'); + $this->db->select('satellite.name AS satellite, satellite.displayname AS displayname, tle.tle, tle.updated'); $this->db->join('tle', 'satellite.id = tle.satelliteid'); $this->db->where('name', $sat); $query = $this->db->get('satellite'); diff --git a/application/views/satellite/flightpath.php b/application/views/satellite/flightpath.php index d331489ec..e93197a2e 100644 --- a/application/views/satellite/flightpath.php +++ b/application/views/satellite/flightpath.php @@ -42,7 +42,7 @@ satname . '"'; if ($sat->satname == $selsat) { echo ' selected'; } - echo '>' . $sat->satname . ''."\n"; + echo '>' . ($sat->satname != null ? ($sat->displayname.' ('.$sat->satname.')') : $sat->displayname). ''."\n"; } ?> diff --git a/assets/js/sections/flightpath.js b/assets/js/sections/flightpath.js index 6289fc1a9..a7dbe043a 100644 --- a/assets/js/sections/flightpath.js +++ b/assets/js/sections/flightpath.js @@ -695,7 +695,7 @@ function getBearing(lat1, lng1, lat2, lng2) { } function start(data) { - init(data.satellite); + init((data.satellite != '' ? (data.displayname+' ('+data.satellite+')') : data.displayname)); initSats(parseTle(data.tle)); } @@ -726,7 +726,7 @@ function plot_sat() { }, success: function (data) { sats.start(data); - $("#satname").html($("#sats").val()); + $("#satname").html($("#sats :selected").text()); }, error: function (data) { alert('Something went wrong!'); From d59dfd0a04959ee0ed8db9469977992a8753cd9b Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 8 Jul 2025 14:07:13 +0200 Subject: [PATCH 2/2] Exchange display and lotw name --- application/views/satellite/flightpath.php | 2 +- assets/js/sections/flightpath.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/satellite/flightpath.php b/application/views/satellite/flightpath.php index e93197a2e..aad4b619a 100644 --- a/application/views/satellite/flightpath.php +++ b/application/views/satellite/flightpath.php @@ -42,7 +42,7 @@ satname . '"'; if ($sat->satname == $selsat) { echo ' selected'; } - echo '>' . ($sat->satname != null ? ($sat->displayname.' ('.$sat->satname.')') : $sat->displayname). ''."\n"; + echo '>' . ($sat->satname != null ? ($sat->satname.' ('.$sat->displayname.')') : $sat->displayname). ''."\n"; } ?> diff --git a/assets/js/sections/flightpath.js b/assets/js/sections/flightpath.js index a7dbe043a..3e6cfaebc 100644 --- a/assets/js/sections/flightpath.js +++ b/assets/js/sections/flightpath.js @@ -695,7 +695,7 @@ function getBearing(lat1, lng1, lat2, lng2) { } function start(data) { - init((data.satellite != '' ? (data.displayname+' ('+data.satellite+')') : data.displayname)); + init((data.satellite != '' ? (data.satellite+' ('+data.displayname+')') : data.displayname)); initSats(parseTle(data.tle)); }