Add lcc1620 attenuator - #52
Merged
Merged
Conversation
- Introduced LCC1620Attenuator module for controlling Thorlabs LCC1620/M liquid crystal attenuator via NIDAQ card. - Created AttenuatorInterface for generic optical attenuator functionalities. - Implemented methods for setting drive voltage, transmission, and calibration. - Added GUI for real-time control of the attenuator.
The textbox callback called both set_close_to! and setdrivevoltage, writing the hardware twice per entry (with possibly different values since the slider snaps to its 0.01 V grid). The slider used lift, which fires at construction, so opening the GUI wrote the hardware before any user input. Route all writes through a single on(slider.value) handler. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tead of NIDAQ card
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness issues in the new calibration/constructor validation paths and a likely copyright-risk documentation file that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds first-class support for optical attenuators by introducing a new AttenuatorInterface layer and a concrete Thorlabs LCC1620/M implementation driven via Triggerscope V4, integrating both into the package’s interface/implementation aggregation modules.
Changes:
- Added
AttenuatorInterface(types, function stubs, and a basic GLMakie GUI) and re-exported it viaHardwareInterfaces. - Added
LCC1620Attenuatorimplementation (types + interface methods) and enabledTriggerscope/LCC1620 inHardwareImplementations. - Updated
CLAUDE.mdarchitecture notes to include the new Attenuator interface/implementation.
File summaries
| File | Description |
|---|---|
| src/hardware_interfaces/HardwareInterfaces.jl | Re-exports the new AttenuatorInterface and enables TrigInterface inclusion. |
| src/hardware_interfaces/attenuator_interface/AttenuatorInterface.jl | New attenuator interface module wiring (exports/includes). |
| src/hardware_interfaces/attenuator_interface/interface_types.jl | Introduces Attenuator abstract type and AttenuatorProperties container. |
| src/hardware_interfaces/attenuator_interface/interface_functions.jl | Adds attenuator interface function stubs (setdrivevoltage, settransmission, etc.). |
| src/hardware_interfaces/attenuator_interface/gui.jl | Adds a simple GUI for driving attenuator voltage. |
| src/hardware_implementations/lcc1620_attenuator/LCC1620Attenuator.jl | New module wrapper exporting LCC1620 and methods. |
| src/hardware_implementations/lcc1620_attenuator/types.jl | Defines the LCC1620 attenuator type and constructor. |
| src/hardware_implementations/lcc1620_attenuator/interface_methods.jl | Implements attenuator methods, calibration LUT handling, interpolation, and export/shutdown. |
| src/hardware_implementations/lcc1620_attenuator/lcc1620_device_notes.md | Adds device notes (currently includes extensive manual restatement). |
| src/hardware_implementations/HardwareImplementations.jl | Enables Triggerscope and LCC1620Attenuator implementations. |
| CLAUDE.md | Documents the new AttenuatorInterface and LCC1620 implementation in the repo architecture overview. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+63
to
+70
| if !issorted(voltages) | ||
| @error "voltages must be sorted in increasing order" | ||
| return | ||
| end | ||
| if !(issorted(transmissions) || issorted(transmissions; rev=true)) | ||
| @error "transmissions must be monotonic so settransmission can invert the table" | ||
| return | ||
| end |
Comment on lines
+32
to
+34
| if !(1 <= dac_channel <= scope.dacoutputs) | ||
| @error "dac_channel must be between 1 and $(scope.dacoutputs)" | ||
| end |
| Linear interpolation of `y` over monotonic `x` at query point `xq`, | ||
| clamped to the table endpoints. `x` may be increasing or decreasing. | ||
| """ | ||
| function interp1(x::Vector{Float64}, y::Vector{Float64}, xq::Float64) |
Comment on lines
+3
to
+7
| Complete technical content of the official Thorlabs user guide | ||
| (**CTN002190-D02, Rev D, January 8, 2020**), restated chapter by chapter for | ||
| this repo, with a rig/driver appendix at the end. Original PDF (graphs and | ||
| mechanical drawings in full fidelity): | ||
| <https://media.thorlabs.com/globalassets/items/l/lc/lcc/lcc1620_m/ctn002190-d02.pdf> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.