@robotical/webapp-types 3.7.25 → 3.7.27
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.
|
@@ -521,13 +521,13 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
521
521
|
ApplicationManager.prototype.connectToRIC = function (method, uuids, withoutVerification) {
|
|
522
522
|
var _a, _b;
|
|
523
523
|
return __awaiter(this, void 0, void 0, function () {
|
|
524
|
-
var wasConnectedObj, raftId, raftType, raft;
|
|
524
|
+
var wasConnectedObj, raftId, raftType, raft, oldColours;
|
|
525
525
|
return __generator(this, function (_c) {
|
|
526
526
|
switch (_c.label) {
|
|
527
527
|
case 0: return [4 /*yield*/, RAFT.connect(method, uuids)];
|
|
528
528
|
case 1:
|
|
529
529
|
wasConnectedObj = _c.sent();
|
|
530
|
-
if (!wasConnectedObj.success) return [3 /*break*/,
|
|
530
|
+
if (!wasConnectedObj.success) return [3 /*break*/, 6];
|
|
531
531
|
raftId = (_a = wasConnectedObj.data) === null || _a === void 0 ? void 0 : _a.raftId;
|
|
532
532
|
raftType = (_b = wasConnectedObj.data) === null || _b === void 0 ? void 0 : _b.raftType;
|
|
533
533
|
if (!raftId || !raftType) {
|
|
@@ -550,15 +550,20 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
550
550
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 200); })];
|
|
551
551
|
case 2:
|
|
552
552
|
_c.sent();
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
553
|
+
if (!!withoutVerification) return [3 /*break*/, 3];
|
|
554
|
+
modalState.setModal(createElement(VerificationModal, { connectedRAFT_: raft }), "Looking for ".concat(raft.type));
|
|
555
|
+
return [3 /*break*/, 5];
|
|
556
|
+
case 3:
|
|
557
|
+
oldColours = raft._ledLcdColours;
|
|
558
|
+
raft._ledLcdColours = [];
|
|
559
|
+
return [4 /*yield*/, raft.verifyRaft()];
|
|
560
|
+
case 4:
|
|
561
|
+
_c.sent();
|
|
562
|
+
raft._ledLcdColours = oldColours;
|
|
563
|
+
raft.stopVerifyingRaft(true);
|
|
564
|
+
_c.label = 5;
|
|
565
|
+
case 5: return [2 /*return*/, raft];
|
|
566
|
+
case 6: return [2 /*return*/, null];
|
|
562
567
|
}
|
|
563
568
|
});
|
|
564
569
|
});
|
|
@@ -647,7 +652,7 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
647
652
|
raftFoundSubscriptionHelper().subscribe(function (_a) {
|
|
648
653
|
var discoveredDevice = _a.discoveredDevice;
|
|
649
654
|
return __awaiter(_this, void 0, void 0, function () {
|
|
650
|
-
var newRaft;
|
|
655
|
+
var newRaft, oldColours;
|
|
651
656
|
return __generator(this, function (_b) {
|
|
652
657
|
switch (_b.label) {
|
|
653
658
|
case 0:
|
|
@@ -655,21 +660,27 @@ var ApplicationManager = /** @class */ (function () {
|
|
|
655
660
|
if (foundRICs.length > 0) {
|
|
656
661
|
return [2 /*return*/];
|
|
657
662
|
}
|
|
658
|
-
if (!discoveredDevice._serviceUUIDs.includes(uuids[0])) return [3 /*break*/,
|
|
663
|
+
if (!discoveredDevice._serviceUUIDs.includes(uuids[0])) return [3 /*break*/, 4];
|
|
659
664
|
foundRICs.push(discoveredDevice);
|
|
660
665
|
return [4 /*yield*/, this.selectRaft(discoveredDevice, RaftConnectionMethod.PHONE_BLE)];
|
|
661
666
|
case 1:
|
|
662
667
|
newRaft = _b.sent();
|
|
663
|
-
if (newRaft)
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
668
|
+
if (!newRaft) return [3 /*break*/, 3];
|
|
669
|
+
this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
|
|
670
|
+
afterRaftConnectedCb(newRaft);
|
|
671
|
+
oldColours = newRaft._ledLcdColours;
|
|
672
|
+
newRaft._ledLcdColours = [];
|
|
673
|
+
return [4 /*yield*/, newRaft.verifyRaft()];
|
|
674
|
+
case 2:
|
|
675
|
+
_b.sent();
|
|
676
|
+
newRaft._ledLcdColours = oldColours;
|
|
677
|
+
newRaft.stopVerifyingRaft(true);
|
|
678
|
+
raftFoundSubscriptionHelper().unsubscribe();
|
|
679
|
+
return [3 /*break*/, 4];
|
|
680
|
+
case 3:
|
|
681
|
+
foundRICs = [];
|
|
682
|
+
_b.label = 4;
|
|
683
|
+
case 4: return [2 /*return*/];
|
|
673
684
|
}
|
|
674
685
|
});
|
|
675
686
|
});
|
|
@@ -113,7 +113,7 @@ function QRContent(_a) {
|
|
|
113
113
|
var _this = this;
|
|
114
114
|
var setSerialNo = _a.setSerialNo;
|
|
115
115
|
var onQrCodeFound = function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
116
|
-
var rawValue,
|
|
116
|
+
var rawValue, serialNo;
|
|
117
117
|
var _a;
|
|
118
118
|
return __generator(this, function (_b) {
|
|
119
119
|
rawValue = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.rawValue;
|
|
@@ -121,8 +121,7 @@ function QRContent(_a) {
|
|
|
121
121
|
window.applicationManager.toaster.error("No Valid QR Code Found");
|
|
122
122
|
return [2 /*return*/];
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
serialNo = "00000000" + today.toISOString().split("T")[0].replaceAll("-", "") + rawValue.split("-").slice(-1)[0].padStart(16, "0");
|
|
124
|
+
serialNo = "00000000" + rawValue.split("-").slice(-1)[0].padStart(24, "0");
|
|
126
125
|
setSerialNo(serialNo);
|
|
127
126
|
return [2 /*return*/];
|
|
128
127
|
});
|