Rework radar system
This commit is contained in:
@@ -1,57 +1,23 @@
|
||||
"""Builder for pinned primary action controls."""
|
||||
|
||||
from __future__ import annotations
|
||||
"""Pinned primary actions; controllers connect their own buttons."""
|
||||
|
||||
from PyQt6.QtWidgets import QGridLayout, QGroupBox, QPushButton, QSizePolicy
|
||||
|
||||
|
||||
def _expanding_button(label: str) -> QPushButton:
|
||||
"""Create horizontally expanding action button."""
|
||||
button = QPushButton(label)
|
||||
button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
return button
|
||||
from python_app.gui.controllers.sections.views import PrimaryView
|
||||
|
||||
|
||||
def build_primary_actions_group(owner) -> QGroupBox:
|
||||
"""Create pinned action block combining pipeline and hardware actions."""
|
||||
group = QGroupBox("Actions")
|
||||
layout = QGridLayout(group)
|
||||
def build_primary_actions_group() -> PrimaryView:
|
||||
view = PrimaryView(group=QGroupBox("Actions"), start=QPushButton("Start"),
|
||||
single_capture=QPushButton("Single Capture"), stop=QPushButton("Stop"),
|
||||
apply_radar=QPushButton("Apply Radar"), load=QPushButton("Load Config"),
|
||||
save=QPushButton("Save Config"), preprocess=QPushButton("Preprocessing"),
|
||||
clear=QPushButton("Clear Runtime History"))
|
||||
layout = QGridLayout(view.group)
|
||||
layout.setHorizontalSpacing(8)
|
||||
layout.setVerticalSpacing(8)
|
||||
|
||||
start_button = _expanding_button("Start")
|
||||
start_button.clicked.connect(owner._start_run)
|
||||
layout.addWidget(start_button, 0, 0)
|
||||
|
||||
single_button = _expanding_button("Single Capture")
|
||||
single_button.clicked.connect(owner._start_single_capture)
|
||||
layout.addWidget(single_button, 0, 1)
|
||||
|
||||
stop_button = _expanding_button("Stop")
|
||||
stop_button.clicked.connect(owner._stop_run)
|
||||
layout.addWidget(stop_button, 0, 2)
|
||||
|
||||
apply_radar_button = _expanding_button("Apply Radar")
|
||||
apply_radar_button.clicked.connect(owner._apply_radar_settings)
|
||||
layout.addWidget(apply_radar_button, 1, 0)
|
||||
|
||||
load_config_button = _expanding_button("Load Config")
|
||||
load_config_button.clicked.connect(owner._load_config_from_dialog)
|
||||
layout.addWidget(load_config_button, 1, 1)
|
||||
|
||||
save_config_button = _expanding_button("Save Config")
|
||||
save_config_button.clicked.connect(owner._save_current_config)
|
||||
layout.addWidget(save_config_button, 1, 2)
|
||||
|
||||
preprocess_button = _expanding_button("Preprocessing")
|
||||
preprocess_button.clicked.connect(owner._open_preprocess_panel)
|
||||
layout.addWidget(preprocess_button, 2, 0)
|
||||
|
||||
clear_history_button = _expanding_button("Clear Runtime History")
|
||||
clear_history_button.clicked.connect(owner._clear_all_runtime_history)
|
||||
layout.addWidget(clear_history_button, 2, 1, 1, 2)
|
||||
|
||||
layout.setColumnStretch(0, 1)
|
||||
layout.setColumnStretch(1, 1)
|
||||
layout.setColumnStretch(2, 1)
|
||||
return group
|
||||
for index, button in enumerate((view.start, view.single_capture, view.stop, view.apply_radar,
|
||||
view.load, view.save, view.preprocess, view.clear)):
|
||||
button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
layout.addWidget(button, index // 3, index % 3, 1, 2 if button is view.clear else 1)
|
||||
for column in range(3):
|
||||
layout.setColumnStretch(column, 1)
|
||||
return view
|
||||
|
||||
Reference in New Issue
Block a user