1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 09:15:49 +03:00

motor direction tools: gui_log the direction clicked (#3634)

* motor direction tools: gui_log the direction clicked

* motor direction tools: gui_log the direction clicked ; fix syntax

* motor direction tools: gui_log the direction clicked ; deduplicate/simplify

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
This commit is contained in:
nerdCopter 2023-11-15 09:13:53 -06:00 committed by GitHub
parent 5b2be8a968
commit 86043faf49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
import EscDshotCommandQueue from './EscDshotCommandQueue.js';
import DshotCommand from '../../js/utils/DshotCommand.js';
import MSPCodes from '../../js/msp/MSPCodes.js';
import { gui_log } from "../../js/gui_log";
class EscDshotDirectionMotorDriver
{
@ -122,6 +123,21 @@ class EscDshotDirectionMotorDriver
buffer.push8(direction);
buffer.push8(DshotCommand.dshotCommands_e.DSHOT_CMD_SAVE_SETTINGS);
this._EscDshotCommandQueue.pushCommand(MSPCodes.MSP2_SEND_DSHOT_COMMAND, buffer);
let logString = "";
if (motorIndex === DshotCommand.ALL_MOTORS) {
logString += i18n.getMessage('motorsText');
} else {
const motorNumber = motorIndex+1;
logString += i18n.getMessage(`motorNumber${motorNumber}`);
}
logString += ': ';
if (direction === DshotCommand.dshotCommands_e.DSHOT_CMD_SPIN_DIRECTION_1) {
logString += i18n.getMessage('escDshotDirectionDialog-CommandNormal');
} else {
logString += i18n.getMessage('escDshotDirectionDialog-CommandReverse');
}
gui_log(logString);
}
_spinMotor(motorIndex, value)