Rework radar system
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
"""Builder for snapshot and storage actions section."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from PyQt6.QtWidgets import (
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
@@ -15,39 +13,39 @@ from PyQt6.QtWidgets import (
|
||||
)
|
||||
|
||||
|
||||
def build_data_actions_group(owner) -> QGroupBox:
|
||||
from python_app.gui.controllers.sections.views import DataView, SectionView
|
||||
from python_app.models.gui_profile_schema import GuiStateModel
|
||||
|
||||
|
||||
def build_data_actions_group(gui: GuiStateModel) -> DataView:
|
||||
"""Create snapshot save controls section."""
|
||||
group = QGroupBox("Data Actions")
|
||||
view = SectionView(QGroupBox("Data Actions"))
|
||||
group = view.group
|
||||
layout = QVBoxLayout(group)
|
||||
layout.setSpacing(8)
|
||||
data_defaults = owner._gui_defaults.data_actions
|
||||
data_defaults = gui.data_actions
|
||||
|
||||
save_button = QPushButton("Save Last 1000")
|
||||
save_button.setToolTip("Save up to 1000 most recent measurements with all available data stages.")
|
||||
save_button.clicked.connect(owner._save_snapshot)
|
||||
save_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
save_vna_json_button = QPushButton("Save S21 JSON")
|
||||
save_vna_json_button.setToolTip(
|
||||
"Export one S21 VNA-history JSON per combo from the preprocessed stage (S11 is not included)."
|
||||
"Export one S21 VNA-history JSON per combo from the preprocessed stage."
|
||||
)
|
||||
save_vna_json_button.clicked.connect(owner._save_vna_history_json)
|
||||
save_vna_json_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
remove_last_button = QPushButton("Remove Last Measurement")
|
||||
remove_last_button.clicked.connect(owner._remove_last_runtime_history)
|
||||
remove_last_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
capture_tmp_reference_button = QPushButton("Capture Tmp Reference")
|
||||
capture_tmp_reference_button.clicked.connect(owner._capture_tmp_reference)
|
||||
capture_tmp_reference_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
record_button = QPushButton("Start + Record to Disk")
|
||||
record_button.setToolTip(
|
||||
"Start the run (if stopped) and save the next N measurements to the path/name below."
|
||||
)
|
||||
record_button.clicked.connect(owner._start_run_with_recording)
|
||||
record_button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
owner._record_count = QSpinBox()
|
||||
owner._record_count.setMinimum(1)
|
||||
owner._record_count.setMaximum(1_000_000)
|
||||
owner._record_count.setValue(int(data_defaults.record_count))
|
||||
record_count = view.add("_record_count", QSpinBox())
|
||||
record_count.setMinimum(1)
|
||||
record_count.setMaximum(1_000_000)
|
||||
record_count.setValue(int(data_defaults.record_count))
|
||||
|
||||
button_grid = QGridLayout()
|
||||
button_grid.setHorizontalSpacing(8)
|
||||
@@ -64,24 +62,26 @@ def build_data_actions_group(owner) -> QGroupBox:
|
||||
record_count_row = QHBoxLayout()
|
||||
record_count_row.setSpacing(8)
|
||||
record_count_row.addWidget(QLabel("Number of Sweeps to Record"))
|
||||
record_count_row.addWidget(owner._record_count)
|
||||
record_count_row.addWidget(record_count)
|
||||
record_count_row.addStretch(1)
|
||||
layout.addLayout(record_count_row)
|
||||
|
||||
path_row = QHBoxLayout()
|
||||
path_row.setSpacing(8)
|
||||
owner._save_path_input = QLineEdit(str(data_defaults.save_path))
|
||||
save_path_input = view.add("_save_path_input", QLineEdit(str(data_defaults.save_path)))
|
||||
browse_button = QPushButton("Browse")
|
||||
browse_button.clicked.connect(owner._browse_save_path)
|
||||
path_row.addWidget(QLabel("Path"))
|
||||
path_row.addWidget(owner._save_path_input, stretch=1)
|
||||
path_row.addWidget(save_path_input, stretch=1)
|
||||
path_row.addWidget(browse_button)
|
||||
layout.addLayout(path_row)
|
||||
|
||||
name_row = QHBoxLayout()
|
||||
name_row.setSpacing(8)
|
||||
owner._save_name_input = QLineEdit(str(data_defaults.save_name))
|
||||
save_name_input = view.add("_save_name_input", QLineEdit(str(data_defaults.save_name)))
|
||||
name_row.addWidget(QLabel("Name"))
|
||||
name_row.addWidget(owner._save_name_input, stretch=1)
|
||||
name_row.addWidget(save_name_input, stretch=1)
|
||||
layout.addLayout(name_row)
|
||||
return group
|
||||
return DataView(group=group, fields=view.fields, save=save_button, save_json=save_vna_json_button,
|
||||
remove_last=remove_last_button, capture_tmp=capture_tmp_reference_button,
|
||||
record=record_button, browse=browse_button, save_path=save_path_input,
|
||||
save_name=save_name_input, record_count=record_count)
|
||||
|
||||
Reference in New Issue
Block a user