Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 click centering monitor now starts with waiting for three click #368

Open
wants to merge 9 commits into
base: md2-raster-2024-1
Choose a base branch
from

Conversation

NYSBC-Rudra
Copy link
Contributor

Thought I was just adding line 1441 but hopefully this will still work

@@ -3058,6 +3086,8 @@ def measurePolyCB(self):
def center3LoopCB(self):
logger.info("3-click center loop")
self.threeClickCount = 1
self.threeClickSignal.emit('{} more clicks'.format(str(4-self.threeClickCount)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using f strings see section 7.1.1 - https://docs.python.org/3/tutorial/inputoutput.html . the text to emit would look like '{4-self.threeClickCount} more clicks'

@@ -2220,13 +2243,18 @@ def processRingCurrent(self, ringCurrentVal):
else:
self.ringCurrentMessage.setStyleSheet("background-color: #99FF66;")

def processBeamAvailable(self, beamAvailVal):
if int(beamAvailVal) == 1:
'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beam available is supposed to be a global signal of whether the sample would be exposed to X-rays if the shutter were open, regardless of what the user is doing on the GUI.

@@ -3820,9 +3875,19 @@ def pixelSelect(self, event):
correctedC2C_x = correctedC2C_x * scale_x
correctedC2C_y = correctedC2C_y * scale_y
self.md2.centring_click.put(f"{correctedC2C_x} {correctedC2C_y}")
#logger.info('waiting for motor rotation')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented-out text - if necessary, use git history to retrieve it, unless it is likely to be used soon

@@ -139,7 +139,7 @@ class ControlMain(QtWidgets.QMainWindow):
fastShutterSignal = QtCore.Signal(float)
gripTempSignal = QtCore.Signal(float)
ringCurrentSignal = QtCore.Signal(float)
beamAvailableSignal = QtCore.Signal(float)
threeClickSignal = QtCore.Signal(str)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it looks like the beam available GUI feature is being replaced with three-click, I suggest using a completely new GUI object instead of re-using an old one. Re-using items with the same name is going to be difficult to debug in the feature than if it is correctly named.

'''
def omegaMoveCheck(self, sleeptime,call='OmegaState'):
state = self.md2.exporter.read(call)
while(state == 'Moving'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these kinds of checks are going to be done in multiple areas of the code, I suggest moving the function into a more central place and have the states as enums or constants (like things in config_params.py) so that small issues such as wrong comparison of strings ("string" != "String") don't lead to functional issues.

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