Only the displayed label: the settings key event_trigger and the JFJ
header key trigger_event are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fel_per is a float (10.0): tmove=10.0 gave wait_pulses=twait//tmove=1.0,
used to repeat the CTA lists ('can't multiply sequence by non-int').
tmove is now written as int when fel_per is whole, and wait_pulses is
cast to int.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mode 7 uses tmove/twait in ms like mode 5 (shapepath divides by fel_per,
its 'shots' doc is wrong): tmove is fel_per for both (was 1 for mode 7)
- wait field in ms, steps of fel_per, typed values snapped to a multiple
- the panel writes the fixed tmove into the parameter text, add obj and
update param set it too (fix_motion_param), so it shows in the object
information; the collection still enforces it
- warning when the text has another tmove or a twait that is not a
multiple of it; a saved text gets the fixed tmove at startup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- chip type (same selection as the Fix Target type), motion mode 4..7,
wait in pulses (mode 5/7) and section size (mode 6/7): these edit their
keys in the Fix Target parameter text box and follow it when typed;
text box and chip type are kept in the settings
- tmove is fixed to one FEL pulse (fel_per ms for mode 5, 1 shot for
mode 7): not editable, set at the collection for every object
- the collection refuses objects with a mode other than 4..7
- laser delay PV readback and the calculated laser to X-ray delay
- estimated run time of the chip from the CTA sequence lengths
(motion_run_pulses), including the checks that would abort it
- orange warning for twait not a multiple of tmove or an invalid ssz
- ModuleFixTarget: parse_param/format_param for the parameter text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- header_appendix: chip_type, motion_mode, motion_param, fel_per_ms,
delay_pulses, laser_delay_ns and total_delay_ns, taken from the job
that actually runs (Jungfrau.config), not from the GUI
- laser delay read from SLAAR03-LTIM-PDLY:DELAYNS_SLOW (ns, negative:
laser before the X-rays); total = laser - delay_pulses * fel_per;
trigger_delay now holds the total delay
- motion_delay_pulses(): trigger to X-ray pulses per mode, same rules as
the CTA sequences (mode 6/7 nominal)
- remove the unused manual laser_delay from the run parameters
- fix laser_pulse_energy, which was written with the trigger delay
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- data storage: pgroup, protein and prefix are editable (letters, digits
and _ only); last run and last path stay read only
- experimental parameters (was empty): incident energy, event trigger,
triggered, unit cell a b c alpha beta gamma and space group
- every change is saved immediately (no Enter needed: the Collect button
takes no focus, so editingFinished would not fire before a collection)
- the preferences window is a single instance; main page and preferences
update each other, so the preferences no longer write back stale group
values; pgroup/energy/event trigger changes force a new jungfrau object
- the fields are locked during collections and motor sequences (left tabs)
- lower case labels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The collimator and post-tube groups read the 2nd device_prefix (outdated
SARES30-ESBMX), discarded it for the hard coded SARES30-SMX and logged a
warning at every start. Keep the hard coded prefix with a comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 'if not in keys' guards of the channel list defaults were commented
out, so both lists were reset to the built-in defaults at every start
(and logged as 'not defined'). The defaults are now only used when no
list is saved yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The channel lists were one very long line in the preferences tree. They
are now buttons ("edit beam-sync channels (N)...") opening a dialog with
one channel per line; OK saves the list (empty lines and duplicates
removed, space separated pastes work) and forces a new jungfrau object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The out position was one x and one y delta added to the upstream and
downstream in positions, and "use current position as out" computed the
deltas from the upstream motors only, so a downstream out position could
not be stored.
- preferences: out X/Y upstream and downstream (absolute) replace the out
deltas; "use current position as out" stores all five axes
- existing settings: the absolute out positions are created once from
in + delta
- the deltas are still written (upstream out - in) for older SwissMX
versions sharing the settings file
- move_post_tube uses the absolute out positions (falls back to in+delta)
The collimator already stores absolute out positions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pyqtgraph's 'decimals' is the number of significant figures: beam_x/beam_y
(decimals 2) showed 1613.25 as 1.6e+03, and energy/unit cell (decimals 3)
showed 12.398 as 12.4 and 109.47 as 109. Editing such a field stored the
rounded value. Use 6 significant figures (2-3 decimal places).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Home Fast Stages wrote 'enable plc 1' to SAR-EXPMX1:ASYN.AOUT, which
does not exist: write to SAR-EXPMX:asyn1.AOUT instead
- new Home Coarse Y: 'enable plc 2' (PLC_HomingCY in MX1_home.cfg)
- both ask for confirmation (default No), report a failed write and do
nothing with simulated motors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- swissmx.ui: remove the Grid, Prelocated, Helical and EMBL method tabs,
the Sample Selection tab with its empty centre page, and their stale
tab stops; Experiment (Fix Target) and Setup remain
- remove the X-ray Eye motor group (SARES30-SMX:MCS14/15) from the right
panel
- remove the dead code of these tasks: collection branches calling
missing methods, the unreachable tail of cb_mouse_click and the task
constants
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- all print calls outside the __main__ test blocks are now log calls:
info for run information (CTA configuration summary on one line, run
number, CTA start pid), warning/error for aborts and failures, debug for
dumps (object/transform info, autofocus measurements, logger tree)
- psi_device: remove the import-time logging.basicConfig(level=DEBUG) and
print('past logging'); the standalone test configures logging itself
- startup import timings are logged at info level
- ctadaq added to the -l log level list
Prints from PBTools/PBSwissMX, slic and the JFJ client are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- move_together(): post-tube in/out and the tandem arrows check all targets
first (nudge cap, soft limits), then send the moves back to back to the
VAL fields (us X, ds X, us Y, ds Y) without reads in between; either all
axes move or none (a refused tandem axis could tilt the tube)
- set_collecting(False) re-enables all groups: after a motor sequence the
collimator and post-tube groups stayed greyed out
- log the end of a motor sequence and the GUI unlock
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Collect (after the task and target checks) the collimator, post sample
tube and detector are compared with their configured in positions and the
backlight with out (tolerance 0.1). If anything is out of position a
dialog lists every device and asks the operator to confirm (default No).
The check result and the operator's choice are logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Detector, collimator, post-tube in/out, move home/yag, the backlight button
and the sample exchange/alignment/data collection transitions blocked the
GUI thread for up to ~20s per move.
- MoveWorker (same thread as the collection worker, so sequences and
collections can not overlap) runs (label, callable) steps with a progress
dialog; all controls are locked meanwhile (no nudges, zoom stays usable)
- move functions raise MoveError instead of showing dialogs; the GUI shows
the message when the sequence ends
- abort stops all motors (motor record STOP, backlight) and ends the
sequence; position checks (assert_tweaker_positions abort=) stop waiting
- safety: backlight moves wait and check the position before the next step
(post-tube in used to start while the backlight was still moving out)
- tandem nudges stay non blocking in the GUI thread; collimator still moves
X then Y
- sample alignment: backlight in now also checks the detector is clear of
the post-tube path (as the backlight button does)
Tested in simulation and at the beamline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- pv_monitor_add skips simulated motor widgets one by one instead of
asserting sim&0x10 (mixed modes such as --sim 0x0ef crashed at startup)
- preferences: roi/binning numbers written as decimals (8.0) are parsed as
one number and rounded; a roi without 4 or binning without 2 values is
not saved (8.0 used to become 8,0 and corrupt the camera roi)
- camera.set_param refuses a roi/binning with the wrong number of values
- Collect warns when there is nothing to scan or the task is not fix target
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before, an abort stopped motion and shutter only: the CTA sequence (detector,
x-ray shutter, laser triggers), the BS/PV retrieval and JFJ kept running to
the planned end of the run.
- CTAAcquisition.abort(stop_pid): stops the CTA sequence; the retrieval loop
ends early and retrieves the following blocks cut at the abort pulse id
(the retrieval lags the pulses by about one block) until a block is empty
- Jungfrau.stop_triggers(): reads the current pulse id and aborts the CTA
acquisition (or stops a plain SFAcquisition task)
- Jungfrau.cancel(): JFJ cancel_post, then wait (max 60s each) for the data
retrieval to finish and JFJ to be idle
- worker: request_abort closes the shutter first (Shutter.close caput
sequence), then stops the CTA immediately; cleanup stops the CTA again,
recovers the motion, then cancels JFJ and waits
- Shutter reads sync_flag from the preferences at each open/close instead
of once at startup
Tested at the beamline (run 72): BS/PV data and JF images end at the abort
pulse id, motion recovered, JFJ idle afterwards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old abort only sent &1a;Gather.Enable=0, which left triggerSync running
and Coord[1].DesTimeBase at 0 (or under triggerSync control). The fast
stages then needed an IOC restart.
_recover_motion() now runs after an abort or any error while the motion
program is active:
- abort the motion program and stop gathering
- stop triggerSync (Ctrl-C, close the shell channel, killall)
- then restore Coord[1].DesTimeBase=Sys.ServoPeriod, TimeBaseSlew=1E-4
and reset Coord[1].Q[0]=0 (a stale -2 lets the next wait_armed() return
before the stage is at the start position)
- log the PowerBrick state before and after
Tested at the beamline (sync_mode 2, sync_flag 3): after a mid-scan abort
the fast stages move without an IOC restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- progress dialog is non modal; during a collection set_collecting() greys
out the left tabs, toolbar, menu, fast stage and x-ray eye groups,
backlight/lights/exposure and the collimator/post-tube in/out buttons
- collimator and post-tube motors stay usable, limited to a total move of
NUDGE_MAX_STEP (0.5 mm) from their position at the start of the
collection (MotorTweak/SimMotorTweak.set_max_step)
- zoom stays usable during a collection
- mouse clicks on the camera view are ignored during a collection
- daq_worker added to the -l log level list
- debug coordinate log is skipped when points/pts_trf are not in the
scan parameters (grid modes) instead of raising KeyError
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- illumination: send_command() and status() return early in simulated
mode (regression from 960b48f, which tried to connect with no hostname)
- camera: sim_gen(mode=1) falls back to generated images (mode 0) when
simCamImg/*.png is missing instead of raising IndexError
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- new daq_worker.py: CollectionWorker runs in its own QThread and owns the
Deltatau/Jungfrau objects; progress, run info, gather plots and results
are sent to the GUI thread with signals
- abort closes the shutter immediately and stops the motion program
(&1a;Gather.Enable=0) at the next check
- shutter is closed in a finally block if the collection fails
- removes the processEvents()/sleep polling loop from the GUI thread
- quitting is blocked while a collection is running
- fix: debug coord log no longer overwrites the gather upload filename
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>