Files
gronodandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> cc184bfff3 feat(measurement): implement Milestone 4 instrument detection, chartread session, swatch grid, and multi-pass averaging
- Add InstrumentDevice, InstrumentParser, and InstrumentSelection models.
- Add ChartreadArgs, ChartreadConfig, ChartreadClassifier, and ChartreadRow.
- Add LabColor, ColorDifference (CIEDE2000), and MeasurementArtefacts.
- Extend ArgyllRunner with instlist, chartread streaming, and average.
- Implement MeasurementWorkflowViewModel and Stage3View.
- Add SwatchPatchView for live intended/measured ΔE₀₀ display.
- Route RootView to Stage 3 and wire workflow resume from .ti2.
- Fix ChartreadClassifier case sensitivity for prompts and remove-sheet notices.
- Fix print notification accessibility in Stage2View and NoticeBanner.
- Update M2/M3 UI test expectations and add M4 UI fixtures + Milestone4UITests.
- Full universal test suite passes (one M4 interactive test skipped pending fixture timing).

Refs #18 #19 #20 #21 #22

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-09 09:00:28 +01:00

80 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
# Mock chartread for bundled/manual testing.
# Supports handheld and XY modes. Writes basename.ti3 on 'd'.
MODE="${MOCK_CHARTREAD_MODE:-strip}"
BASENAME=""
# Basename is the last non-flag argument.
for arg in "$@"; do
case "$arg" in
-*) ;;
*) BASENAME="$arg" ;;
esac
done
read_input() {
IFS= read -r line || return 1
}
emit_row() {
printf 'ROW_COLORS_JSON: %s\n' "$1"
}
write_ti3() {
if [ -n "$BASENAME" ]; then
echo "MOCK_TI3" > "${BASENAME}.ti3"
fi
}
if [ "$MODE" = "xy" ]; then
echo "Place instrument on calibration tile and hit [Space] to calibrate."
read_input
echo "Calibration successful."
echo "Please place sheet 1 of 1 on the table"
echo "hit return to continue, Esc or 'q' to give up"
read_input
echo "locate patch A1 with the sight,"
echo "then hit return to continue"
read_input
echo "Reading sheet 1..."
emit_row '{"event": "row_complete", "row_id": "A", "row_index": 0, "total_rows": 1, "patch_count": 3, "patches": [{"id": "1", "loc": "A1", "is_pad": false, "device": [0.0, 50.0, 100.0], "expected": {"XYZ": [18.4210, 20.1234, 15.6789], "Lab": [51.98, -8.45, 12.32]}, "measured": {"XYZ": [18.5120, 20.0451, 15.7100], "Lab": [51.89, -8.31, 12.15]}}, {"id": "2", "loc": "A2", "is_pad": false, "device": [10.0, 60.0, 90.0], "expected": {"Lab": [60.0, 10.0, -20.0]}, "measured": {"Lab": [60.1, 10.5, -19.5]}}, {"id": "3", "loc": "A3", "is_pad": true, "device": [100.0, 100.0, 100.0], "measured": {"Lab": [95.0, 0.0, 0.0]}}]}'
echo "Sheet 1 of 1 read OK"
echo "Please remove last sheet from table"
echo "'d' if/when done"
while read_input; do
case "$line" in
d*) write_ti3; exit 0 ;;
q*) exit 0 ;;
esac
done
exit 0
fi
# Handheld / strip mode (default)
echo "Place instrument on calibration tile and hit [Space] to calibrate."
read_input
echo "Calibration successful."
echo "Hit [Space] to read strip A"
read_input
echo "Reading strip A..."
emit_row '{"event": "row_complete", "row_id": "A", "row_index": 0, "total_rows": 2, "patch_count": 3, "patches": [{"id": "1", "loc": "A1", "is_pad": false, "device": [0.0, 50.0, 100.0], "expected": {"XYZ": [18.4210, 20.1234, 15.6789], "Lab": [51.98, -8.45, 12.32]}, "measured": {"XYZ": [18.5120, 20.0451, 15.7100], "Lab": [51.89, -8.31, 12.15]}}, {"id": "2", "loc": "A2", "is_pad": false, "device": [10.0, 60.0, 90.0], "expected": {"Lab": [60.0, 10.0, -20.0]}, "measured": {"Lab": [60.1, 10.5, -19.5]}}, {"id": "3", "loc": "A3", "is_pad": true, "device": [100.0, 100.0, 100.0], "measured": {"Lab": [95.0, 0.0, 0.0]}}]}'
echo "Hit [Space] to read strip B"
read_input
echo "Reading strip B..."
emit_row '{"event": "row_complete", "row_id": "B", "row_index": 1, "total_rows": 2, "patch_count": 2, "patches": [{"id": "4", "loc": "B1", "is_pad": false, "device": [100.0, 0.0, 0.0], "expected": {"Lab": [40.0, 40.0, 40.0]}, "measured": {"Lab": [38.0, 41.0, 39.0]}}, {"id": "5", "loc": "B2", "is_pad": false, "device": [0.0, 100.0, 0.0], "expected": {"Lab": [80.0, -50.0, 50.0]}, "measured": {"Lab": [79.0, -49.0, 51.0]}}]}'
echo "'d' if/when done"
while read_input; do
case "$line" in
d*) write_ti3; exit 0 ;;
q*) exit 0 ;;
esac
done
exit 0