Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Weblate
2026-03-09 10:33:46 +00:00

View File

@@ -152,19 +152,19 @@ class Distances_model extends CI_Model
switch ($measurement_base) { switch ($measurement_base) {
case 'M': case 'M':
$unit = "mi"; $unit = "mi";
$dist = '13000'; $dist = '26000';
break; break;
case 'K': case 'K':
$unit = "km"; $unit = "km";
$dist = '20000'; $dist = '40050';
break; break;
case 'N': case 'N':
$unit = "nmi"; $unit = "nmi";
$dist = '11000'; $dist = '22000';
break; break;
default: default:
$unit = "km"; $unit = "km";
$dist = '20000'; $dist = '40050';
} }
if (!$this->valid_locator($stationgrid)) { if (!$this->valid_locator($stationgrid)) {
@@ -172,7 +172,12 @@ class Distances_model extends CI_Model
echo json_encode(array('Error' => 'Error. There is a problem with the gridsquare ('.$stationgrid.') set in your profile!')); echo json_encode(array('Error' => 'Error. There is a problem with the gridsquare ('.$stationgrid.') set in your profile!'));
exit; exit;
} else { } else {
// Making the array we will use for plotting, we save occurrences of the length of each qso in the array // Build the chart buckets in 50-unit steps up to the max chart distance ($dist).
// Each bucket covers a 50-unit range, e.g. in km mode:
// $dataarray[0] => "0km - 50km"
// $dataarray[1] => "50km - 100km"
// ...
// till 40050 (longpath)
$j = 0; $j = 0;
for ($i = 0; $j < $dist; $i++) { for ($i = 0; $j < $dist; $i++) {
$dataarray[$i]['dist'] = $j . $unit . ' - ' . ($j + 50) . $unit; $dataarray[$i]['dist'] = $j . $unit . ' - ' . ($j + 50) . $unit;
@@ -205,6 +210,9 @@ class Distances_model extends CI_Model
$qrb['Callsign'] = $qso['callsign']; $qrb['Callsign'] = $qso['callsign'];
$qrb['Grid'] = $qso['grid']; $qrb['Grid'] = $qso['grid'];
} }
if (!isset($dataarray[$arrayplacement])) { // QSO distance exceeds chart range, skip plotting
continue;
}
$dataarray[$arrayplacement]['count']++; // Used for counting total qsos plotted $dataarray[$arrayplacement]['count']++; // Used for counting total qsos plotted
if ($dataarray[$arrayplacement]['callcount'] < 5) { // Used for tooltip in graph, set limit to 5 calls shown if ($dataarray[$arrayplacement]['callcount'] < 5) { // Used for tooltip in graph, set limit to 5 calls shown
if ($dataarray[$arrayplacement]['callcount'] > 0) { if ($dataarray[$arrayplacement]['callcount'] > 0) {