diff --git a/css/ui1-dark.css b/css/ui1-dark.css index 7138fa7..3b09096 100644 --- a/css/ui1-dark.css +++ b/css/ui1-dark.css @@ -1,833 +1,806 @@ -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; -} - - -#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; - } +html, +body +{ + background-color: #000000; + color: white; + font-family: Tahoma, Sans-Serif; + font-size: 10pt; + height: 100%; + margin: 0; + padding: 0; +} +#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; +} +#power_modal > .modal-content +{ + background-color: #000; + font-size: 18px; + height: 30%; + left: 25%; + line-height: 45px; + position: absolute; + text-align: center; + top: 25%; + width: 50%; +} +#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; + border: 1px solid white; + border-radius: 25px; + height: 20px; + margin: 4px; + padding: 4px; + padding-left: 10px; + text-decoration: none; +} +#branch_button +{ + background-color: white; +} +div#nav_bar +{ + background: black; + border-bottom: 2px solid white; + color: white; + height: 40px; + left: 0px; + padding: 5px; + position: fixed; + top: 0px; + width: 100%; + z-index: 1; +} +div#itinerary_body +{ + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} +img#aircraft_image +{ + height: auto; + max-width: 100%; +} +div#map_container +{ + height: 100%; + position: fixed; + top: 50px; + width: 100%; +} +.subtab_button +{ + width: 25%; +} +div#graphs_body +{ + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} +div#graphs_body +{ + overflow: hidden; +} +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%; +} +#arrow_back_graphs +{ + left: 10px; + position: absolute; + 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 +{ + margin-left: 20px; + width: 100px; +} +div#subtab_buttons +{ + background: black; + bottom: 0px; + padding: 5px; + position: fixed; + width: 100%; + z-index: 1; +} +div#map_canvas +{ + height: 100%; + margin-right: 390px; +} +div#sidebar_container +{ + height: 90%; + position: absolute; + right: 0px; + top: 50px; + width: 390px; +} +#nav_bar.divider +{ + width: 25px; +} +.pointer +{ + cursor: pointer; +} +.noselect +{ + khtml-user-select: none; + moz-user-select: none; + ms-user-select: none; + user-select: none; + webkit-touch-callout: none; + webkit-user-select: none; +} +.space +{ + display: inline-block; + margin: auto; + padding-bottom: 0px; + padding-right: 20px; + padding-top: 0px; + width: fit-content; +} +#planes_table > tr > td +{ + border-bottom: solid white .5px; + text-align: center; +} +.space-nopad +{ + display: inline-block; + margin: auto; + width: fit-content; +} +.center +{ + display: table-cell; + vertical-align: middle; +} +#radar_aircraft_tab +{ + line-height: 17px; +} +#img_button +{ + bottom: 50px; + position: fixed; + right: 10%; +} +#aircraft_button +{ + bottom: 49px; + position: fixed; + right: 14%; +} +#info_button +{ + bottom: 5px; + position: absolute; + right: 10px; +} +#info_icon +{ + bottom: 5px; + position: absolute; + right: 10px; +} +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#loader +{ + background: #000; + bottom: 0; + filter: alpha(opacity=100); + left: 0; + opacity: 1; + position: absolute; + right: 0; + top: 0; + z-index: 99; +} +#spinny +{ + height: 128px; + left: 50%; + margin: -64px 0 0 -64px; + position: absolute; + top: 50%; + width: 128px; +} +#loader_progress +{ + height: 20px; + left: 50%; + margin: 128px 0 0 -125px; + position: absolute; + top: 50%; + width: 250px; +} +#tableinfo, +#sudo_buttons +{ + font-family: monospace; + font-size: x-small; +} +.vPosition +{ + background-color: #d5ffd5; + font-weight: bold; +} +.mlat +{ + background-color: #d5d5ff; + font-weight: bold; +} +.squawk7500 +{ + background-color: #ff5555; + font-weight: bold; +} +.squawk7600 +{ + background-color: #00ffff; + font-weight: bold; +} +.squawk7700 +{ + background-color: #ffff00; + font-weight: bold; +} +.selected +{ + background-color: #dddddd; +} +.plane_table_row +{ + background-color: black; + border: white; + cursor: pointer; +} +.hidden +{ + display: none; +} +.infoblock_heading +{ + font-size: larger; +} +.infoblock_heading a +{ + color: blue; + font-size: x-small; + text-decoration: none; +} +.infoblock_body +{ + font-size: medium; +} +#selected_icao +{ + font-size: x-small; +} +#selected_registration +{ + font-size: x-small; +} +#selected_icaotype +{ + font-size: x-small; +} +.dim +{ + filter: alpha(opacity=30); + opacity: 0.3; +} +.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; + line-height: 40px; + text-decoration: bold; +} +#aircraft_name_css +{ + font-size: 30px; + line-height: 25px; + white-space: nowrap; +} +#modal3_title +{ + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} +.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; +} +.modal +{ + background-color: rgb(0, 0, 0); + background-color: rgba(0, 0, 0, 0.4); + 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%; +} +.close +{ + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} +.close:hover, +.close:focus +{ + color: black; + cursor: pointer; + text-decoration: none; +} +.logo +{ + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 10%; + width: 80%; +} +.settingslogo +{ + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 2%; + width: 40%; +} +.settingstext +{ + margin-left: auto; + margin-right: auto; + text-align: center; +} +.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 +{ + background-color: white; + left: 50%; + position: relative; + right: 50%; +} +#settingstext>table>tbody>tr>td +{ + padding: 15px; +} +#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; +} +#home_page>table>tbody>tr>td>img +{ + width: 100%; +} +#arrivals +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#departures +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#sch-arrivals +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#sch-departures +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +.airportBoard +{ + border: white solid 2px; +} +#aircraft_image1 +{ + width: 100%; +} +#aircraft_image2 +{ + bottom: 12%; + left: 5%; + position: absolute; + width: 24.5%; +} +#aircraft_image3 +{ + bottom: 12%; + left: 30.5%; + position: absolute; + width: 24.5%; +} +#aircraft_image4 +{ + bottom: 12%; + left: 56%; + position: absolute; + width: 24.5%; +} +#itinerary_loading +{ + position: fixed; + width: 100%; +} +#flight_progress_circle +{ + position: absolute; + right: 25%; + top: 10%; +} +#flight_progress_title +{ + font-size: 18px; + position: absolute; + right: 5%; + top: 22%; +} +#flight_progress_elapsed_title +{ + font-size: 18px; + left: 68%; + position: absolute; + top: 40%; +} +#flight_progress_remaining_title +{ + font-size: 18px; + left: 67%; + position: absolute; + top: 53%; +} +#flight_progress_time_title +{ + font-size: 18px; + left: 67%; + position: absolute; + top: 66%; +} +#flight_progress_elapsed_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 45%; +} +#flight_progress_remaining_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 58%; +} +#flight_progress_time_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 71%; +} +#aircraft_name_title +{ + font-size: 18px; + left: 66%; + position: absolute; + top: 20%; +} +#aircraft_model_title +{ + font-size: 18px; + left: 66%; + position: absolute; + top: 33%; +} +#aircraft_registration_title +{ + font-size: 18px; + left: 64%; + position: absolute; + top: 46%; +} +#aircraft_name_addl +{ + font-size: 20px; + font-weight: bold; + left: 67%; + position: absolute; + top: 25%; +} +#aircraft_model +{ + font-size: 20px; + font-weight: bold; + left: 69.5%; + position: absolute; + top: 38%; +} +#aircraft_registration +{ + font-size: 20px; + font-weight: bold; + left: 69%; + position: absolute; + top: 51%; +} +#external_connected +{ + background-color: black; + color: red; + font-size: xx-large; + font-weight: bold; + height: 100%; + text-align: center; + width: 100%; +} +#external_title +{ + animation: blinkingText 1s infinite; + left: 22%; + position: absolute; + top: 55%; +} +#external_image +{ + animation: blinkingText 1s infinite; + left: 43%; + position: absolute; + top: 30%; +} +@keyframes blinkingText +{ + 0% + { + opacity: 0; + } + 50% + { + opacity: 1; + } + 100% + { + opacity: 0; + } } \ No newline at end of file diff --git a/css/ui1-light.css b/css/ui1-light.css index f15a7ce..5410ffd 100644 --- a/css/ui1-light.css +++ b/css/ui1-light.css @@ -1,782 +1,756 @@ -html, -body { - margin: 0; - padding: 0; - background-color: #ffffff; - font-family: Tahoma, Sans-Serif; - font-size: 10pt; - height: 100%; -} - -#power_modal > .modal-content { - width: 50%; - height: 30%; - top: 25%; - left: 25%; - position: absolute; - text-align: center; - line-height: 45px; - font-size: 18px; -} - -#power_table { - width: 100%; -} - -#lock_button { - position: relative; - left: 70%; - top: -70px; - z-index: 1; - line-height: 0%; - margin-bottom: -80px; -} - -#atc_title, #atc_location { - padding-left: 2px; -} - -#audioControl { - position: absolute; - right: 25px; - top: 30px; -} - -div.atc_state { - background-color: #ffffffa6; - height: 20px; - border: 1px solid black; - padding: 4px; - padding-left: 10px; - margin: 4px; - border-radius: 25px; - text-decoration: none; - -} - -div#nav_bar { - position: fixed; - top: 0px; - left: 0px; - width: 100%; - height: 40px; - border: 2px solid black; - padding: 5px; - z-index: 1; - background: white; -} - -#planes_table { - cursor: pointer; -} - - - -#planes_table > tr > td { - border-bottom: solid black .5px; - text-align: center; -} - -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: white; -} - -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; -} - -.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; -} - -.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%; -} - -#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: black 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%; -} - -#metar_loading { - top: 4px; -} - -#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; - } +html, +body +{ + background-color: #ffffff; + font-family: Tahoma, Sans-Serif; + font-size: 10pt; + height: 100%; + margin: 0; + padding: 0; +} +#power_modal > .modal-content +{ + font-size: 18px; + height: 30%; + left: 25%; + line-height: 45px; + position: absolute; + text-align: center; + top: 25%; + width: 50%; +} +#power_table +{ + width: 100%; +} +#lock_button +{ + left: 70%; + line-height: 0%; + margin-bottom: -80px; + position: relative; + top: -70px; + z-index: 1; +} +#atc_title, #atc_location +{ + padding-left: 2px; +} +#audioControl +{ + position: absolute; + right: 25px; + top: 30px; +} +div.atc_state +{ + background-color: #ffffffa6; + border: 1px solid black; + border-radius: 25px; + height: 20px; + margin: 4px; + padding: 4px; + padding-left: 10px; + text-decoration: none; +} +div#nav_bar +{ + background: white; + border: 2px solid black; + height: 40px; + left: 0px; + padding: 5px; + position: fixed; + top: 0px; + width: 100%; + z-index: 1; +} +#planes_table +{ + cursor: pointer; +} +#planes_table > tr > td +{ + border-bottom: solid black .5px; + text-align: center; +} +div#itinerary_body +{ + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} +img#aircraft_image +{ + height: auto; + max-width: 100%; +} +div#map_container +{ + height: 100%; + position: fixed; + top: 50px; + width: 100%; +} +.subtab_button +{ + width: 25%; +} +div#graphs_body +{ + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} +div#graphs_body +{ + overflow: hidden; +} +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%; +} +#arrow_back_graphs +{ + left: 10px; + position: absolute; + 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 +{ + margin-left: 20px; + width: 100px; +} +div#subtab_buttons +{ + background: white; + bottom: 0px; + padding: 5px; + position: fixed; + width: 100%; + z-index: 1; +} +div#map_canvas +{ + height: 100%; + margin-right: 390px; +} +div#sidebar_container +{ + height: 90%; + position: absolute; + right: 0px; + top: 50px; + width: 390px; +} +#nav_bar.divider +{ + width: 25px; +} +.pointer +{ + cursor: pointer; +} +.noselect +{ + khtml-user-select: none; + moz-user-select: none; + ms-user-select: none; + user-select: none; + webkit-touch-callout: none; + webkit-user-select: none; +} +.space +{ + display: inline-block; + margin: auto; + padding-bottom: 0px; + padding-right: 20px; + padding-top: 0px; + width: fit-content; +} +.space-nopad +{ + display: inline-block; + margin: auto; + width: fit-content; +} +.center +{ + display: table-cell; + vertical-align: middle; +} +#radar_aircraft_tab +{ + line-height: 17px; +} +#img_button +{ + bottom: 50px; + position: fixed; + right: 10%; +} +#aircraft_button +{ + bottom: 49px; + position: fixed; + right: 14%; +} +#info_button +{ + bottom: 5px; + position: absolute; + right: 10px; +} +#info_icon +{ + bottom: 5px; + position: absolute; + right: 10px; +} +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#loader +{ + background: #000; + bottom: 0; + filter: alpha(opacity=100); + left: 0; + opacity: 1; + position: absolute; + right: 0; + top: 0; + z-index: 99; +} +#spinny +{ + height: 128px; + left: 50%; + margin: -64px 0 0 -64px; + position: absolute; + top: 50%; + width: 128px; +} +#loader_progress +{ + height: 20px; + left: 50%; + margin: 128px 0 0 -125px; + position: absolute; + top: 50%; + width: 250px; +} +#tableinfo, +#sudo_buttons +{ + font-family: monospace; + font-size: x-small; +} +.vPosition +{ + background-color: #d5ffd5; + font-weight: bold; +} +.mlat +{ + background-color: #d5d5ff; + font-weight: bold; +} +.squawk7500 +{ + background-color: #ff5555; + font-weight: bold; +} +.squawk7600 +{ + background-color: #00ffff; + font-weight: bold; +} +.squawk7700 +{ + background-color: #ffff00; + font-weight: bold; +} +.selected +{ + background-color: #dddddd; +} +.plane_table_row +{ + cursor: pointer; +} +.hidden +{ + display: none; +} +.infoblock_heading +{ + font-size: larger; +} +.infoblock_heading a +{ + color: blue; + font-size: x-small; + text-decoration: none; +} +.infoblock_body +{ + font-size: medium; +} +#selected_icao +{ + font-size: x-small; +} +#selected_registration +{ + font-size: x-small; +} +#selected_icaotype +{ + font-size: x-small; +} +.dim +{ + filter: alpha(opacity=30); + opacity: 0.3; +} +.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; + line-height: 40px; + text-decoration: bold; +} +#aircraft_name_css +{ + font-size: 30px; + line-height: 25px; + white-space: nowrap; +} +#modal3_title +{ + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} +.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; +} +.modal +{ + background-color: rgb(0, 0, 0); + background-color: rgba(0, 0, 0, 0.4); + 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%; +} +.close +{ + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} +.close:hover, +.close:focus +{ + color: black; + cursor: pointer; + text-decoration: none; +} +.logo +{ + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 10%; + width: 80%; +} +.settingslogo +{ + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 2%; + width: 40%; +} +.settingstext +{ + margin-left: auto; + margin-right: auto; + text-align: center; +} +.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 +{ + left: 50%; + position: relative; + right: 50%; +} +#settingstext>table>tbody>tr>td +{ + padding: 15px; +} +#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; +} +#home_page>table>tbody>tr>td>img +{ + width: 100%; +} +#arrivals +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#departures +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#sch-arrivals +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +#sch-departures +{ + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} +.airportBoard +{ + border: black solid 2px; +} +#aircraft_image1 +{ + width: 100%; +} +#aircraft_image2 +{ + bottom: 12%; + left: 5%; + position: absolute; + width: 24.5%; +} +#aircraft_image3 +{ + bottom: 12%; + left: 30.5%; + position: absolute; + width: 24.5%; +} +#aircraft_image4 +{ + bottom: 12%; + left: 56%; + position: absolute; + width: 24.5%; +} +#metar_loading +{ + top: 4px; +} +#itinerary_loading +{ + position: fixed; + width: 100%; +} +#flight_progress_circle +{ + position: absolute; + right: 25%; + top: 10%; +} +#flight_progress_title +{ + font-size: 18px; + position: absolute; + right: 5%; + top: 22%; +} +#flight_progress_elapsed_title +{ + font-size: 18px; + left: 68%; + position: absolute; + top: 40%; +} +#flight_progress_remaining_title +{ + font-size: 18px; + left: 67%; + position: absolute; + top: 53%; +} +#flight_progress_time_title +{ + font-size: 18px; + left: 67%; + position: absolute; + top: 66%; +} +#flight_progress_elapsed_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 45%; +} +#flight_progress_remaining_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 58%; +} +#flight_progress_time_amount +{ + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 71%; +} +#aircraft_name_title +{ + font-size: 18px; + left: 66%; + position: absolute; + top: 20%; +} +#aircraft_model_title +{ + font-size: 18px; + left: 66%; + position: absolute; + top: 33%; +} +#aircraft_registration_title +{ + font-size: 18px; + left: 64%; + position: absolute; + top: 46%; +} +#aircraft_name_addl +{ + font-size: 20px; + font-weight: bold; + left: 67%; + position: absolute; + top: 25%; +} +#aircraft_model +{ + font-size: 20px; + font-weight: bold; + left: 69.5%; + position: absolute; + top: 38%; +} +#aircraft_registration +{ + font-size: 20px; + font-weight: bold; + left: 69%; + position: absolute; + top: 51%; +} +#external_connected +{ + background-color: black; + color: red; + font-size: xx-large; + font-weight: bold; + height: 100%; + text-align: center; + width: 100%; +} +#external_title +{ + animation: blinkingText 1s infinite; + left: 22%; + position: absolute; + top: 55%; +} + + +#external_image +{ + animation: blinkingText 1s infinite; + left: 43%; + position: absolute; + top: 30%; +} +@keyframes blinkingText +{ + 0% + { + opacity: 0; + } + 50% + { + opacity: 1; + } + 100% + { + opacity: 0; + } } \ No newline at end of file diff --git a/css/ui2-dark.css b/css/ui2-dark.css new file mode 100644 index 0000000..e86c771 --- /dev/null +++ b/css/ui2-dark.css @@ -0,0 +1,1211 @@ +#aircraft_button { + bottom: 49px; + position: fixed; + right: 14%; +} + +#aircraft_image1 { + width: 100%; +} + +#aircraft_image2 { + bottom: 12%; + left: 5%; + position: absolute; + width: 24.5%; +} + +#aircraft_image3 { + bottom: 12%; + left: 30.5%; + position: absolute; + width: 24.5%; +} + +#aircraft_image4 { + bottom: 12%; + left: 56%; + position: absolute; + width: 24.5%; +} + +#aircraft_info_overlay { + color: rgba(255, 255, 255, .7); + font-size: large; + position: absolute; + top: 175px; +} + +#aircraft_model { + font-size: 20px; + font-weight: bold; + left: 69.5%; + position: absolute; + top: 38%; +} + +#aircraft_model_title { + font-size: 18px; + left: 66%; + position: absolute; + top: 33%; +} + +#aircraft_name_addl { + font-size: 20px; + font-weight: bold; + left: 67%; + position: absolute; + top: 25%; +} + +#aircraft_name_css { + font-size: 30px; + line-height: 25px; + white-space: nowrap; +} + +#aircraft_name_title { + font-size: 18px; + left: 66%; + position: absolute; + top: 20%; +} + +#aircraft_registration { + font-size: 20px; + font-weight: bold; + left: 69%; + position: absolute; + top: 51%; +} + +#aircraft_registration_title { + font-size: 18px; + left: 64%; + position: absolute; + top: 46%; +} + +#aircraft_tab_background { + filter: brightness(50%); + height: 225px; + width: 400px; +} + +#arrivals { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#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; +} + +#departures { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#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%; +} + +#flight_progress_circle { + position: absolute; + right: 25%; + top: 10%; +} + +#flight_progress_div { + color: black; +} + +#flight_progress_elapsed_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 45%; +} + +#flight_progress_elapsed_title { + font-size: 18px; + left: 68%; + position: absolute; + top: 40%; +} + +#flight_progress_remaining_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 58%; +} + +#flight_progress_remaining_title { + font-size: 18px; + left: 67%; + position: absolute; + top: 53%; +} + +#flight_progress_time_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 71%; +} + +#flight_progress_time_title { + font-size: 18px; + left: 67%; + position: absolute; + top: 66%; +} + +#flight_progress_title { + font-size: 18px; + position: absolute; + right: 5%; + top: 22%; +} + +#home_page { + overflow: hidden; +} + +#home_page>table>tbody>tr>td>img { + width: 100%; +} + +#img_button { + bottom: 70px; + position: fixed; + right: 10%; +} + +#info_button { + bottom: 5px; + position: absolute; + right: 10px; +} + +#info_icon { + bottom: 5px; + position: absolute; + right: 10px; +} + +#arrivals {} + +#loader_progress { + height: 20px; + left: 50%; + margin: 128px 0 0 -125px; + position: absolute; + top: 50%; + width: 250px; +} + +#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; +} + +#modal2_title { + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} + +#modal3_title { + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} + +#nav_bar.divider { + width: 25px; +} + +#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; +} + +#planestable { + height: 200px; +} + +#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%; +} + +#radar_aircraft_tab { + line-height: 17px; +} + +#sch-arrivals { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#sch-departures { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#selected_icao { + font-size: x-small; +} + +#selected_icaotype { + font-size: x-small; +} + +#selected_position { + left: 138px; + position: absolute; + top: 228px; +} + +#selected_registration { + font-size: x-small; +} + +#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; +} + +#spinny { + height: 128px; + left: 50%; + margin: -64px 0 0 -64px; + position: absolute; + top: 50%; + width: 128px; +} + +#tableinfo, +#sudo_buttons { + font-family: monospace; + font-size: x-small; +} + +#tableinfo::-webkit-scrollbar { + display: none; +} + +#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; +} + +.itinheader { + background-color: rgba(255, 255, 255, .7); + 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; +} + +.mainHeader { + display: none; +} + +.center { + display: table-cell; + vertical-align: middle; +} + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + cursor: pointer; + text-decoration: none; +} + +.dim { + filter: alpha(opacity=30); + opacity: 0.3; +} + +.hidden { + display: none; +} + +.home_table { + margin-left: auto; + margin-right: auto; + width: 60%; +} + +.infoblock_body { + font-size: medium; +} + +.infoblock_heading { + font-size: larger; +} + +.infoblock_heading a { + color: blue; + font-size: x-small; + text-decoration: none; +} + +.logo { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 10%; + width: 80%; +} + +.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; +} + +.mlat { + background-color: #d5d5ff; + font-weight: bold; +} + +.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 { + khtml-user-select: none; + moz-user-select: none; + ms-user-select: none; + user-select: none; + webkit-touch-callout: none; + webkit-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; +} + +.selected { + background-color: #dddddd; +} + +.settingslogo { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 2%; + width: 40%; +} + +.settingstext { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.space { + display: inline-block; + margin: auto; + padding-bottom: 0px; + padding-right: 20px; + padding-top: 0px; + width: fit-content; +} + +.space-nopad { + display: inline-block; + margin: auto; + width: fit-content; +} + +.squawk7500 { + background-color: #ff5555; + font-weight: bold; +} + +.squawk7600 { + background-color: #00ffff; + font-weight: bold; +} + +.squawk7700 { + background-color: #ffff00; + font-weight: bold; +} + +.subtab_button { + width: 25%; +} + +.vPosition { + background-color: #d5ffd5; + font-weight: bold; +} + +@keyframes blinkingText { + 0% { + opacity: 0; + } + + 100% { + opacity: 0; + } + + 50% { + opacity: 1; + } +} + +div#graphs_body { + overflow: hidden; +} + +div#graphs_body { + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} + +div#itinerary_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 20px 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; +} + +#itin_title { + color: rgba(255, 255, 255, .7); + position: absolute; + right: 10px; + top: -18px; +} + +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%; + ms-overflow-style: none; + overflow: auto; + position: absolute; + right: 5px; + scrollbar-width: none; + 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#subtab_buttons { + background: transparent; + bottom: 15px; + display: none; + padding: 5px; + position: fixed; + width: 100%; + z-index: 1; +} + +div#subtab_buttons>button { + margin-left: 20px; + width: 100px; +} + +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_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%; +} + +#itin_airport_name { + font-size: 46px; + font-weight: bold; + left: 5px; + position: absolute; + top: 15px; +} + + +#itin_arrivals { + bottom: 10px; + left: 10px; + position: absolute; +} + +#itin_back { + top: 72px; + left: 10px; + position: absolute; +} + +#itin_departures { + bottom: 10px; + position: absolute; + right: 10px; +} + +#itin_info button { + background-color: rgba(0, 0, 0, .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); +} +#radar_flight_tab_button { + color: rgba(255, 255, 255, .7); +} +#radar_aircraft_tab_button { + color: rgba(255, 255, 255, .7); +} +#radar_radar_tab_button { + color: rgba(255, 255, 255, .7); +} + +#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#aircraft_image { + height: auto; + max-width: 100%; +} + +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; +} \ No newline at end of file diff --git a/css/ui2-light.css b/css/ui2-light.css index f316678..05cea88 100644 --- a/css/ui2-light.css +++ b/css/ui2-light.css @@ -1,1139 +1,1138 @@ -#aircraft_button { - bottom: 49px; - position: fixed; - right: 14%; -} - -#aircraft_image1 { - width: 100%; -} - -#aircraft_image2 { - bottom: 12%; - left: 5%; - position: absolute; - width: 24.5%; -} - -#aircraft_image3 { - bottom: 12%; - left: 30.5%; - position: absolute; - width: 24.5%; -} - -#aircraft_image4 { - bottom: 12%; - left: 56%; - position: absolute; - width: 24.5%; -} - -#aircraft_info_overlay { - color: white; - font-size: large; - position: absolute; - top: 175px; -} - -#aircraft_model { - font-size: 20px; - font-weight: bold; - left: 69.5%; - position: absolute; - top: 38%; -} - -#aircraft_model_title { - font-size: 18px; - left: 66%; - position: absolute; - top: 33%; -} - -#aircraft_name_addl { - font-size: 20px; - font-weight: bold; - left: 67%; - position: absolute; - top: 25%; -} - -#aircraft_name_css { - font-size: 30px; - line-height: 25px; - white-space: nowrap; -} - -#aircraft_name_title { - font-size: 18px; - left: 66%; - position: absolute; - top: 20%; -} - -#aircraft_registration { - font-size: 20px; - font-weight: bold; - left: 69%; - position: absolute; - top: 51%; -} - -#aircraft_registration_title { - font-size: 18px; - left: 64%; - position: absolute; - top: 46%; -} - -#aircraft_tab_background { - filter: brightness(50%); - height: 225px; - width: 400px; -} - -#arrivals { - display: inline-table; - margin: auto; - padding: 5px; - width: fit-content; -} - -#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; -} - -#departures { - display: inline-table; - margin: auto; - padding: 5px; - width: fit-content; -} - -#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%; -} - -#external_mode_button { - left: 50%; - position: relative; - right: 50%; -} - -#external_title { - animation: blinkingText 1s infinite; - left: 22%; - position: absolute; - top: 55%; -} - -#flight_progress_circle { - position: absolute; - right: 25%; - top: 10%; -} - -#flight_progress_div { - color: black; -} - -#flight_progress_elapsed_amount { - font-size: 20px; - font-weight: bold; - left: 64%; - position: absolute; - top: 45%; -} - -#flight_progress_elapsed_title { - font-size: 18px; - left: 68%; - position: absolute; - top: 40%; -} - -#flight_progress_remaining_amount { - font-size: 20px; - font-weight: bold; - left: 64%; - position: absolute; - top: 58%; -} - -#flight_progress_remaining_title { - font-size: 18px; - left: 67%; - position: absolute; - top: 53%; -} - -#flight_progress_time_amount { - font-size: 20px; - font-weight: bold; - left: 64%; - position: absolute; - top: 71%; -} - -#flight_progress_time_title { - font-size: 18px; - left: 67%; - position: absolute; - top: 66%; -} - -#flight_progress_title { - font-size: 18px; - position: absolute; - right: 5%; - top: 22%; -} - -#home_page { - overflow: hidden; -} - -#home_page>table>tbody>tr>td>img { - width: 100%; -} - -#img_button { - bottom: 70px; - position: fixed; - right: 10%; -} - -#info_button { - bottom: 5px; - position: absolute; - right: 10px; -} - -#info_icon { - bottom: 5px; - position: absolute; - right: 10px; -} - -#arrivals {} - -#loader_progress { - height: 20px; - left: 50%; - margin: 128px 0 0 -125px; - position: absolute; - top: 50%; - width: 250px; -} - -#lock_button { - background-color: rgba(255, 255, 255, .3); - line-height: 0%; - margin-bottom: -80px; - position: absolute; - right: 6px; - top: 181px; - z-index: 1; - z-index: 2; -} - -#metar_loading { - top: 4px; -} - -#modal2_title { - font-size: 30px; - line-height: 40px; - text-decoration: bold; -} - -#modal3_title { - font-size: 30px; - line-height: 40px; - text-decoration: bold; -} - -#nav_bar.divider { - width: 25px; -} - -#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; -} - -#planestable { - height: 200px; -} - -#power_button { - position: absolute; - right: 4px; - top: 5px; -} - -#power_modal>.modal-content { - background-color: rgba(255, 255, 255, 0.9); - border-radius: 8px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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%; -} - -#radar_aircraft_tab { - line-height: 17px; -} - -#sch-arrivals { - display: inline-table; - margin: auto; - padding: 5px; - width: fit-content; -} - -#sch-departures { - display: inline-table; - margin: auto; - padding: 5px; - width: fit-content; -} - -#selected_icao { - font-size: x-small; -} - -#selected_icaotype { - font-size: x-small; -} - -#selected_position { - left: 138px; - position: absolute; - top: 228px; -} - -#selected_registration { - font-size: x-small; -} - -#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(0, 0, 0, .7); - cursor: pointer; - position: fixed; - right: 5px; - z-index: inherit; -} - -#sidebar_open_button { - background-color: rgba(255, 255, 255, 0.8); - border-bottom-left-radius: 4px; - border-top-left-radius: 4px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - cursor: pointer; - height: 25%; - padding: 2px; - position: absolute; - right: 0; - top: 40%; - width: 25px; - z-index: 2; -} - -#spinny { - height: 128px; - left: 50%; - margin: -64px 0 0 -64px; - position: absolute; - top: 50%; - width: 128px; -} - -#tableinfo, -#sudo_buttons { - font-family: monospace; - font-size: x-small; -} - -#tableinfo::-webkit-scrollbar { - display: none; -} - -#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: white; - color: black; - font-weight: bolder; - text-transform: uppercase; -} - -.itinheader { - background-color: white; - 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%; -} - -.mainHeader { - display: none; -} - -.center { - display: table-cell; - vertical-align: middle; -} - -.close { - color: #aaa; - float: right; - font-size: 28px; - font-weight: bold; -} - -.close:hover, -.close:focus { - color: black; - cursor: pointer; - text-decoration: none; -} - -.dim { - filter: alpha(opacity=30); - opacity: 0.3; -} - -.hidden { - display: none; -} - -.home_table { - margin-left: auto; - margin-right: auto; - width: 60%; -} - -.infoblock_body { - font-size: medium; -} - -.infoblock_heading { - font-size: larger; -} - -.infoblock_heading a { - color: blue; - font-size: x-small; - text-decoration: none; -} - -.logo { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 10%; - width: 80%; -} - -.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; -} - -.mlat { - background-color: #d5d5ff; - font-weight: bold; -} - -.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 { - khtml-user-select: none; - moz-user-select: none; - ms-user-select: none; - user-select: none; - webkit-touch-callout: none; - webkit-user-select: none; -} - -.plane_table_row { - cursor: pointer; -} - -.pointer { - cursor: pointer; -} - -.pointer { - cursor: pointer; -} - -.selected { - background-color: #dddddd; -} - -.settingslogo { - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 2%; - width: 40%; -} - -.settingstext { - margin-left: auto; - margin-right: auto; - text-align: center; -} - -.space { - display: inline-block; - margin: auto; - padding-bottom: 0px; - padding-right: 20px; - padding-top: 0px; - width: fit-content; -} - -.space-nopad { - display: inline-block; - margin: auto; - width: fit-content; -} - -.squawk7500 { - background-color: #ff5555; - font-weight: bold; -} - -.squawk7600 { - background-color: #00ffff; - font-weight: bold; -} - -.squawk7700 { - background-color: #ffff00; - font-weight: bold; -} - -.subtab_button { - width: 25%; -} - -.vPosition { - background-color: #d5ffd5; - font-weight: bold; -} - -@keyframes blinkingText { - 0% { - opacity: 0; - } - - 100% { - opacity: 0; - } - - 50% { - opacity: 1; - } -} - -div#graphs_body { - overflow: hidden; -} - -div#graphs_body { - height: 100%; - position: absolute; - top: 50px; - width: 100%; -} - -div#itinerary_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%; -} - -div#nav_bar { - background: rgba(255, 255, 255, 0.8); - border-radius: 5px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - height: 40px; - left: 10%; - padding: 5px; - position: fixed; - top: 5px; - width: 80%; - z-index: 1; -} - -div#itin_nav_bar { - background: rgba(255, 255, 255, 0.8); - border-radius: 5px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - height: 40px; - left: 10%; - padding: 5px; - position: fixed; - top: 5px; - width: 80%; - z-index: 1; -} - -#itin_title { - color: rgba(0, 0, 0, .7); - position: absolute; - right: 10px; - top: -18px; -} - -div#sidebar_container { - background-color: rgba(255, 255, 255, .9); - border-radius: 8px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - display: none; - height: 85%; - ms-overflow-style: none; - overflow: auto; - position: absolute; - right: 5px; - scrollbar-width: none; - 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#subtab_buttons { - background: transparent; - bottom: 15px; - display: none; - padding: 5px; - position: fixed; - width: 100%; - z-index: 1; -} - -div#subtab_buttons>button { - margin-left: 20px; - width: 100px; -} - -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 { - align-items: center; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - display: flex; - float: left; - height: 50px; - justify-content: center; - margin: 8px; - margin-left: 15px; - overflow: hidden; - padding: 5px; - width: 24%; -} - -.itin_state { - align-items: center; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - display: inline-block; - height: 50px; - line-height: 50px; - margin: 5px; - margin-left: 10px; - padding: 5px; - text-align: center; - width: 42%; -} - -.itin_header1 { - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - display: inline-block; - height: 50px; - line-height: 50px; - margin: 5px; - padding: 5px; - text-align: center; - width: 28%; -} - -#itin_airport_name { - font-size: 46px; - font-weight: bold; - left: 5px; - position: absolute; - top: 15px; -} - -#itin_air_info { - bottom: 55px; - position: absolute; - right: 10px; -} - -#itin_arrivals { - bottom: 10px; - left: 10px; - position: absolute; -} - -#itin_back { - bottom: 55px; - left: 10px; - position: absolute; -} - -#itin_departures { - bottom: 10px; - position: absolute; - right: 10px; -} - -#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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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; -} - -html, -body { - font-family: Tahoma, Sans-Serif; - font-size: 10pt; - height: 100%; - margin: 0; - padding: 0; -} - -html::-webkit-scrollbar { - display: none; -} - -img#aircraft_image { - height: auto; - max-width: 100%; -} - -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; +#aircraft_button { + bottom: 49px; + position: fixed; + right: 14%; +} + +#aircraft_image1 { + width: 100%; +} + +#aircraft_image2 { + bottom: 12%; + left: 5%; + position: absolute; + width: 24.5%; +} + +#aircraft_image3 { + bottom: 12%; + left: 30.5%; + position: absolute; + width: 24.5%; +} + +#aircraft_image4 { + bottom: 12%; + left: 56%; + position: absolute; + width: 24.5%; +} + +#aircraft_info_overlay { + color: white; + font-size: large; + position: absolute; + top: 175px; +} + +#aircraft_model { + font-size: 20px; + font-weight: bold; + left: 69.5%; + position: absolute; + top: 38%; +} + +#aircraft_model_title { + font-size: 18px; + left: 66%; + position: absolute; + top: 33%; +} + +#aircraft_name_addl { + font-size: 20px; + font-weight: bold; + left: 67%; + position: absolute; + top: 25%; +} + +#aircraft_name_css { + font-size: 30px; + line-height: 25px; + white-space: nowrap; +} + +#aircraft_name_title { + font-size: 18px; + left: 66%; + position: absolute; + top: 20%; +} + +#aircraft_registration { + font-size: 20px; + font-weight: bold; + left: 69%; + position: absolute; + top: 51%; +} + +#aircraft_registration_title { + font-size: 18px; + left: 64%; + position: absolute; + top: 46%; +} + +#aircraft_tab_background { + filter: brightness(50%); + height: 225px; + width: 400px; +} + +#arrivals { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#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; +} + +#departures { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#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%; +} + +#external_mode_button { + left: 50%; + position: relative; + right: 50%; +} + +#external_title { + animation: blinkingText 1s infinite; + left: 22%; + position: absolute; + top: 55%; +} + +#flight_progress_circle { + position: absolute; + right: 25%; + top: 10%; +} + +#flight_progress_div { + color: black; +} + +#flight_progress_elapsed_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 45%; +} + +#flight_progress_elapsed_title { + font-size: 18px; + left: 68%; + position: absolute; + top: 40%; +} + +#flight_progress_remaining_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 58%; +} + +#flight_progress_remaining_title { + font-size: 18px; + left: 67%; + position: absolute; + top: 53%; +} + +#flight_progress_time_amount { + font-size: 20px; + font-weight: bold; + left: 64%; + position: absolute; + top: 71%; +} + +#flight_progress_time_title { + font-size: 18px; + left: 67%; + position: absolute; + top: 66%; +} + +#flight_progress_title { + font-size: 18px; + position: absolute; + right: 5%; + top: 22%; +} + +#home_page { + overflow: hidden; +} + +#home_page>table>tbody>tr>td>img { + width: 100%; +} + +#img_button { + bottom: 70px; + position: fixed; + right: 10%; +} + +#info_button { + bottom: 5px; + position: absolute; + right: 10px; +} + +#info_icon { + bottom: 5px; + position: absolute; + right: 10px; +} + +#arrivals {} + +#loader_progress { + height: 20px; + left: 50%; + margin: 128px 0 0 -125px; + position: absolute; + top: 50%; + width: 250px; +} + +#lock_button { + background-color: rgba(255, 255, 255, .3); + line-height: 0%; + margin-bottom: -80px; + position: absolute; + right: 6px; + top: 181px; + z-index: 1; + z-index: 2; +} + +#metar_loading { + top: 4px; +} + +#modal2_title { + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} + +#modal3_title { + font-size: 30px; + line-height: 40px; + text-decoration: bold; +} + +#nav_bar.divider { + width: 25px; +} + +#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; +} + +#planestable { + height: 200px; +} + +#power_button { + position: absolute; + right: 4px; + top: 5px; +} + +#power_modal>.modal-content { + background-color: rgba(255, 255, 255, 0.9); + border-radius: 8px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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%; +} + +#radar_aircraft_tab { + line-height: 17px; +} + +#sch-arrivals { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#sch-departures { + display: inline-table; + margin: auto; + padding: 5px; + width: fit-content; +} + +#selected_icao { + font-size: x-small; +} + +#selected_icaotype { + font-size: x-small; +} + +#selected_position { + left: 138px; + position: absolute; + top: 228px; +} + +#selected_registration { + font-size: x-small; +} + +#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(0, 0, 0, .7); + cursor: pointer; + position: fixed; + right: 5px; + z-index: inherit; +} + +#sidebar_open_button { + background-color: rgba(255, 255, 255, 0.8); + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + cursor: pointer; + height: 25%; + padding: 2px; + position: absolute; + right: 0; + top: 40%; + width: 25px; + z-index: 2; +} + +#spinny { + height: 128px; + left: 50%; + margin: -64px 0 0 -64px; + position: absolute; + top: 50%; + width: 128px; +} + +#tableinfo, +#sudo_buttons { + font-family: monospace; + font-size: x-small; +} + +#tableinfo::-webkit-scrollbar { + display: none; +} + +#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: white; + color: black; + font-weight: bolder; + text-transform: uppercase; +} + +.itinheader { + background-color: white; + 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%; +} + +.mainHeader { + display: none; +} + +.center { + display: table-cell; + vertical-align: middle; +} + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + cursor: pointer; + text-decoration: none; +} + +.dim { + filter: alpha(opacity=30); + opacity: 0.3; +} + +.hidden { + display: none; +} + +.home_table { + margin-left: auto; + margin-right: auto; + width: 60%; +} + +.infoblock_body { + font-size: medium; +} + +.infoblock_heading { + font-size: larger; +} + +.infoblock_heading a { + color: blue; + font-size: x-small; + text-decoration: none; +} + +.logo { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 10%; + width: 80%; +} + +.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; +} + +.mlat { + background-color: #d5d5ff; + font-weight: bold; +} + +.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 { + khtml-user-select: none; + moz-user-select: none; + ms-user-select: none; + user-select: none; + webkit-touch-callout: none; + webkit-user-select: none; +} + +.plane_table_row { + cursor: pointer; +} + +.pointer { + cursor: pointer; +} + +.pointer { + cursor: pointer; +} + +.selected { + background-color: #dddddd; +} + +.settingslogo { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 2%; + width: 40%; +} + +.settingstext { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.space { + display: inline-block; + margin: auto; + padding-bottom: 0px; + padding-right: 20px; + padding-top: 0px; + width: fit-content; +} + +.space-nopad { + display: inline-block; + margin: auto; + width: fit-content; +} + +.squawk7500 { + background-color: #ff5555; + font-weight: bold; +} + +.squawk7600 { + background-color: #00ffff; + font-weight: bold; +} + +.squawk7700 { + background-color: #ffff00; + font-weight: bold; +} + +.subtab_button { + width: 25%; +} + +.vPosition { + background-color: #d5ffd5; + font-weight: bold; +} + +@keyframes blinkingText { + 0% { + opacity: 0; + } + + 100% { + opacity: 0; + } + + 50% { + opacity: 1; + } +} + +div#graphs_body { + overflow: hidden; +} + +div#graphs_body { + height: 100%; + position: absolute; + top: 50px; + width: 100%; +} + +div#itinerary_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%; +} + +div#nav_bar { + background: rgba(255, 255, 255, 0.8); + border-radius: 5px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + height: 40px; + left: 10%; + padding: 5px; + position: fixed; + top: 5px; + width: 80%; + z-index: 1; +} + +div#itin_nav_bar { + background: rgba(255, 255, 255, 0.8); + border-radius: 5px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + height: 40px; + left: 10%; + padding: 5px; + position: fixed; + top: 5px; + width: 80%; + z-index: 1; +} + +#itin_title { + color: rgba(0, 0, 0, .7); + position: absolute; + right: 10px; + top: -18px; +} + +div#sidebar_container { + background-color: rgba(255, 255, 255, .9); + border-radius: 8px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + display: none; + height: 85%; + ms-overflow-style: none; + overflow: auto; + position: absolute; + right: 5px; + scrollbar-width: none; + 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#subtab_buttons { + background: transparent; + bottom: 15px; + display: none; + padding: 5px; + position: fixed; + width: 100%; + z-index: 1; +} + +div#subtab_buttons>button { + margin-left: 20px; + width: 100px; +} + +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 { + align-items: center; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + display: flex; + float: left; + height: 50px; + justify-content: center; + margin: 8px; + margin-left: 15px; + overflow: hidden; + padding: 5px; + width: 24%; +} + +.itin_state { + align-items: center; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + display: inline-block; + height: 50px; + line-height: 50px; + margin: 5px; + margin-left: 10px; + padding: 5px; + text-align: center; + width: 42%; +} + +.itin_header1 { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + display: inline-block; + height: 50px; + line-height: 50px; + margin: 5px; + padding: 5px; + text-align: center; + width: 28%; +} + +#itin_airport_name { + font-size: 46px; + font-weight: bold; + left: 5px; + position: absolute; + top: 15px; +} + + +#home_button { + background-color: transparent; +} + +#itin_arrivals { + bottom: 10px; + left: 10px; + position: absolute; +} + +#itin_back { + top: 72px; + left: 10px; + position: absolute; +} + +#itin_departures { + bottom: 10px; + position: absolute; + right: 10px; +} + +#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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 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; +} + +html, +body { + font-family: Tahoma, Sans-Serif; + font-size: 10pt; + height: 100%; + margin: 0; + padding: 0; +} + +html::-webkit-scrollbar { + display: none; +} + +img#aircraft_image { + height: auto; + max-width: 100%; +} + +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; } \ No newline at end of file diff --git a/data/aircraft1.json b/data/aircraft1.json index 12cc037..da70c9a 100644 --- a/data/aircraft1.json +++ b/data/aircraft1.json @@ -1 +1 @@ -{"now":1642967266412.587,"messages":0,"aircraft":[]} \ No newline at end of file +{"now":1644846736438.561,"messages":0,"aircraft":[{"hex":"a3e658","flight":"AAL1049","lat":33.6419,"lon":-84.4419,"altitude":0,"track":270,"speed":0,"squawk":"2066","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"MIA","airline":"AAL"},{"hex":"a057cc","flight":"DAL2184","lat":33.6465,"lon":-84.4414,"altitude":1700,"track":266,"speed":149,"squawk":"7245","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"CLE","airline":"DAL"},{"hex":"ab4840","flight":"DAL345","lat":33.6407,"lon":-84.4405,"altitude":0,"track":1,"speed":11,"squawk":"7160","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"LAX","airline":"DAL"},{"hex":"a8e20f","flight":"DAL376","lat":33.6412,"lon":-84.4397,"altitude":0,"track":81,"speed":1,"squawk":"3544","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"BOS","arr":"ATL","airline":"DAL"},{"hex":"a3a503","flight":"DAL1252","lat":33.6426,"lon":-84.4389,"altitude":0,"track":270,"speed":0,"squawk":"7276","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"AUS","arr":"ATL","airline":"DAL"},{"hex":"a6c88a","flight":"DAL2895","lat":33.6422,"lon":-84.4388,"altitude":0,"track":270,"speed":0,"squawk":"3310","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"TPA","arr":"ATL","airline":"DAL"},{"hex":"ac531a","flight":"EDV5079","lat":33.6333,"lon":-84.4373,"altitude":0,"track":16,"speed":11,"squawk":"5262","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"MGM","arr":"ATL","airline":"DAL"},{"hex":"a4491f","flight":"DAL2333","lat":33.641,"lon":-84.4371,"altitude":0,"track":149,"speed":4,"squawk":"1612","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"HSV","arr":"ATL","airline":"DAL"},{"hex":"acad53","flight":"DAL1709","lat":33.6446,"lon":-84.4363,"altitude":0,"track":90,"speed":12,"squawk":"2211","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"CVG","airline":"DAL"},{"hex":"a3b028","flight":"DAL1150","lat":33.64,"lon":-84.4363,"altitude":0,"track":90,"speed":1,"squawk":"2464","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"IAH","arr":"ATL","airline":"DAL"},{"hex":"a364ea","flight":"DAL2175","lat":33.6426,"lon":-84.4355,"altitude":0,"track":270,"speed":0,"squawk":"7235","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"IND","airline":"DAL"},{"hex":"a8d600","flight":"DAL1264","lat":33.638,"lon":-84.4346,"altitude":0,"track":180,"speed":12,"squawk":"2216","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"FLL","airline":"DAL"},{"hex":"adc8ee","flight":"DAL2229","lat":33.6437,"lon":-84.4339,"altitude":0,"track":39,"speed":3,"squawk":"1761","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"DAL","airline":"DAL"},{"hex":"ad5e27","flight":"SWA2217","lat":33.6374,"lon":-84.4338,"altitude":0,"track":53,"speed":1,"squawk":"7134","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"MSY","airline":"SWA"},{"hex":"a5050e","flight":"SWA656","lat":33.6402,"lon":-84.4336,"altitude":0,"track":87,"speed":3,"squawk":"0000","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"BNA","airline":"SWA"},{"hex":"ac20e7","flight":"SWA1458","lat":33.6379,"lon":-84.4331,"altitude":0,"track":90,"speed":0,"squawk":"7277","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"AUS","airline":"SWA"},{"hex":"a44031","flight":"DAL2893","lat":33.6446,"lon":-84.4329,"altitude":0,"track":90,"speed":21,"squawk":"2036","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"OMA","airline":"DAL"},{"hex":"a15397","flight":"","lat":33.6557,"lon":-84.4328,"altitude":0,"track":51,"speed":0,"squawk":"1257","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"","airline":"DAL"},{"hex":"a01b56","flight":"DAL2958","lat":33.6366,"lon":-84.4325,"altitude":0,"track":90,"speed":9,"squawk":"7240","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"PBI","airline":"DAL"},{"hex":"a280fe","flight":"SWA1364","lat":33.6402,"lon":-84.4322,"altitude":0,"track":270,"speed":0,"squawk":"0025","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"LGA","arr":"ATL","airline":"SWA"},{"hex":"aaa2d3","flight":"SWA20","lat":33.6405,"lon":-84.4321,"altitude":0,"track":270,"speed":0,"squawk":"2067","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"HOU","airline":"SWA"},{"hex":"a29eb6","flight":"SWA428","lat":33.6398,"lon":-84.4321,"altitude":0,"track":275,"speed":0,"squawk":"1741","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"JAN","airline":"SWA"},{"hex":"a61219","flight":"SWA1853","lat":33.6478,"lon":-84.4316,"altitude":0,"track":126,"speed":0,"squawk":"3636","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"OMA","arr":"ATL","airline":"SWA"},{"hex":"ad493b","flight":"SWA2454","lat":33.6374,"lon":-84.4313,"altitude":0,"track":180,"speed":0,"squawk":"7162","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"FLL","airline":"SWA"},{"hex":"ad15cc","flight":"NKS740","lat":33.6373,"lon":-84.4306,"altitude":0,"track":11,"speed":6,"squawk":"5751","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"FLL","arr":"ATL","airline":"NKS"},{"hex":"a06703","flight":"RPA4697","lat":33.6412,"lon":-84.4299,"altitude":0,"track":90,"speed":0,"squawk":"5155","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"CLT","arr":"ATL","airline":"AAL"},{"hex":"ad2fcd","flight":"NKS481","lat":33.6378,"lon":-84.4298,"altitude":0,"track":90,"speed":0,"squawk":"0000","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"MSY","airline":"NKS"},{"hex":"a41090","flight":"FFT1515","lat":33.6379,"lon":-84.429,"altitude":0,"track":289,"speed":0,"squawk":"1325","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"MIA","arr":"ATL","airline":"FFT"},{"hex":"adcca5","flight":"DAL2421","lat":33.6496,"lon":-84.4284,"altitude":0,"track":270,"speed":53,"squawk":"6235","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"MSN","arr":"ATL","airline":"DAL"},{"hex":"ab8b56","flight":"DAL2810","lat":33.6358,"lon":-84.4283,"altitude":0,"track":90,"speed":28,"squawk":"5101","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"BHM","arr":"ATL","airline":"DAL"},{"hex":"a35da8","flight":"FFT419","lat":33.6383,"lon":-84.4261,"altitude":0,"track":90,"speed":0,"squawk":"1742","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"DEN","airline":"FFT"},{"hex":"ab3d41","flight":"","lat":33.6419,"lon":-84.4261,"altitude":0,"track":70,"speed":0,"squawk":"0000","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"","airline":"DAL"},{"hex":"abd90c","flight":"SWA778","lat":33.6447,"lon":-84.4257,"altitude":0,"track":90,"speed":20,"squawk":"5737","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"MEM","airline":"SWA"},{"hex":"71c084","flight":"KAL035","lat":33.6431,"lon":-84.4223,"altitude":0,"track":185,"speed":8,"squawk":"3125","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ICN","arr":"ATL","airline":"KAL"},{"hex":"abef98","flight":"SWA1045","lat":33.645,"lon":-84.4222,"altitude":0,"track":59,"speed":19,"squawk":"1705","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"MCI","airline":"SWA"},{"hex":"ab80f4","flight":"DAL683","lat":33.6479,"lon":-84.4205,"altitude":0,"track":270,"speed":0,"squawk":"2227","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"PHX","airline":"DAL"},{"hex":"a65092","flight":"DAL463","lat":33.6386,"lon":-84.4202,"altitude":0,"track":90,"speed":0,"squawk":"7453","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"","airline":"DAL"},{"hex":"a63dff","flight":"DAL352","lat":33.6395,"lon":-84.419,"altitude":0,"track":303,"speed":0,"squawk":"2565","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"DTW","airline":"DAL"},{"hex":"abc29a","flight":"DAL55","lat":33.6385,"lon":-84.4183,"altitude":0,"track":96,"speed":7,"squawk":"1254","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"","airline":"DAL"},{"hex":"ac2fff","flight":"EDV4688","lat":33.6318,"lon":-84.4159,"altitude":725,"track":270,"speed":136,"squawk":"2651","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"BQK","arr":"ATL","airline":"DAL"},{"hex":"aa8864","flight":"SWA1643","lat":33.6347,"lon":-84.4137,"altitude":0,"track":270,"speed":76,"squawk":"3151","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"PHL","airline":"SWA"},{"hex":"a11d3c","flight":"DAL1279","lat":33.6358,"lon":-84.4122,"altitude":0,"track":90,"speed":18,"squawk":"3363","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"TPA","airline":"DAL"},{"hex":"ac8777","flight":"SWA727","lat":33.6455,"lon":-84.4073,"altitude":0,"track":87,"speed":15,"squawk":"6006","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"IND","airline":"SWA"},{"hex":"abb5bf","flight":"SWA5699","lat":33.6468,"lon":-84.4062,"altitude":0,"track":270,"speed":8,"squawk":"3506","seen":1,"seen_pos":1,"rssi":0,"messages":1,"internet":true,"dep":"ATL","arr":"SAT","airline":"SWA"}]} \ No newline at end of file diff --git a/gmap.html b/gmap.html index ea10176..a9a8884 100644 --- a/gmap.html +++ b/gmap.html @@ -1,727 +1,741 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aviation Assistant - - - - - - - - - - - -
- - -
- - -

Airport Itinerary

- - -
-
-
-
- - - - - - - -
- -
- -
-
- -
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aviation Assistant + + + + + + + + + + + +
+ + +
+ + + + + + Volume - % + + + + + + + + + +
+
+
+
+ + + + + + + +
+ +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/graphs1090/graphs/dump1090-localhost-aircraft-8h.png b/graphs1090/graphs/dump1090-localhost-aircraft-8h.png new file mode 100644 index 0000000..f57da84 Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-aircraft-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-aircraft_message_rate-8h.png b/graphs1090/graphs/dump1090-localhost-aircraft_message_rate-8h.png new file mode 100644 index 0000000..e92676b Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-aircraft_message_rate-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-cpu-8h.png b/graphs1090/graphs/dump1090-localhost-cpu-8h.png new file mode 100644 index 0000000..1de42a5 Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-cpu-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-local_rate-8h.png b/graphs1090/graphs/dump1090-localhost-local_rate-8h.png new file mode 100644 index 0000000..56e7d84 Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-local_rate-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-local_trailing_rate-8h.png b/graphs1090/graphs/dump1090-localhost-local_trailing_rate-8h.png new file mode 100644 index 0000000..6da7199 Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-local_trailing_rate-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-signal-8h.png b/graphs1090/graphs/dump1090-localhost-signal-8h.png new file mode 100644 index 0000000..0a3475c Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-signal-8h.png differ diff --git a/graphs1090/graphs/dump1090-localhost-tracks-8h.png b/graphs1090/graphs/dump1090-localhost-tracks-8h.png new file mode 100644 index 0000000..4f516f9 Binary files /dev/null and b/graphs1090/graphs/dump1090-localhost-tracks-8h.png differ diff --git a/graphs1090/graphs/system-localhost-cpu-8h.png b/graphs1090/graphs/system-localhost-cpu-8h.png new file mode 100644 index 0000000..5bb5dba Binary files /dev/null and b/graphs1090/graphs/system-localhost-cpu-8h.png differ diff --git a/graphs1090/graphs/system-localhost-memory-8h.png b/graphs1090/graphs/system-localhost-memory-8h.png new file mode 100644 index 0000000..e7aec8f Binary files /dev/null and b/graphs1090/graphs/system-localhost-memory-8h.png differ diff --git a/graphs1090/graphs/system-localhost-temperature-8h.png b/graphs1090/graphs/system-localhost-temperature-8h.png new file mode 100644 index 0000000..843cfc5 Binary files /dev/null and b/graphs1090/graphs/system-localhost-temperature-8h.png differ diff --git a/information_files/colorschememapping.xml b/information_files/colorschememapping.xml index 6a0069c..b200daa 100644 --- a/information_files/colorschememapping.xml +++ b/information_files/colorschememapping.xml @@ -1,2 +1,2 @@ - + \ No newline at end of file diff --git a/information_files/filelist.xml b/information_files/filelist.xml index 14a8269..07fc93a 100644 --- a/information_files/filelist.xml +++ b/information_files/filelist.xml @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/js/flightinfo.js b/js/flightinfo.js index 1145ca1..6730cda 100644 --- a/js/flightinfo.js +++ b/js/flightinfo.js @@ -1,372 +1,371 @@ -// 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("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() - } -} - -// 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() - - } -} - -// 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 (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("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] + 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() + } +} + +// 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() + + } +} + +// 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) } \ No newline at end of file diff --git a/js/script.js b/js/script.js index 861377a..2c75f02 100644 --- a/js/script.js +++ b/js/script.js @@ -1,1109 +1,1110 @@ -// -*- mode: javascript; indent-tabs-mode: nil; c-basic-offset: 8 -*- -"use strict"; - -// Define our global variables -var dark_mode = false -var brightness = 0 -var OLMap = null; -var StaticFeatures = new ol.Collection(); -var PlaneIconFeatures = new ol.Collection(); -var PlaneTrailFeatures = new ol.Collection(); -var Planes = {}; -var PlanesOrdered = []; -var SelectedPlane = null; -var FollowSelected = false; -var OfflineMode = false; -var internet_mode_data = {} - -var SpecialSquawks = { - '7500': { - cssClass: 'squawk7500', - markerColor: 'rgb(255, 85, 85)', - text: 'Aircraft Hijacking' - }, - '7600': { - cssClass: 'squawk7600', - markerColor: 'rgb(0, 255, 255)', - text: 'Radio Failure' - }, - '7700': { - cssClass: 'squawk7700', - markerColor: 'rgb(255, 255, 0)', - text: 'General Emergency' - } -}; - -// Get current map settings -var CenterLat, CenterLon, ZoomLvl, MapType; - -var Dump1090Version = "v.2.0"; -var RefreshInterval = 1000; - -var PlaneRowTemplate = null; - -var TrackedAircraft = 0; -var TrackedAircraftPositions = 0; -var TrackedHistorySize = 0; - -var SitePosition = null; - -var ReceiverClock = null; - -var LastReceiverTimestamp = 0; -var StaleReceiverCount = 0; -var FetchPending = null; - -var MessageCountHistory = []; -var MessageRate = 0; - -var NBSP = '\u00a0'; -var ShowClocks = false - -function processReceiverUpdate(data) { - // Loop through all the planes in the data packet - var now = data.now; - var acs = data.aircraft; - - // Detect stats reset - if (MessageCountHistory.length > 0 && MessageCountHistory[MessageCountHistory.length - 1].messages > data.messages) { - MessageCountHistory = [{ - 'time': MessageCountHistory[MessageCountHistory.length - 1].time, - 'messages': 0 - }]; - } - - // Note the message count in the history - MessageCountHistory.push({ - 'time': now, - 'messages': data.messages - }); - // .. and clean up any old values - if ((now - MessageCountHistory[0].time) > 30) - MessageCountHistory.shift(); - - for (var j = 0; j < acs.length; j++) { - var ac = acs[j]; - var hex = ac.hex; - var plane = null; - - // Do we already have this plane object in Planes? - // If not make it. - - if (Planes[hex]) { - plane = Planes[hex]; - } else { - plane = new PlaneObject(hex); - plane.tr = PlaneRowTemplate.cloneNode(true); - - if (hex[0] === '~') { - // Non-ICAO address - plane.tr.cells[0].textContent = hex.substring(1); - $(plane.tr).css('font-style', 'italic'); - } else { - plane.tr.cells[0].textContent = hex; - } - - // set flag image if available - if (ShowFlags && plane.icaorange.flag_image !== null) { - $('img', plane.tr.cells[1]).attr('src', FlagPath + plane.icaorange.flag_image); - $('img', plane.tr.cells[1]).attr('title', plane.icaorange.country); - } else { - $('img', plane.tr.cells[1]).css('display', 'none'); - } - - plane.tr.addEventListener('click', function (h, evt) { - selectPlaneByHex(h, false); - evt.preventDefault(); - }.bind(undefined, hex)); - - plane.tr.addEventListener('dblclick', function (h, evt) { - selectPlaneByHex(h, true); - evt.preventDefault(); - }.bind(undefined, hex)); - - Planes[hex] = plane; - PlanesOrdered.push(plane); - } - - // Call the function update - plane.updateData(now, ac); - } -} - -function fetchData() { - if (FetchPending !== null && FetchPending.state() == 'pending') { - // don't double up on fetches, let the last one resolve - return; - } - - if (internet_mode === 1) { - FetchPending = $.ajax({ - url: 'data/aircraft1.json', - timeout: 5000, - cache: false, - dataType: 'json' - }); - } else if (internet_mode === 0) { - FetchPending = $.ajax({ - url: 'data/aircraft.json', - timeout: 5000, - cache: false, - dataType: 'json' - }); - } - - FetchPending.done(function (data) { - var now = data.now; - if (internet_mode) { - internet_mode_data = data.aircraft - } - processReceiverUpdate(data); - - // update timestamps, visibility, history track for all planes - not only those updated - for (var i = 0; i < PlanesOrdered.length; ++i) { - var plane = PlanesOrdered[i]; - plane.updateTick(now, LastReceiverTimestamp); - } - - refreshTableInfo(); - refreshSelected(); - - if (ReceiverClock) { - var rcv = new Date(now * 1000); - ReceiverClock.render(rcv.getUTCHours(), rcv.getUTCMinutes(), rcv.getUTCSeconds()); - } - - // Check for stale receiver data - if (LastReceiverTimestamp === now) { - StaleReceiverCount++; - if (StaleReceiverCount > 5) { - $("#update_error_detail").text("The data from dump1090 hasn't been updated in a while. Maybe dump1090 is no longer running?"); - $("#update_error").css('display', 'block'); - } - } else { - StaleReceiverCount = 0; - LastReceiverTimestamp = now; - $("#update_error").css('display', 'none'); - } - }); - - FetchPending.fail(function (jqxhr, status, error) { - $("#update_error_detail").text("AJAX call failed (" + status + (error ? (": " + error) : "") + "). Maybe dump1090 is no longer running?"); - $("#update_error").css('display', 'block'); - }); -} - -var PositionHistorySize = 0; - -function initialize() { - - // Set page basics - document.title = PageName; - PlaneRowTemplate = document.getElementById("plane_row_template"); - - if (!ShowClocks) { - $('#timestamps').css('display', 'none'); - } else { - // Create the clocks. - new CoolClock({ - canvasId: "utcclock", - skinId: "classic", - displayRadius: 40, - showSecondHand: true, - gmtOffset: "0", // this has to be a string! - showDigital: false, - logClock: false, - logClockRev: false - }); - - ReceiverClock = new CoolClock({ - canvasId: "receiverclock", - skinId: "classic", - displayRadius: 40, - showSecondHand: true, - gmtOffset: null, - showDigital: false, - logClock: false, - logClockRev: false - }); - - // disable ticking on the receiver clock, we will update it ourselves - ReceiverClock.tick = (function () {}) - } - - // Initialize my functions - getInitialVolume() - readBatteryLevel() - readBrightnessLevel() - modal() - sendCMD("getbranch") - window.setInterval(readBatteryLevel, 1000); - getCPUTemp() - window.setInterval(getCPUTemp, 30000) - //window.setInterval(fetchInternetAircraft, 1000) - initializeSchedulesPage(); - document.getElementById("graphs_holder").setAttribute("class", "graphs_s") - document.getElementById("graphs_holder").setAttribute("src", "http://localhost/graphs1090/graphs" + graph_types[starting_graph] + "2h.png") - $("#loader").removeClass("hidden"); - // Get receiver metadata, reconfigure using it, then continue - // with initialization - $.ajax({ - url: 'data/receiver.json', - timeout: 5000, - cache: false, - dataType: 'json' - }) - - .done(function (data) { - if (typeof data.lat !== "undefined") { - SiteShow = true; - SiteLat = data.lat; - SiteLon = data.lon; - DefaultCenterLat = data.lat; - DefaultCenterLon = data.lon; - } - - Dump1090Version = data.version; - RefreshInterval = data.refresh; - PositionHistorySize = data.history; - }) - - .always(function () { - initialize_map(); - start_load_history(); - }); - - - // Settings Modal - - // When the user clicks anywhere outside of the modal, close it - window.onclick = function (event) { - if (event.target == document.getElementById("settings_modal")) { - document.getElementById("settings_modal").style.display = "none"; - } - } -} - -var CurrentHistoryFetch = null; -var PositionHistoryBuffer = [] - -function start_load_history() { - if (PositionHistorySize > 0) { - $("#loader_progress").attr('max', PositionHistorySize); - console.log("Starting to load history (" + PositionHistorySize + " items)"); - load_history_item(0); - } else { - end_load_history(); - } -} - -function load_history_item(i) { - if (i >= PositionHistorySize) { - end_load_history(); - return; - } - - console.log("Loading history #" + i); - $("#loader_progress").attr('value', i); - - $.ajax({ - url: 'data/history_' + i + '.json', - timeout: 5000, - cache: false, - dataType: 'json' - }) - - .done(function (data) { - PositionHistoryBuffer.push(data); - load_history_item(i + 1); - }) - - .fail(function (jqxhr, status, error) { - // No more history - end_load_history(); - }); -} - -function end_load_history() { - $("#loader").addClass("hidden"); - - console.log("Done loading history"); - - if (PositionHistoryBuffer.length > 0) { - var now, last = 0; - - // Sort history by timestamp - console.log("Sorting history"); - PositionHistoryBuffer.sort(function (x, y) { - return (x.now - y.now); - }); - - // Process history - for (var h = 0; h < PositionHistoryBuffer.length; ++h) { - now = PositionHistoryBuffer[h].now; - console.log("Applying history " + h + "/" + PositionHistoryBuffer.length + " at: " + now); - processReceiverUpdate(PositionHistoryBuffer[h]); - - // update track - console.log("Updating tracks at: " + now); - for (var i = 0; i < PlanesOrdered.length; ++i) { - var plane = PlanesOrdered[i]; - plane.updateTrack((now - last) + 1); - } - - last = now; - } - - // Final pass to update all planes to their latest state - console.log("Final history cleanup pass"); - for (var i = 0; i < PlanesOrdered.length; ++i) { - var plane = PlanesOrdered[i]; - plane.updateTick(now); - } - - LastReceiverTimestamp = last; - } - - PositionHistoryBuffer = null; - - console.log("Completing init"); - - refreshTableInfo(); - refreshSelected(); - reaper(); - - // Setup our timer to poll from the server. - window.setInterval(fetchData, RefreshInterval); - window.setInterval(reaper, 60000); - - // And kick off one refresh immediately. - fetchData(); - -} - -// Make a LineString with 'points'-number points -// that is a closed circle on the sphere such that the -// great circle distance from 'center' to each point is -// 'radius' meters -function make_geodesic_circle(center, radius, points) { - var angularDistance = radius / 6378137.0; - var lon1 = center[0] * Math.PI / 180.0; - var lat1 = center[1] * Math.PI / 180.0; - var geom = new ol.geom.LineString(); - for (var i = 0; i <= points; ++i) { - var bearing = i * 2 * Math.PI / points; - - var lat2 = Math.asin(Math.sin(lat1) * Math.cos(angularDistance) + - Math.cos(lat1) * Math.sin(angularDistance) * Math.cos(bearing)); - var lon2 = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(angularDistance) * Math.cos(lat1), - Math.cos(angularDistance) - Math.sin(lat1) * Math.sin(lat2)); - - lat2 = lat2 * 180.0 / Math.PI; - lon2 = lon2 * 180.0 / Math.PI; - geom.appendCoordinate([lon2, lat2]); - } - return geom; -} - -// Initalizes the map and starts up our timers to call various functions -function initialize_map() { - - // Load stored map settings if present - CenterLat = Number(localStorage['CenterLat']) || DefaultCenterLat; - CenterLon = Number(localStorage['CenterLon']) || DefaultCenterLon; - ZoomLvl = Number(localStorage['ZoomLvl']) || DefaultZoomLvl; - MapType = localStorage['MapType']; - - // Set SitePosition, initialize sorting - if (SiteShow && (typeof SiteLat !== 'undefined') && (typeof SiteLon !== 'undefined')) { - SitePosition = [SiteLon, SiteLat]; - sortByDistance(); - } else { - SitePosition = null; - PlaneRowTemplate.cells[6].style.display = 'none'; // hide distance column - document.getElementById("distance").style.display = 'none'; // hide distance header - sortByAltitude(); - } - - // Maybe hide flag info - if (!ShowFlags) { - PlaneRowTemplate.cells[1].style.display = 'none'; // hide flag column - document.getElementById("flag").style.display = 'none'; // hide flag header - document.getElementById("infoblock_country").style.display = 'none'; // hide country row - } - - // Initialize OL3 - - var layers = createBaseLayers(); - - var iconsLayer = new ol.layer.Vector({ - name: 'ac_positions', - type: 'overlay', - title: 'Aircraft positions', - source: new ol.source.Vector({ - features: PlaneIconFeatures, - }) - }); - - layers.push(new ol.layer.Group({ - title: 'Overlays', - name: "Overlays", - fold: 'close', - layers: [ - new ol.layer.Vector({ - name: 'site_pos', - type: 'overlay', - title: 'Site position and range rings', - source: new ol.source.Vector({ - features: StaticFeatures, - }) - }), - - new ol.layer.Vector({ - name: 'ac_trail', - type: 'overlay', - title: 'Selected aircraft trail', - source: new ol.source.Vector({ - features: PlaneTrailFeatures, - }) - }), - - - iconsLayer - ] - })); - - var foundType = false; - - - OLMap = new ol.Map({ - target: 'map_canvas', - layers: layers, - view: new ol.View({ - center: ol.proj.fromLonLat([CenterLon, CenterLat]), - zoom: ZoomLvl - }), - controls: [new ol.control.Zoom(), - new ol.control.Rotate(), - new ol.control.FullScreen(), - new ol.control.ScaleLine({ - units: Metric ? "metric" : "nautical" - }), - new ol.control.LayerSwitcher() - ], - loadTilesWhileAnimating: true, - loadTilesWhileInteracting: true - }); - - var layerSwitcher = new LayerSwitcher({ - reverse: false, - groupSelectStyle: 'group', - activationMode: 'click' - }); - OLMap.addControl(layerSwitcher); - - // Listeners for newly created Map - OLMap.on("moveend", function () { - var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); - if (TAB === 'METAR') { - nearestStations(center[1], center[0]) - } - getBounds() - fetchData() - }) - - OLMap.getView().on('change:center', function (event) { - var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); - localStorage['CenterLon'] = center[0] - localStorage['CenterLat'] = center[1] - if (FollowSelected) { - // On manual navigation, disable follow - var selected = Planes[SelectedPlane]; - if (Math.abs(center[0] - selected.position[0]) > 0.0001 && - Math.abs(center[1] - selected.position[1]) > 0.0001) { - FollowSelected = false; - refreshSelected(); - } - } - }); - - OLMap.getView().on('change:resolution', function (event) { - localStorage['ZoomLvl'] = OLMap.getView().getZoom(); - getBounds() - fetchData() - }); - - OLMap.on(['click', 'dblclick'], function (evt) { - var hex = evt.map.forEachFeatureAtPixel(evt.pixel, - function (feature, layer) { - return feature.hex; - }, - 20, - function (layer) { - return (layer === iconsLayer); - }, - null); - if (hex) { - selectPlaneByHex(hex, (evt.type === 'dblclick')); - evt.stopPropagation(); - } - }); - - // Add home marker if requested - if (SitePosition) { - var markerStyle = new ol.style.Style({ - image: new ol.style.Circle({ - radius: 7, - snapToPixel: false, - fill: new ol.style.Fill({ - color: 'black' - }), - stroke: new ol.style.Stroke({ - color: 'white', - width: 2 - }) - }) - }); - - var feature = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat(SitePosition))); - feature.setStyle(markerStyle); - StaticFeatures.push(feature); - - if (SiteCircles) { - var circleStyle = new ol.style.Style({ - fill: null, - stroke: new ol.style.Stroke({ - color: '#000000', - width: 1 - }) - }); - - for (var i = 0; i < SiteCirclesDistances.length; ++i) { - var distance = SiteCirclesDistances[i] * 1000.0; - if (!Metric) { - distance *= 1.852; - } - - var circle = make_geodesic_circle(SitePosition, distance, 360); - circle.transform('EPSG:4326', 'EPSG:3857'); - var feature = new ol.Feature(circle); - feature.setStyle(circleStyle); - StaticFeatures.push(feature); - } - } - } - - getBounds() - - // Add terrain-limit rings. To enable this: - // - // create a panorama for your receiver location on heywhatsthat.com - // - // note the "view" value from the URL at the top of the panorama - // i.e. the XXXX in http://www.heywhatsthat.com/?view=XXXX - // - // fetch a json file from the API for the altitudes you want to see: - // - // wget -O /usr/share/dump1090-mutability/html/upintheair.json \ - // 'http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=3048,9144' - // - // NB: altitudes are in _meters_, you can specify a list of altitudes - - // kick off an ajax request that will add the rings when it's done - var request = $.ajax({ - url: 'upintheair.json', - timeout: 5000, - cache: true, - dataType: 'json' - }); - request.done(function (data) { - var ringStyle = new ol.style.Style({ - fill: null, - stroke: new ol.style.Stroke({ - color: '#000000', - width: 1 - }) - }); - - for (var i = 0; i < data.rings.length; ++i) { - var geom = new ol.geom.LineString(); - var points = data.rings[i].points; - if (points.length > 0) { - for (var j = 0; j < points.length; ++j) { - geom.appendCoordinate([points[j][1], points[j][0]]); - } - geom.appendCoordinate([points[0][1], points[0][0]]); - geom.transform('EPSG:4326', 'EPSG:3857'); - - var feature = new ol.Feature(geom); - feature.setStyle(ringStyle); - StaticFeatures.push(feature); - } - } - }); - - request.fail(function (jqxhr, status, error) { - // no rings available, do nothing - }); - goHome() -} - -// This looks for planes to reap out of the master Planes variable -function reaper() { - //console.log("Reaping started.."); - - // Look for planes where we have seen no messages for >300 seconds - var newPlanes = []; - for (var i = 0; i < PlanesOrdered.length; ++i) { - var plane = PlanesOrdered[i]; - - if (plane.seen > 300) { - // Reap it. - //console.log("Reaping " + plane.icao); - //console.log("parent " + plane.tr.parentNode); - plane.tr.parentNode.removeChild(plane.tr); - plane.tr = null; - delete Planes[plane.icao]; - plane.destroy(); - } else { - // Keep it. - newPlanes.push(plane); - } - }; - - PlanesOrdered = newPlanes; - refreshTableInfo(); - refreshSelected(); -} - -// Page Title update function -function refreshPageTitle() { - if (!PlaneCountInTitle && !MessageRateInTitle) - return; - - var subtitle = ""; - - if (PlaneCountInTitle) { - subtitle += TrackedAircraftPositions + '/' + TrackedAircraft; - } - - if (MessageRateInTitle) { - if (MessageRate != null) { - if (subtitle) subtitle += ' | '; - subtitle += MessageRate.toFixed(1) + '/s'; - } - } - - document.title = PageName + ' - ' + subtitle; -} - -// Refresh the detail window about the plane -function refreshSelected() { - if (MessageCountHistory.length > 1) { - var message_time_delta = MessageCountHistory[MessageCountHistory.length - 1].time - MessageCountHistory[0].time; - var message_count_delta = MessageCountHistory[MessageCountHistory.length - 1].messages - MessageCountHistory[0].messages; - if (message_time_delta > 0) - MessageRate = message_count_delta / message_time_delta; - } else { - MessageRate = null; - } - - refreshPageTitle(); - - var selected = false; - if (typeof SelectedPlane !== 'undefined' && SelectedPlane != "ICAO" && SelectedPlane != null) { - selected = Planes[SelectedPlane]; - } - - if (!selected) { - $('#selected_infoblock').css('display', 'none'); - $('#dump1090_infoblock').css('display', 'block'); - $('#dump1090_version').text(Dump1090Version); - $('#dump1090_total_ac').text(TrackedAircraft); - $('#dump1090_total_ac_positions').text(TrackedAircraftPositions); - $('#dump1090_total_history').text(TrackedHistorySize); - - if (MessageRate !== null) { - $('#dump1090_message_rate').text(MessageRate.toFixed(1)); - } else { - $('#dump1090_message_rate').text("n/a"); - } - - return; - } - - $('#dump1090_infoblock').css('display', 'none'); - $('#selected_infoblock').css('display', 'block'); - - $('#selected_flightaware_link').attr('href', '//flightaware.com/live/modes/' + selected.icao + '/redirect'); - - if (selected.flight !== null && selected.flight !== "") { - $('#selected_callsign').text(selected.flight); - $('#selected_links').css('display', 'inline'); - $('#selected_fr24_link').attr('href', 'http://fr24.com/' + selected.flight); - $('#selected_flightstats_link').attr('href', 'http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do?flightNumber=' + selected.flight); - $('#selected_planefinder_link').attr('href', 'https://planefinder.net/flight/' + selected.flight); - } else { - $('#selected_callsign').text('n/a'); - $('#selected_links').css('display', 'none'); - } - - if (selected.registration !== null) { - $('#selected_registration').text(selected.registration); - } else { - $('#selected_registration').text(""); - } - - if (selected.icaotype !== null) { - $('#selected_icaotype').text(selected.icaotype); - } else { - $('#selected_icaotype').text(""); - } - - var emerg = document.getElementById('selected_emergency'); - if (selected.squawk in SpecialSquawks) { - emerg.className = SpecialSquawks[selected.squawk].cssClass; - emerg.textContent = NBSP + 'Squawking: ' + SpecialSquawks[selected.squawk].text + NBSP; - } else { - emerg.className = 'hidden'; - } - - $("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate)); - - if (selected.squawk === null || selected.squawk === '0000') { - $('#selected_squawk').text('n/a'); - } else { - $('#selected_squawk').text(selected.squawk); - } - - $('#selected_speed').text(format_speed_long(selected.speed)); - $('#selected_icao').text(selected.icao.toUpperCase()); - $('#airframes_post_icao').attr('value', selected.icao); - $('#selected_track').text(format_track_long(selected.track)); - - if (selected.seen <= 1) { - $('#selected_seen').text('now'); - } else { - $('#selected_seen').text(selected.seen.toFixed(1) + 's'); - } - - $('#selected_country').text(selected.icaorange.country); - if (ShowFlags && selected.icaorange.flag_image !== null) { - $('#selected_flag').removeClass('hidden'); - $('#selected_flag img').attr('src', FlagPath + selected.icaorange.flag_image); - $('#selected_flag img').attr('title', selected.icaorange.country); - } else { - $('#selected_flag').addClass('hidden'); - } - - if (selected.position === null) { - $('#selected_position').text('n/a'); - $('#selected_follow').addClass('hidden'); - } else { - var mlat_bit = (selected.position_from_mlat ? "MLAT: " : ""); - if (selected.seen_pos > 1) { - $('#selected_position').text("(" + mlat_bit + format_latlng(selected.position) + ")"); - } else { - $('#selected_position').text(mlat_bit + format_latlng(selected.position)); - } - $('#selected_follow').removeClass('hidden'); - if (FollowSelected) { - $('#selected_follow').css('font-weight', 'bold'); - OLMap.getView().setCenter(ol.proj.fromLonLat(selected.position)); - } else { - $('#selected_follow').css('font-weight', 'normal'); - } - } - - $('#selected_sitedist').text(format_distance_long(selected.sitedist)); - $('#selected_rssi').text(selected.rssi.toFixed(1) + ' dBFS'); -} - -// Refreshes the larger table of all the planes -function refreshTableInfo() { - var show_squawk_warning = false; - - TrackedAircraft = 0 - TrackedAircraftPositions = 0 - TrackedHistorySize = 0 - - for (var i = 0; i < PlanesOrdered.length; ++i) { - var tableplane = PlanesOrdered[i]; - TrackedHistorySize += tableplane.history_size; - if (!tableplane.visible) { - tableplane.tr.className = "plane_table_row hidden"; - } else { - TrackedAircraft++; - var classes = "plane_table_row"; - - if (tableplane.position !== null && tableplane.seen_pos < 60) { - ++TrackedAircraftPositions; - if (tableplane.position_from_mlat) - classes += " mlat"; - else - classes += " vPosition"; - } - if (tableplane.icao == SelectedPlane) - classes += " selected"; - - if (tableplane.squawk in SpecialSquawks) { - classes = classes + " " + SpecialSquawks[tableplane.squawk].cssClass; - show_squawk_warning = true; - } - - // ICAO doesn't change - tableplane.tr.cells[2].textContent = (tableplane.flight !== null ? tableplane.flight : ""); - tableplane.tr.cells[3].textContent = (tableplane.squawk !== null ? tableplane.squawk : ""); - tableplane.tr.cells[4].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate); - tableplane.tr.cells[5].textContent = format_speed_brief(tableplane.speed); - tableplane.tr.cells[6].textContent = format_distance_brief(tableplane.sitedist); - tableplane.tr.cells[7].textContent = format_track_brief(tableplane.track); - tableplane.tr.cells[8].textContent = tableplane.messages; - tableplane.tr.cells[9].textContent = tableplane.seen.toFixed(0); - tableplane.tr.className = classes; - } - } - - if (show_squawk_warning) { - $("#SpecialSquawkWarning").css('display', 'block'); - } else { - $("#SpecialSquawkWarning").css('display', 'none'); - } - - resortTable(); -} - -// -// ---- table sorting ---- -// - -function compareAlpha(xa, ya) { - if (xa === ya) - return 0; - if (xa < ya) - return -1; - return 1; -} - -function compareNumeric(xf, yf) { - if (Math.abs(xf - yf) < 1e-9) - return 0; - - return xf - yf; -} - -function sortByICAO() { - sortBy('icao', compareAlpha, function (x) { - return x.icao; - }); -} - -function sortByFlight() { - sortBy('flight', compareAlpha, function (x) { - return x.flight; - }); -} - -function sortBySquawk() { - sortBy('squawk', compareAlpha, function (x) { - return x.squawk; - }); -} - -function sortByAltitude() { - sortBy('altitude', compareNumeric, function (x) { - return (x.altitude == "ground" ? -1e9 : x.altitude); - }); -} - -function sortBySpeed() { - sortBy('speed', compareNumeric, function (x) { - return x.speed; - }); -} - -function sortByDistance() { - sortBy('sitedist', compareNumeric, function (x) { - return x.sitedist; - }); -} - -function sortByTrack() { - sortBy('track', compareNumeric, function (x) { - return x.track; - }); -} - -function sortByMsgs() { - sortBy('msgs', compareNumeric, function (x) { - return x.messages; - }); -} - -function sortBySeen() { - sortBy('seen', compareNumeric, function (x) { - return x.seen; - }); -} - -function sortByCountry() { - sortBy('country', compareAlpha, function (x) { - return x.icaorange.country; - }); -} - -var sortId = ''; -var sortCompare = null; -var sortExtract = null; -var sortAscending = true; - -function sortFunction(x, y) { - var xv = x._sort_value; - var yv = y._sort_value; - - // always sort missing values at the end, regardless of - // ascending/descending sort - if (xv == null && yv == null) return x._sort_pos - y._sort_pos; - if (xv == null) return 1; - if (yv == null) return -1; - - var c = sortAscending ? sortCompare(xv, yv) : sortCompare(yv, xv); - if (c !== 0) return c; - - return x._sort_pos - y._sort_pos; -} - -function resortTable() { - // number the existing rows so we can do a stable sort - // regardless of whether sort() is stable or not. - // Also extract the sort comparison value. - for (var i = 0; i < PlanesOrdered.length; ++i) { - PlanesOrdered[i]._sort_pos = i; - PlanesOrdered[i]._sort_value = sortExtract(PlanesOrdered[i]); - } - - PlanesOrdered.sort(sortFunction); - - var tbody = document.getElementById('tableinfo').tBodies[0]; - for (var i = 0; i < PlanesOrdered.length; ++i) { - tbody.appendChild(PlanesOrdered[i].tr); - } -} - -function sortBy(id, sc, se) { - if (id === sortId) { - sortAscending = !sortAscending; - PlanesOrdered.reverse(); // this correctly flips the order of rows that compare equal - } else { - sortAscending = true; - } - - sortId = id; - sortCompare = sc; - sortExtract = se; - - resortTable(); -} - -function selectPlaneByHex(hex, autofollow) { - //console.log("select: " + hex); - // If SelectedPlane has something in it, clear out the selected - if (SelectedPlane != null) { - Planes[SelectedPlane].selected = false; - Planes[SelectedPlane].clearLines(); - Planes[SelectedPlane].updateMarker(); - $(Planes[SelectedPlane].tr).removeClass("selected"); - document.getElementById("radar_flight_info").style.display = "none" - document.getElementById("radar_flight_loading").style.display = "block" - document.getElementById("radar_aircraft_info").style.display = "none" - document.getElementById("radar_aircraft_loading").style.display = "block" - document.getElementById("lock_button").disabled = false - closeSidebar() - document.getElementById("tableinfo").style.display = "block" - } - - - - // If we are clicking the same plane, we are deselecting it. - // (unless it was a doubleclick..) - if (SelectedPlane === hex && !autofollow) { - hex = null; - document.getElementById("radar_flight_info").style.display = "none" - document.getElementById("radar_flight_loading").style.display = "block" - document.getElementById("radar_aircraft_info").style.display = "none" - document.getElementById("radar_aircraft_loading").style.display = "block" - document.getElementById("lock_button").disabled = false - closeSidebar() - radarRadarTabSwitch() - document.getElementById("tableinfo").style.display = "block" - - } - - if (hex !== null) { - // Assign the new selected - SelectedPlane = hex; - document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") - tabBackgroundImage() - expandSidebar() - radarRadarTabSwitch() - updateFlightTab() - document.getElementById("tableinfo").style.display = "none" - Planes[SelectedPlane].selected = true; - Planes[SelectedPlane].updateLines(); - Planes[SelectedPlane].updateMarker(); - $(Planes[SelectedPlane].tr).addClass("selected"); - document.getElementById("radar_flight_info").style.display = "none" - document.getElementById("radar_flight_loading").style.display = "block" - document.getElementById("radar_aircraft_info").style.display = "none" - document.getElementById("radar_aircraft_loading").style.display = "block" - } else { - SelectedPlane = null; - document.getElementById("radar_flight_info").style.display = "none" - document.getElementById("radar_flight_loading").style.display = "block" - document.getElementById("radar_aircraft_info").style.display = "none" - document.getElementById("radar_aircraft_loading").style.display = "block" - } - - if (SelectedPlane !== null && autofollow) { - FollowSelected = true; - - if (OLMap.getView().getZoom() < 8) - OLMap.getView().setZoom(8); - } else { - FollowSelected = false; - - } - - refreshSelected(); -} - -function toggleFollowSelected() { - FollowSelected = !FollowSelected; - if (FollowSelected && OLMap.getView().getZoom() < 8) - OLMap.getView().setZoom(8); - refreshSelected(); -} - -function resetMap() { - // Reset localStorage values and map settings - localStorage['CenterLat'] = CenterLat = DefaultCenterLat; - localStorage['CenterLon'] = CenterLon = DefaultCenterLon; - localStorage['ZoomLvl'] = ZoomLvl = DefaultZoomLvl; - - // Set and refresh - OLMap.getView().setZoom(ZoomLvl); - OLMap.getView().setCenter(ol.proj.fromLonLat([CenterLon, CenterLat])); - - selectPlaneByHex(null, false); -} - -function toggleOffline() { - // Activates Offline Mode - if (OfflineMode === true) { - OfflineMode = false - console.log("False") - } else { - OfflineMode = true - console.log("True") - } +// -*- mode: javascript; indent-tabs-mode: nil; c-basic-offset: 8 -*- +"use strict"; + +// Define our global variables +var dark_mode = false +var brightness = 0 +var OLMap = null; +var StaticFeatures = new ol.Collection(); +var PlaneIconFeatures = new ol.Collection(); +var PlaneTrailFeatures = new ol.Collection(); +var Planes = {}; +var PlanesOrdered = []; +var SelectedPlane = null; +var FollowSelected = false; +var OfflineMode = false; +var internet_mode_data = {} + +var SpecialSquawks = { + '7500': { + cssClass: 'squawk7500', + markerColor: 'rgb(255, 85, 85)', + text: 'Aircraft Hijacking' + }, + '7600': { + cssClass: 'squawk7600', + markerColor: 'rgb(0, 255, 255)', + text: 'Radio Failure' + }, + '7700': { + cssClass: 'squawk7700', + markerColor: 'rgb(255, 255, 0)', + text: 'General Emergency' + } +}; + +// Get current map settings +var CenterLat, CenterLon, ZoomLvl, MapType; + +var Dump1090Version = "v.2.0"; +var RefreshInterval = 1000; + +var PlaneRowTemplate = null; + +var TrackedAircraft = 0; +var TrackedAircraftPositions = 0; +var TrackedHistorySize = 0; + +var SitePosition = null; + +var ReceiverClock = null; + +var LastReceiverTimestamp = 0; +var StaleReceiverCount = 0; +var FetchPending = null; + +var MessageCountHistory = []; +var MessageRate = 0; + +var NBSP = '\u00a0'; +var ShowClocks = false + +function processReceiverUpdate(data) { + // Loop through all the planes in the data packet + var now = data.now; + var acs = data.aircraft; + + // Detect stats reset + if (MessageCountHistory.length > 0 && MessageCountHistory[MessageCountHistory.length - 1].messages > data.messages) { + MessageCountHistory = [{ + 'time': MessageCountHistory[MessageCountHistory.length - 1].time, + 'messages': 0 + }]; + } + + // Note the message count in the history + MessageCountHistory.push({ + 'time': now, + 'messages': data.messages + }); + // .. and clean up any old values + if ((now - MessageCountHistory[0].time) > 30) + MessageCountHistory.shift(); + + for (var j = 0; j < acs.length; j++) { + var ac = acs[j]; + var hex = ac.hex; + var plane = null; + + // Do we already have this plane object in Planes? + // If not make it. + + if (Planes[hex]) { + plane = Planes[hex]; + } else { + plane = new PlaneObject(hex); + plane.tr = PlaneRowTemplate.cloneNode(true); + + if (hex[0] === '~') { + // Non-ICAO address + plane.tr.cells[0].textContent = hex.substring(1); + $(plane.tr).css('font-style', 'italic'); + } else { + plane.tr.cells[0].textContent = hex; + } + + // set flag image if available + if (ShowFlags && plane.icaorange.flag_image !== null) { + $('img', plane.tr.cells[1]).attr('src', FlagPath + plane.icaorange.flag_image); + $('img', plane.tr.cells[1]).attr('title', plane.icaorange.country); + } else { + $('img', plane.tr.cells[1]).css('display', 'none'); + } + + plane.tr.addEventListener('click', function (h, evt) { + selectPlaneByHex(h, false); + evt.preventDefault(); + }.bind(undefined, hex)); + + plane.tr.addEventListener('dblclick', function (h, evt) { + selectPlaneByHex(h, true); + evt.preventDefault(); + }.bind(undefined, hex)); + + Planes[hex] = plane; + PlanesOrdered.push(plane); + } + + // Call the function update + plane.updateData(now, ac); + } +} + +function fetchData() { + if (FetchPending !== null && FetchPending.state() == 'pending') { + // don't double up on fetches, let the last one resolve + return; + } + + if (internet_mode === 1) { + FetchPending = $.ajax({ + url: 'data/aircraft1.json', + timeout: 5000, + cache: false, + dataType: 'json' + }); + } else if (internet_mode === 0) { + FetchPending = $.ajax({ + url: 'data/aircraft.json', + timeout: 5000, + cache: false, + dataType: 'json' + }); + } + + FetchPending.done(function (data) { + var now = data.now; + if (internet_mode) { + internet_mode_data = data.aircraft + } + processReceiverUpdate(data); + + // update timestamps, visibility, history track for all planes - not only those updated + for (var i = 0; i < PlanesOrdered.length; ++i) { + var plane = PlanesOrdered[i]; + plane.updateTick(now, LastReceiverTimestamp); + } + + refreshTableInfo(); + refreshSelected(); + + if (ReceiverClock) { + var rcv = new Date(now * 1000); + ReceiverClock.render(rcv.getUTCHours(), rcv.getUTCMinutes(), rcv.getUTCSeconds()); + } + + // Check for stale receiver data + if (LastReceiverTimestamp === now) { + StaleReceiverCount++; + if (StaleReceiverCount > 5) { + $("#update_error_detail").text("The data from dump1090 hasn't been updated in a while. Maybe dump1090 is no longer running?"); + $("#update_error").css('display', 'block'); + } + } else { + StaleReceiverCount = 0; + LastReceiverTimestamp = now; + $("#update_error").css('display', 'none'); + } + }); + + FetchPending.fail(function (jqxhr, status, error) { + $("#update_error_detail").text("AJAX call failed (" + status + (error ? (": " + error) : "") + "). Maybe dump1090 is no longer running?"); + $("#update_error").css('display', 'block'); + }); +} + +var PositionHistorySize = 0; + +function initialize() { + + // Set page basics + document.title = PageName; + PlaneRowTemplate = document.getElementById("plane_row_template"); + + if (!ShowClocks) { + $('#timestamps').css('display', 'none'); + } else { + // Create the clocks. + new CoolClock({ + canvasId: "utcclock", + skinId: "classic", + displayRadius: 40, + showSecondHand: true, + gmtOffset: "0", // this has to be a string! + showDigital: false, + logClock: false, + logClockRev: false + }); + + ReceiverClock = new CoolClock({ + canvasId: "receiverclock", + skinId: "classic", + displayRadius: 40, + showSecondHand: true, + gmtOffset: null, + showDigital: false, + logClock: false, + logClockRev: false + }); + + // disable ticking on the receiver clock, we will update it ourselves + ReceiverClock.tick = (function () {}) + } + + // Initialize my functions + getInitialVolume() + readBatteryLevel() + readBrightnessLevel() + modal() + sendCMD("getbranch") + window.setInterval(readBatteryLevel, 1000); + window.setInterval(getBounds, 60000) + getCPUTemp() + window.setInterval(getCPUTemp, 30000) + //window.setInterval(fetchInternetAircraft, 1000) + initializeSchedulesPage(); + document.getElementById("graphs_holder").setAttribute("class", "graphs_s") + document.getElementById("graphs_holder").setAttribute("src", "http://localhost/graphs1090/graphs" + graph_types[starting_graph] + "2h.png") + $("#loader").removeClass("hidden"); + // Get receiver metadata, reconfigure using it, then continue + // with initialization + $.ajax({ + url: 'data/receiver.json', + timeout: 5000, + cache: false, + dataType: 'json' + }) + + .done(function (data) { + if (typeof data.lat !== "undefined") { + SiteShow = true; + SiteLat = data.lat; + SiteLon = data.lon; + DefaultCenterLat = data.lat; + DefaultCenterLon = data.lon; + } + + Dump1090Version = data.version; + RefreshInterval = data.refresh; + PositionHistorySize = data.history; + }) + + .always(function () { + initialize_map(); + start_load_history(); + }); + + + // Settings Modal + + // When the user clicks anywhere outside of the modal, close it + window.onclick = function (event) { + if (event.target == document.getElementById("settings_modal")) { + document.getElementById("settings_modal").style.display = "none"; + } + } +} + +var CurrentHistoryFetch = null; +var PositionHistoryBuffer = [] + +function start_load_history() { + if (PositionHistorySize > 0) { + $("#loader_progress").attr('max', PositionHistorySize); + console.log("Starting to load history (" + PositionHistorySize + " items)"); + load_history_item(0); + } else { + end_load_history(); + } +} + +function load_history_item(i) { + if (i >= PositionHistorySize) { + end_load_history(); + return; + } + + console.log("Loading history #" + i); + $("#loader_progress").attr('value', i); + + $.ajax({ + url: 'data/history_' + i + '.json', + timeout: 5000, + cache: false, + dataType: 'json' + }) + + .done(function (data) { + PositionHistoryBuffer.push(data); + load_history_item(i + 1); + }) + + .fail(function (jqxhr, status, error) { + // No more history + end_load_history(); + }); +} + +function end_load_history() { + $("#loader").addClass("hidden"); + + console.log("Done loading history"); + + if (PositionHistoryBuffer.length > 0) { + var now, last = 0; + + // Sort history by timestamp + console.log("Sorting history"); + PositionHistoryBuffer.sort(function (x, y) { + return (x.now - y.now); + }); + + // Process history + for (var h = 0; h < PositionHistoryBuffer.length; ++h) { + now = PositionHistoryBuffer[h].now; + console.log("Applying history " + h + "/" + PositionHistoryBuffer.length + " at: " + now); + processReceiverUpdate(PositionHistoryBuffer[h]); + + // update track + console.log("Updating tracks at: " + now); + for (var i = 0; i < PlanesOrdered.length; ++i) { + var plane = PlanesOrdered[i]; + plane.updateTrack((now - last) + 1); + } + + last = now; + } + + // Final pass to update all planes to their latest state + console.log("Final history cleanup pass"); + for (var i = 0; i < PlanesOrdered.length; ++i) { + var plane = PlanesOrdered[i]; + plane.updateTick(now); + } + + LastReceiverTimestamp = last; + } + + PositionHistoryBuffer = null; + + console.log("Completing init"); + + refreshTableInfo(); + refreshSelected(); + reaper(); + + // Setup our timer to poll from the server. + window.setInterval(fetchData, RefreshInterval); + window.setInterval(reaper, 60000); + + // And kick off one refresh immediately. + fetchData(); + +} + +// Make a LineString with 'points'-number points +// that is a closed circle on the sphere such that the +// great circle distance from 'center' to each point is +// 'radius' meters +function make_geodesic_circle(center, radius, points) { + var angularDistance = radius / 6378137.0; + var lon1 = center[0] * Math.PI / 180.0; + var lat1 = center[1] * Math.PI / 180.0; + var geom = new ol.geom.LineString(); + for (var i = 0; i <= points; ++i) { + var bearing = i * 2 * Math.PI / points; + + var lat2 = Math.asin(Math.sin(lat1) * Math.cos(angularDistance) + + Math.cos(lat1) * Math.sin(angularDistance) * Math.cos(bearing)); + var lon2 = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(angularDistance) * Math.cos(lat1), + Math.cos(angularDistance) - Math.sin(lat1) * Math.sin(lat2)); + + lat2 = lat2 * 180.0 / Math.PI; + lon2 = lon2 * 180.0 / Math.PI; + geom.appendCoordinate([lon2, lat2]); + } + return geom; +} + +// Initalizes the map and starts up our timers to call various functions +function initialize_map() { + + // Load stored map settings if present + CenterLat = Number(localStorage['CenterLat']) || DefaultCenterLat; + CenterLon = Number(localStorage['CenterLon']) || DefaultCenterLon; + ZoomLvl = Number(localStorage['ZoomLvl']) || DefaultZoomLvl; + MapType = localStorage['MapType']; + + // Set SitePosition, initialize sorting + if (SiteShow && (typeof SiteLat !== 'undefined') && (typeof SiteLon !== 'undefined')) { + SitePosition = [SiteLon, SiteLat]; + sortByDistance(); + } else { + SitePosition = null; + PlaneRowTemplate.cells[6].style.display = 'none'; // hide distance column + document.getElementById("distance").style.display = 'none'; // hide distance header + sortByAltitude(); + } + + // Maybe hide flag info + if (!ShowFlags) { + PlaneRowTemplate.cells[1].style.display = 'none'; // hide flag column + document.getElementById("flag").style.display = 'none'; // hide flag header + document.getElementById("infoblock_country").style.display = 'none'; // hide country row + } + + // Initialize OL3 + + var layers = createBaseLayers(); + + var iconsLayer = new ol.layer.Vector({ + name: 'ac_positions', + type: 'overlay', + title: 'Aircraft positions', + source: new ol.source.Vector({ + features: PlaneIconFeatures, + }) + }); + + layers.push(new ol.layer.Group({ + title: 'Overlays', + name: "Overlays", + fold: 'close', + layers: [ + new ol.layer.Vector({ + name: 'site_pos', + type: 'overlay', + title: 'Site position and range rings', + source: new ol.source.Vector({ + features: StaticFeatures, + }) + }), + + new ol.layer.Vector({ + name: 'ac_trail', + type: 'overlay', + title: 'Selected aircraft trail', + source: new ol.source.Vector({ + features: PlaneTrailFeatures, + }) + }), + + + iconsLayer + ] + })); + + var foundType = false; + + + OLMap = new ol.Map({ + target: 'map_canvas', + layers: layers, + view: new ol.View({ + center: ol.proj.fromLonLat([CenterLon, CenterLat]), + zoom: ZoomLvl + }), + controls: [new ol.control.Zoom(), + new ol.control.Rotate(), + new ol.control.FullScreen(), + new ol.control.ScaleLine({ + units: Metric ? "metric" : "nautical" + }), + new ol.control.LayerSwitcher() + ], + loadTilesWhileAnimating: true, + loadTilesWhileInteracting: true + }); + + var layerSwitcher = new LayerSwitcher({ + reverse: false, + groupSelectStyle: 'group', + activationMode: 'click' + }); + OLMap.addControl(layerSwitcher); + + // Listeners for newly created Map + OLMap.on("moveend", function () { + var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); + if (TAB === 'METAR') { + nearestStations(center[1], center[0]) + } + getBounds() + fetchData() + }) + + OLMap.getView().on('change:center', function (event) { + var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); + localStorage['CenterLon'] = center[0] + localStorage['CenterLat'] = center[1] + if (FollowSelected) { + // On manual navigation, disable follow + var selected = Planes[SelectedPlane]; + if (Math.abs(center[0] - selected.position[0]) > 0.0001 && + Math.abs(center[1] - selected.position[1]) > 0.0001) { + FollowSelected = false; + refreshSelected(); + } + } + }); + + OLMap.getView().on('change:resolution', function (event) { + localStorage['ZoomLvl'] = OLMap.getView().getZoom(); + getBounds() + fetchData() + }); + + OLMap.on(['click', 'dblclick'], function (evt) { + var hex = evt.map.forEachFeatureAtPixel(evt.pixel, + function (feature, layer) { + return feature.hex; + }, + 20, + function (layer) { + return (layer === iconsLayer); + }, + null); + if (hex) { + selectPlaneByHex(hex, (evt.type === 'dblclick')); + evt.stopPropagation(); + } + }); + + // Add home marker if requested + if (SitePosition) { + var markerStyle = new ol.style.Style({ + image: new ol.style.Circle({ + radius: 7, + snapToPixel: false, + fill: new ol.style.Fill({ + color: 'black' + }), + stroke: new ol.style.Stroke({ + color: 'white', + width: 2 + }) + }) + }); + + var feature = new ol.Feature(new ol.geom.Point(ol.proj.fromLonLat(SitePosition))); + feature.setStyle(markerStyle); + StaticFeatures.push(feature); + + if (SiteCircles) { + var circleStyle = new ol.style.Style({ + fill: null, + stroke: new ol.style.Stroke({ + color: '#000000', + width: 1 + }) + }); + + for (var i = 0; i < SiteCirclesDistances.length; ++i) { + var distance = SiteCirclesDistances[i] * 1000.0; + if (!Metric) { + distance *= 1.852; + } + + var circle = make_geodesic_circle(SitePosition, distance, 360); + circle.transform('EPSG:4326', 'EPSG:3857'); + var feature = new ol.Feature(circle); + feature.setStyle(circleStyle); + StaticFeatures.push(feature); + } + } + } + + getBounds() + + // Add terrain-limit rings. To enable this: + // + // create a panorama for your receiver location on heywhatsthat.com + // + // note the "view" value from the URL at the top of the panorama + // i.e. the XXXX in http://www.heywhatsthat.com/?view=XXXX + // + // fetch a json file from the API for the altitudes you want to see: + // + // wget -O /usr/share/dump1090-mutability/html/upintheair.json \ + // 'http://www.heywhatsthat.com/api/upintheair.json?id=XXXX&refraction=0.25&alts=3048,9144' + // + // NB: altitudes are in _meters_, you can specify a list of altitudes + + // kick off an ajax request that will add the rings when it's done + var request = $.ajax({ + url: 'upintheair.json', + timeout: 5000, + cache: true, + dataType: 'json' + }); + request.done(function (data) { + var ringStyle = new ol.style.Style({ + fill: null, + stroke: new ol.style.Stroke({ + color: '#000000', + width: 1 + }) + }); + + for (var i = 0; i < data.rings.length; ++i) { + var geom = new ol.geom.LineString(); + var points = data.rings[i].points; + if (points.length > 0) { + for (var j = 0; j < points.length; ++j) { + geom.appendCoordinate([points[j][1], points[j][0]]); + } + geom.appendCoordinate([points[0][1], points[0][0]]); + geom.transform('EPSG:4326', 'EPSG:3857'); + + var feature = new ol.Feature(geom); + feature.setStyle(ringStyle); + StaticFeatures.push(feature); + } + } + }); + + request.fail(function (jqxhr, status, error) { + // no rings available, do nothing + }); + goHome() +} + +// This looks for planes to reap out of the master Planes variable +function reaper() { + //console.log("Reaping started.."); + + // Look for planes where we have seen no messages for >300 seconds + var newPlanes = []; + for (var i = 0; i < PlanesOrdered.length; ++i) { + var plane = PlanesOrdered[i]; + + if (plane.seen > 300) { + // Reap it. + //console.log("Reaping " + plane.icao); + //console.log("parent " + plane.tr.parentNode); + plane.tr.parentNode.removeChild(plane.tr); + plane.tr = null; + delete Planes[plane.icao]; + plane.destroy(); + } else { + // Keep it. + newPlanes.push(plane); + } + }; + + PlanesOrdered = newPlanes; + refreshTableInfo(); + refreshSelected(); +} + +// Page Title update function +function refreshPageTitle() { + if (!PlaneCountInTitle && !MessageRateInTitle) + return; + + var subtitle = ""; + + if (PlaneCountInTitle) { + subtitle += TrackedAircraftPositions + '/' + TrackedAircraft; + } + + if (MessageRateInTitle) { + if (MessageRate != null) { + if (subtitle) subtitle += ' | '; + subtitle += MessageRate.toFixed(1) + '/s'; + } + } + + document.title = PageName + ' - ' + subtitle; +} + +// Refresh the detail window about the plane +function refreshSelected() { + if (MessageCountHistory.length > 1) { + var message_time_delta = MessageCountHistory[MessageCountHistory.length - 1].time - MessageCountHistory[0].time; + var message_count_delta = MessageCountHistory[MessageCountHistory.length - 1].messages - MessageCountHistory[0].messages; + if (message_time_delta > 0) + MessageRate = message_count_delta / message_time_delta; + } else { + MessageRate = null; + } + + refreshPageTitle(); + + var selected = false; + if (typeof SelectedPlane !== 'undefined' && SelectedPlane != "ICAO" && SelectedPlane != null) { + selected = Planes[SelectedPlane]; + } + + if (!selected) { + $('#selected_infoblock').css('display', 'none'); + $('#dump1090_infoblock').css('display', 'block'); + $('#dump1090_version').text(Dump1090Version); + $('#dump1090_total_ac').text(TrackedAircraft); + $('#dump1090_total_ac_positions').text(TrackedAircraftPositions); + $('#dump1090_total_history').text(TrackedHistorySize); + + if (MessageRate !== null) { + $('#dump1090_message_rate').text(MessageRate.toFixed(1)); + } else { + $('#dump1090_message_rate').text("n/a"); + } + + return; + } + + $('#dump1090_infoblock').css('display', 'none'); + $('#selected_infoblock').css('display', 'block'); + + $('#selected_flightaware_link').attr('href', '//flightaware.com/live/modes/' + selected.icao + '/redirect'); + + if (selected.flight !== null && selected.flight !== "") { + $('#selected_callsign').text(selected.flight); + $('#selected_links').css('display', 'inline'); + $('#selected_fr24_link').attr('href', 'http://fr24.com/' + selected.flight); + $('#selected_flightstats_link').attr('href', 'http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do?flightNumber=' + selected.flight); + $('#selected_planefinder_link').attr('href', 'https://planefinder.net/flight/' + selected.flight); + } else { + $('#selected_callsign').text('n/a'); + $('#selected_links').css('display', 'none'); + } + + if (selected.registration !== null) { + $('#selected_registration').text(selected.registration); + } else { + $('#selected_registration').text(""); + } + + if (selected.icaotype !== null) { + $('#selected_icaotype').text(selected.icaotype); + } else { + $('#selected_icaotype').text(""); + } + + var emerg = document.getElementById('selected_emergency'); + if (selected.squawk in SpecialSquawks) { + emerg.className = SpecialSquawks[selected.squawk].cssClass; + emerg.textContent = NBSP + 'Squawking: ' + SpecialSquawks[selected.squawk].text + NBSP; + } else { + emerg.className = 'hidden'; + } + + $("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate)); + + if (selected.squawk === null || selected.squawk === '0000') { + $('#selected_squawk').text('n/a'); + } else { + $('#selected_squawk').text(selected.squawk); + } + + $('#selected_speed').text(format_speed_long(selected.speed)); + $('#selected_icao').text(selected.icao.toUpperCase()); + $('#airframes_post_icao').attr('value', selected.icao); + $('#selected_track').text(format_track_long(selected.track)); + + if (selected.seen <= 1) { + $('#selected_seen').text('now'); + } else { + $('#selected_seen').text(selected.seen.toFixed(1) + 's'); + } + + $('#selected_country').text(selected.icaorange.country); + if (ShowFlags && selected.icaorange.flag_image !== null) { + $('#selected_flag').removeClass('hidden'); + $('#selected_flag img').attr('src', FlagPath + selected.icaorange.flag_image); + $('#selected_flag img').attr('title', selected.icaorange.country); + } else { + $('#selected_flag').addClass('hidden'); + } + + if (selected.position === null) { + $('#selected_position').text('n/a'); + $('#selected_follow').addClass('hidden'); + } else { + var mlat_bit = (selected.position_from_mlat ? "MLAT: " : ""); + if (selected.seen_pos > 1) { + $('#selected_position').text("(" + mlat_bit + format_latlng(selected.position) + ")"); + } else { + $('#selected_position').text(mlat_bit + format_latlng(selected.position)); + } + $('#selected_follow').removeClass('hidden'); + if (FollowSelected) { + $('#selected_follow').css('font-weight', 'bold'); + OLMap.getView().setCenter(ol.proj.fromLonLat(selected.position)); + } else { + $('#selected_follow').css('font-weight', 'normal'); + } + } + + $('#selected_sitedist').text(format_distance_long(selected.sitedist)); + $('#selected_rssi').text(selected.rssi.toFixed(1) + ' dBFS'); +} + +// Refreshes the larger table of all the planes +function refreshTableInfo() { + var show_squawk_warning = false; + + TrackedAircraft = 0 + TrackedAircraftPositions = 0 + TrackedHistorySize = 0 + + for (var i = 0; i < PlanesOrdered.length; ++i) { + var tableplane = PlanesOrdered[i]; + TrackedHistorySize += tableplane.history_size; + if (!tableplane.visible) { + tableplane.tr.className = "plane_table_row hidden"; + } else { + TrackedAircraft++; + var classes = "plane_table_row"; + + if (tableplane.position !== null && tableplane.seen_pos < 60) { + ++TrackedAircraftPositions; + if (tableplane.position_from_mlat) + classes += " mlat"; + else + classes += " vPosition"; + } + if (tableplane.icao == SelectedPlane) + classes += " selected"; + + if (tableplane.squawk in SpecialSquawks) { + classes = classes + " " + SpecialSquawks[tableplane.squawk].cssClass; + show_squawk_warning = true; + } + + // ICAO doesn't change + tableplane.tr.cells[2].textContent = (tableplane.flight !== null ? tableplane.flight : ""); + tableplane.tr.cells[3].textContent = (tableplane.squawk !== null ? tableplane.squawk : ""); + tableplane.tr.cells[4].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate); + tableplane.tr.cells[5].textContent = format_speed_brief(tableplane.speed); + tableplane.tr.cells[6].textContent = format_distance_brief(tableplane.sitedist); + tableplane.tr.cells[7].textContent = format_track_brief(tableplane.track); + tableplane.tr.cells[8].textContent = tableplane.messages; + tableplane.tr.cells[9].textContent = tableplane.seen.toFixed(0); + tableplane.tr.className = classes; + } + } + + if (show_squawk_warning) { + $("#SpecialSquawkWarning").css('display', 'block'); + } else { + $("#SpecialSquawkWarning").css('display', 'none'); + } + + resortTable(); +} + +// +// ---- table sorting ---- +// + +function compareAlpha(xa, ya) { + if (xa === ya) + return 0; + if (xa < ya) + return -1; + return 1; +} + +function compareNumeric(xf, yf) { + if (Math.abs(xf - yf) < 1e-9) + return 0; + + return xf - yf; +} + +function sortByICAO() { + sortBy('icao', compareAlpha, function (x) { + return x.icao; + }); +} + +function sortByFlight() { + sortBy('flight', compareAlpha, function (x) { + return x.flight; + }); +} + +function sortBySquawk() { + sortBy('squawk', compareAlpha, function (x) { + return x.squawk; + }); +} + +function sortByAltitude() { + sortBy('altitude', compareNumeric, function (x) { + return (x.altitude == "ground" ? -1e9 : x.altitude); + }); +} + +function sortBySpeed() { + sortBy('speed', compareNumeric, function (x) { + return x.speed; + }); +} + +function sortByDistance() { + sortBy('sitedist', compareNumeric, function (x) { + return x.sitedist; + }); +} + +function sortByTrack() { + sortBy('track', compareNumeric, function (x) { + return x.track; + }); +} + +function sortByMsgs() { + sortBy('msgs', compareNumeric, function (x) { + return x.messages; + }); +} + +function sortBySeen() { + sortBy('seen', compareNumeric, function (x) { + return x.seen; + }); +} + +function sortByCountry() { + sortBy('country', compareAlpha, function (x) { + return x.icaorange.country; + }); +} + +var sortId = ''; +var sortCompare = null; +var sortExtract = null; +var sortAscending = true; + +function sortFunction(x, y) { + var xv = x._sort_value; + var yv = y._sort_value; + + // always sort missing values at the end, regardless of + // ascending/descending sort + if (xv == null && yv == null) return x._sort_pos - y._sort_pos; + if (xv == null) return 1; + if (yv == null) return -1; + + var c = sortAscending ? sortCompare(xv, yv) : sortCompare(yv, xv); + if (c !== 0) return c; + + return x._sort_pos - y._sort_pos; +} + +function resortTable() { + // number the existing rows so we can do a stable sort + // regardless of whether sort() is stable or not. + // Also extract the sort comparison value. + for (var i = 0; i < PlanesOrdered.length; ++i) { + PlanesOrdered[i]._sort_pos = i; + PlanesOrdered[i]._sort_value = sortExtract(PlanesOrdered[i]); + } + + PlanesOrdered.sort(sortFunction); + + var tbody = document.getElementById('tableinfo').tBodies[0]; + for (var i = 0; i < PlanesOrdered.length; ++i) { + tbody.appendChild(PlanesOrdered[i].tr); + } +} + +function sortBy(id, sc, se) { + if (id === sortId) { + sortAscending = !sortAscending; + PlanesOrdered.reverse(); // this correctly flips the order of rows that compare equal + } else { + sortAscending = true; + } + + sortId = id; + sortCompare = sc; + sortExtract = se; + + resortTable(); +} + +function selectPlaneByHex(hex, autofollow) { + //console.log("select: " + hex); + // If SelectedPlane has something in it, clear out the selected + if (SelectedPlane != null) { + Planes[SelectedPlane].selected = false; + Planes[SelectedPlane].clearLines(); + Planes[SelectedPlane].updateMarker(); + $(Planes[SelectedPlane].tr).removeClass("selected"); + document.getElementById("radar_flight_info").style.display = "none" + document.getElementById("radar_flight_loading").style.display = "block" + document.getElementById("radar_aircraft_info").style.display = "none" + document.getElementById("radar_aircraft_loading").style.display = "block" + document.getElementById("lock_button").disabled = false + closeSidebar() + document.getElementById("tableinfo").style.display = "block" + } + + + + // If we are clicking the same plane, we are deselecting it. + // (unless it was a doubleclick..) + if (SelectedPlane === hex && !autofollow) { + hex = null; + document.getElementById("radar_flight_info").style.display = "none" + document.getElementById("radar_flight_loading").style.display = "block" + document.getElementById("radar_aircraft_info").style.display = "none" + document.getElementById("radar_aircraft_loading").style.display = "block" + document.getElementById("lock_button").disabled = false + closeSidebar() + radarRadarTabSwitch() + document.getElementById("tableinfo").style.display = "block" + + } + + if (hex !== null) { + // Assign the new selected + SelectedPlane = hex; + document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") + tabBackgroundImage() + expandSidebar() + radarRadarTabSwitch() + updateFlightTab() + document.getElementById("tableinfo").style.display = "none" + Planes[SelectedPlane].selected = true; + Planes[SelectedPlane].updateLines(); + Planes[SelectedPlane].updateMarker(); + $(Planes[SelectedPlane].tr).addClass("selected"); + document.getElementById("radar_flight_info").style.display = "none" + document.getElementById("radar_flight_loading").style.display = "block" + document.getElementById("radar_aircraft_info").style.display = "none" + document.getElementById("radar_aircraft_loading").style.display = "block" + } else { + SelectedPlane = null; + document.getElementById("radar_flight_info").style.display = "none" + document.getElementById("radar_flight_loading").style.display = "block" + document.getElementById("radar_aircraft_info").style.display = "none" + document.getElementById("radar_aircraft_loading").style.display = "block" + } + + if (SelectedPlane !== null && autofollow) { + FollowSelected = true; + + if (OLMap.getView().getZoom() < 8) + OLMap.getView().setZoom(8); + } else { + FollowSelected = false; + + } + + refreshSelected(); +} + +function toggleFollowSelected() { + FollowSelected = !FollowSelected; + if (FollowSelected && OLMap.getView().getZoom() < 8) + OLMap.getView().setZoom(8); + refreshSelected(); +} + +function resetMap() { + // Reset localStorage values and map settings + localStorage['CenterLat'] = CenterLat = DefaultCenterLat; + localStorage['CenterLon'] = CenterLon = DefaultCenterLon; + localStorage['ZoomLvl'] = ZoomLvl = DefaultZoomLvl; + + // Set and refresh + OLMap.getView().setZoom(ZoomLvl); + OLMap.getView().setCenter(ol.proj.fromLonLat([CenterLon, CenterLat])); + + selectPlaneByHex(null, false); +} + +function toggleOffline() { + // Activates Offline Mode + if (OfflineMode === true) { + OfflineMode = false + console.log("False") + } else { + OfflineMode = true + console.log("True") + } } \ No newline at end of file diff --git a/js/script2.js b/js/script2.js index eeec70e..f646f77 100644 --- a/js/script2.js +++ b/js/script2.js @@ -1,639 +1,649 @@ -function openMetar() { - expandSidebar() - document.getElementById("metar_container").style.display = "block" - document.getElementById("radar_container").style.display = "none" - document.getElementById("atc_container").style.display = "none" - TAB = "METAR" - var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); - nearestStations(center[1], center[0]) - document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" - if (lastATC === 1) { - StaticFeatures.removeAt(0) - } -} - -function openRadar() { - expandSidebar() - document.getElementById("metar_container").style.display = "none" - document.getElementById("radar_container").style.display = "block" - document.getElementById("atc_container").style.display = "none" - TAB = "RADAR" - document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" - if (lastMETAR === 1) { - StaticFeatures.removeAt(0) - } - if (lastATC === 1) { - StaticFeatures.removeAt(0) - } -} - -function openATC() { - expandSidebar() - document.getElementById("metar_container").style.display = "none" - document.getElementById("radar_container").style.display = "none" - document.getElementById("atc_container").style.display = "block" - TAB = "ATC" - listStations() - document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" - if (lastMETAR === 1) { - StaticFeatures.removeAt(0) - } -} - -function readBatteryLevel() { - FetchPending = $.ajax({ - url: 'data/battery.json', - timeout: 5000, - cache: false, - dataType: 'json' - }); - FetchPending.done(function (data) { - document.getElementById("percentage").innerHTML = data.percentage[0].level + "%" - battery = data.adapter[0].status - if (battery === "in") { - document.getElementById('battery').innerHTML = "battery_charging_full" - - } else if (data.percentage[0].level < 21) { - document.getElementById('battery').innerHTML = "battery_alert" - - } else { - document.getElementById('battery').innerHTML = "battery_full" - - } - }); - -} - -function celciusToF(number) { - return number * 9 / 5 + 32 -} - -function metersToF(number) { - return number * 3.28084 -} - -function numToCompass(num) { - var val = Math.floor((num / 22.5) + 0.5); - var arr = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]; - return arr[(val % 16)]; -} - -function ktsToMPH(num) { - return num * 1.15078 -} - -function showInformation() { - document.getElementById("settings_information").style.display = "block" - document.getElementById("settings_default").style.display = "none" - -} - -function showDefault() { - document.getElementById("settings_default").style.display = "block" - document.getElementById("settings_information").style.display = "none" -} - -function volUp() { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response) - document.getElementById("volume_level").innerHTML = xhr.response - } - } - xhr.send(JSON.stringify({ - direction: 1 - })); - -} - -function volDown() { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response) - document.getElementById("volume_level").innerHTML = xhr.response - } - } - xhr.send(JSON.stringify({ - direction: 0 - })); -} - -function changeMapBounds(btm_left, top_right) { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":8000/internet", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - //console.log(xhr.response) - } - } - var json = { - lat_north: top_right[1], - lat_south: btm_left[1], - long_east: btm_left[0], - long_west: top_right[0] - } - xhr.send(JSON.stringify(json)); -} - -function toggleInternet() { - if (internet_mode === 0) { - getBounds() - internet_mode = 1 - document.getElementById("internet_mode").innerHTML = "wifi" - } else if (internet_mode === 1) { - location.reload(); - } -} - -function getBounds() { - const extent = OLMap.getView().calculateExtent(OLMap.getSize()) - var coord1 = [extent[0], extent[1]] - var point1 = ol.proj.toLonLat(coord1, OLMap.getView().getProjection()) - var coord2 = [extent[2], extent[3]] - var point2 = ol.proj.toLonLat(coord2, OLMap.getView().getProjection()) - changeMapBounds(point1, point2) - //console.log(point1, point2) -} - -function modal() { - var modal = document.getElementById("info_modal"); - var btn = document.getElementById("info_button"); - var span = document.getElementById("close_modal"); - btn.onclick = function () { - modal.style.display = "block"; - } - span.onclick = function () { - modal.style.display = "none"; - } - window.onclick = function (event) { - if (event.target == modal) { - modal.style.display = "none"; - } - } - modal2() -} - -function modal2() { - var modal = document.getElementById("image_modal"); - var btn = document.getElementById("img_button"); - var span = document.getElementById("close_modal2"); - btn.onclick = function () { - modal.style.display = "block"; - } - span.onclick = function () { - modal.style.display = "none"; - } - window.onclick = function (event) { - if (event.target == modal) { - modal.style.display = "none"; - } - } - modal3() -} - -function modal3() { - var modal = document.getElementById("aircraft_modal"); - var btn = document.getElementById("aircraft_button"); - var span = document.getElementById("close_modal3"); - btn.onclick = function () { - modal.style.display = "block"; - } - span.onclick = function () { - modal.style.display = "none"; - } - window.onclick = function (event) { - if (event.target == modal) { - modal.style.display = "none"; - } - } - modal4() -} - -function modal4() { - var modal = document.getElementById("power_modal"); - var btn = document.getElementById("power_button"); - var span = document.getElementById("close_modal4"); - btn.onclick = function () { - modal.style.display = "block"; - } - span.onclick = function () { - modal.style.display = "none"; - } - window.onclick = function (event) { - if (event.target == modal) { - modal.style.display = "none"; - } - } -} - -function getInitialVolume() { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response) - document.getElementById("volume_level").innerHTML = xhr.response - } - } - xhr.send(JSON.stringify({ - direction: 2 - })); -} - -function getCPUTemp() { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - temp = xhr.response - temp = temp.substring(5, temp.length - 5) - var temp_percentage = temp / 85 * 100 - temp = celciusToF(parseFloat(temp)); - document.getElementById("internal_temperature").innerHTML = temp - document.getElementById("internal_temperature").style.color = hsl_col_perc(temp_percentage, 0, 120) - } - } - xhr.send(JSON.stringify({ - command: "vcgencmd measure_temp" - })); -} - -function readBrightnessLevel() { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - brightness = parseFloat(xhr.response) - document.getElementById("brightness_level").innerHTML = brightness - } - } - xhr.send(JSON.stringify({ - level: 256 - })); -} - - - -function setBrightness(direction) { - if (direction === "up") { - if (brightness + 5 <= 255) { - brightness = brightness + 5 - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify({ - level: brightness - })); - document.getElementById("brightness_level").innerHTML = brightness - } - } - if (direction === "down") { - if (brightness - 5 >= 15) { - brightness = brightness - 5 - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify({ - level: brightness - })); - document.getElementById("brightness_level").innerHTML = brightness - } - - } -} - -function offlineToggle() { - if (document.getElementById("switch-1").checked) { - openRadar() - document.getElementById("metar_button").disabled = true; - document.getElementById("liveatc_button").disabled = true; - document.getElementById("player").pause() - document.getElementById("itinerary_button").style.opacity = .4 - document.getElementById("itinerary_button").classList.remove("pointer") - document.getElementById("itinerary_button").removeAttribute("onclick") - } else { - document.getElementById("metar_button").disabled = false; - document.getElementById("liveatc_button").disabled = false; - document.getElementById("itinerary_button").style.opacity = 1 - document.getElementById("itinerary_button").classList.add("pointer") - document.getElementById("itinerary_button").setAttribute("onclick", "goItinerary()") - } - -} - -function lockPlane() { - selectPlaneByHex(SelectedPlane, true); - document.getElementById("lock_button").disabled = true -} - -function sendCMD(cmd) { - if (cmd === "update") { - var output = "" - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response + "A") - if (xhr.response.substring(0, 19) === "Already up to date.") { - var snackbarContainer = document.getElementById('no-updates-snackbar'); - var data = { - message: 'Already Up To Date!' - }; - snackbarContainer.MaterialSnackbar.showSnackbar(data); - } else { - var snackbarContainer = document.getElementById('no-updates-snackbar'); - var data = { - message: 'Updating...' - }; - snackbarContainer.MaterialSnackbar.showSnackbar(data); - } - } - } - xhr.send(JSON.stringify({ - command: "sudo git pull" - })); - } - if (cmd === "getbranch") { - var output = "" - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - output = xhr.response - var current_branch = output.substr(2, output.length - 3) - if (current_branch === 'unstable') { - document.getElementById("branch_name").innerHTML = "stable" - document.getElementById("branch_button").setAttribute("onclick", "changeBranch('master')") - } else { - document.getElementById("branch_name").innerHTML = "unstable" - document.getElementById("branch_button").setAttribute("onclick", "changeBranch('unstable')") - } - - } - } - xhr.send(JSON.stringify({ - command: "sudo git branch | grep -F '*'" - })); - - } - if (cmd === "shutdown") { - var snackbarContainer = document.getElementById('no-updates-snackbar'); - var data = { - message: 'Shutting Down...' - }; - snackbarContainer.MaterialSnackbar.showSnackbar(data); - var output = "" - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response) - output = xhr.response - } - } - xhr.send(JSON.stringify({ - command: "cd /usr/local/bin && sudo x728softsd.sh" - })); - } - if (cmd === "restart") { - var snackbarContainer = document.getElementById('no-updates-snackbar'); - var data = { - message: 'Restarting...' - }; - snackbarContainer.MaterialSnackbar.showSnackbar(data); - var output = "" - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - console.log(xhr.response) - output = xhr.response - } - } - xhr.send(JSON.stringify({ - command: "cd /usr/local/bin && sudo reboot" - })); - } - - -} - -function tabBackgroundImage() { - if (Planes[SelectedPlane].registration !== null) { - 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") - if (img1.attr('src') !== undefined) { - document.getElementById("aircraft_tab_background").setAttribute('src', img1.attr('src')) - document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" - } else { - document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") - document.getElementById("sidebar_close").style.color = "rgba(255,255,255,.7)" - } - return - } - } - xhr.send(JSON.stringify({ - command: "curl https://www.jetphotos.com/photo/keyword/" + Planes[SelectedPlane].registration - })); - } else { - document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") - document.getElementById("sidebar_close").style.color = "rgba(255,255,255,.7)" - } -} - -function expandSidebar() { - document.getElementById("sidebar_container").style.display = "block" - document.getElementById("sidebar_open_button").style.display = "none" -} - -function closeSidebar() { - document.getElementById("sidebar_container").style.display = "none" - document.getElementById("sidebar_open_button").style.display = "block" -} - -function changeColorMode() { - const themeStylesheet = document.getElementById('theme') - //const themeToggle = document.getElementById('theme-toggle') - if (themeStylesheet.href.includes('light')) { - - document.getElementById("logo").setAttribute("src", "images/dark/logo.png") - document.getElementById("radar_image").setAttribute("src", "images/dark/radar.png") - document.getElementById("itinerary_image").setAttribute("src", "images/dark/itinerary.png") - document.getElementById("graphs_image").setAttribute("src", "images/dark/graphs.png") - document.getElementById("settings_image").setAttribute("src", "images/dark/settings.png") - document.getElementById("settings_logo").setAttribute("src", "images/dark/logo.png") - themeStylesheet.href = 'css/ui1-dark.css' - // themeToggle.innerText = 'Switch to light mode' - } else { - // if it's dark -> go light - themeStylesheet.href = 'css/ui1-light.css' - document.getElementById("logo").setAttribute("src", "images/light/logo.png") - document.getElementById("radar_image").setAttribute("src", "images/light/radar.png") - document.getElementById("itinerary_image").setAttribute("src", "images/light/itinerary.png") - document.getElementById("graphs_image").setAttribute("src", "images/light/graphs.png") - document.getElementById("settings_image").setAttribute("src", "images/light/settings.png") - document.getElementById("settings_logo").setAttribute("src", "images/light/logo.png") - //themeToggle.innerText = 'Switch to dark mode' - } -} - -function changeBranch(branch) { - var xhr = new XMLHttpRequest(); - xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify({ - command: "sudo git checkout " + branch - })); - sendCMD("getbranch") -} - -function goHome() { - // document.getElementById("itinerary_page").style.display = "none" - document.getElementById("radar_page").style.display = "none" - document.getElementById("home_page").style.display = "block" - document.getElementById("settings_page").style.display = "none" - document.getElementById("graphs_page").style.display = "none" -} - -function goRadar() { - //document.getElementById("itinerary_page").style.display = "none" - document.getElementById("radar_page").style.display = "block" - document.getElementById("itin_nav_bar").style.display = "none" - document.getElementById("nav_bar").style.display = "block" - document.getElementById("radar_container").style.display = "block" - document.getElementById("itinerary_container").style.display = "none" - - document.getElementById("home_page").style.display = "none" - document.getElementById("settings_page").style.display = "none" - document.getElementById("graphs_page").style.display = "none" -} - -function goItinerary() { - document.getElementById("radar_page").style.display = "block" - document.getElementById("itin_nav_bar").style.display = "block" - document.getElementById("nav_bar").style.display = "none" - document.getElementById("radar_container").style.display = "none" - document.getElementById("itinerary_container").style.display = "block" - - document.getElementById("home_page").style.display = "none" - document.getElementById("settings_page").style.display = "none" - document.getElementById("graphs_page").style.display = "none" -} - -function goSettings() { - // document.getElementById("itinerary_page").style.display = "none" - document.getElementById("settings_page").style.display = "block" - document.getElementById("radar_page").style.display = "none" - document.getElementById("home_page").style.display = "none" - document.getElementById("graphs_page").style.display = "none" -} - - -function goGraphs() { - //document.getElementById("itinerary_page").style.display = "none" - document.getElementById("settings_page").style.display = "none" - document.getElementById("radar_page").style.display = "none" - document.getElementById("home_page").style.display = "none" - document.getElementById("graphs_page").style.display = "block" -} - -function itinAirportArrivals() { - document.getElementById("itin_arr").style.display = "block" - document.getElementById("itin_info").style.display = "none" -} - -function itinAirportDepartures() { - document.getElementById("itin_dep").style.display = "block" - document.getElementById("itin_info").style.display = "none" -} - -function radarRadarTabSwitch() { - document.getElementById("radar_radar_tab").style.display = "block" - document.getElementById("radar_flight_tab").style.display = "none" - document.getElementById("radar_aircraft_tab").style.display = "none" -} - -function radarFlightTabSwitch() { - document.getElementById("radar_radar_tab").style.display = "none" - document.getElementById("radar_flight_tab").style.display = "block" - document.getElementById("radar_aircraft_tab").style.display = "none" -} - -function radarAircraftTabSwitch() { - document.getElementById("radar_radar_tab").style.display = "none" - document.getElementById("radar_flight_tab").style.display = "none" - document.getElementById("radar_aircraft_tab").style.display = "block" -} - -function changeGraphsTime() { - var time = document.getElementById("graphs_time").value - document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") -} - -function changeGraph(direction) { - - var time = document.getElementById("graphs_time").value - if (direction && starting_graph != graph_types.length - 1) { - starting_graph++ - document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") - console.log(starting_graph) - } else if (starting_graph != 0) { - starting_graph = starting_graph - 1 - document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") - console.log(starting_graph) - } - - if (starting_graph === graph_types.length - 1) { - document.getElementById("arrow_forward_graphs").disabled = true; - } else if (starting_graph === 0) { - document.getElementById("arrow_back_graphs").disabled = true; - } else { - document.getElementById("arrow_back_graphs").disabled = false; - document.getElementById("arrow_forward_graphs").disabled = false; - } - - if (starting_graph === 0) { - document.getElementById("graphs_holder").setAttribute("class", "graphs_s") - } else if (starting_graph === 7) { - document.getElementById("graphs_holder").setAttribute("class", "graphs_s") - } else { - document.getElementById("graphs_holder").setAttribute("class", "graphs") - } -} - - -function toTitleCase(str) { - return str.toLowerCase().split(' ').map(function (word) { - return (word.charAt(0).toUpperCase() + word.slice(1)); - }).join(' '); -} - -function hsl_col_perc(percent, start, end) { - var a = percent / 100, - b = (end - start) * a, - c = b + start; - - // Return a CSS HSL string - return 'hsl(' + c + ', 100%, 50%)'; - // hsl_col_perc(bed_percent, 0, 120) -} - +function openMetar() { + expandSidebar() + document.getElementById("metar_container").style.display = "block" + document.getElementById("radar_container").style.display = "none" + document.getElementById("atc_container").style.display = "none" + TAB = "METAR" + var center = ol.proj.toLonLat(OLMap.getView().getCenter(), OLMap.getView().getProjection()); + nearestStations(center[1], center[0]) + document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" + if (lastATC === 1) { + StaticFeatures.removeAt(0) + } +} + +function openRadar() { + expandSidebar() + document.getElementById("metar_container").style.display = "none" + document.getElementById("radar_container").style.display = "block" + document.getElementById("atc_container").style.display = "none" + TAB = "RADAR" + document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" + if (lastMETAR === 1) { + StaticFeatures.removeAt(0) + } + if (lastATC === 1) { + StaticFeatures.removeAt(0) + } +} + +function openATC() { + expandSidebar() + document.getElementById("metar_container").style.display = "none" + document.getElementById("radar_container").style.display = "none" + document.getElementById("atc_container").style.display = "block" + TAB = "ATC" + listStations() + document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" + if (lastMETAR === 1) { + StaticFeatures.removeAt(0) + } +} + +function readBatteryLevel() { + FetchPending = $.ajax({ + url: 'data/battery.json', + timeout: 5000, + cache: false, + dataType: 'json' + }); + FetchPending.done(function (data) { + document.getElementById("percentage").innerHTML = data.percentage[0].level + "%" + battery = data.adapter[0].status + if (battery === "in") { + document.getElementById('battery').innerHTML = "battery_charging_full" + + } else if (data.percentage[0].level < 21) { + document.getElementById('battery').innerHTML = "battery_alert" + + } else { + document.getElementById('battery').innerHTML = "battery_full" + + } + }); + +} + +function celciusToF(number) { + return number * 9 / 5 + 32 +} + +function metersToF(number) { + return number * 3.28084 +} + +function numToCompass(num) { + var val = Math.floor((num / 22.5) + 0.5); + var arr = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]; + return arr[(val % 16)]; +} + +function ktsToMPH(num) { + return num * 1.15078 +} + +function showInformation() { + document.getElementById("settings_information").style.display = "block" + document.getElementById("settings_default").style.display = "none" + +} + +function showDefault() { + document.getElementById("settings_default").style.display = "block" + document.getElementById("settings_information").style.display = "none" +} + +function volUp() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response) + document.getElementById("volume_level").innerHTML = xhr.response + } + } + xhr.send(JSON.stringify({ + direction: 1 + })); + +} + +function volDown() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response) + document.getElementById("volume_level").innerHTML = xhr.response + } + } + xhr.send(JSON.stringify({ + direction: 0 + })); +} + +function changeMapBounds(btm_left, top_right) { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":8000/internet", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + //console.log(xhr.response) + } + } + var json = { + lat_north: top_right[1], + lat_south: btm_left[1], + long_east: btm_left[0], + long_west: top_right[0] + } + xhr.send(JSON.stringify(json)); +} + +function toggleInternet() { + if (internet_mode === 0) { + getBounds() + internet_mode = 1 + document.getElementById("internet_mode").innerHTML = "wifi" + } else if (internet_mode === 1) { + location.reload(); + } +} + +function getBounds() { + const extent = OLMap.getView().calculateExtent(OLMap.getSize()) + var coord1 = [extent[0], extent[1]] + var point1 = ol.proj.toLonLat(coord1, OLMap.getView().getProjection()) + var coord2 = [extent[2], extent[3]] + var point2 = ol.proj.toLonLat(coord2, OLMap.getView().getProjection()) + changeMapBounds(point1, point2) + //console.log(point1, point2) +} + +function modal() { + var modal = document.getElementById("info_modal"); + var btn = document.getElementById("info_button"); + var span = document.getElementById("close_modal"); + btn.onclick = function () { + modal.style.display = "block"; + } + span.onclick = function () { + modal.style.display = "none"; + } + window.onclick = function (event) { + if (event.target == modal) { + modal.style.display = "none"; + } + } + modal2() +} + +function modal2() { + var modal = document.getElementById("image_modal"); + var btn = document.getElementById("img_button"); + var span = document.getElementById("close_modal2"); + btn.onclick = function () { + modal.style.display = "block"; + } + span.onclick = function () { + modal.style.display = "none"; + } + window.onclick = function (event) { + if (event.target == modal) { + modal.style.display = "none"; + } + } + modal3() +} + +function modal3() { + var modal = document.getElementById("aircraft_modal"); + var btn = document.getElementById("aircraft_button"); + var span = document.getElementById("close_modal3"); + btn.onclick = function () { + modal.style.display = "block"; + } + span.onclick = function () { + modal.style.display = "none"; + } + window.onclick = function (event) { + if (event.target == modal) { + modal.style.display = "none"; + } + } + modal4() +} + +function modal4() { + var modal = document.getElementById("power_modal"); + var btn = document.getElementById("power_button"); + var span = document.getElementById("close_modal4"); + btn.onclick = function () { + modal.style.display = "block"; + } + span.onclick = function () { + modal.style.display = "none"; + } + window.onclick = function (event) { + if (event.target == modal) { + modal.style.display = "none"; + } + } +} + +function getInitialVolume() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/audio", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response) + document.getElementById("volume_level").innerHTML = xhr.response + } + } + xhr.send(JSON.stringify({ + direction: 2 + })); +} + +function getCPUTemp() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + temp = xhr.response + temp = temp.substring(5, temp.length - 5) + var temp_percentage = temp / 85 * 100 + temp = celciusToF(parseFloat(temp)); + document.getElementById("internal_temperature").innerHTML = temp + document.getElementById("internal_temperature").style.color = hsl_col_perc(temp_percentage, 0, 120) + } + } + xhr.send(JSON.stringify({ + command: "vcgencmd measure_temp" + })); +} + +function readBrightnessLevel() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + brightness = parseFloat(xhr.response) + document.getElementById("brightness_level").innerHTML = brightness + } + } + xhr.send(JSON.stringify({ + level: 256 + })); +} + + + +function setBrightness(direction) { + if (direction === "up") { + if (brightness + 5 <= 255) { + brightness = brightness + 5 + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.send(JSON.stringify({ + level: brightness + })); + document.getElementById("brightness_level").innerHTML = brightness + } + } + if (direction === "down") { + if (brightness - 5 >= 15) { + brightness = brightness - 5 + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/brightness", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.send(JSON.stringify({ + level: brightness + })); + document.getElementById("brightness_level").innerHTML = brightness + } + + } +} + +function offlineToggle() { + if (document.getElementById("switch-1").checked) { + openRadar() + document.getElementById("metar_button").disabled = true; + document.getElementById("liveatc_button").disabled = true; + document.getElementById("player").pause() + document.getElementById("itinerary_button").style.opacity = .4 + document.getElementById("itinerary_button").classList.remove("pointer") + document.getElementById("itinerary_button").removeAttribute("onclick") + } else { + document.getElementById("metar_button").disabled = false; + document.getElementById("liveatc_button").disabled = false; + document.getElementById("itinerary_button").style.opacity = 1 + document.getElementById("itinerary_button").classList.add("pointer") + document.getElementById("itinerary_button").setAttribute("onclick", "goItinerary()") + } + +} + +function lockPlane() { + selectPlaneByHex(SelectedPlane, true); + document.getElementById("lock_button").disabled = true +} + +function sendCMD(cmd) { + if (cmd === "update") { + var output = "" + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response + "A") + if (xhr.response.substring(0, 19) === "Already up to date.") { + var snackbarContainer = document.getElementById('no-updates-snackbar'); + var data = { + message: 'Already Up To Date!' + }; + snackbarContainer.MaterialSnackbar.showSnackbar(data); + } else { + var snackbarContainer = document.getElementById('no-updates-snackbar'); + var data = { + message: 'Updating...' + }; + snackbarContainer.MaterialSnackbar.showSnackbar(data); + } + } + } + xhr.send(JSON.stringify({ + command: "sudo git pull" + })); + } + if (cmd === "getbranch") { + var output = "" + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + output = xhr.response + var current_branch = output.substr(2, output.length - 3) + if (current_branch === 'unstable') { + document.getElementById("branch_name").innerHTML = "stable" + document.getElementById("branch_button").setAttribute("onclick", "changeBranch('master')") + } else { + document.getElementById("branch_name").innerHTML = "unstable" + document.getElementById("branch_button").setAttribute("onclick", "changeBranch('unstable')") + } + + } + } + xhr.send(JSON.stringify({ + command: "sudo git branch | grep -F '*'" + })); + + } + if (cmd === "shutdown") { + var snackbarContainer = document.getElementById('no-updates-snackbar'); + var data = { + message: 'Shutting Down...' + }; + snackbarContainer.MaterialSnackbar.showSnackbar(data); + var output = "" + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response) + output = xhr.response + } + } + xhr.send(JSON.stringify({ + command: "cd /usr/local/bin && sudo x728softsd.sh" + })); + } + if (cmd === "restart") { + var snackbarContainer = document.getElementById('no-updates-snackbar'); + var data = { + message: 'Restarting...' + }; + snackbarContainer.MaterialSnackbar.showSnackbar(data); + var output = "" + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + console.log(xhr.response) + output = xhr.response + } + } + xhr.send(JSON.stringify({ + command: "cd /usr/local/bin && sudo reboot" + })); + } + + +} + +function tabBackgroundImage() { + if (Planes[SelectedPlane].registration !== null) { + 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") + if (img1.attr('src') !== undefined) { + document.getElementById("aircraft_tab_background").setAttribute('src', img1.attr('src')) + document.getElementById("sidebar_close").style.color = "rgba(0,0,0,.7)" + } else { + document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") + document.getElementById("sidebar_close").style.color = "rgba(255,255,255,.7)" + } + return + } + } + xhr.send(JSON.stringify({ + command: "curl https://www.jetphotos.com/photo/keyword/" + Planes[SelectedPlane].registration + })); + } else { + document.getElementById("aircraft_tab_background").setAttribute('src', "images/black.jpg") + document.getElementById("sidebar_close").style.color = "rgba(255,255,255,.7)" + } +} + +function expandSidebar() { + document.getElementById("sidebar_container").style.display = "block" + document.getElementById("sidebar_open_button").style.display = "none" +} + +function closeSidebar() { + document.getElementById("sidebar_container").style.display = "none" + document.getElementById("sidebar_open_button").style.display = "block" +} + +function changeColorMode() { + const themeStylesheet = document.getElementById('theme') + //const themeToggle = document.getElementById('theme-toggle') + if (themeStylesheet.href.includes('light')) { + + document.getElementById("logo").setAttribute("src", "images/dark/logo.png") + document.getElementById("radar_image").setAttribute("src", "images/dark/radar.png") + document.getElementById("itinerary_image").setAttribute("src", "images/dark/itinerary.png") + document.getElementById("graphs_image").setAttribute("src", "images/dark/graphs.png") + document.getElementById("settings_image").setAttribute("src", "images/dark/settings.png") + document.getElementById("settings_logo").setAttribute("src", "images/dark/logo.png") + themeStylesheet.href = 'css/ui2-dark.css' + // themeToggle.innerText = 'Switch to light mode' + } else { + // if it's dark -> go light + themeStylesheet.href = 'css/ui2-light.css' + document.getElementById("logo").setAttribute("src", "images/light/logo.png") + document.getElementById("radar_image").setAttribute("src", "images/light/radar.png") + document.getElementById("itinerary_image").setAttribute("src", "images/light/itinerary.png") + document.getElementById("graphs_image").setAttribute("src", "images/light/graphs.png") + document.getElementById("settings_image").setAttribute("src", "images/light/settings.png") + document.getElementById("settings_logo").setAttribute("src", "images/light/logo.png") + //themeToggle.innerText = 'Switch to dark mode' + } +} + +function changeBranch(branch) { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "http://" + window.location.hostname + ":5000/cmd", true); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.send(JSON.stringify({ + command: "sudo git checkout " + branch + })); + sendCMD("getbranch") +} + +function goHome() { + // document.getElementById("itinerary_page").style.display = "none" + document.getElementById("radar_page").style.display = "none" + document.getElementById("home_page").style.display = "block" + document.getElementById("settings_page").style.display = "none" + document.getElementById("graphs_page").style.display = "none" +} + +function goRadar() { + //document.getElementById("itinerary_page").style.display = "none" + document.getElementById("radar_page").style.display = "block" + document.getElementById("itin_nav_bar").style.display = "none" + document.getElementById("nav_bar").style.display = "block" + document.getElementById("radar_container").style.display = "block" + document.getElementById("itinerary_container").style.display = "none" + + document.getElementById("home_page").style.display = "none" + document.getElementById("settings_page").style.display = "none" + document.getElementById("graphs_page").style.display = "none" +} + +function goItinerary() { + document.getElementById("metar_container").style.display = "none" + document.getElementById("radar_container").style.display = "none" + document.getElementById("atc_container").style.display = "none" + document.getElementById("radar_page").style.display = "block" + document.getElementById("itin_nav_bar").style.display = "block" + document.getElementById("nav_bar").style.display = "none" + document.getElementById("radar_container").style.display = "none" + document.getElementById("itinerary_container").style.display = "block" + + document.getElementById("home_page").style.display = "none" + document.getElementById("settings_page").style.display = "none" + document.getElementById("graphs_page").style.display = "none" +} + +function goSettings() { + // document.getElementById("itinerary_page").style.display = "none" + document.getElementById("settings_page").style.display = "block" + document.getElementById("radar_page").style.display = "none" + document.getElementById("home_page").style.display = "none" + document.getElementById("graphs_page").style.display = "none" +} + + +function goGraphs() { + //document.getElementById("itinerary_page").style.display = "none" + document.getElementById("settings_page").style.display = "none" + document.getElementById("radar_page").style.display = "none" + document.getElementById("home_page").style.display = "none" + document.getElementById("graphs_page").style.display = "block" +} + +function itinAirportArrivals() { + document.getElementById("itin_arr").style.display = "block" + document.getElementById("itin_info").style.display = "none" +} + +function itinAirportDepartures() { + document.getElementById("itin_dep").style.display = "block" + document.getElementById("itin_info").style.display = "none" +} + +function radarRadarTabSwitch() { + document.getElementById("radar_radar_tab").style.display = "block" + document.getElementById("radar_flight_tab").style.display = "none" + document.getElementById("radar_aircraft_tab").style.display = "none" +} + +function radarFlightTabSwitch() { + document.getElementById("radar_radar_tab").style.display = "none" + document.getElementById("radar_flight_tab").style.display = "block" + document.getElementById("radar_aircraft_tab").style.display = "none" +} + +function radarAircraftTabSwitch() { + document.getElementById("radar_radar_tab").style.display = "none" + document.getElementById("radar_flight_tab").style.display = "none" + document.getElementById("radar_aircraft_tab").style.display = "block" +} + +function changeGraphsTime() { + var time = document.getElementById("graphs_time").value + document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") +} + +function changeGraph(direction) { + + var time = document.getElementById("graphs_time").value + if (direction && starting_graph != graph_types.length - 1) { + starting_graph++ + document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") + console.log(starting_graph) + } else if (starting_graph != 0) { + starting_graph = starting_graph - 1 + document.getElementById("graphs_holder").setAttribute("src", "http://" + window.location.hostname + "/graphs1090/graphs" + graph_types[starting_graph] + time + ".png") + console.log(starting_graph) + } + + if (starting_graph === graph_types.length - 1) { + document.getElementById("arrow_forward_graphs").disabled = true; + } else if (starting_graph === 0) { + document.getElementById("arrow_back_graphs").disabled = true; + } else { + document.getElementById("arrow_back_graphs").disabled = false; + document.getElementById("arrow_forward_graphs").disabled = false; + } + + if (starting_graph === 0) { + document.getElementById("graphs_holder").setAttribute("class", "graphs_s") + } else if (starting_graph === 7) { + document.getElementById("graphs_holder").setAttribute("class", "graphs_s") + } else { + document.getElementById("graphs_holder").setAttribute("class", "graphs") + } +} + + +function toTitleCase(str) { + return str.toLowerCase().split(' ').map(function (word) { + return (word.charAt(0).toUpperCase() + word.slice(1)); + }).join(' '); +} + +function hsl_col_perc(percent, start, end) { + var a = percent / 100, + b = (end - start) * a, + c = b + start; + + // Return a CSS HSL string + return 'hsl(' + c + ', 100%, 50%)'; + // hsl_col_perc(bed_percent, 0, 120) +} + +function toggleMarkers() { + if (text_labels) { + text_labels = 0 + } else { + text_labels = 1 + } +} diff --git a/python/api_pc.py b/python/api_pc.py index 1f0ec1b..73f926e 100644 --- a/python/api_pc.py +++ b/python/api_pc.py @@ -1,47 +1,47 @@ -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('/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() \ No newline at end of file diff --git a/scripts/internet_data_pc.js b/scripts/internet_data_pc.js index 5b8e442..8710a45 100644 --- a/scripts/internet_data_pc.js +++ b/scripts/internet_data_pc.js @@ -1,143 +1,144 @@ -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() { - //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": "*", - "timeout": 4000 - } - }; - request(options, function (error, response, body) { - if (body) { - //console.log(body) - parseData(body) - } - }); -} -*/ - -function getData() { - 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) { - 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() -}, 5000); -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() { + //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": "*", + "timeout": 4000 + } + }; + request(options, function (error, response, body) { + if (body) { + //console.log(body) + parseData(body) + } + }); +} +*/ + +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); } \ No newline at end of file diff --git a/scripts/node_modules/.bin/mime.cmd b/scripts/node_modules/.bin/mime.cmd index 746a279..678bc6b 100644 --- a/scripts/node_modules/.bin/mime.cmd +++ b/scripts/node_modules/.bin/mime.cmd @@ -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 diff --git a/scripts/node_modules/.bin/sshpk-conv.cmd b/scripts/node_modules/.bin/sshpk-conv.cmd index 42f9ce4..3317e0a 100644 --- a/scripts/node_modules/.bin/sshpk-conv.cmd +++ b/scripts/node_modules/.bin/sshpk-conv.cmd @@ -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 diff --git a/scripts/node_modules/.bin/sshpk-sign.cmd b/scripts/node_modules/.bin/sshpk-sign.cmd index 17f60de..54c4925 100644 --- a/scripts/node_modules/.bin/sshpk-sign.cmd +++ b/scripts/node_modules/.bin/sshpk-sign.cmd @@ -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 diff --git a/scripts/node_modules/.bin/sshpk-verify.cmd b/scripts/node_modules/.bin/sshpk-verify.cmd index 4b81f35..2b352fc 100644 --- a/scripts/node_modules/.bin/sshpk-verify.cmd +++ b/scripts/node_modules/.bin/sshpk-verify.cmd @@ -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 diff --git a/scripts/node_modules/.bin/uuid.cmd b/scripts/node_modules/.bin/uuid.cmd index 8154f4e..d719f3b 100644 --- a/scripts/node_modules/.bin/uuid.cmd +++ b/scripts/node_modules/.bin/uuid.cmd @@ -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