Skip to content

software/main_*: Delete unused imports, convert the main and gui* to use loggers. - #4

Merged
ianohara merged 2 commits into
masterfrom
ian-unused-imports-and-logging
Oct 25, 2024
Merged

software/main_*: Delete unused imports, convert the main and gui* to use loggers.#4
ianohara merged 2 commits into
masterfrom
ian-unused-imports-and-logging

Conversation

@ianohara

Copy link
Copy Markdown
Collaborator

See title. This is just straight conversion of prints to Logger, and other small tweaks along the way.

@ianohara
ianohara changed the base branch from ian-delete-outdated to master October 25, 2024 21:12
@ianohara
ianohara force-pushed the ian-unused-imports-and-logging branch from 3443da1 to 7df7369 Compare October 25, 2024 21:14
@ianohara
ianohara merged commit d594814 into master Oct 25, 2024
@ianohara
ianohara deleted the ian-unused-imports-and-logging branch December 27, 2024 17:47
hongquanli added a commit that referenced this pull request Dec 30, 2025
- Add byte count breakdown comment for struct format ">BBiiiiBi"
- Update platformio.ini to use +<src/utils/*.cpp> pattern for future modules
- Skip axis validation if valid_axes is empty (missing firmware constants)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Alpaca233 added a commit that referenced this pull request May 26, 2026
Picks up the remaining cheap, reasonable fixes from PR #535 review:

#1 cv2.imwrite return value: cv2 returns False (without raising) on
missing dir, missing codec, or unsupported dtype. We now check the
return value, log a throttled WARNING per failure, increment a
_silent_write_failures counter (surfaced in the diagnostics summary),
and skip counter increment + CSV row write so no row references a
file that isn't on disk.

#4 channel-name path sanitization: get_image_filepath previously only
replaced spaces; now also strips '/', '\\', ':', '*', '?', '"', '<',
'>', '|'. Strict improvement for both the recording widget and the
multipoint pipeline.

#7 frames.csv open guarded: a PermissionError on the CSV file no
longer leaves the widget in a half-started state. On failure,
experiment_ID is cleared and the exception is re-raised so the
toggle_recording slot doesn't run streamHandler.start_recording().

#8 drop the dead image_format constructor parameter: process_queue
hasn't read it since the cv2.imwrite refactor — it derives the
extension from control._def.Acquisition.IMAGE_FORMAT via
get_image_filepath. No in-tree callers passed it.

#9 OSError auto-stop emits only once per recording: a saturated queue
hitting a persistent OSError (e.g., full disk) no longer fires 10
redundant stop_recording signals. _stop_requested_from_writer is
reset in start_new_experiment; subsequent errors during shutdown
log as WARNING instead of re-emitting.

#18 channel_provider returning None at start_new_experiment now logs
a distinct WARNING. Before, a user who launched the GUI and clicked
Record without first selecting a live channel got every frame
tagged 'live' with no warning (because the provider lambda itself
was non-None, just its return value was).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant