Skip to content

Commit

Permalink
set ndim correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan committed Feb 5, 2025
1 parent d4590c4 commit 55d39a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nxsrecconfig/ProfileManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,6 @@ def __addChannel(cls, cnf, ctrl, device, fullname, dontdisplay, index,
dct['instrument'] = None
dct['label'] = Utils.tostr(device)
dct['name'] = Utils.tostr(device)
dct['ndim'] = 0
dct['nexus_path'] = u''
dct['normalization'] = 0
dct['output'] = True
Expand All @@ -1510,15 +1509,19 @@ def __addChannel(cls, cnf, ctrl, device, fullname, dontdisplay, index,
if device in dontdisplay:
dct['plot_axes'] = []
dct['plot_type'] = 0
dct['ndim'] = 0
elif dct['shape'] and len(dct['shape']) == 1:
dct['plot_axes'] = ['<idx>']
dct['plot_type'] = 1
dct['ndim'] = 1
elif dct['shape'] and len(dct['shape']) == 2:
dct['plot_axes'] = ['<idx>', '<idx>']
dct['plot_type'] = 2
dct['ndim'] = 2
else:
dct['plot_axes'] = ['<mov>']
dct['plot_type'] = 1
dct['ndim'] = 0

if valuerefenabled is not None:
dct['value_ref_enabled'] = valuerefenabled
Expand Down Expand Up @@ -1578,7 +1581,6 @@ def __addTangoChannel(cls, cnf, ctrl, device, record, dontdisplay, index):
dct['instrument'] = None
dct['label'] = Utils.tostr(label)
dct['name'] = Utils.tostr(device)
dct['ndim'] = 0
dct['nexus_path'] = u''
dct['normalization'] = 0
dct['output'] = True
Expand All @@ -1587,15 +1589,19 @@ def __addTangoChannel(cls, cnf, ctrl, device, record, dontdisplay, index):
if device in dontdisplay:
dct['plot_axes'] = []
dct['plot_type'] = 0
dct['ndim'] = 0
elif dct['shape'] and len(dct['shape']) == 1:
dct['plot_axes'] = ['<idx>']
dct['plot_type'] = 1
dct['ndim'] = 1
elif dct['shape'] and len(dct['shape']) == 2:
dct['plot_axes'] = ['<idx>', '<idx>']
dct['plot_type'] = 2
dct['ndim'] = 2
else:
dct['plot_axes'] = ['<mov>']
dct['plot_type'] = 1
dct['ndim'] = 0

dct['source'] = Utils.tostr(source)
ctrlChannels[fullname] = dct
Expand Down

0 comments on commit 55d39a2

Please sign in to comment.