@robotical/webapp-types 3.17.7 → 3.17.10
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.
|
@@ -53,6 +53,8 @@ export default class ApplicationManager {
|
|
|
53
53
|
constructor();
|
|
54
54
|
getDeviceInfo(): Promise<void>;
|
|
55
55
|
updateRaftNameInAllStates(raftId: string, name: string): Promise<boolean>;
|
|
56
|
+
private getConnectedRaftName;
|
|
57
|
+
private addConnectedRaftToContext;
|
|
56
58
|
pauseWifiConnectionMarty(raftId: string, pause: boolean): Promise<boolean>;
|
|
57
59
|
getCachedWifiStatusMarty(martyId: string): RaftWifiConnStatus | undefined;
|
|
58
60
|
wifiConnectMarty(martyId: string, ssid: string, password: string): Promise<boolean>;
|
|
@@ -169,15 +169,19 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
169
169
|
};
|
|
170
170
|
ApplicationManager.prototype.updateRaftNameInAllStates = function (raftId, name) {
|
|
171
171
|
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
-
var wasSuccessful;
|
|
172
|
+
var raft, wasSuccessful;
|
|
173
173
|
return __generator(this, function (_a) {
|
|
174
174
|
switch (_a.label) {
|
|
175
175
|
case 0:
|
|
176
|
-
|
|
177
|
-
return [
|
|
176
|
+
raft = this.connectedRafts[raftId];
|
|
177
|
+
if (!raft) return [3 /*break*/, 2];
|
|
178
|
+
return [4 /*yield*/, raft.setRaftName(name)];
|
|
178
179
|
case 1:
|
|
179
180
|
wasSuccessful = _a.sent();
|
|
180
181
|
if (wasSuccessful) {
|
|
182
|
+
if (raft.systemInfo) {
|
|
183
|
+
raft.systemInfo.Friendly = name;
|
|
184
|
+
}
|
|
181
185
|
this.connectedRaftsContext.forEach(function (connectedRaft) {
|
|
182
186
|
if (connectedRaft.id === raftId) {
|
|
183
187
|
connectedRaft.name = name;
|
|
@@ -197,6 +201,49 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
197
201
|
});
|
|
198
202
|
});
|
|
199
203
|
};
|
|
204
|
+
ApplicationManager.prototype.getConnectedRaftName = function (raft) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
206
|
+
var cachedName, error_1;
|
|
207
|
+
return __generator(this, function (_a) {
|
|
208
|
+
switch (_a.label) {
|
|
209
|
+
case 0:
|
|
210
|
+
cachedName = raft.getFriendlyName();
|
|
211
|
+
if (cachedName) {
|
|
212
|
+
return [2 /*return*/, cachedName];
|
|
213
|
+
}
|
|
214
|
+
_a.label = 1;
|
|
215
|
+
case 1:
|
|
216
|
+
_a.trys.push([1, 3, , 4]);
|
|
217
|
+
return [4 /*yield*/, raft.getRaftName()];
|
|
218
|
+
case 2: return [2 /*return*/, (_a.sent()) || ""];
|
|
219
|
+
case 3:
|
|
220
|
+
error_1 = _a.sent();
|
|
221
|
+
Logger.warn(SHOW_LOGS, TAG, "Failed to read RAFT name for ".concat(raft.id, ": ").concat(error_1));
|
|
222
|
+
return [2 /*return*/, ""];
|
|
223
|
+
case 4: return [2 /*return*/];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
ApplicationManager.prototype.addConnectedRaftToContext = function (raft) {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
230
|
+
var name;
|
|
231
|
+
return __generator(this, function (_a) {
|
|
232
|
+
switch (_a.label) {
|
|
233
|
+
case 0: return [4 /*yield*/, this.getConnectedRaftName(raft)];
|
|
234
|
+
case 1:
|
|
235
|
+
name = _a.sent();
|
|
236
|
+
this.connectedRaftContextMethods.addConnectedRaft({
|
|
237
|
+
id: raft.id,
|
|
238
|
+
type: raft.type,
|
|
239
|
+
name: name,
|
|
240
|
+
isSelected: true,
|
|
241
|
+
});
|
|
242
|
+
return [2 /*return*/];
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
};
|
|
200
247
|
//======================//
|
|
201
248
|
/* MARTY WIFI */
|
|
202
249
|
//======================//
|
|
@@ -478,10 +525,17 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
478
525
|
case 4:
|
|
479
526
|
_a.sent();
|
|
480
527
|
return [3 /*break*/, 7];
|
|
481
|
-
case 5: return [4 /*yield*/, window.applicationManager.startDiscovery(function (newRaft) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
528
|
+
case 5: return [4 /*yield*/, window.applicationManager.startDiscovery(function (newRaft) { return __awaiter(_this, void 0, void 0, function () {
|
|
529
|
+
return __generator(this, function (_a) {
|
|
530
|
+
switch (_a.label) {
|
|
531
|
+
case 0: return [4 /*yield*/, this.addConnectedRaftToContext(newRaft)];
|
|
532
|
+
case 1:
|
|
533
|
+
_a.sent();
|
|
534
|
+
afterRaftConnectedCb(newRaft);
|
|
535
|
+
return [2 /*return*/];
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}); }, uuids)];
|
|
485
539
|
case 6:
|
|
486
540
|
_a.sent();
|
|
487
541
|
_a.label = 7;
|
|
@@ -490,28 +544,30 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
490
544
|
e_1 = _a.sent();
|
|
491
545
|
Logger.error(SHOW_LOGS, TAG, "Failed to start discovery: ".concat(e_1));
|
|
492
546
|
return [3 /*break*/, 9];
|
|
493
|
-
case 9: return [3 /*break*/,
|
|
547
|
+
case 9: return [3 /*break*/, 17];
|
|
494
548
|
case 10:
|
|
495
549
|
secondaryModalState.setModal(createElement(ConnectingLoadingSpinnerModal, {}), i18n.t("connection.connecting_msg"), false);
|
|
496
550
|
_a.label = 11;
|
|
497
551
|
case 11:
|
|
498
|
-
_a.trys.push([11,
|
|
552
|
+
_a.trys.push([11, 15, , 16]);
|
|
499
553
|
return [4 /*yield*/, window.applicationManager.connectToRIC(RaftConnectionMethod.WEB_BLE, uuids, isQRVerification)];
|
|
500
554
|
case 12:
|
|
501
555
|
newRaft = _a.sent();
|
|
502
|
-
if (newRaft)
|
|
503
|
-
|
|
504
|
-
afterRaftConnectedCb(newRaft);
|
|
505
|
-
}
|
|
506
|
-
return [3 /*break*/, 14];
|
|
556
|
+
if (!newRaft) return [3 /*break*/, 14];
|
|
557
|
+
return [4 /*yield*/, this.addConnectedRaftToContext(newRaft)];
|
|
507
558
|
case 13:
|
|
559
|
+
_a.sent();
|
|
560
|
+
afterRaftConnectedCb(newRaft);
|
|
561
|
+
_a.label = 14;
|
|
562
|
+
case 14: return [3 /*break*/, 16];
|
|
563
|
+
case 15:
|
|
508
564
|
e_2 = _a.sent();
|
|
509
565
|
Logger.error(SHOW_LOGS, TAG, "Failed to connect to new robot: ".concat(e_2));
|
|
510
|
-
return [3 /*break*/,
|
|
511
|
-
case
|
|
566
|
+
return [3 /*break*/, 16];
|
|
567
|
+
case 16:
|
|
512
568
|
secondaryModalState.closeModalWithoutAnimation();
|
|
513
|
-
_a.label =
|
|
514
|
-
case
|
|
569
|
+
_a.label = 17;
|
|
570
|
+
case 17: return [2 /*return*/];
|
|
515
571
|
}
|
|
516
572
|
});
|
|
517
573
|
});
|
|
@@ -812,35 +868,37 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
812
868
|
if (foundRICs.length > 0) {
|
|
813
869
|
return [2 /*return*/];
|
|
814
870
|
}
|
|
815
|
-
if (!discoveredDevice._serviceUUIDs.includes(uuids[0])) return [3 /*break*/,
|
|
871
|
+
if (!discoveredDevice._serviceUUIDs.includes(uuids[0])) return [3 /*break*/, 8];
|
|
816
872
|
foundRICs.push(discoveredDevice);
|
|
817
873
|
return [4 /*yield*/, this.selectRaft(discoveredDevice, RaftConnectionMethod.PHONE_BLE)];
|
|
818
874
|
case 1:
|
|
819
875
|
newRaft = _b.sent();
|
|
820
|
-
if (!newRaft) return [3 /*break*/,
|
|
876
|
+
if (!newRaft) return [3 /*break*/, 7];
|
|
821
877
|
secondaryModalState.closeModalWithoutAnimation();
|
|
822
|
-
|
|
878
|
+
return [4 /*yield*/, this.addConnectedRaftToContext(newRaft)];
|
|
879
|
+
case 2:
|
|
880
|
+
_b.sent();
|
|
823
881
|
afterRaftConnectedCb(newRaft);
|
|
824
882
|
oldColours = newRaft._ledLcdColours;
|
|
825
883
|
newRaft._ledLcdColours = [];
|
|
826
|
-
if (!isPhoneApp()) return [3 /*break*/,
|
|
884
|
+
if (!isPhoneApp()) return [3 /*break*/, 4];
|
|
827
885
|
return [4 /*yield*/, newRaft.verifyRaftPhoneApp(discoveredDevice)];
|
|
828
|
-
case
|
|
886
|
+
case 3:
|
|
829
887
|
_b.sent();
|
|
830
|
-
return [3 /*break*/,
|
|
831
|
-
case
|
|
832
|
-
case 4:
|
|
833
|
-
_b.sent();
|
|
834
|
-
_b.label = 5;
|
|
888
|
+
return [3 /*break*/, 6];
|
|
889
|
+
case 4: return [4 /*yield*/, newRaft.verifyRaft()];
|
|
835
890
|
case 5:
|
|
891
|
+
_b.sent();
|
|
892
|
+
_b.label = 6;
|
|
893
|
+
case 6:
|
|
836
894
|
newRaft._ledLcdColours = oldColours;
|
|
837
895
|
newRaft.stopVerifyingRaft(true);
|
|
838
896
|
raftFoundSubscriptionHelper().unsubscribe();
|
|
839
|
-
return [3 /*break*/,
|
|
840
|
-
case
|
|
897
|
+
return [3 /*break*/, 8];
|
|
898
|
+
case 7:
|
|
841
899
|
foundRICs = [];
|
|
842
|
-
_b.label =
|
|
843
|
-
case
|
|
900
|
+
_b.label = 8;
|
|
901
|
+
case 8: return [2 /*return*/];
|
|
844
902
|
}
|
|
845
903
|
});
|
|
846
904
|
});
|
package/dist-types/src/i18n.js
CHANGED
|
@@ -3124,7 +3124,7 @@ var resources = {
|
|
|
3124
3124
|
"warranty_terms": "Garantivilkår"
|
|
3125
3125
|
},
|
|
3126
3126
|
"update_raft_name": {
|
|
3127
|
-
"current_name": "Nuværende navn: {{
|
|
3127
|
+
"current_name": "Nuværende navn: {{name}}",
|
|
3128
3128
|
"update": "OPDATER NAVN",
|
|
3129
3129
|
"updating": "Opdaterer navn..."
|
|
3130
3130
|
},
|
|
@@ -3516,7 +3516,7 @@ var resources = {
|
|
|
3516
3516
|
"warranty_terms": "Garantivilkår"
|
|
3517
3517
|
},
|
|
3518
3518
|
"update_raft_name": {
|
|
3519
|
-
"current_name": "Nåværende navn: {{
|
|
3519
|
+
"current_name": "Nåværende navn: {{name}}",
|
|
3520
3520
|
"update": "OPPDATERING AV NAVN",
|
|
3521
3521
|
"updating": "Oppdaterer navn ..."
|
|
3522
3522
|
},
|
|
@@ -4692,7 +4692,7 @@ var resources = {
|
|
|
4692
4692
|
"warranty_terms": "Garantivillkor"
|
|
4693
4693
|
},
|
|
4694
4694
|
"update_raft_name": {
|
|
4695
|
-
"current_name": "Nuvarande namn: {{
|
|
4695
|
+
"current_name": "Nuvarande namn: {{name}}",
|
|
4696
4696
|
"update": "UPPDATERA NAMN",
|
|
4697
4697
|
"updating": "Uppdaterar namn..."
|
|
4698
4698
|
},
|