nxsrecconfig package

Submodules

nxsrecconfig.CheckerThread module

Component CheckerThread - thread which checks tango server attributes

nxsrecconfig.CheckerThread.ATTRIBUTESTOCHECK = ['Value', 'Position', 'Counts', 'Data', 'Voltage', 'Energy', 'SampleTime']

(list < str>) default attributes to check

exception nxsrecconfig.CheckerThread.AlarmStateError[source]

Bases: Exception

Alarm State Exception class

class nxsrecconfig.CheckerThread.CheckerItem(name)[source]

Bases: list

Checker list Item

constructor

Parameters:

name (str) – checker item name

active

(bool) enabled flag

errords

(str) datasource with first error

message

(str) first error message

name

(str) checker name

class nxsrecconfig.CheckerThread.CheckerThread(index, queue)[source]

Bases: Thread

Single CheckerThread

constructor

Brief:

It creates ElementThread from the runnable element

Parameters:
  • index (int) – the current thread index

  • queue (Queue.Queue) – queue with tasks

index

(int) thread index

run()[source]

runner

Brief:

It runs the defined thread

tangoSourceErrorStates

(list <str>) tango datasources error states

tangoSourceWarningStates

(list <str>) tango datasources warning states

exception nxsrecconfig.CheckerThread.FaultStateError[source]

Bases: Exception

Fault State Exception class

exception nxsrecconfig.CheckerThread.OffStateError[source]

Bases: Exception

Off State Exception class

class nxsrecconfig.CheckerThread.TangoDSItem(name=None, device=None, attr=None)[source]

Bases: object

Tango DataSource item

constructor

Parameters:
  • name (str) – datasource name

  • device (str) – datasource device

  • attr (str) – device attribute

attr

(str) datasource device attribute

device

(str) datasource device

name

(str) datasource name

nxsrecconfig.Converter module

Selection version converter

class nxsrecconfig.Converter.Converter(ver)[source]

Bases: object

selection version converter

contstructor

Parameters:

ver (str) – the required selection version

allkeys(selection)[source]
Parameters:

selection (nxsrecconfig.Selection.Selection) – selection dictionary object

Returns:

selection keys

Return type:

set

convert(selection)[source]

converts selection from any version to any other

Parameters:

selection (dict <str, any>) – selection dictionary object

down

(list <ConverterXtoY>) converter down sequence

majorversion

(int) major selection version

minorversion

(int) minor selection version

patchversion

(int) patch selection version

up

(list <ConverterXtoY>) converter up sequence

classmethod version(selection)[source]
fetches selection version and converts it

into (major, minor, patch)

Parameters:

selection (nxsrecconfig.Selection.Selection) – selection dictionary object

Returns:

(major, minor, patch) tuple with integers

Return type:

(int , int , int)

class nxsrecconfig.Converter.Converter1to2[source]

Bases: ConverterXtoY

Selection converter from version 1 to 2

constructor

convert(selection)[source]

converts selection from version 1 to 2

Parameters:

selection (dict <str, any>) – selection dictionary object

names

(dict <str, str>) names to convert

pnames

(dict <str, str>) names of properties

class nxsrecconfig.Converter.Converter2to1[source]

Bases: ConverterXtoY

Selection converter from version 2 to 1

constructor

convert(selection)[source]

converts selection from version 2 to 1

Parameters:

selection (dict <str, any>) – selection dictionary object

names

(dict <str, str>) names to convert

pnames

(dict <str, str>) names of properties

class nxsrecconfig.Converter.Converter2to3[source]

Bases: ConverterXtoY

Selection converter from version 2 to 3

converter

convert(selection)[source]

converts selection from version 2 to 3

Parameters:

selection (dict <str, any>) – selection dictionary object

names

(dict <str, str>) names to convert

seltoint(jselelem)[source]

converters list/dict of elements to dictionary with logical values

Parameters:

jselelem (str) – json list or dict selection element

Returns:

json dictionary

Return type:

str

class nxsrecconfig.Converter.Converter3to2[source]

Bases: ConverterXtoY

Selection converter from version 3 to 2

constructor

convert(selection)[source]

converts selection from version 3 to 2

Parameters:

selection (dict <str, any>) – selection dictionary object

names

(dict <str, str>) names to convert

seltobool(jselelem)[source]
converters dictioanry with None/True/False values

to dictionary with True/False values

Parameters:

jselelem (str) – json dictionary selection element

Returns:

converter json dictionary

Return type:

str

seltolist(jselelem)[source]
converters dictioanry with None/True/False values

to list of elementes with walue True

Parameters:

jselelem (str) – json dictionary selection element

Returns:

converter json dictionary

Return type:

str

class nxsrecconfig.Converter.ConverterXtoY[source]

Bases: object

virtual selection version converter

constructor

convert(selection)[source]

converts selection to the current selector version

Parameters:

selection (dict <str, any>) – selection dictionary object

names

(dict <str, str>) names to convert

nxsrecconfig.Describer module

Component Describer

class nxsrecconfig.Describer.DSItem(name=None, dstype=None, record=None, dsitem=None, parentobj=None)[source]

Bases: object

Basic DataSource item

constructor

Parameters:
  • name (str) – datasource name

  • dstype (str) – datasource type

  • record (str) – datasource record

  • dsitem (DSItem) – datasource item

  • parentobj (str) – datasource parent object

dstype

(str) datasource type

name

(str) datasource name

parentobj

(str) datasource parentobj

record

(str) datasource record

class nxsrecconfig.Describer.Describer(nexusconfig_device, tree=False, pyevalfromscript=False)[source]

Bases: object

Lists datasources, strategy, dstype and record name of given component

constructor

Parameters:
components(components=None, strategy='', dstype='', cfvars=None)[source]

describes given components. If tree = True it returns

[{ cpname : { dsname : [ | (strategy, dstype, record, nxstype, shape), …] } } ]

else

[{“dsname”: dsname, “strategy”: strategy, “dstype”: dstype, | “record”: record, “nxstype”: nxstype, “shape”: shape , | “cpname”: cpname}, …]
Parameters:
  • components (list <str>) – given components. If None all available ones are taken

  • strategy (str) – list datasets only with given strategy. If ‘’ all available ones are taken

  • dstype (str) – list datasets only with given datasource type. If ‘’ all available ones are taken

  • cfvars (str) – configuration variables in JSON dictionary

Returns:

list of dictionary with description of components

Return type:

[dict <str, dict <str, list <(str, str, str, str, list <int>)> > > ] or [{“dsname”: str, “strategy”: str, “dstype”: str, “record”: str, “nxstype”: str, “shape”: list <int> , “cpname”: str}, …]

dataSources(names=None, dstype='')[source]

describes given datasources

Parameters:
  • names (list <str>) – given datasources. If None all available ones are taken

  • dstype (str) – list datasources only with given type. If ‘’ all available ones are taken

Returns:

list of dictionary with description of datasources

Return type:

[dict <str, ExDSDict > ] or [{“dsname”: str, “dstype”: str, “record”: str}, …]

class nxsrecconfig.Describer.ExDSDict(*args, **kw)[source]

Bases: dict

Extended DataSource Dictionary

constructor

Parameters:
  • args (list <any>) – dict args

  • kw (dict <any , any>) – dict kw

appendDSList(dslist, mode, nxtype=None, shape=None)[source]

appends a list of ExDSItem

Parameters:
  • dslist (list <DSItem>) – DSItem list

  • mode (str) – startegy mode

  • nxtype – NeXus type

  • shape (list <int>) – data shape

Returns:

datasource name for first added datasource or None if not appended

Return type:

str

class nxsrecconfig.Describer.ExDSItem(dsitem=None, mode=None, nxtype=None, shape=None)[source]

Bases: DSItem

Extended DataSource item

constructor

Parameters:
  • dsitem (DSItem) – datasource item

  • mode (str) – writing strategy mode

  • nxtype – nexus type

  • shape (list <int>) – datasource shape

mode

(str) writing strategy mode

nxtype

(str) nexus type

shape

(list <int>) datasource shape

nxsrecconfig.DynamicComponent module

Dynamic Component

class nxsrecconfig.DynamicComponent.DynamicComponent(nexusconfig_device, defaultpath="/$var.entryname#'scan'$var.serialno:NXentry/NXinstrument/collection", defaulttype='NX_CHAR', defaultuserpath="/$var.entryname#'scan'$var.serialno:NXentry/user_data:NXparameters")[source]

Bases: object

Creates dynamic component of given component

constructor

Parameters:
create()[source]

creates dynamic component

Returns:

dynanic component name

Return type:

str

remove(name)[source]

removes dynamic component

Parameters:

name (str) – dynamic component name

setDefaultLinkPath(dynamicLinks, dynamicPath, dynamicInitLinks=None)[source]

sets default nexus path and link flag for dynamic components

Brief:

if dynamicPath is None or “” it is reset to default one

Parameters:
  • dynamicPath (str) – nexus default path

  • dynamicLinks (bool) – default link flag

  • dynamicInitLinks (bool) – default link flag

setInitDSources(dsources)[source]

sets init datasources

Parameters:

dsources (list <str>) – list of init datasources

setLabelParams(labels, paths, links, types, shapes)[source]

sets label parameters for specific dynamic components

Parameters:
setStepDSources(dsources)[source]

sets step datasources

Parameters:

dsources (list <str>) – list of step datasources

setStepDictDSources(dctlist)[source]

sets user datasources with type and shape

Parameters:

dctlist (str) – json list of parameter dictionaries [{“name”: <dsname>, “dtype”: <num_type>, “shape”:<list>}, …]

nxsrecconfig.MacroServerPools module

Selection state

class nxsrecconfig.MacroServerPools.MacroServerPools(numberOfThreads)[source]

Bases: object

sardanamacro server and pools

constructor

Parameters:

numberOfThreads (str) – number of threads

checkChannels(door, configdevice, channels, componentgroup, datasourcegroup, channelerrors)[source]

checks component channels

Parameters:
Returns:

json dictionary with selected active components

Return type:

str

getMacroServer(door)[source]

door macro server device name

Parameters:

door (str) – door device name

Returns:

macroserver device name

Return type:

str

getPools(door)[source]

door pool device proxies

Parameters:

door (str) – door device name

Returns:

pool device proxies

Return type:

list <tango.DeviceProxy>

getScanEnv(door)[source]

fetches Scan Environment Data

Parameters:

door (str) – door device

Returns:

JSON String with important variables

Return type:

str

getSelectorEnv(door, names, data)[source]

imports Environment Data

Parameters:
  • door (str) – door device

  • names (list <str>) – names of required variables

  • data (dict <str , any>) – dictionary with resulting data

isDoorRunning(ms)[source]

check if any door server is running

Parameters:

ms (str) – macroserver device name

Returns:

if any door running

Return type:

bool

poolBlacklist

(list <str>) black list of pools

setScanEnv(door, jdata)[source]

stores Scan Environment Data

Parameters:
  • door (str) – door device

  • jdata (str) – JSON String with important variables

setSelectorEnv(door, data, cmddata=None)[source]

exports all Environment Data

Parameters:
  • door (str) – door device

  • data (dict <str , any>) – data dictionary

  • cmddata (dict <str , any>) – command data dictionary

tangoSourceErrorStates

(list <str>) tango datasources off states

tangoSourceWarningStates

(list <str>) tango datasources warning states

updateMacroServer(door)[source]

updates MacroServer and sardana pools for given door

Parameters:

door (str) – door device name

Returns:

macroserver device name

Return type:

str

nxsrecconfig.NXSConfig module

Selector Server for NeXus Sardana Recorder

class nxsrecconfig.NXSConfig.NXSRecSelector(cl, name)[source]

Bases: LatestDeviceImpl

NXSRecSelector server interface

Brief:

Tango Server for Nexus Sardana Recorder Settings. Device States Description: DevState.ON - Server is ON, DevState.RUNNING - Performing a query

Device constructor

Parameters:
  • cl (str) – class name

  • name (str) – device name

AddStepDataSources(argin)[source]

AddStepDataSources command

Brief:

switch datasources to step mode

Parameters:

argin (list <str>) – DevVarStringArray list of datasource names

Returns:

DevVarStringArray list of datasources not found in components

Rtypes:

list <str>

AdministratorDataNames()[source]

AdministratorDataNames command

Brief:

Provide Administrator Data Names

Returns:

DevVarStringArray data record names

Return type:

list <str>

AvailableComponents()[source]

AvailableComponents command

Brief:

Return a list of available component names

Returns:

DevVarStringArray list of available component names

Return type:

list <str>

AvailableDataSources()[source]

AvailableDataSources command

Brief:

Return a list of available DataSource names

Returns:

DevVarStringArray list of available DataSource names

Return type:

list <str>

AvailableMntGrps()[source]

AvailableMntGrps command

Brief:

Return a list of available mntgrp names

Returns:

DevVarStringArray list of available mntgrp names

Return type:

list <str>

AvailableProfiles()[source]

AvailableProfiles command

Brief:

Return a list of available selection names

Returns:

DevVarStringArray list of available selection names

Return type:

list <str>

AvailableTimers()[source]

AvailableTimers command

Brief:

Returns a list of available component names

Returns:

DevVarStringArray list of available component names

Return type:

list <str>

ChannelProperties(argin)[source]

ChannelProperties command

Brief:

Provide JSON dictionary with channel properties {channel:property}

Parameters:

argin (str) – DevString property type

Returns:

DevString JSON dictionary with channel properties

Return type:

str

ComponentClientSources(argin)[source]

ComponentClientSources command

Brief:

Describe client datasources from components

Parameters:

argin (list <str>) – DevVarStringArray list of component names

Returns:

DevVarString description of component datasources

Return type:

str

ComponentDataSources()[source]

ComponentDataSources command

Brief:

Provide the component datasources

Returns:

DevVarStringArray component names

Return type:

list <str>

ComponentDescription()[source]

ComponentDescription command

Brief:

Return a list of available component names

Returns:

DevString list of available component names

Return type:

str

ComponentSources(argin)[source]

ComponentSources command

Brief:

Describe datasources from components

Parameters:

argin (list <str>) – DevVarStringArray list of component names

Returns:

DevVarString description of component datasources

Return type:

str

CreateDataSources(argin)[source]

It creates new DataSources on the ConfigServer

Parameters:

argin (str) – JSON dictionary with {dsname: tangosource, …}

CreateDynamicComponent(argin)[source]

CreateDynamicComponent command

Brief:

Create dynamic component

Parameters:

argin (list <str>) – DevVarStringArray list of datasource parameters

Returns:

DevVarString name of created dynamic component

Return type:

str

CreateWriterConfiguration(argin)[source]

CreateWriterConfiguration command

Brief:

Create configuration from the given components

Parameters:

argin (list <str>) – DevVarStringArray list of component names

Returns:

DevVarString XML configuration string

Return type:

str

DataSourceDescription(argin)[source]

DataSourceDescription command

Brief:

Provide datasource description

Parameters:

argin (list <str>) – DevVarStringArray list of datasource names

Returns:

DevVarStringArray description of datasources

Rtypes:

list <str>

DeleteAllProfiles()[source]

DeleteAllProfiles command

Brief:

Delete all profiles from Configuration Server

DeleteProfile(argin)[source]

DeleteProfile command

Brief:

Delete the given mntgrp

Parameters:

argin (str) – DevString measurement group name

ExportEnvProfile()[source]

ExportEnvProfile command

Brief:

Export all environment variables

FetchProfile()[source]

FetchProfile command

Brief:

Fetch server configuration

FullDeviceNames()[source]

FullDeviceNames command

Brief:

Return a JSON with full device names for all aliases

Returns:

DevString JSON dictionary with full device names

Return type:

str

ImportEnvProfile()[source]

ImportEnvProfile command

Brief:

Import all environment variables

ImportMntGrp()[source]

ImportMntGrp command

Brief:

Import active mntgrp configuration

IsMntGrpUpdated()[source]

IsMntGrpUpdated command

Returns:

True if mntgrp was changed

Return type:

bool

LoadProfile()[source]

LoadProfile command

Brief:

Load server configuration

MandatoryComponents()[source]

MandatoryComponents command

Brief:

Set the mandatory components

Returns:

DevVarStringArray component names

Return type:

list <str>

MntGrpConfiguration()[source]

MntGrpConfiguration command

Brief:

returns mntgrp configuration

Returns:

Provide mntgrp configuration in json string

Return type:

str

MutedChannels()[source]

MutedChannels command

Brief:

Return a list of muted channel names

Returns:

DevVarStringArray list of muted channel names

Return type:

list <str>

PoolElementNames(argin)[source]

PoolElementNames command

Brief:

Return a list of available pool channels

Parameters:

argin (str) – DevString name of pool list attribute

Returns:

DevVarStringArray list of available pool elements

Return type:

list <str>

PreselectComponents()[source]

PreselectComponents command

Brief:

Check existing devices of pools

PreselectedComponents()[source]

PreselectedComponents command

Brief:

Provide the preselected components

Returns:

DevVarStringArray component names

Return type:

list <str>

PreselectedDataSources()[source]

PreselectedDataSources command

Brief:

Provide the preselected components

Returns:

DevVarStringArray component names

Return type:

list <str>

RemoveDynamicComponent(argin)[source]

RemoveDynamicComponent command

Brief:

Delete the given dynamic component

Parameters:

argin (str) – DevString dynamic component name

ResetPreselectedComponents()[source]

ResetPreselectedComponents command

Brief:

reset PreselectedComponents to DefaultPreselectedComponents

SaveProfile()[source]

SaveProfile command

Brief:

Save server configuration

ScanEnvVariables()[source]

ScanEnvVariables command

Brief:

Fetch ScanDir, ScanFile, ScanID and NeXusSelectorDevice in environment variables

Returns:

DevString json dictionary with environment data

Return type:

str

SelectedComponents()[source]

SelectedComponents command

Brief:

Provide the selected components

Returns:

DevVarStringArray component names

Return type:

list <str>

SelectedDataSources()[source]

SelectedDataSources command

Brief:

Provide the selected datasources

Returns:

DevVarStringArray component names

Return type:

list <str>

SetChannelProperties(argin)[source]

SetChannelProperties command SetChannelProperties

Brief:

Set Channel Properties of the given type

Parameters:

argin ([str, str]) – DevVarStringArray two element list with a property type and JSON value dictionary {channel:property}

SetScanEnvVariables(argin)[source]

SetScanEnvVariables command

Brief:

Store ScanDir, ScanFile and NeXusSelectorDevice in environment variables

Parameters:

argin (str) – json dictionary with environment data

Returns:

DevLong scan ID

Return type:

int

StoreProfile()[source]

StoreProfile command command

Brief:

Store server configuration

SwitchProfile()[source]

SwitchProfile command

Brief:

Switch mntgrp configuration

UpdateConfigVariables()[source]

UpdateConfigVariables command

Brief:

Send ConfigVariables into ConfigServer and update serialno if appendEntry selected

UpdateMntGrp()[source]

UpdateMntGrp command

Brief:

Update mntgrp configuration

Returns:

mntgrp configuration string

Return type:

str

UpdateProfile()[source]

UpdateProfile command

Brief:

Update mntgrp configuration

Returns:

JSON string with mntgrp configuration info

Return type:

str

VariableComponents()[source]

VariableComponents command

Brief:

Returns a list of available component names

Returns:

DevString list of available component names

Return type:

str

always_executed_hook()[source]

Always excuted hook method

delete_device()[source]

Device destructor

init_device()[source]

Device initialization

is_AdministratorDataNames_allowed()[source]

AdministratorDataNames command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_AvailableComponents_allowed()[source]

AvailableComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_AvailableDataSources_allowed()[source]

AvailableDataSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_AvailableMntGrps_allowed()[source]

AvailableMntGrps command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_AvailableProfiles_allowed()[source]

AvailableProfiles command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_AvailableTimers_allowed()[source]

AvailableTimers command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_CanFailDataSources_write_allowed()[source]

CanFailDataSources attribute Write State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ChannelProperties_allowed()[source]

ChannelProperties command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ComponentClientSources_allowed()[source]

ComponentClientSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ComponentDataSources_allowed()[source]

ComponentDataSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ComponentDescription_allowed()[source]

ComponentDescription command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ComponentSources_allowed()[source]

ComponentSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_CreateDataSources_allowed()[source]

CreateDataSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_CreateDynamicComponent_allowed()[source]

CreateDynamicComponent command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_CreateWriterConfiguration_allowed()[source]

CreateWriterConfiguration command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_DataSourceDescription_allowed()[source]

DataSourceDescription command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_DeleteAllProfiles_allowed()[source]

DeleteAllProfiles command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_DeleteProfile_allowed()[source]

DeleteProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ExportEnv_allowed()[source]

ExportMntGrp command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_FetchProfile_allowed()[source]

FetchProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_FullDeviceNames_allowed()[source]

FullDeviceNames command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ImportEnv_allowed()[source]

ImportMntGrp command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ImportMntGrp_allowed()[source]

ImportMntGrp command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_IsMntGrpUpdated_allowed()[source]

IsMntGrpUpdated command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_LinkDataSources_write_allowed()[source]

LinkDataSources attribute Write State Machine

Returns:

True if the operation allowed

Return type:

bool

is_LoadProfile_allowed()[source]

LoadProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_MandatoryComponents_allowed()[source]

MandatoryComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_MntGrpConfiguration_allowed()[source]

MntGrpConfiguration command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_MutedChannels_allowed()[source]

MutedChannels command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_PoolElementNames_allowed()[source]

PoolElementNames command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_PreselectComponents_allowed()[source]

PreselectComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_PreselectedComponents_allowed()[source]

PreselectedComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_PreselectedDataSources_allowed()[source]

PreselectedDataSources command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_RemoveDynamicComponent_allowed()[source]

RemoveDynamicComponent command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ResetPreselectedComponents_allowed()[source]

ResetPreselectedComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_SaveProfile_allowed()[source]

SaveProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_ScanEnvVariables_allowed()[source]

ScanEnvVariables command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_SelectedComponents_allowed()[source]

SelectedComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_SelectedDataSources_allowed()[source]

SelectedDataSources command State Machine

is_SetChannelProperties_allowed()[source]

SetChannelProperties command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_SetScanEnvVariables_allowed()[source]

SetScanEnvVariables command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_StepDataSources_write_allowed()[source]

StepDataSources attribute Write State Machine

Returns:

True if the operation allowed

Return type:

bool

is_StoreProfile_allowed()[source]

StoreProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_SwitchProfile_allowed()[source]

SwitchProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_UpdateConfigVariables_allowed()[source]

UpdateConfigVariables command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_UpdateMntGrp_allowed()[source]

UpdateMntGrp command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_UpdateProfile_allowed()[source]

UpdateProfile command State Machine

Returns:

True if the operation allowed

Return type:

bool

is_VariableComponents_allowed()[source]

VariableComponents command State Machine

Returns:

True if the operation allowed

Return type:

bool

read_AppendEntry(attr)[source]

Read AppendEntry attribute

Parameters:

attr (tango.Attribute) – read attribute

read_CanFailDataSources(attr)[source]

Read CanFailDataSources attribute

Parameters:

attr (tango.Attribute) – read attribute

read_Components(attr)[source]

Read Components attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ConfigDevice(attr)[source]

Read ConfigDevice attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ConfigVariables(attr)[source]

Read ConfigVariables attribute

Parameters:

attr (tango.Attribute) – read attribute

read_DataSources(attr)[source]

Read DataSources attribute

Parameters:

attr (tango.Attribute) – read attribute

read_DescriptionErrors(attr)[source]

Read DescriptionErrors attribute

Parameters:

attr (tango.Attribute) – read attribute

read_DeviceGroups(attr)[source]

Read DeviceGroups attribute

Parameters:

attr (tango.Attribute) – read attribute

read_Door(attr)[source]

Read Door attribute

Parameters:

attr (tango.Attribute) – read attribute

read_LinkDataSources(attr)[source]

Read LinkDataSources attribute

Parameters:

attr (tango.Attribute) – read attribute

read_MacroServer(attr)[source]

Read MacroServer attribute

Parameters:

attr (tango.Attribute) – read attribute

read_MntGrp(attr)[source]

Read MntGrp attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ProfileConfiguration(attr)[source]

Read ProfileConfiguration attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ProfileFile(attr)[source]

Read ProfileFile attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ScanDir(attr)[source]

Read ScanDir attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ScanFile(attr)[source]

Read ScanFile attribute

Parameters:

attr (tango.Attribute) – read attribute

read_ScanID(attr)[source]

Read ScanID attribute

Parameters:

attr (tango.Attribute) – read attribute

read_StepDataSources(attr)[source]

Read StepDataSources attribute

Parameters:

attr (tango.Attribute) – read attribute

read_UserData(attr)[source]

Read UserData attribute

Parameters:

attr (tango.Attribute) – read attribute

read_Version(attr)[source]

Read Version attribute

Parameters:

attr (tango.Attribute) – read attribute

read_WriterDevice(attr)[source]

Read WriterDevice attribute

Parameters:

attr (tango.Attribute) – read attribute

read_attr_hardware(_)[source]

Read Attribute Hardware

write_AppendEntry(attr)[source]

Write AppendEntry attribute

Parameters:

attr (tango.Attribute) – written attribute

write_CanFailDataSources(attr)[source]

Write CanFailDataSources attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ConfigDevice(attr)[source]

Write ConfigDevice attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ConfigVariables(attr)[source]

Write ConfigVariables attribute

Parameters:

attr (tango.Attribute) – written attribute

write_DeviceGroups(attr)[source]

Write DeviceGroups attribute

Parameters:

attr (tango.Attribute) – written attribute

write_Door(attr)[source]

Write Door attribute

Parameters:

attr (tango.Attribute) – written attribute

write_LinkDataSources(attr)[source]

Write LinkDataSources attribute

Parameters:

attr (tango.Attribute) – written attribute

write_MntGrp(attr)[source]

Write MntGrp attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ProfileConfiguration(attr)[source]

Write ProfileConfiguration attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ProfileFile(attr)[source]

Write ProfileFile attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ScanDir(attr)[source]

Write ScanDir attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ScanFile(attr)[source]

Write ScanFile attribute

Parameters:

attr (tango.Attribute) – written attribute

write_ScanID(attr)[source]

Write ScanID attribute

Parameters:

attr (tango.Attribute) – written attribute

write_StepDataSources(attr)[source]

Write StepDataSources attribute

Parameters:

attr (tango.Attribute) – written attribute

write_UserData(attr)[source]

Write UserData attribute

Parameters:

attr (tango.Attribute) – written attribute

write_WriterDevice(attr)[source]

Write WriterDevice attribute

Parameters:

attr (tango.Attribute) – written attribute

class nxsrecconfig.NXSConfig.NXSRecSelectorClass(name)[source]

Bases: DeviceClass

NXSRecSelectorclass Constructor

attr_list = {'AppendEntry': [[tango._tango.CmdArgType.DevBoolean, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Append Entry', 'description': 'flag for entry appending'}], 'CanFailDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'list of datasources to be switch into canfail mode', 'description': 'list of datasources to be switched into canfail mode', 'Display level': tango._tango.DispLevel.EXPERT}], 'Components': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'label': 'Selected Components', 'description': 'list of Selected Components'}], 'ConfigDevice': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Configuration Device', 'description': 'Configuration device name', 'Memorized': 'true'}], 'ConfigVariables': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Configuration Variables', 'description': 'JSON dictionary with configuration variablesfor templated components', 'Display level': tango._tango.DispLevel.EXPERT}], 'DataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'label': 'Selected Datasources', 'description': 'list of Selected Datasources'}], 'DescriptionErrors': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SPECTRUM, tango._tango.AttrWriteType.READ, 10000], {'label': 'Descriptive Component Errors', 'description': 'list of Descriptive Component Errors'}], 'DeviceGroups': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Device groups', 'description': 'JSON dictionary with device groups', 'Memorized': 'true', 'Display level': tango._tango.DispLevel.EXPERT}], 'Door': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Door', 'description': 'Door device name', 'Memorized': 'true'}], 'LinkDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'list of datasources to which a link will be added', 'description': 'list of datasources to which a link will be added', 'Display level': tango._tango.DispLevel.EXPERT}], 'MacroServer': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'label': 'MacroServer', 'description': 'Macro Server device name'}], 'MntGrp': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': ' Measurement Group', 'description': ' Measurement Group name'}], 'ProfileConfiguration': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Profile Configuration', 'description': 'JSON dict of server configuration', 'Display level': tango._tango.DispLevel.EXPERT}], 'ProfileFile': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Profile File with its Path', 'description': 'config file with its full path', 'Memorized': 'true'}], 'ScanDir': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Scan Directory', 'description': 'Scan Directory'}], 'ScanFile': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Scan File(s)', 'description': 'Scan File(s)'}], 'ScanID': [[tango._tango.CmdArgType.DevLong, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Scan ID', 'description': 'Scan ID'}], 'StepDataSources': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'list of datasources to be switch into step mode', 'description': 'list of datasources to be switched into step mode', 'Display level': tango._tango.DispLevel.EXPERT}], 'UserData': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Client Data', 'description': 'JSON dictionary with User Data', 'Display level': tango._tango.DispLevel.EXPERT}], 'Version': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ], {'label': 'Version', 'description': 'server version'}], 'WriterDevice': [[tango._tango.CmdArgType.DevString, tango._tango.AttrDataFormat.SCALAR, tango._tango.AttrWriteType.READ_WRITE], {'label': 'Writer Device', 'description': 'Writer device device name'}]}
class_property_list = {}

(dict <str, [ str, tango.CmdArgType, [ list <int> ] ] > ) Class Properties

cmd_list = {'AddStepDataSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required datasources'], [tango._tango.CmdArgType.DevVarStringArray, 'list of datasources not found in components']], 'AdministratorDataNames': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'administrator data names']], 'AvailableComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available component names']], 'AvailableDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available DataSource names']], 'AvailableMntGrps': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available mntgrp names']], 'AvailableProfiles': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available selection names']], 'AvailableTimers': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of available timers']], 'ChannelProperties': [[tango._tango.CmdArgType.DevString, 'property type'], [tango._tango.CmdArgType.DevString, 'JSON dictionary with channel properties {channel:property}']], 'ComponentClientSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of component client datasources'], [tango._tango.CmdArgType.DevString, 'JSON with description of component CLIENT Datasources']], 'ComponentDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'profile component datasources']], 'ComponentDescription': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON component description']], 'ComponentSources': [[tango._tango.CmdArgType.DevVarStringArray, 'list of components'], [tango._tango.CmdArgType.DevString, 'JSON with description of component Datasources']], 'CreateDataSources': [[tango._tango.CmdArgType.DevString, 'JSON dictionary with {``dsname``: ``tangosource``, ...}'], [tango._tango.CmdArgType.DevVoid, '']], 'CreateDynamicComponent': [[tango._tango.CmdArgType.DevVarStringArray, 'list of JSON strings with datasource parameters'], [tango._tango.CmdArgType.DevString, 'name of dynamic Component']], 'CreateWriterConfiguration': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required components'], [tango._tango.CmdArgType.DevString, 'XML Settinges']], 'DataSourceDescription': [[tango._tango.CmdArgType.DevVarStringArray, 'list of required datasources'], [tango._tango.CmdArgType.DevVarStringArray, 'list of JSON with description of CLIENT Datasources']], 'DeleteAllProfiles': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'DeleteProfile': [[tango._tango.CmdArgType.DevString, 'mntgrp name'], [tango._tango.CmdArgType.DevVoid, '']], 'ExportEnvProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'FetchProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'FullDeviceNames': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON Dictionary with full device names for  all aliases ']], 'ImportEnvProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ImportMntGrp': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'IsMntGrpUpdated': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevBoolean, 'true if mntgrp changed']], 'LoadProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'MandatoryComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'MntGrpConfiguration': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'mntgrp configuration string']], 'MutedChannels': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'list of muted channels']], 'PoolElementNames': [[tango._tango.CmdArgType.DevString, 'pool list attribute name'], [tango._tango.CmdArgType.DevVarStringArray, 'list of available pool elements']], 'PreselectComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'PreselectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'PreselectedDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'datasources names']], 'RemoveDynamicComponent': [[tango._tango.CmdArgType.DevString, 'name of dynamic Component'], [tango._tango.CmdArgType.DevVoid, '']], 'ResetPreselectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'SaveProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'ScanEnvVariables': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'environment data']], 'SelectedComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'component names']], 'SelectedDataSources': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVarStringArray, 'profile datasources']], 'SetChannelProperties': [[tango._tango.CmdArgType.DevVarStringArray, 'a two element list with a property type and JSON value dictionary {channel:property}'], [tango._tango.CmdArgType.DevVoid, '']], 'SetScanEnvVariables': [[tango._tango.CmdArgType.DevString, 'environment data'], [tango._tango.CmdArgType.DevLong, 'scanID']], 'StoreProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'SwitchProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'UpdateConfigVariables': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevVoid, '']], 'UpdateMntGrp': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'configuration']], 'UpdateProfile': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'mntgrp configuration string']], 'VariableComponents': [[tango._tango.CmdArgType.DevVoid, ''], [tango._tango.CmdArgType.DevString, 'JSON Dictionary with all Components for   configuration variable']]}

(dict <str, [[ tango.CmdArgType, str]] >) Command definitions

device_property_list = {'AdminDataNames': [tango._tango.CmdArgType.DevVarStringArray, 'list of administrator data names', []], 'ClientRecordKeys': [tango._tango.CmdArgType.DevVarStringArray, 'list of record keys for CLIENT datasources', []], 'DefaultCanFailDataSources': [tango._tango.CmdArgType.DevVarStringArray, 'list of default datasources in the CanFail mode', []], 'DefaultMntGrp': [tango._tango.CmdArgType.DevString, 'default measurement group name', ['nxsmntgrp']], 'DefaultNeXusPath': [tango._tango.CmdArgType.DevString, 'default NeXus path', ["/$var.entryname#'scan'$var.serialno:NXentry/NXinstrument/collection"]], 'DefaultNeXusType': [tango._tango.CmdArgType.DevString, 'default dynamic component NeXus data type', ['NX_CHAR']], 'DefaultPreselectedComponents': [tango._tango.CmdArgType.DevVarStringArray, 'list of default preselected components', []], 'DefaultTimeZone': [tango._tango.CmdArgType.DevString, 'default Time Zone', ['Europe/Berlin']], 'DefaultUserDataPath': [tango._tango.CmdArgType.DevString, 'default NeXus User Data path', ["/$var.entryname#'scan'$var.serialno:NXentry/user_data:NXparameters"]], 'MasterTimer': [tango._tango.CmdArgType.DevBoolean, 'set the master timer/monitor channel for older MG', [False]], 'MasterTimerFirst': [tango._tango.CmdArgType.DevBoolean, 'the master timer channel of MG with the index: 0', [True]], 'MergeProfilesToMntGrps': [tango._tango.CmdArgType.DevBoolean, 'merge profiles to available measurement groups', [False]], 'MutedChannelFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of muted channel filters', []], 'MutedPreScanAttrFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of muted attribute channel filters for PreScanSnapshot', []], 'NumberOfThreads': [tango._tango.CmdArgType.DevLong, 'maximal number of threads', [20]], 'PoolBlacklist': [tango._tango.CmdArgType.DevVarStringArray, 'blacklist of pools', []], 'ResetInvalidDoor': [tango._tango.CmdArgType.DevBoolean, 'reset Door when it is invalid', [True]], 'SyncSnapshot': [tango._tango.CmdArgType.DevBoolean, 'preselection merges the current ScanSnapshot', [False]], 'TangoSourceErrorStates': [tango._tango.CmdArgType.DevVarStringArray, 'list of tango error states for tango datasources', ['OFF', 'INIT', 'INSERT', 'CLOSE', 'UNKNOWN', 'FAULT']], 'TangoSourceWarningStates': [tango._tango.CmdArgType.DevVarStringArray, 'list of tango warning states for tango datasources', ['ALARM', 'DISABLE']], 'TimerFilters': [tango._tango.CmdArgType.DevVarStringArray, 'list of timer device name filters', []], 'WritePoolMotorPositions': [tango._tango.CmdArgType.DevBoolean, 'add dynamic components for all pool motor positions', [False]]}

(dict <str, [ str, tango.CmdArgType, [ list <int> ] ] > ) Device Properties

nxsrecconfig.ProfileManager module

ProfileManager

nxsrecconfig.ProfileManager.DEFAULT_RECORD_KEYS = ['serialno', 'end_time', 'start_time', 'point_nb', 'timestamps', 'scan_title', 'filename']

(list <str>) default data names

nxsrecconfig.ProfileManager.NXSTOOLS = True

(bool) flag for nxstools installed

class nxsrecconfig.ProfileManager.ProfileManager(selector, syncsnapshot=False, writepoolmotorpositions=False)[source]

Bases: object

Manages Measurement Group and Profile from Selector

constructor

Parameters:
  • selector (nxsrecconfig.Selector.Selector) – selector object

  • syncsnapshot (bool) – preselection merges current ScanSnapshot

  • writepoolmotorpositions (bool) – add dynamic components for all pool motor positions

availableMntGrps()[source]

available mntgrps

Returns:

list of available measurement groups

Return type:

list <str>

clientRecordKeys

(list <str>) client record keys

componentDataSources()[source]

provides a list of Component DataSources

Returns:

list of component datasources

Return type:

list <str>

components()[source]

provides selected components

Returns:

list of available selected components

Return type:

list <str>

cpdescription(full=False)[source]

provides description of components

Parameters:

full (bool) – if True describes all available ones are taken otherwise selectect, preselected and mandatory

Returns:

description of required components

Return type:

[dict <str, dict <str, list <(str, str, str, str, list <int>)> > > ] or [{“dsname”: str, “strategy”: str, “dstype”: str, “record”: str, “nxstype”: str, “shape”: list <int> , “cpname”: str}, …]

createDataSources(tangods, dsg=None)[source]

adds known and creates unknown datasources

Parameters:
  • tangods (list < [str , str , str ] >) – tango datasources list with elements (name, label, source)

  • dsg (dict <str, bool or None>) – datasource selection dictionary

Returns:

dictionary with of source alias names

Return type:

dict <str , str >

dataSources()[source]

provides selected datasources

Returns:

list of available selected datasources

Return type:

list <str>

defaultPreselectedComponents

(list <str>) default preselectedComponents

deleteProfile(name)[source]

deletes mntgrp

Parameters:

name (str) – mntgrp name

fetchProfile()[source]

fetches the profile configuration

getPoolMotors()[source]

available mntgrps

Returns:

list of available measurement groups

Return type:

list <str>

importMntGrp()[source]

import setting from active measurement

isMntGrpUpdated()[source]

check if active measurement group was changed

Returns:

True if it is different to the current setting

Return type:

bool

masterTimer

(bool ) set master timer/monitor like for older MGs

masterTimerFirst

(bool ) master timer/monitor with the first index

mntGrpConfiguration()[source]

provides configuration of mntgrp

Returns:

string with mntgrp configuration

Return type:

str

mutedPreScanAttrFilters

(list <str>) muted PreScan attribute filters

preselectedComponents()[source]

provides preselected components

Returns:

list of available preselected components

Return type:

list <str>

preselectedDataSources()[source]

provides preselected datasources

Returns:

list of available preselected components

Return type:

list <str>

switchProfile(toActive=True)[source]

switchProfile to active measurement

Parameters:

toActive (bool) – if False update the current profile

timerFilters

(list <str>) timer filters

updateProfile(sync=False, resetDoor=False)[source]

sets active measurement group from components and import setting from active measurement

Parameters:
  • sync (bool) – make profile and mntgrp synchronization

  • sync – reset door device name flag

Returns:

json dictionary with mntgrp configuration information

Return type:

str

nxsrecconfig.Release module

NeXus Sardana Recorder Settings - Release

nxsrecconfig.Selection module

Selection state

class nxsrecconfig.Selection.Selection(*args, **kw)[source]

Bases: dict

Selection Dictionary which contains the following records: { “Timer”: ‘[]’, “OrderedChannels”: ‘[]’, “ComponentSelection”: ‘{}’, “DataSourceSelection”: ‘{}’, “DataSourcePreselection”: ‘{}’, “ComponentPreselection”: ‘{}’, “PreselectingDataSources”: ‘[]’, “OptionalComponents”: ‘[]’, “AppendEntry”: False, “ComponentsFromMntGrp”: False, “ConfigVariables”: ‘{}’, “UserData”: ‘{}’, “ChannelProperties”: ‘{}’, “UnplottedComponents”: ‘[]’, “DynamicComponents”: True, “DefaultDynamicLinks”: True, “DefaultDynamicPath”: ‘/$var.entryname#’scan’$var.serialno:NXentry/NXinstrument/collection’, “TimeZone”: self.__defaultzone, “ConfigDevice”: ‘’, “WriterDevice”: ‘’, “Door”: ‘’, “MntGrp”: ‘’, “Version”: self.__version, “MntGrpConfiguration”: ‘’ }

constructor

Parameters:
  • args (list <any>) – dictionary args

  • kw (dict <str, any>) – dictionary kw

deselect()[source]

deselects components and datasources

reset()[source]

resets dictionary to default value

resetMntGrp()[source]

reset method for mntGrp attribute

Brief:

If MntGrp not defined set it to default value

resetPreselectedComponents(components)[source]

resets Preselected Components with given components and set them to not active :param components: list of components to be set :type components: list <str>

resetTimeZone()[source]

reset method for timeZone attribute

Brief:

If TimeZone not defined set it to default value

updateChannelProperties(devicecontrollers, triggergate)[source]

update method for orderedChannels attribute

Brief:

sets pool channels in order defined by OrderedChannels

Parameters:
  • devicecontrollers (dict <str, str>) – device controller dictionary

  • triggergate (list <str>) – trigger gate list

updateComponentSelection()[source]

update method for componentGroup attribute

Brief:

It removes datasource components from component group

updateDataSourceSelection(channels, datasources)[source]

update method for dataSourceGroup attribute

Brief:

It removes datasources from DataSourceSelection if they are neither in poolchannels nor in avaiblable datasources It adds new channels to DataSourceSelection

Parameters:
  • channels (list <str>) – pool channels

  • datasources (list <str>) – available datasources

updateOrderedChannels(channels)[source]

update method for orderedChannels attribute

Brief:

sets pool channels in order defined by OrderedChannels

Parameters:

channels (list <str>) – pool channels

updatePreselectingDataSources(datasources)[source]

update method for Preselected DataSources

Brief:

appends new datasources to Preselected DataSources

Parameters:

datasources (list <str>) – list of datasources

nxsrecconfig.Selector module

Selection state

class nxsrecconfig.Selector.Selector(macroserverpools, version, defaultpath="/$var.entryname#'scan'$var.serialno:NXentry/NXinstrument/collection", defaulttimezone='Europe/Berlin', defaultmntgrp='nxsmntgrp')[source]

Bases: object

access class to Selection dictionary and Config Device

constructor

Parameters:
  • macroserverpools (nxsrecconfig.MacroServerPools.MacroServerPools) – MacroServerPools object

  • version (str) – selector version

  • defaultpath (str) – default dynamic component path

  • defaultpath – default dynamic component path

  • defaulttimezone (str) – default time zone

  • defaultmntgrp (str) – default measurement group name

configCommand(command, *var)[source]

executes command on configuration server

Parameters:
  • command (str) – command name

  • var ([ any ]) – parameter list

Returns:

command result

Return type:

any

descErrors

(list <str>) error descriptions

deselect()[source]

deselects all seleciton elements

exportEnv(data=None, cmddata=None)[source]

exports Selector Environment Data

Parameters:
  • data (dict <str , any>) – dictionary with input data

  • cmddata (dict <str , any>) – dictionary with command input data

fetchSelection()[source]

fetch configuration

Returns:

if configuration was fetched

Return type:

bool

get()[source]

provides selection data

Returns:

selection data

Return type:

dict <str, any>

getMacroServer()[source]

provides MacroServer name

Returns:

MacroServer name

Return type:

str

getPools()[source]

provides pool proxies

Returns:

list of pool proxies

Return type:

list <tango.DeviceProxy>

getScanEnvVariables()[source]

gets Scan Environment Data

Returns:

JSON String with important variables

Return type:

str

importEnv(names=None, data=None)[source]

imports Selector Environment Data

Parameters:
  • names (list <str>) – names of required variables

  • data (dict <str , any>) – dictionary with resulting data

isDoorValid()[source]

checks if Door valid

Returns:

valid Door device flag

Return type:

bool

keys()[source]

provides all names of variables

Returns:

selection keys

Return type:

list <str>

moduleLabel

(str) module label

poolElementNames(listattr)[source]

provides names from the given pool listattr

Parameters:

listattr (str) – pool attribute with list

Returns:

names from given pool listattr

Return type:

list <str>

preselect()[source]

updates active state of preselected components

Brief:

It provides new group of preselected components

reset()[source]

resets seleciton except Door and ConfigDevice

resetPreselectedComponents(components)[source]

resets preselected components to set of given components

Parameters:

components (list <str>) – new selection preselected components

set(state)[source]

sets selection from state data

Parameters:

state (dict <str, any>) – state data

setConfigInstance()[source]

sets config instances

Returns:

set config instance

Return type:

tango.DeviceProxy or nxsconfigserver.XMLConfigurator.XMLConfigurator

setScanEnvVariables(jdata)[source]

sets Scan Environment Data

Parameters:

jdata (str) – JSON String with important variables

storeSelection()[source]

saves configuration

nxsrecconfig.Settings module

NeXus Sardana Recorder Settings implementation

class nxsrecconfig.Settings.Settings(server=None, numberofthreads=None, defaultnexuspath=None, defaulttimezone=None, defaultmntgrp=None, syncsnapshot=False, writepoolmotorpositions=False, defaultnexustype=None, defaultudatapath=None)[source]

Bases: object

NeXus Sardana Recorder settings

contructor

Parameters:
  • server (nxsrecconfig.NXSConfig.NXSRecSelector) – NXSRecSelector server

  • numberofthreads (str) – number of threads used to check device state

  • defaultnexuspath (str) – default dynamic component path

  • syncsnapshot (bool) – preselection merges current ScanSnapshot

  • writepoolmotorpositions (bool) – add dynamic components for all pool motor positions

  • defaultnexustype (str) – default dynamic component nexus type

  • defaultudatapath (str) – default user data dynamic component path

addStepDataSources(datasources)[source]

describe datasources

Parameters:

datasources (list <str>) – list for datasource names

Returns:

list of datasources not found in components

Return type:

list <str>

adminDataNames

(list <str>) administator data

administratorDataNames()[source]

provides administrator data names

Returns:

list of provides administrator data names

Return type:

list <str>

property appendEntry

(bool) the json data string

availableComponents()[source]

available components

Returns:

list of available components

Return type:

list <str>

availableDataSources()[source]

available datasources

Returns:

list of available datasources

Return type:

list <str>

availableMntGrps()[source]

available mntgrps

Returns:

list of available measurement groups

Return type:

list <str>

availableProfiles()[source]

available selections

Returns:

list of available selections

Return type:

list <str>

availableTimers()[source]

provides available Timers from MacroServer pools

Returns:

available Timers from MacroServer pools

Return type:

list <str>

property canfaildatasources

(str) the json data string

channelProperties(ptype)[source]

provides channel properties of the given type

Parameters:

ptype (str) – property type

Returns:

json dictionary with channel properties

Return type:

str

property clientRecordKeys

(list <str>) client record keys

componentClientSources(cps)[source]

provides description of client datasources

Parameters:

cps (list <str>) – component names

Returns:

JSON string with description of client datasources

Return type:

str

componentDataSources()[source]

provides a list of profile component DataSources

Returns:

list of profile component datasources

Return type:

list <str>

componentDescription()[source]

provides description of all components

Returns:

JSON string with description of all components

Return type:

str

componentSources(cps)[source]

provides description of datasources

Parameters:

cps (list <str>) – component names

Returns:

JSON string with description of client datasources

Return type:

str

property components

(list <str>) provides selected components

property configDevice

(str) the json data string

property configVariables

(str) the json variables string

createDataSources(datasources)[source]

describe datasources

Parameters:

datasources (str) – JSON dictionary with {dsname: tangosource, …}

createDynamicComponent(params)[source]

creates dynamic component

Parameters:

params (list <str>) – datasource parameters

Returns:

dynamic component name

Return type:

str

createWriterConfiguration(cps)[source]

create configuration and clean stepdatasources and linkdatasources

Parameters:

cps (list <str>) – component names

Returns:

JSON string with description of client datasources

Return type:

str

dataSourceDescription(datasources)[source]

describe datasources

Parameters:

datasources (list <str>) – list for datasource names

Returns:

list of dictionary with description of datasources

Return type:

[{“dsname”: str, “dstype”: str, “record”: str}, …]

property dataSources

(list <str>) provides all selected data sources

defaultCanFailDataSources

(list <str>) default CanFail DataSources

defaultMntGrp

(str) default measurement group

defaultNeXusPath

(str) default NeXus path

defaultNeXusType

(str) default NeXus type

property defaultPreselectedComponents

(list <str>) default PreselectedComponents

defaultTimeZone

(str) default time zone

defaultUserDataPath

(str) default NeXus path

deleteAllProfiles()[source]

clear all selections

deleteProfile(name)[source]

deletes mntgrp

Parameters:

name (str) – mntgrp name

property descriptionErrors

(list <str>) provides preselected components

property deviceGroups

(str) the json data string

property door

(str) the json data string

exportEnvProfile()[source]

exports all Enviroutment Data

fetchProfile()[source]

fetch configuration

fullDeviceNames()[source]

provides full names of pool devices

Returns:

JSON string with full names of pool devices

Return type:

str

importEnvProfile()[source]

imports all Enviroutment Data

importMntGrp()[source]

import setting from active measurement

isMntGrpUpdated()[source]

check if active measurement group was changed

Returns:

True if it is different to the current setting

Return type:

bool

property linkdatasources

(str) the json data string

loadProfile()[source]

loads configuration

property macroServer

(str) the json data string

mandatoryComponents()[source]

mandatory components

Returns:

list of mandatory components

Return type:

list <str>

property masterTimer

(bool) set master channels

property masterTimerFirst

(bool) master channels with the 0 index

mergeProfilesToMntGrps

(bool) merge profiles to available measurement groups

property mntGrp

(str) the json data string

mntGrpConfiguration()[source]

provides configuration of mntgrp

Returns:

string with mntgrp configuration

Return type:

str

mutedChannelFilters

(list <str>) muted channel filters

mutedChannels()[source]

provides muted channels from pool

Returns:

muted channels from pool

Return type:

list <str>

property mutedPreScanAttrFilters

(list <str>) muted prescan attribute filters

names()[source]

provides names of variables

Returns:

all names of variables

Rtypes:

list <str>

numberOfThreads

(int) number of threads

property poolBlacklist

(list <str>) black list of pools

poolElementNames(listattr)[source]

provides names from given pool listattr

Parameters:

listattr (str) – name of pool attribute with a element list

Returns:

names from given pool listattr

Return type:

list <str>

preselectComponents()[source]

checks existing controllers of pools

preselectedComponents()[source]

provides preselected components

Returns:

list of available preselected components

Return type:

list <str>

preselectedDataSources()[source]

provides preselected datasources

Returns:

list of available preselected datasources

Return type:

list <str>

property profileConfiguration

(str) the json data string

profileFile

(str) configuration file

removeDynamicComponent(name)[source]

removes dynamic component

Parameters:

name (str) – dynamic component name

resetInvalidDoor

(bool) reset Door when it is invalid

resetPreselectedComponents()[source]

reset preselected Components to defaultPreselectedComponents

saveProfile()[source]

saves configuration

property scanDir

the json data string

scanEnvVariables()[source]

gets Scan Environment Data

Returns:

JSON String with important variables

Return type:

str

property scanFile

(str) the json data string

property scanID

(int) the json data string

selectedComponents()[source]

provides user selected components

Returns:

list of available selected components

Return type:

list <str>

selectedDataSources()[source]

provides selected datasources

Returns:

list of available selected datasources

setChannelProperties(typeandvariables)[source]

sets channel properties of the given type

Parameters:

typeandvariables ((str, str)) – (property type, json dictionary of channel propertie values)

setScanEnvVariables(jdata)[source]

sets Scan Environment Data

Parameters:

jdata (str) – JSON String with important variables

property stepdatasources

(str) the json data string

storeProfile()[source]

saves configuration

switchProfile(toActive=True)[source]

switch to active measurement

Parameters:

toActive (bool) – if False update the current profile

syncSnapshot

(bool) preselection merges current ScanSnapshot

property tangoSourceErrorStates

(list <str>) tango source fault state

property tangoSourceWarningStates

(list <str>) tango source alarm state

property timerFilters

(list <str>) timer filters

updateConfigVariables()[source]

sends ConfigVariables into ConfigServer and updates serialno if appendEntry selected

updateMntGrp()[source]

set active measurement group from components

Returns:

string with mntgrp configuration

Return type:

str

updateProfile()[source]

update profile and measurement group

Returns:

string with mntgrp configuration

Return type:

str

property userData

(str) the json data string

value(name)[source]

provides values of the required variable

Parameters:

name (str) – name of the required variable

Returns:

values of the required variable

Return type:

any

variableComponents()[source]

provides components for all variables

Returns:

json dictionary with components for all variables

Return type:

str

property version

(str) server version

writepoolmotorpositions

(bool) add dynamic components for all pool motor positions

property writerDevice

(str) the json data string

nxsrecconfig.StreamSet module

labels to Tango Streams

class nxsrecconfig.StreamSet.StreamSet(streams)[source]

Bases: object

streamset constractor

Parameters:

streams (StreamSet or tango.LatestDeviceImpl) – tango-like steamset class

debug(message, std=None)[source]

writes debug message

Parameters:
  • message (str) – debug message

  • std (bool) – True if it writes to sys stream when log stream does not exist

error(message, std=None)[source]

writes error message

Parameters:
  • message (str) – error message

  • std (bool) – True if it writes to sys stream when log stream does not exist

fatal(message, std=None)[source]

writes fatal error message

Parameters:
  • message (str) – error message

  • std (bool) – True if it writes to sys stream when log stream does not exist

info(message, std=None)[source]

writes info message

Parameters:
  • message (str) – info message

  • std (bool) – True if it writes to sys stream when log stream does not exist

log_debug

(tango.log4tango.TangoStream) Tango debug log stream

log_error

(tango.log4tango.TangoStream) Tango error log stream

log_fatal

(tango.log4tango.TangoStream) Tango fatal log stream

log_info

(tango.log4tango.TangoStream) Tango info log stream

log_warn

(tango.log4tango.TangoStream) Tango warn log stream

warn(message, std=None)[source]

writes warning message

Parameters:
  • message (str) – warning message

  • std (bool) – True if it writes to sys stream when log stream does not exist

nxsrecconfig.Utils module

Tango Utilities

class nxsrecconfig.Utils.MSUtils[source]

Bases: object

MacroServer Utilities

classmethod getEnv(var, ms)[source]

provides environment variable value

Parameters:
  • var (str) – variable name

  • ms (str) – macroserver

Returns:

environment variable value

Return type:

any

classmethod getMacroServer(db, door, find=True)[source]

provides macro server of given door

Parameters:
  • db (tango.Database) – tango database

  • door (str) – given door

  • find (bool) – find new macroserver if door does not exist

Returns:

first MacroServer of the given door

Return type:

str

classmethod setEnv(var, value, ms)[source]

sets environment variable value

Parameters:
  • var (str) – variable name

  • value (any) – variable value

  • ms (str) – macroserver

classmethod setEnvs(varvalues, ms)[source]

sets environment variable value

Parameters:
  • varvalues (dict <str , any>) – variable value dictionary

  • ms (str) – macroserver

classmethod usetEnv(var, ms)[source]

unsets environment variable

Parameters:
  • var (str) – variable name

  • ms (str) – macroserver

classmethod writeEnvAttr(value, dp)[source]

sets environment variable value

Parameters:
  • value (dict <str , any> or any) – variable value dictionary

  • dp (str) – macroserver

exception nxsrecconfig.Utils.OldTangoError[source]

Bases: Exception

Old Tango version Exception class

nxsrecconfig.Utils.PYTG_BUG_213 = False

(bool) tango bug #213 flag related to EncodedAttributes in python3

class nxsrecconfig.Utils.PoolUtils[source]

Bases: object

Pool Utilities

classmethod filterNames(pools, filters=None, lst=None)[source]

provides channels of given pools

Parameters:
Returns:

list of channel names

Return type:

list <str>

classmethod filterOutTango(lst, filters=None)[source]

provides channels of given pools

Parameters:
  • lst (list <str or (str, str)>) – list of strings to filter out

  • filters (list <str>) – device name filter list

Returns:

list of channel names

Return type:

list <str>

classmethod getAliases(pools, names=None)[source]

find aliases from fullnames

Parameters:
Returns:

full device name

Return type:

dict <str, str>

classmethod getChannelSources(pools, devices)[source]

provides channel sources

Parameters:
Returns:

device sources

Return type:

dict <str, str>

classmethod getDeviceControllers(pools, devices=None)[source]

provides device controller full names

Parameters:
Returns:

device controller full names

Return type:

dict <str, str>

classmethod getElementNames(pools, listattr, typefilter=None)[source]

provides experimental Channels

Parameters:
  • pools (list <tango.DeviceProxy>) – list of pool devices

  • listattr (str) – pool attribute with list

  • typefilter (list <str>) – pool attribute with list

Returns:

names from given pool listattr

Return type:

list <str>

classmethod getFullDeviceNames(pools, names=None)[source]

find device names from aliases

Parameters:
Returns:

full device name

Return type:

dict <str, str>

classmethod getMntGrpName(pools, alias)[source]

find measurement group name from alias

Parameters:
Returns:

full name of the measurement group alias

Return type:

str

classmethod getMotorPositionAttributes(pools)[source]

find motor names

Parameters:

pools (list <tango.DeviceProxy>) – list of pool devices

Returns:

full name of the measurement group alias

Return type:

str

Returns:

(name , name , motor position attribute)

Return type:

list <str,:obj:str, str>

classmethod getSource(name)[source]

provides datasource from pool device

Parameters:

name (str) – pool device name

Returns:

source of pool device

Return type:

str

classmethod getTimers(pools, filters=None)[source]

provides tiemrs of given pools

Parameters:
Returns:

list of timer names

Return type:

list <str>

class nxsrecconfig.Utils.TangoUtils[source]

Bases: object

Tango Utilities

classmethod command(server, command, *var)[source]

executes command on server on python package

Parameters:
Returns:

command result

Return type:

any

classmethod getDeviceName(db, cname)[source]

finds device of give class

Parameters:
Returns:

device name if exists

Return type:

bool

classmethod getFullAttrName(source, fqdn=False)[source]

provides tango device full name with host and port

Parameters:
  • source (str) – string with device name and its attribute

  • fqdn (bool) – if true adds fqdn host name

Returns:

database host and port in url string

Return type:

str

classmethod getProxies(names)[source]

provides proxies of given device names

Parameters:

names (list <str>) – given device names

Returns:

list of device DeviceProxies

Return type:

list <tango.DeviceProxy>

classmethod getShapeTypeUnit(source)[source]

retrives shape type units for attribure

Parameters:

source (str) – string with device name and its attribute

Returns:

(shape, data_type, units)

Return type:

(list <int>, str, str)

classmethod openProxy(device, counter=1000)[source]

opens device proxy of the given device

Parameters:

device (str) – device name

Returns:

DeviceProxy of device

Return type:

tango.DeviceProxy

tTnp = {tango._tango.CmdArgType.DevBoolean: 'bool', tango._tango.CmdArgType.DevShort: 'int16', tango._tango.CmdArgType.DevLong: 'int32', tango._tango.CmdArgType.DevFloat: 'float32', tango._tango.CmdArgType.DevDouble: 'float64', tango._tango.CmdArgType.DevUShort: 'uint16', tango._tango.CmdArgType.DevULong: 'uint32', tango._tango.CmdArgType.DevString: 'string', tango._tango.CmdArgType.DevUChar: 'uint8', tango._tango.CmdArgType.DevLong64: 'int64', tango._tango.CmdArgType.DevULong64: 'uint64', tango._tango.CmdArgType.DevEncoded: 'encoded'}

(dict <tango.CmdArgType, str>) map of Tango:Numpy types

classmethod wait(proxy, counter=100, state='RUNNING')[source]

waits for device proxy not running

Parameters:

proxy (tango.DeviceProxy) – device proxy

Returns:

if proxy device ready

Return type:

str

class nxsrecconfig.Utils.Utils[source]

Bases: object

Miscellaneous Utilities

classmethod compareDict(dct, dct2)[source]

copares two dictionaries

Parameters:
  • dct (dict) – first dictinary

  • dct2 (dict) – second dictinary

Returns:

if dictionaries are the same

Return type:

bool

classmethod getRecord(node)[source]

provides datasource record from xml dom node

Parameters:

node (lxml.etree.Element) – xml DOM node

Returns:

datasource record

Return type:

str

classmethod getText(node)[source]

collects text from text child nodes

Parameters:

node (xml.etree.ElementTree.Element) – parent node

classmethod pickleloads(bytestr)[source]

loads pickle byte string :param bytestr: byte string to convert :type bytesstr: bytes :returns: loaded bytestring :rtype: any

classmethod stringToDictJson(string, toBool=False)[source]

converts string to json dictionary

Parameters:
  • string (str) – string with list of item or json dictionary

  • toBool (bool) – if true convert dictionary values to bool

Returns:

json dictionary

Return type:

str

classmethod stringToListJson(string)[source]

converts string to json list

Parameters:

string (str) – with list of item or json list

Returns:

json list

Return type:

str

classmethod toString(obj)[source]

converts list/dict/object of unicode/string to string object

Parameters:

obj (any) – given unicode/string object

Returns:

string object

Return type:

str

classmethod tostr(text)[source]

convert bytestr or unicode to python str :param text: text to convert :type text: bytes or unicode or str :returns: converted text :rtype: str

Module contents

NeXus Sardana Recorder Settings - Tango Server

nxsrecconfig.run(argv)[source]

runs the TANGO server

Parameters:

argv (list <str>) – command-line arguments