Implements real-time visual status feedback via the integrated ring LEDs on the X-Rite i1Pro 2 (Rev E) spectrophotometer during chartread sessions (fixes#37).
Key Additions
spectro/inst.h & spectro/inst.c:
Defined inst_led_state enumeration (inst_led_off, inst_led_cal_wait, inst_led_row_ready, inst_led_row_fail, inst_led_row_success).
Added set_led_state method pointer to INST_OBJ_BASE with inst_unsupported default fallback.
spectro/i1pro_imp.c & spectro/i1pro_imp.h:
Added thread management state (led_th, led_th_run, led_lock, current_led_state) to struct _i1proimp.
Implemented i1pro2_indLEDset() to send color mask sequences via USB endpoint 0x03 with vendor request 0xD6.
Implemented i1pro2_led_thread() asynchronous worker thread for pulse timing (White 500ms/500ms, Blue 300ms/700ms, Red 3x 100ms/100ms, Green 400ms solid, Off).
Added responsive sub-20ms state polling and clean thread join / LED extinguishing in i1pro_stop_threads() for safe teardown.
spectro/i1pro.c:
Exposed inst2_has_leds capability and wired p->set_led_state = i1pro_set_led_state; when dtype == instI1Pro2.
spectro/chartread.c:
Added -Y l / -Y L command-line switch preserving backwards compatibility with existing -L (dolab = 2).
Integrated status feedback hooks at calibration prompt/completion, row scan readiness, misread error, read success acceptance, and session abort/exit.
Verification
Built full codebase with Jam.
Verified ./bin/chartread -\?, -Y l, and backwards compatibility with -L.
### Overview
Implements real-time visual status feedback via the integrated ring LEDs on the X-Rite i1Pro 2 (Rev E) spectrophotometer during `chartread` sessions (fixes #37).
### Key Additions
- **`spectro/inst.h` & `spectro/inst.c`:**
- Defined `inst_led_state` enumeration (`inst_led_off`, `inst_led_cal_wait`, `inst_led_row_ready`, `inst_led_row_fail`, `inst_led_row_success`).
- Added `#define INST_CAP_LED_STATUS inst2_has_leds` capability flag.
- Added `set_led_state` method pointer to `INST_OBJ_BASE` with `inst_unsupported` default fallback.
- **`spectro/i1pro_imp.c` & `spectro/i1pro_imp.h`:**
- Added thread management state (`led_th`, `led_th_run`, `led_lock`, `current_led_state`) to `struct _i1proimp`.
- Implemented `i1pro2_indLEDset()` to send color mask sequences via USB endpoint 0x03 with vendor request 0xD6.
- Implemented `i1pro2_led_thread()` asynchronous worker thread for pulse timing (White 500ms/500ms, Blue 300ms/700ms, Red 3x 100ms/100ms, Green 400ms solid, Off).
- Added responsive sub-20ms state polling and clean thread join / LED extinguishing in `i1pro_stop_threads()` for safe teardown.
- **`spectro/i1pro.c`:**
- Exposed `inst2_has_leds` capability and wired `p->set_led_state = i1pro_set_led_state;` when `dtype == instI1Pro2`.
- **`spectro/chartread.c`:**
- Added `-Y l` / `-Y L` command-line switch preserving backwards compatibility with existing `-L` (`dolab = 2`).
- Integrated status feedback hooks at calibration prompt/completion, row scan readiness, misread error, read success acceptance, and session abort/exit.
### Verification
- Built full codebase with Jam.
- Verified `./bin/chartread -\?`, `-Y l`, and backwards compatibility with `-L`.
- Add inst_led_state enum, INST_CAP_LED_STATUS capability, and set_led_state to inst.h / inst.c
- Implement i1pro2_indLEDset, worker thread i1pro2_led_thread, and i1pro_imp_set_led_state in i1pro_imp.c / i1pro_imp.h
- Wire up i1pro_set_led_state and determine_capabilities in i1pro.c for i1Pro 2 (Rev E)
- Integrate -Y l option and lifecycle hooks in chartread.c for calibration, readiness, success, failure, and clean exit
gronod
merged commit ca85951565 into development2026-09-05 18:16:44 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overview
Implements real-time visual status feedback via the integrated ring LEDs on the X-Rite i1Pro 2 (Rev E) spectrophotometer during
chartreadsessions (fixes #37).Key Additions
spectro/inst.h&spectro/inst.c:inst_led_stateenumeration (inst_led_off,inst_led_cal_wait,inst_led_row_ready,inst_led_row_fail,inst_led_row_success).#define INST_CAP_LED_STATUS inst2_has_ledscapability flag.set_led_statemethod pointer toINST_OBJ_BASEwithinst_unsupporteddefault fallback.spectro/i1pro_imp.c&spectro/i1pro_imp.h:led_th,led_th_run,led_lock,current_led_state) tostruct _i1proimp.i1pro2_indLEDset()to send color mask sequences via USB endpoint 0x03 with vendor request 0xD6.i1pro2_led_thread()asynchronous worker thread for pulse timing (White 500ms/500ms, Blue 300ms/700ms, Red 3x 100ms/100ms, Green 400ms solid, Off).i1pro_stop_threads()for safe teardown.spectro/i1pro.c:inst2_has_ledscapability and wiredp->set_led_state = i1pro_set_led_state;whendtype == instI1Pro2.spectro/chartread.c:-Y l/-Y Lcommand-line switch preserving backwards compatibility with existing-L(dolab = 2).Verification
./bin/chartread -\?,-Y l, and backwards compatibility with-L.