@robotical/webapp-types 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/src/application/ApplicationManager/ApplicationManager.d.ts +1 -1
- package/dist-types/src/application/ApplicationManager/ApplicationManager.js +3 -0
- package/dist-types/src/application/RAFTs/Cog/Cog.js +1 -1
- package/dist-types/src/application/RAFTs/Cog/PublishedDataAnalyser.js +6 -6
- package/dist-types/src/application/RAFTs/RAFT.js +1 -1
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.js +1 -1
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ export default class ApplicationManager {
|
|
|
42
42
|
* This method is called from various environments (connection button, blocksjr, blocks etc.)
|
|
43
43
|
* Known issue: connecting to a raft from within a platform won't add the newly connected raft to the connectedRafts hook
|
|
44
44
|
*/
|
|
45
|
-
connectGeneric(afterRaftConnectedCb: (raft: RAFT) => void, uuids
|
|
45
|
+
connectGeneric(afterRaftConnectedCb: (raft: RAFT) => void, uuids?: string[]): Promise<void>;
|
|
46
46
|
/**
|
|
47
47
|
* Disconnect from RAFT generic
|
|
48
48
|
* This method is called from various environments (connection button, blocksjr, blocks etc.)
|
|
@@ -137,6 +137,9 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
137
137
|
return __generator(this, function (_a) {
|
|
138
138
|
switch (_a.label) {
|
|
139
139
|
case 0:
|
|
140
|
+
if (!uuids) {
|
|
141
|
+
uuids = [ConnManager.COGUUID, ConnManager.RICUUID];
|
|
142
|
+
}
|
|
140
143
|
if (!isPhoneApp()) return [3 /*break*/, 5];
|
|
141
144
|
_a.label = 1;
|
|
142
145
|
case 1:
|
|
@@ -208,7 +208,7 @@ var Cog = /** @class */ (function (_super) {
|
|
|
208
208
|
return __generator(this, function (_a) {
|
|
209
209
|
switch (eventEnum) {
|
|
210
210
|
case RaftInfoEvents.STATE_INFO:
|
|
211
|
-
this.raftStateInfo = data;
|
|
211
|
+
this.raftStateInfo = data.stateInfo;
|
|
212
212
|
break;
|
|
213
213
|
default:
|
|
214
214
|
break;
|
|
@@ -119,7 +119,7 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
119
119
|
var _this = this;
|
|
120
120
|
this.pubSub = raftPubSubscriptionHelper(this.cog);
|
|
121
121
|
this.pubSub.subscribe(function (data) {
|
|
122
|
-
_this.analyse(data);
|
|
122
|
+
_this.analyse(data.stateInfo);
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
125
|
PublishedDataAnalyser.prototype.unsubscribeFromPublishedData = function () {
|
|
@@ -317,7 +317,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
317
317
|
this.gravityVector = [xAcc, yAcc, zAcc];
|
|
318
318
|
if (this.moveInProgress) {
|
|
319
319
|
// console.log("move detected");
|
|
320
|
-
analyser.setMovementType("move");
|
|
320
|
+
// analyser.setMovementType("move");
|
|
321
321
|
}
|
|
322
322
|
else {
|
|
323
323
|
// console.log("no move detected");
|
|
@@ -326,7 +326,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
326
326
|
this.moveInProgress = false;
|
|
327
327
|
this.shakeInProgress = false;
|
|
328
328
|
this.sensorBundles = [];
|
|
329
|
-
return this.
|
|
329
|
+
return this.shakeInProgress;
|
|
330
330
|
}
|
|
331
331
|
else {
|
|
332
332
|
//console.log("move in progrss. prev state: ", this.moveInProgress);
|
|
@@ -351,7 +351,7 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
351
351
|
if (this.sensorBundles.length > this.thresholdShakeNumber) {
|
|
352
352
|
// console.log("Shake detected!");
|
|
353
353
|
this.sensorBundles = [];
|
|
354
|
-
this.shakeInProgress =
|
|
354
|
+
this.shakeInProgress = true;
|
|
355
355
|
analyser.setMovementType("shake");
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -363,11 +363,11 @@ var ShakeDetector = /** @class */ (function () {
|
|
|
363
363
|
this.sensorBundles = [];
|
|
364
364
|
// console.log("resetting shake detector. Move detected");
|
|
365
365
|
// fire move detector
|
|
366
|
-
analyser.setMovementType("
|
|
366
|
+
analyser.setMovementType("none");
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return this.
|
|
370
|
+
return this.shakeInProgress;
|
|
371
371
|
/*
|
|
372
372
|
if (this.sensorBundles.length === 0 || timestamp - this.lastTime > this.interval) {
|
|
373
373
|
// Check if we should reset based on time since last recorded shake
|
|
@@ -324,7 +324,7 @@ var RAFT = /** @class */ (function () {
|
|
|
324
324
|
return __generator(this, function (_a) {
|
|
325
325
|
switch (eventEnum) {
|
|
326
326
|
case RaftInfoEvents.STATE_INFO:
|
|
327
|
-
this.raftStateInfo = data;
|
|
327
|
+
this.raftStateInfo = data.stateInfo;
|
|
328
328
|
break;
|
|
329
329
|
case RaftInfoEvents.SYSTEM_INFO:
|
|
330
330
|
this.systemInfo = data.systemInfo;
|
|
@@ -193,7 +193,7 @@ var CogConnector = /** @class */ (function (_super) {
|
|
|
193
193
|
light: CogPublishedDataGetter.getLightData(stateInfo.deviceManager),
|
|
194
194
|
gyroscope: CogPublishedDataGetter.getGyroscopeData(stateInfo.deviceManager)
|
|
195
195
|
};
|
|
196
|
-
this.publish("raftinfo", RaftInfoEvents.STATE_INFO, "StateInfo", simplifiedInfo);
|
|
196
|
+
this.publish("raftinfo", RaftInfoEvents.STATE_INFO, "StateInfo", { stateInfo: simplifiedInfo });
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
break;
|