Merge remote-tracking branch 'peeps/master' into peeps

Added new settings from ahrs_dev branch back in.
pull/734/head^2
Eric Westphal 2017-07-18 18:32:02 -04:00
commit 5463d334c4
11 zmienionych plików z 819 dodań i 302 usunięć

Wyświetl plik

@ -55,6 +55,7 @@ install:
cp -f libdump978.so /usr/lib/libdump978.so cp -f libdump978.so /usr/lib/libdump978.so
cp -f dump1090/dump1090 /usr/bin/ cp -f dump1090/dump1090 /usr/bin/
cp -f image/hostapd_manager.sh /usr/sbin/ cp -f image/hostapd_manager.sh /usr/sbin/
cp -f image/hostapd_manager_quiet.sh /usr/sbin/
cp -f image/stratux-wifi.sh /usr/sbin/ cp -f image/stratux-wifi.sh /usr/sbin/
clean: clean:

Wyświetl plik

@ -2,16 +2,39 @@
echo powersave >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo powersave >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
STX_LOG="/var/log/stratux.log"
function wLog () {
echo "$(date +"%Y/%m/%d %H:%m:%S") - $1" >> ${STX_LOG}
}
wLog "Running Stratux Updater Script."
SCRIPT_MASK="update*stratux*v*.sh"
TEMP_LOCATION="/boot/StratuxUpdates/$SCRIPT_MASK"
UPDATE_LOCATION="/root/$SCRIPT_MASK"
if [ -e ${TEMP_LOCATION} ]; then
wLog "Found Update Script in $TEMP_LOCATION$SCRIPT_MASK"
TEMP_SCRIPT=`ls -1t ${TEMP_LOCATION} | head -1`
wLog "Moving Script $TEMP_SCRIPT"
cp -r ${TEMP_SCRIPT} /root/
wLog "Changing permissions to chmod a+x $UPDATE_LOCATION"
chmod a+x ${UPDATE_LOCATION}
wLog "Removing Update file from $TEMP_LOCATION"
rm -rf ${TEMP_SCRIPT}
fi
# Check if we need to run an update. # Check if we need to run an update.
if [ -e /root/update*stratux*v*.sh ] ; then if [ -e ${UPDATE_LOCATION} ]; then
UPDATE_SCRIPT=`ls -1t /root/update*stratux*v*.sh | head -1` UPDATE_SCRIPT=`ls -1t ${UPDATE_LOCATION} | head -1`
if [ -n "$UPDATE_SCRIPT" ] ; then if [ -n ${UPDATE_SCRIPT} ] ; then
# Execute the script, remove it, then reboot. # Execute the script, remove it, then reboot.
echo wLog "Running update script ${UPDATE_SCRIPT}..."
echo "Running update script ${UPDATE_SCRIPT}..."
bash ${UPDATE_SCRIPT} bash ${UPDATE_SCRIPT}
rm -f $UPDATE_SCRIPT wLog "Removing Update SH"
rm -f ${UPDATE_SCRIPT}
wLog "Finished... Rebooting... Bye"
reboot reboot
fi fi
fi fi
wLog "Exited without updating anything..."

Wyświetl plik

@ -0,0 +1,244 @@
#!/bin/bash
######################################################################
# STRATUX QUIET HOSTAPD MANAGE #
######################################################################
# This script is almost identical to hostapd_manager.sh except all the
# screen outputs are supplressed except for error messages.
#
# Usage:
# hostapd_manager_quiet.sh -s Stratux-N12345 -p SquawkDirty! -c 5
# Command above sets the SSID to "Stratux-N12345, secures the network with the passphrase "SquawkDirty!, and changes the network channel to "5"
#
# hostapd_manager_quiet.sh -o
# Command above opens the network(removes any passphrase)
#
# hostapd_manager_quiet.sh -e
# Command above secures the WiFi network using the default passphrase "SquawkDirtyToMe!"
# Options:
# -s --Sets the SSID to ${BOLD}ssid${NORM}. -s stratux
# -c --Sets the channel to chan. -c 1
# -o --Turns off encryption and sets network to open. Cannot be used with -e or -p.
# -e --Turns on encryption with passphrase SquawkDirtyToMe!. Cannot be used with -o or -p
# -p --Turns on encryption with your chosen passphrase pass. 8-63 Printable Characters(ascii 32-126). Cannot be used with -o or -e. -p password!
#
# Important:
# After each call of this script the wifi network will disconnect and restart all associated services to apply the changes
#Set Script Name variable
SCRIPT=`basename ${BASH_SOURCE[0]}`
#Initialize variables to default values.
OPT_S=false
OPT_C=false
OPT_E=false
OPT_O=false
OPT_P=false
OPT_Q=false
OPT_R=false
defaultPass="SquawkDirtyToMe!"
#apply settings and restart all processes
function APPLYSETTINGSQUIET {
sleep 2
TEMP=:$(/usr/bin/killall -9 hostapd hostapd-edimax > /dev/null 2>&1)
sleep 1
TEMP=:$(/usr/sbin/service isc-dhcp-server stop > /dev/null 2>&1)
sleep 0.5
TEMP=:$(ifdown wlan0)
sleep 0.5
TEMP=:$(ifup wlan0)
sleep 0.5
}
function error_exit {
echo "$1" >&2 ## Send message to stderr. Exclude >&2 if you don't want it that way.
exit "${2:-1}" ## Return a code specified by $2 or 1 by default.
}
if [ $(whoami) != 'root' ]; then
echo "${BOLD}${RED}This script must be executed as root, exiting...${WHITE}${NORMAL}"
echo "${BOLD}${RED}USAGE${WHITE}${NORMAL}"
error_exit "Not Root"
fi
#Check the number of arguments. If none are passed, print help and exit.
NUMARGS=$#
if [ $NUMARGS -eq 0 ]; then
error_exit "No Args Passed"
fi
### Start getopts code ###
#Parse command line flags
#If an option should be followed by an argument, it should be followed by a ":".
#Notice there is no ":" after "eoqh". The leading ":" suppresses error messages from
#getopts. This is required to get my unrecognized option code to work.
options=':s:c:p:eoh'
while getopts $options option; do
case $option in
s) #set option "s"
if [[ -z "${OPTARG}" || "${OPTARG}" == *[[:space:]]* || "${OPTARG}" == -* ]]; then
error_exit "No SSID for -s, exiting..."
else
OPT_S=$OPTARG
fi
;;
c) #set option "c"
if [[ -z "${OPTARG}" || "${OPTARG}" == *[[:space:]]* || "${OPTARG}" == -* ]]; then
error_exit "Channel option(-c) used without value, exiting... "
else
OPT_C=$OPTARG
if [[ "$OPT_C" =~ ^[0-9]+$ ]] && [ "$OPT_C" -ge 1 -a "$OPT_C" -le 13 ]; then
OPT_C=$OPTARG
else
error_exit "Channel is not within acceptable values, exiting..."
fi
fi
;;
e) #set option "e" with default passphrase
if [[ -z "${OPTARG}" || "${OPTARG}" == *[[:space:]]* || "${OPTARG}" == -* ]]; then
OPT_E=$defaultPass
else
error_exit "Option -e does not require arguement.${WHITE}${NORMAL}"
fi
;;
p) #set encryption with user specified passphrase
if [[ -z "${OPTARG}" || "${OPTARG}" =~ ^[[:space:]]*$ || "${OPTARG}" == -* ]]; then
error_exit "Encryption option(-p) used without passphrase!"
else
OPT_P=$OPTARG
fi
echo "$parm Encryption option -p used:"
if [ -z `echo $OPT_P | tr -d "[:print:]"` ] && [ ${#OPT_P} -ge 8 ] && [ ${#OPT_P} -le 63 ]; then
echo "${GREEN} WiFi will be encrypted using ${BOLD}${UNDR}$OPT_P${NORMAL}${GREEN} as the passphrase!${WHITE}${NORMAL}"
else
error_exit "Invalid PASSWORD: 8 - 63 printable characters, exiting..."
fi
;;
o) #set option "o"
if [[ -z "${OPTARG}" || "${OPTARG}" == *[[:space:]]* || "${OPTARG}" == -* ]]; then
OPT_O=true
else
error_exit "${BOLD}${RED}$err Option -o does not require arguement. Exiting..."
fi
;;
\?) # invalid option
error_exit "Invalid option -$OPTARG"
;;
:) # Missing Arg
error_exit "Missing option for argument -$OPTARG"
;;
*) # Invalid
error_exit "Unimplemented option -$OPTARG ${WHITE}${NORMAL}"
;;
esac
done
shift $((OPTIND-1)) #This tells getopts to move on to the next argument.
### End getopts code ###
### Main loop to process files ###
#This is where your main file processing will take place. This example is just
#printing the files and extensions to the terminal. You should place any other
#file processing tasks within the while-do loop.
if [[ $OPT_O == true && ( $OPT_E != false || $OPT_P != false ) ]]; then
error_exit "Option -e , -p and -o cannot be used simultaneously"
fi
if [ $OPT_P != false ] && [ $OPT_E != false ]; then
error_exit "Option -e and -p cannot be used simultaneously..."
fi
# files to edit
HOSTAPD=('/etc/hostapd/hostapd.user')
####
#### File modification loop
####
for i in "${HOSTAPD[@]}"
do
if [ -f ${i} ]; then
if [ $OPT_S != false ]; then
if grep -q "^ssid=" ${HOSTAPD[$x]}; then
sed -i "s/^ssid=.*/ssid=${OPT_S}/" ${i}
else
echo ${OPT_S} >> ${i}
fi
fi
if [ $OPT_C != false ]; then
if grep -q "^channel=" ${i}; then
sed -i "s/^channel=.*/channel=${OPT_C}/" ${i}
else
echo ${OPT_C} >> ${i}
fi
fi
if [ $OPT_E != false ]; then
if grep -q "^#auth_algs=" ${i}; then
sed -i "s/^#auth_algs=.*/auth_algs=1/" ${i}
sed -i "s/^#wpa=.*/wpa=3/" ${i}
sed -i "s/^#wpa_passphrase=.*/wpa_passphrase=$OPT_E/" ${i}
sed -i "s/^#wpa_key_mgmt=.*/wpa_key_mgmt=WPA-PSK/" ${i}
sed -i "s/^#wpa_pairwise=.*/wpa_pairwise=TKIP/" ${i}
sed -i "s/^#rsn_pairwise=.*/rsn_pairwise=CCMP/" ${i}
elif grep -q "^auth_algs=" ${i}; then
sed -i "s/^auth_algs=.*/auth_algs=1/" ${i}
sed -i "s/^wpa=.*/wpa=3/" ${i}
sed -i "s/^wpa_passphrase=.*/wpa_passphrase=$OPT_E/" ${i}
sed -i "s/^wpa_key_mgmt=.*/wpa_key_mgmt=WPA-PSK/" ${i}
sed -i "s/^wpa_pairwise=.*/wpa_pairwise=TKIP/" ${i}
sed -i "s/^rsn_pairwise=.*/rsn_pairwise=CCMP/" ${i}
else
echo "" >> ${i}
echo "auth_algs=1" >> ${i}
echo "wpa=3" >> ${i}
echo "wpa_passphrase=$OPT_E" >> ${i}
echo "wpa_key_mgmt=WPA-PSK" >> ${i}
echo "wpa_pairwise=TKIP" >> ${i}
echo "rsn_pairwise=CCMP" >> ${i}
fi
fi
if [ $OPT_O != false ]; then
if grep -q "^auth_algs=" ${i}; then
sed -i "s/^auth_algs=.*/#auth_algs=1/" ${i}
sed -i "s/^wpa=.*/#wpa=3/" ${i}
sed -i "s/^wpa_passphrase=.*/#wpa_passphrase=$defaultPass/" ${i}
sed -i "s/^wpa_key_mgmt=.*/#wpa_key_mgmt=WPA-PSK/" ${i}
sed -i "s/^wpa_pairwise=.*/#wpa_pairwise=TKIP/" ${i}
sed -i "s/^rsn_pairwise=.*/#rsn_pairwise=CCMP/" ${i}
elif grep -q "^#auth_algs=" ${i}; then
sed -i "s/^#auth_algs=.*/#auth_algs=1/" ${i}
sed -i "s/^#wpa=.*/#wpa=3/" ${i}
sed -i "s/^#wpa_passphrase=.*/#wpa_passphrase=$defaultPass/" ${i}
sed -i "s/^#wpa_key_mgmt=.*/#wpa_key_mgmt=WPA-PSK/" ${i}
sed -i "s/^#wpa_pairwise=.*/#wpa_pairwise=TKIP/" ${i}
sed -i "s/^#rsn_pairwise=.*/#rsn_pairwise=CCMP/" ${i}
else
echo "" >> ${i}
echo "#auth_algs=1" >> ${i}
echo "#wpa=3" >> ${i}
echo "#wpa_passphrase=$defaultPass" >> ${i}
echo "#wpa_key_mgmt=WPA-PSK" >> ${i}
echo "#wpa_pairwise=TKIP" >> ${i}
echo "#rsn_pairwise=CCMP" >> ${i}
fi
fi
else
error_exit "No ${i} file found..."
fi
done
### End main loop ###
### Apply Settings and restart all services
APPLYSETTINGSQUIET
exit 1

Wyświetl plik

@ -43,6 +43,8 @@ cp -f hostapd-edimax.conf mnt/etc/hostapd/hostapd-edimax.conf
#hostapd manager script #hostapd manager script
cp -f hostapd_manager.sh mnt/usr/sbin/hostapd_manager.sh cp -f hostapd_manager.sh mnt/usr/sbin/hostapd_manager.sh
chmod 755 mnt/usr/sbin/hostapd_manager.sh chmod 755 mnt/usr/sbin/hostapd_manager.sh
cp -f hostapd_manager_quiet.sh mnt/usr/sbin/hostapd_manager_quiet.sh
chmod 755 mnt/usr/sbin/hostapd_manager_quiet.sh
#hostapd #hostapd
cp -f hostapd-edimax mnt/usr/sbin/hostapd-edimax cp -f hostapd-edimax mnt/usr/sbin/hostapd-edimax
chmod 755 mnt/usr/sbin/hostapd-edimax chmod 755 mnt/usr/sbin/hostapd-edimax

Wyświetl plik

@ -31,6 +31,7 @@ cp image/bashrc.txt work/bin/
cp image/modules.txt work/bin/ cp image/modules.txt work/bin/
cp image/stxAliases.txt work/bin/ cp image/stxAliases.txt work/bin/
cp image/hostapd_manager.sh work/bin/ cp image/hostapd_manager.sh work/bin/
cp image/hostapd_manager_quiet.sh work/bin/
cp image/sdr-tool.sh work/bin/ cp image/sdr-tool.sh work/bin/
cp image/10-stratux.rules work/bin/ cp image/10-stratux.rules work/bin/
cp image/99-uavionix.rules work/bin/ cp image/99-uavionix.rules work/bin/

Wyświetl plik

@ -28,6 +28,7 @@ cp -f stratux-wifi.sh /usr/sbin/
#WiFi Config Manager #WiFi Config Manager
cp -f hostapd_manager.sh /usr/sbin/ cp -f hostapd_manager.sh /usr/sbin/
cp -f hostapd_manager_quiet.sh /usr/sbin/
#SDR Serial Script #SDR Serial Script
cp -f sdr-tool.sh /usr/sbin/ cp -f sdr-tool.sh /usr/sbin/

Wyświetl plik

@ -4,6 +4,12 @@
.modal { .modal {
} }
.grayout {
opacity: 0.4; /* Real browsers */
filter: alpha(opacity = 60); /* MSIE */
}
.vertical-alignment-helper { .vertical-alignment-helper {
display:table; display:table;
height: 100%; height: 100%;

Wyświetl plik

@ -1,29 +1,32 @@
// application constants // application constants
var URL_HOST_BASE = window.location.hostname; var URL_HOST_BASE = window.location.hostname + (window.location.port ? ':' + window.location.port : '');
var URL_SETTINGS_GET = "http://" + URL_HOST_BASE + "/getSettings"; var URL_HOST_PROTOCOL = window.location.protocol + "//";
var URL_SETTINGS_SET = "http://" + URL_HOST_BASE + "/setSettings";
var URL_GPS_WS = "ws://" + URL_HOST_BASE + "/situation"; var URL_AHRS_CAGE = URL_HOST_PROTOCOL + URL_HOST_BASE + "/cageAHRS";
var URL_TOWERS_GET = "http://" + URL_HOST_BASE + "/getTowers"; var URL_AHRS_CAL = URL_HOST_PROTOCOL + URL_HOST_BASE + "/calibrateAHRS";
var URL_STATUS_GET = "http://" + URL_HOST_BASE + "/getStatus"; var URL_AHRS_ORIENT = URL_HOST_PROTOCOL + URL_HOST_BASE + "/orientAHRS";
var URL_SATELLITES_GET = "http://" + URL_HOST_BASE + "/getSatellites"; var URL_DELETEAHRSLOGFILES = URL_HOST_PROTOCOL + URL_HOST_BASE + "/deleteahrslogfiles";
var URL_STATUS_WS = "ws://" + URL_HOST_BASE + "/status"; var URL_DELETELOGFILE = URL_HOST_PROTOCOL + URL_HOST_BASE + "/deletelogfile";
var URL_TRAFFIC_WS = "ws://" + URL_HOST_BASE + "/traffic"; var URL_DEV_TOGGLE_GET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/develmodetoggle";
var URL_WEATHER_WS = "ws://" + URL_HOST_BASE + "/weather"; var URL_DOWNLOADAHRSLOGFILES = URL_HOST_PROTOCOL + URL_HOST_BASE + "/downloadahrslogs";
var URL_DEVELOPER_GET = "ws://" + URL_HOST_BASE + "/developer"; var URL_DOWNLOADDB = URL_HOST_PROTOCOL + URL_HOST_BASE + "/downloaddb";
var URL_UPDATE_UPLOAD = "http://" + URL_HOST_BASE + "/updateUpload"; var URL_DOWNLOADLOGFILE = URL_HOST_PROTOCOL + URL_HOST_BASE + "/downloadlog";
var URL_REBOOT = "http://" + URL_HOST_BASE + "/reboot"; var URL_GMETER_RESET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/resetGMeter";
var URL_SHUTDOWN = "http://" + URL_HOST_BASE + "/shutdown"; var URL_REBOOT = URL_HOST_PROTOCOL + URL_HOST_BASE + "/reboot";
var URL_RESTARTAPP = "http://" + URL_HOST_BASE + "/restart"; var URL_RESTARTAPP = URL_HOST_PROTOCOL + URL_HOST_BASE + "/restart";
var URL_DEV_TOGGLE_GET = "http://" + URL_HOST_BASE + "/develmodetoggle"; var URL_SATELLITES_GET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/getSatellites";
var URL_AHRS_ORIENT = "http://" + URL_HOST_BASE + "/orientAHRS"; var URL_SETTINGS_GET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/getSettings";
var URL_AHRS_CAL = "http://" + URL_HOST_BASE + "/calibrateAHRS"; var URL_SETTINGS_SET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/setSettings";
var URL_AHRS_CAGE = "http://" + URL_HOST_BASE + "/cageAHRS"; var URL_SHUTDOWN = URL_HOST_PROTOCOL + URL_HOST_BASE + "/shutdown";
var URL_GMETER_RESET = "http://" + URL_HOST_BASE + "/resetGMeter"; var URL_STATUS_GET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/getStatus";
var URL_DELETELOGFILE = "http://" + URL_HOST_BASE + "/deletelogfile"; var URL_TOWERS_GET = URL_HOST_PROTOCOL + URL_HOST_BASE + "/getTowers";
var URL_DOWNLOADLOGFILE = "http://" + URL_HOST_BASE + "/downloadlog"; var URL_UPDATE_UPLOAD = URL_HOST_PROTOCOL + URL_HOST_BASE + "/updateUpload";
var URL_DELETEAHRSLOGFILES = "http://" + URL_HOST_BASE + "/deleteahrslogfiles";
var URL_DOWNLOADAHRSLOGFILES = "http://" + URL_HOST_BASE + "/downloadahrslogs"; var URL_DEVELOPER_WS = "ws://" + URL_HOST_BASE + "/developer";
var URL_DOWNLOADDB = "http://" + URL_HOST_BASE + "/downloaddb"; var URL_GPS_WS = "ws://" + URL_HOST_BASE + "/situation";
var URL_STATUS_WS = "ws://" + URL_HOST_BASE + "/status";
var URL_TRAFFIC_WS = "ws://" + URL_HOST_BASE + "/traffic";
var URL_WEATHER_WS = "ws://" + URL_HOST_BASE + "/weather";
// define the module with dependency on mobile-angular-ui // define the module with dependency on mobile-angular-ui
//var app = angular.module('stratux', ['ngRoute', 'mobile-angular-ui', 'mobile-angular-ui.gestures', 'appControllers']); //var app = angular.module('stratux', ['ngRoute', 'mobile-angular-ui', 'mobile-angular-ui.gestures', 'appControllers']);
@ -99,4 +102,4 @@ app.controller('MainCtrl', function ($scope, $http) {
}, function(response) { }, function(response) {
//Second function handles error //Second function handles error
}); });
}); });

144
web/plates/js/settings.js 100644 → 100755
Wyświetl plik

@ -1,4 +1,4 @@
angular.module('appControllers').controller('SettingsCtrl', SettingsCtrl); // get the main module contollers set angular.module('appControllers').controller('SettingsCtrl', SettingsCtrl); // get the main module controllers set
SettingsCtrl.$inject = ['$rootScope', '$scope', '$state', '$location', '$window', '$http']; // Inject my dependencies SettingsCtrl.$inject = ['$rootScope', '$scope', '$state', '$location', '$window', '$http']; // Inject my dependencies
// create our controller function with all necessary logic // create our controller function with all necessary logic
@ -9,7 +9,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
var toggles = ['UAT_Enabled', 'ES_Enabled', 'Ping_Enabled', 'GPS_Enabled', 'IMU_Sensor_Enabled', var toggles = ['UAT_Enabled', 'ES_Enabled', 'Ping_Enabled', 'GPS_Enabled', 'IMU_Sensor_Enabled',
'BMP_Sensor_Enabled', 'DisplayTrafficSource', 'DEBUG', 'ReplayLog', 'AHRSLog']; 'BMP_Sensor_Enabled', 'DisplayTrafficSource', 'DEBUG', 'ReplayLog', 'AHRSLog'];
var settings = {}; var settings = {};
for (i = 0; i < toggles.length; i++) { for (var i = 0; i < toggles.length; i++) {
settings[toggles[i]] = undefined; settings[toggles[i]] = undefined;
} }
$scope.update_files = ''; $scope.update_files = '';
@ -40,6 +40,12 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.OwnshipModeS = settings.OwnshipModeS; $scope.OwnshipModeS = settings.OwnshipModeS;
$scope.DeveloperMode = settings.DeveloperMode; $scope.DeveloperMode = settings.DeveloperMode;
$scope.GLimits = settings.GLimits; $scope.GLimits = settings.GLimits;
$scope.StaticIps = settings.StaticIps;
$scope.WiFiSSID = settings.WiFiSSID;
$scope.WiFiSecurityEnabled = settings.WiFiSecurityEnabled;
$scope.WiFiPasscode = settings.WiFiPasscode;
$scope.WiFiChannel = settings.WiFiChannel;
} }
function getSettings() { function getSettings() {
@ -73,6 +79,11 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
getSettings(); getSettings();
// Reset all settings from a button on the page
$scope.resetSettings = function () {
getSettings();
};
$scope.$watchGroup(toggles, function (newValues, oldValues, scope) { $scope.$watchGroup(toggles, function (newValues, oldValues, scope) {
var newsettings = {}; var newsettings = {};
var dirty = false; var dirty = false;
@ -95,7 +106,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
settings["PPM"] = 0; settings["PPM"] = 0;
if (($scope.PPM !== undefined) && ($scope.PPM !== null) && ($scope.PPM !== settings["PPM"])) { if (($scope.PPM !== undefined) && ($scope.PPM !== null) && ($scope.PPM !== settings["PPM"])) {
settings["PPM"] = parseInt($scope.PPM); settings["PPM"] = parseInt($scope.PPM);
newsettings = { var newsettings = {
"PPM": settings["PPM"] "PPM": settings["PPM"]
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
@ -107,7 +118,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
settings["Baud"] = 0; settings["Baud"] = 0;
if (($scope.Baud !== undefined) && ($scope.Baud !== null) && ($scope.Baud !== settings["Baud"])) { if (($scope.Baud !== undefined) && ($scope.Baud !== null) && ($scope.Baud !== settings["Baud"])) {
settings["Baud"] = parseInt($scope.Baud); settings["Baud"] = parseInt($scope.Baud);
newsettings = { var newsettings = {
"Baud": settings["Baud"] "Baud": settings["Baud"]
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
@ -115,24 +126,24 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
} }
}; };
$scope.updatewatchlist = function () { $scope.updatewatchlist = function () {
if ($scope.WatchList !== settings["WatchList"]) { if ($scope.WatchList !== settings["WatchList"]) {
settings["WatchList"] = ""; settings["WatchList"] = "";
if ($scope.WatchList !== undefined) { if ($scope.WatchList !== undefined) {
settings["WatchList"] = $scope.WatchList.toUpperCase(); settings["WatchList"] = $scope.WatchList.toUpperCase();
} }
newsettings = { var newsettings = {
"WatchList": settings["WatchList"] "WatchList": settings["WatchList"]
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
setSettings(angular.toJson(newsettings)); setSettings(angular.toJson(newsettings));
} }
}; };
$scope.updatemodes = function () { $scope.updatemodes = function () {
if ($scope.OwnshipModeS !== settings["OwnshipModeS"]) { if ($scope.OwnshipModeS !== settings["OwnshipModeS"]) {
settings["OwnshipModeS"] = $scope.OwnshipModeS.toUpperCase(); settings["OwnshipModeS"] = $scope.OwnshipModeS.toUpperCase();
newsettings = { var newsettings = {
"OwnshipModeS": $scope.OwnshipModeS.toUpperCase() "OwnshipModeS": $scope.OwnshipModeS.toUpperCase()
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
@ -142,18 +153,18 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.updatestaticips = function () { $scope.updatestaticips = function () {
if ($scope.StaticIps !== settings.StaticIps) { if ($scope.StaticIps !== settings.StaticIps) {
newsettings = { var newsettings = {
"StaticIps": $scope.StaticIps === undefined ? "" : $scope.StaticIps.join(' ') "StaticIps": $scope.StaticIps === undefined? "" : $scope.StaticIps.join(' ')
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
setSettings(angular.toJson(newsettings)); setSettings(angular.toJson(newsettings));
} }
}; };
$scope.updateGLimits = function () { $scope.updateGLimits = function () {
if ($scope.GLimits !== settings["GLimits"]) { if ($scope.GLimits !== settings["GLimits"]) {
settings["GLimits"] = $scope.GLimits; settings["GLimits"] = $scope.GLimits;
newsettings = { var newsettings = {
"GLimits": settings["GLimits"] "GLimits": settings["GLimits"]
}; };
// console.log(angular.toJson(newsettings)); // console.log(angular.toJson(newsettings));
@ -161,16 +172,16 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
} }
}; };
$scope.postShutdown = function () { $scope.postShutdown = function () {
$window.location.href = "/"; $window.location.href = "/";
$location.path('/home'); $location.path('/home');
$http.post(URL_SHUTDOWN). $http.post(URL_SHUTDOWN).
then(function (response) { then(function (response) {
// do nothing // do nothing
// $scope.$apply(); // $scope.$apply();
}, function (response) { }, function (response) {
// do nothing // do nothing
}); });
}; };
$scope.postReboot = function () { $scope.postReboot = function () {
@ -189,10 +200,12 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.update_files = files; $scope.update_files = files;
$scope.$apply(); $scope.$apply();
}; };
$scope.resetUploadFile = function () { $scope.resetUploadFile = function () {
$scope.update_files = ''; $scope.update_files = '';
$scope.$apply(); $scope.$apply();
}; };
$scope.uploadFile = function () { $scope.uploadFile = function () {
var fd = new FormData(); var fd = new FormData();
//Take the first selected file //Take the first selected file
@ -209,7 +222,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
alert ("file does not appear to be an update"); alert ("file does not appear to be an update");
return; return;
} }
fd.append("update_file", file); fd.append("update_file", file);
$http.post(URL_UPDATE_UPLOAD, fd, { $http.post(URL_UPDATE_UPLOAD, fd, {
@ -239,18 +252,61 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.Ui.turnOff('modalCalibrateDone'); $scope.Ui.turnOff('modalCalibrateDone');
$scope.Ui.turnOn("modalCalibrateFailed"); $scope.Ui.turnOn("modalCalibrateFailed");
}); });
}; };
$scope.calibrateGyros = function() { $scope.calibrateGyros = function() {
console.log("sending calibrate message."); console.log("sending calibrate message.");
$http.post(URL_AHRS_CAL). $http.post(URL_AHRS_CAL).then(function (response) {
then(function(response) { console.log("Sent calibrate message.");
console.log("Sent calibrate message."); }, function (response) {
}, function(response) { console.log(response.data);
console.log(response.data); $scope.Calibration_Failure_Message = response.data;
$scope.Calibration_Failure_Message = response.data; $scope.Ui.turnOff("modalCalibrateGyros");
$scope.Ui.turnOff("modalCalibrateGyros"); $scope.Ui.turnOn("modalCalibrateGyrosFailed");
$scope.Ui.turnOn("modalCalibrateGyrosFailed");
}); });
}; };
$scope.updateWiFi = function(action) {
$scope.WiFiErrors = {
'WiFiSSID':'',
'WiFiPasscode':'',
'Errors':false
};
if (($scope.WiFiSSID === undefined) || ($scope.WiFiSSID === null) || ($scope.WiFiSSID.length === 0)) {
$scope.WiFiErrors.WiFiSSID = "Your Network Name(\"SSID\") Cannot be Blank.";
$scope.WiFiErrors.Errors = true;
}
if ($scope.WiFiPasscode.length < 8) {
if ($scope.WiFiPasscode.length === 0) {
$scope.WiFiErrors.WiFiPasscode = "Your WiFi Password must be at least 8 characters long";
} else {
$scope.WiFiErrors.WiFiPasscode = "Your WiFi Password, " + $scope.WiFiPasscode + ", must be at least 8 characters long";
}
$scope.WiFiErrors.Errors = true;
}
$scope.Ui.turnOff("modalSubmitWiFi");
if (!$scope.WiFiErrors.Errors) {
var newsettings = {
"WiFiSSID" : $scope.WiFiSSID,
"WiFiSecurityEnabled" : $scope.WiFiSecurityEnabled,
"WiFiPasscode" : $scope.WiFiPasscode,
"WiFiChannel" : $scope.WiFiChannel
};
console.log(angular.toJson(newsettings));
alert("Developers,\nThis is the JSON string\n"+angular.toJson(newsettings)+"\npassed to\n"+URL_SETTINGS_SET+"\n");
setSettings(angular.toJson(newsettings));
$scope.Ui.turnOn("modalSuccessWiFi");
} else {
$scope.Ui.turnOn("modalErrorWiFi");
//alert($scope.WiFiErrorMsg);
}
};
} }

106
web/plates/settings-help.html 100644 → 100755
Wyświetl plik

@ -1,40 +1,78 @@
<div class="section text-left help-page"> <div class="section text-left help-page">
<p>The <strong>Settings</strong> page provides both control and configuration of your Stratux device.</p> <p>The <strong>Settings</strong> page provides both control and configuration of your Stratux device.</p>
<p>Use the toggles in the <strong>Hardware</strong> section to control which devices are active.</p> <p>Use the toggles in the <strong>Hardware</strong> section to control which devices are active.</p>
<p class="text-warning">NOTE: Only hardware toggled on here, will appear on the <p class="text-warning">NOTE: Only hardware toggled on here, will appear on the
<strong>Status</strong> page.</p> <strong>Status</strong> page.</p>
<p>The <strong>Diagnostics</strong> section helps with debugging and communicating with the Stratux project contributors via GitHub and the reddit subgroup.</p> <p>
<ul class="list-simple"> The <strong>WiFi</strong> section allows the user to change various WiFi Settings:
<li>Toggling <strong>Traffic Source</strong> adds text for traffic targets within your navigation application. Traffic received via UAT will display <code>u</code> while traffic received via 1090 will display <code>e</code>.</li> <dl class="dl-horizontal">
<li>Toggling <strong>Record Logs</strong> enables logging to a series of files for your Stratux device including data recorded for UAT traffic and weather, 1090 traffic, GPS messages, and AHRS messages. The log files are accessible from the <strong>Logs</strong> menu available on the left.</li> <dt>WiFi SSID</dt><dd>The name of your Stratux Network.
</ul> You might want to change this to match your A/C Tail Number (ex: Stratux-N12345).</dd>
<dt>Network Security</dt><dd>This switch will turn your wireless security <b>On</b> or <b>Off</b>.</dd>
<dt>WiFi Passcode</dt><dd>When Security is turned on this will be the password for your network.</dd>
<dt>WiFi Channel</dt><dd>Changing the WiFi Channel can improve the wireless signal if in a congested WiFi area.</dd>
</dl>
</p>
<p>The <strong>AHRS</strong> section allows for calibration and future configuration of the AHRS function. <p>The <strong>Diagnostics</strong> section helps with debugging and communicating with the Stratux project contributors
<strong>Calibrate AHRS Sensors</strong> guides initial setup of the AHRS function, specifying the orientation of the sensors relative to the airplane. Additional calibration may be added later.</p> via GitHub and the reddit subgroup.</p>
<p>The calibration process determines which sensor direction will be forward, which toward the left wing, and which toward the ground. You only have to do this once. The settings for this sensor will be saved for future flights.</p> <ul class="list-simple">
<p>The direction of gravity is used to determine the forward and up orientations, and the left wing is determined based on this.</p> <li>Toggling <strong>Traffic Source</strong> adds text for traffic targets within your navigation application.
Traffic received via UAT will display <code>u</code>
while traffic received via 1090 will display <code>e</code>.</li>
<li>Toggling <strong>Record Logs</strong> enables logging to a series of files for your Stratux device including
data recorded for UAT traffic and weather, 1090 traffic, GPS messages, and AHRS messages.
The log files are accessible from the <strong>Logs</strong> menu available on the left.</li>
</ul>
<p>GLoad Limits allows the user to set which limits will show on the G Meter on the GPS/AHRS page. Enter a space-separated list of G limits, e.g. "-1.76 4.4".</p> <p>The <strong>AHRS</strong> section allows for calibration and future configuration of the AHRS function.
<strong>Calibrate AHRS Sensors</strong> guides initial setup of the AHRS function,
specifying the orientation of the sensors relative to the airplane.
Additional calibration may be added later.</p>
<p>The calibration process determines which sensor direction will be forward.
You only have to do this once. The settings for this sensor will be saved for future flights.</p>
<p>The direction of gravity is used to determine the forward orientation.</p>
<p>The <strong>Configuration</strong> section lets you adjust the default operation of your Stratux device.</p> <p>GLoad Limits allows the user to set which limits will show on the G Meter on the GPS/AHRS page.
<ul class="list-simple"> Enter a space-separated list of G limits, e.g. "-1.76 4.4".</p>
<li>To avoid having your own aircraft appear as traffic, and scare the bejeezus our of you, you may provide your <strong>Mode S code</strong>. You can find this value in the FAA N-Number Registry for your aircraft. You should use the hexadecimal value (not the octal value) for this setting. No validation is done so please ensure you enter your valide Mode S value.
</li> <p>The <strong>Configuration</strong> section lets you adjust the default operation of your Stratux device.</p>
<li>The <strong>Weather</strong> page uses a user-defined <strong>Watch List</strong> to filter the large volume of ADS-B weather messages for display. Define a list of identifiers (airport, VOR, etc) separated by a spaces. For example <code>KBOS EEN LAH LKP</code>. You may change this list at any time and the <strong>Weather</strong> page will start watching for the updated list immediately. <ul class="list-simple">
<br/> <li>To avoid having your own aircraft appear as traffic, and scare the bejeezus our of you,
<span class="text-warning">NOTE: To save your changes, you must either tap somehwere else on the page or hit <code>ENTER</code> or <code>RETURN</code> or <code>GO</code> (or whatever your keyboard indicates).</span> you may provide your <strong>Mode S code</strong>.
</li> You can find this value in the FAA N-Number Registry for your aircraft.
<li>The SDR (software defined radio) receiver support an adjustment in the form of a <strong>PPM Correction</strong>. From the Raspberry Pi, you may use the command <code>kal -g 48 -s GSM850</code> to scan for available channels in your area. Then use the command <code>kal -g 48 -c <em>channel#</em></code> to calculate the PPM. You should use the hexadecimal value (not the octal value) for this setting.
<br/> No validation is done so please ensure you enter your valid Mode S value.
<span class="text-warning">NOTE: You will need to perform all commands as <code>root</code> by issuing the command: <code>sudo su -</code>. You will need to stop the Stratux software before running the calibration process. You can stop all of the Stratux processes with the command: <code>pkill screen</code>.</span> </li>
</li> <li>The <strong>Weather</strong> page uses a user-defined <strong>Watch List</strong> to filter the
<li>Addiitonal settings will be added in future releases.</li> large volume of ADS-B weather messages for display.
</ul> Define a list of identifiers (airport, VOR, etc) separated by a spaces.
<p>The <strong>System</strong> section lets you safely shutdown or reboot your Stratux device.</p> For example <code>KBOS EEN LAH LKP</code>.
<ul> You may change this list at any time and the <strong>Weather</strong> page will start watching for the
<li><strong>Shutdown</strong> will immediately shutdown the Stratux. You may then safely remove power.</li> updated list immediately.
<li><strong>Reboot</strong> will immediately reboot the Stratux. After the reboot you may have to rejoin the WiFi connection to reconnect.</li> <br/>
</ul> <span class="text-warning">NOTE: To save your changes, you must either tap somewhere else on the page
</div> or hit <code>ENTER</code> or <code>RETURN</code> or <code>GO</code>
(or whatever your keyboard indicates).</span>
</li>
<li>The SDR (software defined radio) receiver support an adjustment in the form of a
<strong>PPM Correction</strong>. From the Raspberry Pi, you may use the command
<code>kal -g 48 -s GSM850</code> to scan for available channels in your area.
Then use the command <code>kal -g 48 -c <em>channel#</em></code> to calculate the PPM.
<br/>
<span class="text-warning">NOTE: You will need to perform all commands as <code>root</code>
by issuing the command: <code>sudo su -</code>.
You will need to stop the Stratux software before running the calibration process.
You can stop all of the Stratux processes with the command: <code>pkill screen</code>.</span>
</li>
<li>Additional settings will be added in future releases.</li>
</ul>
<p>The <strong>System</strong> section lets you safely shutdown or reboot your Stratux device.</p>
<ul>
<li><strong>Shutdown</strong> will immediately shutdown the Stratux. You may then safely remove power.</li>
<li><strong>Reboot</strong> will immediately reboot the Stratux.
After the reboot you may have to rejoin the WiFi connection to reconnect.</li>
</ul>
</div>

524
web/plates/settings.html 100644 → 100755
Wyświetl plik

@ -1,222 +1,274 @@
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel-group col-sm-6"> <!-- Begin Left Col -->
<div class="panel panel-default"> <div class="col-sm-6">
<div class="panel-heading">Hardware</div> <!-- Hardware Settings -->
<div class="panel-body"> <div class="panel-group col-sm-12">
<div class="form-group"> <div class="panel panel-default ng-scope">
<label class="control-label col-xs-7">978 MHz</label> <div class="panel-heading">Hardware</div>
<div class="col-xs-5"> <div class="panel-body">
<ui-switch ng-model='UAT_Enabled' settings-change></ui-switch> <div class="form-group">
<label class="control-label col-xs-7">978 MHz</label>
<div class="col-xs-5">
<ui-switch ng-model='UAT_Enabled' settings-change></ui-switch>
</div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="control-label col-xs-7">1090 MHz</label>
<label class="control-label col-xs-7">1090 MHz</label> <div class="col-xs-5">
<div class="col-xs-5"> <ui-switch ng-model='ES_Enabled' settings-change></ui-switch>
<ui-switch ng-model='ES_Enabled' settings-change></ui-switch> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="control-label col-xs-7">Ping ADS-B</label>
<label class="control-label col-xs-7">Ping ADS-B</label> <div class="col-xs-5">
<div class="col-xs-5"> <ui-switch ng-model='Ping_Enabled' settings-change></ui-switch>
<ui-switch ng-model='Ping_Enabled' settings-change></ui-switch> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="control-label col-xs-7">GPS</label>
<label class="control-label col-xs-7">GPS</label> <div class="col-xs-5">
<div class="col-xs-5"> <ui-switch ng-model='GPS_Enabled' settings-change></ui-switch>
<ui-switch ng-model='GPS_Enabled' settings-change></ui-switch> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="control-label col-xs-7">AHRS Sensor</label>
<label class="control-label col-xs-7">AHRS Sensor</label> <div class="col-xs-5">
<div class="col-xs-5"> <ui-switch ng-model='IMU_Sensor_Enabled' settings-change></ui-switch>
<ui-switch ng-model='IMU_Sensor_Enabled' settings-change></ui-switch> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="control-label col-xs-7">Baro Sensor</label>
<label class="control-label col-xs-7">Baro Sensor</label> <div class="col-xs-5">
<div class="col-xs-5"> <ui-switch ng-model='BMP_Sensor_Enabled' settings-change></ui-switch>
<ui-switch ng-model='BMP_Sensor_Enabled' settings-change></ui-switch> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- WiFi Settings -->
<div class="panel-group col-sm-12">
<div class="panel-group col-sm-6"> <div class="panel panel-default ng-scope">
<div class="panel panel-default"> <div class="panel-heading">WiFi Settings</div>
<div class="panel-heading">Diagnostics</div> <div class="panel-body grayout">
<div class="panel-body"> <form name="WiFiSettings">
<div class="form-group"> <div class="alert alert-info">
<label class="control-label col-xs-7">Show Traffic Source in Callsign</label> <strong>Notice!</strong> This feature has not been implemented... YET!
<div class="col-xs-5"> </div>
<ui-switch ng-model='DisplayTrafficSource' settings-change></ui-switch> <div class="form-group reset-flow">
</div> <label class="control-label col-xs-5">WiFi SSID</label>
</div> <input class="col-xs-7" type="string" ng-model="WiFiSSID" placeholder="WiFi Network Name" />
<div class="form-group"> </div>
<label class="control-label col-xs-7">Verbose Message Log</label> <div class="form-group reset-flow">
<div class="col-xs-5"> <label class="control-label col-xs-7">Network Security</label>
<ui-switch ng-model='DEBUG' settings-change></ui-switch> <div class="col-xs-5">
</div> <ui-switch ng-model="WiFiSecurityEnabled" settings-change> </ui-switch>
</div> </div>
<div class="form-group"> </div>
<label class="control-label col-xs-7">Record Replay Logs</label> <div class="form-group reset-flow">
<div class="col-xs-5"> <label class="control-label col-xs-5">WiFi Passcode</label>
<ui-switch ng-model='ReplayLog' settings-change></ui-switch> <input class="col-xs-7" type="string" ng-model="WiFiPasscode" placeholder="WiFi Passcode" />
</div> </div>
</div> <div class="form-group reset-flow">
<div class="form-group"> <label class="control-label col-xs-7">WiFi Channel</label>
<label class="control-label col-xs-7">Record AHRS Logs</label> <select class="input-small col-sm-2 form-control-sm" ng-model="WiFiChannel" id="WiFiChannel">
<div class="col-xs-5"> <option value="1">1</option>
<ui-switch ng-model='AHRSLog' settings-change></ui-switch> <option value="2">2</option>
</div> <option value="3">3</option>
</div> <option value="4">4</option>
</div> <option value="5">5</option>
</div> <option value="6">6</option>
</div> <option value="7">7</option>
<option value="8">8</option>
<div class="panel-group col-sm-6"> <option value="9">9</option>
<div class="panel panel-default"> <option value="10">10</option>
<div class="panel-heading">AHRS</div> <option value="11">11</option>
<div class="panel-body"> <option value="12">12</option>
<div class="col-xs-12"> <option value="13">13</option>
<span style="position:relative; overflow: hidden;"> </select>
<button class="btn btn-primary btn-block" ui-turn-on="modalCalibrateForward" </div>
ng-disabled="!IMU_Sensor_Enabled">Set AHRS Sensor Orientation</button> <div class="form-group reset-flow">
</span> <button class="btn btn-primary btn-block" ui-turn-on="modalSubmitWiFi">Submit WiFi Changes</button>
</div> </div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block" ui-turn-on="modalCalibrateGyros"
ng-disabled="!IMU_Sensor_Enabled">Calibrate Gyros</button>
</div>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-5">G Limits</label>
<form name="GLimitForm" ng-submit="updateGLimits()" novalidate ng-disabled="!IMU_Sensor_Enabled">
<input class="col-xs-7" type="string" required ng-model="GLimits" ng-blur="updateGLimits()"
placeholder="Space-separated negative and positive G meter limits"/>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- System Configuration -->
</div> <div class="panel-group col-sm-12">
<div class="panel panel-default">
<div class="col-sm-12"> <div class="panel-heading">Configuration</div>
<div class="panel-group col-sm-6"> <div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">Configuration</div>
<div class="panel-body">
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Mode S Code (Hex)</label>
<form name="modeForm" ng-submit="updatemodes()" novalidate>
<!-- type="number" not supported except on mobile -->
<!-- RegEx for validation: ^[A-Fa-f0-9]{6}$ -->
<input class="col-xs-7" type="string" required ng-model="OwnshipModeS" placeholder="FAA HEX code" ng-blur="updatemodes()" />
</form>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Watch List</label>
<form name="watchForm" ng-submit="updatewatchlist()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="string" required ng-model="WatchList" placeholder="space-delimited identifiers" ng-blur="updatewatchlist()" />
</form>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-5">PPM Correction</label>
<form name="ppmForm" ng-submit="updateppm()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="number_format" required ng-model="PPM" placeholder="integer" ng-blur="updateppm()" />
</form>
</div>
<div class="form-group reset-flow" ng-class="{ 'section_invisible': (!visible_serialout)}">
<label class="control-label col-xs-5">Serial Output Baudrate</label>
<form name="ppmForm" ng-submit="updateBaud()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="number_format" required ng-model="Baud" placeholder="integer" ng-blur="updateBaud()" />
</form>
</div>
</div>
</div>
</div>
<div class="panel-group col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Commands</div>
<div class="panel-body">
<!-- Upload. Temporary. -->
<div class="col-xs-12">
<span ng-show="update_files == ''">
<span style="position:relative; overflow: hidden;">
<span class="fake-btn fake-btn-block">Click to select System Update file</span>
<input style="opacity:0.0; position: absolute; top: 0; right: 0;" class="col-xs-12" type="file" name="update_file" onchange="angular.element(this).scope().setUploadFile(this.files)"/>
</span>
</span>
<span ng-hide="update_files == ''">
<button class="btn btn-block" onclick="angular.element(this).scope().uploadFile()">Install {{update_files[0].name}}</button>
</span>
</div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block" ui-turn-on="modalReboot">Reboot</button>
</div>
</div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block"ui-turn-on="modalShutdown">Shutdown</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Developer mode area -->
<div class="col-sm-12">
<div ng-show="DeveloperMode" class="panel-group col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">Developer Options</div>
<div class="panel-body">
<div class="col-xs-12">
<div class="form-group reset-flow"> <div class="form-group reset-flow">
<label class="control-label col-xs-5">Static IPs</label> <label class="control-label col-xs-5">Mode S Code (Hex)</label>
<form name="staticipForm" ng-submit="updatestaticips()" novalidate> <form name="modeForm" ng-submit="updatemodes()" novalidate>
<input class="col-xs-7" type="string" required ng-model="StaticIps" ng-list=" " ng-trim="false" placeholder="space-delimited ip's to send network data" ng-blur="updatestaticips()" /> <!-- type="number" not supported except on mobile -->
<!-- RegEx for validation: ^[A-Fa-f0-9]{6}$ -->
<input class="col-xs-7" type="string" required ng-model="OwnshipModeS" placeholder="FAA HEX code" ng-blur="updatemodes()" />
</form>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Watch List</label>
<form name="watchForm" ng-submit="updatewatchlist()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="string" required ng-model="WatchList" placeholder="space-delimited identifiers" ng-blur="updatewatchlist()" />
</form>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-5">PPM Correction</label>
<form name="ppmForm" ng-submit="updateppm()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="number_format" required ng-model="PPM" placeholder="integer" ng-blur="updateppm()" />
</form>
</div>
<div class="form-group reset-flow" ng-class="{ 'section_invisible': (!visible_serialout)}">
<label class="control-label col-xs-5">Serial Output Baudrate</label>
<form name="ppmForm" ng-submit="updateBaud()" novalidate>
<!-- type="number" not supported except on mobile -->
<input class="col-xs-7" type="number_format" required ng-model="Baud" placeholder="integer" ng-blur="updateBaud()" />
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Developer Options -->
<div ng-show="DeveloperMode" class="panel-group col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Developer Options</div>
<div class="panel-body">
<div class="col-xs-12">
<div class="form-group reset-flow">
<label class="control-label col-xs-5">Static IPs</label>
<form name="staticipForm" ng-submit="updatestaticips()" novalidate>
<input class="col-xs-7" type="string" required ng-model="StaticIps" ng-list=" " ng-trim="false" placeholder="space-delimited ip's to send network data" ng-blur="updatestaticips()" />
</form>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> <!-- End Left Col -->
<!-- Begin Right Col -->
<div class="col-sm-6">
<div class="col-sm-12" ng-show="DeveloperMode" > <!-- Diagnostics Values -->
<div class="panel panel-default"> <div class="panel-group col-sm-12">
<div class="panel-heading">Raw Configuration</div> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-heading">Diagnostics</div>
<p>stratux.conf:</p> <div class="panel-body">
<pre>{{rawSettings}}</pre> <div class="form-group">
<label class="control-label col-xs-7">Show Traffic Source in Callsign</label>
<div class="col-xs-5">
<ui-switch ng-model='DisplayTrafficSource' settings-change></ui-switch>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-7">Verbose Message Log</label>
<div class="col-xs-5">
<ui-switch ng-model='DEBUG' settings-change></ui-switch>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-7">Record Replay Logs</label>
<div class="col-xs-5">
<ui-switch ng-model='ReplayLog' settings-change></ui-switch>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-7">Record AHRS Logs</label>
<div class="col-xs-5">
<ui-switch ng-model='AHRSLog' settings-change></ui-switch>
</div>
</div>
</div>
</div>
</div>
<!-- AHRS Options -->
<div class="panel-group col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">AHRS</div>
<div class="panel-body">
<div class="col-xs-12">
<span style="position:relative; overflow: hidden;">
<button class="btn btn-primary btn-block" ui-turn-on="modalCalibrateForward"
ng-disabled="!IMU_Sensor_Enabled">Set AHRS Sensor Orientation</button>
</span>
</div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block" ui-turn-on="modalCalibrateGyros"
ng-disabled="!IMU_Sensor_Enabled">Calibrate Gyros</button>
</div>
</div>
<div class="form-group reset-flow">
<label class="control-label col-xs-3">G Limits</label>
<form name="GLimitForm" ng-submit="updateGLimits()" novalidate ng-disabled="!IMU_Sensor_Enabled">
<input class="col-xs-9" type="string" required ng-model="GLimits" ng-blur="updateGLimits()"
placeholder="Space-separated negative and positive G meter limits"/>
</form>
</div>
</div>
</div>
</div>
<!-- App Commands -->
<div class="panel-group col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Commands</div>
<div class="panel-body">
<!-- Upload. Temporary. -->
<div class="col-xs-12">
<span ng-show="update_files == ''">
<span style="position:relative; overflow: hidden;">
<span class="fake-btn fake-btn-block">Click to select System Update file</span>
<input style="opacity:0.0; position: absolute; top: 0; right: 0;" class="col-xs-12" type="file" name="update_file" onchange="angular.element(this).scope().setUploadFile(this.files)"/>
</span>
</span>
<span ng-hide="update_files == ''">
<button class="btn btn-block" onclick="angular.element(this).scope().uploadFile()">Install {{update_files[0].name}}</button>
</span>
</div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block" ui-turn-on="modalReboot">Reboot</button>
</div>
</div>
<div class="form-group reset-flow">
<div class="col-xs-12">
<button class="btn btn-primary btn-block"ui-turn-on="modalShutdown">Shutdown</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12" ng-show="DeveloperMode" >
<div class="panel panel-default">
<div class="panel-heading">Raw Configuration</div>
<div class="panel-body">
<p>stratux.conf:</p>
<pre>{{rawSettings}}</pre>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- ############################################## -->
<!-- Modal popups -->
<!-- ############################################## -->
<!-- Messages Modal -->
<div class="col-sm-12"> <div class="col-sm-12">
<h3 ui-if="rebooting" ui-state="rebooting">Stratux is rebooting. You may need to reconnect WiFi once it reboots.</h3> <h3 ui-if="rebooting" ui-state="rebooting">Stratux is rebooting. You may need to reconnect WiFi once it reboots.</h3>
<h3 ui-if="shuttingdown" ui-state="shuttingdown">Stratux is shutting down. You may disconnect power.</h3> <h3 ui-if="shuttingdown" ui-state="shuttingdown">Stratux is shutting down. You may disconnect power.</h3>
<h3 ui-if="WiFiRestart" ui-state="WiFiRestart">Stratux WiFi is Restarting Services. You may need to reconnect WiFi once services are restored.</h3>
</div> </div>
<div ui-content-for="modals"> <div ui-content-for="modals">
<!-- Reboot Config Modal -->
<div class="modal" ui-if="modalReboot" ui-state="modalReboot"> <div class="modal" ui-if="modalReboot" ui-state="modalReboot">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center"> <div class="modal-dialog vertical-align-center">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button class="close" <button class="close" ui-turn-off="modalReboot"></button>
ui-turn-off="modalReboot"></button>
<h4 class="modal-title">Are you really sure?</h4> <h4 class="modal-title">Are you really sure?</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -231,16 +283,14 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Shutdown Modal -->
<div class="modal" ui-if="modalShutdown" ui-state="modalShutdown"> <div class="modal" ui-if="modalShutdown" ui-state="modalShutdown">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center"> <div class="modal-dialog vertical-align-center">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button class="close" <button class="close" ui-turn-off="modalShutdown"></button>
ui-turn-off="modalShutdown"></button>
<h4 class="modal-title">Are you really sure?</h4> <h4 class="modal-title">Are you really sure?</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -255,7 +305,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Calibrate Forward Modal -->
<div class="modal" ui-if="modalCalibrateForward" ui-state="modalCalibrateForward"> <div class="modal" ui-if="modalCalibrateForward" ui-state="modalCalibrateForward">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
@ -279,6 +329,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Calibration Success Modal -->
<div class="modal" ui-if="modalCalibrateDone" ui-state="modalCalibrateDone"> <div class="modal" ui-if="modalCalibrateDone" ui-state="modalCalibrateDone">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
@ -290,8 +341,8 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>The sensor orientation is set. These settings will be saved for future flights. <p>The sensor orientation is set. These settings will be saved for future flights.
Place the Stratux in its in-flight orientation and keep it stationary for 5 seconds Place the Stratux in its in-flight orientation and keep it stationary for 5 seconds
after you press the <strong>Done</strong> button.</p> after you press the <strong>Done</strong> button.</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a ng-click="setOrientation('done')" ui-turn-off="modalCalibrateDone" <a ng-click="setOrientation('done')" ui-turn-off="modalCalibrateDone"
@ -301,6 +352,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Calibration Failed Modal -->
<div class="modal" ui-if="modalCalibrateFailed" ui-state="modalCalibrateFailed"> <div class="modal" ui-if="modalCalibrateFailed" ui-state="modalCalibrateFailed">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
@ -322,7 +374,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Gyro Calibration Modal -->
<div class="modal" ui-if="modalCalibrateGyros" ui-state="modalCalibrateGyros"> <div class="modal" ui-if="modalCalibrateGyros" ui-state="modalCalibrateGyros">
<div class="modal-overlay "></div> <div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block"> <div class="vertical-alignment-helper center-block">
@ -345,4 +397,94 @@
</div> </div>
</div> </div>
</div> </div>
<!-- WiFi Submit Modal -->
<div class="modal" ui-if="modalSubmitWiFi" ui-state="modalSubmitWiFi">
<div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header">
<button class="close" ui-turn-off="modalSubmitWiFi"></button>
<h4 class="modal-title">Are you really sure?</h4>
</div>
<div class="modal-body">
<p>Do you wish to submit the WiFi cnanges?</p>
<p>Note that the wireless services will reboot immediately and it will stop responding during the reboot</p>
<p>You might have to reselect the new WiFi network if you made changes to the SSID or security.</p>
</div>
<div class="modal-footer">
<a ui-turn-off="modalSubmitWiFi" ui-turn-on="modalCancelWiFi" class="btn btn-default">Cancel</a>
<a ng-click="updateWiFi()" ui-turn-off="modalSubmitWiFi" ui-turn-on="WiFiRestart" class="btn btn-primary">Submit Changes</a>
</div>
</div>
</div>
</div>
</div>
<!-- WiFi Success Modal -->
<div class="modal" ui-if="modalSuccessWiFi" ui-state="modalSuccessWiFi">
<div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header">
<button class="close" ui-turn-off="modalSuccessWiFi"></button>
<h4 class="modal-title">Success</h4>
</div>
<div class="modal-body">
<p>I am not able to get these values to update after updateWiFi finction but they are being sent back to the server correctly. Something about a $scope.$apply() function and a change outside of the digets. I cannot figure this out<br /> https://stackoverflow.com/questions/30119538/angularjs-ng-bind-not-updating</p>
<p>Your WiFi settings were successful. </p>
<p>WiFi SSID: {{WiFiSSID}}</p>
<p>WiFi Security: {{WiFiSecurityEnabled}}</p>
<p>WiFi Passcode: {{WiFiPasscode}}</p>
<p>WiFi Channel: {{WiFiChannel}}</p>
<p>Your Stratux's WiFi services are now restarting to apply the new settings. You might have to reconnect to your new WiFi SSID. </p>
</div>
<div class="modal-footer">
<a ui-turn-off="modalSuccessWiFi" class="btn btn-default">Close</a>
</div>
</div>
</div>
</div>
</div>
<!-- WiFi Error Modal -->
<div class="modal" ui-if="modalErrorWiFi" ui-state="modalErrorWiFi">
<div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header">
<button class="close" ui-turn-off="modalErrorWiFi"></button>
<h4 class="modal-title">Errors in your WiFi Settings</h4>
</div>
<div class="modal-body">
<div>{{WiFiErrors.WiFiSSID}}</div>
<div>{{WiFiErrors.WiFiPasscode}}</div>
</div>
<div class="modal-footer">
<a ui-turn-off="modalErrorWiFi" ng-click="resetSettings()" class="btn btn-default">Close</a>
</div>
</div>
</div>
</div>
</div>
<!-- WiFi Canceled Modal -->
<div class="modal" ui-if="modalCancelWiFi" ui-state="modalCancelWiFi">
<div class="modal-overlay "></div>
<div class="vertical-alignment-helper center-block">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header">
<button class="close" ui-turn-off="modalCancelWiFi"></button>
<h4 class="modal-title">WiFi Settings: Canceled</h4>
</div>
<div class="modal-body">
<p>WiFi Settings Canceled.</p>
</div>
<div class="modal-footer">
<a ui-turn-off="modalCancelWiFi" ng-click="resetSettings()" class="btn btn-default btn-primary">OK</a>
</div>
</div>
</div>
</div>
</div>
</div> </div>