mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
satisfy linter
This commit is contained in:
parent
deab7dd209
commit
a0cccba3be
1 changed files with 22 additions and 26 deletions
|
@ -3,8 +3,6 @@ const BlockType = require('../../extension-support/block-type');
|
||||||
const log = require('../../util/log');
|
const log = require('../../util/log');
|
||||||
// const cast = require('../../util/cast');
|
// const cast = require('../../util/cast');
|
||||||
const formatMessage = require('format-message');
|
const formatMessage = require('format-message');
|
||||||
const BLE = require('../../io/ble');
|
|
||||||
const Base64Util = require('../../util/base64-util');
|
|
||||||
// const ScratchLinkProxy = require('./scratch-link-proxy');
|
// const ScratchLinkProxy = require('./scratch-link-proxy');
|
||||||
const createDevice = require('@vernier/godirect').default.createDevice;
|
const createDevice = require('@vernier/godirect').default.createDevice;
|
||||||
|
|
||||||
|
@ -56,10 +54,10 @@ class GdxFor {
|
||||||
force: 0,
|
force: 0,
|
||||||
accelerationX: 0,
|
accelerationX: 0,
|
||||||
accelerationY: 0,
|
accelerationY: 0,
|
||||||
accelerationX: 0,
|
accelerationZ: 0,
|
||||||
angularVelocityX: 0,
|
angularVelocityX: 0,
|
||||||
angularVelocityY: 0,
|
angularVelocityY: 0,
|
||||||
angularVelocityX: 0,
|
angularVelocityZ: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
this.disconnect = this.disconnect.bind(this);
|
this.disconnect = this.disconnect.bind(this);
|
||||||
|
@ -80,9 +78,8 @@ class GdxFor {
|
||||||
navigator.bluetooth.requestDevice({
|
navigator.bluetooth.requestDevice({
|
||||||
filters: [{namePrefix: 'GDX'}],
|
filters: [{namePrefix: 'GDX'}],
|
||||||
optionalServices: ['d91714ef-28b9-4f91-ba16-f0d9a604f112']
|
optionalServices: ['d91714ef-28b9-4f91-ba16-f0d9a604f112']
|
||||||
}).then((bleWbtDevice) => {
|
}).then(bleWbtDevice => createDevice(bleWbtDevice, {open: false}))
|
||||||
return createDevice(bleWbtDevice, {open: false});
|
.then(device => {
|
||||||
}).then((device) => {
|
|
||||||
this._ble = device;
|
this._ble = device;
|
||||||
this._ble.open(false); // false prevents starting of measurements
|
this._ble.open(false); // false prevents starting of measurements
|
||||||
this._ble.on('device-opened', this._onConnect);
|
this._ble.on('device-opened', this._onConnect);
|
||||||
|
@ -133,11 +130,11 @@ class GdxFor {
|
||||||
sensor.setEnabled(true);
|
sensor.setEnabled(true);
|
||||||
|
|
||||||
// do some calculations here?
|
// do some calculations here?
|
||||||
sensor.on('value-changed', (sensor) => {
|
sensor.on('value-changed', changedSensor => {
|
||||||
|
|
||||||
// We don't need this list, essentially.
|
// We don't need this list, essentially.
|
||||||
if (sensor.values.length > 1000) {
|
if (changedSensor.values.length > 1000) {
|
||||||
sensor.clear();
|
changedSensor.clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -379,7 +376,7 @@ class Scratch3GdxForBlocks {
|
||||||
],
|
],
|
||||||
menus: {
|
menus: {
|
||||||
directionOptions: this.DIRECTIONS_MENU,
|
directionOptions: this.DIRECTIONS_MENU,
|
||||||
compareOptions: this.COMPARE_MENU,
|
compareOptions: this.COMPARE_MENU
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -394,7 +391,6 @@ class Scratch3GdxForBlocks {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
getAcceleration (args) {
|
getAcceleration (args) {
|
||||||
console.log(args);
|
|
||||||
switch (args.DIRECTION) {
|
switch (args.DIRECTION) {
|
||||||
case 'x':
|
case 'x':
|
||||||
return this._peripheral.getAccelerationX();
|
return this._peripheral.getAccelerationX();
|
||||||
|
|
Loading…
Reference in a new issue