Skip to content

Add lcc1620 attenuator - #52

Merged
kalidke merged 5 commits into
mainfrom
add-lcc1620-attenuator
Sep 8, 2026
Merged

Add lcc1620 attenuator#52
kalidke merged 5 commits into
mainfrom
add-lcc1620-attenuator

Conversation

@AliKNS

@AliKNS AliKNS commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

AliKNS and others added 4 commits August 10, 2026 16:42
- 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>
Copilot AI lite review requested due to automatic review settings August 21, 2026 18:44
@AliKNS
AliKNS requested review from kalidke and removed request for Copilot August 21, 2026 18:44
Copilot AI lite review requested due to automatic review settings September 8, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 via HardwareInterfaces.
  • Added LCC1620Attenuator implementation (types + interface methods) and enabled Triggerscope/LCC1620 in HardwareImplementations.
  • Updated CLAUDE.md architecture 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>
@kalidke
kalidke merged commit 9d24bd1 into main Sep 8, 2026
4 checks passed
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.

3 participants