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

MX Energy Scan GUI changes #223

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mskinner5278
Copy link
Collaborator

GUI updates for the energy scan tab, omitted the changes edwin declined (we are not ready for resizing)

@mskinner5278 mskinner5278 requested a review from JunAishima June 14, 2022 20:40
@@ -3670,6 +3670,18 @@ def calcLifetimeCB(self):
self.sampleLifetimeReadback_ledit.setText(lifeTime_s)
self.sampleLifetimeReadback_ledit.setStyleSheet("color : green");

def setEscanTransCB(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should have been with the previous commit so that you have a cohesive change where you can check the callback while having the GUI connection

@@ -3670,6 +3670,18 @@ def calcLifetimeCB(self):
self.sampleLifetimeReadback_ledit.setText(lifeTime_s)
self.sampleLifetimeReadback_ledit.setStyleSheet("color : green");

def setEscanTransCB(self):
try:
if (float(self.escan_transmission_ledit.text()) > 1.0 or float(self.escan_transmission_ledit.text()) < 0.001):
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any fundamental difference between this and setTransCB? couldn't you refactor setTransCB so it can work with this?

colTransmissionLabel = QtWidgets.QLabel('Transmission (RI) (0.0-1.0):')
else:
self.transmissionReadback = QtEpicsPVLabel(daq_utils.pvLookupDict["transmissionRBV"],self,60,3)
self.escan_transmissionReadback = QtEpicsPVLabel(daq_utils.pvLookupDict["transmissionRBV"],self,60,3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it make sense to show the escan readback? it is the same PV as "normal" transmission, so they should be the same, right?

@@ -3061,7 +3061,7 @@ def processSampMove(self,posRBV,motID):
self.vecLine.setLine(self.vectorStart["graphicsitem"].x()+self.vectorStart["centerCursorX"]+self.centerMarkerCharOffsetX,self.vectorStart["graphicsitem"].y()+self.vectorStart["centerCursorY"]+self.centerMarkerCharOffsetY,self.vectorEnd["graphicsitem"].x()+self.vectorStart["centerCursorX"]+self.centerMarkerCharOffsetX,self.vectorEnd["graphicsitem"].y()+self.vectorStart["centerCursorY"]+self.centerMarkerCharOffsetY)

def queueEnScanCB(self):
self.protoComboBox.setCurrentIndex(self.protoComboBox.findText(str("eScan")))
self.protoComboBox.setCurrentText("eScan")
Copy link
Collaborator

Choose a reason for hiding this comment

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

so you remove the eScan protocol as an option from the combo box but add it back in text? can you explain why you did this?

maybe you can show me how the user is supposed to do the escan (which screens to go to, how to start, etc.) and then maybe it will become more obvious to me how this is supposed to work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are correct, it is unusual. EScan is removed from the combo box list while on the main screen, so it can not be found with the "findText" when you queue from the e-scan tab. It does not appear on the list, instead the combo box on the main screen shows a blank when you switch back.

Overall it prevents you from queueing e-scans from the main tab and automatically applies it as the selected type when on the e-scan tab.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like that it's hacking the protocol system and the combo box.

can you do something like have a callback monitor for the combo box, then bring up the eScan tab when that protocol is selected?

@@ -2490,6 +2490,15 @@ def createSampleTab(self):
tempPlotButton.clicked.connect(self.queueEnScanCB)
clearEnscanPlotButton = QtWidgets.QPushButton("Clear")
clearEnscanPlotButton.clicked.connect(self.clearEnScanPlotCB)
escanTransmissionLabel = QtWidgets.QLabel("Transmission")
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the transmission in the escan interface the same as in the main collection area? what is different about it?

some more explanation would help me understand the logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The intention is that the setpoint is different for each tab, but the RBV has a duplicate label to allow it to be displayed on both tabs.

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