-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
* thank you jun for this suggestion
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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': |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.") |
There was a problem hiding this comment.
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
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.