@robotical/webapp-types 3.11.2 → 3.11.4
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.
|
@@ -8,7 +8,7 @@ interface CogState {
|
|
|
8
8
|
movementType: "none" | "shake" | "move";
|
|
9
9
|
rotation: "none" | "clockwise" | "counterClockwise";
|
|
10
10
|
buttonClick: "none" | "click" | "release";
|
|
11
|
-
objectSense: "none" | "left" | "right";
|
|
11
|
+
objectSense: "none" | "left" | "right" | "both";
|
|
12
12
|
lightSense: "none" | "high" | "mid" | "low";
|
|
13
13
|
}
|
|
14
14
|
declare class PublishedDataAnalyser extends EventEmitter {
|
|
@@ -92,6 +92,7 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
92
92
|
objectSense: {
|
|
93
93
|
left: "objectSenseLeft",
|
|
94
94
|
right: "objectSenseRight",
|
|
95
|
+
both: "objectSenseBoth",
|
|
95
96
|
none: "noObjectSense"
|
|
96
97
|
},
|
|
97
98
|
lightSense: {
|
|
@@ -463,10 +464,15 @@ var ObjectSenseDetection = /** @class */ (function () {
|
|
|
463
464
|
this.objectSensed2Threshold = 1500; // button
|
|
464
465
|
}
|
|
465
466
|
ObjectSenseDetection.prototype.detectObjectSense = function (objectSenseValue, analyser) {
|
|
466
|
-
|
|
467
|
+
var left = objectSenseValue[0] > this.objectSensed0Threshold;
|
|
468
|
+
var right = objectSenseValue[1] > this.objectSensed1Threshold;
|
|
469
|
+
if (left && right) {
|
|
470
|
+
analyser.setObjectSense("both");
|
|
471
|
+
}
|
|
472
|
+
else if (left) {
|
|
467
473
|
analyser.setObjectSense("left");
|
|
468
474
|
}
|
|
469
|
-
else if (
|
|
475
|
+
else if (right) {
|
|
470
476
|
analyser.setObjectSense("right");
|
|
471
477
|
}
|
|
472
478
|
else {
|
|
@@ -111,7 +111,8 @@ export default function LEDLightsOrQRVerificationModal() {
|
|
|
111
111
|
return (_jsxs("div", __assign({ className: styles.container }, { children: [!isButtonToConnectVisible ? _jsx("div", __assign({ className: styles.cards }, { children: options.map(function (_a) {
|
|
112
112
|
var id = _a.id, title = _a.title, subtitle = _a.subtitle, icon = _a.icon;
|
|
113
113
|
return (_jsxs("div", __assign({ className: qrSelected && id === 'qr' ? [styles.card, styles.qrselected].join(" ") : styles.card, onClick: function () { return handleSelect(id); } }, { children: [_jsx("div", __assign({ className: styles.icon }, { children: icon })), _jsx("h3", __assign({ className: styles.title }, { children: title })), _jsx("p", __assign({ className: styles.subtitle }, { children: subtitle }))] }), id));
|
|
114
|
-
}) })) :
|
|
114
|
+
}) })) :
|
|
115
|
+
_jsx("div", __assign({ className: styles.cogNote }, { children: _jsxs("strong", { children: ["Don't forget to ", _jsx("span", __assign({ className: styles.cogNoteHighlight }, { children: "turn on" })), " your Cog!"] }) })), qrSelected && _jsx(QRContent, { setSerialNo: setSerialNoFromQR }), _jsxs("div", __assign({ className: styles.buttonsContainer }, { children: [isButtonToConnectVisible && _jsx("button", __assign({ className: styles.connectButton, onClick: handleConnect }, { children: "QR code scan - click to connect" })), _jsx("button", __assign({ className: styles.cancelButton, onClick: function () { return modalState.closeModal(false); } }, { children: "Cancel" }))] }))] })));
|
|
115
116
|
}
|
|
116
117
|
function QRContent(_a) {
|
|
117
118
|
var _this = this;
|