kopia lustrzana https://github.com/jprochazka/adsb-receiver
ACARS display fixes.
rodzic
67e24fc5e5
commit
6f8c727ced
|
@ -87,7 +87,7 @@ if [[ "${adsb_decoder_installed}" == "true" || "${uat_decoder_installed}" == "tr
|
|||
while [[ -z $adsb_device_number ]] ; do
|
||||
adsb_device_number=$(whiptail --backtitle "ACARSDEC Decoder Configuration" \
|
||||
--title "${adsb_device_number_title}" \
|
||||
--inputbox "\nEnter the RTL-SDR device number to assign your ADS-B decoder." \
|
||||
--inputbox "Enter the RTL-SDR device number to assign your ADS-B decoder." \
|
||||
8 78 \
|
||||
"${current_adsb_device_number}" 3>&1 1>&2 2>&3)
|
||||
exit_status=$?
|
||||
|
@ -112,7 +112,7 @@ if [[ "${adsb_decoder_installed}" == "true" || "${uat_decoder_installed}" == "tr
|
|||
while [[ -z $uat_device_number ]] ; do
|
||||
uat_device_number=$(whiptail --backtitle "ACARSDEC Decoder Configuration" \
|
||||
--title "${uat_device_number_title}" \
|
||||
--inputbox "\nEnter the RTL-SDR device number to assign your UAT decoder." \
|
||||
--inputbox "Enter the RTL-SDR device number to assign your UAT decoder." \
|
||||
8 78 \
|
||||
"${current_uat_device_number}" 3>&1 1>&2 2>&3)
|
||||
exit_status=$?
|
||||
|
@ -139,7 +139,7 @@ if [[ "${adsb_decoder_installed}" == "true" || "${uat_decoder_installed}" == "tr
|
|||
while [[ -z $acars_device_number ]]; do
|
||||
acars_device_number=$(whiptail --backtitle "ACARSDEC Decoder Configuration" \
|
||||
--title "${acars_device_number_title}" \
|
||||
--inputbox "\nEnter the RTL-SDR device number to assign your ACARSDEC decoder." \
|
||||
--inputbox "Enter the RTL-SDR device number to assign your ACARSDEC decoder." \
|
||||
8 78 \
|
||||
"${current_acars_device_number}" 3>&1 1>&2 2>&3)
|
||||
exit_status=$?
|
||||
|
@ -159,7 +159,7 @@ if [[ -z $acars_device_number ]]; then
|
|||
acars_device_number="0"
|
||||
fi
|
||||
|
||||
current_acars_frequencies=""
|
||||
current_acars_frequencies="130.025 130.425 130.450 131.125 131.550"
|
||||
if [[ "${acars_decoder_installed}" == "true" ]]; then
|
||||
log_message "Determining which frequencies are currently assigned"
|
||||
exec_start=`get_config "ExecStart" "/etc/systemd/system/acarsdec.service"`
|
||||
|
|
|
@ -16,8 +16,17 @@
|
|||
// The title of this page.
|
||||
$pageData['title'] = "ACARS Messages";
|
||||
|
||||
// Pagination.
|
||||
$items_per_page = 15;
|
||||
$page = (isset($_GET['page']) ? $_GET['page'] : 1);
|
||||
$message_count = $acars->getAcarsMessageCount();
|
||||
|
||||
// Get most recent ACARS messages.
|
||||
$acarsMessages = $acars->getAcarsMessages(25, 0);
|
||||
$messages = $acars->getAcarsMessages($items_per_page, ($items_per_page * $page));
|
||||
$pageData['acarsMessages'] = $messages;
|
||||
|
||||
// Calculate the number of pagination links to show.
|
||||
$pageData['pageLinks'] = ceil($message_count / $items_per_page);
|
||||
|
||||
$template->display($pageData);
|
||||
?>
|
||||
|
|
|
@ -19,5 +19,22 @@
|
|||
|
||||
return $acarsMessages;
|
||||
}
|
||||
|
||||
function getAcarsMessageCount() {
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
|
||||
$common = new common();
|
||||
|
||||
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
|
||||
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
|
||||
$sql = "SELECT COUNT(*) FROM Messages";
|
||||
$sth = $dbh->prepare($sql);
|
||||
$sth->execute();
|
||||
$number_of_rows = $sth->fetchColumn();
|
||||
$sth = NULL;
|
||||
$dbh = NULL;
|
||||
$dsn = NULL;
|
||||
|
||||
return $number_of_rows;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h1>ACARS Messages</h1>
|
||||
<hr />
|
||||
{foreach page:acarsMessages as message}
|
||||
<h2>{message->FlightNumber}<h2>
|
||||
<h2>{message->FlightNumber}</h2>
|
||||
<p>
|
||||
Aircarft Registration: {message->Registration}<br/>
|
||||
The first message was received on {message->StartTime} with the last seen {message->LastTime}.<br/>
|
||||
|
@ -26,8 +26,13 @@
|
|||
</ul>
|
||||
</div>
|
||||
{/foreach}
|
||||
<ul class="pagination">
|
||||
{for pageNumber eq 1 to page:pageLinks}
|
||||
<li><a href="acars.php?page={pageNumber}">{pageNumber}</a></li>
|
||||
{/for}
|
||||
</ul>
|
||||
</div>
|
||||
{/area}
|
||||
{area:scripts}
|
||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||
{/area}
|
||||
{/area}
|
||||
|
|
Ładowanie…
Reference in New Issue