Rewrite AA Code, Fix Internet Script, Device Autoupdate LiveATC.json #1

Merged
npease merged 76 commits from rewrite2022 into master 2022-06-04 18:20:12 -09:00
41 changed files with 8148 additions and 312489 deletions
+11 -6
View File
@@ -1,6 +1,11 @@
json/keys.json
/node_modules
/scripts/node_modules
/tiles/keys.json
/tiles/
/data/aircraft1.json
json/keys.json
/node_modules
/scripts/node_modules
/tiles/keys.json
/tiles/
/data/aircraft1.json
/data/battery.json
/data/
/.vscode/
/information_files/
/information/
-6
View File
@@ -1,6 +0,0 @@
# All Scripts to be run at start
unclutter &
cd /usr/share/dump1090-mutability/html
sudo python battery.py &
sudo python api.py &
sudo node /scripts/internet_data.js
-499
View File
@@ -1,499 +0,0 @@
.progress-circle {
font-size: 20px;
margin: 20px;
position: relative;
/* so that children can be absolutely positioned */
padding: 0;
width: 5em;
height: 5em;
background-color: #F2E9E1;
border-radius: 50%;
line-height: 5em;
}
.progress-circle:after {
border: none;
position: absolute;
top: 0.35em;
left: 0.35em;
text-align: center;
display: block;
border-radius: 50%;
width: 4.3em;
height: 4.3em;
background-color: white;
content: " ";
}
/* Text inside the control */
.progress-circle span {
position: absolute;
line-height: 5em;
width: 5em;
text-align: center;
display: block;
color: #53777A;
z-index: 2;
}
.left-half-clipper {
/* a round circle */
border-radius: 50%;
width: 5em;
height: 5em;
position: absolute;
/* needed for clipping */
clip: rect(0, 5em, 5em, 2.5em);
/* clips the whole left half*/
}
/* when p>50, don't clip left half*/
.progress-circle.over50 .left-half-clipper {
clip: rect(auto, auto, auto, auto);
}
.value-bar {
/*This is an overlayed square, that is made round with the border radius,
then it is cut to display only the left half, then rotated clockwise
to escape the outer clipping path.*/
position: absolute;
/*needed for clipping*/
clip: rect(0, 2.5em, 5em, 0);
width: 5em;
height: 5em;
border-radius: 50%;
border: 0.45em solid #53777A;
/*The border is 0.35 but making it larger removes visual artifacts */
/*background-color: #4D642D;*/
/* for debug */
box-sizing: border-box;
}
/* Progress bar filling the whole right half for values above 50% */
.progress-circle.over50 .first50-bar {
/*Progress bar for the first 50%, filling the whole right half*/
position: absolute;
/*needed for clipping*/
clip: rect(0, 5em, 5em, 2.5em);
background-color: #53777A;
border-radius: 50%;
width: 5em;
height: 5em;
}
.progress-circle:not(.over50) .first50-bar {
display: none;
}
/* Progress bar rotation position */
.progress-circle.p0 .value-bar {
display: none;
}
.progress-circle.p1 .value-bar {
transform: rotate(4deg);
}
.progress-circle.p2 .value-bar {
transform: rotate(7deg);
}
.progress-circle.p3 .value-bar {
transform: rotate(11deg);
}
.progress-circle.p4 .value-bar {
transform: rotate(14deg);
}
.progress-circle.p5 .value-bar {
transform: rotate(18deg);
}
.progress-circle.p6 .value-bar {
transform: rotate(22deg);
}
.progress-circle.p7 .value-bar {
transform: rotate(25deg);
}
.progress-circle.p8 .value-bar {
transform: rotate(29deg);
}
.progress-circle.p9 .value-bar {
transform: rotate(32deg);
}
.progress-circle.p10 .value-bar {
transform: rotate(36deg);
}
.progress-circle.p11 .value-bar {
transform: rotate(40deg);
}
.progress-circle.p12 .value-bar {
transform: rotate(43deg);
}
.progress-circle.p13 .value-bar {
transform: rotate(47deg);
}
.progress-circle.p14 .value-bar {
transform: rotate(50deg);
}
.progress-circle.p15 .value-bar {
transform: rotate(54deg);
}
.progress-circle.p16 .value-bar {
transform: rotate(58deg);
}
.progress-circle.p17 .value-bar {
transform: rotate(61deg);
}
.progress-circle.p18 .value-bar {
transform: rotate(65deg);
}
.progress-circle.p19 .value-bar {
transform: rotate(68deg);
}
.progress-circle.p20 .value-bar {
transform: rotate(72deg);
}
.progress-circle.p21 .value-bar {
transform: rotate(76deg);
}
.progress-circle.p22 .value-bar {
transform: rotate(79deg);
}
.progress-circle.p23 .value-bar {
transform: rotate(83deg);
}
.progress-circle.p24 .value-bar {
transform: rotate(86deg);
}
.progress-circle.p25 .value-bar {
transform: rotate(90deg);
}
.progress-circle.p26 .value-bar {
transform: rotate(94deg);
}
.progress-circle.p27 .value-bar {
transform: rotate(97deg);
}
.progress-circle.p28 .value-bar {
transform: rotate(101deg);
}
.progress-circle.p29 .value-bar {
transform: rotate(104deg);
}
.progress-circle.p30 .value-bar {
transform: rotate(108deg);
}
.progress-circle.p31 .value-bar {
transform: rotate(112deg);
}
.progress-circle.p32 .value-bar {
transform: rotate(115deg);
}
.progress-circle.p33 .value-bar {
transform: rotate(119deg);
}
.progress-circle.p34 .value-bar {
transform: rotate(122deg);
}
.progress-circle.p35 .value-bar {
transform: rotate(126deg);
}
.progress-circle.p36 .value-bar {
transform: rotate(130deg);
}
.progress-circle.p37 .value-bar {
transform: rotate(133deg);
}
.progress-circle.p38 .value-bar {
transform: rotate(137deg);
}
.progress-circle.p39 .value-bar {
transform: rotate(140deg);
}
.progress-circle.p40 .value-bar {
transform: rotate(144deg);
}
.progress-circle.p41 .value-bar {
transform: rotate(148deg);
}
.progress-circle.p42 .value-bar {
transform: rotate(151deg);
}
.progress-circle.p43 .value-bar {
transform: rotate(155deg);
}
.progress-circle.p44 .value-bar {
transform: rotate(158deg);
}
.progress-circle.p45 .value-bar {
transform: rotate(162deg);
}
.progress-circle.p46 .value-bar {
transform: rotate(166deg);
}
.progress-circle.p47 .value-bar {
transform: rotate(169deg);
}
.progress-circle.p48 .value-bar {
transform: rotate(173deg);
}
.progress-circle.p49 .value-bar {
transform: rotate(176deg);
}
.progress-circle.p50 .value-bar {
transform: rotate(180deg);
}
.progress-circle.p51 .value-bar {
transform: rotate(184deg);
}
.progress-circle.p52 .value-bar {
transform: rotate(187deg);
}
.progress-circle.p53 .value-bar {
transform: rotate(191deg);
}
.progress-circle.p54 .value-bar {
transform: rotate(194deg);
}
.progress-circle.p55 .value-bar {
transform: rotate(198deg);
}
.progress-circle.p56 .value-bar {
transform: rotate(202deg);
}
.progress-circle.p57 .value-bar {
transform: rotate(205deg);
}
.progress-circle.p58 .value-bar {
transform: rotate(209deg);
}
.progress-circle.p59 .value-bar {
transform: rotate(212deg);
}
.progress-circle.p60 .value-bar {
transform: rotate(216deg);
}
.progress-circle.p61 .value-bar {
transform: rotate(220deg);
}
.progress-circle.p62 .value-bar {
transform: rotate(223deg);
}
.progress-circle.p63 .value-bar {
transform: rotate(227deg);
}
.progress-circle.p64 .value-bar {
transform: rotate(230deg);
}
.progress-circle.p65 .value-bar {
transform: rotate(234deg);
}
.progress-circle.p66 .value-bar {
transform: rotate(238deg);
}
.progress-circle.p67 .value-bar {
transform: rotate(241deg);
}
.progress-circle.p68 .value-bar {
transform: rotate(245deg);
}
.progress-circle.p69 .value-bar {
transform: rotate(248deg);
}
.progress-circle.p70 .value-bar {
transform: rotate(252deg);
}
.progress-circle.p71 .value-bar {
transform: rotate(256deg);
}
.progress-circle.p72 .value-bar {
transform: rotate(259deg);
}
.progress-circle.p73 .value-bar {
transform: rotate(263deg);
}
.progress-circle.p74 .value-bar {
transform: rotate(266deg);
}
.progress-circle.p75 .value-bar {
transform: rotate(270deg);
}
.progress-circle.p76 .value-bar {
transform: rotate(274deg);
}
.progress-circle.p77 .value-bar {
transform: rotate(277deg);
}
.progress-circle.p78 .value-bar {
transform: rotate(281deg);
}
.progress-circle.p79 .value-bar {
transform: rotate(284deg);
}
.progress-circle.p80 .value-bar {
transform: rotate(288deg);
}
.progress-circle.p81 .value-bar {
transform: rotate(292deg);
}
.progress-circle.p82 .value-bar {
transform: rotate(295deg);
}
.progress-circle.p83 .value-bar {
transform: rotate(299deg);
}
.progress-circle.p84 .value-bar {
transform: rotate(302deg);
}
.progress-circle.p85 .value-bar {
transform: rotate(306deg);
}
.progress-circle.p86 .value-bar {
transform: rotate(310deg);
}
.progress-circle.p87 .value-bar {
transform: rotate(313deg);
}
.progress-circle.p88 .value-bar {
transform: rotate(317deg);
}
.progress-circle.p89 .value-bar {
transform: rotate(320deg);
}
.progress-circle.p90 .value-bar {
transform: rotate(324deg);
}
.progress-circle.p91 .value-bar {
transform: rotate(328deg);
}
.progress-circle.p92 .value-bar {
transform: rotate(331deg);
}
.progress-circle.p93 .value-bar {
transform: rotate(335deg);
}
.progress-circle.p94 .value-bar {
transform: rotate(338deg);
}
.progress-circle.p95 .value-bar {
transform: rotate(342deg);
}
.progress-circle.p96 .value-bar {
transform: rotate(346deg);
}
.progress-circle.p97 .value-bar {
transform: rotate(349deg);
}
.progress-circle.p98 .value-bar {
transform: rotate(353deg);
}
.progress-circle.p99 .value-bar {
transform: rotate(356deg);
}
.progress-circle.p100 .value-bar {
transform: rotate(360deg);
}
-21
View File
File diff suppressed because one or more lines are too long
-836
View File
@@ -1,836 +0,0 @@
html,
body {
margin: 0;
padding: 0;
background-color: #000000;
color: white;
font-family: Tahoma, Sans-Serif;
font-size: 10pt;
height: 100%;
}
#map_container {
color: black
}
#planes_table {
background-color: black;
cursor: pointer;
}
#metar_loading {
top: 4px;
}
#liveatc_button {
color: white;
}
#metar_button {
color: white;
}
#radar_button {
color: white;
}
#radar_flight_tab_button {
color: white;
}
#radar_aircraft_tab_button {
color: white;
}
#radar_radar_tab_button {
color: white;
}
#vol_down_button {
background-color: white;
}
#power_button {
background-color: white;
}
#vol_up_button {
background-color: white;
}
#home_button {
background-color: white;
}
#internet_mode_button {
background-color: white;
}
#cesium_button {
background-color: white;
}
#power_modal > .modal-content {
width: 50%;
height: 30%;
top: 25%;
left: 25%;
position: absolute;
text-align: center;
line-height: 45px;
font-size: 18px;
background-color: #000;
}
#power_table {
width: 100%;
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(1) > button {
background-color: white;
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(2) > button {
background-color: white;
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(3) > button {
background-color: white;
}
div.atc_state {
background-color: #000;
height: 20px;
border: 1px solid white;
padding: 4px;
padding-left: 10px;
margin: 4px;
border-radius: 25px;
text-decoration: none;
}
#branch_button {
background-color: white;
}
div#nav_bar {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 40px;
border-bottom: 2px solid white;
padding: 5px;
z-index: 1;
background: black;
color: white;
}
div#itinerary_body {
position: absolute;
top: 50px;
width: 100%;
height: 100%;
}
img#aircraft_image {
max-width: 100%;
height: auto;
}
div#map_container {
position: fixed;
top: 50px;
width: 100%;
height: 100%;
}
.subtab_button {
width: 25%;
}
div#graphs_body {
position: absolute;
top: 50px;
width: 100%;
height: 100%;
}
div#graphs_body {
overflow: hidden;
}
img.graphs {
width: 80%;
height: 70%;
position: relative;
top: 5%;
left: 10%;
}
img.graphs_s {
width: 80%;
height: 40%;
position: relative;
left: 10%;
top: 30%
}
#arrow_back_graphs {
position: absolute;
left: 10px;
top: 40%;
}
#arrow_forward_graphs {
position: absolute;
right: 10px;
top: 40%;
}
html::-webkit-scrollbar {
display: none;
}
img#message_rate img#cpu_usage {
width: 50%
}
div#subtab_buttons>button {
width: 100px;
margin-left: 20px;
}
div#subtab_buttons {
position: fixed;
bottom: 0px;
width: 100%;
padding: 5px;
z-index: 1;
background: black;
}
div#map_canvas {
margin-right: 390px;
height: 100%;
}
div#sidebar_container {
position: absolute;
right: 0px;
top: 50px;
width: 390px;
height: 90%;
}
#nav_bar.divider {
width: 25px;
}
.pointer {
cursor: pointer;
}
.noselect {
-webkit-touch-callout: none;
/* iOS Safari */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Old versions of Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
user-select: none;
/* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */
}
.space {
padding-right: 20px;
padding-top: 0px;
padding-bottom: 0px;
margin: auto;
width: fit-content;
display: inline-block;
}
#planes_table > tr > td {
border-bottom: solid white .5px;
text-align: center;
}
.space-nopad {
margin: auto;
width: fit-content;
display: inline-block;
}
.center {
display: table-cell;
vertical-align: middle;
}
#radar_aircraft_tab {
line-height: 17px;
}
#img_button {
position: fixed;
right: 10%;
bottom: 50px;
}
#aircraft_button {
position: fixed;
right: 14%;
bottom: 49px;
}
#info_button {
position: absolute;
right: 10px;
bottom: 5px
}
#info_icon {
position: absolute;
right: 10px;
bottom: 5px
}
div#SpecialSquawkWarning {
position: absolute;
bottom: 25px;
right: 430px;
border: 2px solid red;
background-color: #FFFFA3;
opacity: 0.75;
filter: alpha(opacity=75);
padding: 5px;
text-align: center;
}
div#update_error {
position: absolute;
bottom: 25px;
left: 25px;
border: 2px solid red;
background-color: #FFFFA3;
opacity: 0.75;
filter: alpha(opacity=75);
padding: 5px;
text-align: center;
}
div#loader {
z-index: 99;
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: #000;
opacity: 1;
filter: alpha(opacity=100);
}
#spinny {
width: 128px;
height: 128px;
position: absolute;
top: 50%;
left: 50%;
margin: -64px 0 0 -64px;
}
#loader_progress {
width: 250px;
height: 20px;
position: absolute;
top: 50%;
left: 50%;
margin: 128px 0 0 -125px;
}
#tableinfo,
#sudo_buttons {
font-size: x-small;
font-family: monospace;
}
.vPosition {
font-weight: bold;
background-color: #d5ffd5;
}
.mlat {
font-weight: bold;
background-color: #d5d5ff;
}
.squawk7500 {
font-weight: bold;
background-color: #ff5555;
}
.squawk7600 {
font-weight: bold;
background-color: #00ffff;
}
.squawk7700 {
font-weight: bold;
background-color: #ffff00;
}
.selected {
background-color: #dddddd;
}
.plane_table_row {
cursor: pointer;
border: white;
background-color: black;
}
.hidden {
display: none;
}
.infoblock_heading {
font-size: larger;
}
.infoblock_heading a {
text-decoration: none;
color: blue;
font-size: x-small;
}
.infoblock_body {
font-size: medium;
}
#selected_icao {
font-size: x-small;
}
#selected_registration {
font-size: x-small;
}
#selected_icaotype {
font-size: x-small;
}
.dim {
opacity: 0.3;
filter: alpha(opacity=30);
/* For IE8 and earlier */
}
.pointer {
cursor: pointer;
}
td#icao {
font-size: medium;
}
td#flag {
font-size: medium;
}
td#flight {
font-size: medium;
}
td#squawk {
font-size: medium;
}
td#altitude {
font-size: medium;
}
td#speed {
font-size: medium;
}
td#distance {
font-size: medium;
}
td#track {
font-size: medium;
}
td#msgs {
font-size: medium;
}
td#seen {
font-size: medium;
}
#modal2_title {
font-size: 30px;
text-decoration: bold;
line-height: 40px;
}
#aircraft_name_css {
font-size: 30px;
line-height: 25px;
white-space: nowrap;
}
#modal3_title {
font-size: 30px;
text-decoration: bold;
line-height: 40px;
}
.material-icons.md-18 {
font-size: 18px;
}
.material-icons.md-24 {
font-size: 24px;
}
.material-icons.md-36 {
font-size: 36px;
}
.material-icons.md-48 {
font-size: 48px;
}
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 2;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 2% auto;
/* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 90%;
height: 80%
/* Could be more or less, depending on screen size */
}
/* The Close Button */
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
.logo {
display: block;
margin-left: auto;
margin-right: auto;
width: 80%;
margin-top: 10%;
}
.settingslogo {
display: block;
margin-left: auto;
margin-right: auto;
width: 40%;
margin-top: 2%;
}
.settingstext {
text-align: center;
margin-left: auto;
margin-right: auto;
}
.home_table {
margin-left: auto;
margin-right: auto;
width: 60%;
}
#home_page {
overflow: hidden;
}
#settings_page {
overflow: hidden;
}
#settingstext>table {
margin: auto;
}
#external_mode_button {
position: relative;
left: 50%;
right: 50%;
background-color: white;
}
#settingstext>table>tbody>tr>td {
padding: 15px;
}
#settingstext>table:nth-child(1)>tbody>tr:nth-child(3)>td {
position: relative;
top: 0;
left: -25%;
}
#settingstext>table:nth-child(1)>tbody>tr:nth-child(3)>td {
position: relative;
top: 0;
left: -25%;
}
#home_page>table>tbody>tr>td>img {
width: 100%;
}
#arrivals {
margin: auto;
width: fit-content;
display: inline-table;
padding: 5px;
}
#departures {
margin: auto;
width: fit-content;
display: inline-table;
padding: 5px;
}
#sch-arrivals {
margin: auto;
width: fit-content;
display: inline-table;
padding: 5px;
}
#sch-departures {
margin: auto;
width: fit-content;
display: inline-table;
padding: 5px;
}
.airportBoard {
border: white solid 2px;
}
#aircraft_image1 {
width: 100%;
}
#aircraft_image2 {
width: 24.5%;
position: absolute;
left: 5%;
bottom: 12%;
}
#aircraft_image3 {
width: 24.5%;
position: absolute;
left: 30.5%;
bottom: 12%;
}
#aircraft_image4 {
width: 24.5%;
position: absolute;
left: 56%;
bottom: 12%;
}
#itinerary_loading {
width: 100%;
position: fixed
}
#flight_progress_circle {
position: absolute;
right: 25%;
top: 10%;
}
#flight_progress_title {
position: absolute;
right: 5%;
top: 22%;
font-size: 18px;
}
#flight_progress_elapsed_title {
font-size: 18px;
position: absolute;
top: 40%;
left: 68%;
}
#flight_progress_remaining_title {
font-size: 18px;
position: absolute;
top: 53%;
left: 67%;
}
#flight_progress_time_title {
font-size: 18px;
position: absolute;
top: 66%;
left: 67%;
}
#flight_progress_elapsed_amount {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 45%;
left: 64%;
}
#flight_progress_remaining_amount {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 58%;
left: 64%;
}
#flight_progress_time_amount {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 71%;
left: 64%;
}
#aircraft_name_title {
font-size: 18px;
position: absolute;
top: 20%;
left: 66%;
}
#aircraft_model_title {
font-size: 18px;
position: absolute;
top: 33%;
left: 66%;
}
#aircraft_registration_title {
font-size: 18px;
position: absolute;
top: 46%;
left: 64%;
}
#aircraft_name_addl {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 25%;
left: 67%;
}
#aircraft_model {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 38%;
left: 69.5%;
}
#aircraft_registration {
font-size: 20px;
font-weight: bold;
position: absolute;
top: 51%;
left: 69%;
}
#external_connected {
width: 100%;
height: 100%;
background-color: black;
color: red;
text-align: center;
font-size: xx-large;
font-weight: bold;
}
#external_title {
animation: blinkingText 1s infinite;
position: absolute;
top: 55%;
left: 22%;
}
#external_image {
animation: blinkingText 1s infinite;
position: absolute;
top: 30%;
left: 43%;
}
@keyframes blinkingText {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
+841
View File
@@ -0,0 +1,841 @@
#aircraft_info_overlay {
color: rgba(255, 255, 255, .7);
font-size: large;
position: absolute;
top: 175px;
}
#aircraft_tab_background {
filter: brightness(50%);
height: 225px;
width: 400px;
}
#arrow_back_graphs {
left: 10px;
position: absolute;
top: 40%;
}
#arrow_forward_graphs {
position: absolute;
right: 10px;
top: 40%;
}
#atc_title,
#atc_location {
padding-left: 2px;
}
#audioControl {
position: absolute;
right: 25px;
top: 30px;
}
#battery {
font-size: 28px;
position: absolute;
right: 50px;
text-align: center;
top: 5px;
}
#expand_icon {
height: 10%;
position: absolute;
right: 0px;
top: 40%;
}
#external_connected {
background-color: black;
color: red;
font-size: xx-large;
font-weight: bold;
height: 100%;
text-align: center;
width: 100%;
}
#external_image {
animation: blinkingText 1s infinite;
left: 43%;
position: absolute;
top: 30%;
}
#button_background {
background-color: rgba(255, 255, 255, .7);
}
#external_mode_button {
left: 50%;
position: relative;
right: 50%;
background-color: rgba(255, 255, 255, .7);
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(1) > button
{
background-color: rgba(255, 255, 255, .7);
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(2) > button
{
background-color: rgba(255, 255, 255, .7);
}
#power_table > tbody > tr:nth-child(1) > td:nth-child(3) > button
{
background-color: rgba(255, 255, 255, .7);
}
#external_title {
animation: blinkingText 1s infinite;
left: 22%;
position: absolute;
top: 55%;
}
#home_page {
overflow: hidden;
}
#home_page>table>tbody>tr>td>img {
width: 100%;
}
#info_button {
bottom: 5px;
position: absolute;
right: 10px;
}
#info_icon {
bottom: 5px;
position: absolute;
right: 10px;
}
#lock_button {
background-color: rgba(0, 0, 0, .3);
line-height: 0%;
margin-bottom: -80px;
position: absolute;
right: 6px;
top: 181px;
z-index: 1;
z-index: 2;
}
#metar_loading {
top: 4px;
}
#percentage {
bottom: 0px;
font-size: 12px;
position: absolute;
right: 50px;
}
#planes_table {
cursor: pointer;
}
#planes_table>tr>td {
border-bottom: solid black .5px;
text-align: center;
}
#power_button {
position: absolute;
right: 4px;
top: 5px;
}
#power_modal>.modal-content {
background-color: rgba(0, 0, 0, 0.9);
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
font-size: 18px;
height: 30%;
left: 25%;
line-height: 45px;
position: absolute;
text-align: center;
top: 25%;
width: 50%;
}
#power_table {
width: 100%;
}
#selected_position {
left: 138px;
position: absolute;
top: 228px;
}
#settings_page {
overflow: hidden;
}
#settingstext>table {
margin: auto;
}
#settingstext>table:nth-child(1)>tbody>tr:nth-child(3)>td {
left: -25%;
position: relative;
top: 0;
}
#settingstext>table:nth-child(1)>tbody>tr:nth-child(3)>td {
left: -25%;
position: relative;
top: 0;
}
#settingstext>table>tbody>tr>td {
padding: 15px;
}
#sidebar_close {
color: rgba(255, 255, 255, .7);
cursor: pointer;
position: fixed;
right: 5px;
z-index: inherit;
}
#sidebar_open_button {
background-color: rgba(0, 0, 0, 0.8);
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
cursor: pointer;
height: 25%;
padding: 2px;
position: absolute;
right: 0;
top: 40%;
width: 25px;
z-index: 2;
}
#tableinfo,
#sudo_buttons {
font-family: monospace;
font-size: x-small;
}
#vol_down_button {
position: absolute;
right: 250px;
top: 5px;
}
#vol_up_button {
position: absolute;
right: 90px;
top: 5px;
}
#volume_text {
position: absolute;
right: 140px;
top: 17px;
}
.secondaryHeader th {
background-color: rgba(255, 255, 255, .7);
color: black;
font-weight: bolder;
text-transform: uppercase;
}
#itin_body {
background-color: rgba(0, 0, 0, .9);
}
.itinheader {
color: black;
font-weight: bolder;
padding-left: 25px;
text-transform: uppercase;
width: 100%;
}
.secondaryHeader th:nth-child(2) {
text-overflow: ellipsis;
white-space: nowrap;
width: 220px;
}
.airportBoard thead tr td:nth-child(2) {
overflow: hidden;
text-overflow: ellipsis;
text-transform: uppercase;
white-space: nowrap;
width: 200px;
}
.airportBoard thead tr td:nth-child(3) {
text-align: right;
}
.airportBoard thead tr td:nth-child(1) {
text-overflow: ellipsis;
white-space: nowrap;
width: 60px;
}
.airportBoard tbody tr td:nth-child(2) {
overflow: hidden;
text-overflow: ellipsis;
text-transform: uppercase;
white-space: nowrap;
width: 200px;
}
#itin_back_chart {
font-size: 16px;
position: absolute;
left: 5px;
top: 2px;
cursor: pointer;
}
.airportBoard tbody tr td:nth-child(3) {
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}
.airportBoard tbody tr td:nth-child(1) {
text-overflow: ellipsis;
white-space: nowrap;
width: 60px;
}
.secondaryHeader th:nth-child(1) {
text-overflow: ellipsis;
white-space: nowrap;
width: 65px;
}
.airportBoard {
color: rgba(255, 255, 255, .8);
table-layout: fixed;
width: 100%;
border: rgba(255, 255, 255, .7) solid 2px;
}
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
cursor: pointer;
text-decoration: none;
}
.hidden {
display: none;
}
.home_table {
margin-left: auto;
margin-right: auto;
width: 60%;
}
.infoblock_body {
font-size: medium;
}
.infoblock_heading {
font-size: larger;
}
.logo {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 10%;
width: 80%;
}
.material-icons.md-36 {
font-size: 36px;
}
.modal {
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.75);
display: none;
height: 100%;
left: 0;
overflow: auto;
position: fixed;
top: 0;
width: 100%;
z-index: 2;
}
.modal-content {
background-color: #fefefe;
border: 1px solid #888;
height: 80%;
margin: 2% auto;
padding: 20px;
width: 90%;
}
.noselect {
user-select: none;
}
.plane_table_row {
cursor: pointer;
background-color: rgba(0, 0, 0, .7);
border: rgba(255, 255, 255, .5);
}
.pointer {
cursor: pointer;
}
.pointer {
cursor: pointer;
}
.settingslogo {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 2%;
width: 40%;
}
.squawk7500 {
background-color: #ff5555;
font-weight: bold;
}
.squawk7600 {
background-color: #00ffff;
font-weight: bold;
}
.squawk7700 {
background-color: #ffff00;
font-weight: bold;
}
.vPosition {
background-color: #d5ffd5;
font-weight: bold;
}
div#graphs_body {
overflow: hidden;
}
div#graphs_body {
height: 100%;
position: absolute;
top: 50px;
width: 100%;
}
div#loader {
background: #000;
bottom: 0;
filter: alpha(opacity=100);
left: 0;
opacity: 1;
position: absolute;
right: 0;
top: 0;
z-index: 99;
}
div#map_canvas {
height: 100%;
margin-right: 0px;
}
div#map_container {
height: 100%;
position: fixed;
top: 0px;
width: 100%;
}
#planes_table > tr > td
{
border-bottom: solid rgba(255, 255, 255, .7) .5px;
text-align: center;
}
div#nav_bar {
color: rgba(255, 255, 255, .7);
background: rgba(0, 0, 0, 0.8);
border-radius: 5px;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 15px 0 rgba(255, 255, 255, 0.19);
height: 40px;
left: 10%;
padding: 5px;
position: fixed;
top: 5px;
width: 80%;
z-index: 1;
}
div#itin_nav_bar {
background: rgba(0, 0, 0, 0.8);
border-radius: 5px;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
height: 40px;
left: 10%;
padding: 5px;
position: fixed;
top: 5px;
width: 80%;
z-index: 1;
}
div#sidebar_container {
background-color: rgba(0, 0, 0, .9);
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
display: none;
height: 85%;
overflow: auto;
position: absolute;
right: 5px;
top: 60px;
width: 390px;
z-index: 1;
}
div#sidebar_container::-webkit-scrollbar {
display: none;
}
div#SpecialSquawkWarning {
background-color: #FFFFA3;
border: 2px solid red;
bottom: 25px;
filter: alpha(opacity=75);
opacity: 0.75;
padding: 5px;
position: absolute;
right: 430px;
text-align: center;
}
div#update_error {
background-color: #FFFFA3;
border: 2px solid red;
bottom: 25px;
filter: alpha(opacity=75);
left: 25px;
opacity: 0.75;
padding: 5px;
position: absolute;
text-align: center;
}
div.atc_state {
background-color: rgba(0, 0, 0, .1);
border: 1px solid rgba(255, 255, 255, .5);
color: rgba(255, 255, 255, .9);
align-items: center;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
display: flex;
float: left;
height: 50px;
justify-content: center;
margin: 8px;
margin-left: 15px;
overflow: hidden;
padding: 5px;
width: 24%;
}
#branch_button {
background-color: rgba(255, 255, 255, .7);
}
.itin_state {
align-items: center;
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
cursor: pointer;
display: flex;
float: left;
height: 50px;
justify-content: center;
margin: 8px;
margin-left: 15px;
overflow: hidden;
padding: 5px;
width: 24%;
}
.itin_header {
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
display: inline-block;
height: 50px;
line-height: 50px;
margin: 5px;
margin-left: 10px;
padding: 5px;
text-align: center;
width: 42%;
}
#itin_airport_name {
font-size: 46px;
font-weight: bold;
left: 5px;
position: absolute;
top: 15px;
}
#itin_arrivals {
bottom: 10px;
left: 10px;
position: absolute;
}
#itinerary_container {
background-color: rgba(255, 255, 255, .7);
}
#itin_back {
top: 72px;
left: 10px;
position: absolute;
background-color: rgba(255, 255, 255, .7);
}
#itin_departures {
bottom: 10px;
position: absolute;
right: 10px;
background-color: rgba(255, 255, 255, .7);
}
#itin_info button {
background-color: rgba(255, 255, 255, .7);
}
#itin_info {
color: rgba(255, 255, 255, .7);
}
#itin_img {
border-bottom-left-radius: 8px;
filter: brightness(50%);
height: 100%;
position: absolute;
right: 0px;
width: 100%;
}
#itin_airport_city {
font-size: 18px;
font-style: italic;
font-weight: 10;
position: absolute;
right: 30px;
top: 2px;
}
#itin_airport_loc {
font-weight: 10;
position: absolute;
right: 5px;
top: 25px;
}
#itin_airport_long_name {
font-size: 16px;
font-weight: 50;
left: 8px;
position: absolute;
top: 45px;
}
#atc_ready_state {
font-size: 50px;
left: 5px;
position: absolute;
top: 20px;
}
#atc_current_time {
left: 11px;
position: absolute;
top: 68px;
}
#atc_location {
left: 8px;
position: relative;
top: -25px;
}
#atc_title {
left: 25px;
position: relative;
top: -10px;
}
div.atc_header {
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
display: inline-block;
height: 50px;
line-height: 50px;
margin: 5px;
margin-left: 10px;
padding: 5px;
text-align: center;
width: 43%;
}
div.atc_header1 {
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.2), 0 6px 20px 0 rgba(255, 255, 255, 0.19);
display: inline-block;
height: 50px;
line-height: 50px;
margin: 5px;
padding: 5px;
text-align: center;
width: 28%;
}
#station_id,
#station_name,
#full_metar {
text-align: center;
}
#map_container {
color: black
}
#planes_table {
background-color: black;
cursor: pointer;
}
#metar_loading {
top: 4px;
}
#liveatc_button {
color: rgba(255, 255, 255, .8);
}
#metar_button {
color: rgba(255, 255, 255, .8);
}
#radar_button {
color: rgba(255, 255, 255, .8);
}
#home_button {
color:rgba(255, 255, 255, .7);
background-color: transparent;
}
#audioControl {
background-color: rgba(255, 255, 255, .5);
}
html,
body {
font-family: Tahoma, Sans-Serif;
font-size: 10pt;
height: 100%;
margin: 0;
padding: 0;
background-color: #000000;
color: rgba(255, 255, 255, .7);
}
html::-webkit-scrollbar {
display: none;
}
img#message_rate img#cpu_usage {
width: 50%;
}
img.graphs {
height: 70%;
left: 10%;
position: relative;
top: 5%;
width: 80%;
}
img.graphs_s {
height: 40%;
left: 10%;
position: relative;
top: 30%;
width: 80%;
}
td#altitude {
font-size: medium;
}
td#distance {
font-size: medium;
}
td#flag {
font-size: medium;
}
td#flight {
font-size: medium;
}
td#icao {
font-size: medium;
}
td#msgs {
font-size: medium;
}
td#seen {
font-size: medium;
}
td#speed {
font-size: medium;
}
td#squawk {
font-size: medium;
}
td#track {
font-size: medium;
}
File diff suppressed because it is too large Load Diff
+599 -732
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+7
View File
@@ -0,0 +1,7 @@
{
"Bing": "Avu1sIS7QCdoqq3MjgrRLTOpfkFgs0cTGY3JWozoIQ6hABYlefqSjPwsYWAR4ldJ",
"hereapi": "h2sjCSDN1ZHRMUx9stX8QtIzYjWvMdvZVEiimdLvcP8",
"AVWX": "2TFcLCOsNASt37yV-39PEHnAu9PD6eoJ05ihOYiW49w",
"AE": "0eadb2-55b342",
"GithubToken": "01880079ec4b1a5274dc0a6da9c233fd97c7f9e3"
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>
+5 -5
View File
@@ -1,6 +1,6 @@
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
<o:MainFile HRef="../information.html"/>
<o:File HRef="themedata.thmx"/>
<o:File HRef="colorschememapping.xml"/>
<o:File HRef="filelist.xml"/>
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
<o:MainFile HRef="../information.html"/>
<o:File HRef="themedata.thmx"/>
<o:File HRef="colorschememapping.xml"/>
<o:File HRef="filelist.xml"/>
</xml>
-305890
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
+21 -1
View File
@@ -7,7 +7,27 @@ function nearestStations(x, y) {
cache: false,
dataType: 'json',
});
FetchPending.done(function(data) {
FetchPending.done(function (data) {
var markerStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: 7,
snapToPixel: false,
fill: new ol.style.Fill({
color: 'green'
}),
stroke: new ol.style.Stroke({
color: 'black',
width: 2
})
})
});
var feature = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat([data.info.longitude, data.info.latitude])));
feature.setStyle(markerStyle);
lastMETAR = StaticFeatures.push(feature) - 1
if (lastMETAR === 1) {
StaticFeatures.removeAt(0)
}
document.getElementById('metar_loading').style.display = "none"
document.getElementById('metar_data').style.display = "block"
document.getElementById('station_id').innerHTML = data.station
+63 -30
View File
@@ -7,11 +7,11 @@
// API KEYS
var keys = {}
// API Keys
// API Keys
var xhr = new XMLHttpRequest();
xhr.open("GET", "tiles/keys.json", true);
xhr.open("GET", "information/keys.json", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
keys = JSON.parse(xhr.response)
}
@@ -20,14 +20,18 @@ xhr.send();
var ol3d
var cesuim_active = false
var internet_mode = 0
var lastMETAR = 0
var lastItin = 0
var liveATC = 0
var exclude = 1
var text_labels = 1
var country_names = {}
var xhr1 = new XMLHttpRequest();
xhr1.open("GET", "json/country_names.json", true);
xhr1.setRequestHeader('Content-Type', 'application/json');
xhr1.onreadystatechange = function() {
xhr1.onreadystatechange = function () {
if (xhr1.readyState === 4) {
country_names = JSON.parse(xhr1.response)
}
@@ -36,25 +40,25 @@ xhr1.send();
var flight_info = {}
var TAB = "Radar"
var DateTime = luxon.DateTime;
//var DateTime = luxon.DateTime;
var graph_types = ["/dump1090-localhost-local_trailing_rate-", "/dump1090-localhost-aircraft-", "/dump1090-localhost-tracks-", "/dump1090-localhost-signal-", "/dump1090-localhost-local_rate-", "/dump1090-localhost-aircraft_message_rate-", "/dump1090-localhost-cpu-", "/system-localhost-cpu-", "/system-localhost-temperature-", "/system-localhost-memory-", "/system-localhost-network_bandwidth-", "/system-localhost-df_root-", "/system-localhost-disk_io_iops-", "/system-localhost-disk_io_octets-"]
/* var graph_types = {
"ADSB Message Rate": "/dump1090-localhost-local_trailing_rate-",
"Aircraft Seen": "/dump1090-localhost-aircraft-",
"Track's Seen (8 Minute Moving Average)": "/dump1090-localhost-tracks-",
"Signal Level": "/dump1090-localhost-signal-",
"ADS-B Maxima": "dump1090-localhost-local_rate-",
"Message Rate / Aircraft": "/dump1090-localhost-aircraft_message_rate-",
"ADS-B CPU Usage": "/dump1090-localhost-cpu-",
"Overall CPU Usage": "/system-localhost-cpu-",
"Max Core Temp": "/system-localhost-temperature-",
"Memory Usage": "/system-localhost-memory-",
"Bandwidth Usage": "/system-localhost-network_bandwidth-",
"Disk Usage": "/system-localhost-df_root-",
"Disk I/O - IOPS": "/system-localhost-disk_io_iops-",
"Disk I/O - Bandwidth": "/system-localhost-disk_io_octets-"
/* var graph_types = {
"ADSB Message Rate": "/dump1090-localhost-local_trailing_rate-",
"Aircraft Seen": "/dump1090-localhost-aircraft-",
"Track's Seen (8 Minute Moving Average)": "/dump1090-localhost-tracks-",
"Signal Level": "/dump1090-localhost-signal-",
"ADS-B Maxima": "dump1090-localhost-local_rate-",
"Message Rate / Aircraft": "/dump1090-localhost-aircraft_message_rate-",
"ADS-B CPU Usage": "/dump1090-localhost-cpu-",
"Overall CPU Usage": "/system-localhost-cpu-",
"Max Core Temp": "/system-localhost-temperature-",
"Memory Usage": "/system-localhost-memory-",
"Bandwidth Usage": "/system-localhost-network_bandwidth-",
"Disk Usage": "/system-localhost-df_root-",
"Disk I/O - IOPS": "/system-localhost-disk_io_iops-",
"Disk I/O - Bandwidth": "/system-localhost-disk_io_octets-"
} */
} */
var starting_graph = 0
// -- Title Settings --------------------------------------
@@ -97,10 +101,18 @@ SiteName = "My Radar Site"; // tooltip of the marker
// All color values are given as Hue (0-359) / Saturation (0-100) / Lightness (0-100)
ColorByAlt = {
// HSL for planes with unknown altitude:
unknown: { h: 0, s: 0, l: 40 },
unknown: {
h: 0,
s: 0,
l: 40
},
// HSL for planes that are on the ground:
ground: { h: 120, s: 100, l: 30 },
ground: {
h: 120,
s: 100,
l: 30
},
air: {
// These define altitude-to-hue mappings
@@ -116,22 +128,43 @@ ColorByAlt = {
// hue of the first entry; altitudes above
// the last entry use the hue of the last
// entry.
h: [{ alt: 2000, val: 20 }, // orange
{ alt: 10000, val: 140 }, // light green
{ alt: 40000, val: 300 }
h: [{
alt: 2000,
val: 20
}, // orange
{
alt: 10000,
val: 140
}, // light green
{
alt: 40000,
val: 300
}
], // magenta
s: 85,
l: 50,
},
// Changes added to the color of the currently selected plane
selected: { h: 0, s: -10, l: +20 },
selected: {
h: 0,
s: -10,
l: +20
},
// Changes added to the color of planes that have stale position info
stale: { h: 0, s: -10, l: +30 },
stale: {
h: 0,
s: -10,
l: +30
},
// Changes added to the color of planes that have positions from mlat
mlat: { h: 0, s: -10, l: -10 }
mlat: {
h: 0,
s: -10,
l: -10
}
};
// For a monochrome display try this:
+71 -375
View File
@@ -1,376 +1,72 @@
// Generic update function for radar subtabs
function updateFlightTab() {
if (flight_info[SelectedPlane]) {
$.getJSON('json/airlines.json', function (world_airlines) {
$.getJSON('json/world_airports.json', function (world_airports) {
$.getJSON('json/airplanes.json', function (aircraft_information) {
var flightdata = flight_info[SelectedPlane]
var scheduledata = flight_info[SelectedPlane].schedule
flightInfo(flightdata, world_airports, world_airlines)
flightProgress(flightdata, world_airports, scheduledata)
getAircraftInfo(aircraft_information, flightdata)
getPlaneImage(flightdata)
document.getElementById("radar_flight_info").style.display = "block"
document.getElementById("radar_flight_loading").style.display = "none"
document.getElementById("radar_aircraft_info").style.display = "block"
document.getElementById("radar_aircraft_loading").style.display = "none"
})
});
});
} else {
if (internet_mode) {
$.getJSON('json/airlines.json', function (world_airlines) {
$.getJSON('json/world_airports.json', function (world_airports) {
$.getJSON('json/airplanes.json', function (aircraft_information) {
// Planes[SelectedPlane] gives
document.getElementById("flight_progress_div").style.display = "none"
document.getElementById('additional_info_hidden').style.display = "none"
document.getElementById("img_button").disabled = true
document.getElementById("radar_aircraft_tab_button").disabled = true
document.getElementById("flight_airport_long_destination").innerHTML = "N/A"
document.getElementById("flight_airport_short_destination").innerHTML = "N/A"
document.getElementById("flight_airport_loc_destination").innerHTML = "N/A"
document.getElementById("flight_airport_long_origin").innerHTML = "N/A"
document.getElementById("flight_airport_short_origin").innerHTML = "N/A"
document.getElementById("flight_airport_loc_origin").innerHTML = "N/A"
for (element in internet_mode_data) {
if (internet_mode_data[element].hex === SelectedPlane) {
var data = internet_mode_data[element]
console.log(internet_mode_data[element])
if (data.airline != "") {
document.getElementById("flight_flightnum").innerHTML = data.flight.replace(/\D/g, "")
document.getElementById("flight_status").innerHTML = ""
document.getElementById("flight_flighticaonum").innerHTML = data.flight
try {
document.getElementById("flight_airline").innerHTML = world_airlines[data.airline].nameAirline + " "
} catch {
document.getElementById("flight_airline").innerHTML = "N/A "
}
} else {
//document.getElementById("flight_flightnum").innerHTML = data.flight.replace(/\D/g, "")
document.getElementById("flight_status").innerHTML = ""
document.getElementById("flight_flightnum").innerHTML = ""
document.getElementById("flight_flighticaonum").innerHTML = data.flight
document.getElementById("flight_airline").innerHTML = data.flight
}
for (airport_search in world_airports) {
if (world_airports[airport_search].iata === internet_mode_data[element].arr && internet_mode_data[element].arr != "") {
var airport = world_airports[airport_search]
try {
document.getElementById("flight_airport_long_destination").innerHTML = airport.name
document.getElementById("flight_airport_short_destination").innerHTML = airport.icao
document.getElementById("flight_airport_loc_destination").innerHTML = airport.city + ", " + country_names[airport.country]
} catch {
document.getElementById("flight_airport_long_destination").innerHTML = "N/A"
document.getElementById("flight_airport_short_destination").innerHTML = "N/A"
document.getElementById("flight_airport_loc_destination").innerHTML = "N/A"
}
} else if (internet_mode_data[element].arr === "") {
document.getElementById("flight_airport_long_destination").innerHTML = "N/A"
document.getElementById("flight_airport_short_destination").innerHTML = "N/A"
document.getElementById("flight_airport_loc_destination").innerHTML = "N/A"
}
if (world_airports[airport_search].iata === internet_mode_data[element].dep && internet_mode_data[element].dep != "") {
var airport = world_airports[airport_search]
try {
document.getElementById("flight_airport_long_origin").innerHTML = airport.name
document.getElementById("flight_airport_short_origin").innerHTML = airport.icao
document.getElementById("flight_airport_loc_origin").innerHTML = airport.city + ", " + country_names[airport.country]
} catch {
document.getElementById("flight_airport_long_origin").innerHTML = "N/A"
document.getElementById("flight_airport_short_origin").innerHTML = "N/A"
document.getElementById("flight_airport_loc_origin").innerHTML = "N/A"
}
} else if (internet_mode_data[element].dep === "") {
document.getElementById("flight_airport_long_origin").innerHTML = "N/A"
document.getElementById("flight_airport_short_origin").innerHTML = "N/A"
document.getElementById("flight_airport_loc_origin").innerHTML = "N/A"
}
}
}
}
document.getElementById("radar_flight_info").style.display = "block"
document.getElementById("radar_flight_loading").style.display = "none"
document.getElementById("radar_aircraft_info").style.display = "block"
document.getElementById("radar_aircraft_loading").style.display = "none"
})
});
});
} else {
$.getJSON("https://aviation-edge.com/v2/public/flights?key=" + keys['AE'] + "&aircraftIcao24=" + SelectedPlane, function (flightdata) {
flightdata = flightdata[0]
$.getJSON("https://aviation-edge.com/v2/public/timetable?key=" + keys['AE'] + "&flight_icao=" + flightdata.flight.icaoNumber + "&status=active", function (scheduledata) {
scheduledata = scheduledata[0]
$.getJSON('json/airlines.json', function (world_airlines) {
$.getJSON('json/world_airports.json', function (world_airports) {
$.getJSON('json/airplanes.json', function (aircraft_information) {
flight_info[SelectedPlane] = flightdata
flight_info[SelectedPlane].schedule = scheduledata
flight_info[SelectedPlane].aircraft.information = aircraft_information[flightdata.aircraft.iataCode]
flightInfo(flightdata, world_airports, world_airlines)
flightProgress(flightdata, world_airports, scheduledata)
getAircraftInfo(aircraft_information, flightdata)
getPlaneImage(flightdata)
document.getElementById("radar_flight_info").style.display = "block"
document.getElementById("radar_flight_loading").style.display = "none"
document.getElementById("radar_aircraft_info").style.display = "block"
document.getElementById("radar_aircraft_loading").style.display = "none"
document.getElementById("img_button").disabled = false
})
});
});
});
});
}
}
}
// handles information of flight itself
function flightInfo(data, world_airports, world_airlines) {
try {
document.getElementById("flight_flightnum").innerHTML = data.flight.number
document.getElementById("flight_status").innerHTML = toTitleCase(data.status)
document.getElementById("flight_flighticaonum").innerHTML = data.flight.icaoNumber
try {
document.getElementById("flight_airport_long_origin").innerHTML = world_airports[data.departure.icaoCode].name
document.getElementById("flight_airport_short_origin").innerHTML = data.departure.icaoCode
document.getElementById("flight_airport_loc_origin").innerHTML = world_airports[data.departure.icaoCode].city + ", " + country_names[world_airports[data.departure.icaoCode].country]
} catch {
document.getElementById("flight_airport_long_origin").innerHTML = "N/A"
document.getElementById("flight_airport_short_origin").innerHTML = "N/A"
document.getElementById("flight_airport_loc_origin").innerHTML = "N/A"
}
try {
document.getElementById("flight_airport_long_destination").innerHTML = world_airports[data.arrival.icaoCode].name
document.getElementById("flight_airport_short_destination").innerHTML = data.arrival.icaoCode
document.getElementById("flight_airport_loc_destination").innerHTML = world_airports[data.arrival.icaoCode].city + ", " + country_names[world_airports[data.arrival.icaoCode].country]
} catch {
document.getElementById("flight_airport_long_destination").innerHTML = "N/A"
document.getElementById("flight_airport_short_destination").innerHTML = "N/A"
document.getElementById("flight_airport_loc_destination").innerHTML = "N/A"
}
try {
document.getElementById("flight_airline").innerHTML = world_airlines[data.airline.icaoCode].nameAirline + " "
} catch {
document.getElementById("flight_airline").innerHTML = "N/A "
}
} catch {
radarRadarTabSwitch()
document.getElementById("radar_flight_tab_button").disabled = true
document.getElementById("radar_aircraft_tab_button").disabled = true
}
}
// get's aircraft information
function getAircraftInfo(aircraft_information, data) {
var aircraft = aircraft_information[data.aircraft.iataCode]
if (aircraft) {
document.getElementById("aircraft_name").innerHTML = aircraft.productionLine
document.getElementById("aircraft_name_addl").innerHTML = aircraft.productionLine
document.getElementById("aircraft_model").innerHTML = aircraft.modelCode
document.getElementById("aircraft_registration").innerHTML = aircraft.numberRegistration
document.getElementById("aircraft_engine").innerHTML = aircraft.enginesType
document.getElementById("aircraft_engine_count").innerHTML = aircraft.enginesCount
document.getElementById("aircraft_status").innerHTML = toTitleCase(aircraft.planeStatus)
document.getElementById("aircraft_age").innerHTML = aircraft.planeAge
if (aircraft.rolloutDate) {
document.getElementById("aircraft_rollout_date").innerHTML = DateTime.fromISO(aircraft.rolloutDate).toLocaleString("DATE_SHORT")
}
if (aircraft.firstFlight) {
document.getElementById("aircraft_first_flight").innerHTML = DateTime.fromISO(aircraft.firstFlight).toLocaleString("DATE_SHORT")
}
} else {
radarRadarTabSwitch()
document.getElementById("radar_aircraft_tab_button").disabled = true
}
}
// Flight's current progress
function flightProgress(flightdata, world_airports, data) {
try {
arrival_timezone = world_airports[data.arrival.icaoCode].tz
departure_timezone = world_airports[data.departure.icaoCode].tz
if (data.departure.actualTime) {
departure_time = DateTime.fromISO(data.departure.actualTime, {
zone: departure_timezone
});
} else if (data.departure.estimatedTime) {
departure_time = DateTime.fromISO(data.departure.estimatedTime, {
zone: departure_timezone
});
} else if (data.departure.scheduledTime) {
departure_time = DateTime.fromISO(data.departure.scheduledTime, {
zone: departure_timezone
});
}
if (data.arrival.actualTime) {
arrival_time = DateTime.fromISO(data.arrival.actualTime, {
zone: arrival_timezone
});
} else if (data.arrival.estimatedTime) {
arrival_time = DateTime.fromISO(data.arrival.estimatedTime, {
zone: arrival_timezone
});
} else if (data.arrival.scheduledTime) {
arrival_time = DateTime.fromISO(data.arrival.scheduledTime, {
zone: arrival_timezone
});
}
arrival_time = arrival_time.setZone("America/New_York")
departure_time = departure_time.setZone("America/New_York")
document.getElementById("flight_depart_time").innerHTML = departure_time.toLocaleString(DateTime.DATETIME_MED)
document.getElementById("flight_arrival_time").innerHTML = arrival_time.toLocaleString(DateTime.DATETIME_MED)
var trip_progress = getTripProgress(arrival_time, departure_time)
document.getElementById("flight_percentage_spinner").innerHTML = trip_progress + "%"
document.getElementById("flight_progress_circle").setAttribute("class", "progress-circle p" + trip_progress)
flight_info[SelectedPlane].schedule.progress = trip_progress
getFlightPlanImage(flightdata, trip_progress, world_airports)
document.getElementById("flight_progress_div").style.display = "block"
document.getElementById('additional_info_hidden').style.display = "block"
if (data.departure.terminal) {
document.getElementById("flight_depart_terminal").innerHTML = data.departure.terminal
}
if (data.departure.gate) {
document.getElementById("flight_depart_gate").innerHTML = data.departure.gate
}
if (data.arrival.terminal) {
document.getElementById("flight_arrival_terminal").innerHTML = data.arrival.terminal
}
if (data.arrival.gate) {
document.getElementById("flight_arrival_gate").innerHTML = data.arrival.gate
}
} catch {
document.getElementById("flight_progress_div").style.display = "none"
document.getElementById('additional_info_hidden').style.display = "none"
getFlightPlanImage(flightdata, 1, world_airports)
}
}
//Flight progress percentage
function getTripProgress(arrival_time, departure_time) {
var current_time = DateTime.local();
var total_time = arrival_time.diff(departure_time);
var time_elapsed = current_time.diff(departure_time);
var trip_progress = ((time_elapsed * 100) / total_time).toFixed(0)
var time_remaining = arrival_time.diff(current_time);
document.getElementById("flight_progress").MaterialProgress.setProgress(trip_progress);
if (time_remaining.days != 0) {
document.getElementById("flight_progress_remaining_amount").innerHTML = time_remaining.toFormat("o 'Day(s), ' h 'Hour(s), ' m 'Minute(s)'")
} else {
document.getElementById("flight_progress_remaining_amount").innerHTML = time_remaining.toFormat("h 'Hour(s), ' m 'Minute(s)'")
}
if (time_elapsed.days != 0) {
document.getElementById("flight_progress_elapsed_amount").innerHTML = time_elapsed.toFormat("o 'Day(s), ' h 'Hour(s), ' m 'Minute(s)'")
} else {
document.getElementById("flight_progress_elapsed_amount").innerHTML = time_elapsed.toFormat("h 'Hour(s), ' m 'Minute(s)'")
}
if (total_time.days != 0) {
document.getElementById("flight_progress_time_amount").innerHTML = total_time.toFormat("o 'Day(s), ' h 'Hour(s), ' m 'Minute(s)'")
} else {
document.getElementById("flight_progress_time_amount").innerHTML = total_time.toFormat("h 'Hour(s), ' m 'Minute(s)'")
}
return trip_progress
}
// Get image of aircraft
function getPlaneImage(flightdata) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://127.0.0.1:5000/cmd", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var page_nodes = $($.parseHTML(xhr.response));
var img1 = page_nodes.find("#results > div:nth-child(1) > div.result__section.result__section--photo-wrapper > a > img")
var img2 = page_nodes.find("#results > div:nth-child(3) > div.result__section.result__section--photo-wrapper > a > img")
var img3 = page_nodes.find("#results > div:nth-child(4) > div.result__section.result__section--photo-wrapper > a > img")
var img4 = page_nodes.find("#results > div:nth-child(5) > div.result__section.result__section--photo-wrapper > a > img")
if (img2) {
document.getElementById("aircraft_image2").setAttribute('src', img2.attr('src'))
flight_info[SelectedPlane].aircraft.imageurl2 = img2.attr('src')
document.getElementById("aircraft_image3").style.display = "block"
} else {
document.getElementById("aircraft_image2").style.display = "none"
}
if (img3) {
document.getElementById("aircraft_image3").setAttribute('src', img3.attr('src'))
flight_info[SelectedPlane].aircraft.imageurl3 = img3.attr('src')
document.getElementById("aircraft_image3").style.display = "block"
} else {
document.getElementById("aircraft_image3").style.display = "none"
}
if (img4) {
document.getElementById("aircraft_image4").style.display = "block"
document.getElementById("aircraft_image4").setAttribute('src', img4.attr('src'))
flight_info[SelectedPlane].aircraft.imageurl4 = img4.attr('src')
} else {
document.getElementById("aircraft_image4").style.display = "none"
}
document.getElementById("aircraft_image1").setAttribute('src', img1.attr('src'))
document.getElementById("aircraft_image1-1").setAttribute('src', img1.attr('src'))
flight_info[SelectedPlane].aircraft.imageurl1 = img1.attr('src')
return
}
}
xhr.send(JSON.stringify({
command: "curl https://www.jetphotos.com/photo/keyword/" + flightdata.aircraft.regNumber
}));
}
// get image of whole flight path
function getFlightPlanImage(data, flight_progress, world_airports) {
try {
departure_timezone = world_airports[data.departure.icaoCode].tz
/*
if (data.departure.actualTime) {
departure_time = DateTime.fromISO(data.departure.actualTime, {
zone: departure_timezone
});
} else if (data.departure.estimatedTime) {
departure_time = DateTime.fromISO(data.departure.estimatedTime, {
zone: departure_timezone
});
} else if (data.departure.scheduledTime) {
departure_time = DateTime.fromISO(data.departure.scheduledTime, {
zone: departure_timezone
});
}
*/
departure_time = DateTime.local();
var dep_date = departure_time.toFormat('yyyyMMdd')
document.getElementById("progress_image").setAttribute("src", "https://www.flightview.com/fvPublicSiteFT/FlightViewCGI.exe?qtype=gif&acid=" + data.flight.iataNumber + "&depap=" + data.departure.iataCode + "&arrap=" + data.arrival.iataCode + "&depdate=" + dep_date + "&pctcomplete=" + flight_progress)
flight_info[SelectedPlane].flightimage = "https://www.flightview.com/fvPublicSiteFT/FlightViewCGI.exe?qtype=gif&acid=" + data.flight.iataNumber + "&depap=" + data.departure.iataCode + "&arrap=" + data.arrival.iataCode + "&depdate=" + dep_date + "&pctcomplete=" + flight_progress
document.getElementById("img_button").disabled = false
} catch {
document.getElementById("image_modal").style.display = "none"
document.getElementById("img_button").disabled = true
}
}
function setBigImage(source) {
var source_url = document.getElementById(source).getAttribute("src")
var dest_url = document.getElementById("aircraft_image1-1").getAttribute("src")
document.getElementById("aircraft_image1-1").setAttribute("src", source_url)
document.getElementById(source).setAttribute("src", dest_url)
// Generic update function for radar subtabs
function updateFlightTab() {
if (internet_mode) {
$.getJSON('json/airlines.json', function (world_airlines) {
$.getJSON('json/world_airports.json', function (world_airports) {
$.getJSON('json/airplanes.json', function (aircraft_information) {
// Planes[SelectedPlane] gives
document.getElementById("flight_airport_long_destination").innerHTML = ""
document.getElementById("flight_airport_short_destination").innerHTML = ""
document.getElementById("flight_airport_loc_destination").innerHTML = ""
document.getElementById("flight_airport_long_origin").innerHTML = ""
document.getElementById("flight_airport_short_origin").innerHTML = ""
document.getElementById("flight_airport_loc_origin").innerHTML = ""
for (element in internet_mode_data) {
if (internet_mode_data[element].hex === SelectedPlane) {
var data = internet_mode_data[element]
if (data.airline != "") {
document.getElementById("flight_flightnum").innerHTML = data.flight.replace(/\D/g, "")
try {
document.getElementById("flight_airline").innerHTML = world_airlines[data.airline].nameAirline + " "
} catch {
document.getElementById("flight_airline").innerHTML = "N/A "
}
} else {
//document.getElementById("flight_flightnum").innerHTML = data.flight.replace(/\D/g, "")
document.getElementById("flight_flightnum").innerHTML = ""
document.getElementById("flight_airline").innerHTML = data.flight
}
for (airport_search in world_airports) {
if (world_airports[airport_search].iata === internet_mode_data[element].arr && internet_mode_data[element].arr != "") {
var airport = world_airports[airport_search]
try {
document.getElementById("flight_airport_long_destination").innerHTML = airport.name
document.getElementById("flight_airport_short_destination").innerHTML = airport.icao
document.getElementById("flight_airport_loc_destination").innerHTML = airport.city + ", " + country_names[airport.country]
} catch {
document.getElementById("flight_airport_long_destination").innerHTML = ""
document.getElementById("flight_airport_short_destination").innerHTML = ""
document.getElementById("flight_airport_loc_destination").innerHTML = ""
}
} else if (internet_mode_data[element].arr === "") {
document.getElementById("flight_airport_long_destination").innerHTML = ""
document.getElementById("flight_airport_short_destination").innerHTML = ""
document.getElementById("flight_airport_loc_destination").innerHTML = ""
}
if (world_airports[airport_search].iata === internet_mode_data[element].dep && internet_mode_data[element].dep != "") {
var airport = world_airports[airport_search]
try {
document.getElementById("flight_airport_long_origin").innerHTML = airport.name
document.getElementById("flight_airport_short_origin").innerHTML = airport.icao
document.getElementById("flight_airport_loc_origin").innerHTML = airport.city + ", " + country_names[airport.country]
} catch {
document.getElementById("flight_airport_long_origin").innerHTML = ""
document.getElementById("flight_airport_short_origin").innerHTML = ""
document.getElementById("flight_airport_loc_origin").innerHTML = ""
}
} else if (internet_mode_data[element].dep === "") {
document.getElementById("flight_airport_long_origin").innerHTML = ""
document.getElementById("flight_airport_short_origin").innerHTML = ""
document.getElementById("flight_airport_loc_origin").innerHTML = ""
}
}
}
}
})
});
});
}
}
+3 -5
View File
@@ -68,9 +68,6 @@ function createBaseLayers() {
})
}))
if (ChartBundleLayers) {
var chartbundleTypes = {
sec: "Sectional Charts",
@@ -134,6 +131,7 @@ function createBaseLayers() {
name: 'Radar',
title: 'Radar',
type: 'overlay',
visible: false
});
online.push(radar);
@@ -143,7 +141,7 @@ function createBaseLayers() {
apiRequest.open("GET", "https://api.rainviewer.com/public/maps.json", true);
apiRequest.onload = function(e) {
// save available timestamps and show the latest frame: "-1" means "timestamp.lenght - 1"
// save available timestamps and show the latest frame: "-1" means "timestamp.length - 1"
timestamps = JSON.parse(apiRequest.response);
radar.setSource(new ol.source.XYZ({
@@ -159,7 +157,7 @@ function createBaseLayers() {
if (online.length > 0) {
layers.push(new ol.layer.Group({
name: 'Online Maps',
title: 'Worldwide Online Maps + Overlays',
title: 'Worldwide Online Maps/Overlays',
fold: 'open',
layers: online
}));
+59 -93
View File
@@ -1,5 +1,16 @@
function playPLS(url, title) {
window.setInterval(function () {
if (document.getElementById("player").readyState === 3 || document.getElementById("player").readyState === 4) {
document.getElementById("atc_ready_state").style.color = "green"
} else {
document.getElementById("atc_ready_state").style.color = "red"
}
var time = document.getElementById("player").currentTime
document.getElementById("atc_current_time").innerHTML = HHMMSS(time)
}, 1000)
document.getElementById("atc_spacer").style.display = "block"
document.getElementById("atc_ready_state").style.display = "block"
document.getElementById("atc_current_time").style.display = "block"
document.getElementById("audioControl").style.display = "block"
document.getElementById("atc_location").innerHTML = ""
document.getElementById("atc_location").style.display = "block"
@@ -10,9 +21,31 @@ function playPLS(url, title) {
var city = world_airports[airport].city
var state = world_airports[airport].state
document.getElementById("atc_location").innerHTML = city + ", " + state
// MAP MARKER INFO
var markerStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: 7,
snapToPixel: false,
fill: new ol.style.Fill({
color: 'blue'
}),
stroke: new ol.style.Stroke({
color: 'black',
width: 2
})
})
});
var feature = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat([world_airports[airport].lon, world_airports[airport].lat])));
feature.setStyle(markerStyle);
lastATC = StaticFeatures.push(feature) - 1
if (lastATC === 1) {
StaticFeatures.removeAt(0)
}
// PLS INFO
const proxyurl = "http://" + window.location.hostname + ":7000/";
var request = $.ajax({
url: 'json/liveatc.json',
url: 'information/liveatc.json',
timeout: 5000,
cache: true,
dataType: 'json'
@@ -43,32 +76,11 @@ function playPause() {
document.getElementById("audioControl_icon").innerHTML = "play_arrow"
}
}
/*
function playPLS(url, title) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://127.0.0.1:5000/cmd", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
var response = xhr.response
response = response.split('\n')
response = response[1]
response = response.substring(6, data.length)
document.getElementById("player").setAttribute("src", url)
document.getElementById("player").load()
document.getElementById("atc_title").innerHTML = title
document.getElementById("player").play()
}
}
xhr.send(JSON.stringify({
command: "curl http://www.liveatc.net"+url
}));
}
*/
function listStations() {
document.getElementById("atc_selector").innerHTML = ""
var request = $.ajax({
url: 'json/liveatc.json',
url: 'information/liveatc.json',
timeout: 5000,
cache: true,
dataType: 'json'
@@ -93,20 +105,20 @@ function selectState(state) {
document.getElementById("atc_selector").innerHTML = ""
var node = document.createElement("div")
node.setAttribute("id", "atc_" + state)
node.setAttribute("class", "atc_state noselect pointer")
node.setAttribute("class", "atc_header noselect pointer")
node.setAttribute("onmousedown", "listStations()")
node.innerHTML = "<b>Go Back</b>"
document.getElementById("atc_selector").appendChild(node)
var node = document.createElement("div")
node.setAttribute("id", "atc_" + state)
node.setAttribute("class", "atc_state noselect")
node.setAttribute("class", "atc_header noselect")
node.setAttribute("onmousedown", "selectState('" + state + "')")
node.innerHTML = "<b>" + state + "</b>"
document.getElementById("atc_selector").appendChild(node)
var node = document.createElement("hr")
document.getElementById("atc_selector").appendChild(node)
var request = $.ajax({
url: 'json/liveatc.json',
url: 'information/liveatc.json',
timeout: 5000,
cache: true,
dataType: 'json'
@@ -136,24 +148,24 @@ function selectAirport(airport, state) {
document.getElementById("atc_selector").innerHTML = ""
var node = document.createElement("div")
node.setAttribute("id", "atc_" + state)
node.setAttribute("class", "atc_state noselect pointer")
node.setAttribute("class", "atc_header1 noselect pointer")
node.setAttribute("onmousedown", "selectState('" + state + "')")
node.innerHTML = "<b>Go Back</b>"
document.getElementById("atc_selector").appendChild(node)
var node = document.createElement("div")
node.setAttribute("id", "atc_" + state)
node.setAttribute("class", "atc_state noselect")
node.setAttribute("class", "atc_header1 noselect")
node.innerHTML = "<b>" + state + "</b>"
document.getElementById("atc_selector").appendChild(node)
var node = document.createElement("div")
node.setAttribute("id", "atc_" + airport)
node.setAttribute("class", "atc_state noselect")
node.setAttribute("class", "atc_header1 noselect")
node.innerHTML = "<b id='atc_airport_code'>" + airport + "</b>"
document.getElementById("atc_selector").appendChild(node)
var node = document.createElement("hr")
document.getElementById("atc_selector").appendChild(node)
var request = $.ajax({
url: 'json/liveatc.json',
url: 'information/liveatc.json',
timeout: 5000,
cache: true,
dataType: 'json'
@@ -173,69 +185,23 @@ function selectAirport(airport, state) {
node.innerHTML = "<br><br><br>"
document.getElementById("atc_selector").appendChild(node)
})
}
//DEPRACATED - NOT USED - GENERATES FILE
function startPulling() {
var json = {}
function HHMMSS(time) {
var sec_num = parseInt(time, 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60);
FetchPending = $.ajax({
url: 'json/us_airports.json',
timeout: 5000,
cache: false,
dataType: 'json',
});
FetchPending.done(function (data) {
var us_airports = data
for (state in us_airports) {
for (airport in us_airports[state].airports) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://127.0.0.1:5000/cmd", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
console.log(xhr.response)
let a = $(data);
if (json[airport_json[airport].state]) {
} else {
json[airport_json[airport].state] = {}
}
if (json[airport_json[airport].state].airports) {
} else {
json[airport_json[airport].state].airports = {}
}
if (a('font.body > font[color="red"]').html()) {
json[airport_json[airport].state].airports[airport].feeds = "ERROR"
} else {
var feedName = a('table.body > tbody > tr > td[bgcolor="lightblue"]');
n = 0
json[airport_json[airport].state].airports[airport].feeds = {}
json[airport_json[airport].state].airports[airport].name = airport_json[airport].name
for (b in feedName) {
let title = a(b).find("strong").text();
json[airport_json[airport].state].airports[airport].feeds[n] = {}
json[airport_json[airport].state].airports[airport].feeds[n].name = title
n++
}
var pageurl = a('table.body > tbody > tr:nth-child(4) > td')
i = 0
for (url in pageurl) {
let title = a(url).find("a").attr('href');
if (title) {
json[airport_json[airport].state].airports[airport].feeds[i].url = title
i++
}
}
}
}
}
xhr.send(JSON.stringify({
command: "https://www.liveatc.net/search/?icao=" + airport
}));
}
}
})
if (hours < 10) {
hours = "0" + hours;
}
if (minutes < 10) {
minutes = "0" + minutes;
}
if (seconds < 10) {
seconds = "0" + seconds;
}
return hours + ':' + minutes + ':' + seconds;
}
-1
View File
File diff suppressed because one or more lines are too long
+694
View File
@@ -0,0 +1,694 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('ol/control/Control'), require('ol/Observable'), require('ol/layer/Group')) :
typeof define === 'function' && define.amd ? define(['ol/control/Control', 'ol/Observable', 'ol/layer/Group'], factory) :
(global.LayerSwitcher = factory(global.ol.control.Control,global.ol.Observable,global.ol.layer.Group));
}(this, (function (Control,ol_Observable,LayerGroup) { 'use strict';
Control = 'default' in Control ? Control['default'] : Control;
LayerGroup = 'default' in LayerGroup ? LayerGroup['default'] : LayerGroup;
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var get = function get(object, property, receiver) {
if (object === null) object = Function.prototype;
var desc = Object.getOwnPropertyDescriptor(object, property);
if (desc === undefined) {
var parent = Object.getPrototypeOf(object);
if (parent === null) {
return undefined;
} else {
return get(parent, property, receiver);
}
} else if ("value" in desc) {
return desc.value;
} else {
var getter = desc.get;
if (getter === undefined) {
return undefined;
}
return getter.call(receiver);
}
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
/**
* @protected
*/
var CSS_PREFIX = 'layer-switcher-';
/**
* OpenLayers LayerSwitcher Control, displays a list of layers and groups
* associated with a map which have a `title` property.
*
* To be shown in the LayerSwitcher panel layers must have a `title` property;
* base map layers should have a `type` property set to `base`. Group layers
* (`LayerGroup`) can be used to visually group layers together; a group
* with a `fold` property set to either `'open'` or `'close'` will be displayed
* with a toggle.
*
* See [BaseLayerOptions](#baselayeroptions) for a full list of LayerSwitcher
* properties for layers (`TileLayer`, `ImageLayer`, `VectorTile` etc.) and
* [GroupLayerOptions](#grouplayeroptions) for group layer (`LayerGroup`)
* LayerSwitcher properties.
*
* Layer and group properties can either be set by adding extra properties
* to their options when they are created or via their set method.
*
* Specify a `title` for a Layer by adding a `title` property to it's options object:
* ```javascript
* var lyr = new ol.layer.Tile({
* // Specify a title property which will be displayed by the layer switcher
* title: 'OpenStreetMap',
* visible: true,
* source: new ol.source.OSM()
* })
* ```
*
* Alternatively the properties can be set via the `set` method after a layer has been created:
* ```javascript
* var lyr = new ol.layer.Tile({
* visible: true,
* source: new ol.source.OSM()
* })
* // Specify a title property which will be displayed by the layer switcher
* lyr.set('title', 'OpenStreetMap');
* ```
*
* To create a LayerSwitcher and add it to a map, create a new instance then pass it to the map's [`addControl` method](https://openlayers.org/en/latest/apidoc/module-ol_PluggableMap-PluggableMap.html#addControl).
* ```javascript
* var layerSwitcher = new LayerSwitcher({
* reverse: true,
* groupSelectStyle: 'group'
* });
* map.addControl(layerSwitcher);
* ```
*
* @constructor
* @extends {ol/control/Control~Control}
* @param opt_options LayerSwitcher options, see [LayerSwitcher Options](#options) and [RenderOptions](#renderoptions) which LayerSwitcher `Options` extends for more details.
*/
var LayerSwitcher = function (_Control) {
inherits(LayerSwitcher, _Control);
function LayerSwitcher(opt_options) {
classCallCheck(this, LayerSwitcher);
var options = Object.assign({}, opt_options);
// TODO Next: Rename to showButtonTitle
var tipLabel = options.tipLabel ? options.tipLabel : 'Legend';
// TODO Next: Rename to hideButtonTitle
var collapseTipLabel = options.collapseTipLabel ? options.collapseTipLabel : 'Collapse legend';
var element = document.createElement('div');
var _this = possibleConstructorReturn(this, (LayerSwitcher.__proto__ || Object.getPrototypeOf(LayerSwitcher)).call(this, { element: element, target: options.target }));
_this.activationMode = options.activationMode || 'mouseover';
_this.startActive = options.startActive === true;
// TODO Next: Rename to showButtonContent
var label = options.label !== undefined ? options.label : '';
// TODO Next: Rename to hideButtonContent
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\xBB';
_this.groupSelectStyle = LayerSwitcher.getGroupSelectStyle(options.groupSelectStyle);
_this.reverse = options.reverse !== false;
_this.mapListeners = [];
_this.hiddenClassName = 'ol-unselectable ol-control layer-switcher';
if (LayerSwitcher.isTouchDevice_()) {
_this.hiddenClassName += ' touch';
}
_this.shownClassName = 'shown';
element.className = _this.hiddenClassName;
var button = document.createElement('button');
button.setAttribute('title', tipLabel);
button.setAttribute('aria-label', tipLabel);
element.appendChild(button);
_this.panel = document.createElement('div');
_this.panel.className = 'panel';
element.appendChild(_this.panel);
LayerSwitcher.enableTouchScroll_(_this.panel);
button.textContent = label;
element.classList.add(CSS_PREFIX + 'group-select-style-' + _this.groupSelectStyle);
element.classList.add(CSS_PREFIX + 'activation-mode-' + _this.activationMode);
if (_this.activationMode === 'click') {
// TODO Next: Remove in favour of layer-switcher-activation-mode-click
element.classList.add('activationModeClick');
if (_this.startActive) {
button.textContent = collapseLabel;
button.setAttribute('title', collapseTipLabel);
button.setAttribute('aria-label', collapseTipLabel);
}
button.onclick = function (e) {
var evt = e || window.event;
if (_this.element.classList.contains(_this.shownClassName)) {
_this.hidePanel();
button.textContent = label;
button.setAttribute('title', tipLabel);
button.setAttribute('aria-label', tipLabel);
} else {
_this.showPanel();
button.textContent = collapseLabel;
button.setAttribute('title', collapseTipLabel);
button.setAttribute('aria-label', collapseTipLabel);
}
evt.preventDefault();
};
} else {
button.onmouseover = function () {
_this.showPanel();
};
button.onclick = function (e) {
var evt = e || window.event;
_this.showPanel();
evt.preventDefault();
};
_this.panel.onmouseout = function (evt) {
if (!_this.panel.contains(evt.relatedTarget)) {
_this.hidePanel();
}
};
}
return _this;
}
/**
* Set the map instance the control is associated with.
* @param map The map instance.
*/
createClass(LayerSwitcher, [{
key: 'setMap',
value: function setMap(map) {
var _this2 = this;
// Clean up listeners associated with the previous map
for (var i = 0; i < this.mapListeners.length; i++) {
ol_Observable.unByKey(this.mapListeners[i]);
}
this.mapListeners.length = 0;
// Wire up listeners etc. and store reference to new map
get(LayerSwitcher.prototype.__proto__ || Object.getPrototypeOf(LayerSwitcher.prototype), 'setMap', this).call(this, map);
if (map) {
if (this.startActive) {
this.showPanel();
} else {
this.renderPanel();
}
if (this.activationMode !== 'click') {
this.mapListeners.push(map.on('pointerdown', function () {
_this2.hidePanel();
}));
}
}
}
/**
* Show the layer panel.
*/
}, {
key: 'showPanel',
value: function showPanel() {
if (!this.element.classList.contains(this.shownClassName)) {
this.element.classList.add(this.shownClassName);
this.renderPanel();
}
}
/**
* Hide the layer panel.
*/
}, {
key: 'hidePanel',
value: function hidePanel() {
if (this.element.classList.contains(this.shownClassName)) {
this.element.classList.remove(this.shownClassName);
}
}
/**
* Re-draw the layer panel to represent the current state of the layers.
*/
}, {
key: 'renderPanel',
value: function renderPanel() {
this.dispatchEvent('render');
LayerSwitcher.renderPanel(this.getMap(), this.panel, {
groupSelectStyle: this.groupSelectStyle,
reverse: this.reverse
});
this.dispatchEvent('rendercomplete');
}
/**
* **_[static]_** - Re-draw the layer panel to represent the current state of the layers.
* @param map The OpenLayers Map instance to render layers for
* @param panel The DOM Element into which the layer tree will be rendered
* @param options Options for panel, group, and layers
*/
}], [{
key: 'renderPanel',
value: function renderPanel(map, panel, options) {
// Create the event.
var render_event = new Event('render');
// Dispatch the event.
panel.dispatchEvent(render_event);
options = options || {};
options.groupSelectStyle = LayerSwitcher.getGroupSelectStyle(options.groupSelectStyle);
LayerSwitcher.ensureTopVisibleBaseLayerShown(map, options.groupSelectStyle);
while (panel.firstChild) {
panel.removeChild(panel.firstChild);
}
// Reset indeterminate state for all layers and groups before
// applying based on groupSelectStyle
LayerSwitcher.forEachRecursive(map, function (l, _idx, _a) {
l.set('indeterminate', false);
});
if (options.groupSelectStyle === 'children' || options.groupSelectStyle === 'none') {
// Set visibile and indeterminate state of groups based on
// their children's visibility
LayerSwitcher.setGroupVisibility(map);
} else if (options.groupSelectStyle === 'group') {
// Set child indetermiate state based on their parent's visibility
LayerSwitcher.setChildVisibility(map);
}
var ul = document.createElement('ul');
panel.appendChild(ul);
// passing two map arguments instead of lyr as we're passing the map as the root of the layers tree
LayerSwitcher.renderLayers_(map, map, ul, options, function render(_changedLyr) {
LayerSwitcher.renderPanel(map, panel, options);
});
// Create the event.
var rendercomplete_event = new Event('rendercomplete');
// Dispatch the event.
panel.dispatchEvent(rendercomplete_event);
}
/**
* **_[static]_** - Determine if a given layer group contains base layers
* @param grp Group to test
*/
}, {
key: 'isBaseGroup',
value: function isBaseGroup(grp) {
if (grp instanceof LayerGroup) {
var lyrs = grp.getLayers().getArray();
return lyrs.length && lyrs[0].get('type') === 'base';
} else {
return false;
}
}
}, {
key: 'setGroupVisibility',
value: function setGroupVisibility(map) {
// Get a list of groups, with the deepest first
var groups = LayerSwitcher.getGroupsAndLayers(map, function (l) {
return l instanceof LayerGroup && !l.get('combine') && !LayerSwitcher.isBaseGroup(l);
}).reverse();
// console.log(groups.map(g => g.get('title')));
groups.forEach(function (grp) {
// TODO Can we use getLayersArray, is it public in the esm build?
var descendantVisibility = grp.getLayersArray().map(function (l) {
var state = l.getVisible();
// console.log('>', l.get('title'), state);
return state;
});
// console.log(descendantVisibility);
if (descendantVisibility.every(function (v) {
return v === true;
})) {
grp.setVisible(true);
grp.set('indeterminate', false);
} else if (descendantVisibility.every(function (v) {
return v === false;
})) {
grp.setVisible(false);
grp.set('indeterminate', false);
} else {
grp.setVisible(true);
grp.set('indeterminate', true);
}
});
}
}, {
key: 'setChildVisibility',
value: function setChildVisibility(map) {
// console.log('setChildVisibility');
var groups = LayerSwitcher.getGroupsAndLayers(map, function (l) {
return l instanceof LayerGroup && !l.get('combine') && !LayerSwitcher.isBaseGroup(l);
});
groups.forEach(function (grp) {
var group = grp;
// console.log(group.get('title'));
var groupVisible = group.getVisible();
var groupIndeterminate = group.get('indeterminate');
group.getLayers().getArray().forEach(function (l) {
l.set('indeterminate', false);
if ((!groupVisible || groupIndeterminate) && l.getVisible()) {
l.set('indeterminate', true);
}
});
});
}
/**
* Ensure only the top-most base layer is visible if more than one is visible.
* @param map The map instance.
* @param groupSelectStyle
* @protected
*/
}, {
key: 'ensureTopVisibleBaseLayerShown',
value: function ensureTopVisibleBaseLayerShown(map, groupSelectStyle) {
var lastVisibleBaseLyr = void 0;
LayerSwitcher.forEachRecursive(map, function (lyr, _idx, _arr) {
if (lyr.get('type') === 'base' && lyr.getVisible()) {
lastVisibleBaseLyr = lyr;
}
});
if (lastVisibleBaseLyr) LayerSwitcher.setVisible_(map, lastVisibleBaseLyr, true, groupSelectStyle);
}
/**
* **_[static]_** - Get an Array of all layers and groups displayed by the LayerSwitcher (has a `'title'` property)
* contained by the specified map or layer group; optionally filtering via `filterFn`
* @param grp The map or layer group for which layers are found.
* @param filterFn Optional function used to filter the returned layers
*/
}, {
key: 'getGroupsAndLayers',
value: function getGroupsAndLayers(grp, filterFn) {
var layers = [];
filterFn = filterFn || function (_lyr, _idx, _arr) {
return true;
};
LayerSwitcher.forEachRecursive(grp, function (lyr, idx, arr) {
if (lyr.get('title')) {
if (filterFn(lyr, idx, arr)) {
layers.push(lyr);
}
}
});
return layers;
}
/**
* Toggle the visible state of a layer.
* Takes care of hiding other layers in the same exclusive group if the layer
* is toggle to visible.
* @protected
* @param map The map instance.
* @param lyr layer whose visibility will be toggled.
* @param visible Set whether the layer is shown
* @param groupSelectStyle
* @protected
*/
}, {
key: 'setVisible_',
value: function setVisible_(map, lyr, visible, groupSelectStyle) {
// console.log(lyr.get('title'), visible, groupSelectStyle);
lyr.setVisible(visible);
if (visible && lyr.get('type') === 'base') {
// Hide all other base layers regardless of grouping
LayerSwitcher.forEachRecursive(map, function (l, _idx, _arr) {
if (l != lyr && l.get('type') === 'base') {
l.setVisible(false);
}
});
}
if (lyr instanceof LayerGroup && !lyr.get('combine') && groupSelectStyle === 'children') {
lyr.getLayers().forEach(function (l) {
LayerSwitcher.setVisible_(map, l, lyr.getVisible(), groupSelectStyle);
});
}
}
/**
* Render all layers that are children of a group.
* @param map The map instance.
* @param lyr Layer to be rendered (should have a title property).
* @param idx Position in parent group list.
* @param options Options for groups and layers
* @protected
*/
}, {
key: 'renderLayer_',
value: function renderLayer_(map, lyr, idx, options, render) {
var li = document.createElement('li');
var lyrTitle = lyr.get('title');
var checkboxId = LayerSwitcher.uuid();
var label = document.createElement('label');
if (lyr instanceof LayerGroup && !lyr.get('combine')) {
var isBaseGroup = LayerSwitcher.isBaseGroup(lyr);
li.classList.add('group');
if (isBaseGroup) {
li.classList.add(CSS_PREFIX + 'base-group');
}
// Group folding
if (lyr.get('fold')) {
li.classList.add(CSS_PREFIX + 'fold');
li.classList.add(CSS_PREFIX + lyr.get('fold'));
var btn = document.createElement('button');
btn.onclick = function (e) {
var evt = e || window.event;
LayerSwitcher.toggleFold_(lyr, li);
evt.preventDefault();
};
li.appendChild(btn);
}
if (!isBaseGroup && options.groupSelectStyle != 'none') {
var input = document.createElement('input');
input.type = 'checkbox';
input.id = checkboxId;
input.checked = lyr.getVisible();
input.indeterminate = lyr.get('indeterminate');
input.onchange = function (e) {
var target = e.target;
LayerSwitcher.setVisible_(map, lyr, target.checked, options.groupSelectStyle);
render(lyr);
};
li.appendChild(input);
label.htmlFor = checkboxId;
}
label.innerHTML = lyrTitle;
li.appendChild(label);
var ul = document.createElement('ul');
li.appendChild(ul);
LayerSwitcher.renderLayers_(map, lyr, ul, options, render);
} else {
li.className = 'layer';
var _input = document.createElement('input');
if (lyr.get('type') === 'base') {
_input.type = 'radio';
_input.name = 'base';
} else {
_input.type = 'checkbox';
}
_input.id = checkboxId;
_input.checked = lyr.get('visible');
_input.indeterminate = lyr.get('indeterminate');
_input.onchange = function (e) {
var target = e.target;
LayerSwitcher.setVisible_(map, lyr, target.checked, options.groupSelectStyle);
render(lyr);
};
li.appendChild(_input);
label.htmlFor = checkboxId;
label.innerHTML = lyrTitle;
var rsl = map.getView().getResolution();
if (rsl > lyr.getMaxResolution() || rsl < lyr.getMinResolution()) {
label.className += ' disabled';
}
li.appendChild(label);
}
return li;
}
/**
* Render all layers that are children of a group.
* @param map The map instance.
* @param lyr Group layer whose children will be rendered.
* @param elm DOM element that children will be appended to.
* @param options Options for groups and layers
* @protected
*/
}, {
key: 'renderLayers_',
value: function renderLayers_(map, lyr, elm, options, render) {
var lyrs = lyr.getLayers().getArray().slice();
if (options.reverse) lyrs = lyrs.reverse();
for (var i = 0, l; i < lyrs.length; i++) {
l = lyrs[i];
if (l.get('title')) {
elm.appendChild(LayerSwitcher.renderLayer_(map, l, i, options, render));
}
}
}
/**
* **_[static]_** - Call the supplied function for each layer in the passed layer group
* recursing nested groups.
* @param lyr The layer group to start iterating from.
* @param fn Callback which will be called for each layer
* found under `lyr`.
*/
}, {
key: 'forEachRecursive',
value: function forEachRecursive(lyr, fn) {
lyr.getLayers().forEach(function (lyr, idx, a) {
fn(lyr, idx, a);
if (lyr instanceof LayerGroup) {
LayerSwitcher.forEachRecursive(lyr, fn);
}
});
}
/**
* **_[static]_** - Generate a UUID
* Adapted from http://stackoverflow.com/a/2117523/526860
* @returns {String} UUID
*/
}, {
key: 'uuid',
value: function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : r & 0x3 | 0x8;
return v.toString(16);
});
}
/**
* Apply workaround to enable scrolling of overflowing content within an
* element. Adapted from https://gist.github.com/chrismbarr/4107472
* @param elm Element on which to enable touch scrolling
* @protected
*/
}, {
key: 'enableTouchScroll_',
value: function enableTouchScroll_(elm) {
if (LayerSwitcher.isTouchDevice_()) {
var scrollStartPos = 0;
elm.addEventListener('touchstart', function (event) {
scrollStartPos = this.scrollTop + event.touches[0].pageY;
}, false);
elm.addEventListener('touchmove', function (event) {
this.scrollTop = scrollStartPos - event.touches[0].pageY;
}, false);
}
}
/**
* Determine if the current browser supports touch events. Adapted from
* https://gist.github.com/chrismbarr/4107472
* @returns {Boolean} True if client can have 'TouchEvent' event
* @protected
*/
}, {
key: 'isTouchDevice_',
value: function isTouchDevice_() {
try {
document.createEvent('TouchEvent');
return true;
} catch (e) {
return false;
}
}
/**
* Fold/unfold layer group
* @param lyr Layer group to fold/unfold
* @param li List item containing layer group
* @protected
*/
}, {
key: 'toggleFold_',
value: function toggleFold_(lyr, li) {
li.classList.remove(CSS_PREFIX + lyr.get('fold'));
lyr.set('fold', lyr.get('fold') === 'open' ? 'close' : 'open');
li.classList.add(CSS_PREFIX + lyr.get('fold'));
}
/**
* If a valid groupSelectStyle value is not provided then return the default
* @param groupSelectStyle The string to check for validity
* @returns The value groupSelectStyle, if valid, the default otherwise
* @protected
*/
}, {
key: 'getGroupSelectStyle',
value: function getGroupSelectStyle(groupSelectStyle) {
return ['none', 'children', 'group'].indexOf(groupSelectStyle) >= 0 ? groupSelectStyle : 'children';
}
}]);
return LayerSwitcher;
}(Control);
if (window['ol'] && window['ol']['control']) {
window['ol']['control']['LayerSwitcher'] = LayerSwitcher;
}
return LayerSwitcher;
})));
-2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+126 -100
View File
@@ -1,32 +1,32 @@
"use strict";
function PlaneObject(icao) {
// Info about the plane
this.icao = icao;
// Info about the plane
this.icao = icao;
this.icaorange = findICAORange(icao);
this.flight = null;
this.squawk = null;
this.selected = false;
this.category = null;
this.flight = null;
this.squawk = null;
this.selected = false;
this.category = null;
// Basic location information
this.altitude = null;
this.speed = null;
this.track = null;
// Basic location information
this.altitude = null;
this.speed = null;
this.track = null;
this.prev_position = null;
this.position = null;
this.position = null;
this.position_from_mlat = false
this.sitedist = null;
this.sitedist = null;
// Data packet numbers
this.messages = null;
this.rssi = null;
// Data packet numbers
this.messages = null;
this.rssi = null;
// Track history as a series of line segments
this.track_linesegs = [];
this.history_size = 0;
// When was this last updated (receiver timestamp)
// When was this last updated (receiver timestamp)
this.last_message_time = null;
this.last_position_time = null;
@@ -50,7 +50,7 @@ function PlaneObject(icao) {
this.icaotype = null;
// request metadata
getAircraftData(this.icao).done(function(data) {
getAircraftData(this.icao).done(function (data) {
if ("r" in data) {
this.registration = data.r;
}
@@ -60,14 +60,14 @@ function PlaneObject(icao) {
}
if (this.selected) {
refreshSelected();
refreshSelected();
}
}.bind(this));
}
// Appends data to the running track so we can get a visual tail on the plane
// Only useful for a long running browser session.
PlaneObject.prototype.updateTrack = function(estimate_time) {
PlaneObject.prototype.updateTrack = function (estimate_time) {
if (!this.position)
return false;
if (this.position == this.prev_position)
@@ -86,34 +86,37 @@ PlaneObject.prototype.updateTrack = function(estimate_time) {
if (this.track_linesegs.length == 0) {
// Brand new track
//console.log(this.icao + " new track");
var newseg = { fixed: new ol.geom.LineString([projHere]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground")
};
var newseg = {
fixed: new ol.geom.LineString([projHere]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground")
};
this.track_linesegs.push(newseg);
this.history_size ++;
this.history_size++;
return;
}
var lastseg = this.track_linesegs[this.track_linesegs.length - 1];
var elapsed = (this.last_position_time - lastseg.head_update);
var est_track = (elapsed > estimate_time);
var ground_track = (this.altitude === "ground");
if (est_track) {
if (!lastseg.estimated) {
// >5s gap in data, create a new estimated segment
//console.log(this.icao + " switching to estimated");
lastseg.fixed.appendCoordinate(projPrev);
this.track_linesegs.push({ fixed: new ol.geom.LineString([projPrev, projHere]),
feature: null,
head_update: this.last_position_time,
estimated: true });
this.track_linesegs.push({
fixed: new ol.geom.LineString([projPrev, projHere]),
feature: null,
head_update: this.last_position_time,
estimated: true
});
this.history_size += 2;
} else {
// Keep appending to the existing dashed line; keep every point
@@ -124,39 +127,43 @@ PlaneObject.prototype.updateTrack = function(estimate_time) {
return true;
}
if (lastseg.estimated) {
// We are back to good data (we got two points close in time), switch back to
// solid lines.
lastseg = { fixed: new ol.geom.LineString([projPrev]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground") };
lastseg = {
fixed: new ol.geom.LineString([projPrev]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground")
};
this.track_linesegs.push(lastseg);
this.history_size ++;
this.history_size++;
// continue
}
if ( (lastseg.ground && this.altitude !== "ground") ||
(!lastseg.ground && this.altitude === "ground") ) {
if ((lastseg.ground && this.altitude !== "ground") ||
(!lastseg.ground && this.altitude === "ground")) {
//console.log(this.icao + " ground state changed");
// Create a new segment as the ground state changed.
// assume the state changed halfway between the two points
// FIXME needs reimplementing post-google
lastseg.fixed.appendCoordinate(projPrev);
this.track_linesegs.push({ fixed: new ol.geom.LineString([projPrev, projHere]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground") });
this.track_linesegs.push({
fixed: new ol.geom.LineString([projPrev, projHere]),
feature: null,
head_update: this.last_position_time,
tail_update: this.last_position_time,
estimated: false,
ground: (this.altitude === "ground")
});
this.history_size += 3;
return true;
}
// Add more data to the existing track.
// We only retain some historical points, at 5+ second intervals,
// plus the most recent point
@@ -165,7 +172,7 @@ PlaneObject.prototype.updateTrack = function(estimate_time) {
//console.log(this.icao + " retain last point");
lastseg.fixed.appendCoordinate(projHere);
lastseg.tail_update = lastseg.head_update;
this.history_size ++;
this.history_size++;
}
lastseg.head_update = this.last_position_time;
@@ -173,8 +180,8 @@ PlaneObject.prototype.updateTrack = function(estimate_time) {
};
// This is to remove the line from the screen if we deselect the plane
PlaneObject.prototype.clearLines = function() {
for (var i = this.track_linesegs.length - 1; i >= 0 ; --i) {
PlaneObject.prototype.clearLines = function () {
for (var i = this.track_linesegs.length - 1; i >= 0; --i) {
var seg = this.track_linesegs[i];
if (seg.feature !== null) {
PlaneTrailFeatures.remove(seg.feature);
@@ -183,7 +190,7 @@ PlaneObject.prototype.clearLines = function() {
}
};
PlaneObject.prototype.getMarkerColor = function() {
PlaneObject.prototype.getMarkerColor = function () {
// Emergency squawks override everything else
if (this.squawk in SpecialSquawks)
return SpecialSquawks[this.squawk].markerColor;
@@ -206,12 +213,12 @@ PlaneObject.prototype.getMarkerColor = function() {
// and interpolate the hue between those points
var hpoints = ColorByAlt.air.h;
h = hpoints[0].val;
for (var i = hpoints.length-1; i >= 0; --i) {
for (var i = hpoints.length - 1; i >= 0; --i) {
if (this.altitude > hpoints[i].alt) {
if (i == hpoints.length-1) {
if (i == hpoints.length - 1) {
h = hpoints[i].val;
} else {
h = hpoints[i].val + (hpoints[i+1].val - hpoints[i].val) * (this.altitude - hpoints[i].alt) / (hpoints[i+1].alt - hpoints[i].alt)
h = hpoints[i].val + (hpoints[i + 1].val - hpoints[i].val) * (this.altitude - hpoints[i].alt) / (hpoints[i + 1].alt - hpoints[i].alt)
}
break;
}
@@ -226,7 +233,7 @@ PlaneObject.prototype.getMarkerColor = function() {
}
// If this marker is selected, change color
if (this.selected){
if (this.selected) {
h += ColorByAlt.selected.h;
s += ColorByAlt.selected.s;
l += ColorByAlt.selected.l;
@@ -251,10 +258,10 @@ PlaneObject.prototype.getMarkerColor = function() {
if (l < 5) l = 5;
else if (l > 95) l = 95;
return 'hsl(' + (h/5).toFixed(0)*5 + ',' + (s/5).toFixed(0)*5 + '%,' + (l/5).toFixed(0)*5 + '%)'
return 'hsl(' + (h / 5).toFixed(0) * 5 + ',' + (s / 5).toFixed(0) * 5 + '%,' + (l / 5).toFixed(0) * 5 + '%)'
}
PlaneObject.prototype.updateIcon = function() {
PlaneObject.prototype.updateIcon = function () {
var col = this.getMarkerColor();
var opacity = (this.position_from_mlat ? 0.75 : 1.0);
var outline = (this.position_from_mlat ? OutlineMlatColor : OutlineADSBColor);
@@ -306,13 +313,32 @@ PlaneObject.prototype.updateIcon = function() {
rotateWithView: true
});
this.markerStyle = new ol.style.Style({
image: this.markerIcon
image: this.markerIcon,
});
} else {
this.markerIcon = icon;
this.markerStyle = new ol.style.Style({
image: this.markerIcon
});
if (text_labels) {
this.markerStyle = new ol.style.Style({
image: this.markerIcon,
text: new ol.style.Text({
text: this.flight + "\n" + this.altitude,
scale: 1.2,
offsetY: -25,
fill: new ol.style.Fill({
color: "#fff"
}),
stroke: new ol.style.Stroke({
color: "0",
width: 2
})
})
});
} else {
this.markerStyle = new ol.style.Style({
image: this.markerIcon
});
}
this.markerStaticIcon = null;
this.markerStaticStyle = new ol.style.Style({});
}
@@ -340,22 +366,22 @@ PlaneObject.prototype.updateIcon = function() {
};
// Update our data
PlaneObject.prototype.updateData = function(receiver_timestamp, data) {
// Update all of our data
this.messages = data.messages;
this.rssi = data.rssi;
this.last_message_time = receiver_timestamp - data.seen;
PlaneObject.prototype.updateData = function (receiver_timestamp, data) {
// Update all of our data
this.messages = data.messages;
this.rssi = data.rssi;
this.last_message_time = receiver_timestamp - data.seen;
if (typeof data.altitude !== "undefined")
this.altitude = data.altitude;
this.altitude = data.altitude;
if (typeof data.vert_rate !== "undefined")
this.vert_rate = data.vert_rate;
this.vert_rate = data.vert_rate;
if (typeof data.speed !== "undefined")
this.speed = data.speed;
this.speed = data.speed;
if (typeof data.track !== "undefined")
this.track = data.track;
this.track = data.track;
if (typeof data.lat !== "undefined") {
this.position = [data.lon, data.lat];
this.position = [data.lon, data.lat];
this.last_position_time = receiver_timestamp - data.seen_pos;
if (SitePosition !== null) {
@@ -374,58 +400,58 @@ PlaneObject.prototype.updateData = function(receiver_timestamp, data) {
}
}
if (typeof data.flight !== "undefined")
this.flight = data.flight;
this.flight = data.flight;
if (typeof data.squawk !== "undefined")
this.squawk = data.squawk;
this.squawk = data.squawk;
if (typeof data.category !== "undefined")
this.category = data.category;
this.category = data.category;
};
PlaneObject.prototype.updateTick = function(receiver_timestamp, last_timestamp) {
PlaneObject.prototype.updateTick = function (receiver_timestamp, last_timestamp) {
// recompute seen and seen_pos
this.seen = receiver_timestamp - this.last_message_time;
this.seen_pos = (this.last_position_time === null ? null : receiver_timestamp - this.last_position_time);
// If no packet in over 58 seconds, clear the plane.
if (this.seen > 58) {
// If no packet in over 58 seconds, clear the plane.
if (this.seen > 58) {
if (this.visible) {
//console.log("hiding " + this.icao);
this.clearMarker();
this.visible = false;
if (SelectedPlane == this.icao)
selectPlaneByHex(null,false);
if (SelectedPlane == this.icao)
selectPlaneByHex(null, false);
}
} else {
} else {
this.visible = true;
if (this.position !== null && (this.selected || this.seen_pos < 60)) {
if (this.updateTrack(receiver_timestamp - last_timestamp + (this.position_from_mlat ? 30 : 5))) {
if (this.updateTrack(receiver_timestamp - last_timestamp + (this.position_from_mlat ? 30 : 5))) {
this.updateLines();
this.updateMarker(true);
} else {
} else {
this.updateMarker(false); // didn't move
}
} else {
this.clearMarker();
}
}
this.clearMarker();
}
}
};
PlaneObject.prototype.clearMarker = function() {
if (this.marker) {
PlaneObject.prototype.clearMarker = function () {
if (this.marker) {
PlaneIconFeatures.remove(this.marker);
PlaneIconFeatures.remove(this.markerStatic);
/* FIXME google.maps.event.clearListeners(this.marker, 'click'); */
this.marker = this.markerStatic = null;
}
}
};
// Update our marker on the map
PlaneObject.prototype.updateMarker = function(moved) {
PlaneObject.prototype.updateMarker = function (moved) {
if (!this.visible || this.position == null) {
this.clearMarker();
return;
}
this.updateIcon();
if (this.marker) {
if (moved) {
@@ -442,11 +468,11 @@ PlaneObject.prototype.updateMarker = function(moved) {
this.markerStatic.hex = this.icao;
this.markerStatic.setStyle(this.markerStaticStyle);
PlaneIconFeatures.push(this.markerStatic);
}
}
};
// Update our planes tail line,
PlaneObject.prototype.updateLines = function() {
PlaneObject.prototype.updateLines = function () {
if (!this.selected)
return;
@@ -506,7 +532,7 @@ PlaneObject.prototype.updateLines = function() {
}
};
PlaneObject.prototype.destroy = function() {
PlaneObject.prototype.destroy = function () {
this.clearLines();
this.clearMarker();
};
};
+224 -46
View File
@@ -1,79 +1,257 @@
var us_airports = {}
function initializeSchedulesPage() {
document.getElementById("itin_body").innerHTML = ""
document.getElementById("itin_img").setAttribute("src", 'images/black.jpg')
FetchPending = $.ajax({
url: 'json/liveatc.json',
url: 'information/liveatc.json',
timeout: 5000,
cache: false,
dataType: 'json',
});
FetchPending.done(function(data) {
FetchPending.done(function (data) {
us_airports = data
for (state in us_airports) {
var node = document.createElement("option")
var node = document.createElement("div")
node.setAttribute("value", state)
node.innerHTML = state
document.getElementById("itinerary_states").appendChild(node)
node.setAttribute("class", "itin_state")
node.setAttribute("onclick", "loadAirport('" + state + "')")
node.innerHTML = "<b>" + state + "</b>"
document.getElementById("itin_body").appendChild(node)
}
})
}
function itineraryLoadAirports() {
document.getElementById("itinerary_loading").style.display = "block"
document.getElementById("arrivals").style.display = "none"
document.getElementById("departures").style.display = "none"
document.getElementById("sch-arrivals").style.display = "none"
document.getElementById("sch-departures").style.display = "none"
document.getElementById("itinerary_undefined").style.display = "none"
while (document.getElementById("itinerary_airports").firstChild) {
document.getElementById("itinerary_airports").removeChild(document.getElementById("itinerary_airports").firstChild);
}
document.getElementById("itinerary_airports").style.display = "inline"
var state = document.getElementById("itinerary_states").value
function loadAirport(state) {
document.getElementById("itin_img").setAttribute("src", 'images/black.jpg')
document.getElementById("itin_info").style.display = "none"
document.getElementById("itin_body").style.display = "block"
document.getElementById("itin_body").innerHTML = ""
document.getElementById("sidebar_close").style.color = "rgba(0, 0, 0, 0.7)";
var node = document.createElement("div")
node.setAttribute("class", "itin_header noselect pointer")
node.setAttribute("onmousedown", "initializeSchedulesPage()")
node.innerHTML = "<b>Go Back</b>"
document.getElementById("itin_body").appendChild(node)
var node = document.createElement("div")
node.setAttribute("class", "itin_header noselect")
node.innerHTML = "<b>" + state + "</b>"
document.getElementById("itin_body").appendChild(node)
var node = document.createElement("hr")
document.getElementById("itin_body").appendChild(node)
var regexp = /\d/;
for (airport in us_airports[state].airports) {
var node = document.createElement("option")
node.setAttribute("value", airport)
node.innerHTML = airport
document.getElementById("itinerary_airports").appendChild(node)
if (!regexp.test(airport.charAt(0)) || !exclude) {
var node = document.createElement("div")
node.setAttribute("value", airport)
node.setAttribute("class", "itin_state")
node.setAttribute("onclick", "retrieveSchedule('" + airport + "','" + state + "')")
node.innerHTML = "<b>" + airport + "</b>"
document.getElementById("itin_body").appendChild(node)
}
}
}
function airportSchedule() {
var airport = document.getElementById("itinerary_airports").value
retrieveSchedule(airport)
}
function retrieveSchedule(airport, state) {
document.getElementById("itin_arr").style.display = "none"
document.getElementById("itin_dep").style.display = "none"
document.getElementById("itin_body").innerHTML = ""
document.getElementById("itin_info").style.display = "block"
document.getElementById("itin_body").style.display = "none"
document.getElementById("sidebar_close").style.color = "rgba(255, 255, 255, 0.7)";
var node = document.createElement("div")
node.setAttribute("class", "itin_header1 noselect pointer")
node.setAttribute("onmousedown", "loadAirport('" + state + "')")
node.innerHTML = "<b>Go Back</b>"
document.getElementById("itin_body").appendChild(node)
var node = document.createElement("div")
node.setAttribute("class", "itin_header1 noselect")
node.innerHTML = "<b>" + state + "</b>"
document.getElementById("itin_body").appendChild(node)
var node = document.createElement("div")
node.setAttribute("class", "itin_header1 noselect")
node.innerHTML = "<b>" + airport + "</b>"
document.getElementById("itin_body").appendChild(node)
var node = document.createElement("hr")
document.getElementById("itin_body").appendChild(node)
FetchPending = $.ajax({
url: 'json/world_airports.json',
timeout: 5000,
cache: false,
dataType: 'json',
});
FetchPending.done(function (data) {
world_airports = data
// MAP MARKER INFO
var markerStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: 7,
snapToPixel: false,
fill: new ol.style.Fill({
color: 'red'
}),
stroke: new ol.style.Stroke({
color: 'black',
width: 2
})
})
});
OLMap.getView().setCenter(ol.proj.fromLonLat([world_airports[airport].lon, world_airports[airport].lat]));
var feature = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat([world_airports[airport].lon, world_airports[airport].lat])));
feature.setStyle(markerStyle);
lastItin = StaticFeatures.push(feature) - 1
if (lastItin === 1) {
StaticFeatures.removeAt(0)
}
document.getElementById("itin_airport_city").innerHTML = world_airports[airport].city + ", " + world_airports[airport].state
document.getElementById("itin_airport_name").innerHTML = airport
document.getElementById("itin_airport_long_name").innerHTML = world_airports[airport].name
document.getElementById("itin_airport_loc").innerHTML = parseFloat(world_airports[airport].lat).toFixed(2) + ", " + parseFloat(world_airports[airport].lon).toFixed(2)
document.getElementById("itin_back").setAttribute("onclick", "loadAirport('" + state + "');")
var xhr1 = new XMLHttpRequest();
xhr1.open("GET", "http://"+window.location.hostname+":7000/www.airnav.com/airport/" + airport.slice(1,4), true);
//xhr1.setRequestHeader('origin', '*');
xhr1.onreadystatechange = function () {
if (xhr1.readyState === 4) {
var html = xhr1.response
var page_nodes = $($.parseHTML(html));
page_nodes.find("img").each(function (index) {
if ($(this).attr('alt')) {
if ($(this).attr('alt').includes("Aerial")) {
document.getElementById("itin_img").setAttribute("src", $(this).attr('src'))
}
}
})
/* console.log(page_nodes.find("table:nth-child(8) > tbody > tr.part_body > td > font > img").attr("src"))
if (page_nodes.find("table:nth-child(8) > tbody > tr.part_body > td > font > img").attr("src")) {
document.getElementById("itin_img").setAttribute("src",page_nodes.find("table:nth-child(8) > tbody > tr.part_body > td > font > img").attr("src"))
}*/
}
}
xhr1.send();
})
function retrieveSchedule(airport) {
document.getElementById("itinerary_loading").style.display = "none"
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://127.0.0.1:5000/cmd", true);
xhr.open("POST", "http://"+window.location.hostname+":5000/curl", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var html = xhr.response
var page_nodes = $($.parseHTML(html));
document.getElementById("itinerary_loading").style.display = "none"
if (page_nodes.find("#arrivals-board > div").html() === undefined || page_nodes.find("#arrivals-board > div > table > tbody > tr:nth-child(1) > td:nth-child(1)").html() === "&nbsp;") {
document.getElementById("itinerary_undefined").style.display = "block"
} else {
document.getElementById("itinerary_undefined").style.display = "none"
document.getElementById("arrivals").style.display = "inline-table"
document.getElementById("departures").style.display = "inline-table"
document.getElementById("sch-arrivals").style.display = "inline-table"
document.getElementById("sch-departures").style.display = "inline-table"
document.getElementById("arrivals").innerHTML = page_nodes.find("#arrivals-board > div").html()
document.getElementById("departures").innerHTML = page_nodes.find("#departures-board > div").html()
document.getElementById("sch-arrivals").innerHTML = page_nodes.find("#enroute-board > div").html()
document.getElementById("sch-departures").innerHTML = page_nodes.find("#scheduled-board > div").html()
$("#arrivals > table > thead > tr:nth-child(1) > th > h2").html("Arrivals")
$("#departures > table > thead > tr:nth-child(1) > th > h2").html("Departures")
$("#sch-arrivals > table > thead > tr:nth-child(1) > th > h2").html("Scheduled Arrivals")
$("#sch-departures > table > thead > tr:nth-child(1) > th > h2").html("Scheduled Departures")
document.querySelectorAll("#itinerary_page a").forEach(a => a.outerHTML = a.innerHTML);
document.getElementById("itin_arr").innerHTML = page_nodes.find("#enroute-board > div").html() + page_nodes.find("#arrivals-board > div").html()
document.getElementById("itin_dep").innerHTML = page_nodes.find("#scheduled-board > div").html() + page_nodes.find("#departures-board > div").html()
var arrow = document.createElement("span")
arrow.setAttribute("class","material-icons")
arrow.setAttribute("id","itin_back_chart")
arrow.setAttribute("onclick", "retrieveSchedule('"+airport+"','"+state+"')")
arrow.innerHTML = "arrow_back_ios"
var title = document.createElement("span")
title.innerHTML = airport + " ARRIVALS"
title.setAttribute("class","itinheader")
title.prepend(arrow)
document.querySelector("#itin_arr").prepend(title)
document.querySelectorAll("#itin_arr a").forEach(a => a.outerHTML = a.innerHTML);
document.querySelectorAll("#itin_dep a").forEach(a => a.outerHTML = a.innerHTML);
document.querySelector("#itin_arr > table:nth-child(2)").style.backgroundColor = "black"
document.querySelector("#itin_arr > table:nth-child(2) > thead > tr:nth-child(1)").remove()
document.querySelector("#itin_arr > table:nth-child(3)").style.backgroundColor = "black"
document.querySelector("#itin_arr > table:nth-child(3) > thead > tr:nth-child(1)").remove()
var arrow1 = document.createElement("span")
arrow1.setAttribute("class","material-icons")
arrow1.setAttribute("id","itin_back_chart")
arrow1.setAttribute("onclick", "retrieveSchedule('"+airport+"','"+state+"')")
arrow1.innerHTML = "arrow_back_ios"
var title1 = document.createElement("span")
title1.innerHTML = airport + " DEPARTURES"
title1.setAttribute("class","itinheader")
title1.prepend(arrow1)
document.querySelector("#itin_dep").prepend(title1)
document.querySelectorAll("#itin_dep a").forEach(a => a.outerHTML = a.innerHTML);
document.querySelectorAll("#itin_dep a").forEach(a => a.outerHTML = a.innerHTML);
document.querySelector("#itin_dep > table:nth-child(2)").style.backgroundColor = "black"
document.querySelector("#itin_dep > table:nth-child(2) > thead > tr:nth-child(1)").remove()
document.querySelector("#itin_dep > table:nth-child(3)").style.backgroundColor = "black"
document.querySelector("#itin_dep > table:nth-child(3) > thead > tr:nth-child(1)").remove()
// Getting the table
var tble = document.querySelector("#itin_arr > table")
// Getting the rows in table.
var row = tble.rows;
// Removing the column at index(1).
var i = 1;
for (var j = 0; j < row.length; j++) {
// Deleting the ith cell of each row.
row[j].deleteCell(1);
row[j].deleteCell(3);
row[j].deleteCell(2);
}
// Getting the table
var tble = document.querySelector("#itin_arr > table:nth-child(3)")
// Getting the rows in table.
var row = tble.rows;
// Removing the column at index(1).
var i = 1;
for (var j = 0; j < row.length; j++) {
// Deleting the ith cell of each row.
row[j].deleteCell(1);
row[j].deleteCell(3);
row[j].deleteCell(2);
}
// Getting the table
var tble = document.querySelector("#itin_dep > table")
// Getting the rows in table.
var row = tble.rows;
// Removing the column at index(1).
var i = 1;
for (var j = 0; j < row.length; j++) {
// Deleting the ith cell of each row.
row[j].deleteCell(1);
row[j].deleteCell(4);
row[j].deleteCell(3);
}
// Getting the table
var tble = document.querySelector("#itin_dep > table:nth-child(3)")
// Getting the rows in table.
var row = tble.rows;
// Removing the column at index(1).
var i = 1;
for (var j = 0; j < row.length; j++) {
// Deleting the ith cell of each row.
row[j].deleteCell(1);
row[j].deleteCell(4);
row[j].deleteCell(3);
}
}
}
}
xhr.send(JSON.stringify({
command: "curl https://flightaware.com/live/airport/" + airport
url: "https://flightaware.com/live/airport/" + airport
}));
}
+1086 -1091
View File
File diff suppressed because it is too large Load Diff
+541 -574
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,2 +1,2 @@
.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-Index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:flex-end}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}
.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-step-marker{width:1px;height:15px;background-color:#000;float:right;z-Index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:12px;z-Index:11;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-text{position:absolute;font-size:14px;text-align:center;bottom:25px;color:#000;text-shadow:-2px 0 #fff,0 2px #fff,2px 0 #fff,0 -2px #fff}.ol-scale-singlebar{position:relative;height:10px;z-Index:9;box-sizing:border-box;border:1px solid #000}.ol-unsupported{display:none}.ol-unselectable,.ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;bottom:.5em}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:flex-end}.ol-attribution ul{margin:0;padding:1px .5em;color:#000;text-shadow:0 0 2px #fff}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:2px;left:2px;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}
/*# sourceMappingURL=ol.css.map */
-11
View File
@@ -1,11 +0,0 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"olcs": {
"version": "2.13.0",
"resolved": "https://registry.npmjs.org/olcs/-/olcs-2.13.0.tgz",
"integrity": "sha512-5H41vMRdyvDcy4BWm+6V7vkS7glK+jVpUysVRqhzPnXjwvJG9NnvMxKBhAjBG07Lh9QAKAPMLnQ+RWDofN707Q=="
}
}
}
+65 -3
View File
@@ -2,6 +2,8 @@ from flask import Flask, json, request
import os
app = Flask(__name__)
name = "Aviation Assistant"
version = "v.2.7.2-aaf68f9bf2b51806300f7830f67f5254f04a90a2"
@app.route('/brightness',methods = ['POST'])
def brightness():
@@ -13,6 +15,28 @@ def brightness():
status = os.popen('sudo cat /sys/class/backlight/rpi_backlight/brightness').read()
return status
@app.route('/information',methods = ['GET'])
def information():
ip = os.popen("ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'").read()
json = {
"name": name,
"version": version,
"ip": ip
}
return json
@app.route('/connection',methods = ['GET'])
def connection():
if request.method == 'GET':
return "OK"
@app.route('/authentication',methods = ['POST'])
def authentication():
json = request.get_json()
if json['username'] == "npease" and json['password'] == "1118":
return "OK"
else:
return "NO"
@app.route('/audio',methods = ['POST'])
def volume():
@@ -26,14 +50,52 @@ def volume():
level = os.popen('vol').read()
return str(level)
@app.route('/cmd',methods = ['POST'])
def command():
@app.route('/curl',methods = ['POST'])
def curl():
if request.method == 'POST':
json = request.get_json()
output = os.popen("cd /usr/share/dump1090-mutability/html && "+json['command']).read()
output = os.popen("curl "+json['url']).read()
#output = os.popen(json['command']).read()
return str(output)
@app.route('/cputemp',methods = ['GET'])
def cputemp():
if request.method == 'GET':
output = os.popen("vcgencmd measure_temp").read()
return str(output)
@app.route('/update',methods = ['GET'])
def update():
if request.method == 'GET':
output = os.popen("sudo git pull").read()
return str(output)
@app.route('/branch',methods = ['GET'])
def branch():
if request.method == 'GET':
output = os.popen("sudo git branch | grep -F '*'").read()
return str(output)
@app.route('/shutdown',methods = ['GET'])
def shutdown():
if request.method == 'GET':
output = os.popen("cd /usr/local/bin && sudo x728softsd.sh").read()
return str(output)
@app.route('/reboot',methods = ['GET'])
def reboot():
if request.method == 'GET':
output = os.popen("cd /usr/local/bin && sudo reboot").read()
return str(output)
@app.route('/setbranch',methods = ['POST'])
def setbranch():
if request.method == 'POST':
json = request.get_json()
output = os.popen("cd /usr/share/dump1090-mutability/html && sudo git checkout " +json['branch']).read()
return str(output)
@app.after_request
def after_request(response):
+68 -46
View File
@@ -1,47 +1,69 @@
from flask import Flask, json, request
import os
app = Flask(__name__)
@app.route('/brightness',methods = ['POST'])
def brightness():
if request.method == 'POST':
json = request.get_json()
if json['level'] < 255 and json['level'] > 15:
status = os.popen('echo '+str(json['level'])+' > /sys/class/backlight/rpi_backlight/brightness').read()
elif json['level'] == 256:
status = os.popen('sudo cat /sys/class/backlight/rpi_backlight/brightness').read()
return status
@app.route('/audio',methods = ['POST'])
def volume():
if request.method == 'POST':
json = request.get_json()
if json['direction']:
level = os.popen('vol +').read()
elif json['direction'] == 0:
level = os.popen('vol -').read()
elif json['direction'] == 2:
level = os.popen('vol').read()
return str(level)
@app.route('/cmd',methods = ['POST'])
def command():
if request.method == 'POST':
json = request.get_json()
#output = os.popen("cd /usr/share/dump1090-mutability/html && "+json['command']).read()
output = os.popen(json['command']).read()
return str(output)
@app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Methods', 'POST')
return response
if __name__ == '__main__':
from flask import Flask, json, request
import os
app = Flask(__name__)
@app.route('/brightness',methods = ['POST'])
def brightness():
if request.method == 'POST':
json = request.get_json()
if json['level'] < 255 and json['level'] > 15:
status = os.popen('echo '+str(json['level'])+' > /sys/class/backlight/rpi_backlight/brightness').read()
elif json['level'] == 256:
status = os.popen('sudo cat /sys/class/backlight/rpi_backlight/brightness').read()
return status
@app.route('/connection',methods = ['GET'])
def connection():
if request.method == 'GET':
return "OK"
@app.route('/authentication',methods = ['POST'])
def authentication():
json = request.get_json()
if json['username'] == "npease" and json['password'] == "1118":
return "OK"
else:
return "NO"
@app.route('/information',methods = ['GET'])
def information():
ip = os.popen("ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'").read()
json = {
"name": name,
"version": version,
"ip": ip
}
return json
@app.route('/audio',methods = ['POST'])
def volume():
if request.method == 'POST':
json = request.get_json()
if json['direction']:
level = os.popen('vol +').read()
elif json['direction'] == 0:
level = os.popen('vol -').read()
elif json['direction'] == 2:
level = os.popen('vol').read()
return str(level)
@app.route('/cmd',methods = ['POST'])
def command():
if request.method == 'POST':
json = request.get_json()
#output = os.popen("cd /usr/share/dump1090-mutability/html && "+json['command']).read()
output = os.popen(json['command']).read()
return str(output)
@app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Methods', 'POST')
return response
if __name__ == '__main__':
app.run()
+124 -114
View File
@@ -1,114 +1,124 @@
const request = require('request');
const fs = require('fs')
var json = {}
var bounds = {
lat_north: 0,
lat_south: 0,
long_east: 0,
long_west: 0
}
const express = require('express')
const bodyParser = require("body-parser");
const app = express()
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(bodyParser.json());
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
function getData() {
//console.log('http://localhost:7000/data-live.flightradar24.com/zones/fcgi/feed.js?faa=1&bounds='+bounds.lat_north.toFixed(3)+'%2C'+bounds.lat_south.toFixed(3)+'%2C'+bounds.long_east.toFixed(3)+'%2C'+bounds.long_west.toFixed(3)+'&satellite=1&mlat=1&flarm=1&adsb=1&gnd=1&air=1&vehicles=1&estimated=1&maxage=14400&gliders=1&stats=1')
const options = {
url: 'http://localhost:7000/data-live.flightradar24.com/zones/fcgi/feed.js?faa=1&bounds=' + bounds.lat_north.toFixed(3) + '%2C' + bounds.lat_south.toFixed(3) + '%2C' + bounds.long_east.toFixed(3) + '%2C' + bounds.long_west.toFixed(3) + '&satellite=1&mlat=1&flarm=1&adsb=1&gnd=1&air=1&vehicles=1&estimated=1&maxage=14400&gliders=1&stats=1',
headers: {
'x-requested-with': 'request',
"origin": "*"
}
};
request(options, function (error, response, body) {
if (body) {
//console.log(body)
parseData(body)
}
});
}
function parseData(data) {
data = JSON.parse(data)
json.now = new Date()
json.now = json.now.getTime() - json.now.getMilliseconds() / 1000
json.messages = 0
json.aircraft = []
for (element in data) {
if (element != "stats" && element != "full_count" && element != "version") {
json.aircraft.push({
hex: data[element][0].toLowerCase(),
flight: data[element][16],
lat: data[element][1],
lon: data[element][2],
altitude: data[element][4],
track: data[element][3],
speed: data[element][5],
squawk: data[element][6],
seen: 0,
seen_pos: 0,
rssi: 0,
messages: 0,
internet: true,
dep: data[element][11],
arr: data[element][12],
airline: data[element][18]
})
// console.log(element)
//console.log(data[element][1])
//console.log(data[element][2])
}
}
for (element in json.aircraft) {
if (json.aircraft[element].messages != 0) {
json.aircraft[element] = {}
} else {
json.aircraft[element].messages = json.aircraft[element].messages + 1
}
}
// fs.writeFileSync("/run/dump1090-mutability/aircraft1.json", JSON.stringify(json))
fs.writeFileSync("../data/aircraft1.json", JSON.stringify(json))
//console.log(json)
}
function changeTime() {
//fs.readFile('/run/dump1090-mutability/aircraft1.json', 'utf8', function (err,data) {
fs.readFile('../data/aircraft1.json', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
data = JSON.parse(data)
for (element in data.aircraft) {
data.aircraft[element].seen = data.aircraft[element].seen + 1
data.aircraft[element].seen_pos = data.aircraft[element].seen_pos + 1
}
//fs.writeFileSync("/run/dump1090-mutability/aircraft1.json", JSON.stringify(data))
fs.writeFileSync("../data/aircraft1.json", JSON.stringify(data))
});
}
setInterval(function () {
getData()
}, 10000);
setInterval(function () {
changeTime()
}, 1000);
app.post("/internet", function (req, res) {
//console.log(req.body)
bounds = req.body
getData()
return res.send("Recieved")
})
app.listen(8000);
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
const fs = require('fs')
var json = {}
var bounds = {
lat_north: 0,
lat_south: 0,
long_east: 0,
long_west: 0
}
const express = require('express')
const bodyParser = require("body-parser");
const app = express()
var cluster = require('cluster');
if (cluster.isMaster) {
cluster.fork();
cluster.on('exit', function(worker, code, signal) {
cluster.fork();
});
}
if (cluster.isWorker) {
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(bodyParser.json());
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
function getData() {
var xhr = new XMLHttpRequest()
xhr.open("POST", "http://127.0.0.1:5000/cmd", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.timeout = 8000;
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
parseData(xhr.responseText)
}
}
xhr.send(JSON.stringify({
command: 'curl "http://data-live.flightradar24.com/zones/fcgi/feed.js?faa=1&bounds=' + bounds.lat_north.toFixed(3) + '%2C' + bounds.lat_south.toFixed(3) + '%2C' + bounds.long_east.toFixed(3) + '%2C' + bounds.long_west.toFixed(3) + '&satellite=1&mlat=1&flarm=1&adsb=1&gnd=1&air=1&vehicles=1&estimated=1&maxage=14400&gliders=1&stats=1"'
}));
}
function parseData(data) {
data = JSON.parse(data)
json.now = new Date()
json.now = json.now.getTime() - json.now.getMilliseconds() / 1000
json.messages = 0
json.aircraft = []
for (element in data) {
if (element != "stats" && element != "full_count" && element != "version") {
json.aircraft.push({
hex: data[element][0].toLowerCase(),
flight: data[element][16],
lat: data[element][1],
lon: data[element][2],
altitude: data[element][4],
track: data[element][3],
speed: data[element][5],
squawk: data[element][6],
seen: 0,
seen_pos: 0,
rssi: 0,
messages: 0,
internet: true,
dep: data[element][11],
arr: data[element][12],
airline: data[element][18]
})
// console.log(element)
//console.log(data[element][1])
//console.log(data[element][2])
}
}
for (element in json.aircraft) {
if (json.aircraft[element].messages != 0) {
json.aircraft[element] = {}
} else {
json.aircraft[element].messages = json.aircraft[element].messages + 1
}
}
// fs.writeFileSync("/run/dump1090-mutability/aircraft1.json", JSON.stringify(json))
fs.writeFileSync("../data/aircraft1.json", JSON.stringify(json))
//console.log(json)
}
function changeTime() {
//fs.readFile('/run/dump1090-mutability/aircraft1.json', 'utf8', function (err,data) {
fs.readFile('../data/aircraft1.json', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
data = JSON.parse(data)
for (element in data.aircraft) {
data.aircraft[element].seen = data.aircraft[element].seen + 1
data.aircraft[element].seen_pos = data.aircraft[element].seen_pos + 1
}
//fs.writeFileSync("/run/dump1090-mutability/aircraft1.json", JSON.stringify(data))
fs.writeFileSync("../data/aircraft1.json", JSON.stringify(data))
});
}
setInterval(function () {
getData()
}, 10000);
setInterval(function () {
changeTime()
}, 1000);
app.post("/internet", function (req, res) {
//console.log(req.body)
bounds = req.body
getData()
return res.send("Recieved")
})
app.listen(8000);
}
+17 -17
View File
@@ -1,17 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\mime\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\mime\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
+17 -17
View File
@@ -1,17 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
+17 -17
View File
@@ -1,17 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
+17 -17
View File
@@ -1,17 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
+17 -17
View File
@@ -1,17 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\uuid\bin\uuid" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\uuid\bin\uuid" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
+10
View File
@@ -283,6 +283,11 @@
"unpipe": "~1.0.0"
}
},
"flask": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/flask/-/flask-0.2.10.tgz",
"integrity": "sha1-9fWkLP1YownjfGfAo5YXqBnl4bc="
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@@ -330,6 +335,11 @@
"har-schema": "^2.0.0"
}
},
"http": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz",
"integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g=="
},
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
+24 -24
View File
@@ -1,24 +1,24 @@
MODE=$1
if [ $MODE == "aircraft" ]
then
echo "Aircraft"
sudo systemctl enable dump1090-mutability
sudo mv /home/pi/.config/Start_Aircraft.desktop /home/pi/.config/autostart/Start_Aircraft.desktop
sudo mv /home/pi/.config/autostart/Start_Radio.desktop /home/pi/.config/Start_Radio.desktop
sudo mv /home/pi/Desktop/.Files/*.desktop /home/pi/Desktop/
env DISPLAY=:0.0 pcmanfm -w /usr/share/dump1090-mutability/html/images/logo.png
sudo reboot
fi
if [ $MODE == "radio" ]
then
echo "Radio"
sudo systemctl enable dump1090-mutability
sudo mv /home/pi/.config/Start_Radio.desktop /home/pi/.config/autostart/Start_Radio.desktop
sudo mv /home/pi/.config/autostart/Start_Aircraft.desktop /home/pi/.config/Start_Aircraft.desktop
env DISPLAY=:0.0 pcmanfm -w /usr/share/dump1090-mutability/html/images/psplogo.png
sudo mv /home/pi/Desktop/*.desktop /home/pi/Desktop/.Files/
sudo reboot
fi
MODE=$1
if [ $MODE == "aircraft" ]
then
echo "Aircraft"
sudo systemctl enable dump1090-mutability
sudo mv /home/pi/.config/Start_Aircraft.desktop /home/pi/.config/autostart/Start_Aircraft.desktop
sudo mv /home/pi/.config/autostart/Start_Radio.desktop /home/pi/.config/Start_Radio.desktop
sudo mv /home/pi/Desktop/.Files/*.desktop /home/pi/Desktop/
env DISPLAY=:0.0 pcmanfm -w /usr/share/dump1090-mutability/html/images/logo.png
sudo reboot
fi
if [ $MODE == "radio" ]
then
echo "Radio"
sudo systemctl enable dump1090-mutability
sudo mv /home/pi/.config/Start_Radio.desktop /home/pi/.config/autostart/Start_Radio.desktop
sudo mv /home/pi/.config/autostart/Start_Aircraft.desktop /home/pi/.config/Start_Aircraft.desktop
env DISPLAY=:0.0 pcmanfm -w /usr/share/dump1090-mutability/html/images/psplogo.png
sudo mv /home/pi/Desktop/*.desktop /home/pi/Desktop/.Files/
sudo reboot
fi
+2 -1
View File
@@ -1,6 +1,7 @@
sudo python /usr/share/dump1090-mutability/html/python/battery.py & > /dev/null 2>&1 &
sudo python /usr/share/dump1090-mutability/html/python/api.py & > /dev/null 2>&1 &
sudo node /usr/share/dump1090-mutability/html/scripts/internet_data.js & > /usr/share/dump1090-mutability/html/scripts/log &
sudo node /usr/share/dump1090-mutability/html/scripts/internet_data.js & > /dev/null 2>&1 &
/usr/bin/wget http://server1.nicholaspease.com:6500/reports/liveatc.json -O /home/pi/dump1090-info/liveatc.json
export PORT=8080
sudo node /home/pi/cors-anywhere/server.js