GUI: Move sample in Smargon Z with shift+click

This commit is contained in:
2025-06-17 11:00:29 +02:00
parent a126f7ccb4
commit 4e15624036
3 changed files with 7 additions and 2 deletions
-1
View File
@@ -31,7 +31,6 @@ class SampleGeometryModel(BaseModel):
def smargon_z(self, pic_y: float) -> Coordinate:
y_mm = (pic_y - self.beam_location_pxl.y) * self.pixel_in_mm
print("Moving by ", y_mm, "mm in z direction.")
return self.smargon.sh_mm + self.smargon_nudge(Coordinate(z=y_mm))
# This goes from image coordinates to relative beam coordinates in image plane
+5
View File
@@ -64,3 +64,8 @@ class StatusPanel(QFrame):
)
self.ring_current.setText(f"<b>{s.bl.ring_current_mA:.1f}</b>")
self.flux.setText(f"<b>{(s.bl.flux_ph_s / 1e9):.2f}</b>")
if s.diffraction.wavelength_angstrom is None:
self.wavelength.setText("<b>N/A</b>")
else:
self.wavelength.setText(f"<b>{s.diffraction.wavelength_angstrom:.3f}</b>")
+2 -1
View File
@@ -309,7 +309,8 @@ class SampleCameraImageLabel(QGraphicsView):
case SampleCameraImageState.IDLE:
point = self.mapToScene(event.pos())
if event.modifiers() & Qt.KeyboardModifier.ShiftModifier:
self.smargon.emit(self.__geom.smargon_z(point.y()))
sc = SmargonCoordinate(sh_mm=self.__geom.smargon_z(point.y()))
self.smargon.emit(sc)
else:
sample_coord = self.__geom.picture_to_sample(Coordinate(x=point.x(), y=point.y()))
smargon_coord = SmargonCoordinate(