@robotical/webapp-types 1.0.8 → 1.0.9
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/analytics/AnalyticsManager.d.ts +28 -0
- package/dist-types/src/analytics/AnalyticsManager.js +171 -0
- package/dist-types/src/application/ApplicationManager/ApplicationManager.d.ts +8 -2
- package/dist-types/src/application/ApplicationManager/ApplicationManager.js +23 -8
- package/dist-types/src/application/RAFTs/Cog/Cog.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Cog/Cog.js +1 -1
- package/dist-types/src/application/RAFTs/Cog/PublishedDataGetter.d.ts +1 -1
- package/dist-types/src/application/RAFTs/Cog/PublishedDataGetter.js +1 -1
- package/dist-types/src/application/RAFTs/Marty/Marty.d.ts +5 -3
- package/dist-types/src/application/RAFTs/Marty/Marty.js +24 -16
- package/dist-types/src/application/RAFTs/RAFT.d.ts +5 -1
- package/dist-types/src/application/RAFTs/RAFT.js +30 -1
- package/dist-types/src/application/RAFTs/RAFTInterface.d.ts +1 -1
- package/dist-types/src/application/RAFTs/RaftObserver.d.ts +1 -1
- package/dist-types/src/application/RAFTs/raft-subscription-helpers.js +1 -1
- package/dist-types/src/components/modals/DisconnectConfirmation/index.js +3 -1
- package/dist-types/src/components/modals/VerificationModal/index.js +1 -1
- package/dist-types/src/components/modals/VerificationModalPhoneApp/index.js +1 -1
- package/dist-types/src/components/oneoffs/LEDs/index.js +1 -1
- package/dist-types/src/components/oneoffs/RaftSignal/index.d.ts +7 -0
- package/dist-types/src/components/oneoffs/{RICSignal → RaftSignal}/index.js +2 -2
- package/dist-types/src/state-observables/modal/ModalState.d.ts +1 -0
- package/dist-types/src/state-observables/modal/ModalState.js +1 -0
- package/dist-types/src/store/SelectedRaftContext.d.ts +2 -0
- package/dist-types/src/store/SelectedRaftContext.js +2 -1
- package/dist-types/src/wrapper-app/WrapperAppManager.d.ts +2 -2
- package/dist-types/src/wrapper-app/WrapperAppManager.js +3 -3
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/CogConnector/CogConnector.js +1 -1
- package/dist-types/src/wrapper-app/connectors/Connector.d.ts +2 -2
- package/dist-types/src/wrapper-app/connectors/Connector.js +1 -1
- package/dist-types/src/wrapper-app/connectors/ConnectorInterface.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.d.ts +1 -1
- package/dist-types/src/wrapper-app/connectors/MartyConnector/MartyConnector.js +1 -1
- package/package.json +1 -1
- package/dist-types/src/components/oneoffs/RICSignal/index.d.ts +0 -7
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnalyticsManager
|
|
3
|
+
*
|
|
4
|
+
* This class is responsible for managing the analytics services for the testing phase.
|
|
5
|
+
* Analytics gathered:
|
|
6
|
+
* - Connections
|
|
7
|
+
* - Disconnections
|
|
8
|
+
* - Visited pages
|
|
9
|
+
* - emoji feedback
|
|
10
|
+
* - text feedback
|
|
11
|
+
*
|
|
12
|
+
* Each of them will be stored as an event. They will stored in the order they were received so we can track the user's journey.
|
|
13
|
+
* There will be a timestamp for each event.
|
|
14
|
+
*
|
|
15
|
+
* We store client's id in a cookie so we can track the user's journey.
|
|
16
|
+
*/
|
|
17
|
+
type EventType = "connection" | "disconnection" | "page" | "emojifeedback" | "textfeedback" | "connection_issue" | "connection_issue_resolved";
|
|
18
|
+
export declare class AnalyticsManager {
|
|
19
|
+
private static instance;
|
|
20
|
+
private clientId;
|
|
21
|
+
private eventsStorer;
|
|
22
|
+
private constructor();
|
|
23
|
+
static getInstance(): AnalyticsManager;
|
|
24
|
+
private getClientId;
|
|
25
|
+
private generateClientId;
|
|
26
|
+
logEvent(eventType: EventType, data: any): void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnalyticsManager
|
|
3
|
+
*
|
|
4
|
+
* This class is responsible for managing the analytics services for the testing phase.
|
|
5
|
+
* Analytics gathered:
|
|
6
|
+
* - Connections
|
|
7
|
+
* - Disconnections
|
|
8
|
+
* - Visited pages
|
|
9
|
+
* - emoji feedback
|
|
10
|
+
* - text feedback
|
|
11
|
+
*
|
|
12
|
+
* Each of them will be stored as an event. They will stored in the order they were received so we can track the user's journey.
|
|
13
|
+
* There will be a timestamp for each event.
|
|
14
|
+
*
|
|
15
|
+
* We store client's id in a cookie so we can track the user's journey.
|
|
16
|
+
*/
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var AnalyticsManager = /** @class */ (function () {
|
|
65
|
+
function AnalyticsManager() {
|
|
66
|
+
this.clientId = this.getClientId();
|
|
67
|
+
this.eventsStorer = new EventsStorer(this.clientId);
|
|
68
|
+
}
|
|
69
|
+
AnalyticsManager.getInstance = function () {
|
|
70
|
+
if (!AnalyticsManager.instance) {
|
|
71
|
+
AnalyticsManager.instance = new AnalyticsManager();
|
|
72
|
+
}
|
|
73
|
+
return AnalyticsManager.instance;
|
|
74
|
+
};
|
|
75
|
+
AnalyticsManager.prototype.getClientId = function () {
|
|
76
|
+
var clientId = localStorage.getItem('@robotical/webapp/analytics/clientId');
|
|
77
|
+
if (!clientId) {
|
|
78
|
+
clientId = this.generateClientId();
|
|
79
|
+
localStorage.setItem('@robotical/webapp/analytics/clientId', clientId);
|
|
80
|
+
}
|
|
81
|
+
return clientId;
|
|
82
|
+
};
|
|
83
|
+
AnalyticsManager.prototype.generateClientId = function () {
|
|
84
|
+
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
85
|
+
};
|
|
86
|
+
AnalyticsManager.prototype.logEvent = function (eventType, data) {
|
|
87
|
+
var event = new AnalyticsEvent(eventType, data);
|
|
88
|
+
this.eventsStorer.addEvent(event);
|
|
89
|
+
};
|
|
90
|
+
return AnalyticsManager;
|
|
91
|
+
}());
|
|
92
|
+
export { AnalyticsManager };
|
|
93
|
+
var AnalyticsEvent = /** @class */ (function () {
|
|
94
|
+
function AnalyticsEvent(type, data) {
|
|
95
|
+
this.type = type;
|
|
96
|
+
this.data = data;
|
|
97
|
+
this.isProcessed = false;
|
|
98
|
+
this.timestamp = new Date().toString();
|
|
99
|
+
this.urlSafeTimestamp = new Date().toISOString().replaceAll("T", "_").replaceAll(":", "-").replaceAll("/", "-").replaceAll(".", "_");
|
|
100
|
+
}
|
|
101
|
+
AnalyticsEvent.prototype.process = function () {
|
|
102
|
+
this.isProcessed = true;
|
|
103
|
+
};
|
|
104
|
+
return AnalyticsEvent;
|
|
105
|
+
}());
|
|
106
|
+
var EventsStorer = /** @class */ (function () {
|
|
107
|
+
function EventsStorer(clientId) {
|
|
108
|
+
this.clientId = clientId;
|
|
109
|
+
this.events = [];
|
|
110
|
+
this.processing = false;
|
|
111
|
+
}
|
|
112
|
+
EventsStorer.prototype.addEvent = function (event) {
|
|
113
|
+
this.events.push(event);
|
|
114
|
+
this._processEvents();
|
|
115
|
+
};
|
|
116
|
+
EventsStorer.prototype._processEvents = function () {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var _i, _a, event_1;
|
|
119
|
+
return __generator(this, function (_b) {
|
|
120
|
+
switch (_b.label) {
|
|
121
|
+
case 0:
|
|
122
|
+
if (this.processing)
|
|
123
|
+
return [2 /*return*/];
|
|
124
|
+
this.processing = true;
|
|
125
|
+
_i = 0, _a = this.events;
|
|
126
|
+
_b.label = 1;
|
|
127
|
+
case 1:
|
|
128
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
129
|
+
event_1 = _a[_i];
|
|
130
|
+
if (!!event_1.isProcessed) return [3 /*break*/, 3];
|
|
131
|
+
this._processEvent(event_1);
|
|
132
|
+
return [4 /*yield*/, this._delay(1000)];
|
|
133
|
+
case 2:
|
|
134
|
+
_b.sent(); // 1 second debounce time
|
|
135
|
+
_b.label = 3;
|
|
136
|
+
case 3:
|
|
137
|
+
_i++;
|
|
138
|
+
return [3 /*break*/, 1];
|
|
139
|
+
case 4:
|
|
140
|
+
this.processing = false;
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
EventsStorer.prototype._delay = function (ms) {
|
|
147
|
+
return new Promise(function (resolve) { return setTimeout(resolve, ms); });
|
|
148
|
+
};
|
|
149
|
+
EventsStorer.prototype._processEvent = function (event) {
|
|
150
|
+
event.process();
|
|
151
|
+
var data = __assign(__assign(__assign({}, event), event.data), { data: undefined, isProcessed: undefined, urlSafeTimestamp: undefined });
|
|
152
|
+
var path = "".concat(this.clientId, "/").concat(event.urlSafeTimestamp, "-").concat(event.type);
|
|
153
|
+
FirebaseInteractor.put(path, data);
|
|
154
|
+
};
|
|
155
|
+
return EventsStorer;
|
|
156
|
+
}());
|
|
157
|
+
var FirebaseInteractor = /** @class */ (function () {
|
|
158
|
+
function FirebaseInteractor() {
|
|
159
|
+
}
|
|
160
|
+
FirebaseInteractor.put = function (path, data) {
|
|
161
|
+
fetch("".concat(this.db_href, "/").concat(path, ".json"), {
|
|
162
|
+
method: 'PUT',
|
|
163
|
+
body: JSON.stringify(data),
|
|
164
|
+
headers: {
|
|
165
|
+
'Content-Type': 'application/json'
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
FirebaseInteractor.db_href = "https://app-v2-analytics-default-rtdb.firebaseio.com";
|
|
170
|
+
return FirebaseInteractor;
|
|
171
|
+
}());
|
|
@@ -6,9 +6,10 @@ import Cog from "../RAFTs/Cog/Cog";
|
|
|
6
6
|
import { FOUND_RAFT_ON_DISCOVERY_RESPONSE } from "../../types/phone-app-communicator";
|
|
7
7
|
import { RaftObserver } from "../RAFTs/RaftObserver";
|
|
8
8
|
import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
9
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@
|
|
9
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
10
10
|
import { ConnectedRaftItem } from "../../store/SelectedRaftContext";
|
|
11
11
|
import Toaster from "../../utils/Toaster";
|
|
12
|
+
import { AnalyticsManager } from "../../analytics/AnalyticsManager";
|
|
12
13
|
export default class ApplicationManager {
|
|
13
14
|
private _observers;
|
|
14
15
|
static wrapperAppCommunicator: WebAppCommunicator;
|
|
@@ -16,8 +17,13 @@ export default class ApplicationManager {
|
|
|
16
17
|
[key: string]: RAFT;
|
|
17
18
|
};
|
|
18
19
|
connectedRaftsContext: ConnectedRaftItem[];
|
|
20
|
+
returnToMainApp: () => void;
|
|
21
|
+
private _router;
|
|
22
|
+
setRouter(router: any): void;
|
|
23
|
+
navigateTo(path: string): void;
|
|
19
24
|
ricSelectedCb: ((raft: RAFT) => void) | null;
|
|
20
25
|
toaster: typeof Toaster;
|
|
26
|
+
analyticsManager: AnalyticsManager;
|
|
21
27
|
showBackHomeButton: () => void;
|
|
22
28
|
hideBackHomeButton: () => void;
|
|
23
29
|
connectedRaftContextMethods: {
|
|
@@ -55,7 +61,7 @@ export default class ApplicationManager {
|
|
|
55
61
|
* Removes raft after a certain time
|
|
56
62
|
* Removes from the rics list after x seconds so that we can still get the last event
|
|
57
63
|
*/
|
|
58
|
-
|
|
64
|
+
_removeRaft(raftId: string, timeout: number): void;
|
|
59
65
|
/**
|
|
60
66
|
* Start looking for rics to connect to
|
|
61
67
|
* This is used from the Phone App only
|
|
@@ -45,11 +45,12 @@ import VerificationModal from "../../components/modals/VerificationModal";
|
|
|
45
45
|
import { raftFoundSubscriptionHelper } from "../RAFTs/raft-subscription-helpers";
|
|
46
46
|
import { AppSentMessage } from "../../types/communication-between-apps/wrapper-communication";
|
|
47
47
|
import VerificationModalPhoneApp from "../../components/modals/VerificationModalPhoneApp";
|
|
48
|
-
import { RaftChannelBLE, } from "@
|
|
48
|
+
import { RaftChannelBLE, } from "@robotical/raftjs";
|
|
49
49
|
import Logger from "../../services/logger/Logger";
|
|
50
50
|
import isPhoneApp from "../../utils/phone-app-communication/is-phone-app";
|
|
51
51
|
import DisconnectConfirmationModal from "../../components/modals/DisconnectConfirmation";
|
|
52
52
|
import Toaster from "../../utils/Toaster";
|
|
53
|
+
import { AnalyticsManager } from "../../analytics/AnalyticsManager";
|
|
53
54
|
var SHOW_LOGS = true;
|
|
54
55
|
var TAG = "ApplicationManager";
|
|
55
56
|
var ApplicationManager = /** @class */ (function () {
|
|
@@ -59,10 +60,11 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
59
60
|
// Connected RICs
|
|
60
61
|
this.connectedRafts = {};
|
|
61
62
|
this.connectedRaftsContext = [];
|
|
63
|
+
this.returnToMainApp = function () { };
|
|
62
64
|
// Callback to call when a RAFT is selected (Phone App only)
|
|
63
65
|
// We need that to make sure the connection button gets the selected RAFT once the user selects one
|
|
64
66
|
this.ricSelectedCb = null;
|
|
65
|
-
//
|
|
67
|
+
// RICNotificationsManager
|
|
66
68
|
// private _ricNotificationsManager: RICNotificationsManager = new RICNotificationsManager(
|
|
67
69
|
// this
|
|
68
70
|
// );
|
|
@@ -75,6 +77,8 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
75
77
|
// public sessionDbs = new SessionsDBManager();
|
|
76
78
|
// toaster
|
|
77
79
|
this.toaster = Toaster;
|
|
80
|
+
// Analytics Manager
|
|
81
|
+
this.analyticsManager = AnalyticsManager.getInstance();
|
|
78
82
|
this.showBackHomeButton = function () { };
|
|
79
83
|
this.hideBackHomeButton = function () { };
|
|
80
84
|
// connected raft context methods
|
|
@@ -85,10 +89,21 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
85
89
|
};
|
|
86
90
|
this.isPhoneApp = isPhoneApp;
|
|
87
91
|
// super();
|
|
88
|
-
//
|
|
92
|
+
// DatabaseManager.appStartSession();
|
|
89
93
|
this.connectGenericMarty = this.connectGenericMarty.bind(this);
|
|
90
94
|
this.connectGenericCog = this.connectGenericCog.bind(this);
|
|
91
95
|
}
|
|
96
|
+
ApplicationManager.prototype.setRouter = function (router) {
|
|
97
|
+
this._router = router;
|
|
98
|
+
};
|
|
99
|
+
ApplicationManager.prototype.navigateTo = function (path) {
|
|
100
|
+
if (this._router) {
|
|
101
|
+
this._router.navigate(path);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
Logger.error(SHOW_LOGS, TAG, "Router is not set");
|
|
105
|
+
}
|
|
106
|
+
};
|
|
92
107
|
ApplicationManager.prototype.createNewCog = function (id) {
|
|
93
108
|
return new Cog(id);
|
|
94
109
|
};
|
|
@@ -126,7 +141,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
126
141
|
case 1:
|
|
127
142
|
_a.trys.push([1, 3, , 4]);
|
|
128
143
|
return [4 /*yield*/, window.applicationManager.startDiscovery(function (newRaft) {
|
|
129
|
-
_this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, name: newRaft.getFriendlyName() || "", isSelected: true });
|
|
144
|
+
_this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
|
|
130
145
|
afterRaftConnectedCb(newRaft);
|
|
131
146
|
})];
|
|
132
147
|
case 2:
|
|
@@ -143,7 +158,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
143
158
|
case 6:
|
|
144
159
|
newRaft = _a.sent();
|
|
145
160
|
if (newRaft) {
|
|
146
|
-
this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, name: newRaft.getFriendlyName() || "", isSelected: true });
|
|
161
|
+
this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
|
|
147
162
|
afterRaftConnectedCb(newRaft);
|
|
148
163
|
}
|
|
149
164
|
return [3 /*break*/, 8];
|
|
@@ -292,7 +307,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
292
307
|
return [4 /*yield*/, raft.disconnect()];
|
|
293
308
|
case 1:
|
|
294
309
|
_a.sent();
|
|
295
|
-
this.
|
|
310
|
+
this._removeRaft(raftId, 3000);
|
|
296
311
|
return [2 /*return*/];
|
|
297
312
|
}
|
|
298
313
|
});
|
|
@@ -302,7 +317,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
302
317
|
* Removes raft after a certain time
|
|
303
318
|
* Removes from the rics list after x seconds so that we can still get the last event
|
|
304
319
|
*/
|
|
305
|
-
ApplicationManager.prototype.
|
|
320
|
+
ApplicationManager.prototype._removeRaft = function (raftId, timeout) {
|
|
306
321
|
var _this = this;
|
|
307
322
|
var ricRemovalTimeout = setTimeout(function () {
|
|
308
323
|
delete _this.connectedRafts[raftId];
|
|
@@ -360,7 +375,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
360
375
|
case 0: return [4 /*yield*/, ((_a = this.connectedRafts[raftId]) === null || _a === void 0 ? void 0 : _a.stopVerifyingRaft(isCorrectRIC))];
|
|
361
376
|
case 1:
|
|
362
377
|
_b.sent();
|
|
363
|
-
this.
|
|
378
|
+
this._removeRaft(raftId, 3000);
|
|
364
379
|
return [2 /*return*/];
|
|
365
380
|
}
|
|
366
381
|
});
|
|
@@ -2,7 +2,7 @@ import RAFT from "../RAFT";
|
|
|
2
2
|
import RICInterface from "../RAFTInterface";
|
|
3
3
|
import { RaftTypeE } from "../../../types/raft";
|
|
4
4
|
import { CogStateInfo, RICLedLcdColours } from "@robotical/roboticaljs";
|
|
5
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
5
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
6
6
|
import { RaftInfoEvents } from "../../../types/events/raft-info";
|
|
7
7
|
import PublishedDataAnalyser from "./PublishedDataAnalyser";
|
|
8
8
|
export declare class Cog extends RAFT implements RICInterface {
|
|
@@ -51,7 +51,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51
51
|
};
|
|
52
52
|
import RAFT from "../RAFT";
|
|
53
53
|
import { RaftTypeE } from "../../../types/raft";
|
|
54
|
-
import { deviceAttrGetLatestFormatted, RaftConnEvent, RaftPublishEvent } from "@
|
|
54
|
+
import { deviceAttrGetLatestFormatted, RaftConnEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
55
55
|
import { RaftInfoEvents } from "../../../types/events/raft-info";
|
|
56
56
|
import PublishedDataAnalyser from "./PublishedDataAnalyser";
|
|
57
57
|
var Cog = /** @class */ (function (_super) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceManager } from "@
|
|
1
|
+
import { DeviceManager } from "@robotical/raftjs/dist/web/RaftDeviceManager";
|
|
2
2
|
export default class PublishedDataGetter {
|
|
3
3
|
static getPowerData(deviceManager: DeviceManager): {
|
|
4
4
|
battV: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import RICInterface from "../RAFTInterface";
|
|
2
2
|
import { RaftTypeE } from "../../../types/raft";
|
|
3
3
|
import RAFT from "../RAFT";
|
|
4
|
-
import { RaftConnEvent, RaftPublishEvent, RaftSystemInfo, RaftUpdateEvent } from "@
|
|
4
|
+
import { RaftConnEvent, RaftPublishEvent, RaftSystemInfo, RaftUpdateEvent } from "@robotical/raftjs";
|
|
5
5
|
import { RaftInfoEvents } from "../../../types/events/raft-info";
|
|
6
6
|
import { RICLedLcdColours, RICStateInfo } from "@robotical/roboticaljs";
|
|
7
7
|
export declare class Marty extends RAFT implements RICInterface {
|
|
@@ -10,6 +10,8 @@ export declare class Marty extends RAFT implements RICInterface {
|
|
|
10
10
|
raftStateInfo: RICStateInfo | null;
|
|
11
11
|
systemInfo: RaftSystemInfo | null;
|
|
12
12
|
_ledLcdColours: RICLedLcdColours;
|
|
13
|
+
private rssiValues;
|
|
14
|
+
private MAX_RSSI_VALUES_N;
|
|
13
15
|
constructor(id: string);
|
|
14
16
|
get ledLcdColours(): RICLedLcdColours;
|
|
15
17
|
/**
|
|
@@ -25,8 +27,8 @@ export declare class Marty extends RAFT implements RICInterface {
|
|
|
25
27
|
*/
|
|
26
28
|
highlight(): Promise<void>;
|
|
27
29
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
* This methods handles RAFT events coming from the RICConnector of the wrapper
|
|
31
|
+
*/
|
|
30
32
|
handleRaftEvent(eventType: string, eventEnum: RaftConnEvent | RaftUpdateEvent | RaftPublishEvent | RaftInfoEvents, eventName: string, eventData: any): void;
|
|
31
33
|
/**
|
|
32
34
|
* Pub Event Handler
|
|
@@ -51,21 +51,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51
51
|
};
|
|
52
52
|
import { RaftTypeE } from "../../../types/raft";
|
|
53
53
|
import RAFT from "../RAFT";
|
|
54
|
-
import { RaftPublishEvent } from "@
|
|
54
|
+
import { RaftPublishEvent } from "@robotical/raftjs";
|
|
55
55
|
var Marty = /** @class */ (function (_super) {
|
|
56
56
|
__extends(Marty, _super);
|
|
57
|
-
// // Joint names
|
|
58
|
-
// private _jointNames = {
|
|
59
|
-
// LeftHip: "LeftHip",
|
|
60
|
-
// LeftTwist: "LeftTwist",
|
|
61
|
-
// LeftKnee: "LeftKnee",
|
|
62
|
-
// RightHip: "RightHip",
|
|
63
|
-
// RightTwist: "RightTwist",
|
|
64
|
-
// RightKnee: "RightKnee",
|
|
65
|
-
// LeftArm: "LeftArm",
|
|
66
|
-
// RightArm: "RightArm",
|
|
67
|
-
// Eyes: "Eyes",
|
|
68
|
-
// };
|
|
69
57
|
function Marty(id) {
|
|
70
58
|
var _this = _super.call(this, id) || this;
|
|
71
59
|
_this.id = id;
|
|
@@ -80,6 +68,20 @@ var Marty = /** @class */ (function (_super) {
|
|
|
80
68
|
{ led: "#880000", lcd: "#FF0000" },
|
|
81
69
|
{ led: "#000040", lcd: "#0080FF" },
|
|
82
70
|
];
|
|
71
|
+
// // Joint names
|
|
72
|
+
// private _jointNames = {
|
|
73
|
+
// LeftHip: "LeftHip",
|
|
74
|
+
// LeftTwist: "LeftTwist",
|
|
75
|
+
// LeftKnee: "LeftKnee",
|
|
76
|
+
// RightHip: "RightHip",
|
|
77
|
+
// RightTwist: "RightTwist",
|
|
78
|
+
// RightKnee: "RightKnee",
|
|
79
|
+
// LeftArm: "LeftArm",
|
|
80
|
+
// RightArm: "RightArm",
|
|
81
|
+
// Eyes: "Eyes",
|
|
82
|
+
// };
|
|
83
|
+
_this.rssiValues = []; // Array to store recent RSSI values
|
|
84
|
+
_this.MAX_RSSI_VALUES_N = 8; // Number of values to consider for averaging
|
|
83
85
|
return _this;
|
|
84
86
|
}
|
|
85
87
|
Object.defineProperty(Marty.prototype, "ledLcdColours", {
|
|
@@ -94,7 +96,13 @@ var Marty = /** @class */ (function (_super) {
|
|
|
94
96
|
*/
|
|
95
97
|
Marty.prototype.getRSSI = function () {
|
|
96
98
|
var _a;
|
|
97
|
-
|
|
99
|
+
var newRssi = ((_a = this.raftStateInfo) === null || _a === void 0 ? void 0 : _a.robotStatus.robotStatus.bleRSSI) || -200;
|
|
100
|
+
if (this.rssiValues.length >= this.MAX_RSSI_VALUES_N) {
|
|
101
|
+
this.rssiValues.shift();
|
|
102
|
+
}
|
|
103
|
+
this.rssiValues.push(newRssi);
|
|
104
|
+
var rssiAverage = this.rssiValues.reduce(function (sum, val) { return sum + val; }, 0) / this.rssiValues.length;
|
|
105
|
+
return this.rssiValues.reduce(function (sum, val) { return sum + val; }, 0) / this.rssiValues.length;
|
|
98
106
|
};
|
|
99
107
|
/**
|
|
100
108
|
* Gets the battery strength of the RAFT
|
|
@@ -128,8 +136,8 @@ var Marty = /** @class */ (function (_super) {
|
|
|
128
136
|
});
|
|
129
137
|
};
|
|
130
138
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
* This methods handles RAFT events coming from the RICConnector of the wrapper
|
|
140
|
+
*/
|
|
133
141
|
Marty.prototype.handleRaftEvent = function (eventType, eventEnum, eventName, eventData) {
|
|
134
142
|
_super.prototype.handleRaftEvent.call(this, eventType, eventEnum, eventName, eventData);
|
|
135
143
|
switch (eventType) {
|
|
@@ -3,7 +3,7 @@ import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
|
3
3
|
import { FOUND_RAFT_ON_DISCOVERY_RESPONSE } from "../../types/phone-app-communicator";
|
|
4
4
|
import RICInterface from "./RAFTInterface";
|
|
5
5
|
import { RaftObserver } from "./RaftObserver";
|
|
6
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent, RaftOKFail, RaftSystemInfo } from "@
|
|
6
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent, RaftOKFail, RaftSystemInfo } from "@robotical/raftjs";
|
|
7
7
|
import { CogStateInfo, RICLedLcdColours, RICStateInfo } from "@robotical/roboticaljs";
|
|
8
8
|
export default class RAFT implements RICInterface {
|
|
9
9
|
id: string;
|
|
@@ -98,6 +98,10 @@ export default class RAFT implements RICInterface {
|
|
|
98
98
|
* (to be implemented in child classes)
|
|
99
99
|
*/
|
|
100
100
|
handleRaftEvent(eventType: string, eventEnum: RaftConnEvent | RaftUpdateEvent | RaftPublishEvent | RaftInfoEvents, eventName: string, eventData: any): void;
|
|
101
|
+
/**
|
|
102
|
+
* Connection Event Handler
|
|
103
|
+
*/
|
|
104
|
+
_connectionEventHandler(eventEnum: RaftConnEvent, eventName: string, data: any): Promise<void>;
|
|
101
105
|
/**
|
|
102
106
|
* Pub Event Handler
|
|
103
107
|
*/
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { AppSentMessage } from "../../types/communication-between-apps/wrapper-communication";
|
|
38
38
|
import { RaftTypeE } from "../../types/raft";
|
|
39
39
|
import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
40
|
-
import { RaftPublishEvent, } from "@
|
|
40
|
+
import { RaftConnEvent, RaftPublishEvent, } from "@robotical/raftjs";
|
|
41
41
|
var RAFT = /** @class */ (function () {
|
|
42
42
|
function RAFT(id) {
|
|
43
43
|
this.id = id;
|
|
@@ -261,6 +261,9 @@ var RAFT = /** @class */ (function () {
|
|
|
261
261
|
*/
|
|
262
262
|
RAFT.prototype.handleRaftEvent = function (eventType, eventEnum, eventName, eventData) {
|
|
263
263
|
switch (eventType) {
|
|
264
|
+
case "conn":
|
|
265
|
+
this._connectionEventHandler(eventEnum, eventName, eventData);
|
|
266
|
+
break;
|
|
264
267
|
case "pub":
|
|
265
268
|
this._pubEventHandler(eventEnum, eventName, eventData);
|
|
266
269
|
break;
|
|
@@ -271,6 +274,32 @@ var RAFT = /** @class */ (function () {
|
|
|
271
274
|
break;
|
|
272
275
|
}
|
|
273
276
|
};
|
|
277
|
+
/**
|
|
278
|
+
* Connection Event Handler
|
|
279
|
+
*/
|
|
280
|
+
RAFT.prototype._connectionEventHandler = function (eventEnum, eventName, data) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282
|
+
return __generator(this, function (_a) {
|
|
283
|
+
switch (eventEnum) {
|
|
284
|
+
case RaftConnEvent.CONN_VERIFIED_CORRECT:
|
|
285
|
+
window.applicationManager.analyticsManager.logEvent("connection", { raftType: this.type, systemInfo: this.systemInfo });
|
|
286
|
+
break;
|
|
287
|
+
case RaftConnEvent.CONN_DISCONNECTED:
|
|
288
|
+
window.applicationManager.analyticsManager.logEvent("disconnection", { raftType: this.type });
|
|
289
|
+
break;
|
|
290
|
+
case RaftConnEvent.CONN_ISSUE_DETECTED:
|
|
291
|
+
window.applicationManager.analyticsManager.logEvent("connection_issue", { data: data });
|
|
292
|
+
break;
|
|
293
|
+
case RaftConnEvent.CONN_ISSUE_RESOLVED:
|
|
294
|
+
window.applicationManager.analyticsManager.logEvent("connection_issue_resolved", { data: data });
|
|
295
|
+
break;
|
|
296
|
+
default:
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
return [2 /*return*/];
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
};
|
|
274
303
|
/**
|
|
275
304
|
* Pub Event Handler
|
|
276
305
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RaftTypeE } from "../../types/raft";
|
|
2
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
2
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
3
3
|
import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
4
4
|
import { RICLedLcdColours } from "@robotical/roboticaljs";
|
|
5
5
|
export default abstract class RICInterface {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
2
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@
|
|
2
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
3
3
|
export interface MartyObservable {
|
|
4
4
|
subscribe(observer: RaftObserver, topics: Array<string>): void;
|
|
5
5
|
unsubscribe(observer: RaftObserver): void;
|
|
@@ -48,8 +48,10 @@ export default function DisconnectConfirmationModal(_a) {
|
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
51
|
-
if (!connectedRaft)
|
|
51
|
+
if (!connectedRaft) {
|
|
52
|
+
console.warn("No connected raft found", connectedRaft);
|
|
52
53
|
return [2 /*return*/];
|
|
54
|
+
}
|
|
53
55
|
return [4 /*yield*/, window.applicationManager.disconnectFromRaft(connectedRaft.id)];
|
|
54
56
|
case 1:
|
|
55
57
|
_a.sent();
|
|
@@ -51,7 +51,7 @@ import "./styles.css";
|
|
|
51
51
|
import { ReactComponent as BluetoothSVG } from "../../../assets/configuration/bluetooth.svg";
|
|
52
52
|
import { MAIN_BLUE } from "../../../styles/colors";
|
|
53
53
|
import modalState from "../../../state-observables/modal/ModalState";
|
|
54
|
-
import RICSignal from "../../oneoffs/
|
|
54
|
+
import RICSignal from "../../oneoffs/RaftSignal";
|
|
55
55
|
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
56
56
|
import LEDs from "../../oneoffs/LEDs";
|
|
57
57
|
import { raftConnectingSubscriptionHelper } from "../../../application/RAFTs/raft-subscription-helpers";
|
|
@@ -52,7 +52,7 @@ import { ReactComponent as BluetoothSVG } from "../../../assets/configuration/bl
|
|
|
52
52
|
import { ReactComponent as RefreshSVG } from "../../../assets/refresh.svg";
|
|
53
53
|
import { MAIN_BLUE, WHITE } from "../../../styles/colors";
|
|
54
54
|
import modalState from "../../../state-observables/modal/ModalState";
|
|
55
|
-
import RICSignal from "../../oneoffs/
|
|
55
|
+
import RICSignal from "../../oneoffs/RaftSignal";
|
|
56
56
|
import SimpleButton from "../../disposables/buttons/SimpleButton";
|
|
57
57
|
import LEDs from "../../oneoffs/LEDs";
|
|
58
58
|
import SVGImageButton from "../../disposables/buttons/SVGImageButton";
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { RaftUtils } from "@
|
|
13
|
+
import { RaftUtils } from "@robotical/raftjs";
|
|
14
14
|
import "./styles.css";
|
|
15
15
|
import { RaftTypeE } from "../../../types/raft";
|
|
16
16
|
export default function LEDs(_a) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import RAFT from "../../../application/RAFTs/RAFT";
|
|
2
|
+
type RaftSignalProps = {
|
|
3
|
+
signalStrength: number;
|
|
4
|
+
connectedRaft?: RAFT;
|
|
5
|
+
};
|
|
6
|
+
export default function RaftSignal({ signalStrength, connectedRaft }: RaftSignalProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import rescale from "../../../utils/helpers/rescale-range";
|
|
|
5
5
|
import { SCREENFREE_GREEN, SCREENFREE_YELLOW } from "../../../styles/colors";
|
|
6
6
|
import isVersionGreater from "../../../utils/helpers/compare-version";
|
|
7
7
|
import { FW_VERSION_RSSI_WIFI } from "../../../utils/helpers/wifi-configuration-subtitle-gen";
|
|
8
|
-
export default function
|
|
8
|
+
export default function RaftSignal(_a) {
|
|
9
9
|
var signalStrength = _a.signalStrength, connectedRaft = _a.connectedRaft;
|
|
10
10
|
var signalRef = useRef(null);
|
|
11
11
|
useEffect(function () {
|
|
@@ -25,5 +25,5 @@ export default function RICSignal(_a) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}, [signalStrength]);
|
|
28
|
-
return _jsx(EmptySignalSVG, { ref: signalRef, width: "
|
|
28
|
+
return _jsx(EmptySignalSVG, { ref: signalRef, width: "100%", opacity: !isVersionGreater((connectedRaft === null || connectedRaft === void 0 ? void 0 : connectedRaft.getRaftVersion()) || "100.0.0", FW_VERSION_RSSI_WIFI) ? 0.5 : 1 });
|
|
29
29
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { RaftTypeE } from '../types/raft';
|
|
1
2
|
export declare enum NewRobotIdE {
|
|
2
3
|
NEW = "=+__new__+="
|
|
3
4
|
}
|
|
4
5
|
export type ConnectedRaftItem = {
|
|
5
6
|
id: string;
|
|
6
7
|
name: string;
|
|
8
|
+
type: RaftTypeE;
|
|
7
9
|
isSelected: boolean;
|
|
8
10
|
};
|
|
9
11
|
export declare const ConnectedRaftContentProvider: ({ children }: {
|
|
@@ -20,6 +20,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
import { createContext, useContext, useEffect, useState } from 'react';
|
|
23
|
+
import { RaftTypeE } from '../types/raft';
|
|
23
24
|
export var NewRobotIdE;
|
|
24
25
|
(function (NewRobotIdE) {
|
|
25
26
|
NewRobotIdE["NEW"] = "=+__new__+=";
|
|
@@ -33,7 +34,7 @@ var ConnectedRaftContext = createContext({
|
|
|
33
34
|
// Provider component
|
|
34
35
|
export var ConnectedRaftContentProvider = function (_a) {
|
|
35
36
|
var children = _a.children;
|
|
36
|
-
var _b = useState([{ id: NewRobotIdE.NEW, isSelected: true, name: "Connect to new robot" }]), connectedRafts = _b[0], setConnectedRafts = _b[1];
|
|
37
|
+
var _b = useState([{ id: NewRobotIdE.NEW, isSelected: true, name: "Connect to new robot", type: RaftTypeE.undefined }]), connectedRafts = _b[0], setConnectedRafts = _b[1];
|
|
37
38
|
useEffect(function () {
|
|
38
39
|
if (window.applicationManager) {
|
|
39
40
|
window.applicationManager.connectedRaftContextMethods = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RaftInfoEvents } from "../types/events/raft-info";
|
|
2
2
|
import { ConnectionAttemptResults, RaftConnectionMethod } from "../types/raft";
|
|
3
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
3
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
4
4
|
import { RICLedLcdColours } from "@robotical/roboticaljs";
|
|
5
5
|
export declare class WrapperAppManager {
|
|
6
6
|
private connectors;
|
|
@@ -47,7 +47,7 @@ export declare class WrapperAppManager {
|
|
|
47
47
|
/**
|
|
48
48
|
* Send a REST message to the RAFT
|
|
49
49
|
*/
|
|
50
|
-
sendRestMessage(msg: string, params: object | undefined, raftId: string): Promise<import("@
|
|
50
|
+
sendRestMessage(msg: string, params: object | undefined, raftId: string): Promise<import("@robotical/raftjs").RaftOKFail>;
|
|
51
51
|
/**
|
|
52
52
|
* Removes marty after a certain time
|
|
53
53
|
* Removes from the martys list after x seconds so that we can still get the last event
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { WrapperSentMessage } from "../types/communication-between-apps/wrapper-communication";
|
|
38
38
|
import Logger from "../services/logger/Logger";
|
|
39
|
-
import { RaftConnEvent } from "@
|
|
39
|
+
import { RaftConnEvent } from "@robotical/raftjs";
|
|
40
40
|
import ConnectorFactory from "./connectors/ConnectorFactory";
|
|
41
41
|
var SHOW_LOGS = true;
|
|
42
42
|
var TAG = "WrapperAppManager";
|
|
@@ -116,7 +116,7 @@ var WrapperAppManager = /** @class */ (function () {
|
|
|
116
116
|
*/
|
|
117
117
|
WrapperAppManager.prototype.stopVerifyingRaft = function (isCorrectRIC, raftId) {
|
|
118
118
|
if (!isCorrectRIC) {
|
|
119
|
-
this._removeRICConnector(raftId,
|
|
119
|
+
this._removeRICConnector(raftId, 3000);
|
|
120
120
|
}
|
|
121
121
|
return this.connectors[raftId].stopVerifyingRaft(isCorrectRIC);
|
|
122
122
|
};
|
|
@@ -124,7 +124,7 @@ var WrapperAppManager = /** @class */ (function () {
|
|
|
124
124
|
* Disconnect from a RAFT
|
|
125
125
|
*/
|
|
126
126
|
WrapperAppManager.prototype.disconnect = function (raftId) {
|
|
127
|
-
this._removeRICConnector(raftId,
|
|
127
|
+
this._removeRICConnector(raftId, 3000);
|
|
128
128
|
return this.connectors[raftId].disconnect();
|
|
129
129
|
};
|
|
130
130
|
/**
|
|
@@ -2,7 +2,7 @@ import { RaftInfoEvents } from "../../../types/events/raft-info";
|
|
|
2
2
|
import { ConnectionAttemptResults, RaftTypeE } from "../../../types/raft";
|
|
3
3
|
import Connector from "../Connector";
|
|
4
4
|
import ConnectorInterface from "../ConnectorInterface";
|
|
5
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
5
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
6
6
|
import { ConnManager } from "@robotical/roboticaljs";
|
|
7
7
|
declare class CogConnector extends Connector implements ConnectorInterface {
|
|
8
8
|
type: RaftTypeE;
|
|
@@ -52,7 +52,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
import Logger from "../../../services/logger/Logger";
|
|
53
53
|
import { RaftTypeE } from "../../../types/raft";
|
|
54
54
|
import Connector from "../Connector";
|
|
55
|
-
import { RaftConnEvent, RaftUpdateEvent } from "@
|
|
55
|
+
import { RaftConnEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
56
56
|
var SHOW_LOGS = true;
|
|
57
57
|
var TAG = "CogConnector";
|
|
58
58
|
var CogConnector = /** @class */ (function (_super) {
|
|
@@ -2,7 +2,7 @@ import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
|
2
2
|
import { ConnectionAttemptResults, RaftTypeE } from "../../types/raft";
|
|
3
3
|
import ConnectorInterface from "./ConnectorInterface";
|
|
4
4
|
import { ConnManager, RICLedLcdColours } from "@robotical/roboticaljs";
|
|
5
|
-
import { RaftOKFail, RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@
|
|
5
|
+
import { RaftOKFail, RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
6
6
|
declare class Connector implements ConnectorInterface {
|
|
7
7
|
id: string;
|
|
8
8
|
type: RaftTypeE;
|
|
@@ -16,7 +16,7 @@ declare class Connector implements ConnectorInterface {
|
|
|
16
16
|
/**
|
|
17
17
|
* Get connected raft info
|
|
18
18
|
*/
|
|
19
|
-
getSystemInfo(): Promise<import("@
|
|
19
|
+
getSystemInfo(): Promise<import("@robotical/raftjs").RaftSystemInfo>;
|
|
20
20
|
/**
|
|
21
21
|
* Gets the RAFT name
|
|
22
22
|
*/
|
|
@@ -38,7 +38,7 @@ import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
|
38
38
|
import { WrapperSentMessage } from "../../types/communication-between-apps/wrapper-communication";
|
|
39
39
|
import Logger from "../../services/logger/Logger";
|
|
40
40
|
import { RaftTypeE } from "../../types/raft";
|
|
41
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@
|
|
41
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
42
42
|
var SHOW_LOGS = true;
|
|
43
43
|
var TAG = "Connector";
|
|
44
44
|
var Connector = /** @class */ (function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@
|
|
1
|
+
import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robotical/raftjs";
|
|
2
2
|
import { ConnectionAttemptResults, RaftTypeE } from "../../types/raft";
|
|
3
3
|
import { RaftInfoEvents } from "../../types/events/raft-info";
|
|
4
4
|
import { RICLedLcdColours } from "@robotical/roboticaljs";
|
|
@@ -2,7 +2,7 @@ import { RaftInfoEvents } from "../../../types/events/raft-info";
|
|
|
2
2
|
import { ConnectionAttemptResults, RaftTypeE } from "../../../types/raft";
|
|
3
3
|
import Connector from "../Connector";
|
|
4
4
|
import ConnectorInterface from "../ConnectorInterface";
|
|
5
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@
|
|
5
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent } from "@robotical/raftjs";
|
|
6
6
|
import { ConnManager } from "@robotical/roboticaljs";
|
|
7
7
|
declare class MartyConnector extends Connector implements ConnectorInterface {
|
|
8
8
|
type: RaftTypeE;
|
|
@@ -53,7 +53,7 @@ import { RICRoboticalAddOns } from "@robotical/ricjs-robotical-addons";
|
|
|
53
53
|
import Logger from "../../../services/logger/Logger";
|
|
54
54
|
import { RaftTypeE } from "../../../types/raft";
|
|
55
55
|
import Connector from "../Connector";
|
|
56
|
-
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent, } from "@
|
|
56
|
+
import { RaftConnEvent, RaftUpdateEvent, RaftPublishEvent, } from "@robotical/raftjs";
|
|
57
57
|
import { RICServoParamUpdater, RICSystemUtils, } from "@robotical/roboticaljs";
|
|
58
58
|
var SHOW_LOGS = true;
|
|
59
59
|
var TAG = "MartyConnector";
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import RAFT from "../../../application/RAFTs/RAFT";
|
|
2
|
-
type RICSignlaProps = {
|
|
3
|
-
signalStrength: number;
|
|
4
|
-
connectedRaft?: RAFT;
|
|
5
|
-
};
|
|
6
|
-
export default function RICSignal({ signalStrength, connectedRaft }: RICSignlaProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|