@robotical/webapp-types 3.13.2 → 3.13.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.
|
@@ -95,6 +95,8 @@ declare class ShakeDetector {
|
|
|
95
95
|
updateAxis(index: number, acceleration: number, matrix: number[][], adjustment?: number): void;
|
|
96
96
|
}
|
|
97
97
|
export declare class ButtonClickDetection {
|
|
98
|
+
irMin: undefined | number;
|
|
99
|
+
irMax: undefined | number;
|
|
98
100
|
clickThreshold: number;
|
|
99
101
|
releaseThreshold: number;
|
|
100
102
|
lastTime: number;
|
|
@@ -429,6 +429,8 @@ var ButtonClickDetection = /** @class */ (function () {
|
|
|
429
429
|
When the threshold is exceeded, the button is clicked, but we want to send the event when the button is released
|
|
430
430
|
so that the event is triggered only once.
|
|
431
431
|
*/
|
|
432
|
+
this.irMin = undefined;
|
|
433
|
+
this.irMax = undefined;
|
|
432
434
|
this.clickThreshold = 1600;
|
|
433
435
|
this.releaseThreshold = 1590;
|
|
434
436
|
this.lastTime = 0;
|
|
@@ -520,6 +522,8 @@ export var setButtonThresholdsUtil = function (connectedCog) { return __awaiter(
|
|
|
520
522
|
irMax = lightResponse.light.irMax4;
|
|
521
523
|
Logger.info(SHOW_LOGS, TAG, "Got button thresholds: irMin: ".concat(irMin, ", irMax: ").concat(irMax));
|
|
522
524
|
buttonClickDetection = connectedCog.publishedDataAnalyser.buttonClickDetection;
|
|
525
|
+
buttonClickDetection.irMin = irMin;
|
|
526
|
+
buttonClickDetection.irMax = irMax;
|
|
523
527
|
buttonClickDetection.clickThreshold = irMin + (irMax - irMin) / 2;
|
|
524
528
|
buttonClickDetection.releaseThreshold = buttonClickDetection.clickThreshold - 10;
|
|
525
529
|
Logger.info(SHOW_LOGS, TAG, "Set button thresholds: clickThreshold: ".concat(buttonClickDetection.clickThreshold, ", releaseThreshold: ").concat(buttonClickDetection.releaseThreshold));
|