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

Draft PR for the NYX compliance changes #360

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

mskinner5278
Copy link
Collaborator

These are all the changes that were made prior to the MD2 integration. Many of these changes were made to meet the compliance requirements that were added during the cycle, and many are invalidated by the MD2 integration and ophydization that occurs later.

Copy link
Collaborator

@JunAishima JunAishima left a comment

Choose a reason for hiding this comment

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

the code as it is cannot run on AMX/FMX without changing functionality drastically.
there is more wiggle room with the GUI, so would recommend working with beamline staff to see which of the current NYX changes are actually desirable for AMX/FMX as well.

xMotAbsoluteMove, xEnd, yMotAbsoluteMove, yEnd, zMotAbsoluteMove, zEnd = raster_positions(row, stepsize, omegaRad, rasterStartX, rasterStartY, rasterStartZ, row_index)
vector = {'x': (xMotAbsoluteMove, xEnd), 'y': (yMotAbsoluteMove, yEnd), 'z': (zMotAbsoluteMove, zEnd)}
logger.info(f'starting new row: {row_index}')
zMotAbsoluteMove, zEnd, yMotAbsoluteMove, yEnd, xMotAbsoluteMove, xEnd = raster_positions(row, stepsize, omegaRad+90, rasterStartZ*1000, rasterStartY*1000, rasterStartX*1000, row_index)
Copy link
Collaborator

Choose a reason for hiding this comment

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

these factors of 1000 cannot stay. can't you refine or make alternative PVs for sample centering-related PVs that would enable you to keep the current values and the same names of the objects to be moved?

@@ -1909,6 +1915,7 @@ def snakeRasterBluesky(rasterReqID, grain=""):
initiate transitions here allows for GUI sample/heat map image to update
after moving to known position"""
logger.debug(f'lastOnSample(): {lastOnSample()} autoRasterFlag: {autoRasterFlag}')
yield from bps.sleep(3) #waiting for detector to not lose row
Copy link
Collaborator

Choose a reason for hiding this comment

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

this would be a major problem for the other beamlines, where this sleep isn't necessary

multiColThreshold = reqObj["diffCutoff"]
gotoMaxRaster(rasterResult,multiColThreshold=multiColThreshold)
multiColThreshold = reqObj["diffCutoff"]
# gotoMaxRaster(rasterResult,multiColThreshold=multiColThreshold)
Copy link
Collaborator

Choose a reason for hiding this comment

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

calls to other code can't just be removed. make a config variable or something that enables you to make NYX work with your code while AMX/FMX use the gotoMaxRaster() function

clean_up_files(pic_prefix, output_file)
zebraCamDaq(0,360,40,.4,pic_prefix,getBlConfig("visitDirectory"),0)
#TODO: if daq_utils.beamline=='nyx':
Copy link
Collaborator

Choose a reason for hiding this comment

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

make sure that the AMX/FMX code works for them


arm_status = SubscriptionStatus(flyer.detector.cam.armed, armed_callback, run=False)

flyer.detector.cam.acquire.put(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this acquire be done after the detector is armed?

@@ -28,12 +28,9 @@
logging.getLogger('ophyd').setLevel(logging.WARN)
logging.getLogger('caproto').setLevel(logging.WARN)
handler1 = handlers.RotatingFileHandler('lsdcServerLog.txt', maxBytes=5000000, backupCount=100)
Copy link
Collaborator

Choose a reason for hiding this comment

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

again, differences cannot be completely removed.

@@ -74,6 +74,7 @@ class RasterStatus(Enum):
PINS_PER_PUCK = 16

DETECTOR_OBJECT_TYPE_LSDC = "lsdc" # using det_lib
DETECTOR_OBJECT_TYPE_NO_INIT = "no init" # skip epics detector init
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 reason why you couldn't use DETECTOR_OBJECT_TYPE_OPHYD?

@@ -453,13 +459,13 @@ def createSampleTab(self):
)
)
self.exp_time_ledit.textChanged.connect(self.checkEntryState)
hBoxColParams2.addWidget(colRangeLabel)
hBoxColParams2.addWidget(self.osc_range_ledit)
#hBoxColParams2.addWidget(colRangeLabel)
Copy link
Collaborator

Choose a reason for hiding this comment

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

a lot of GUI code is just changed without any recourse to it being shown on AMX/FMX.
if you really want to have this pull request merged, please go over with beamline staff the changes you have made while showing the existing AMX/FMX GUI, and see where they agree with changes. otherwise, the changes that AMX/FMX do not want must be rolled back.

@@ -3262,22 +3347,22 @@ def getCurrentFOV(self):

def screenXPixels2microns(self, pixels):
fov = self.getCurrentFOV()
fovX = fov["x"]
fovX = fov["x"]*1000
Copy link
Collaborator

Choose a reason for hiding this comment

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

these factors of 1000 must again be removed from the common code

@@ -75,7 +75,7 @@ def check_working_directory():
check_working_directory.remediation = f'Please start LSDC in {daq_utils.beamline} data directory. Current directory: {working_dir}'
return False
if daq_utils.getBlConfig("visitDirectory") != os.getcwd():
check_working_directory.remediation = ("Working directory mismatch. Please start LSDC GUI in the same folder as the server is running.")
check_working_directory.remediation = (f"Working directory mismatch. Please start LSDC GUI in the same folder as the server is running.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

f not necessary for this string

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