add button for flat trim
Esse commit está contido em:
@@ -14,6 +14,10 @@ function pilot(name, deps) {
|
|||||||
console.log("calibrate", cmd);
|
console.log("calibrate", cmd);
|
||||||
return deps.client.calibrate(cmd.device_num);
|
return deps.client.calibrate(cmd.device_num);
|
||||||
});
|
});
|
||||||
|
socket.on('/pilot/ftrim', function () {
|
||||||
|
console.log("flat trim");
|
||||||
|
return deps.client.ftrim();
|
||||||
|
});
|
||||||
socket.on('/pilot/animate', function (cmd) {
|
socket.on('/pilot/animate', function (cmd) {
|
||||||
console.log("animate", cmd);
|
console.log("animate", cmd);
|
||||||
return deps.client.animate(cmd.action, 500);
|
return deps.client.animate(cmd.action, 500);
|
||||||
|
|||||||
@@ -115,11 +115,17 @@ PILOT_ACCELERATION = 0.04;
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
pilot.calibrate(0);
|
pilot.calibrate(0);
|
||||||
});
|
});
|
||||||
|
$('#ftrim').click(function(ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
pilot.ftrim();
|
||||||
|
});
|
||||||
this.cockpit.socket.on('hovering', function() {
|
this.cockpit.socket.on('hovering', function() {
|
||||||
$('#calibratemagneto').prop('disabled', false);
|
$('#calibratemagneto').prop('disabled', false);
|
||||||
|
$('#ftrim').prop('disabled', true);
|
||||||
});
|
});
|
||||||
this.cockpit.socket.on('landed', function() {
|
this.cockpit.socket.on('landed', function() {
|
||||||
$('#calibratemagneto').prop('disabled', true);
|
$('#calibratemagneto').prop('disabled', true);
|
||||||
|
$('#ftrim').prop('disabled', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -240,6 +246,14 @@ PILOT_ACCELERATION = 0.04;
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Requests a flat trim. Disabled when flying.
|
||||||
|
*/
|
||||||
|
Pilot.prototype.ftrim = function ftrim() {
|
||||||
|
this.cockpit.socket.emit("/pilot/ftrim");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
window.Cockpit.plugins.push(Pilot);
|
window.Cockpit.plugins.push(Pilot);
|
||||||
|
|
||||||
}(window, document));
|
}(window, document));
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<span id="controls">
|
<span id="controls">
|
||||||
|
<input type="button" id="ftrim" value="Flat trim">
|
||||||
<input type="button" id="calibratemagneto" value="Calibrate magneto">
|
<input type="button" id="calibratemagneto" value="Calibrate magneto">
|
||||||
</span>
|
</span>
|
||||||
<header class="wrapper clearfix">
|
<header class="wrapper clearfix">
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário