Merge remote-tracking branch 'origin/master' into dzikuvx-new-mixer-approach

pull/332/head
Pawel Spychalski (DzikuVx) 7 years ago
commit c4735d2690

@ -313,6 +313,9 @@
"communitySlackSupport": {
"message": "Slack Support Live Chat"
},
"communityTelegramSupport": {
"message": "Telegram Channel"
},
"initialSetupBackupAndRestoreApiVersion": {
"message": "<span style=\"color: red\">Backup and restore functionality disabled.</span> You have firmware with API version <span style=\"color: red\">$1</span>, backup and restore requires <span style=\"color: #37a8db\">$2</span>. Please backup your settings via the CLI, see INAV documentation for procedure."
},
@ -406,6 +409,42 @@
"initialSetupBattery": {
"message": "Battery voltage:"
},
"initialSetupBatteryDetectedCells": {
"message": "Battery detected cell count:"
},
"initialSetupBatteryDetectedCellsValue": {
"message": "$1"
},
"initialSetupBatteryPercentage": {
"message": "Battery left:"
},
"initialSetupBatteryPercentageValue": {
"message": "$1 %"
},
"initialSetupBatteryRemainingCapacity": {
"message": "Battery remaining capacity"
},
"initialSetupBatteryRemainingCapacityValue": {
"message": "$1 $2"
},
"initialSetupBatteryFull": {
"message": "Battery full when plugged in"
},
"initialSetupBatteryFullValue": {
"message": "$1"
},
"initialSetupBatteryThresholds": {
"message": "Battery use cap thresholds"
},
"initialSetupBatteryThresholdsValue": {
"message": "$1"
},
"initialSetup_Wh_drawn": {
"message": "Capacity drawn:"
},
"initialSetup_Wh_drawnValue": {
"message": "$1 Wh"
},
"initialSetupBatteryValue": {
"message": "$1 V"
},
@ -483,6 +522,9 @@
"featureVBAT": {
"message": "Battery voltage monitoring"
},
"featureTX_PROF_SEL": {
"message": "Profile selection with TX stick command"
},
"featureINFLIGHT_ACC_CAL": {
"message": "In-flight level calibration"
},
@ -573,6 +615,9 @@
"featureAIRMODE": {
"message": "Permanently enable AIRMODE"
},
"featureFW_LAUNCH": {
"message": "Permanently enable Launch Mode for Fixed Wing"
},
"configurationFeatureEnabled": {
"message": "Enabled"
},
@ -637,16 +682,10 @@
"message": "Magnetometer Declination [deg]"
},
"configurationAutoDisarmDelay": {
"message": "Disarm delay [Seconds]"
"message": "Seconds until disarm due to low THR"
},
"configurationAutoDisarmDelayHelp": {
"message": "Requires MOTOR_STOP feature"
},
"configurationDisarmKillSwitch": {
"message": "Disarm regardless of throttle value"
},
"configurationDisarmKillSwitchHelp": {
"message": "When arming via radio channel"
"message": "Only used for stick arming (i.e. not using a switch)"
},
"configurationThrottleMinimum": {
"message": "Minimum Throttle"
@ -690,6 +729,21 @@
"configurationBatteryMultiwiiCurrent": {
"message": "Enable support for legacy Multiwii MSP current output"
},
"configurationBatteryCapacity": {
"message": "Battery Capacity"
},
"configurationBatteryCapacityValue": {
"message": "Capacity"
},
"configurationBatteryCapacityWarning": {
"message": "Warning Capacity (%)"
},
"configurationBatteryCapacityCritical": {
"message": "Critical Capacity (%)"
},
"configurationBatteryCapacityUnit": {
"message": "Battery Capacity Unit"
},
"configuration3d": {
"message": "3D"
},
@ -832,6 +886,15 @@
"pidTuningYawRate": {
"message": "YAW rate"
},
"pidTuningManualRollRate": {
"message": "Manual ROLL rate"
},
"pidTuningManualPitchRate": {
"message": "Manual PITCH rate"
},
"pidTuningManualYawRate": {
"message": "Manual YAW rate"
},
"magHoldYawRate": {
"message": "MagHold rate"
},
@ -893,6 +956,12 @@
"receiverRcYawExpo": {
"message": "RC Yaw Expo"
},
"receiverManualRcExpo": {
"message": "Manual RC Expo"
},
"receiverManualRcYawExpo": {
"message": "Manual RC Yaw Expo"
},
"receiverChannelMap": {
"message": "Channel Map"
},
@ -1052,37 +1121,37 @@
"message": "Roll D Adjustment"
},
"adjustmentsFunction21": {
"message": "Alt P Adjustment"
"message": "RC Yaw Expo Adjustment"
},
"adjustmentsFunction22": {
"message": "Alt I Adjustment"
"message": "Manual RC Expo Adjustment"
},
"adjustmentsFunction23": {
"message": "Alt D Adjustment"
"message": "Manual RC Yaw Expo Adjustment"
},
"adjustmentsFunction24": {
"message": "Vel P Adjustment"
"message": "Manual Pitch & Roll Rate Adjustment"
},
"adjustmentsFunction25": {
"message": "Vel I Adjustment"
"message": "Manual Roll Rate Adjustment"
},
"adjustmentsFunction26": {
"message": "Vel D Adjustment"
"message": "Manual Pitch Rate Adjustment"
},
"adjustmentsFunction27": {
"message": "MAG P Adjustment"
"message": "Manual Yaw Rate Adjustment"
},
"adjustmentsFunction28": {
"message": "Pos P Adjustment"
"message": "Navigation FW Cruise Throttle Adjustment"
},
"adjustmentsFunction29": {
"message": "Pos I Adjustment"
"message": "Navigation FW Pitch To Throttle Adjustment"
},
"adjustmentsFunction30": {
"message": "PosR P Adjustment"
"message": "Board Roll Alignment Adjustment"
},
"adjustmentsFunction31": {
"message": "PosR I Adjustment"
"message": "Board Pitch Alignment Adjustment"
},
"adjustmentsFunction32": {
"message": "PosR D Adjustment"
@ -2249,9 +2318,24 @@
"osdElement_MAIN_BATT_CELL_VOLTAGE": {
"message": "Battery Cell Voltage"
},
"osdElement_MAIN_BATT_REMAINING_PERCENTAGE": {
"message": "Battery Remaining Percentage"
},
"osdElement_MAIN_BATT_REMAINING_CAPACITY": {
"message": "Battery Remaining Capacity"
},
"osdElement_MAIN_BATT_CELL_VOLTAGE_HELP": {
"message": "Shows the average cell voltage from the main battery"
},
"osdElement_MAH_DRAWN": {
"message": "mAh drawn"
},
"osdElement_EFFICIENCY_MAH": {
"message": "Efficiency mAh/Km"
},
"osdElement_EFFICIENCY_WH": {
"message": "Efficiency Wh/Km"
},
"osdElement_THROTTLE_POSITION_AUTO_THR": {
"message": "Throttle Position / Auto Throttle"
},
@ -2276,6 +2360,9 @@
"osdElement_GPS_HDOP_HELP": {
"message": "Shows the Horizontal Dilution Of Precission from the GPS. The lower, the most accurate the GPS fix is."
},
"osdElement_TRIP_DIST": {
"message": "Trip distance"
},
"osdElement_VARIO_HELP": {
"message": "Shows vertical speed using up or down arrows. Each arrow represents 10cm (~4 inches) per second."
},
@ -2324,6 +2411,51 @@
"downloadUpdatesBtn": {
"message": "Download new app"
},
"tabMissionControl": {
"message": "Mission Control"
},
"loadMissionButton": {
"message": "Load mission from FC"
},
"saveMissionButton": {
"message": "Save mission to FC"
},
"loadEepromMissionButton": {
"message": "Load Eeprom mission"
},
"saveEepromMissionButton": {
"message": "Save Eeprom mission"
},
"editPointHead": {
"message": "Edit point"
},
"editPointButtonSave": {
"message": "Save"
},
"editPointButtonRemove": {
"message": "Remove"
},
"removeAllPointButtonSave": {
"message": "Remove all points"
},
"missionTotalInformationHead": {
"message": "Total information"
},
"missionRTHsettingsTitle": {
"message": "RTH settings"
},
"missionDefaultSettingsHead": {
"message": "Default settings"
},
"useOnlyStandalone": {
"message": "Use stand-alone application.<br> Please visit the <a href=\"https://github.com/iNavFlight/inav-configurator/releases\" target=\"_blank\">website</a> to read the release notes and download."
},
"eeprom_load_ok": {
"message": "EEPROM <span style=\"color: #37a8db\">loaded</span>"
},
"confirm_delete_all_points": {
"message": "Do you really want to delete all points?"
},
"servoMixer": {
"message": "Servo mixer"
},

@ -56,6 +56,7 @@ sources.js = [
'./js/libraries/google-analytics-bundle.js',
'./node_modules/jquery/dist/jquery.min.js',
'./node_modules/jquery-ui-npm/jquery-ui.min.js',
'./node_modules/marked/lib/marked.js',
'./js/libraries/d3.min.js',
'./js/libraries/jquery.nouislider.all.min.js',
'./node_modules/three/three.min.js',
@ -128,6 +129,10 @@ sources.receiverJs = [
'./tabs/receiver_msp.js'
];
sources.debugTraceJs = [
'./js/debug_trace.js'
];
sources.hexParserJs = [
'./js/workers/hex_parser.js',
];
@ -139,6 +144,7 @@ var output = {
mapJs: 'map.js',
receiverCss: 'receiver-msp.css',
receiverJs: 'receiver-msp.js',
debugTraceJs: 'debug-trace.js',
hexParserJs: 'hex_parser.js',
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -0,0 +1,9 @@
function debugTraceOnLoad()
{
var output = document.getElementById('debug-trace');
setInterval(function() {
output.innerText = getDebugTrace();
}, 100);
}
window.onload = debugTraceOnLoad;

@ -24,10 +24,12 @@ var CONFIG,
MOTOR_DATA,
SERVO_DATA,
GPS_DATA,
MISSION_PLANER,
ANALOG,
ARMING_CONFIG,
FC_CONFIG,
MISC,
VOLTMETER_CONFIG,
_3D,
DATAFLASH,
SDCARD,
@ -48,7 +50,8 @@ var CONFIG,
CALIBRATION_DATA,
POSITION_ESTIMATOR,
RTH_AND_LAND_CONFIG,
FW_CONFIG;
FW_CONFIG,
DEBUG_TRACE;
var FC = {
MAX_SERVO_RATE: 125,
@ -141,7 +144,12 @@ var FC = {
throttle_MID: 0,
throttle_EXPO: 0,
dynamic_THR_breakpoint: 0,
RC_YAW_EXPO: 0
RC_YAW_EXPO: 0,
manual_RC_EXPO: 0,
manual_RC_YAW_EXPO: 0,
manual_roll_rate: 0,
manual_pitch_rate: 0,
manual_yaw_rate: 0,
};
AUX_CONFIG = [];
@ -171,6 +179,7 @@ var FC = {
altitude: 0,
barometer: 0,
sonar: 0,
air_speed: 0,
kinematics: [0.0, 0.0, 0.0],
debug: [0, 0, 0, 0]
};
@ -198,11 +207,34 @@ var FC = {
packetCount: 0
};
MISSION_PLANER = {
maxWaypoints: 0,
isValidMission: 0,
countBusyPoints: 0,
bufferPoint: {
number: 0,
action: 0,
lat: 0,
lon: 0,
alt: 0,
endMission: 0,
p1: 0
}
};
ANALOG = {
voltage: 0,
mAhdrawn: 0,
mWhdrawn: 0,
rssi: 0,
amperage: 0
amperage: 0,
power: 0,
cell_count: 0,
battery_percentage: 0,
battery_full_when_plugged_in: false,
use_capacity_thresholds: false,
battery_remaining_capacity: 0,
battery_flags: 0
};
ARMING_CONFIG = {
@ -230,7 +262,24 @@ var FC = {
vbatscale: 0,
vbatmincellvoltage: 0,
vbatmaxcellvoltage: 0,
vbatwarningcellvoltage: 0
vbatwarningcellvoltage: 0,
battery_capacity: 0,
battery_capacity_warning: 0,
battery_capacity_critical: 0,
battery_capacity_unit: 'mAh'
};
BATTERY_CONFIG = {
vbatscale: 0,
vbatmincellvoltage: 0,
vbatmaxcellvoltage: 0,
vbatwarningcellvoltage: 0,
current_offset: 0,
current_scale: 0,
capacity: 0,
capacity_warning: 0,
capacity_critical: 0,
capacity_unit: 0
};
ADVANCED_CONFIG = {
@ -500,6 +549,13 @@ var FC = {
);
}
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
features.push(
{bit: 30, group: 'other', name: 'FW_LAUNCH', haveTip: false, showNameInTip: false},
{bit: 2, group: 'other', name: 'TX_PROF_SEL', haveTip: false, showNameInTip: false}
);
}
return features.reverse();
},
isFeatureEnabled: function (featureName, features) {
@ -720,6 +776,10 @@ var FC = {
data.push('TBS Crossfire');
}
if (semver.gte(CONFIG.flightControllerVersion, "1.9.1")) {
data.push('FPort');
}
return data;
},
getSPIProtocolTypes: function () {
@ -837,13 +897,13 @@ var FC = {
}
},
getOsdDisabledFields: function () {
return ['CRAFT_NAME'];
return [];
},
getAccelerometerNames: function () {
return [ "NONE", "AUTO", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "FAKE"];
},
getMagnetometerNames: function () {
return ["NONE", "AUTO", "HMC5883", "AK8975", "GPSMAG", "MAG3110", "AK8963", "IST8310", "FAKE"];
return ["NONE", "AUTO", "HMC5883", "AK8975", "GPSMAG", "MAG3110", "AK8963", "IST8310", "QMC5883", "MPU9250", "FAKE"];
},
getBarometerNames: function () {
if (semver.gte(CONFIG.flightControllerVersion, "1.6.2")) {
@ -862,7 +922,7 @@ var FC = {
}
},
getRangefinderNames: function () {
return [ "NONE", "HCSR04", "SRF10"];
return [ "NONE", "HCSR04", "SRF10", "HCSR04I2C", "VL53L0X", "UIB"];
},
getArmingFlags: function () {
return {
@ -936,8 +996,31 @@ var FC = {
}
},
getRcMapLetters: function () {
if (semver.gte(CONFIG.flightControllerVersion, '1.9.1'))
return ['A', 'E', 'R', 'T'];
else
return ['A', 'E', 'R', 'T', '5', '6', '7', '8'];
},
isRcMapValid: function (val) {
var strBuffer = val.split(''),
duplicityBuffer = [];
if (val.length != FC.getRcMapLetters().length)
return false;
// check if characters inside are all valid, also check for duplicity
for (var i = 0; i < val.length; i++) {
if (FC.getRcMapLetters().indexOf(strBuffer[i]) < 0)
return false;
if (duplicityBuffer.indexOf(strBuffer[i]) < 0)
duplicityBuffer.push(strBuffer[i]);
else
return false;
}
return true;
},
getServoMixInputNames: function () {
return [
'Stabilised Roll',

@ -38,7 +38,8 @@ var GUI_control = function () {
'setup',
'osd',
'profiles',
'advanced_tuning'
'advanced_tuning',
'mission_control'
];
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;

@ -20,7 +20,9 @@ var MSPCodes = {
MSP_POSITION_ESTIMATION_CONFIG: 16,
MSP_SET_POSITION_ESTIMATION_CONFIG: 17,
MSP_WP_MISSION_LOAD: 18,
MSP_WP_MISSION_SAVE: 19,
MSP_WP_GETINFO: 20,
MSP_RTH_AND_LAND_CONFIG: 21,
MSP_SET_RTH_AND_LAND_CONFIG: 22,
MSP_FW_CONFIG: 23,
@ -155,5 +157,16 @@ var MSPCodes = {
MSPV2_SET_SETTING: 0x1004,
MSP2_COMMON_MOTOR_MIXER: 0x1005,
MSP2_COMMON_SET_MOTOR_MIXER: 0x1006
MSP2_COMMON_SET_MOTOR_MIXER: 0x1006,
MSPV2_INAV_STATUS: 0x2000,
MSPV2_INAV_OPTICAL_FLOW: 0x2001,
MSPV2_INAV_ANALOG: 0x2002,
MSPV2_INAV_MISC: 0x2003,
MSPV2_INAV_SET_MISC: 0x2004,
MSPV2_INAV_BATTERY_CONFIG: 0x2005,
MSPV2_INAV_SET_BATTERY_CONFIG: 0x2006,
MSPV2_INAV_RATE_PROFILE: 0x2007,
MSPV2_INAV_SET_RATE_PROFILE: 0x2008,
MSPV2_INAV_AIR_SPEED: 0x2009,
};

@ -42,11 +42,17 @@ var mspHelper = (function (gui) {
'BLACKBOX': 7,
'TELEMETRY_MAVLINK': 8,
'TELEMETRY_IBUS': 9,
'RUNCAM_DEVICE_CONTROL' : 10,
'RUNCAM_DEVICE_CONTROL': 10,
'TBS_SMARTAUDIO': 11,
'IRC_TRAMP': 12
};
// Required for MSP_DEBUGMSG because console.log() doesn't allow omitting
// the newline at the end, so we keep the pending message here until we find a
// '\0', then print it. Messages sent by MSP_DEBUGMSG are guaranteed to
// always finish with a '\0'.
var debugMsgBuffer = '';
/**
*
* @param {MSP} dataHandler
@ -225,11 +231,36 @@ var mspHelper = (function (gui) {
case MSPCodes.MSP_SONAR:
SENSOR_DATA.sonar = data.getInt32(0, true);
break;
case MSPCodes.MSPV2_INAV_AIR_SPEED:
SENSOR_DATA.air_speed = data.getInt32(0, true);
break;
case MSPCodes.MSP_ANALOG:
ANALOG.voltage = data.getUint8(0) / 10.0;
ANALOG.mAhdrawn = data.getUint16(1, true);
ANALOG.rssi = data.getUint16(3, true); // 0-1023
ANALOG.amperage = data.getInt16(5, true) / 100; // A
break;
case MSPCodes.MSPV2_INAV_ANALOG:
ANALOG.voltage = data.getUint16(offset, true) / 100.0;
offset += 2;
ANALOG.cell_count = data.getUint8(offset++);
ANALOG.battery_percentage = data.getUint8(offset++);
ANALOG.power = data.getUint16(offset, true);
offset += 2;
ANALOG.mAhdrawn = data.getUint16(offset, true);
offset += 2;
ANALOG.mWhdrawn = data.getUint16(offset, true);
offset += 2;
ANALOG.rssi = data.getUint16(offset, true); // 0-1023
offset += 2;
ANALOG.amperage = data.getInt16(offset, true) / 100; // A
offset += 2;
var battery_flags = data.getUint8(offset++);
ANALOG.battery_full_when_plugged_in = (battery_flags & 1 ? true : false);
ANALOG.use_capacity_thresholds = ((battery_flags & 2) >> 1 ? true : false);
ANALOG.battery_state = (battery_flags & 12) >> 2;
ANALOG.battery_remaining_capacity = data.getUint32(offset, true);
offset += 4;
//noinspection JSValidateTypes
dataHandler.analog_last_received_timestamp = Date.now();
break;
@ -255,6 +286,32 @@ var mspHelper = (function (gui) {
offset += 2;
RC_tuning.RC_YAW_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
break;
case MSPCodes.MSPV2_INAV_RATE_PROFILE:
// compat
RC_tuning.RC_RATE = 100;
RC_tuning.roll_pitch_rate = 0;
// throttle
RC_tuning.throttle_MID = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.throttle_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.dynamic_THR_PID = parseInt(data.getUint8(offset++));
RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset, true);
offset += 2;
// stabilized
RC_tuning.RC_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.RC_YAW_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.roll_rate = data.getUint8(offset++) * 10;
RC_tuning.pitch_rate = data.getUint8(offset++) * 10;
RC_tuning.yaw_rate = data.getUint8(offset++) * 10;
// manual
RC_tuning.manual_RC_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.manual_RC_YAW_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2));
RC_tuning.manual_roll_rate = data.getUint8(offset++);
RC_tuning.manual_pitch_rate = data.getUint8(offset++);
RC_tuning.manual_yaw_rate = data.getUint8(offset++);
break;
case MSPCodes.MSP_PID:
// PID data arrived, we need to scale it and save to appropriate bank / array
for (i = 0, needle = 0; i < (dataHandler.message_length_expected / 3); i++, needle += 3) {
@ -294,6 +351,60 @@ var mspHelper = (function (gui) {
MISC.vbatmaxcellvoltage = data.getUint8(offset++) / 10; // 10-50
MISC.vbatwarningcellvoltage = data.getUint8(offset++) / 10; // 10-50
break;
case MSPCodes.MSPV2_INAV_MISC:
MISC.midrc = data.getInt16(offset, true);
offset += 2;
MISC.minthrottle = data.getUint16(offset, true); // 0-2000
offset += 2;
MISC.maxthrottle = data.getUint16(offset, true); // 0-2000
offset += 2;
MISC.mincommand = data.getUint16(offset, true); // 0-2000
offset += 2;
MISC.failsafe_throttle = data.getUint16(offset, true); // 1000-2000
offset += 2;
MISC.gps_type = data.getUint8(offset++);
MISC.sensors_baudrate = data.getUint8(offset++);
MISC.gps_ubx_sbas = data.getInt8(offset++);
MISC.rssi_channel = data.getUint8(offset++);
MISC.mag_declination = data.getInt16(offset, 1) / 10; // -18000-18000
offset += 2;
MISC.vbatscale = data.getUint16(offset, true);
offset += 2;
MISC.vbatmincellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
MISC.vbatmaxcellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
MISC.vbatwarningcellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
MISC.battery_capacity = data.getUint32(offset, true);
offset += 4;
MISC.battery_capacity_warning = data.getUint32(offset, true);
offset += 4;
MISC.battery_capacity_critical = data.getUint32(offset, true);
offset += 4;
MISC.battery_capacity_unit = (data.getUint8(offset++) ? 'mWh' : 'mAh');
break;
case MSPCodes.MSPV2_INAV_BATTERY_CONFIG:
BATTERY_CONFIG.vbatscale = data.getUint16(offset, true);
offset += 2;
BATTERY_CONFIG.vbatmincellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
BATTERY_CONFIG.vbatmaxcellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
BATTERY_CONFIG.vbatwarningcellvoltage = data.getUint16(offset, true) / 100;
offset += 2;
BATTERY_CONFIG.current_offset = data.getUint16(offset, true);
offset += 2;
BATTERY_CONFIG.current_scale = data.getUint16(offset, true);
offset += 2;
BATTERY_CONFIG.capacity = data.getUint32(offset, true);
offset += 4;
BATTERY_CONFIG.capacity_warning = data.getUint32(offset, true);
offset += 4;
BATTERY_CONFIG.capacity_critical = data.getUint32(offset, true);
offset += 4;
BATTERY_CONFIG.battery_capacity_unit = (data.getUint8(offset++) ? 'mWh' : 'mAh');
break;
case MSPCodes.MSP_3D:
_3D.deadband3d_low = data.getUint16(offset, true);
offset += 2;
@ -340,7 +451,13 @@ var mspHelper = (function (gui) {
}
break;
case MSPCodes.MSP_WP:
console.log(data);
MISSION_PLANER.bufferPoint.number = data.getUint8(0);
MISSION_PLANER.bufferPoint.action = data.getUint8(1);
MISSION_PLANER.bufferPoint.lat = data.getInt32(2, true) / 10000000;
MISSION_PLANER.bufferPoint.lon = data.getInt32(6, true) / 10000000;
MISSION_PLANER.bufferPoint.alt = data.getInt32(10, true);
MISSION_PLANER.bufferPoint.p1 = data.getInt16(14, true);
break;
case MSPCodes.MSP_BOXIDS:
//noinspection JSUndeclaredVariable
@ -462,6 +579,19 @@ var mspHelper = (function (gui) {
console.log('Settings Saved in EEPROM');
break;
case MSPCodes.MSP_DEBUGMSG:
for (var ii = 0; ii < data.byteLength; ii++) {
var c = data.readU8();
if (c == 0) {
// End of message
if (debugMsgBuffer.length > 1) {
console.log('[DEBUG] ' + debugMsgBuffer);
DEBUG_TRACE = (DEBUG_TRACE || '') + debugMsgBuffer;
}
debugMsgBuffer = '';
continue;
}
debugMsgBuffer += String.fromCharCode(c);
}
break;
case MSPCodes.MSP_DEBUG:
for (i = 0; i < 4; i++)
@ -503,7 +633,7 @@ var mspHelper = (function (gui) {
BF_CONFIG.board_align_pitch = data.getInt16(8, true); // -180 - 360
BF_CONFIG.board_align_yaw = data.getInt16(10, true); // -180 - 360
BF_CONFIG.currentscale = data.getInt16(12, true);
BF_CONFIG.currentoffset = data.getUint16(14, true);
BF_CONFIG.currentoffset = data.getInt16(14, true);
break;
case MSPCodes.MSP_SET_BF_CONFIG:
console.log('BF_CONFIG saved');
@ -1147,6 +1277,23 @@ var mspHelper = (function (gui) {
case MSPCodes.MSPV2_SET_SETTING:
console.log("Setting set");
break;
case MSPCodes.MSP_WP_GETINFO:
// Reserved for waypoint capabilities data.getUint8(0);
MISSION_PLANER.maxWaypoints = data.getUint8(1);
MISSION_PLANER.isValidMission = data.getUint8(2);
MISSION_PLANER.countBusyPoints = data.getUint8(3);
break;
case MSPCodes.MSP_SET_WP:
console.log('Point saved');
break;
case MSPCodes.MSP_WP_MISSION_SAVE:
// buffer.push(0);
console.log(data);
break;
case MSPCodes.MSP_WP_MISSION_LOAD:
console.log('Mission load');
break;
default:
console.log('Unknown code detected: ' + dataHandler.code);
} else {
@ -1231,6 +1378,28 @@ var mspHelper = (function (gui) {
buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint));
buffer.push(Math.round(RC_tuning.RC_YAW_EXPO * 100));
break;
case MSPCodes.MSPV2_INAV_SET_RATE_PROFILE:
// throttle
buffer.push(Math.round(RC_tuning.throttle_MID * 100));
buffer.push(Math.round(RC_tuning.throttle_EXPO * 100));
buffer.push(RC_tuning.dynamic_THR_PID);
buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint));
buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint));
// stabilized
buffer.push(Math.round(RC_tuning.RC_EXPO * 100));
buffer.push(Math.round(RC_tuning.RC_YAW_EXPO * 100));
buffer.push(Math.round(RC_tuning.roll_rate / 10));
buffer.push(Math.round(RC_tuning.pitch_rate / 10));
buffer.push(Math.round(RC_tuning.yaw_rate / 10));
// manual
buffer.push(Math.round(RC_tuning.manual_RC_EXPO * 100));
buffer.push(Math.round(RC_tuning.manual_RC_YAW_EXPO * 100));
buffer.push(RC_tuning.manual_roll_rate);
buffer.push(RC_tuning.manual_pitch_rate);
buffer.push(RC_tuning.manual_yaw_rate);
break;
case MSPCodes.MSP_SET_RX_MAP:
for (i = 0; i < RC_MAP.length; i++) {
@ -1275,6 +1444,60 @@ var mspHelper = (function (gui) {
buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10));
buffer.push(Math.round(MISC.vbatwarningcellvoltage * 10));
break;
case MSPCodes.MSPV2_INAV_SET_MISC:
buffer.push(lowByte(MISC.midrc));
buffer.push(highByte(MISC.midrc));
buffer.push(lowByte(MISC.minthrottle));
buffer.push(highByte(MISC.minthrottle));
buffer.push(lowByte(MISC.maxthrottle));
buffer.push(highByte(MISC.maxthrottle));
buffer.push(lowByte(MISC.mincommand));
buffer.push(highByte(MISC.mincommand));
buffer.push(lowByte(MISC.failsafe_throttle));
buffer.push(highByte(MISC.failsafe_throttle));
buffer.push(MISC.gps_type);
buffer.push(MISC.sensors_baudrate);
buffer.push(MISC.gps_ubx_sbas);
buffer.push(MISC.rssi_channel);
buffer.push(lowByte(Math.round(MISC.mag_declination * 10)));
buffer.push(highByte(Math.round(MISC.mag_declination * 10)));
buffer.push(lowByte(MISC.vbatscale));
buffer.push(highByte(MISC.vbatscale));
buffer.push(lowByte(Math.round(MISC.vbatmincellvoltage * 100)));
buffer.push(highByte(Math.round(MISC.vbatmincellvoltage * 100)));
buffer.push(lowByte(Math.round(MISC.vbatmaxcellvoltage * 100)));
buffer.push(highByte(Math.round(MISC.vbatmaxcellvoltage * 100)));
buffer.push(lowByte(Math.round(MISC.vbatwarningcellvoltage * 100)));
buffer.push(highByte(Math.round(MISC.vbatwarningcellvoltage * 100)));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(MISC.battery_capacity, byte_index));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(MISC.battery_capacity_warning, byte_index));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(MISC.battery_capacity_critical, byte_index));
buffer.push((MISC.battery_capacity_unit == 'mAh') ? 0 : 1);
break;
case MSPCodes.MSPV2_INAV_SET_BATTERY_CONFIG:
buffer.push(lowByte(BATTERY_CONFIG.vbatscale));
buffer.push(highByte(BATTERY_CONFIG.vbatscale));
buffer.push(lowByte(Math.round(BATTERY_CONFIG.vbatmincellvoltage * 100)));
buffer.push(highByte(Math.round(BATTERY_CONFIG.vbatmincellvoltage * 100)));
buffer.push(lowByte(Math.round(BATTERY_CONFIG.vbatmaxcellvoltage * 100)));
buffer.push(highByte(Math.round(BATTERY_CONFIG.vbatmaxcellvoltage * 100)));
buffer.push(lowByte(Math.round(BATTERY_CONFIG.vbatwarningcellvoltage * 100)));
buffer.push(highByte(Math.round(BATTERY_CONFIG.vbatwarningcellvoltage * 100)));
buffer.push(lowByte(BATTERY_CONFIG.current_offset));
buffer.push(highByte(BATTERY_CONFIG.current_offset));
buffer.push(lowByte(BATTERY_CONFIG.current_scale));
buffer.push(highByte(BATTERY_CONFIG.current_scale));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(BATTERY_CONFIG.capacity, byte_index));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(BATTERY_CONFIG.capacity_warning, byte_index));
for (byte_index = 0; byte_index < 4; ++byte_index)
buffer.push(specificByte(BATTERY_CONFIG.capacity_critical, byte_index));
buffer.push(BATTERY_CONFIG.capacity_unit);
break;
case MSPCodes.MSP_SET_RX_CONFIG:
buffer.push(RX_CONFIG.serialrx_provider);
@ -1627,6 +1850,44 @@ var mspHelper = (function (gui) {
buffer.push(SENSOR_CONFIG.opflow);
break;
case MSPCodes.MSP_SET_WP:
buffer.push(MISSION_PLANER.bufferPoint.number); // sbufReadU8(src); // number
buffer.push(MISSION_PLANER.bufferPoint.action); // sbufReadU8(src); // action
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lat, 0)); // sbufReadU32(src); // lat
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lat, 1));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lat, 2));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lat, 3));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lon, 0)); // sbufReadU32(src); // lon
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lon, 1));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lon, 2));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.lon, 3));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.alt, 0)); // sbufReadU32(src); // to set altitude (cm)
buffer.push(specificByte(MISSION_PLANER.bufferPoint.alt, 1));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.alt, 2));
buffer.push(specificByte(MISSION_PLANER.bufferPoint.alt, 3));
buffer.push(lowByte(MISSION_PLANER.bufferPoint.p1)); //sbufReadU16(src); // P1 speed or landing
buffer.push(highByte(MISSION_PLANER.bufferPoint.p1));
buffer.push(lowByte(0)); //sbufReadU16(src); // P2
buffer.push(highByte(0));
buffer.push(lowByte(0)); //sbufReadU16(src); // P3
buffer.push(highByte(0));
buffer.push(MISSION_PLANER.bufferPoint.endMission); //sbufReadU8(src); // future: to set nav flag
break;
case MSPCodes.MSP_WP:
console.log(MISSION_PLANER.bufferPoint.number);
buffer.push(MISSION_PLANER.bufferPoint.number+1);
break;
case MSPCodes.MSP_WP_MISSION_SAVE:
// buffer.push(0);
console.log(buffer);
break;
case MSPCodes.MSP_WP_MISSION_LOAD:
// buffer.push(0);
console.log(buffer);
break;
default:
return false;
}
@ -2149,7 +2410,7 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, callback);
};
self.loadINAVPidConfig = function(callback) {
self.loadINAVPidConfig = function (callback) {
if (semver.gt(CONFIG.flightControllerVersion, "1.3.0")) {
MSP.send_message(MSPCodes.MSP_INAV_PID, false, false, callback);
} else {
@ -2161,7 +2422,7 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_LOOP_TIME, false, false, callback);
};
self.loadAdvancedConfig = function(callback) {
self.loadAdvancedConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.3.0")) {
MSP.send_message(MSPCodes.MSP_ADVANCED_CONFIG, false, false, callback);
} else {
@ -2189,6 +2450,10 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_RC_TUNING, false, false, callback);
};
self.loadRateProfileData = function (callback) {
MSP.send_message(MSPCodes.MSPV2_INAV_RATE_PROFILE, false, false, callback);
};
self.loadPidData = function (callback) {
MSP.send_message(MSPCodes.MSP_PID, false, false, callback);
};
@ -2213,6 +2478,14 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_MISC, false, false, callback);
};
self.loadMiscV2 = function (callback) {
MSP.send_message(MSPCodes.MSPV2_INAV_MISC, false, false, callback);
};
self.loadBatteryConfig = function (callback) {
MSP.send_message(MSPCodes.MSPV2_BATTERY_CONFIG, false, false, callback);
};
self.loadArmingConfig = function (callback) {
MSP.send_message(MSPCodes.MSP_ARMING_CONFIG, false, false, callback);
};
@ -2309,6 +2582,10 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_SET_RC_TUNING, mspHelper.crunch(MSPCodes.MSP_SET_RC_TUNING), false, callback);
};
self.saveRateProfileData = function (callback) {
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, callback);
};
self.savePidAdvanced = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) {
MSP.send_message(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED), false, callback);
@ -2325,6 +2602,14 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP_SET_MISC, mspHelper.crunch(MSPCodes.MSP_SET_MISC), false, callback);
};
self.saveMiscV2 = function (callback) {
MSP.send_message(MSPCodes.MSPV2_INAV_SET_MISC, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_MISC), false, callback);
};
self.saveBatteryConfig = function (callback) {
MSP.send_message(MSPCodes.MSPV2_SET_BATTERY_CONFIG, mspHelper.crunch(MSPCodes.MSPV2_SET_BATTERY_CONFIG), false, callback);
};
self.save3dConfig = function (callback) {
MSP.send_message(MSPCodes.MSP_SET_3D, mspHelper.crunch(MSPCodes.MSP_SET_3D), false, callback);
};
@ -2342,7 +2627,7 @@ var mspHelper = (function (gui) {
};
self.saveRxConfig = function (callback) {
if(semver.gte(CONFIG.apiVersion, "1.21.0")) {
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
MSP.send_message(MSPCodes.MSP_SET_RX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_RX_CONFIG), false, callback);
} else {
callback();
@ -2350,7 +2635,7 @@ var mspHelper = (function (gui) {
};
self.saveSensorConfig = function (callback) {
if(semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
MSP.send_message(MSPCodes.MSP_SET_SENSOR_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_SENSOR_CONFIG), false, callback);
} else {
callback();
@ -2437,20 +2722,28 @@ var mspHelper = (function (gui) {
}
};
self._getSetting = function(name) {
self.getMissionInfo = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, callback);
} else {
callback();
}
};
self._getSetting = function (name) {
var promise;
if (this._settings) {
promise = Promise.resolve(this._settings);
} else {
promise = new Promise(function(resolve, reject) {
promise = new Promise(function (resolve, reject) {
var $this = this;
$.ajax({
url: chrome.runtime.getURL('/resources/settings.json'),
dataType: 'json',
error: function(jqXHR, text, error) {
error: function (jqXHR, text, error) {
reject(error);
},
success: function(data) {
success: function (data) {
$this._settings = data;
resolve(data);
}
@ -2462,19 +2755,19 @@ var mspHelper = (function (gui) {
});
};
self._encodeSettingName = function(name, data) {
self._encodeSettingName = function (name, data) {
for (var ii = 0; ii < name.length; ii++) {
data.push(name.charCodeAt(ii));
}
data.push(0);
};
self.getSetting = function(name, callback) {
self.getSetting = function (name, callback) {
var $this = this;
return this._getSetting(name).then(function (setting) {
var data = [];
$this._encodeSettingName(name, data);
MSP.send_message(MSPCodes.MSPV2_SETTING, data, false, function(resp) {
MSP.send_message(MSPCodes.MSPV2_SETTING, data, false, function (resp) {
var value;
switch (setting.type) {
case "uint8_t":
@ -2511,7 +2804,7 @@ var mspHelper = (function (gui) {
});
};
self.encodeSetting = function(name, value) {
self.encodeSetting = function (name, value) {
var $this = this;
return this._getSetting(name).then(function (setting) {
if (setting.table) {
@ -2554,15 +2847,15 @@ var mspHelper = (function (gui) {
});
};
self.setSetting = function(name, value, callback) {
self.setSetting = function (name, value, callback) {
this.encodeSetting(name, value).then(function (data) {
MSP.send_message(MSPCodes.MSPV2_SET_SETTING, data, false, callback);
});
};
self.getRTC = function(callback) {
self.getRTC = function (callback) {
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
MSP.send_message(MSPCodes.MSP_RTC, false, false, function(resp) {
MSP.send_message(MSPCodes.MSP_RTC, false, false, function (resp) {
var seconds = resp.data.read32();
var millis = resp.data.readU16();
if (callback) {
@ -2574,7 +2867,7 @@ var mspHelper = (function (gui) {
}
};
self.setRTC = function(callback) {
self.setRTC = function (callback) {
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
var now = Date.now();
var secs = now / 1000;

@ -61,18 +61,31 @@ helper.periodicStatusUpdater = (function () {
}
if (ANALOG != undefined) {
var nbCells = Math.floor(ANALOG.voltage / MISC.vbatmaxcellvoltage) + 1;
var nbCells;
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
nbCells = ANALOG.cell_count;
} else {
nbCells = Math.floor(ANALOG.voltage / MISC.vbatmaxcellvoltage) + 1;
if (ANALOG.voltage == 0)
nbCells = 1;
}
var min = MISC.vbatmincellvoltage * nbCells;
var max = MISC.vbatmaxcellvoltage * nbCells;
var warn = MISC.vbatwarningcellvoltage * nbCells;
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
$(".battery-status").css({
width: ANALOG.battery_percentage + "%",
display: 'inline-block'
});
} else {
$(".battery-status").css({
width: ((ANALOG.voltage - min) / (max - min) * 100) + "%",
display: 'inline-block'
});
}
if (active) {
$(".linkicon").css({
@ -84,7 +97,7 @@ helper.periodicStatusUpdater = (function () {
});
}
if (ANALOG.voltage < warn) {
if (((semver.gte(CONFIG.flightControllerVersion, '1.8.1')) && (((ANALOG.use_capacity_thresholds) && (ANALOG.battery_remaining_capacity <= (MISC.battery_capacity_warning - MISC.battery_capacity_critical))) || ((!ANALOG.use_capacity_thresholds) && (ANALOG.voltage < warn))) || (ANALOG.voltage < min)) || ((semver.lt(CONFIG.flightControllerVersion, '1.8.1')) && (ANALOG.voltage < warn))) {
$(".battery-status").css('background-color', '#D42133');
} else {
$(".battery-status").css('background-color', '#59AA29');
@ -123,7 +136,11 @@ helper.periodicStatusUpdater = (function () {
MSP.send_message(MSPCodes.MSP_STATUS, false, false);
}
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
MSP.send_message(MSPCodes.MSPV2_INAV_ANALOG, false, false);
} else {
MSP.send_message(MSPCodes.MSP_ANALOG, false, false);
}
privateScope.updateView();
}

@ -1107,6 +1107,17 @@ dialog {
opacity: 0.5;
}
.content_toolbar .btn-danger a {
background-color: #db250e;
border: 1px solid #b5480e;
}
.content_toolbar .btn-danger a:hover {
background-color: #b5480e;
transition: all ease 0.2s;
}
.toolbar_scroll_bottom .content_wrapper {
/* content wrapper in view with toolbar in scroll bottom
leave 50px space for the toolbar
@ -1658,7 +1669,7 @@ dialog {
color: white;
font-size: 10px;
margin-top: 20px;
width: 90px;
width: 100px;
float: right;
margin-right: 20px;
line-height: 12px;
@ -1750,6 +1761,7 @@ dialog {
.bottomStatusIcons {
background-color: #272727;
height: 31px;
margin-left: 5px;
margin-top: 2px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;

@ -1,9 +1,11 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="./build/styles.css" media="all"/>
<script type="text/javascript" src="./build/script.js"></script>
<link type="text/css" rel="stylesheet" href="./build/map.css" media="all"/>
<script type="text/javascript" src="./build/map.js"></script>
<title></title>
</head>
<body>
@ -14,7 +16,8 @@
<div class="modal__text" data-i18n="appUpdateNotificationDescription"></div>
</div>
<div class="modal__buttons modal__buttons--upbottom">
<a href="https://github.com/iNavFlight/inav-configurator/releases" target="_blank" id="update-notification-download" class="modal__button modal__button--main modal__button--main--inline" data-i18n="downloadUpdatesBtn"></a>
<a href="https://github.com/iNavFlight/inav-configurator/releases" target="_blank" id="update-notification-download"
class="modal__button modal__button--main modal__button--main--inline" data-i18n="downloadUpdatesBtn"></a>
<a id="update-notification-close" class="modal__button modal__button--main modal__button--main--inline" data-i18n="closeUpdateBtn"></a>
</div>
</div>
@ -185,6 +188,7 @@
<li class="tab_servos"><a href="#" data-i18n="tabServos" class="tabicon ic_servo" title="Servos"></a>
</li>
<li class="tab_gps"><a href="#" data-i18n="tabGPS" class="tabicon ic_gps" title="GPS"></a></li>
<li class="tab_mission_control"><a href="#" data-i18n="tabMissionControl" class="tabicon ic_mission" title="Mission Control"></a></li>
<li class="tab_motors"><a href="#" data-i18n="tabMotorTesting" class="tabicon ic_motor"
title="Motors"></a></li>
<li class="tab_osd"><a href="#" data-i18n="tabOSD" class="tabicon ic_osd" title="OSD"></a></li>
@ -199,7 +203,6 @@
title="Onboard Logging"></a></li>
<li class="tab_cli"><a href="#" data-i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
<!--<li class=""><a href="#" class="tabicon ic_mission">Mission (spare icon)</a></li>-->
<!--<li class=""><a href="#" class="tabicon ic_advanced">Advanced (spare icon)</a></li>-->
<!--<li class=""><a href="#" class="tabicon ic_wizzard">Wizzard (spare icon)</a></li>-->
</ul>

@ -59,9 +59,20 @@ $(document).ready(function () {
}
});
win.setMinimumSize(1024, 800);
win.on('close', function () {
//Save window size and position
var currentWin = this;
// var height = win.height;
// var width = win.width;
//
// if (height < 400) {
// height = 400
// }
// if (width < 512) {
// width = 512
// }
chrome.storage.local.set({'windowSize': {height: win.height, width: win.width, x: win.x, y: win.y}}, function () {
// Notify that we saved.
console.log('Settings saved');
@ -189,6 +200,9 @@ $(document).ready(function () {
case 'gps':
TABS.gps.initialize(content_ready);
break;
case 'mission_control':
TABS.mission_control.initialize(content_ready);
break;
case 'motors':
TABS.motors.initialize(content_ready);
break;

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"minimum_chrome_version": "38",
"version": "1.8.1",
"version": "1.9.3",
"author": "Several",
"name": "INAV - Configurator",
"short_name": "INAV",

2282
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
{
"name": "inav-configurator",
"description": "INAV Configurator",
"version": "1.8.1",
"version": "1.9.3",
"main": "main.html",
"default_locale": "en",
"scripts": {
@ -29,8 +29,9 @@
"inflection": "1.12.0",
"jquery": "2.1.4",
"jquery-ui-npm": "1.12.0",
"nw": "^0.25.4",
"nw-builder": "^3.5.1",
"marked": "^0.3.17",
"nw": "^0.25.4-sdk",
"nw-builder": "^3.4.1",
"openlayers": "^4.6.4",
"run-sequence": "^2.2.0",
"temp": "^0.8.3",

@ -2179,49 +2179,49 @@ MAX7456
01010101
01010101
01010101
00010101
01010101
01010100
10000001
01010101
01010010
10001000
00010101
01001010
10101010
10000101
01010010
10001000
10100001
01010100
10000001
00100001
01010101
00010100
00100001
01010101
01010010
10100001
01010100
00001010
00000101
01010010
10101000
01010101
01010010
00000001
01010101
01010010
00000001
01010101
01010010
10101000
01010101
01010100
00001010
00010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
01010101
01010101
01010101
@ -10946,10 +10946,54 @@ MAX7456
01010101
01010101
01010101
01010000
00010100
00000101
01010010
00010100
10000101
01010010
00000000
10000101
01010010
00000000
10000101
01010010
00101000
10000101
01010000
10101010
00000101
01010100
10000010
00010101
01010100
00000000
00010101
01010100
00000101
01010101
01010100
10000101
01010101
01010100
10000000
01010101
01010100
10001000
01010101
01010100
10100010
00010101
01010100
10000010
00010101
01010100
10000010
00010101
01010100
00000000
00010101
01010101
01010101
01010101
@ -10964,21 +11008,56 @@ MAX7456
01010101
01010101
01010101
01010001
01010100
01010101
01001000
01010010
01010101
01001000
01010010
01010101
01001000
00000010
01010101
01001000
10100010
01010101
01010010
10101000
01010101
01010010
00001000
01010101
01010100
01010001
01010101
00000000
00000000
01010100
10101010
10101010
01010101
00000000
00000000
01010101
01010100
00010000
01010101
01010010
00001000
01010101
01010010
00100000
01010101
01010010
10100000
01010101
01010010
00001000
01010101
01010100
00000000
01010101
01010101
01010101
@ -10992,135 +11071,56 @@ MAX7456
01010101
01010101
01010101
01000001
01010101
01010101
00100001
01010101
01010101
00100000
01010101
01010101
00100010
00010101
01010101
00101000
10000101
01010101
00100000
10000101
01010101
00100000
10000101
01010101
01000101
00010101
01010101
00000000
00000000
01010101
10101010
10101010
00010101
00000000
00000000
01010101
00000100
00010101
01010101
00100010
00010101
01010101
10001000
10000101
01010101
10001000
10000101
01010101
10000000
10000101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
00010101
00010101
01010101
01010101
01010101

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

@ -2179,49 +2179,49 @@ MAX7456
01010101
01010101
01010101
00010101
01010101
01010100
10000001
01010101
01010010
10001000
00010101
01001010
10101010
10000101
01010010
10001000
10100001
01010100
10000001
00100001
01010101
00010100
00100001
01010101
01010010
10100001
01010100
00001010
00000101
01010010
10101000
01010101
01010010
00000001
01010101
01010010
00000001
01010101
01010010
10101000
01010101
01010100
00001010
00010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
01010101
01010101
01010101
@ -10946,15 +10946,53 @@ MAX7456
01010101
01010101
01010101
01010100
01010101
00010101
01010010
00010100
10000101
01010010
00010100
10000101
01010010
00000000
10000101
01010010
00101000
10000101
01010100
10101010
00010101
01010100
10000010
00010101
01010101
00010100
01010101
01010101
00010101
01010101
01010100
10000101
01010101
01010100
10000001
01010101
01010100
10001000
01010101
01010100
10100010
00010101
01010100
10000010
00010101
01010100
10000010
00010101
01010101
00010100
01010101
01010101
01010101
@ -10970,21 +11008,56 @@ MAX7456
01010101
01010101
01010101
01010001
01010100
01010101
01001000
01010010
01010101
01001000
01010010
01010101
01001000
00000010
01010101
01001000
10100010
01010101
01010010
10101000
01010101
01010010
00001000
01010101
01010100
01010001
01010101
00000000
00000000
01010100
10101010
10101010
01010101
00000000
00000000
01010101
01010100
00010000
01010101
01010010
00001000
01010101
01010010
00100000
01010101
01010010
10100000
01010101
01010010
00001000
01010101
01010100
00000000
01010101
01010101
01010101
@ -10998,129 +11071,56 @@ MAX7456
01010101
01010101
01010101
01000001
01010101
01010101
00100001
01010101
01010101
00100000
01010101
01010101
00100010
00010101
01010101
00101000
10000101
01010101
00100000
10000101
01010101
00100000
10000101
01010101
01000101
00010101
01010101
00000000
00000000
01010101
10101010
10101010
00010101
00000000
00000000
01010101
00000100
00010101
01010101
00100010
00010101
01010101
10001000
10000101
01010101
10001000
10000101
01010101
10000000
10000101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
00010101
00010101
01010101
01010101
01010101

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

@ -2179,49 +2179,49 @@ MAX7456
01010101
01010101
01010101
00010101
01010101
01010100
10000001
01010101
01010010
10001000
00010101
01001010
10101010
10000101
01010010
10001000
10100001
01010100
10000001
00100001
01010101
00010100
00100001
01010101
01010010
10100001
01010100
00001010
00000101
01010010
10101000
01010101
01010010
00000001
01010101
01010010
00000001
01010101
01010010
10101000
01010101
01010100
00001010
00010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010000
01010101
01010101
01010101
@ -10946,15 +10946,53 @@ MAX7456
01010101
01010101
01010101
01010100
01010101
00010101
01010010
00010100
10000101
01010010
00010100
10000101
01010010
00000000
10000101
01010010
00101000
10000101
01010100
10101010
00010101
01010100
10000010
00010101
01010101
00010100
01010101
01010101
00010101
01010101
01010100
10000101
01010101
01010100
10000001
01010101
01010100
10001000
01010101
01010100
10100010
00010101
01010100
10000010
00010101
01010100
10000010
00010101
01010101
00010100
01010101
01010101
01010101
@ -10970,21 +11008,56 @@ MAX7456
01010101
01010101
01010101
01010001
01010100
01010101
01001000
01010010
01010101
01001000
01010010
01010101
01001000
00000010
01010101
01001000
10100010
01010101
01010010
10101000
01010101
01010010
00001000
01010101
01010100
01010001
01010101
00000000
00000000
01010100
10101010
10101010
01010101
00000000
00000000
01010101
01010100
00010000
01010101
01010010
00001000
01010101
01010010
00100000
01010101
01010010
10100000
01010101
01010010
00001000
01010101
01010100
00000000
01010101
01010101
01010101
@ -10998,129 +11071,56 @@ MAX7456
01010101
01010101
01010101
01000001
01010101
01010101
00100001
01010101
01010101
00100000
01010101
01010101
00100010
00010101
01010101
00101000
10000101
01010101
00100000
10000101
01010101
00100000
10000101
01010101
01000101
00010101
01010101
00000000
00000000
01010101
10101010
10101010
00010101
00000000
00000000
01010101
00000100
00010101
01010101
00100010
00010101
01010101
10001000
10000101
01010101
10001000
10000101
01010101
10000000
10000101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
01010101
00010101
00010101
01010101
01010101
01010101

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

@ -0,0 +1,127 @@
.tab-mission-control .btn a {
/* common styles for content toolbar buttons */
/*margin-top: 0;*/
/*margin-bottom: 0;*/
/*margin-right: 20px;*/
background-color: #37a8db;
border-radius: 3px;
border: 1px solid #3394b5;
color: #fff;
/*float: right;*/
font-family: 'open_sansbold', Arial, serif;
font-size: 12px;
text-shadow: 0 1px rgba(0, 0, 0, 0.25);
display: block;
cursor: pointer;
transition: all ease 0.2s;
padding: 0 9px;
line-height: 28px;
margin: 5px;
float: left;
width: 130px;
text-align: center;
}
.tab-mission-control .btn a:hover {
background-color: #3394b5;
transition: all ease 0.2s;
}
.tab-mission-control .btn a:active {
background-color: #37a8db;
transition: all ease 0.0s;
box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.35);
}
.tab-mission-control .btn a.disabled {
cursor: default;
color: #fff;
background-color: #AFAFAF;
border: 1px solid #AFAFAF;
pointer-events: none;
text-shadow: none;
opacity: 0.5;
}
.tab-mission-control .btn-danger a {
background-color: #db250e;
border: 1px solid #b5480e;
}
.tab-mission-control .btn-danger a:hover {
background-color: #b5480e;
transition: all ease 0.2s;
}
.tab-mission-control .checksfail {
/*float: right;*/
margin-top: 3px;
height: 15px;
width: 15px;
background-image:url(../../../images/icons/nopass.svg);
background-size:contain;
background-position:center;
background-repeat:no-repeat;
}
.tab-mission-control .content_wrapper {
display: flex;
/*height: 150px;*/
height: 90%;
/*width: 75%;*/
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
padding-bottom: 5px;
padding-top: 5px;
}
.tab-mission-control {
height: 100%;
}
#missionMap {
height: 100%;
}
.tab-mission-control input {
width: 115px;
padding-left: 3px;
height: 20px;
line-height: 20px;
text-align: left;
border: 1px solid silver;
border-radius: 3px;
font-size: 12px;
font-weight: normal;
}
.tab-mission-control select {
width: 118px;
padding-left: 3px;
height: 20px;
line-height: 20px;
text-align: left;
border: 1px solid silver;
border-radius: 3px;
font-size: 12px;
font-weight: normal;
}
.tab-mission-control .point {
display: block;
margin-bottom: 5px;
margin-left: 5px;
}
.tab-mission-control .point-label {
width: 60px;
display: inline-block;
}
.mission-control-settings {
top: 65px;
left: .5em;
}
.ol-touch .mission-control-settings {
top: 80px;
}

@ -176,6 +176,7 @@
color: white;
border-right: 1px solid silver;
font-weight: normal;
width: 50%;
}
.tab-receiver .tunings table th:first-child {

@ -167,3 +167,13 @@
.tab-sensors .legend .item:nth-child(4) {
fill: #4DA74D;
}
.tab-sensors a.debug-trace {
float: right;
margin-right: 1em;
font-size: 90%;
}
.tab-sensors a.debug-trace:hover {
text-decoration: underline;
}

@ -70,6 +70,10 @@ TABS.adjustments.initialize = function (callback) {
availableFunctionCount = 21;
}
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
availableFunctionCount = 32;
}
var functionListOptions = $(functionListOptions).slice(0,availableFunctionCount);
functionList.empty().append(functionListOptions);

@ -64,8 +64,8 @@
<tr>
<td data-i18n="accGain"></td>
<td><label for="accGainX"><span>X</span></label><input type="number" name="accGainX" min="0" max="2000"></td>
<td><label for="accGainX"><span>Y</span></label><input type="number" name="accGainX" min="0" max="2000"></td>
<td><label for="accGainX"><span>Z</span></label><input type="number" name="accGainX" min="0" max="2000"></td>
<td><label for="accGainY"><span>Y</span></label><input type="number" name="accGainY" min="0" max="2000"></td>
<td><label for="accGainZ"><span>Z</span></label><input type="number" name="accGainZ" min="0" max="2000"></td>
</tr>
</table>
</div>

@ -55,6 +55,7 @@ TABS.calibration.initialize = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
loadChainer.setChain([
mspHelper.loadStatus,
mspHelper.loadSensorConfig,
mspHelper.loadCalibrationData
]);
loadChainer.setExitPoint(loadHtml);
@ -111,7 +112,7 @@ TABS.calibration.initialize = function (callback) {
var pos = ['X', 'Y', 'Z'];
pos.forEach(function (item) {
$('[name=accGain' + item + ']').val(CALIBRATION_DATA.accGain[item]);
$('[name=accZero' + item + ']').val(CALIBRATION_DATA.accGain[item]);
$('[name=accZero' + item + ']').val(CALIBRATION_DATA.accZero[item]);
$('[name=Mag' + item + ']').val(CALIBRATION_DATA.magZero[item]);
});
updateCalibrationSteps();

@ -271,14 +271,6 @@
<div class="features esc"></div>
<!--list of generated features goes here-->
<div class="checkbox">
<input type="checkbox" id="disarmkillswitch" name="disarmkillswitch" class="toggle" />
<label for="disarmkillswitch">
<span data-i18n="configurationDisarmKillSwitch"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="configurationDisarmKillSwitchHelp"></div>
</div>
<div class="number disarmdelay" style="display: none; margin-bottom: 5px;">
<input type="number" id="autodisarmdelay" name="autodisarmdelay" min="0" max="60" />
<label for="autodisarmdelay">
@ -295,7 +287,7 @@
</label>
</div>
<div class="number">
<input type="number" id="midthrottle" name="midthrottle" min="0" max="2000" />
<input type="number" id="midthrottle" name="midthrottle" min="1200" max="1700" />
<label for="midthrottle">
<span data-i18n="configurationThrottleMid"></span>
</label>
@ -382,23 +374,23 @@
<!--list of generated features goes here-->
<div class="number">
<input type="number" id="mincellvoltage" name="mincellvoltage" step="0.1" min="1" max="5" />
<input type="number" id="mincellvoltage" name="mincellvoltage" step="0.01" min="1" max="5" />
<label for="mincellvoltage"><span data-i18n="configurationBatteryMinimum"></span></label>
</div>
<div class="number">
<input type="number" id="maxcellvoltage" name="maxcellvoltage" step="0.1" min="1" max="5" />
<input type="number" id="maxcellvoltage" name="maxcellvoltage" step="0.01" min="1" max="5" />
<label for="maxcellvoltage">
<span data-i18n="configurationBatteryMaximum"></span>
</label>
</div>
<div class="number">
<input type="number" id="warningcellvoltage" name="warningcellvoltage" step="0.1" min="1" max="5" />
<input type="number" id="warningcellvoltage" name="warningcellvoltage" step="0.01" min="1" max="5" />
<label for="warningcellvoltage">
<span data-i18n="configurationBatteryWarning"></span>
</label>
</div>
<div class="number">
<input type="number" id="voltagescale" name="voltagescale" step="1" min="10" max="255" />
<input type="number" id="voltagescale" name="voltagescale" step="1" min="10" max="65535" />
<label for="voltagescale">
<span data-i18n="configurationBatteryScale"></span>
</label>
@ -426,7 +418,7 @@
</label>
</div>
<div class="number">
<input type="number" id="currentoffset" name="currentoffset" step="1" min="0" max="3300" />
<input type="number" id="currentoffset" name="currentoffset" step="1" min="-3300" max="3300" />
<label for="currentoffset">
<span data-i18n="configurationCurrentOffset"></span>
</label>
@ -437,10 +429,35 @@
<span data-i18n="configurationBatteryCurrent"></span>
</label>
</div>
<div class="checkbox">
<input type="checkbox" id="multiwiicurrentoutput" name="multiwiicurrentoutput" class="toggle" />
<label for="multiwiicurrentoutput">
<span data-i18n="configurationBatteryMultiwiiCurrent"></span>
</div>
</div>
<div class="config-section gui_box grey requires-v1_8_1">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="configurationBatteryCapacity"></div>
</div>
<div class="spacer_box">
<div class="select">
<select id="battery_capacity_unit">
<option value="mAh">mAh</option>
<option value="mWh">mWh</option>
</select>
</div>
<div class="number">
<input type="number" id="battery_capacity" name="battery_capacity" step="1" min="0" max="4294967296" />
<label for="battery_capacity">
<span data-i18n="configurationBatteryCapacityValue"></span>
</label>
</div>
<div class="number">
<input type="number" id="battery_capacity_warning" name="battery_capacity_warning" step="1" min="0" max="100" />
<label for="battery_capacity_warning">
<span data-i18n="configurationBatteryCapacityWarning"></span>
</label>
</div>
<div class="number">
<input type="number" id="battery_capacity_critical" name="battery_capacity_critical" step="1" min="0" max="100" />
<label for="battery_capacity_critical">
<span data-i18n="configurationBatteryCapacityCritical"></span>
</label>
</div>
</div>

@ -24,9 +24,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
var loadChain = [
mspHelper.loadBfConfig,
mspHelper.loadMisc,
mspHelper.loadArmingConfig,
mspHelper.loadLoopTime,
mspHelper.loadRxConfig,
@ -36,15 +35,22 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper.loadINAVPidConfig,
mspHelper.loadSensorConfig,
loadCraftName
]);
];
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
loadChain.push(mspHelper.loadMiscV2);
} else {
loadChain.push(mspHelper.loadMisc);
}
loadChainer.setChain(loadChain);
loadChainer.setExitPoint(load_html);
loadChainer.execute();
var saveChainer = new MSPChainerClass();
saveChainer.setChain([
var saveChain = [
mspHelper.saveBfConfig,
mspHelper.saveMisc,
mspHelper.save3dConfig,
mspHelper.saveSensorAlignment,
mspHelper.saveAccTrim,
@ -55,8 +61,17 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper.saveINAVPidConfig,
mspHelper.saveSensorConfig,
saveCraftName,
mspHelper.saveToEeprom
]);
];
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
saveChain.push(mspHelper.saveMiscV2);
} else {
saveChain.push(mspHelper.saveMisc);
}
saveChain.push(mspHelper.saveToEeprom);
saveChainer.setChain(saveChain);
saveChainer.setExitPoint(reboot);
function reboot() {
@ -295,7 +310,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
//fill motor disarm params and FC loop time
$('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay);
$('input[name="disarmkillswitch"]').prop('checked', ARMING_CONFIG.disarm_kill_switch);
$('div.disarm').show();
if(bit_check(BF_CONFIG.features, 4)) {//MOTOR_STOP
$('div.disarmdelay').show();
@ -309,7 +323,15 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('#maxthrottle').val(MISC.maxthrottle);
$('#mincommand').val(MISC.mincommand);
// fill battery
// Battery thresholds resolution is 100mV and voltage scale max is 255 before 1.8.1
if (semver.lt(CONFIG.flightControllerVersion, '1.8.1')) {
$('#mincellvoltage').attr('step', '0.1');
$('#maxcellvoltage').attr('step', '0.1');
$('#warningcellvoltage').attr('step', '0.1');
$('#voltagescale').attr('max', '255');
}
// fill battery voltage
$('#mincellvoltage').val(MISC.vbatmincellvoltage);
$('#maxcellvoltage').val(MISC.vbatmaxcellvoltage);
$('#warningcellvoltage').val(MISC.vbatwarningcellvoltage);
@ -318,7 +340,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// fill current
$('#currentscale').val(BF_CONFIG.currentscale);
$('#currentoffset').val(BF_CONFIG.currentoffset);
$('#multiwiicurrentoutput').prop('checked', MISC.multiwiicurrentoutput);
// fill battery capacity
$('#battery_capacity').val(MISC.battery_capacity);
$('#battery_capacity_warning').val(MISC.battery_capacity_warning * 100 / MISC.battery_capacity);
$('#battery_capacity_critical').val(MISC.battery_capacity_critical * 100 / MISC.battery_capacity);
$('#battery_capacity_unit').val(MISC.battery_capacity_unit);
var escProtocols = FC.getEscProtocols();
var servoRates = FC.getServoRates();
@ -564,6 +591,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$(".requires-v1_7").hide();
}
if (semver.gte(CONFIG.flightControllerVersion, "1.8.1")) {
$(".requires-v1_8_1").show();
} else {
$(".requires-v1_8_1").hide();
}
$('#3ddeadbandlow').val(_3D.deadband3d_low);
$('#3ddeadbandhigh').val(_3D.deadband3d_high);
$('#3dneutral').val(_3D.neutral3d);
@ -629,7 +662,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MISC.mag_declination = parseFloat($('#mag_declination').val());
ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());
ARMING_CONFIG.disarm_kill_switch = ~~$('input[name="disarmkillswitch"]').is(':checked'); // ~~ boolean to decimal conversion
MISC.minthrottle = parseInt($('#minthrottle').val());
MISC.midrc = parseInt($('#midthrottle').val());
@ -641,9 +673,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MISC.vbatwarningcellvoltage = parseFloat($('#warningcellvoltage').val());
MISC.vbatscale = parseInt($('#voltagescale').val());
MISC.battery_capacity = parseInt($('#battery_capacity').val());
MISC.battery_capacity_warning = parseInt($('#battery_capacity_warning').val() * MISC.battery_capacity / 100);
MISC.battery_capacity_critical = parseInt($('#battery_capacity_critical').val() * MISC.battery_capacity / 100);
MISC.battery_capacity_unit = $('#battery_capacity_unit').val();
BF_CONFIG.currentscale = parseInt($('#currentscale').val());
BF_CONFIG.currentoffset = parseInt($('#currentoffset').val());
MISC.multiwiicurrentoutput = ~~$('#multiwiicurrentoutput').is(':checked'); // ~~ boolean to decimal conversion
_3D.deadband3d_low = parseInt($('#3ddeadbandlow').val());
_3D.deadband3d_high = parseInt($('#3ddeadbandhigh').val());
@ -713,7 +749,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
});
helper.interval.add('config_load_analog', function () {
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
$('#batteryvoltage').val([ANALOG.voltage.toFixed(2)]);
} else {
$('#batteryvoltage').val([ANALOG.voltage.toFixed(1)]);
}
$('#batterycurrent').val([ANALOG.amperage.toFixed(2)]);
}, 100, true); // 10 fps
GUI.content_ready(callback);

@ -0,0 +1,9 @@
<html>
<head>
<title>Debug Trace</title>
<script type="text/javascript" src="/build/debug-trace.js"></script>
</head>
<body>
<pre><code id="debug-trace"></code></pre>
</body>
</html>

@ -319,8 +319,12 @@ TABS.firmware_flasher.initialize = function (callback) {
$('div.release_info .status').text(summary.status);
$('div.release_info .file').text(summary.file).prop('href', summary.url);
var formattedNotes = summary.notes.trim('\r').replace(/\r/g, '<br />');
var formattedNotes = marked(summary.notes);
$('div.release_info .notes').html(formattedNotes);
// Make links in the release notes open in a new window
$('div.release_info .notes a').each(function () {
$(this).attr('target', '_blank');
});
$('div.release_info').slideDown();

@ -7,6 +7,7 @@
</div>
</div>
<div class="community">
<ul class="communityTelegramSupport"><a href="https://t.me/INAVFlight" target="_blank"><i class="fa fa-telegram" aria-hidden="true"></i><span i18n="communityTelegramSupport"></span></a></ul>
<ul class="communitySlackSupport"><a href="https://inavflight.signup.team/" target="_blank"><i class="fa fa-slack" aria-hidden="true"></i><span i18n="communitySlackSupport"></span></a></ul>
<ul class="communityRCGroupsSupport"><a href="https://www.rcgroups.com/forums/showthread.php?2495732-Cleanflight-iNav-%28navigation-rewrite%29-project" target="_blank"><i class="fa fa-users" aria-hidden="true"></i><span i18n="communityRCGroupsSupport"></span></a></ul>
</div>

@ -0,0 +1,119 @@
<div class="tab-mission-control">
<div style="padding-top: 20px;padding-left: 20px; padding-right: 20px;position: relative;">
<div class="tab_title" data-i18n="tabMissionControl">Mission planer</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/iNavFlight/inav/releases" target="_blank"></a>
</div>
</div>
<div class="content_wrapper">
<div class="cf_column fourth" id="missionControls">
<div class="spacer_right">
<div id="missionPlanerSettings" class="gui_box grey" style="display: none">
<div class="gui_box_titlebar">
<div class="spacer_box_title i18n-replaced" data-i18n="missionDefaultSettingsHead">Default settings</div>
</div>
<div class="spacer">
<div class="point">
<label class="point-label" for="pointAlt">Alt (cm): </label>
<input id="MPdefaultPointAlt" type="text" value="0" required>
</div>
<div class="point">
<label class="point-label" for="pointSpeed">Speed (cm/s): </label>
<input id="MPdefaultPointSpeed" type="text" value="0" required>
</div>
<div>
<div id="saveSettings" class="btn save_btn" style="padding-top: 10px; display: inline-block">
<a class="save" href="#" data-i18n="editPointButtonSave" style="float: left">Save</a>
</div>
</div>
</div>
</div>
<div id="missionPalnerTotalInfo" class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title i18n-replaced" data-i18n="missionTotalInformationHead">Total information</div>
</div>
<div class="spacer">
<div style="padding-bottom: 2px;">
<span>Distance (m):</span>
<span id="missionDistance"></span>
</div>
<div style="padding-bottom: 2px;">
<span>Available Points</span>
<span id="availablePoints">0/0</span>
</div>
<div style="padding-bottom: 2px;">
<span>Mission valid</span>
<div id="missionValid" style="display: inline-block"></div>
</div>
<br>
<div style="display: flex;">
<input type="checkbox" style="width: 18px;margin-left: 5px;" id="rthEndMission">
<label for="rthEndMission" style="padding: 2px;">RTH at the end of the mission</label>
</div>
<div id="rthSettings" style="display: none">
<div style="display: flex">
<input type="checkbox" id="rthLanding" style="width: 18px;margin-left: 5px;">
<label for="rthLanding" style="padding: 2px">Landing</label>
</div>
</div>
<hr>
<div class="btn save_btn">
<a id="loadMissionButton" class="save" href="#" data-i18n="loadMissionButton">Load mission from FC</a>
<a id="saveMissionButton" class="save" href="#" data-i18n="saveMissionButton">Save mission to FC</a>
<a id="loadEepromMissionButton" class="save" href="#" data-i18n="loadEepromMissionButton">Load Eeprom mission</a>
<a id="saveEepromMissionButton" class="save" href="#" data-i18n="saveEepromMissionButton">Save Eeprom mission</a>
</div>
<hr>
<div id="removeAllPoints" class="btn btn-danger" style="padding-top: 10px; display: inline-block">
<a class="save" href="#" data-i18n="removeAllPointButtonSave" style="float: left">Remove all points</a>
</div>
</div>
</div>
<div class="gui_box grey" id="MPeditPoint" style="display: none">
<div class="gui_box_titlebar">
<div class="spacer_box_title i18n-replaced" data-i18n="editPointHead">Edit point</div>
</div>
<div class="spacer">
<input type="hidden" name="pointNumber" value="">
<div class="point">
<label class="point-label" for="pointType">Type: </label>
<select name="type" id="pointType">
<!--<option value="1">Home</option>-->
<option value="1">Waypoint</option>
<!--<option value="4">RTH</option>-->
</select>
</div>
<div class="point">
<label class="point-label" for="pointLat">Lat: </label>
<input id="pointLat" type="text" value="0.0" required>
</div>
<div class="point">
<label class="point-label" for="pointLon">Lon: </label>
<input id="pointLon" type="text" value="0.0" required>
</div>
<div class="point">
<label class="point-label" for="pointAlt">Alt (cm): </label>
<input id="pointAlt" type="text" value="0" required>
</div>
<div class="point">
<label class="point-label" for="pointSpeed">Speed (cm/s): </label>
<input id="pointSpeed" type="text" value="0" required>
</div>
<div>
<div id="savePoint" class="btn save_btn" style="padding-top: 10px; display: inline-block">
<a class="save" href="#" data-i18n="editPointButtonSave" style="float: left">Save</a>
</div>
<div id="removePoint" class="btn btn-danger" style="padding-top: 10px; display: inline-block;">
<a class="save" href="#" data-i18n="editPointButtonRemove" style="float: left">Remove</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="cf_column threefourth_left">
<div id="missionMap"></div>
<div id="notLoadMap" data-i18n="useOnlyStandalone" style="display: none;"></div>
</div>
</div>
</div>

@ -0,0 +1,602 @@
'use strict';
TABS.mission_control = {};
TABS.mission_control.isYmapLoad = false;
TABS.mission_control.initialize = function (callback) {
if (GUI.active_tab != 'mission_control') {
GUI.active_tab = 'mission_control';
googleAnalytics.sendAppView('Mission Control');
}
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
mspHelper.getMissionInfo
]);
loadChainer.setExitPoint(loadHtml);
loadChainer.execute();
function updateTotalInfo() {
$('#availablePoints').text(MISSION_PLANER.countBusyPoints + '/' + MISSION_PLANER.maxWaypoints);
$('#missionValid').html(MISSION_PLANER.isValidMission ? chrome.i18n.getMessage('armingCheckPass') : chrome.i18n.getMessage('armingCheckFail'));
}
function loadHtml() {
$('#content').load("./tabs/mission_control.html", process_html);
}
function process_html() {
if (typeof require !== "undefined") {
chrome.storage.local.get('missionPlanerSettings', function (result) {
if (result.missionPlanerSettings) {
$('#MPdefaultPointAlt').val(result.missionPlanerSettings.alt);
$('#MPdefaultPointSpeed').val(result.missionPlanerSettings.speed);
} else {
chrome.storage.local.set({'missionPlanerSettings': {speed: 0, alt: 5000}});
$('#MPdefaultPointAlt').val(5000);
$('#MPdefaultPointSpeed').val(0);
}
});
initMap();
} else {
$('#missionMap, #missionControls').hide();
$('#notLoadMap').show();
}
localize();
GUI.content_ready(callback);
}
var markers = [];
var lines = [];
var map;
var selectedMarker = null;
var pointForSend = 0;
function clearEditForm() {
$('#pointLat').val('');
$('#pointLon').val('');
$('#pointAlt').val('');
$('#pointSpeed').val('');
$('[name=pointNumber]').val('');
$('#MPeditPoint').fadeOut(300);
}
function repaint() {
var oldPos;
for (var i in lines) {
map.removeLayer(lines[i]);
}
lines = [];
$('#missionDistance').text(0);
map.getLayers().forEach(function (t) {
//feature.getGeometry().getType()
if (t instanceof ol.layer.Vector && typeof t.alt !== 'undefined') {
var geometry = t.getSource().getFeatures()[0].getGeometry();
if (typeof oldPos !== 'undefined') {
paintLine(oldPos, geometry.getCoordinates());
}
oldPos = geometry.getCoordinates();
}
});
}
function paintLine(pos1, pos2) {
var line = new ol.geom.LineString([pos1, pos2]);
var feature = new ol.Feature({
geometry: line
});
feature.setStyle(new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#1497f1',
width: 3
})
}));
var vectorSource = new ol.source.Vector({
features: [feature]
});
var vectorLayer = new ol.layer.Vector({
source: vectorSource
});
lines.push(vectorLayer);
var length = ol.Sphere.getLength(line) + parseFloat($('#missionDistance').text());
$('#missionDistance').text(length.toFixed(3));
map.addLayer(vectorLayer);
}
function getPointIcon(isEdit) {
return new ol.style.Style({
image: new ol.style.Icon(({
anchor: [0.5, 1],
opacity: 1,
scale: 0.5,
src: '../images/icons/cf_icon_position' + (isEdit ? '_edit' : '') + '.png'
}))
// text: new ol.style.Text({
// text: '10',
// offsetX: -1,
// offsetY: -30,
// overflow: true,
// scale: 2,
// fill: new ol.style.Fill({
// color: 'black'
// })
// })
});
}
function addMarker(_pos, _alt, _action, _speed) {
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point(_pos),
name: 'Null Island',
population: 4000,
rainfall: 500
});
iconFeature.setStyle(getPointIcon());
var vectorSource = new ol.source.Vector({
features: [iconFeature]
});
var vectorLayer = new ol.layer.Vector({
source: vectorSource
});
vectorLayer.alt = _alt;
vectorLayer.number = markers.length;
vectorLayer.action = _action;
vectorLayer.speedValue = _speed;
markers.push(vectorLayer);
return vectorLayer;
}
function initMap() {
var app = {};
/**
* @constructor
* @extends {ol.interaction.Pointer}
*/
app.Drag = function () {
ol.interaction.Pointer.call(this, {
handleDownEvent: app.Drag.prototype.handleDownEvent,
handleDragEvent: app.Drag.prototype.handleDragEvent,
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
handleUpEvent: app.Drag.prototype.handleUpEvent
});
/**
* @type {ol.Pixel}
* @private
*/
this.coordinate_ = null;
/**
* @type {string|undefined}
* @private
*/
this.cursor_ = 'pointer';
/**
* @type {ol.Feature}
* @private
*/
this.feature_ = null;
/**
* @type {string|undefined}
* @private
*/
this.previousCursor_ = undefined;
};
ol.inherits(app.Drag, ol.interaction.Pointer);
/**
* @constructor
* @extends {ol.control.Control}
* @param {Object=} opt_options Control options.
*/
app.PlannerSettingsControl = function (opt_options) {
var options = opt_options || {};
var button = document.createElement('button');
button.innerHTML = ' ';
button.style = 'background: url(\'../images/CF_settings_white.svg\') no-repeat 1px -1px;background-color: rgba(0,60,136,.5);';
var handleShowSettings = function () {
$('#MPeditPoint, #missionPalnerTotalInfo').hide();
$('#missionPlanerSettings').fadeIn(300);
};
button.addEventListener('click', handleShowSettings, false);
button.addEventListener('touchstart', handleShowSettings, false);
var element = document.createElement('div');
element.className = 'mission-control-settings ol-unselectable ol-control';
element.appendChild(button);
element.title = 'MP Settings';
ol.control.Control.call(this, {
element: element,
target: options.target
});
};
ol.inherits(app.PlannerSettingsControl, ol.control.Control);
/**
* @param {ol.MapBrowserEvent} evt Map browser event.
* @return {boolean} `true` to start the drag sequence.
*/
app.Drag.prototype.handleDownEvent = function (evt) {
var map = evt.map;
var feature = map.forEachFeatureAtPixel(evt.pixel,
function (feature, layer) {
return feature;
});
if (feature) {
this.coordinate_ = evt.coordinate;
this.feature_ = feature;
}
return !!feature;
};
/**
* @param {ol.MapBrowserEvent} evt Map browser event.
*/
app.Drag.prototype.handleDragEvent = function (evt) {
var map = evt.map;
var feature = map.forEachFeatureAtPixel(evt.pixel,
function (feature, layer) {
return feature;
});
var deltaX = evt.coordinate[0] - this.coordinate_[0];
var deltaY = evt.coordinate[1] - this.coordinate_[1];
var geometry = /** @type {ol.geom.SimpleGeometry} */
(this.feature_.getGeometry());
geometry.translate(deltaX, deltaY);
this.coordinate_[0] = evt.coordinate[0];
this.coordinate_[1] = evt.coordinate[1];
repaint();
};
/**
* @param {ol.MapBrowserEvent} evt Event.
*/
app.Drag.prototype.handleMoveEvent = function (evt) {
if (this.cursor_) {
var map = evt.map;
var feature = map.forEachFeatureAtPixel(evt.pixel,
function (feature, layer) {
return feature;
});
var element = evt.map.getTargetElement();
if (feature) {
if (element.style.cursor != this.cursor_) {
this.previousCursor_ = element.style.cursor;
element.style.cursor = this.cursor_;
}
} else if (this.previousCursor_ !== undefined) {
element.style.cursor = this.previousCursor_;
this.previousCursor_ = undefined;
}
}
};
/**
* @param {ol.MapBrowserEvent} evt Map browser event.
* @return {boolean} `false` to stop the drag sequence.
*/
app.Drag.prototype.handleUpEvent = function (evt) {
this.coordinate_ = null;
this.feature_ = null;
return false;
};
var lat = GPS_DATA.lat / 10000000;
var lon = GPS_DATA.lon / 10000000;
map = new ol.Map({
controls: ol.control.defaults({
attributionOptions: {
collapsible: false
}
}).extend([
new app.PlannerSettingsControl()
]),
interactions: ol.interaction.defaults().extend([new app.Drag()]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: document.getElementById('missionMap'),
view: new ol.View({
center: ol.proj.fromLonLat([lon, lat]),
zoom: 14
})
});
map.on('click', function (evt) {
if (selectedMarker != null) {
try {
selectedMarker.getSource().getFeatures()[0].setStyle(getPointIcon());
selectedMarker = null;
clearEditForm();
} catch (e) {
GUI.log(e);
}
}
var selectedFeature = map.forEachFeatureAtPixel(evt.pixel,
function (feature, layer) {
return feature;
});
selectedMarker = map.forEachFeatureAtPixel(evt.pixel,
function (feature, layer) {
return layer;
});
if (selectedFeature) {
var geometry = selectedFeature.getGeometry();
var coord = ol.proj.toLonLat(geometry.getCoordinates());
selectedFeature.setStyle(getPointIcon(true));
$('#pointLon').val(coord[0]);
$('#pointLat').val(coord[1]);
$('#pointAlt').val(selectedMarker.alt);
$('#pointType').val(selectedMarker.action);
$('#pointSpeed').val(selectedMarker.speedValue);
$('#MPeditPoint').fadeIn(300);
} else {
map.addLayer(addMarker(evt.coordinate, $('#MPdefaultPointAlt').val(), 1, $('#MPdefaultPointSpeed').val()));
repaint();
}
});
// change mouse cursor when over marker
$(map.getViewport()).on('mousemove', function (e) {
var pixel = map.getEventPixel(e.originalEvent);
var hit = map.forEachFeatureAtPixel(pixel, function (feature, layer) {
return true;
});
if (hit) {
map.getTarget().style.cursor = 'pointer';
} else {
map.getTarget().style.cursor = '';
}
});
$('#removeAllPoints').on('click', function () {
if (confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) {
removeAllPoints();
}
});
$('#removePoint').on('click', function () {
if (selectedMarker) {
var tmp = [];
for (var i in markers) {
if (markers[i] !== selectedMarker && typeof markers[i].action !== "undefined") {
tmp.push(markers[i]);
}
}
map.removeLayer(selectedMarker);
markers = tmp;
selectedMarker = null;
clearEditForm();
repaint();
}
});
$('#savePoint').on('click', function () {
if (selectedMarker) {
map.getLayers().forEach(function (t) {
if (t === selectedMarker) {
var geometry = t.getSource().getFeatures()[0].getGeometry();
geometry.setCoordinates(ol.proj.fromLonLat([parseFloat($('#pointLon').val()), parseFloat($('#pointLat').val())]));
t.alt = $('#pointAlt').val();
t.action = $('#pointType').val();
t.speedValue = $('#pointSpeed').val();
}
});
selectedMarker.getSource().getFeatures()[0].setStyle(getPointIcon());
selectedMarker = null;
clearEditForm();
repaint();
}
});
$('#loadMissionButton').on('click', function () {
if (markers.length) {
if (!confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) {
return;
}
removeAllPoints();
}
$(this).addClass('disabled');
GUI.log('Start get point');
pointForSend = 0;
getNextPoint();
});
$('#saveMissionButton').on('click', function () {
$(this).addClass('disabled');
GUI.log('Start send point');
pointForSend = 0;
sendNextPoint();
});
$('#loadEepromMissionButton').on('click', function () {
if (markers.length) {
if (!confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) {
return;
}
removeAllPoints();
}
GUI.log(chrome.i18n.getMessage('eeprom_load_ok'));
MSP.send_message(MSPCodes.MSP_WP_MISSION_LOAD, false, getPointsFromEprom);
});
$('#saveEepromMissionButton').on('click', function () {
GUI.log(chrome.i18n.getMessage('eeprom_saved_ok'));
MSP.send_message(MSPCodes.MSP_WP_MISSION_SAVE, false, false);
});
$('#rthEndMission').on('change', function () {
if ($(this).is(':checked')) {
$('#rthSettings').fadeIn(300);
} else {
$('#rthSettings').fadeOut(300);
}
});
$('#saveSettings').on('click', function () {
chrome.storage.local.set({'missionPlanerSettings': {speed: $('#MPdefaultPointSpeed').val(), alt: $('#MPdefaultPointAlt').val()}});
$('#missionPlanerSettings').hide();
$('#missionPalnerTotalInfo').fadeIn(300);
if (selectedMarker !== null) {
$('#MPeditPoint').fadeIn(300);
}
});
updateTotalInfo();
}
function removeAllPoints() {
for (var i in markers) {
map.removeLayer(markers[i]);
}
markers = [];
clearEditForm();
repaint();
}
function getPointsFromEprom() {
pointForSend = 0;
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, getNextPoint);
}
function endGetPoint() {
GUI.log('End get point');
$('#loadMissionButton').removeClass('disabled');
repaint();
updateTotalInfo();
}
function getNextPoint() {
if (MISSION_PLANER.countBusyPoints == 0) {
endGetPoint();
return;
}
if (pointForSend > 0) {
// console.log(MISSION_PLANER.bufferPoint.lon);
// console.log(MISSION_PLANER.bufferPoint.lat);
// console.log(MISSION_PLANER.bufferPoint.alt);
// console.log(MISSION_PLANER.bufferPoint.action);
if (MISSION_PLANER.bufferPoint.action == 4) {
$('#rthEndMission').attr('checked', true);
$('#rthSettings').fadeIn(300);
if (MISSION_PLANER.bufferPoint.p1 > 0) {
$('#rthLanding').attr('checked', true);
}
} else {
var coord = ol.proj.fromLonLat([MISSION_PLANER.bufferPoint.lon, MISSION_PLANER.bufferPoint.lat]);
map.addLayer(addMarker(coord, MISSION_PLANER.bufferPoint.alt, MISSION_PLANER.bufferPoint.action, MISSION_PLANER.bufferPoint.p1));
if (pointForSend === 1) {
map.getView().setCenter(coord);
}
}
}
if (pointForSend >= MISSION_PLANER.countBusyPoints) {
endGetPoint();
return;
}
MISSION_PLANER.bufferPoint.number = pointForSend;
pointForSend++;
MSP.send_message(MSPCodes.MSP_WP, mspHelper.crunch(MSPCodes.MSP_WP), false, getNextPoint);
}
function sendNextPoint() {
var isRTH = $('#rthEndMission').is(':checked');
if (pointForSend >= markers.length) {
if (isRTH) {
MISSION_PLANER.bufferPoint.number = pointForSend + 1;
MISSION_PLANER.bufferPoint.action = 4;
MISSION_PLANER.bufferPoint.lon = 0;
MISSION_PLANER.bufferPoint.lat = 0;
MISSION_PLANER.bufferPoint.alt = 0;
MISSION_PLANER.bufferPoint.endMission = 0xA5;
MISSION_PLANER.bufferPoint.p1 = $('#rthLanding').is(':checked') ? 1 : 0;
MSP.send_message(MSPCodes.MSP_SET_WP, mspHelper.crunch(MSPCodes.MSP_SET_WP), false, endSendPoint);
} else {
endSendPoint();
}
return;
}
var geometry = markers[pointForSend].getSource().getFeatures()[0].getGeometry();
var coordinate = ol.proj.toLonLat(geometry.getCoordinates());
MISSION_PLANER.bufferPoint.number = pointForSend + 1;
MISSION_PLANER.bufferPoint.action = markers[pointForSend].action;
MISSION_PLANER.bufferPoint.lon = parseInt(coordinate[0] * 10000000);
MISSION_PLANER.bufferPoint.lat = parseInt(coordinate[1] * 10000000);
MISSION_PLANER.bufferPoint.alt = markers[pointForSend].alt;
MISSION_PLANER.bufferPoint.p1 = markers[pointForSend].speedValue;
pointForSend++;
if (pointForSend >= markers.length && !isRTH) {
MISSION_PLANER.bufferPoint.endMission = 0xA5;
} else {
MISSION_PLANER.bufferPoint.endMission = 0;
}
MSP.send_message(MSPCodes.MSP_SET_WP, mspHelper.crunch(MSPCodes.MSP_SET_WP), false, sendNextPoint);
}
function endSendPoint() {
GUI.log('End send point');
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, updateTotalInfo);
$('#saveMissionButton').removeClass('disabled');
}
};
TABS.mission_control.cleanup = function (callback) {
if (callback) callback();
};

@ -17,8 +17,11 @@ SYM.AH_BAR9_0 = 0x80;
SYM.AH_DECORATION = 0x13;
SYM.AMP = 0x9A;
SYM.MAH = 0x07;
SYM.WH = 0xAB;
SYM.MAH_KM_0 = 157;
SYM.MAH_KM_1 = 158;
SYM.WH_KM_0 = 172;
SYM.WH_KM_1 = 173;
SYM.GPS_SAT1 = 0x1E;
SYM.GPS_SAT2 = 0x1F;
SYM.GPS_HDP1 = 0xBD;
@ -33,6 +36,7 @@ SYM.AIR = 151;
SYM.DIR_TO_HOME = 0x60;
SYM.DIST_KM = 182;
SYM.DIST_MI = 184;
SYM.TRIP_DIST = 0x22;
SYM.HEADING1 = 0xA9;
SYM.HEADING2 = 0xA8;
SYM.HEADING_N = 24;
@ -402,6 +406,12 @@ OSD.constants = {
min_version: '1.7.4',
preview: FONT.symbol(SYM.VOLT) + FONT.embed_dot('3.90V')
},
{
name: 'MAIN_BATT_REMAINING_PERCENTAGE',
id: 38,
min_version: '1.8.1',
preview: '100%'
},
{
name: 'THROTTLE_POSITION',
id: 9,
@ -574,6 +584,12 @@ OSD.constants = {
id: 12,
preview: FONT.symbol(SYM.MAH) + '690 ' // 4 chars
},
{
name: 'WH_DRAWN',
id: 36,
min_version: '1.8.1',
preview: FONT.symbol(SYM.WH) + FONT.embed_dot('1.25')
},
{
name: 'POWER',
id: 19,
@ -581,10 +597,22 @@ OSD.constants = {
preview: 'W50 ' // 3 chars
},
{
name: 'EFFICIENCY',
name: 'MAIN_BATT_REMAINING_CAPACITY',
id: 37,
min_version: '1.8.1',
preview: FONT.symbol(SYM.MAH) + '690 ' // 4 chars
},
{
name: 'EFFICIENCY_MAH',
id: 35,
min_version: '1.7.4',
preview: "123" + FONT.symbol(SYM.MAH_KM_0) + FONT.symbol(SYM.MAH_KM_1)
},
{
name: 'EFFICIENCY_WH',
id: 39,
min_version: '1.8.1',
preview: FONT.embed_dot('1.23') + FONT.symbol(SYM.WH_KM_0) + FONT.symbol(SYM.WH_KM_1)
}
]
},
@ -641,6 +669,18 @@ OSD.constants = {
return FONT.symbol(SYM.DIST_KM) + FONT.embed_dot('1.73');
}
},
{
name: 'TRIP_DIST',
id: 40,
min_version: '1.9.1',
preview: function(osd_data) {
if (OSD.data.unit_mode === 0) {
// Imperial
return FONT.symbol(SYM.TRIP_DIST) + FONT.symbol(SYM.DIST_MI) + FONT.embed_dot('0.98');
}
return FONT.symbol(SYM.TRIP_DIST) + FONT.symbol(SYM.DIST_KM) + FONT.embed_dot('1.73');
}
},
{
name: 'GPS_HDOP',
id: 31,
@ -1010,6 +1050,24 @@ TABS.osd.initialize = function (callback) {
if (typeof alarm.step === 'function') {
step = alarm.step(OSD.data)
}
var $input = $('<label/>');
var tooltip, help = chrome.i18n.getMessage('osdAlarm' + alarm.name + '_HELP');
if (help) {
tooltip = $('<div class="helpicon cf_tip"></div>');
tooltip
.css('margin-top', '1px')
.attr('title', help)
.appendTo($input)
.jBox('Tooltip', {
delayOpen: 100,
delayClose: 100,
position: {
x: 'right',
y: 'center'
},
outside: 'x'
});
}
var alarmInput = $('<input name="alarm" type="number" step="' + step + '"/>' + label + '</label>');
alarmInput.data('alarm', alarm);
if (typeof alarm.to_display === 'function') {
@ -1026,26 +1084,10 @@ TABS.osd.initialize = function (callback) {
OSD.data.alarms[alarm.name] = val;
MSP.promise(MSPCodes.MSP_SET_OSD_CONFIG, OSD.msp.encodeOther())
.then(function () {
tooltip.close();
updateOsdView();
});
});
var $input = $('<label/>');
var help = chrome.i18n.getMessage('osdAlarm' + alarm.name + '_HELP');
if (help) {
$('<div class="helpicon cf_tip"></div>')
.css('margin-top', '1px')
.attr('title', help)
.appendTo($input)
.jBox('Tooltip', {
delayOpen: 100,
delayClose: 100,
position: {
x: 'right',
y: 'center'
},
outside: 'x'
});
}
$input.append(alarmInput);
$alarms.append($input);
}

@ -167,6 +167,24 @@
<input type="number" name="yaw" class="rate-tpa_input" step="10" min="20" max="1800" /> degrees per second
</td>
</tr>
<tr>
<th class="roll" data-i18n="pidTuningManualRollRate"></th>
<td class="roll">
<input type="number" name="manual_roll" class="rate-tpa_input" step="1" min="0" max="100" /> %
</td>
</tr>
<tr>
<th class="pitch" data-i18n="pidTuningManualPitchRate"></th>
<td class="pitch">
<input type="number" name="manual_pitch" class="rate-tpa_input" step="1" min="0" max="100" /> %
</td>
</tr>
<tr>
<th class="yaw" data-i18n="pidTuningManualYawRate"></th>
<td class="yaw">
<input type="number" name="manual_yaw" class="rate-tpa_input" step="1" min="0" max="100" /> %
</td>
</tr>
<tr class="requires-v1_4">
<th data-i18n="magHoldYawRate"></th>
<td >

@ -9,14 +9,21 @@ TABS.pid_tuning.initialize = function (callback) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
var loadChain = [
mspHelper.loadPidNames,
mspHelper.loadPidData,
mspHelper.loadRcTuningData,
mspHelper.loadINAVPidConfig,
mspHelper.loadPidAdvanced,
mspHelper.loadFilterConfig
]);
];
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
loadChain.push(mspHelper.loadRateProfileData);
} else {
loadChain.push(mspHelper.loadRcTuningData);
}
loadChainer.setChain(loadChain);
loadChainer.setExitPoint(load_html);
loadChainer.execute();
@ -58,6 +65,10 @@ TABS.pid_tuning.initialize = function (callback) {
$('.rate-tpa input[name="yaw"]').val(RC_tuning.yaw_rate.toFixed(2));
}
$('.rate-tpa input[name="manual_roll"]').val(RC_tuning.manual_roll_rate);
$('.rate-tpa input[name="manual_pitch"]').val(RC_tuning.manual_pitch_rate);
$('.rate-tpa input[name="manual_yaw"]').val(RC_tuning.manual_yaw_rate);
$('#tpa').val(RC_tuning.dynamic_THR_PID);
$('#tpa-breakpoint').val(RC_tuning.dynamic_THR_breakpoint);
}
@ -80,6 +91,10 @@ TABS.pid_tuning.initialize = function (callback) {
RC_tuning.yaw_rate = parseFloat($('.rate-tpa input[name="yaw"]:visible').val());
RC_tuning.dynamic_THR_PID = parseInt($('#tpa').val());
RC_tuning.dynamic_THR_breakpoint = parseInt($('#tpa-breakpoint').val());
RC_tuning.manual_roll_rate = $('.rate-tpa input[name="manual_roll"]:visible').val();
RC_tuning.manual_pitch_rate = $('.rate-tpa input[name="manual_pitch"]:visible').val();
RC_tuning.manual_yaw_rate = $('.rate-tpa input[name="manual_yaw"]:visible').val();
}
function hideUnusedPids(sensors_detected) {
$('.tab-pid_tuning table.pid_tuning').hide();
@ -231,8 +246,12 @@ TABS.pid_tuning.initialize = function (callback) {
}
function send_rc_tuning_changes() {
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, saveINAVPidConfig);
} else {
MSP.send_message(MSPCodes.MSP_SET_RC_TUNING, mspHelper.crunch(MSPCodes.MSP_SET_RC_TUNING), false, saveINAVPidConfig);
}
}
function saveINAVPidConfig() {
var next_callback = savePidAdvanced;

@ -564,7 +564,7 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
}
function processHtml() {
var modal;
var $presetList = $('#presets-list');
var presetsList = presets.model.extractPresetNames(presets.presets);
@ -590,7 +590,7 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
$('#execute-button').click(function () {
applyAndSave();
OSD.GUI.jbox.close();
modal.close();
googleAnalytics.sendEvent('Presets', 'Applied', currentPreset.name);
});
@ -600,7 +600,7 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
//noinspection JSValidateTypes
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
var modal = new jBox('Modal', {
modal = new jBox('Modal', {
width: 600,
height: 240,
closeButton: 'title',

@ -25,9 +25,9 @@
<input type="text" name="rcmap" spellcheck="false" />
<select class="hybrid_helper"
name="rcmap_helper">
<option value="AETR5678">Default</option>
<option value="AETR5678">Futaba / Hitec</option>
<option value="TAER5678">JR / Spektrum / Graupner</option>
<option value="AETR">Default</option>
<option value="AETR">Futaba / Hitec</option>
<option value="TAER">JR / Spektrum / Graupner</option>
</select>
</div>
</div>
@ -74,26 +74,36 @@
</div>
<div class="gui_box grey" style="float: right;">
<div class="spacer" style="margin-top: 10px; margin-bottom: 10px;">
<div class="cf_column curves" style="width: calc(50% - 10px);">
<div class="fc_column curves" style="width: calc(50% - 10px);">
<table>
<tr>
<td>
<div class="pitch_roll_curve">
<canvas width="200" height="117"></canvas>
</div>
</td>
</tr>
</table>
</div>
<div class="fc_column half tunings">
<table class="rate">
<tr>
<th data-i18n="receiverRcExpo"></th>
<th data-i18n="receiverManualRcExpo"></th>
</tr>
<tr>
<td><input type="number" name="expo" step="0.01" min="0" max="1" /></td>
<td><input type="number" name="manual_expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
<table class="yaw_rate" style="margin-bottom: 0;">
<tr>
<th data-i18n="receiverRcYawExpo"></th>
<th data-i18n="receiverManualRcYawExpo"></th>
</tr>
<tr>
<td><input type="number" name="yaw_expo" step="0.01" min="0" max="1" /></td>
<td><input type="number" name="manual_yaw_expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
</div>

@ -16,14 +16,21 @@ TABS.receiver.initialize = function (callback) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
mspHelper.loadRcTuningData,
var loadChain = [
mspHelper.loadMisc,
mspHelper.loadRcData,
mspHelper.loadRcMap,
mspHelper.loadBfConfig,
mspHelper.loadRcDeadband
]);
];
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
loadChain.push(mspHelper.loadRateProfileData);
} else {
loadChain.push(mspHelper.loadRcTuningData);
}
loadChainer.setChain(loadChain);
loadChainer.setExitPoint(load_html);
loadChainer.execute();
@ -31,10 +38,53 @@ TABS.receiver.initialize = function (callback) {
$('#content').load("./tabs/receiver.html", process_html);
}
function drawRollPitchExpo() {
var pitch_roll_curve = $('.pitch_roll_curve canvas').get(0);
var context = pitch_roll_curve.getContext("2d");
var expoAVal = $('.tunings .rate input[name="expo"]');
var expoA = parseFloat(expoAVal.val());
var expoMVal = $('.tunings .rate input[name="manual_expo"]');
var expoM = parseFloat(expoMVal.val());
if (expoA <= parseFloat(expoAVal.prop('min')) || expoA >= parseFloat(expoAVal.prop('max')) ||
expoM <= parseFloat(expoMVal.prop('min')) || expoM >= parseFloat(expoMVal.prop('max'))) {
return;
}
var rateHeight = TABS.receiver.rateChartHeight;
// draw
context.clearRect(0, 0, 200, rateHeight);
context.beginPath();
context.moveTo(0, rateHeight);
context.quadraticCurveTo(110, rateHeight - ((rateHeight / 2) * (1 - expoA)), 200, 0);
context.lineWidth = 2;
context.strokeStyle = '#37a8db';
context.stroke();
context.beginPath();
context.moveTo(0, rateHeight);
context.quadraticCurveTo(110, rateHeight - ((rateHeight / 2) * (1 - expoM)), 200, 0);
context.lineWidth = 2;
context.strokeStyle = '#a837db';
context.stroke();
}
function process_html() {
// translate to user-selected language
localize();
if (semver.lt(CONFIG.flightControllerVersion, '1.9.1')) {
rcmap_options = $('select[name="rcmap_helper"] option');
for (i = 0; i < rcmap_options.length; ++i) {
option = rcmap_options[i];
option.setAttribute("value", option.getAttribute("value") + "5678");
}
}
// fill in data from RC_tuning
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));
@ -42,6 +92,9 @@ TABS.receiver.initialize = function (callback) {
$('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2));
$('.tunings .yaw_rate input[name="yaw_expo"]').val(RC_tuning.RC_YAW_EXPO.toFixed(2));
$('.tunings .rate input[name="manual_expo"]').val(RC_tuning.manual_RC_EXPO.toFixed(2));
$('.tunings .yaw_rate input[name="manual_yaw_expo"]').val(RC_tuning.manual_RC_YAW_EXPO.toFixed(2));
$('.deadband input[name="yaw_deadband"]').val(RC_deadband.yaw_deadband);
$('.deadband input[name="deadband"]').val(RC_deadband.deadband);
@ -107,9 +160,9 @@ TABS.receiver.initialize = function (callback) {
$(window).on('resize', self.resize).resize(); // trigger so labels get correctly aligned on creation
// handle rcmap & rssi aux channel
var strBuffer = [];
var strBuffer = [], rcMapLetters = FC.getRcMapLetters();
for (var i = 0; i < RC_MAP.length; i++) {
strBuffer[RC_MAP[i]] = FC.getRcMapLetters()[i];
strBuffer[RC_MAP[i]] = rcMapLetters[i];
}
// reconstruct
@ -138,29 +191,12 @@ TABS.receiver.initialize = function (callback) {
});
$rcMap.focusout(function () {
var val = $(this).val(),
strBuffer = val.split(''),
duplicityBuffer = [];
if (val.length != 8) {
$(this).val(last_valid);
return false;
}
// check if characters inside are all valid, also check for duplicity
for (var i = 0; i < val.length; i++) {
if (FC.getRcMapLetters().indexOf(strBuffer[i]) < 0) {
if (!FC.isRcMapValid($(this).val()))
$(this).val(last_valid);
return false;
}
});
if (duplicityBuffer.indexOf(strBuffer[i]) < 0) {
duplicityBuffer.push(strBuffer[i]);
} else {
$(this).val(last_valid);
return false;
}
}
$rcMap.on('input change', function() {
$(this).css("color", FC.isRcMapValid($(this).val()) ? "" : "#FF0000");
});
// handle helper
@ -224,27 +260,7 @@ TABS.receiver.initialize = function (callback) {
$('.tunings .rate input').on('input change', function () {
setTimeout(function () { // let global validation trigger and adjust the values first
var expoE = $('.tunings .rate input[name="expo"]'),
expo = parseFloat(expoE.val()),
pitch_roll_curve = $('.pitch_roll_curve canvas').get(0),
context = pitch_roll_curve.getContext("2d");
// local validation to deal with input event
if (expo >= parseFloat(expoE.prop('min')) &&
expo <= parseFloat(expoE.prop('max'))) {
// continue
} else {
return;
}
// draw
context.clearRect(0, 0, 200, rateHeight);
context.beginPath();
context.moveTo(0, rateHeight);
context.quadraticCurveTo(110, rateHeight - ((rateHeight / 2) * (1 - expo)), 200, 0);
context.lineWidth = 2;
context.strokeStyle = '#37a8db';
context.stroke();
drawRollPitchExpo();
}, 0);
}).trigger('input');
@ -272,6 +288,9 @@ TABS.receiver.initialize = function (callback) {
RC_tuning.RC_EXPO = parseFloat($('.tunings .rate input[name="expo"]').val());
RC_tuning.RC_YAW_EXPO = parseFloat($('.tunings .yaw_rate input[name="yaw_expo"]').val());
RC_tuning.manual_RC_EXPO = parseFloat($('.tunings .rate input[name="manual_expo"]').val());
RC_tuning.manual_RC_YAW_EXPO = parseFloat($('.tunings .yaw_rate input[name="manual_yaw_expo"]').val());
RC_deadband.yaw_deadband = parseInt($('.deadband input[name="yaw_deadband"]').val());
RC_deadband.deadband = parseInt($('.deadband input[name="deadband"]').val());
@ -309,7 +328,11 @@ TABS.receiver.initialize = function (callback) {
});
}
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
MSP.send_message(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE, mspHelper.crunch(MSPCodes.MSPV2_INAV_SET_RATE_PROFILE), false, save_rc_map);
} else {
MSP.send_message(MSPCodes.MSP_SET_RC_TUNING, mspHelper.crunch(MSPCodes.MSP_SET_RC_TUNING), false, save_rc_map);
}
});
$("a.sticks").click(function () {

@ -18,7 +18,10 @@
<label><input type="checkbox" name="gyro_on" class="first" />Gyroscope</label> <label><input
type="checkbox" name="accel_on" />Accelerometer</label> <label><input type="checkbox"
name="mag_on" />Magnetometer</label> <label><input type="checkbox" name="baro_on" />Barometer</label> <label><input
type="checkbox" name="sonar_on" />Sonar</label> <label><input type="checkbox" name="debug_on" />Debug</label>
type="checkbox" name="sonar_on" />Sonar</label> <label><input type="checkbox" name="airspeed_on" />Air speed</label> <label><input
type="checkbox" name="debug_on" />Debug</label>
<a class="debug-trace" href="javascript:void(0);">Open Debug Trace</a>
</div>
</div>
</div>
@ -227,6 +230,39 @@
<div class="clear-both"></div>
</div>
</div>
<div class="wrapper airspeed">
<div class="gui_box grey">
<div class="plot_control">
<div class="title">Air speed - cm/s</div>
<dl>
<dt i18n="sensorsRefresh"></dt>
<dd class="rate">
<select name="airspeed_refresh_rate">
<option value="10">10 ms</option>
<option value="20">20 ms</option>
<option value="30">30 ms</option>
<option value="40">40 ms</option>
<option value="50" selected="selected">50 ms</option>
<option value="100">100 ms</option>
<option value="250">250 ms</option>
<option value="500">500 ms</option>
<option value="1000">1000 ms</option>
</select>
</dd>
<dt>IAS:</dt>
<dd class="x">0</dd>
</dl>
</div>
<svg id="airspeed">
<g class="grid x" transform="translate(40, 120)"></g>
<g class="grid y" transform="translate(40, 10)"></g>
<g class="data" transform="translate(41, 10)"></g>
<g class="axis x" transform="translate(40, 120)"></g>
<g class="axis y" transform="translate(40, 10)"></g>
</svg>
<div class="clear-both"></div>
</div>
</div>
<div class="wrapper debug">
<div class="gui_box grey">
<div class="plot_control">

@ -15,6 +15,7 @@ TABS.sensors.initialize = function (callback) {
SENSOR_DATA.gyroscope[i] = 0;
SENSOR_DATA.magnetometer[i] = 0;
SENSOR_DATA.sonar = 0;
SENSOR_DATA.air_speed = 0;
SENSOR_DATA.altitude = 0;
SENSOR_DATA.debug[i] = 0;
}
@ -172,6 +173,14 @@ TABS.sensors.initialize = function (callback) {
}
}
function plot_airspeed(enable) {
if (enable) {
$('.wrapper.airspeed').show();
} else {
$('.wrapper.airspeed').hide();
}
}
function plot_debug(enable) {
if (enable) {
$('.wrapper.debug').show();
@ -193,6 +202,10 @@ TABS.sensors.initialize = function (callback) {
checkboxes.eq(4).prop('disabled', true);
}
if (semver.lt(CONFIG.flightControllerVersion, "1.9.1") || (!bit_check(CONFIG.activeSensors, 6))) { // airspeed
checkboxes.eq(5).prop('disabled', true);
}
$('.tab-sensors .info .checkboxes input').change(function () {
var enable = $(this).prop('checked');
var index = $(this).parent().index();
@ -214,6 +227,9 @@ TABS.sensors.initialize = function (callback) {
plot_sonar(enable);
break;
case 5:
plot_airspeed(enable);
break;
case 6:
plot_debug(enable);
break;
}
@ -248,12 +264,14 @@ TABS.sensors.initialize = function (callback) {
samples_mag_i = 0,
samples_altitude_i = 0,
samples_sonar_i = 0,
samples_airspeed_i = 0,
samples_debug_i = 0,
gyro_data = initDataArray(3),
accel_data = initDataArray(3),
mag_data = initDataArray(3),
altitude_data = (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) ? initDataArray(2) : initDataArray(1),
sonar_data = initDataArray(1),
airspeed_data = initDataArray(1),
debug_data = [
initDataArray(1),
initDataArray(1),
@ -266,6 +284,7 @@ TABS.sensors.initialize = function (callback) {
var magHelpers = initGraphHelpers('#mag', samples_mag_i, [-1, 1]);
var altitudeHelpers = initGraphHelpers('#altitude', samples_altitude_i);
var sonarHelpers = initGraphHelpers('#sonar', samples_sonar_i);
var airspeedHelpers = initGraphHelpers('#airspeed', samples_airspeed_i);
var debugHelpers = [
initGraphHelpers('#debug1', samples_debug_i),
initGraphHelpers('#debug2', samples_debug_i),
@ -304,6 +323,8 @@ TABS.sensors.initialize = function (callback) {
$('.tab-sensors select[name="baro_refresh_rate"]').val(result.sensor_settings.rates.baro);
$('.tab-sensors select[name="sonar_refresh_rate"]').val(result.sensor_settings.rates.sonar);
$('.tab-sensors select[name="airspeed_refresh_rate"]').val(result.sensor_settings.rates.airspeed);
$('.tab-sensors select[name="debug_refresh_rate"]').val(result.sensor_settings.rates.debug);
// start polling data by triggering refresh rate change event
@ -323,6 +344,7 @@ TABS.sensors.initialize = function (callback) {
'mag': parseInt($('.tab-sensors select[name="mag_refresh_rate"]').val(), 10),
'baro': parseInt($('.tab-sensors select[name="baro_refresh_rate"]').val(), 10),
'sonar': parseInt($('.tab-sensors select[name="sonar_refresh_rate"]').val(), 10),
'airspeed': parseInt($('.tab-sensors select[name="airspeed_refresh_rate"]').val(), 10),
'debug': parseInt($('.tab-sensors select[name="debug_refresh_rate"]').val(), 10)
};
@ -402,6 +424,21 @@ TABS.sensors.initialize = function (callback) {
}
if (checkboxes[5]) {
helper.interval.add('airspeed_pull', function airspeed_data_pull() {
/*
* Enable balancer
*/
if (helper.mspQueue.shouldDrop()) {
update_airspeed_graphs();
return;
}
MSP.send_message(MSPCodes.MSPV2_INAV_AIR_SPEED, false, false, update_airspeed_graphs);
}, rates.airspeed, true);
}
if (checkboxes[6]) {
helper.interval.add('debug_pull', function debug_data_pull() {
/*
@ -470,18 +507,46 @@ TABS.sensors.initialize = function (callback) {
raw_data_text_ements.x[4].text(SENSOR_DATA.sonar.toFixed(2));
}
function update_airspeed_graphs() {
updateGraphHelperSize(airspeedHelpers);
samples_airspeed_i = addSampleToData(airspeed_data, samples_airspeed_i, [SENSOR_DATA.air_speed]);
drawGraph(airspeedHelpers, airspeed_data, samples_airspeed_i);
raw_data_text_ements.x[5].text(SENSOR_DATA.air_speed);
}
function update_debug_graphs() {
for (var i = 0; i < 4; i++) {
updateGraphHelperSize(debugHelpers[i]);
addSampleToData(debug_data[i], samples_debug_i, [SENSOR_DATA.debug[i]]);
drawGraph(debugHelpers[i], debug_data[i], samples_debug_i);
raw_data_text_ements.x[5 + i].text(SENSOR_DATA.debug[i]);
raw_data_text_ements.x[6 + i].text(SENSOR_DATA.debug[i]);
}
samples_debug_i++;
}
});
$("a.debug-trace").click(function () {
var windowWidth = 500;
var windowHeight = 510;
chrome.app.window.create("/tabs/debug_trace.html", {
id: "debug_trace",
innerBounds: {
minWidth: windowWidth, minHeight: windowHeight,
width: windowWidth, height: windowHeight,
},
alwaysOnTop: true
}, function (createdWindow) {
createdWindow.contentWindow.getDebugTrace = function () { return DEBUG_TRACE || ''; };
return true;
});
return false;
});
GUI.content_ready(callback);
});
};

@ -11,22 +11,41 @@ TABS.servos.initialize = function (callback) {
var loadChainer = new MSPChainerClass();
if (BF_CONFIG.mixerConfiguration == 23 || BF_CONFIG.mixerConfiguration == 24 || BF_CONFIG.mixerConfiguration == 25) {
loadChainer.setChain([
mspHelper.loadServoConfiguration,
mspHelper.loadRcData,
mspHelper.loadBfConfig,
mspHelper.loadServoMixRules
]);
}
else {
loadChainer.setChain([
mspHelper.loadServoConfiguration,
mspHelper.loadRcData,
mspHelper.loadBfConfig
]);
}
loadChainer.setExitPoint(load_html);
loadChainer.execute();
var saveChainer = new MSPChainerClass();
if (BF_CONFIG.mixerConfiguration == 23 || BF_CONFIG.mixerConfiguration == 24 || BF_CONFIG.mixerConfiguration == 25) {
saveChainer.setChain([
mspHelper.sendServoConfigurations,
mspHelper.sendServoMixer,
mspHelper.saveToEeprom
]);
}
else {
saveChainer.setChain([
mspHelper.sendServoConfigurations,
mspHelper.saveToEeprom
]);
}
saveChainer.setExitPoint(function () {
GUI.log(chrome.i18n.getMessage('servosEepromSave'));
SERVO_RULES.cleanup();

@ -89,18 +89,42 @@
<div class="spacer_box">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
<tbody>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetupBatteryDetectedCells"></td>
<td class="bat-cells">0</td>
</tr>
<tr>
<td data-i18n="initialSetupBattery"></td>
<td class="bat-voltage">0 V</td>
</tr>
<tr>
<td data-i18n="initialSetupDrawn"></td>
<td class="bat-mah-drawn">0 mAh</td>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetupBatteryPercentage"></td>
<td class="bat-percent">0 %</td>
</tr>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetupBatteryRemainingCapacity"></td>
<td class="bat-remain-cap">NA</td>
</tr>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetupBatteryFull"></td>
<td class="bat-full">0</td>
</tr>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetupBatteryThresholds"></td>
<td class="bat-thresh">0</td>
</tr>
<tr>
<td data-i18n="initialSetupDrawing"></td>
<td class="bat-mah-drawing">0.00 A</td>
</tr>
<tr>
<td data-i18n="initialSetupDrawn"></td>
<td class="bat-mah-drawn">0 mAh</td>
</tr>
<tr class="requires-v1_8_1">
<td data-i18n="initialSetup_Wh_drawn"></td>
<td class="bat-mwh-drawn">0 Wh</td>
</tr>
<tr class="noboarder">
<td data-i18n="initialSetupRSSI"></td>
<td class="rssi">0 %</td>

@ -15,11 +15,18 @@ TABS.setup.initialize = function (callback) {
var loadChainer = new MSPChainerClass();
loadChainer.setChain([
var loadChain = [
mspHelper.loadBfConfig,
mspHelper.loadMisc,
mspHelper.queryFcStatus
]);
];
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
loadChain.push(mspHelper.loadMiscV2);
} else {
loadChain.push(mspHelper.loadMisc);
}
loadChainer.setChain(loadChain);
loadChainer.setExitPoint(load_html);
loadChainer.execute();
@ -77,7 +84,13 @@ TABS.setup.initialize = function (callback) {
// cached elements
var bat_voltage_e = $('.bat-voltage'),
bat_percent_e = $('.bat-percent'),
bat_remaining_e = $('.bat-remain-cap'),
bat_cells_e = $('.bat-cells'),
bat_thresh_e = $('.bat-thresh'),
bat_full_e = $('.bat-full'),
bat_mah_drawn_e = $('.bat-mah-drawn'),
bat_mwh_drawn_e = $('.bat-mwh-drawn'),
bat_mah_drawing_e = $('.bat-mah-drawing'),
rssi_e = $('.rssi'),
gpsFix_e = $('.gpsFixType'),
@ -133,9 +146,23 @@ TABS.setup.initialize = function (callback) {
helper.mspBalancedInterval.add('setup_data_pull_fast', 40, 1, get_fast_data);
helper.mspBalancedInterval.add('setup_data_pull_slow', 250, 1, get_slow_data);
if (semver.lt(CONFIG.flightControllerVersion, '1.8.1')) {
$('.requires-v1_8_1').hide();
}
helper.interval.add('gui_analog_update', function () {
bat_cells_e.text(chrome.i18n.getMessage('initialSetupBatteryDetectedCellsValue', [ANALOG.cell_count]));
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
remaining_capacity_wh_decimals = ANALOG.battery_remaining_capacity.toString().length < 5 ? 3 : (7 - ANALOG.battery_remaining_capacity.toString().length);
remaining_capacity_value = MISC.battery_capacity_unit == 'mAh' ? ANALOG.battery_remaining_capacity : (ANALOG.battery_remaining_capacity / 1000).toFixed(remaining_capacity_wh_decimals < 0 ? 0 : remaining_capacity_wh_decimals);
remaining_capacity_unit = MISC.battery_capacity_unit == 'mAh' ? 'mAh' : 'Wh';
bat_remaining_e.text(chrome.i18n.getMessage('initialSetupBatteryRemainingCapacityValue', ((MISC.battery_capacity > 0) && ANALOG.battery_full_when_plugged_in) ? [remaining_capacity_value, remaining_capacity_unit] : ['NA', '']));
bat_percent_e.text(chrome.i18n.getMessage('initialSetupBatteryPercentageValue', [ANALOG.battery_percentage]));
bat_full_e.text(chrome.i18n.getMessage('initialSetupBatteryFullValue', [ANALOG.battery_full_when_plugged_in]));
bat_thresh_e.text(chrome.i18n.getMessage('initialSetupBatteryThresholdsValue', [ANALOG.use_capacity_thresholds]));
bat_mah_drawn_e.text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
capacity_drawn_decimals = ANALOG.mWhdrawn.toString().length < 5 ? 3 : (7 - ANALOG.mWhdrawn.toString().length);
bat_mwh_drawn_e.text(chrome.i18n.getMessage('initialSetup_Wh_drawnValue', [(ANALOG.mWhdrawn / 1000).toFixed(capacity_drawn_decimals < 0 ? 0 : capacity_drawn_decimals)]));
bat_mah_drawing_e.text(chrome.i18n.getMessage('initialSetupBatteryAValue', [ANALOG.amperage.toFixed(2)]));
rssi_e.text(chrome.i18n.getMessage('initialSetupRSSIValue', [((ANALOG.rssi / 1023) * 100).toFixed(0)]));
}, 100, true);

Loading…
Cancel
Save