Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d9665d9
Added dropdown, need tests
Matt-Carre Mar 9, 2026
7396826
Added unit testing of GUI and labels to drop-down box
Matt-Carre Mar 10, 2026
9269ce2
Added unit testing of GUI and labels to drop-down box, altered one un…
Matt-Carre Mar 10, 2026
5128d66
Added dropdown, need tests
Matt-Carre Mar 9, 2026
b4ccf2c
Added unit testing of GUI and labels to drop-down box
Matt-Carre Mar 10, 2026
ec8d5c6
Added unit testing of GUI and labels to drop-down box, altered one un…
Matt-Carre Mar 10, 2026
6fbe78e
Merge branch 'DropDown' of github.com:DiamondLightSource/i19serial-ui…
Matt-Carre Mar 10, 2026
7fdc4f9
Edited post pull.
Matt-Carre Mar 10, 2026
f8333cb
changed layout of top box, saved choice as variable, moved aperture s…
Matt-Carre Mar 11, 2026
ab31f5d
Altering remaining code according to comments
Matt-Carre Mar 12, 2026
416abda
Altering remaining code according to comments - remembering to alter …
Matt-Carre Mar 12, 2026
e3063ac
changing gui and test to remove zebra, run only main_entry_plan
Matt-Carre Mar 16, 2026
7eba0bc
Added dropdown, need tests
Matt-Carre Mar 9, 2026
5d51acf
changed layout of top box, saved choice as variable, moved aperture s…
Matt-Carre Mar 16, 2026
4a9357c
Merge branch 'main' into 39_merge_run_buttons
Matt-Carre Mar 16, 2026
0eaa1d5
Collected detector_z from ui
Matt-Carre Mar 17, 2026
addf8e8
rewrote test
Matt-Carre Mar 18, 2026
b8b69f3
updated name of plan
Matt-Carre Mar 19, 2026
7240b72
updated name of plan in testing
Matt-Carre Mar 19, 2026
d95c157
renames button based on comments
Matt-Carre Mar 19, 2026
d54b3e9
altered remaining comments
Matt-Carre Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 11 additions & 26 deletions src/i19serial_ui/gui/serial_gui_eh2.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,11 @@ def _create_collection_buttons_group(self):
self.run_btns_group = QtWidgets.QGroupBox()
btn_layout = QtWidgets.QHBoxLayout()

self.test_btn1 = self._create_button("Run zebra", self.run_zebra)

self.test_btn2 = self._create_button("Run panda", self.run_panda)
self.run_btn = self._create_button("Run Plan", self.run_serial)

self.abort_btn = self._create_button("Abort", self.abort)

btn_layout.addWidget(self.test_btn1)
btn_layout.addWidget(self.test_btn2)
btn_layout.addWidget(self.run_btn)
btn_layout.addWidget(self.abort_btn)

self.run_btns_group.setLayout(btn_layout)
Expand Down Expand Up @@ -230,37 +227,25 @@ def abort(self):
self.client.abort_task()
self.appendOutput("Abort")

def run_zebra(self):
rotation_start = float(self.inputs.rotation_start.text())
num_images = float(self.inputs.num_images.text())
rotation_increment = float(self.inputs.image_width.text())
rotation_end = rotation_start + num_images + rotation_increment
params = {
"phi_start": rotation_start,
"phi_end": rotation_end,
"phi_steps": num_images,
"exposure_time": float(self.inputs.time_image.text()),
"gate_width": rotation_end - rotation_start + 0.1,
"pulse_width": rotation_increment,
}
self.client.run_plan("run_zebra_test", params)
self.appendOutput("Run zebra plan")
self.appendOutput(f"With parameters: {params}")

def run_panda(self):
def run_serial(self):
rotation_start = float(self.inputs.rotation_start.text())
num_images = float(self.inputs.num_images.text())
rotation_increment = float(self.inputs.image_width.text())
rotation_end = rotation_start + num_images + rotation_increment

detector_z = float(self.inputs.det_dist.text())
detector_two_theta = float(self.inputs.two_theta.text())
eh2_aperture = self.read_aperture_dropdown()
params = {
"detector_z": detector_z,
"detector_two_theta": detector_two_theta,
"phi_start": rotation_start,
"phi_end": rotation_end,
"phi_steps": num_images,
"exposure_time": float(self.inputs.time_image.text()),
"eh2_aperture": eh2_aperture,
}
self.client.run_plan("run_panda_test", params)
self.appendOutput("Run panda plan")
self.client.run_plan("run_serial_from_panda", params)
self.appendOutput("Start serial collection with the panda")
self.appendOutput(f"With parameters: {params}")


Expand Down
31 changes: 10 additions & 21 deletions tests/gui/test_eh2_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,25 @@ def test_abort_button(mock_eh2_gui):
mock_eh2_gui.client.abort_task.assert_called_once()


def test_run_zebra(mock_eh2_gui):
mock_rotation_start = 0.0
mock_num_images = 50.0
mock_rotation_increment = 0.2
mock_rotation_end = mock_rotation_start + mock_num_images + mock_rotation_increment
mock_time_image = 0.2

mock_params = {
"phi_start": mock_rotation_start,
"phi_end": mock_rotation_end,
"phi_steps": mock_num_images,
"exposure_time": mock_time_image,
"gate_width": mock_rotation_end - mock_rotation_start + 0.1,
"pulse_width": mock_rotation_increment,
}
mock_eh2_gui.test_btn1.click()
mock_eh2_gui.client.run_plan.assert_called_once_with("run_zebra_test", mock_params)


def test_run_panda(mock_eh2_gui):
mock_detector_z = 117.53
mock_eh2_aperture = "20um" # ApertureOptions.UM_20
mock_detector_two_theta = 0.0
mock_rotation_start = 0.0
mock_num_images = 50.0
mock_rotation_increment = 0.2
mock_rotation_end = mock_rotation_start + mock_num_images + mock_rotation_increment
mock_time_image = 0.2
mock_params = {
"detector_z": mock_detector_z,
"detector_two_theta": mock_detector_two_theta,
"phi_start": mock_rotation_start,
"phi_end": mock_rotation_end,
"phi_steps": mock_num_images,
"exposure_time": mock_time_image,
"eh2_aperture": mock_eh2_aperture,
}
mock_eh2_gui.test_btn2.click()
mock_eh2_gui.client.run_plan.assert_called_once_with("run_panda_test", mock_params)
mock_eh2_gui.run_btn.click()
mock_eh2_gui.client.run_plan.assert_called_once_with(
"run_serial_from_panda", mock_params
)
Loading