Browse Source

Fix swapping if already high

beaglebone
Jeroen Vreeken 6 years ago
parent
commit
b194d009f7
2 changed files with 12 additions and 5 deletions
  1. +8
    -1
      console/console/console_sattracker.c
  2. +4
    -4
      console/js/dt_status.js

+ 8
- 1
console/console/console_sattracker.c View File

@ -424,6 +424,7 @@ int main(int argc, char **argv)
struct timeval tv;
double pressure, temperature;
double alt_adj;
bool check_swap = false;
t = time(NULL);
if (t != lastt) {
@ -437,7 +438,7 @@ int main(int argc, char **argv)
predict_calc_azel(predict, JD, &az, &el);
/* predict has an az range from 0 to 360 with 0 being South.
/* predict has an az range from 0 to 360 with 0 being North.
Dwingeloo has an az range from -270 to 270 with 0 being South
*/
az -= 180.0;
@ -453,6 +454,7 @@ int main(int argc, char **argv)
az, az_aos);
az += copysign(360.0, az_aos);
}
check_swap = check_az;
check_az = false;
}
if (el >= EL_HORIZON) {
@ -467,9 +469,14 @@ int main(int argc, char **argv)
log_send(LOG_T_DEBUG,
"Swapping AZ");
az += copysign(360.0, last_az);
if (check_swap && (az > 270.0 || az < -270.0)) {
log_send(LOG_T_DEBUG, "Swap not possible!");
az -= copysign(360.0, last_az);
}
}
}
passknown = false;
check_swap = false;
}
if (t > t_los)


+ 4
- 4
console/js/dt_status.js View File

@ -164,10 +164,10 @@ function dt_status(element_name) {
val = rad2deg(val);
var val_n = val + 180;
if (val >= 360)
val -= 360;
if (val < 0)
val += 360;
if (val_n >= 360)
val_n -= 360;
if (val_n < 0)
val_n += 360;
val_nd = val_n.toFixed(4);
dt_status_this.val_az_north.value_set(val_nd);


Loading…
Cancel
Save