Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
motosat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
motosat
Commits
eca9882b
Commit
eca9882b
authored
Sep 05, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spiral search
parent
e7c0ea42
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
33 deletions
+31
-33
test_01.php
test_01.php
+31
-33
No files found.
test_01.php
View file @
eca9882b
...
@@ -272,35 +272,41 @@ printf($rslt);
...
@@ -272,35 +272,41 @@ printf($rslt);
exit
(
0
);
exit
(
0
);
/**
* Scan rectangular AZ/EL window arownd expected satellite position, alternating
/*
* azimuth directions and increasing elevation offset.
Start rotation
* Start with expected elevation and low az margin, scan azimuth to high margin,
$AZ_CMAX = 4790;
* then alternatively increase/decrease elevation
$EL_CMAX = 10979;
* @param $threshold - minimal modem signal strength
$SK_CMAX = 931;
* @param $DishAngleCenter - array of (elevation, azimuth, skew) in degrees,
* corresponding to the center of the scan window
* @param $wnd_az - full range of azimuth scan in degrees
* @param $wnd_el - full range of elevation scan in degrees
* @param $scan_step - elevation scan step
* @return SimpleXMLElement -
*/
*/
function
scan_window
(
$threshold
,
$DishAngleCenter
,
$wnd_az
,
$wnd_el
,
$scan_step
){
function
scan_window
(
$threshold
,
$DishAngleCenter
,
$wnd_az
,
$wnd_el
,
$scan_step
){
global
$motosat_url
,
$LATE_STOP_AZ
,
$dbg_file
;
global
$motosat_url
,
$LATE_STOP_AZ
,
$dbg_file
;
$DishAngle
=
Array
(
$DishAngleCenter
[
0
],
$DishAngleCenter
[
1
],
$DishAngleCenter
[
2
]);
$DishAngle
=
Array
(
$DishAngleCenter
[
0
],
$DishAngleCenter
[
1
],
$DishAngleCenter
[
2
]);
$pass
=
0
;
$dir
=
0
;
for
(
$DishAngle
[
1
]
=
$DishAngleCenter
[
1
]
-
$wnd_el
/
2
;
for
(
$delta_el
=
0.0
;
$delta_el
<
$wnd_el
/
2
;
$delta_el
+=
$scan_step
)
{
$DishAngle
[
1
]
<=
(
$DishAngleCenter
[
1
]
+
$wnd_el
/
2
);
$passes
=
(
$delta_el
>
0.0
)
?
2
:
1
;
$DishAngle
[
1
]
+=
$scan_step
)
{
for
(
$pass
=
0
;
$pass
<
$passes
;
$pass
++
)
{
// for ($dir = 0; $dir < 2; $dir++) {
if
(
$pass
&
1
)
{
if
(
$dir
>
0
){
$DishAngle
[
1
]
=
$DishAngleCenter
[
1
]
+
$delta_el
;
$az_start
=
$DishAngleCenter
[
0
]
+
$wnd_az
/
2
;
$az_start
=
$DishAngleCenter
[
0
]
+
$wnd_az
/
2
;
$az_end
=
$DishAngleCenter
[
0
]
-
$wnd_az
/
2
;
$az_end
=
$DishAngleCenter
[
0
]
-
$wnd_az
/
2
;
}
else
{
}
else
{
$DishAngle
[
1
]
=
$DishAngleCenter
[
1
]
-
$delta_el
;
$az_start
=
$DishAngleCenter
[
0
]
-
$wnd_az
/
2
;
$az_start
=
$DishAngleCenter
[
0
]
-
$wnd_az
/
2
;
$az_end
=
$DishAngleCenter
[
0
]
+
$wnd_az
/
2
;
$az_end
=
$DishAngleCenter
[
0
]
+
$wnd_az
/
2
;
}
}
$DishAngle
[
0
]
=
$az_start
;
$DishAngle
[
0
]
=
$az_start
;
if
(
$dbg_file
)
{
if
(
$dbg_file
)
{
fprintf
(
$dbg_file
,
"
\n
pass=%d:
\n
"
,
$pass
);
fprintf
(
$dbg_file
,
"
\n
dir=%d:
\n
"
,
$dir
);
fprintf
(
$dbg_file
,
"wnd_az=%f:
\n
"
,
$wnd_az
);
fprintf
(
$dbg_file
,
"wnd_az=%f:
\n
"
,
$wnd_az
);
fprintf
(
$dbg_file
,
"wnd_el=%f:
\n
"
,
$wnd_el
);
fprintf
(
$dbg_file
,
"wnd_el=%f:
\n
"
,
$wnd_el
);
fprintf
(
$dbg_file
,
"threshold=%f:
\n
"
,
$threshold
);
fprintf
(
$dbg_file
,
"threshold=%f:
\n
"
,
$threshold
);
...
@@ -311,11 +317,6 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
...
@@ -311,11 +317,6 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
fprintf
(
$dbg_file
,
print_r
(
$DishAngleCenter
,
1
));
fprintf
(
$dbg_file
,
print_r
(
$DishAngleCenter
,
1
));
}
}
// while (true) {
// $counts = moveElAzSk_degrees($DishAngle);
// if (!isset($counts)) break;
// }
while
(
null
!==
moveElAzSk_degrees
(
$DishAngle
));
while
(
null
!==
moveElAzSk_degrees
(
$DishAngle
));
$DishAngle
[
0
]
=
$az_end
;
$DishAngle
[
0
]
=
$az_end
;
...
@@ -346,7 +347,7 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
...
@@ -346,7 +347,7 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
foreach
(
$DishCount
as
$key
=>
$value
){
foreach
(
$DishCount
as
$key
=>
$value
){
$DishCount
[
$key
]
=
$value
+
0
;
$DishCount
[
$key
]
=
$value
+
0
;
}
}
if
(
$
pass
&
1
){
if
(
$
dir
>
0
){
$DishCount
[
0
]
+=
$LATE_STOP_AZ
;
$DishCount
[
0
]
+=
$LATE_STOP_AZ
;
}
else
{
}
else
{
$DishCount
[
0
]
-=
$LATE_STOP_AZ
;
$DishCount
[
0
]
-=
$LATE_STOP_AZ
;
...
@@ -367,13 +368,10 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
...
@@ -367,13 +368,10 @@ function scan_window($threshold, $DishAngleCenter, $wnd_az, $wnd_el, $scan_step)
return
$xml_state
;
return
$xml_state
;
}
}
$pass
++
;
}
$dir
=
1
-
$dir
;
}
}
moveElAzSk_degrees
(
$DishAngleCenter
);
moveElAzSk_degrees
(
$DishAngleCenter
);
// while (true) {
// $counts = moveElAzSk_degrees($DishAngleCenter);
// if (!isset($counts)) break;
// }
while
(
null
!==
moveElAzSk_degrees
(
$DishAngleCenter
));
while
(
null
!==
moveElAzSk_degrees
(
$DishAngleCenter
));
$xml_state
=
simplexml_load_file
(
$motosat_url
);
$xml_state
=
simplexml_load_file
(
$motosat_url
);
...
...
Write
Preview
Markdown
is supported
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