Skip to content

Commit

Permalink
Execute prettier (#4291)
Browse files Browse the repository at this point in the history
* Execute prettier

* Fix some sonar complaints

* Add git blame ignore rev
  • Loading branch information
haslinghuis authored Jan 4, 2025
1 parent 8e3e419 commit 7614ad3
Show file tree
Hide file tree
Showing 180 changed files with 20,863 additions and 18,937 deletions.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file allows ignoring commits in git blame view on Github.
# For more info, see here:
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view

# Execute prettier
335719b7b7d90676d76b516f67589a0389adceaa
37 changes: 14 additions & 23 deletions src/components/EscDshotDirection/EscDshotCommandQueue.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,49 @@
import MSP from '../../js/msp.js';
import MSP from "../../js/msp.js";

class EscDshotCommandQueue
{
constructor (intervalMs)
{
class EscDshotCommandQueue {
constructor(intervalMs) {
this._intervalId = null;
this._interval = intervalMs;
this._queue = [];
this._purging = false;
}

pushCommand(command, buffer)
{
pushCommand(command, buffer) {
this._queue.push([command, buffer]);
}

pushPause(milliseconds)
{
pushPause(milliseconds) {
const counter = Math.ceil(milliseconds / this._interval);

for (let i = 0; i < counter; i++) {
this.pushCommand(null, null);
}
}

start()
{
start() {
if (null === this._intervalId) {
this._intervalId = setInterval(
() => { this._checkQueue(); },
this._interval);
this._intervalId = setInterval(() => {
this._checkQueue();
}, this._interval);
}
}

stop()
{
if(null !== this._intervalId) {
stop() {
if (null !== this._intervalId) {
clearInterval(this._intervalId);
this._intervalId = null;
}
}

stopWhenEmpty()
{
stopWhenEmpty() {
this._purging = true;
}

clear()
{
clear() {
this._queue = [];
}

_checkQueue()
{
_checkQueue() {
if (0 !== this._queue.length) {
const command = this._queue.shift();

Expand Down
Loading

0 comments on commit 7614ad3

Please sign in to comment.