mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Take care of lat/lng of QTH (depends on station_location)
This commit is contained in:
@@ -13,6 +13,7 @@ class QSO extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->load->model('cat');
|
||||
$this->load->library('qra');
|
||||
$this->load->model('stations');
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
@@ -41,6 +42,7 @@ class QSO extends CI_Controller {
|
||||
$data['iota'] = $this->logbook_model->fetchIota();
|
||||
$data['modes'] = $this->modes->active();
|
||||
$data['bands'] = $this->bands->get_user_bands_for_qso_entry();
|
||||
[$data['lat'], $data['lng']] = $this->qra->qra2latlong($this->stations->gridsquare_from_station($this->stations->find_active()));
|
||||
$data['user_default_band'] = $this->session->userdata('user_default_band');
|
||||
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
|
||||
|
||||
@@ -607,8 +609,10 @@ class QSO extends CI_Controller {
|
||||
|
||||
public function get_station_power() {
|
||||
$this->load->model('stations');
|
||||
$this->load->library('qra');
|
||||
$stationProfile = $this->input->post('stationProfile', TRUE);
|
||||
$data = array('station_power' => $this->stations->get_station_power($stationProfile));
|
||||
[$data['lat'], $data['lng']] = $this->qra->qra2latlong($this->stations->gridsquare_from_station($stationProfile));
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var lang_dxccsummary_for = "<?= __("DXCC Summary for "); ?>";
|
||||
var lang_lotw_upload_day_ago = "<?= __("LoTW User. Last upload was 1 day ago."); ?>";
|
||||
var lang_lotw_upload_days_ago = "<?= __("LoTW User. Last upload was %x days ago."); ?>"; // due to the way the string is built (PHP to JS), %x is replaced with the number of days
|
||||
var latlng=[<?php echo $lat.','.$lng;?>];
|
||||
</script>
|
||||
|
||||
<div class="row qsopane">
|
||||
|
||||
@@ -75,4 +75,4 @@
|
||||
$('#redirect_message').html('<?= __("The data was redirected. You can close this window."); ?>');
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -39,6 +39,7 @@ $('#stationProfile').on('change', function () {
|
||||
data: { 'stationProfile': stationProfile },
|
||||
success: function (res) {
|
||||
$('#transmit_power').val(res.station_power);
|
||||
latlng=[res.lat,res.lng];
|
||||
},
|
||||
error: function () {
|
||||
$('#transmit_power').val('');
|
||||
@@ -354,8 +355,8 @@ function start_az_ele_ticker(tle) {
|
||||
|
||||
// Define the observer's location in radians
|
||||
var observerGd = {
|
||||
longitude: satellite.degreesToRadians(0),
|
||||
latitude: satellite.degreesToRadians(0),
|
||||
longitude: satellite.degreesToRadians(latlng[0]),
|
||||
latitude: satellite.degreesToRadians(latlng[1]),
|
||||
height: 0.370
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user