Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bc39eb8
remove characters that newer python versions do not tolerate
RussBerg Feb 27, 2026
307ab34
add changes to nx_server service
RussBerg Feb 27, 2026
a000930
check if device is in self.mtr_dict before using
RussBerg Feb 27, 2026
71344c3
added sim devs
RussBerg Mar 16, 2026
a859844
restrict log size and location
RussBerg Mar 16, 2026
0783f0e
remove unused icons
RussBerg Mar 16, 2026
c64940d
remove fine image scan config
RussBerg Mar 16, 2026
082075a
do not warn if dev not exist
RussBerg Mar 16, 2026
3ce8078
add required items, update dev name database
RussBerg Mar 16, 2026
4b9e655
docstring and add a button to directory navigator to reset to base da…
RussBerg Mar 17, 2026
c7b820d
removed PixMap Delegate
RussBerg Mar 17, 2026
ccb26d1
override showEvent to fix the sizing of dockwidgets on startup
RussBerg Mar 17, 2026
e564370
override showEvent to fix the sizing of dockwidgets on startup
RussBerg Mar 17, 2026
f24cb89
set the osa_out_position variable
RussBerg Mar 17, 2026
a7bf6e6
add second arg to new_data_dir signal enabling/disabling the addition…
RussBerg Mar 17, 2026
729d57e
progress fixed
RussBerg Mar 17, 2026
31f0436
add striptool_scaling_factor to beamline configuration
RussBerg Mar 19, 2026
5411f41
initial commit
RussBerg Mar 19, 2026
f859565
initial commit
RussBerg Mar 19, 2026
55b493e
fix the setting of combobox for scan requests
RussBerg Mar 19, 2026
386ce94
added a flag to help in plotting performance
RussBerg Mar 19, 2026
23f023c
loading only default attribute data to save memory
RussBerg Mar 19, 2026
40f1ba4
fix spacing of comboboxes for positioner panel
RussBerg Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ The nx_server service must be installed on a computer that
has a mount point to the data computer such that the ```/etc/fstab``` file contains the entry in its list of mount
points.

The service relies on the environment variable set in the file ```nx_server.env``` to determine the port to listen on
and the base data directory.

Create the file in the nx_server directory called ```nx_server.env``` and add the following entry to tell the service
the IP address of nx_server:

```shell
vi pyStxm/nx_server/nx_server.env
```
Then in nx_server.env add the following line, replacing the IP address with the IP address of the computer that is
running nx_server:
```shell
NX_SERVER_HOST=IP-ADDR-HERE
```

**Service Commands**:

- Enable the service:
Expand All @@ -170,6 +185,34 @@ points.
>sudo systemctl restart nx_server.service


In order for the logs of nx_server service to not use all diskspace on **/var/log**
the messages will be sent to **/etc/var/log/nx_server.log** and **logrotate** will be used
to rotate the logs when they reach 10MB in size, keeping 5 rotated logs and
compressing them to save space.


Create the file **/etc/logrotate.d/nx_server** and add the contents below:

```
/var/log/nx_server.log {
size 10M
rotate 5
compress
missingok
notifempty
copytruncate
}
````

Then run:
```shell
sudo logrotate -f /etc/logrotate.d/nx_server
````

You can continue to view live output with:
```shell
tail -f /var/log/nx_server.log
````
--------------------------------------
### Configure pyStxm with Pixelator

Expand Down
4 changes: 2 additions & 2 deletions bcm/devices/ophyd/ad_tucsen.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def make_filename(self):
Path that the IOC can write to or is it the path that this application can write to?

('a9b3ed47-bd2e-47af-ab20',
'\/opt/test_data/C167092/',
'/opt/test_data/C167092/',
'/opt/test_data/C167092')
'''
#dont over ride what was previously set to these signals likely from the scan plan
Expand Down Expand Up @@ -269,7 +269,7 @@ def make_filename(self):
Path that the IOC can write to or is it the path that this application can write to?

('a9b3ed47-bd2e-47af-ab20',
'\directory\\test_data\\C167092\\',
'/directory/test_data/C167092/',
'/opt/test_data/C167092')
'''
#dont over ride what was previously set to these signals likely from the scan plan
Expand Down
5 changes: 4 additions & 1 deletion bcm/devices/zmq/pixelator/pixelator_dcs_server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,17 @@ def intake_scan_line_data(self, resp, selected_det_names):
# calc the progress
all_scans_progress = int(float((self.ttl_points_received / self._total_num_points) * 100.0)/len(selected_det_names))
cur_img_progress = int(float((self.cur_img_points_received / (self.npoints_rows * self.npoints_cols)) * 100.0)/len(selected_det_names))
# cur_img_progress keeps a running total so reset it to zero on start of every new image
if sl_dct['img_idx'] > 0:
cur_img_progress = cur_img_progress - 100.0 * sl_dct['img_idx']

self._scan_line_data_cntr += 1
return {'det_name': selected_det_names[sl_dct['det_chan_idx']], 'row': sl_dct['row'], 'col': sl_dct['col'], 'shape': sl_dct['data_shape'],
'value': sl_dct['data'], 'is_tiled': self.tiling, 'is_partial': True if not self.tiling else False,
'img_idx': sl_dct['img_idx'],
"tile_num": sl_dct['tile_num'], "ev_idx": sl_dct['outer_idx'], "prog": cur_img_progress, "pol_idx": sl_dct['tile_num'],
"total_prog": all_scans_progress}


def handle_scanStarted(self, scan_request):
"""
parse the scan request and set the member variables
Expand Down
1 change: 1 addition & 0 deletions cls/appWidgets/main_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, name, endstation, beamline_cfg_dct=None, splash=None, main_cf
self.dcs_settings = None
self.data_dir = beamline_cfg_dct["BL_CFG_MAIN"]['data_dir']
self.default_detector = beamline_cfg_dct["BL_CFG_MAIN"].get('default_detector', None)
self.striptool_scaling_factor = float(beamline_cfg_dct["BL_CFG_MAIN"].get('striptool_scaling_factor', 1))
self.data_sub_context = zmq.Context()
self.nx_server_master_seq_dct = None
self._progressive_stack_data = {} # this is a dict of detector names each containing a list of lists that
Expand Down
18 changes: 9 additions & 9 deletions cls/app_data/app_dflts.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"OSA_IDX": 1,
"ZP_A1": -4.859,
"ZP_D": 240.0,
"ZP_IDX": 6
"ZP_IDX": 0
}
},
"PREFERENCESPARAMS": {
Expand Down Expand Up @@ -185,8 +185,8 @@
0
],
"RANGE": [
1000.0,
1000.0,
933.33,
933.33,
0,
0
],
Expand All @@ -197,8 +197,8 @@
-10.0
],
"STEP": [
71.42857142857143,
71.42857142857143,
66.66642857142857,
66.66642857142857,
0,
0
],
Expand Down Expand Up @@ -296,8 +296,8 @@
],
"DWELL": 1.0,
"NPOINTS": [
15,
15,
30,
30,
0,
0
],
Expand All @@ -314,8 +314,8 @@
-10.0
],
"STEP": [
5.714285714285714,
5.714285714285714,
2.7586206896551726,
2.7586206896551726,
0,
0
],
Expand Down
4 changes: 2 additions & 2 deletions cls/applications/pyStxm/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ autoSaveData = true

# which beamline configuration to use for the devices, this is the name of the .ini file in the bl_configs directory
# of the same name <lab>_<beamline>_<endstation>.ini
# bl_config = sls_x07da_polLux
bl_config = amb_bl10ID1
bl_config = sls_x07da_polLux
# bl_config = amb_bl10ID1
# bl_config = uhv_bl10ID1
mongo_db_nm = pystxm_amb_bl10ID1
nx_server_port = 5555
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ ptychography_enabled=false
min_ptycho_dwell_ms=300.0 # ms
tomography_enabled=false #requires GONIX and GONIY to exist
use_e712_hdw_accel=true
save_progressive_stack_data=true
save_progressive_stack_data=false
default_detector=DNM_PMT
striptool_scaling_factor=10.0

#plugin_dir=endstation_prefix
#support for Pixelator required override the plugin dir so that it will use the common pixelator scan plugins
Expand Down
43 changes: 22 additions & 21 deletions cls/applications/pyStxm/bl_configs/amb_bl10ID1/devs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

SIM =False
SIM = True
dev_dct = {}


Expand All @@ -9,16 +9,16 @@
"name": "DNM_SAMPLE_FINE_X",
"desc": "Fine_X",
"class": "e712_sample_motor",
#"dcs_nm": "PZAC1610-3-I12-40",
"dcs_nm": "TB_ASTXMIOC:m700" if SIM else "PZAC1610-3-I12-40",
"dcs_nm": "PZAC1610-3-I12-40",
#"dcs_nm": "TB_ASTXMIOC:m700" if SIM else "PZAC1610-3-I12-40",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_SAMPLE_FINE_Y",
"desc": "Fine_Y",
"class": "e712_sample_motor",
#"dcs_nm": "PZAC1610-3-I12-41",
"dcs_nm": "TB_ASTXMIOC:m701" if SIM else "PZAC1610-3-I12-41",
"dcs_nm": "PZAC1610-3-I12-41",
#"dcs_nm": "TB_ASTXMIOC:m701" if SIM else "PZAC1610-3-I12-41",
"pos_type": "POS_TYPE_ES",
},
{
Expand All @@ -34,71 +34,71 @@
"desc": "OSA_Y",
"class": "MotorQt",
#"dcs_nm": "PZAC1610-3-I12-44",
"dcs_nm": "TB_ASTXMIOC:m702" if SIM else "PZAC1610-3-I12-44",
"dcs_nm": "TB_ASTXMIOC:m703" if SIM else "PZAC1610-3-I12-44",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_ZONEPLATE_Z",
"Zoneplate_Z": "FineX",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-51",
"dcs_nm": "TB_ASTXMIOC:m703" if SIM else "SMTR1610-3-I12-51",
"dcs_nm": "TB_ASTXMIOC:m704" if SIM else "SMTR1610-3-I12-51",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_COARSE_X",
"desc": "Coarse_X",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-45",
"dcs_nm": "TB_ASTXMIOC:m704" if SIM else "SMTR1610-3-I12-45",
"dcs_nm": "SMTR1610-3-I12-45",
#"dcs_nm": "TB_ASTXMIOC:m705" if SIM else "SMTR1610-3-I12-45",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_COARSE_Y",
"desc": "Coarse_Y",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-46",
"dcs_nm": "TB_ASTXMIOC:m705" if SIM else "SMTR1610-3-I12-46",
"dcs_nm": "SMTR1610-3-I12-46",
#"dcs_nm": "TB_ASTXMIOC:m706" if SIM else "SMTR1610-3-I12-46",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_COARSE_Z",
"desc": "Coarse_Z",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-47",
"dcs_nm": "TB_ASTXMIOC:m706" if SIM else "SMTR1610-3-I12-47",
"dcs_nm": "TB_ASTXMIOC:m707" if SIM else "SMTR1610-3-I12-47",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_DETECTOR_X",
"desc": "Detector_X",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-48",
"dcs_nm": "TB_ASTXMIOC:m707" if SIM else "SMTR1610-3-I12-48",
"dcs_nm": "TB_ASTXMIOC:m708" if SIM else "SMTR1610-3-I12-48",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_DETECTOR_Y",
"desc": "Detector_Y",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-49",
"dcs_nm": "TB_ASTXMIOC:m708" if SIM else "SMTR1610-3-I12-49",
"dcs_nm": "TB_ASTXMIOC:m709" if SIM else "SMTR1610-3-I12-49",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_DETECTOR_Z",
"desc": "Detector_Z",
"class": "MotorQt",
#"dcs_nm": "SMTR1610-3-I12-50",
"dcs_nm": "TB_ASTXMIOC:m709" if SIM else "SMTR1610-3-I12-50",
"dcs_nm": "TB_ASTXMIOC:m710" if SIM else "SMTR1610-3-I12-50",
"pos_type": "POS_TYPE_ES",
},
{
"name": "DNM_SAMPLE_X",
"desc": "Sample_X",
"class": "sample_abstract_motor",
#"dcs_nm": "PSMTR1610-3-I12-00",
"dcs_nm": "TB_ASTXMIOC:m710" if SIM else "PSMTR1610-3-I12-00",
"dcs_nm": "PSMTR1610-3-I12-00",
#"dcs_nm": "TB_ASTXMIOC:m711" if SIM else "PSMTR1610-3-I12-00",
"pos_type": "POS_TYPE_ES",
"fine_mtr_name": "DNM_SAMPLE_FINE_X",
"coarse_mtr_name": "DNM_COARSE_X"
Expand All @@ -107,8 +107,8 @@
"name": "DNM_SAMPLE_Y",
"desc": "Sample_Y",
"class": "sample_abstract_motor",
#"dcs_nm": "PSMTR1610-3-I12-01",
"dcs_nm": "TB_ASTXMIOC:m711" if SIM else "PSMTR1610-3-I12-01",
"dcs_nm": "PSMTR1610-3-I12-01",
#"dcs_nm": "TB_ASTXMIOC:m712" if SIM else "PSMTR1610-3-I12-01",
"pos_type": "POS_TYPE_ES",
"fine_mtr_name": "DNM_SAMPLE_FINE_Y",
"coarse_mtr_name": "DNM_COARSE_Y"
Expand Down Expand Up @@ -188,7 +188,8 @@
"name": "DNM_EPU_ANGLE",
"desc": "Epu_Angle",
"class": "MotorQt",
"dcs_nm": "SIM_VBL1610-I12:epuAngle" if SIM else "BL1610-I10:epuAngle",
#"dcs_nm": "SIM_VBL1610-I12:epuAngle" if SIM else "BL1610-I10:epuAngle",
"dcs_nm": "BL1610-I10:epuAngle",
"abstract_mtr": True,
"pos_type": "POS_TYPE_BL",
},
Expand All @@ -208,7 +209,7 @@
"name": "DNM_SHUTTERTASKRUN",
"class": "make_basedevice",
# "dcs_nm": "ASTXM1610:Dio:shutter:Run",
"dcs_nm": "uhvDIO:shutter:Run",
"dcs_nm": "ASTXM1610:Dio:shutter:Run" if SIM else "uhvDIO:shutter:Run",
},
]

Expand Down
Loading
Loading