diff --git a/css/style.css b/css/style.css index 7e542405..f6bcaad7 100644 --- a/css/style.css +++ b/css/style.css @@ -376,8 +376,8 @@ a:hover { float: left; width: 182px; - height: 25px; - line-height: 25px; + height: 22px; + line-height: 22px; text-align: center; font-weight: bold; @@ -385,6 +385,8 @@ a:hover { border: 1px solid #8b8b8b; border-bottom: 0; border-left: 0; + + background-color: #ececec; } .tab-auxiliary_configuration .heads li:first-child { margin-left: 181px; @@ -400,17 +402,53 @@ a:hover { width: 100%; border-collapse: collapse; } - .tab-auxiliary_configuration .boxes th, .tab-auxiliary_configuration .boxes td { - padding: 5px; - padding-right: 0px; - padding-left: 0px; + .tab-auxiliary_configuration .boxes th, .tab-auxiliary_configuration .boxes td { + line-height: 22px; + text-align: center; border: 1px solid #8b8b8b; } + .tab-auxiliary_configuration .boxes .name { + /* padding-left: 5px; */ + text-align: center; + } + .tab-auxiliary_configuration .boxes td input { + position: absolute; + + margin-top: -6px; + margin-left: -6px; + } .tab-auxiliary_configuration .boxes tr:nth-child(odd) { background-color: #ececec; - } - + } + .tab-auxiliary_configuration .update { + display: block; + float: right; + + margin-top: 10px; + + width: 120px; + height: 30px; + line-height: 30px; + + font-size: 14px; + color: white; + text-align: center; + + border: 1px solid silver; + + background-color: #6f1515; + } + .tab-auxiliary_configuration .update:hover { + cursor: default; + } + .tab-auxiliary_configuration .update.active { + background-color: #0fab16; + } + .tab-auxiliary_configuration .update.active:hover { + cursor: pointer; + background-color: #13d81d; + } /* Flotr related styles */ .flotr-legend { diff --git a/js/main.js b/js/main.js index 0ff16316..e32757c8 100644 --- a/js/main.js +++ b/js/main.js @@ -30,7 +30,7 @@ $(document).ready(function() { }); // temporary - $('#content').load("./tabs/auxiliary_configuration.html", tab_initialize_auxiliary_configuration); + //$('#content').load("./tabs/auxiliary_configuration.html", tab_initialize_auxiliary_configuration); }); function disable_timers() { diff --git a/js/serial_backend.js b/js/serial_backend.js index e37b9803..0a1718a0 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -168,6 +168,8 @@ function onOpen(openInfo) { send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_PID, MSP_codes.MSP_PID); send_message(MSP_codes.MSP_RC_TUNING, MSP_codes.MSP_RC_TUNING); + send_message(MSP_codes.MSP_BOXNAMES, MSP_codes.MSP_BOXNAMES); + send_message(MSP_codes.MSP_BOX, MSP_codes.MSP_BOX); }, connection_delay * 1000); } @@ -433,6 +435,8 @@ function process_message(code, data) { console.log(data); break; case MSP_codes.MSP_BOXNAMES: + AUX_CONFIG = []; // empty the array as new data is coming in + var buff = new Array(); for (var i = 0; i < data.byteLength; i++) { if (view.getUint8(i) == 0x3B) { // ; (delimeter char) @@ -540,4 +544,12 @@ function lowByte(num) { function bit_check(num, bit) { return ((num >> bit) % 2 != 0) +} + +function bit_set(num, bit) { + return num | 1 << bit; +} + +function bit_clear(num, bit) { + return num & ~(1 << bit); } \ No newline at end of file diff --git a/tabs/auxiliary_configuration.html b/tabs/auxiliary_configuration.html index 9c51707d..148c16af 100644 --- a/tabs/auxiliary_configuration.html +++ b/tabs/auxiliary_configuration.html @@ -24,4 +24,5 @@