move intval() to the reg1testlib to make maxdistance function more generic

This commit is contained in:
HB9HIL
2024-08-26 10:06:05 +02:00
parent 5cfebd450c
commit 4bf41bd046
2 changed files with 3 additions and 3 deletions

View File

@@ -134,7 +134,7 @@ class Qra {
* @param string $unit Unit of measurement
*
* @return object $maxdistanceqso Object of the QSO with the maximum distance
* @return integer $maxdistance Maximum distance
* @return float $maxdistance Maximum distance
*/
function getMaxDistanceQSO($mylocator, $qsos, $unit = "M") {
@@ -162,7 +162,7 @@ class Qra {
$result = [];
$result['qso'] = $maxdistanceqso;
$result['distance'] = intval($maxdistance);
$result['distance'] = $maxdistance;
//return findings
return $result;

View File

@@ -47,7 +47,7 @@ class Reg1testformat {
//set QSO info for QSO with max distance only if we can determine it
if($maxdistanceqso['qso'] != null){
$edi_header .= "CODXC=" . strtoupper($maxdistanceqso['qso']->COL_CALL) . ";" . substr(strtoupper($maxdistanceqso['qso']->COL_GRIDSQUARE), 0, 6) . ";" . $maxdistanceqso['distance'] . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance.
$edi_header .= "CODXC=" . strtoupper($maxdistanceqso['qso']->COL_CALL) . ";" . substr(strtoupper($maxdistanceqso['qso']->COL_GRIDSQUARE), 0, 6) . ";" . intval($maxdistanceqso['distance']) . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance.
}else{
$edi_header .= "CODXC=" . "\r\n"; //Arguments describe the claimed ODX contact call, WWL and distance. Leave empty.
}