Skip to content

Feature/cleaning/control module factorization#25

Open
malik-irain wants to merge 41 commits into
devfrom
feature/cleaning/control-module-factorization
Open

Feature/cleaning/control module factorization#25
malik-irain wants to merge 41 commits into
devfrom
feature/cleaning/control-module-factorization

Conversation

@malik-irain
Copy link
Copy Markdown
Owner

No description provided.

Ashwolaa and others added 30 commits March 29, 2026 08:42
- Remove redundant ini_actuator_pb from DAQ_Move_UI_Base; use
  _setup_init_action + update_init_icon from ControlModuleUI
- Fix show_graph closeEvent bug (True → False) in move UI
- Rename show_tree → _show_settings in move UI for consistency
- Rename _tree → _settings_widget in move UI to match viewer
- Move enable_actions, _show_settings, show_settings to
  ControlModuleUI base so both UIs share the same implementation
- Add statusbar and _settings_widget None-defaults to base __init__
- Remove redundant command_sig redeclaration from DAQ_Viewer_UI
- Remove duplicate _ini_state = False assignments now covered by base

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add _hw_settings_name and _ui_init_attr class attributes to
ParameterControlModule so subclasses declare their settings group name
and UI init property once, removing scattered string literals.

Consolidate into the base class:
- quit_fun: common deinit → quit_signal → _quit_cleanup() hook → ui.close
- _quit_cleanup: no-op default; DAQ_Viewer overrides to close its LCD widget
- _close_hardware: emits 'close' to hardware thread, resets UI init state,
  disconnects LECO; replaces duplicated try/except/finally in both modules
- param_deleted: identical in both modules except for _hw_settings_name
- apply_controller_parameters: replace if/elif on module_type with _hw_settings_name
- process_leco_commands GET_SETTINGS: replace class-name heuristic with _hw_settings_name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add DAQ_Hardware_Base(QObject) in utils.py: shared parent for
  DAQ_Move_Hardware and DAQ_Detector, providing unified plugin reference,
  update_settings dispatch, _dispatch_custom_command helper, and
  queue_command handling for INI_HARDWARE and CLOSE.

- Add ControlToHardware (INI_HARDWARE, CLOSE) and ThreadStatus.INI_HARDWARE
  / ThreadStatus.STOP as canonical unified command/status values;
  ThreadStatusMove.INI_STAGE, ThreadStatusViewer.INI_DETECTOR, and per-class
  STOP are kept as deprecated aliases.

- Move ControleModuleType and ControllerStatus to thread_commands.py;
  re-exported from utils.py for backward compat.

- DAQ_Move_Hardware now subclasses DAQ_Hardware_Base: plugin reference
  (replaces hardware), controller_address (replaces hardware_adress),
  motion_stopped (replaces motion_stoped), ini_hardware (replaces ini_stage);
  deprecated property aliases preserved. Adds _move_completed debounce guard
  on move_done to prevent double MOVE_DONE emissions.

- DAQ_Detector now subclasses DAQ_Hardware_Base: plugin reference (replaces
  detector), ini_hardware (replaces ini_detector); deprecated property aliases
  preserved. queue_command delegates shared commands to super() first.

- DAQ_Move and DAQ_Viewer: _ini_hw_cmd = ControlToHardware.INI_HARDWARE;
  thread_status handles ThreadStatus.INI_HARDWARE alongside legacy aliases;
  ThreadStatus.STOP handled alongside per-class STOP.

- Fix timer-thread warnings: connect thread.finished → hardware.deleteLater
  in _setup_hardware_thread; call thread().quit() in queue_command(CLOSE) so
  the worker is destroyed inside its own thread.

- Remove processEvents() calls from DAQ_Move_base.emit_status,
  axis_name/axis_names setters, and DAQ_Viewer_base.emit_status: signal
  delivery is already asynchronous via queued connections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename DAQ_Detector → DAQ_Viewer_Hardware for symmetry with
  DAQ_Move_Hardware (both are hardware workers for their respective
  control modules).
- Remove unused _kind class attribute from DAQ_Hardware_Base and
  subclasses (no callers in this branch; belongs with capabilities).

Co-Authored-By: Claude Sonnet 4.6 <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.

2 participants