Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions cls/appWidgets/main_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,20 @@ def publish_progressive_stack_data(self, final_data_dct):
# pprint.pprint(final_data_dct)

if self.get_device_backend() == 'epics':

cmd_args = {}
cmd_args['metadata'] = orjson.dumps(convert_ndarrays_to_lists(self._progressive_stack_data['metadata'])).decode('utf-8')
cmd_args['directory'] = self._progressive_stack_data_dir
cmd_args['file_prefix'] = f"progressive-stack-{self._progressive_stack_data_file_prefix}"
cmd_args['extension'] = '.hdf5'
final_data_dct_serializable = convert_ndarrays_to_lists(final_data_dct)
cmd_args['data_dct'] = orjson.dumps(final_data_dct_serializable).decode('utf-8')
res_dct = self.send_to_nx_server(NX_SERVER_CMNDS.SAVE_PROGRESSIVE_STACK_DATA, [], self._progressive_stack_data_file_prefix, self._progressive_stack_data_dir, nx_app_def='nxstxm',
host=self.nx_server_host, port=self.nx_server_port,
verbose=False, cmd_args=cmd_args)
try:
cmd_args = {}
cmd_args['metadata'] = orjson.dumps(convert_ndarrays_to_lists(self._progressive_stack_data['metadata'])).decode('utf-8')
cmd_args['directory'] = self._progressive_stack_data_dir
cmd_args['file_prefix'] = f"progressive-stack-{self._progressive_stack_data_file_prefix}"
cmd_args['extension'] = '.hdf5'
final_data_dct_serializable = convert_ndarrays_to_lists(final_data_dct)
cmd_args['data_dct'] = orjson.dumps(final_data_dct_serializable).decode('utf-8')
res_dct = self.send_to_nx_server(NX_SERVER_CMNDS.SAVE_PROGRESSIVE_STACK_DATA, [], self._progressive_stack_data_file_prefix, self._progressive_stack_data_dir, nx_app_def='nxstxm',
host=self.nx_server_host, port=self.nx_server_port,
verbose=False, cmd_args=cmd_args)
print(f"Successful publish of progressive stack data to nx_server, response: {res_dct}")
except Exception as e:
_logger.error(f"Error publishing progressive stack data to Pixeltor: {e}")
else:
_logger.info(f"Publishing progressive stack data to Pixeltor not currently supported")

Expand Down Expand Up @@ -1487,6 +1490,9 @@ def __init__(self, splash=None):

# provide a variable that will hold a list of positioners that are excluded from being offered on the GUI
self.exclude_list = []
# provide a variable that will hold a list of positioners that are offered on the GUI but have their setpoints
# disabled, useful to provide only the moving status and stop button for certain positioners
self.disable_list = []

self.sscan_rec_prfx = None # either 'ambient' or 'uhv'
self.es_id = None # needs to be defined by inheriting class
Expand Down Expand Up @@ -1725,6 +1731,12 @@ def set_exclude_positioners_list(self, excl_lst):
def get_exclude_positioners_list(self):
return self.exclude_list

def set_disabled_positioners_list(self, disable_lst):
self.disable_list = disable_lst

def get_disabled_positioners_list(self):
return self.disable_list

def get_all_pvs_of_type(self, category_name=None):
# first check for cetegory then in PV_DONT_RECORD
if category_name in self.devices.keys():
Expand Down
2 changes: 1 addition & 1 deletion cls/appWidgets/user_account/sample_holder_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, pos=1):


class sample_holder_obj(object):
def __init__(self, userName, id="H110212", base_data_dir="c:\data"):
def __init__(self, userName, id="H110212", base_data_dir="/data"):
super(sample_holder_obj, self).__init__()
self.id = id
self._userName = userName
Expand Down
80 changes: 40 additions & 40 deletions cls/app_data/app_dflts.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
}
],
"ZP_FOCUS_PARAMS": {
"OSA_A0": 324.6,
"OSA_A0": 356.17,
"OSA_A0MAX": 550.6572,
"OSA_D": 50.0,
"OSA_IDEAL_A0": 1000,
"OSA_IDX": 1,
"ZP_A1": -4.859,
"ZP_D": 240.0,
"ZP_IDX": 5
"ZP_IDX": 6
}
},
"PREFERENCESPARAMS": {
Expand All @@ -101,8 +101,8 @@
259
],
"CALIBPOSN": [
-15.07,
-11.45
-17.35,
-4.53
],
"CENTER": [
0.0,
Expand Down Expand Up @@ -185,8 +185,8 @@
0
],
"RANGE": [
50.0,
50.0,
1000.0,
1000.0,
0,
0
],
Expand All @@ -197,8 +197,8 @@
-10.0
],
"STEP": [
3.5714285714285716,
3.5714285714285716,
71.42857142857143,
71.42857142857143,
0,
0
],
Expand All @@ -211,40 +211,40 @@
},
"FOCUS": {
"CENTER": [
24.78,
-8.81,
-5210.36,
5066.06,
-2182.0,
0
],
"DWELL": 10.0,
"NPOINTS": [
100,
100,
40,
30,
0
],
"RANGE": [
66.53,
-8.81,
50.0,
-5068.82,
5066.06,
200.0,
0
],
"START": [
24.78,
-8.81,
-1258.6,
-5210.36,
5066.06,
-2581.3,
0
],
"STEP": [
0.4217171717171717,
1.4296969696969692,
0.0,
1.2820512820512822,
6.896551724137931,
0
],
"STOP": [
66.53,
-8.81,
-1208.6,
-5068.82,
5066.06,
-2381.3,
0
]
},
Expand Down Expand Up @@ -328,40 +328,40 @@
},
"OSA_FOCUS": {
"CENTER": [
-3.245000000000001,
-10.15,
-3568.29,
-43.27,
-1.51,
-2000.0,
0
],
"DWELL": 10.0,
"DWELL": 5.0,
"NPOINTS": [
15,
15,
15,
0
],
"RANGE": [
109.35,
0.0,
300.0,
-0.18,
-1.51,
600.0,
0
],
"START": [
-57.92,
-10.15,
-3718.29,
-43.27,
-1.51,
-2301.4,
0
],
"STEP": [
7.810714285714285,
3.0778571428571433,
0.0,
21.428571428571427,
42.857142857142854,
0
],
"STOP": [
51.43,
-10.15,
-3418.29,
-0.18,
-1.51,
-1701.4,
0
]
},
Expand Down Expand Up @@ -455,7 +455,7 @@
},
"POSITIONER": {
"CENTER": [
-2000.0,
4000.0,
0,
0,
0
Expand All @@ -468,7 +468,7 @@
0
],
"RANGE": [
2000.0,
7000.0,
0,
0,
0
Expand All @@ -480,7 +480,7 @@
-10.0
],
"STEP": [
81.63265306122449,
61.224489795918366,
0,
0,
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ osa_holder_shape_class=OSALaddPtychoHolderShape
# COARSE_SAMPLEFINE
exclude_list = [
"DNM_COARSE_X",
"DNM_COARSE_Y",
# "DNM_COARSE_Y",
"DNM_GONI_X",
"DNM_GONI_Y",
"DNM_GONI_Z",
Expand All @@ -52,6 +52,11 @@ exclude_list = [
"PeemM3Trans"
]

# this section is for positioners that we want to display on the positioner panel but want to disable (gray out)
# for user interaction except the STOP button which should always be enabled
[POSITIONER_PANEL_DISABLE_LIST]
disable_list = ["DNM_COARSE_Y"]

[UI_OVERRIDES]
# this specified the absolute module import path to use for the motor detail panel class PosionerDetailClass
# motor_detail_module_path=cls.applications.pyStxm.bl_configs.pixelator_common.positioner_detail
Expand Down
2 changes: 2 additions & 0 deletions cls/applications/pyStxm/bl_configs/amb_bl10ID1/amb_bl10ID1.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@
if (sample_mode is not None) and (fine_sample_mode is not None):
# instanciate DEVICE_CFG here which will be imported later
ex_list = blConfig.get_list('POSITIONER_PANEL_EXCLUDE_LIST', 'exclude_list', all=True)
disable_list = blConfig.get_list('POSITIONER_PANEL_DISABLE_LIST', 'disable_list', all=True)
DEVICE_CFG = device_config(
splash=splash,
bl_config_nm=bl_config_nm,
sample_pos_mode=sample_mode,
fine_sample_pos_mode=fine_sample_mode,
posner_panel_exclusion_list=ex_list,
posner_panel_disable_list=disable_list
)

else:
Expand Down

Large diffs are not rendered by default.

Loading