Fixed long path calculation in azimuth_long_path() in locator.c

Spelling edits and removal of space at the end of lines in rig.c



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2829 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.11
Nate Bargmann, N0NB 2010-02-14 21:47:49 +00:00
rodzic 67c2ecfefb
commit 6763e8e750
2 zmienionych plików z 173 dodań i 163 usunięć

Wyświetl plik

@ -576,18 +576,28 @@ double HAMLIB_API distance_long_path(double distance) {
/**
* \brief Calculate the long path bearing between two points.
* \param azimuth The shortpath bearing
* \param azimuth The shortpath bearing--0.0 to 360.0 degrees
*
* Calculate the long path (respective of the short path)
* of a given bearing.
*
* \return the azimuth in decimal degrees for the opposite path.
* \return the azimuth in decimal degrees for the opposite path or
* -RIG_EINVAL upon input error (outside the range of 0.0 to 360.0).
*
* \sa qrb()
*/
double HAMLIB_API azimuth_long_path(double azimuth) {
return 360.0 - azimuth;
if (azimuth == 0.0 || azimuth == 360.0)
return 180.0;
else if (azimuth > 0.0 && azimuth < 180.0)
return 180.0 + azimuth;
else if (azimuth == 180.0)
return 0.0;
else if (azimuth > 180.0 && azimuth < 360.0)
return (180.0 - azimuth) * -1.0;
else
return -RIG_EINVAL;
}
/*! @} */

Wyświetl plik

@ -34,7 +34,7 @@
* \date 2000-2009
*
* Hamlib provides a user-callable API, a set of "front-end" routines that
* call rig-specific "back-end" routines whichactually communicate with
* call rig-specific "back-end" routines which actually communicate with
* the physical rig.
*/
@ -214,7 +214,7 @@ int foreach_opened_rig(int (*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data)
/**
* \brief get string describing the error code
* \param errnum The error code
* \return the appropriate description string, ortherwise a NULL pointer
* \return the appropriate description string, otherwise a NULL pointer
* if the error code is unknown.
*
* Returns a string describing the error code passed in the argument \a errnum.
@ -259,7 +259,7 @@ RIG * HAMLIB_API rig_init(rig_model_t rig_model)
/*
* okay, we've found it. Allocate some memory and set it to zeros,
* and especially the initialize the callbacks
* and especially the callbacks
*/
rig = calloc(1, sizeof(RIG));
if (rig == NULL) {
@ -2305,7 +2305,7 @@ int HAMLIB_API rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t
{
const freq_range_t *txrange;
if (!rig || !rig->caps || !power || mwpower==0)
if (!rig || !rig->caps || !power || mwpower<=0)
return -RIG_EINVAL;
if (rig->caps->mW2power != NULL)
@ -2557,7 +2557,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
}
/**
* \brief check availability of scaning functions
* \brief check availability of scanning functions
* \param rig The rig handle
* \param scan The scan op
*