Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
b194d009
Commit
b194d009
authored
Mar 29, 2016
by
Jeroen Vreeken
Browse files
Fix swapping if already high
parent
c3e2eac7
Changes
2
Show whitespace changes
Inline
Side-by-side
console/console/console_sattracker.c
View file @
b194d009
...
...
@@ -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
Sou
th.
/* predict has an az range from 0 to 360 with 0 being
Nor
th.
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
)
...
...
console/js/dt_status.js
View file @
b194d009
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment