diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4efb5a12..bfa032aa 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -137,6 +137,126 @@ "tabAuxiliary": { "message": "Modes" }, + "tabSitl": { + "message" : "SITL" + }, + "sitlDemoMode": { + "message": "Demo Mode" + }, + "sitlResetDemoModeData": { + "message": "Reset Demo Mode" + }, + "sitlOSNotSupported": { + "message": "SITL is not supported on this operating system." + }, + "sitlOptions": { + "message": "SITL Options" + }, + "sitlEnableSim": { + "message": "Enable simulator" + }, + "sitlSimulator": { + "message": "Simulator" + }, + "sitlUseImu": { + "message": "Use IMU" + }, + "sitlSimIP": { + "message" : "Simulator IP" + }, + "sitlPort": { + "message" : "Simulator Port" + }, + "sitlChannelMap": { + "message": "Channel Mapping" + }, + "sitlSimInput": { + "message": "Simulator Input" + }, + "sitlInavOutput": { + "message": "INAV Output" + }, + "sitlLog": { + "message": "Log" + }, + "sitlStart": { + "message": "Start" + }, + "sitlStop": { + "message": "Stop" + }, + "sitlStopped": { + "message": "SITL stopped\n" + }, + "sitlProfiles": { + "message": "SITL Profiles" + }, + "sitlNew": { + "message": "New" + }, + "sitlSave": { + "message": "Save" + }, + "sitlDelete": { + "message": "Delete" + }, + "sitlNewProfile": { + "message": "New SITL Profile" + }, + "sitlEnterName": { + "message": "(Profile name)" + }, + "sitlProfileExists": { + "message": "A profile with this name already exists." + }, + "sitlStdProfileCantDeleted": { + "message": "SITL standard profile can't be deleted." + }, + "sitlStdProfileCantOverwritten": { + "message": "SITL standard profile can't be overwritten. Please create a new one." + }, + "sitlSerialToTCP": { + "message": "Serial to TCP (UART)" + }, + "sitlSerialProtocoll": { + "message": "Preset for RX Protocoll" + }, + "sitlSerialStopbits": { + "message": "Stopbits" + }, + "sitlSerialPort": { + "message": "Serial port" + }, + "sitlSerialTCPPort": { + "message": "TCP port" + }, + "sitlSerialParity": { + "message": "Parity" + }, + "sitlSerialTcpEnable": { + "message": "Enable" + }, + "sitlHelp": { + "message": "SITL (Software in the loop) allows to run INAV completely in software on the PC without using a flight controller and simulate complete FPV flights. For this, INAV is compiled with a normal PC compiler. The sensors are replaced by data provided by a simulator.
Currently supported are:
" + }, + "sitlProfilesHelp": { + "message": "Profiles are saved locally. The profiles contain not only all data of this tab, but also the configuration file (\"EEPROM\") of INAV itself.
Note:
Standard profiles can't be overwriten. To save your changes, create a new profile. " + }, + "sitlEnableSimulatorHelp": { + "message": "If this option is deactivated, only UARTS (MSP/Configurator) can be used. Useful to configure INAV without having to start the simulator." + }, + "sitlUseImuHelp": { + "message": "Use IMU sensor data from the simulator instead of using attitude data from the simulator directly (Experimental, not recommended)." + }, + "sitlIpHelp": { + "message": "IP address of the computer on which the simulator is running. If the simulator is running on the same computer, leave it at \"127.0.0.1" + }, + "sitlPortHelp": { + "message": "Port number of the interface of the simulator. Note: The RealFlight port is fixed and cannot be changed." + }, + "sitlSer2TcpHelp": { + "message": "Devices with a UART interface can be used with SITL via a serial to USB interface. Especially intended for serial receivers to use the full number of channels. " + }, "auxiliaryAcroEnabled": { "message": "ACRO" }, @@ -191,7 +311,6 @@ "usbDeviceUdevNotice": { "message": "Are udev rules installed correctly? See docs for instructions" }, - "stm32UsbDfuNotFound": { "message": "USB DFU not found" }, @@ -341,6 +460,9 @@ "statusbar_cpu_load": { "message": "CPU Load: $1%" }, + "statusbar_arming_flags": { + "message": "Arming Flags:" + }, "dfu_connect_message": { "message": "Please use the Firmware Flasher to access DFU devices" @@ -2772,10 +2894,6 @@ "tabAdvancedTuningMultirotorTuningTitle": { "message": ": Multirotors" }, - - - - "tabAdvancedTuningGenericTitle": { "message": "Generic settings" }, @@ -4783,6 +4901,9 @@ "nmeaWarning": { "message": "NMEA protocol is deprecated and might be removed in the future. Please use UBLOX or UBLOX7 protocol instead." }, + "softSerialWarning": { + "message": "It is not advisable to use softserial for flight critical devices like GPS or receiver, or high traffic devices like MSP DisplayPort." + }, "ledStripColorSetupTitle": { "message": "Color setup" }, diff --git a/gulpfile.js b/gulpfile.js index 473a4d26..1f6e807d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -136,6 +136,7 @@ sources.js = [ './js/waypoint.js', './node_modules/openlayers/dist/ol.js', './js/libraries/plotly-latest.min.js', + './js/sitl.js', ]; sources.receiverCss = [ @@ -252,6 +253,8 @@ gulp.task('dist-build', gulp.series('build', function() { './resources/models/*', './resources/osd/analogue/*.mcm', './resources/motor_order/*.svg', + './resources/sitl/windows/*', + './resources/sitl/linux/*' ]; return gulp.src(distSources, { base: '.' }) .pipe(gulp.dest(distDir)); @@ -268,7 +271,8 @@ gulp.task('apps', gulp.series('dist', function(done) { flavor: 'normal', macIcns: './images/inav.icns', winIco: './images/inav.ico', - version: get_nw_version() + version: get_nw_version(), + zip: false }); builder.on('log', console.log); builder.build(function (err) { diff --git a/images/icons/cf_icon_setup_white.svg b/images/icons/cf_icon_setup_white.svg index d79669da..7501a9f0 100644 --- a/images/icons/cf_icon_setup_white.svg +++ b/images/icons/cf_icon_setup_white.svg @@ -1,12 +1,16 @@ - + + + width="283.46px" height="141.73px" viewBox="0 0 283.46 141.73" enable-background="new 0 0 283.46 141.73" xml:space="preserve"> - + + + diff --git a/images/icons/cf_icon_sitl_grey.svg b/images/icons/cf_icon_sitl_grey.svg new file mode 100644 index 00000000..94072aca --- /dev/null +++ b/images/icons/cf_icon_sitl_grey.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/images/icons/cf_icon_sitl_white.svg b/images/icons/cf_icon_sitl_white.svg new file mode 100644 index 00000000..018a59f7 --- /dev/null +++ b/images/icons/cf_icon_sitl_white.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/images/inav.ico b/images/inav.ico index e180941b..24501afe 100644 Binary files a/images/inav.ico and b/images/inav.ico differ diff --git a/js/fc.js b/js/fc.js index 0cb03cac..b1040b0f 100644 --- a/js/fc.js +++ b/js/fc.js @@ -596,7 +596,8 @@ var FC = { 'NMEA', 'UBLOX', 'UBLOX7', - 'MSP' + 'MSP', + 'FAKE' ]; }, getGpsBaudRates: function () { diff --git a/js/gui.js b/js/gui.js index 94cbabe6..3d20d07a 100644 --- a/js/gui.js +++ b/js/gui.js @@ -14,6 +14,7 @@ var GUI_control = function () { 'landing', 'firmware_flasher', 'mission_control', + 'sitl', 'help' ]; this.defaultAllowedTabsWhenConnected = [ @@ -202,9 +203,49 @@ GUI_control.prototype.content_ready = function (callback) { }; GUI_control.prototype.updateStatusBar = function() { + + var armingFlags = { + 'ARMED':(1 << 2), + //'WAS_EVER_ARMED':(1 << 3), + 'SIMULATOR_MODE':(1 << 4), + 'ARMING_DISABLED_FAILSAFE_SYSTEM':(1 << 7), + 'ARMING_DISABLED_NOT_LEVEL':(1 << 8), + 'ARMING_DISABLED_SENSORS_CALIBRATING':(1 << 9), + 'ARMING_DISABLED_SYSTEM_OVERLOADED':(1 << 10), + 'ARMING_DISABLED_NAVIGATION_UNSAFE':(1 << 11), + 'ARMING_DISABLED_COMPASS_NOT_CALIBRATED':(1 << 12), + 'ARMING_DISABLED_ACCELEROMETER_NOT_CALIBRATED':(1 << 13), + 'ARMING_DISABLED_ARM_SWITCH':(1 << 14), + 'ARMING_DISABLED_HARDWARE_FAILURE':(1 << 15), + 'ARMING_DISABLED_BOXFAILSAFE':(1 << 16), + 'ARMING_DISABLED_BOXKILLSWITCH':(1 << 17), + 'ARMING_DISABLED_RC_LINK':(1 << 18), + 'ARMING_DISABLED_THROTTLE':(1 << 19), + 'ARMING_DISABLED_CLI':(1 << 20), + 'ARMING_DISABLED_CMS_MENU':(1 << 21), + 'ARMING_DISABLED_OSD_MENU':(1 << 22), + 'ARMING_DISABLED_ROLLPITCH_NOT_CENTERED':(1 << 23), + 'ARMING_DISABLED_SERVO_AUTOTRIM':(1 << 24), + 'ARMING_DISABLED_OOM':(1 << 25), + 'ARMING_DISABLED_INVALID_SETTING':(1 << 26), + 'ARMING_DISABLED_PWM_OUTPUT_ERROR':(1 << 27), + 'ARMING_DISABLED_NO_PREARM':(1 << 28), + 'ARMING_DISABLED_DSHOT_BEEPER':(1 << 29), + 'ARMING_DISABLED_LANDING_DETECTED':(1 << 30), + }; + + var activeArmFlags = []; + for(var i=0;i<32;i++) { + var checkBit = (1 << i); + if(Object.values(armingFlags).includes(checkBit) && (checkBit & CONFIG.armingFlags)) { + activeArmFlags.push(Object.keys(armingFlags)[Object.values(armingFlags).indexOf(checkBit)]); + } + } + $('span.i2c-error').text(CONFIG.i2cError); $('span.cycle-time').text(CONFIG.cycleTime); $('span.cpu-load').text(chrome.i18n.getMessage('statusbar_cpu_load', [CONFIG.cpuload])); + $('span.arming-flags').text(activeArmFlags.length ? activeArmFlags.join(', ') : '-'); }; GUI_control.prototype.updateProfileChange = function() { diff --git a/js/port_handler.js b/js/port_handler.js index 58e464fd..cc31c604 100755 --- a/js/port_handler.js +++ b/js/port_handler.js @@ -1,7 +1,10 @@ 'use strict'; var usbDevices = { - STM32DFU: {'vendorId': 1155, 'productId': 57105} + filters: [ + {'vendorId': 1155, 'productId': 57105}, + {'vendorId': 11836, 'productId': 57105} + ] }; var PortHandler = new function () { @@ -66,7 +69,7 @@ PortHandler.check = function () { chrome.storage.local.get('last_used_port', function (result) { // if last_used_port was set, we try to select it if (result.last_used_port) { - if (result.last_used_port == "ble" || result.last_used_port == "tcp" || result.last_used_port == "udp") { + if (result.last_used_port == "ble" || result.last_used_port == "tcp" || result.last_used_port == "udp" || result.last_used_port == "sitl" || result.last_used_port == "sitl-demo") { $('#port').val(result.last_used_port); } else { current_ports.forEach(function(port) { @@ -152,7 +155,7 @@ PortHandler.check = function () { }; PortHandler.check_usb_devices = function (callback) { - chrome.usb.getDevices(usbDevices.STM32DFU, function (result) { + chrome.usb.getDevices(usbDevices, function (result) { if (result.length) { if (!$("div#port-picker #port [value='DFU']").length) { $('div#port-picker #port').append($('