Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ var FC = {
packetCount: 0,
hwVersion: 0
};

this.ADSB_VEHICLES = {
vehiclesCount: 0,
callsignLength: 0,
Expand Down Expand Up @@ -585,7 +585,7 @@ var FC = {
sensitivityEnd: null,
correctionCenter: null,
correctionEnd: null,
weightCenter: null,
weightCenter: null,
weightEnd: null
};

Expand Down Expand Up @@ -838,7 +838,7 @@ var FC = {
var calibrated = true;
var flagNames = FC.getArmingFlags();

if (this.CALIBRATION_DATA.accGain.X === 4096 && this.CALIBRATION_DATA.accGain.Y === 4096 && this.CALIBRATION_DATA.accGain.Z === 4096 &&
if (this.CALIBRATION_DATA.accGain.X === 4096 && this.CALIBRATION_DATA.accGain.Y === 4096 && this.CALIBRATION_DATA.accGain.Z === 4096 &&
this.CALIBRATION_DATA.accZero.X === 0 && this.CALIBRATION_DATA.accZero.Y === 0 && this.CALIBRATION_DATA.accZero.Z === 0
) {
calibrated = false;
Expand Down Expand Up @@ -870,7 +870,8 @@ var FC = {
'Level',
'Heading Hold',
'Velocity Z',
'Nav Heading'
'Nav Heading',
'Auto Speed'
];
},
getRthAltControlMode: function () {
Expand Down
5 changes: 5 additions & 0 deletions js/flightModes.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ var FLIGHT_MODES = [
boxId: 59,
boxName: "GIMBAL HEADTRACKER",
permanentId: 68
},
{
boxId: 60,
boxName: "AUTO SPEED",
permanentId: 69
}
];

Expand Down
6 changes: 6 additions & 0 deletions js/logicConditionOperators.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ const LOGIC_OPERATORS = {
hasOperand: [true, false],
output: "boolean"
},
61: {
name: "Disable Auto Speed Airspeed",
operandType: "Set Flight Parameter",
hasOperand: [true, false],
output: "boolean"
},
};

export { LOGIC_OPERATORS };
40 changes: 20 additions & 20 deletions js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var SerialBackend = (function () {

var publicScope = {},
privateScope = {};

privateScope.isDemoRunning = false;

privateScope.isWirelessMode = false;
Expand All @@ -43,12 +43,12 @@ var SerialBackend = (function () {
* Handle "Wireless" mode with strict queueing of messages
*/
publicScope.init = function() {

privateScope.$port = $('#port'),
privateScope.$baud = $('#baud'),
publicScope.$portOverride = $('#port-override'),
mspHelper.setSensorStatusEx(privateScope.sensor_status_ex);

$('#wireless-mode').on('change', function () {
var $this = $(this);

Expand Down Expand Up @@ -100,7 +100,7 @@ var SerialBackend = (function () {
}, 5000);
};


GUI.updateManualPortVisibility = function(){
var selected_port = privateScope.$port.find('option:selected');
if (selected_port.data().isManual || selected_port.data().isTcp || selected_port.data().isUdp) {
Expand All @@ -121,7 +121,7 @@ var SerialBackend = (function () {
}
else {
privateScope.$baud.show();
}
}

if (selected_port.data().isBle || selected_port.data().isTcp || selected_port.data().isUdp || selected_port.data().isSitl) {
$('.tab_firmware_flasher').hide();
Expand All @@ -135,18 +135,18 @@ var SerialBackend = (function () {
type = ConnectionType.TCP;
} else if (selected_port.data().isUdp) {
type = ConnectionType.UDP;
}
}
CONFIGURATOR.connection = connectionFactory(type, CONFIGURATOR.connection);

};

GUI.updateManualPortVisibility();

publicScope.$portOverride.on('change', function () {
store.set('portOverride', publicScope.$portOverride.val());
});
publicScope.$portOverride.val(store.get('portOverride', ''));

publicScope.$portOverride.val(store.get('portOverride', ''));

privateScope.$port.on('change', function (target) {
GUI.updateManualPortVisibility();
Expand All @@ -156,7 +156,7 @@ var SerialBackend = (function () {
privateScope.reopenTab = null;
privateScope.reConnect()
});

privateScope.reConnect = function() {
if (groundstation.isActivated()) {
groundstation.deactivate();
Expand All @@ -169,7 +169,7 @@ var SerialBackend = (function () {
var selected_port = privateScope.$port.find('option:selected').data().isManual ?
publicScope.$portOverride.val() :
String(privateScope.$port.val());

if (selected_port === 'DFU') {
GUI.log(i18n.getMessage('dfu_connect_message'));
}
Expand All @@ -188,7 +188,7 @@ var SerialBackend = (function () {
CONFIGURATOR.connection.connect("127.0.0.1:5760", {}, privateScope.onOpen);
} else if (selected_port == 'sitl-demo') {
SITLProcess.stop();
SITLProcess.start("demo.bin");
SITLProcess.start("demo.bin");
this.isDemoRunning = true;

// Wait 1 sec until SITL is ready
Expand Down Expand Up @@ -309,7 +309,7 @@ var SerialBackend = (function () {
} else {
$(`#tabs ul.mode-connected .tab_setup a`).trigger('click');
}

update.firmwareVersion();
});
});
Expand Down Expand Up @@ -369,7 +369,7 @@ var SerialBackend = (function () {
// variable isn't stored yet, saving
store.set('last_used_port', GUI.connected_to);
}


store.set('last_used_bps', CONFIGURATOR.connection.bitrate);
store.set('wireless_mode_enabled', $('#wireless-mode').is(":checked"));
Expand Down Expand Up @@ -410,7 +410,7 @@ var SerialBackend = (function () {
// upgrade to MSPv2 if possible.
MSP.protocolVersion = MSP.constants.PROTOCOL_V2;
MSP.send_message(MSPCodes.MSP_API_VERSION, false, false, function () {

if (FC.CONFIG.apiVersion === "0.0.0") {
GUI.log("<span style='color: red; font-weight: bolder'><strong>" + i18n.getMessage("illegalStateRestartRequired") + "</strong></span>");
FC.restartRequired = true;
Expand All @@ -425,14 +425,14 @@ var SerialBackend = (function () {

GUI.log(i18n.getMessage('fcInfoReceived', [FC.CONFIG.flightControllerIdentifier, FC.CONFIG.flightControllerVersion]));
if (semver.gte(FC.CONFIG.flightControllerVersion, CONFIGURATOR.minfirmwareVersionAccepted) && semver.lt(FC.CONFIG.flightControllerVersion, CONFIGURATOR.maxFirmwareVersionAccepted)) {
if (CONFIGURATOR.connection.type == ConnectionType.BLE && semver.lt(FC.CONFIG.flightControllerVersion, "5.0.0")) {
if (CONFIGURATOR.connection.type == ConnectionType.BLE && semver.lt(FC.CONFIG.flightControllerVersion, "5.0.0")) {
privateScope.onBleNotSupported();
} else {
mspHelper.getCraftName(function(name) {
if (name) {
FC.CONFIG.name = name;
}
privateScope.onValidFirmware();
privateScope.onValidFirmware();
});
}
} else {
Expand Down Expand Up @@ -468,7 +468,7 @@ var SerialBackend = (function () {
$('.mode-disconnected').hide();
$('.mode-connected').show();


MSP.send_message(MSPCodes.MSP_BOXIDS, false, false, function () {
FC.generateAuxConfig();
});
Expand All @@ -482,13 +482,13 @@ var SerialBackend = (function () {
/*
* Init PIDs bank with a length that depends on the version
*/
let pidCount = 11;
let pidCount = 12;

for (let i = 0; i < pidCount; i++) {
FC.PIDs.push(new Array(4));
}


interval.add('msp-load-update', function () {
$('#msp-version').text("MSP version: " + MSP.protocolVersion.toFixed(0));
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
Expand Down
4 changes: 2 additions & 2 deletions tabs/auxiliary.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ auxiliaryTab.initialize = function (callback) {
modeSections["Flight Modes"] = ["ANGLE", "HORIZON", "MANUAL", "ANGLE HOLD"];
modeSections["Navigation Modes"] = ["NAV COURSE HOLD", "NAV CRUISE", "NAV POSHOLD", "NAV RTH", "NAV WP", "GCS NAV"];
modeSections["Flight Mode Modifiers"] = ["NAV ALTHOLD", "HEADING HOLD", "AIR MODE", "SOARING", "SURFACE", "TURN ASSIST"];
modeSections["Fixed Wing"] = ["AUTO TUNE", "SERVO AUTOTRIM", "AUTO LEVEL TRIM", "NAV LAUNCH", "LOITER CHANGE", "FLAPERON"];
modeSections["Fixed Wing"] = ["AUTO TUNE", "SERVO AUTOTRIM", "AUTO LEVEL TRIM", "AUTO SPEED", "NAV LAUNCH", "LOITER CHANGE", "FLAPERON"];
modeSections["Multi-rotor"] = ["FPV ANGLE MIX", "TURTLE", "MC BRAKING", "HEADFREE", "HEADADJ"];
modeSections["OSD Modes"] = ["OSD OFF", "OSD ALT 1", "OSD ALT 2", "OSD ALT 3"];
modeSections["FPV Camera Modes"] = ["CAMSTAB", "CAMERA CONTROL 1", "CAMERA CONTROL 2", "CAMERA CONTROL 3"];
modeSections["VTOL"] = ["MIXER PROFILE 2", "MIXER TRANSITION"];
modeSections["Beeper"] = ["BEEPER", "BEEPER MUTE"];
modeSections["Gimbal"] = ["GIMBAL LEVEL TILT", "GIMBAL LEVEL ROLL", "GIMBAL LEVEL PAN", "GIMBAL HEADTRACKER", "GIMBAL CENTER"];
modeSections["Misc Modes"] = ["LEDS OFF", "LIGHTS", "HOME RESET", "WP PLANNER", "MISSION CHANGE", "BLACKBOX", "FAILSAFE", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2", "USER3", "USER4"];
modeSections["Misc Modes"] = ["LEDS OFF", "LIGHTS", "HOME RESET", "WP PLANNER", "MISSION CHANGE", "BLACKBOX", "FAILSAFE", "MULTI FUNCTION", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2", "USER3", "USER4"];

function sort_modes_for_display() {
// Sort the modes
Expand Down
27 changes: 22 additions & 5 deletions tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,23 @@ OSD.constants = {
}
}
},
{
name: 'AUTO SPEED',
id: 170,
// min_version: '10.0.0',
preview: function(osd_data) {
switch (OSD.data.preferences.units) {
case 0: // Imperial
case 2: // Metric + MPH
case 3: // UK
return FONT.embed_dot('G:127') + FONT.symbol(SYM.MPH_3D);
case 4: // GA
return FONT.embed_dot('G:110') + FONT.symbol(SYM.KT_3D);
default: // Metric
return FONT.embed_dot('G:204') + FONT.symbol(SYM.KMH_3D);
}
}
},
{
name: 'GPS_MAX_SPEED',
id: 125,
Expand Down Expand Up @@ -1907,7 +1924,7 @@ OSD.constants = {
{
name: 'GPS_EXTRA_STATS',
id: 169,
min_version: '9.0.1',
min_version: '9.0.1',
preview: '0' + FONT.symbol(SYM.SYM_HUD_SIGNAL_3) + '0' + FONT.symbol(SYM.SYM_HUD_SIGNAL_3) + '0' + FONT.symbol(SYM.SYM_HUD_SIGNAL_3) + '0'+ FONT.symbol(SYM.SYM_HUD_SIGNAL_3) + FONT.symbol(SYM.SNR) + '99'
}
]
Expand Down Expand Up @@ -2448,7 +2465,7 @@ OSD.reload = function(callback) {
MSP.promise(MSPCodes.MSP2_INAV_OSD_PREFERENCES).then(function (resp) {
OSD.data.supported = true;
OSD.msp.decodePreferences(resp);

MSP.promise(MSPCodes.MSP2_INAV_CUSTOM_OSD_ELEMENTS).then(() => {
mspHelper.loadOsdCustomElements(() => {
MSP.promise(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_CONFIGURED).then(() => {
Expand All @@ -2465,7 +2482,7 @@ OSD.reload = function(callback) {
});
});


};

OSD.updateSelectedLayout = function(new_layout) {
Expand Down Expand Up @@ -3703,13 +3720,13 @@ osdTab.initialize = function (callback) {
$fontPicker.removeClass('active');
$(this).addClass('active');
store.set('osd_font', $(this).data('font-file'));

import(`./../resources/osd/analogue/${$(this).data('font-file')}.mcm?raw`).then(({default: data}) => {
FONT.parseMCMFontFile(data);
FONT.preview($preview);
OSD.GUI.update();
});

});

// load the last selected font when we change tabs
Expand Down
Loading
Loading