@robotical/webapp-types 3.25.6 → 3.25.8
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/package.json +1 -1
- package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.d.ts +10 -15
- package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.js +10 -15
- package/dist-types/src/screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages.js +1 -1
- package/dist-types/src/utils/colour-calibration-reconnect.d.ts +1 -0
- package/dist-types/src/utils/colour-calibration-reconnect.js +3 -2
- package/package.json +1 -1
package/dist-types/package.json
CHANGED
package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.d.ts
CHANGED
|
@@ -7,14 +7,13 @@ declare const english: {
|
|
|
7
7
|
readonly uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.";
|
|
8
8
|
readonly phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.";
|
|
9
9
|
readonly retryUpload: "Retry calibration upload";
|
|
10
|
-
readonly introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white
|
|
10
|
+
readonly introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.";
|
|
11
11
|
readonly sensor: "Colour sensor";
|
|
12
12
|
readonly selectSensor: "Select a colour sensor";
|
|
13
|
+
readonly selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.";
|
|
13
14
|
readonly step: "Step {{number}} of 2";
|
|
14
|
-
readonly optionalStep: "Optional step: purple colour card";
|
|
15
15
|
readonly air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
|
|
16
16
|
readonly white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.";
|
|
17
|
-
readonly purple: "If you have a purple colour card, place the foot with the selected sensor flat on it and capture the readings. This helps the sensor tell a dark card from air. This step is optional: choose Skip and save calibration to finish using your air and white readings and keep the current ground threshold.";
|
|
18
17
|
readonly duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.";
|
|
19
18
|
readonly preparing: "Preparing the sensor…";
|
|
20
19
|
readonly warmingUp: "Waking the colour sensor…";
|
|
@@ -25,22 +24,20 @@ declare const english: {
|
|
|
25
24
|
readonly restoring: "Restoring the previous settings…";
|
|
26
25
|
readonly working: "Please wait…";
|
|
27
26
|
readonly captureAir: "Capture air readings";
|
|
28
|
-
readonly captureWhite: "Capture white
|
|
29
|
-
readonly capturePurple: "Capture purple and save calibration";
|
|
30
|
-
readonly skipPurple: "Skip and save calibration";
|
|
27
|
+
readonly captureWhite: "Capture white and save calibration";
|
|
31
28
|
readonly startAgain: "Start again";
|
|
32
|
-
readonly restartCalibration: "
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly savedWithRGB: "Calibration saved: {{count}} readings for air, white and purple. Purple's colour signal is usable, but its brightness overlaps air. The app will use the calibrated colour signal and keep Marty's current ground threshold.";
|
|
29
|
+
readonly restartCalibration: "Start air and white calibration";
|
|
30
|
+
readonly calibrationRequired: "Calibrate the colour sensor";
|
|
31
|
+
readonly saved: "Calibration saved on Marty: {{count}} readings each for air and white.";
|
|
36
32
|
readonly reconnectStep: "Final step: reconnect Marty";
|
|
37
33
|
readonly reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
|
|
38
34
|
readonly disconnectToFinish: "Disconnect Marty to finish calibration";
|
|
39
35
|
readonly disconnecting: "Disconnecting Marty…";
|
|
40
36
|
readonly loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…";
|
|
41
37
|
readonly calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.";
|
|
42
|
-
readonly calibrationSensorChanged: "
|
|
43
|
-
readonly calibrationSettingsChanged: "
|
|
38
|
+
readonly calibrationSensorChanged: "A different colour sensor is attached. Start calibration for this sensor using air and white.";
|
|
39
|
+
readonly calibrationSettingsChanged: "Marty could not load the saved calibration. Start calibration again using air and white.";
|
|
40
|
+
readonly previousCalibrationChanged: "An earlier calibration no longer matches this sensor. Start a new calibration using air and white.";
|
|
44
41
|
readonly disconnectFailed: "Marty could not be disconnected. Try the disconnect button again.";
|
|
45
42
|
readonly reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.";
|
|
46
43
|
readonly download: "Download a copy (optional)";
|
|
@@ -51,10 +48,8 @@ declare const english: {
|
|
|
51
48
|
readonly unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.";
|
|
52
49
|
readonly readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.";
|
|
53
50
|
readonly unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.";
|
|
54
|
-
readonly saturated: "The air
|
|
51
|
+
readonly saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.";
|
|
55
52
|
readonly weakWhite: "The white reading is too weak. Use a matt white surface with the sensor close to it, then start again.";
|
|
56
|
-
readonly overlap: "Air and purple readings are too close to choose a reliable ground threshold. Check the sensor position and lighting, then start again. No new calibration was saved.";
|
|
57
|
-
readonly overlapDetails: "Air Clear maximum: {{airClearMax}}. Purple Clear minimum: {{purpleClearMin}}. Purple must be at least {{minimumGap}} counts above air. You can retry purple, start again with the same lighting, or skip purple to keep the current ground threshold.";
|
|
58
53
|
readonly settingsChanged: "The sensor settings changed during calibration. Start again to collect a consistent set of readings.";
|
|
59
54
|
readonly writeFailed: "The new calibration could not be saved and verified. The previous settings were restored. Try again.";
|
|
60
55
|
readonly verificationFailed: "The sensor did not return the expected reading after calibration. The previous settings were restored. Keep Marty steady and try again.";
|
package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.js
CHANGED
|
@@ -7,14 +7,13 @@ var english = {
|
|
|
7
7
|
uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.",
|
|
8
8
|
phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.",
|
|
9
9
|
retryUpload: "Retry calibration upload",
|
|
10
|
-
introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white
|
|
10
|
+
introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.",
|
|
11
11
|
sensor: "Colour sensor",
|
|
12
12
|
selectSensor: "Select a colour sensor",
|
|
13
|
+
selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.",
|
|
13
14
|
step: "Step {{number}} of 2",
|
|
14
|
-
optionalStep: "Optional step: purple colour card",
|
|
15
15
|
air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
|
|
16
16
|
white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.",
|
|
17
|
-
purple: "If you have a purple colour card, place the foot with the selected sensor flat on it and capture the readings. This helps the sensor tell a dark card from air. This step is optional: choose Skip and save calibration to finish using your air and white readings and keep the current ground threshold.",
|
|
18
17
|
duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.",
|
|
19
18
|
preparing: "Preparing the sensor…",
|
|
20
19
|
warmingUp: "Waking the colour sensor…",
|
|
@@ -25,22 +24,20 @@ var english = {
|
|
|
25
24
|
restoring: "Restoring the previous settings…",
|
|
26
25
|
working: "Please wait…",
|
|
27
26
|
captureAir: "Capture air readings",
|
|
28
|
-
captureWhite: "Capture white
|
|
29
|
-
capturePurple: "Capture purple and save calibration",
|
|
30
|
-
skipPurple: "Skip and save calibration",
|
|
27
|
+
captureWhite: "Capture white and save calibration",
|
|
31
28
|
startAgain: "Start again",
|
|
32
|
-
restartCalibration: "
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
savedWithRGB: "Calibration saved: {{count}} readings for air, white and purple. Purple's colour signal is usable, but its brightness overlaps air. The app will use the calibrated colour signal and keep Marty's current ground threshold.",
|
|
29
|
+
restartCalibration: "Start air and white calibration",
|
|
30
|
+
calibrationRequired: "Calibrate the colour sensor",
|
|
31
|
+
saved: "Calibration saved on Marty: {{count}} readings each for air and white.",
|
|
36
32
|
reconnectStep: "Final step: reconnect Marty",
|
|
37
33
|
reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
|
|
38
34
|
disconnectToFinish: "Disconnect Marty to finish calibration",
|
|
39
35
|
disconnecting: "Disconnecting Marty…",
|
|
40
36
|
loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…",
|
|
41
37
|
calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.",
|
|
42
|
-
calibrationSensorChanged: "
|
|
43
|
-
calibrationSettingsChanged: "
|
|
38
|
+
calibrationSensorChanged: "A different colour sensor is attached. Start calibration for this sensor using air and white.",
|
|
39
|
+
calibrationSettingsChanged: "Marty could not load the saved calibration. Start calibration again using air and white.",
|
|
40
|
+
previousCalibrationChanged: "An earlier calibration no longer matches this sensor. Start a new calibration using air and white.",
|
|
44
41
|
disconnectFailed: "Marty could not be disconnected. Try the disconnect button again.",
|
|
45
42
|
reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.",
|
|
46
43
|
download: "Download a copy (optional)",
|
|
@@ -51,10 +48,8 @@ var english = {
|
|
|
51
48
|
unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.",
|
|
52
49
|
readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.",
|
|
53
50
|
unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.",
|
|
54
|
-
saturated: "The air
|
|
51
|
+
saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.",
|
|
55
52
|
weakWhite: "The white reading is too weak. Use a matt white surface with the sensor close to it, then start again.",
|
|
56
|
-
overlap: "Air and purple readings are too close to choose a reliable ground threshold. Check the sensor position and lighting, then start again. No new calibration was saved.",
|
|
57
|
-
overlapDetails: "Air Clear maximum: {{airClearMax}}. Purple Clear minimum: {{purpleClearMin}}. Purple must be at least {{minimumGap}} counts above air. You can retry purple, start again with the same lighting, or skip purple to keep the current ground threshold.",
|
|
58
53
|
settingsChanged: "The sensor settings changed during calibration. Start again to collect a consistent set of readings.",
|
|
59
54
|
writeFailed: "The new calibration could not be saved and verified. The previous settings were restored. Try again.",
|
|
60
55
|
verificationFailed: "The sensor did not return the expected reading after calibration. The previous settings were restored. Keep Marty steady and try again.",
|
package/dist-types/src/screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages.js
CHANGED
|
@@ -30,7 +30,7 @@ var colourDiagnosticsEnglish = {
|
|
|
30
30
|
sensorDisconnected: "The selected sensor disconnected. Reconnect Marty and select the sensor again.",
|
|
31
31
|
sensorInitialising: "Marty is still loading the sensor settings. Wait a few seconds and try again.",
|
|
32
32
|
sensorBusy: "The sensor is completing another check. Wait a moment and take the snapshot again.",
|
|
33
|
-
calibrationReconnectRequired: "
|
|
33
|
+
calibrationReconnectRequired: "Complete colour sensor calibration before taking snapshots.",
|
|
34
34
|
sensorAsleep: "Marty's sensor power is asleep. Taking a snapshot wakes the sensors before collecting readings.",
|
|
35
35
|
sensorOffline: "The colour sensor is offline. Take a snapshot to wake it. If it stays offline, check the sensor connection.",
|
|
36
36
|
sensorPowerFailed: "Marty's colour sensor did not wake up. No snapshot was saved. Check that Marty is powered on and the sensor is connected, then try again.",
|
|
@@ -88,7 +88,8 @@ export var getPendingColourCalibration = function (sensor) {
|
|
|
88
88
|
}
|
|
89
89
|
var parsed = JSON.parse(value);
|
|
90
90
|
if (typeof parsed.connectionInstanceId !== "string" || typeof parsed.serialNumber !== "string" ||
|
|
91
|
-
!/^[a-f0-9]{16}$/.test(parsed.whiteCalibrationHex)
|
|
91
|
+
!/^[a-f0-9]{16}$/.test(parsed.whiteCalibrationHex) ||
|
|
92
|
+
(parsed.savedAtMs !== undefined && (!Number.isFinite(parsed.savedAtMs) || parsed.savedAtMs <= 0)))
|
|
92
93
|
throw new Error("Invalid pending calibration");
|
|
93
94
|
cached.set(key, parsed);
|
|
94
95
|
return parsed;
|
|
@@ -99,7 +100,7 @@ export var getPendingColourCalibration = function (sensor) {
|
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
export var markColourCalibrationPending = function (sensor, serialNumber, whiteCalibrationHex, calibrationRecord) {
|
|
102
|
-
var pending = { connectionInstanceId: sensor.raft.connectionInstanceId || "", serialNumber: serialNumber, whiteCalibrationHex: whiteCalibrationHex, calibrationRecord: calibrationRecord };
|
|
103
|
+
var pending = { connectionInstanceId: sensor.raft.connectionInstanceId || "", serialNumber: serialNumber, whiteCalibrationHex: whiteCalibrationHex, savedAtMs: Date.now(), calibrationRecord: calibrationRecord };
|
|
103
104
|
restorePendingColourCalibration(sensor, pending);
|
|
104
105
|
};
|
|
105
106
|
export var restorePendingColourCalibration = function (sensor, pending) {
|