-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for #15 rough server side for Screen app
- Loading branch information
Showing
5 changed files
with
183 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
"""Screen (Profile Monitor) implementation | ||
:copyright: Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved. | ||
:license: http://github.com/slaclab/slicops/LICENSE | ||
""" | ||
|
||
from pykern.pkcollections import PKDict | ||
|
||
def new_implementation(args): | ||
return Screen(**args) | ||
|
||
class Screen(PKDict): | ||
"""Implementation for the Screen (Profile Monitor) application | ||
""" | ||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
def action(self): | ||
pass | ||
|
||
def default_instance(self): | ||
#TODO(pjm): dummy data | ||
return PKDict( | ||
screen=PKDict( | ||
beam_path='SC_HXR', | ||
camera='VCCB', | ||
pv='CAMR:LGUN:950', | ||
curve_fit_method='gaussian', | ||
camera_image=None, | ||
acquire_button=None, | ||
stop_button=None, | ||
), | ||
) | ||
|
||
def schema(self): | ||
#TODO(pjm): schema could be pulled from a file | ||
return PKDict( | ||
constants=PKDict( | ||
BeamPath=[ | ||
#TODO(pjm): dummy data, should be generated from yaml or csv sources | ||
PKDict( | ||
name='CU_HXR', | ||
screens=[ | ||
['OTR11', 'OTRS:LI21:237'], | ||
['OTR12', 'OTRS:LI21:291'], | ||
['OTR2', 'OTRS:IN20:571'], | ||
['OTR21', 'OTRS:LI24:807'], | ||
['OTR3', 'OTRS:IN20:621'], | ||
['OTR30', 'OTRS:LTU1:449'], | ||
['OTR33', 'OTRS:LTUH:745'], | ||
['OTR4', 'OTRS:IN20:711'], | ||
['OTRDMP', 'OTRS:DMPH:695'], | ||
['OTRH1', 'OTRS:IN20:465'], | ||
['OTRH2', 'OTRS:IN20:471'], | ||
['VCC', 'CAMR:IN20:186'], | ||
['YAG01', 'YAGS:IN20:211'], | ||
['YAG02', 'YAGS:IN20:241'], | ||
['YAG03', 'YAGS:IN20:351'], | ||
['YAGPSI', 'YAGS:LTUH:743'], | ||
], | ||
), | ||
PKDict( | ||
name='SC_HXR', | ||
screens=[ | ||
['OTR11B', 'PROF:BC1B:470'], | ||
['OTR21B', 'PROF:BC2B:545'], | ||
['OTRC006', 'PROF:COL0:535'], | ||
['OTRDMP', 'OTRS:DMPH:695'], | ||
['OTRDOG', 'PROF:DOG:195'], | ||
['VCCB','CAMR:LGUN:950'], | ||
['YAGH1', 'YAGS:HTR:625'], | ||
['YAGH2', 'YAGS:HTR:675'], | ||
['YAGPSI', 'YAGS:LTUH:743'], | ||
], | ||
), | ||
], | ||
CurveFitMethod=[ | ||
['gaussian', 'Gaussian'], | ||
['assymetric', 'Assymetric'], | ||
['rms_raw', 'RMS raw'], | ||
['rms_cut_peak', 'RMS cut peak'], | ||
['rms_cut_area', 'RMS cut area'], | ||
['rms_floor', 'RMS floor'], | ||
], | ||
), | ||
model=PKDict( | ||
screen=PKDict( | ||
beam_path=['Beam Path', 'BeamPath'], | ||
camera=['Camera', 'Camera'], | ||
pv=['PV', 'CameraPV'], | ||
curve_fit_method=['Curve Fit Method', 'CurveFitMethod', 'gaussian'], | ||
color_map=['Color Map', 'ColorMap', 'Inferno'], | ||
camera_image=['Camera Image', 'CameraImage'], | ||
acquire_button=['Start', 'AcquireButton'], | ||
stop_button=['Stop', 'StopButton'], | ||
), | ||
), | ||
view=PKDict( | ||
screen=PKDict( | ||
fields=[ | ||
[ | ||
'beam_path', | ||
'camera', | ||
'pv', | ||
'acquire_button', | ||
'stop_button', | ||
'curve_fit_method', | ||
], | ||
[ | ||
'camera_image', | ||
'color_map', | ||
], | ||
], | ||
), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters