This is historical information of device classes implemented in NXSConfigServer device server.

Use this link to find the valid information.

Development status: Released
Information status: New

Contact:



Class Description


# Configuration Server based on MySQL database

Families: Acquisition

Key words: NeXDaTaS

Language: Python

License:

Contact:

Class interface


Attributes:

Name Description
XMLStringScalar: DevString
SelectionScalar: DevString
JSONSettingsScalar: DevString
VersionScalar: DevString
VariablesScalar: DevString
STEPDataSourcesSpectrum: DevString

Commands:

Name Description
StateInput: DevVoid
Output: State
This command gets the device state (stored in its device_state data member) and returns it to the caller.
StatusInput: DevVoid
Output: DevString
This command gets the device status (stored in its device_status data member) and returns it to the caller.
OpenInput: DevVoid
Output: DevVoid
Opens connection to the database
CloseInput: DevVoid
Output: DevVoid
Closes connection into the database
ComponentsInput: DevVarStringArray
Output: DevVarStringArray
Returns a list of required components
SelectionsInput: DevVarStringArray
Output: DevVarStringArray
Returns a list of required selections
InstantiatedComponentsInput: DevVarStringArray
Output: DevVarStringArray
Returns a list of required components
DataSourcesInput: DevVarStringArray
Output: DevVarStringArray
Return a list of required DataSources
AvailableComponentsInput: DevVoid
Output: DevVarStringArray
Returns a list of available component names
AvailableSelectionsInput: DevVoid
Output: DevVarStringArray
Returns a list of available selection names
AvailableDataSourcesInput: DevVoid
Output: DevVarStringArray
Returns a list of available DataSource names
StoreSelectionInput: DevString
Output: DevVoid
Stores the selection from XMLString
StoreComponentInput: DevString
Output: DevVoid
Stores the component from XMLString
StoreDataSourceInput: DevString
Output: DevVoid
Stores the DataSource from XMLString
CreateConfigurationInput: DevVarStringArray
Output: DevVoid
Creates the NDTS configuration script from the given components. The result is strored in XMLString
DeleteComponentInput: DevString
Output: DevVoid
Deletes the given component
DeleteSelectionInput: DevString
Output: DevVoid
Deletes the given selection
DeleteDataSourceInput: DevString
Output: DevVoid
Deletes the given datasource
SetMandatoryComponentsInput: DevVarStringArray
Output: DevVoid
Sets the mandatory components
MandatoryComponentsInput: DevVoid
Output: DevVarStringArray
Sets the mandatory components
UnsetMandatoryComponentsInput: DevVarStringArray
Output: DevVoid
It removes the given components from the mandatory components
ComponentDataSourcesInput: DevString
Output: DevVarStringArray
returns a list of datasource names for a given component
ComponentsDataSourcesInput: DevVarStringArray
Output: DevVarStringArray
returns a list of datasource names for a given components
ComponentsVariablesInput: DevVarStringArray
Output: DevVarStringArray
returns a list of variable names for a given components
ComponentVariablesInput: DevString
Output: DevVarStringArray
returns a list of variable names for a given component
MergeInput: DevVarStringArray
Output: DevString
Merges give components
DependentComponentsInput: DevVarStringArray
Output: DevVarStringArray
returns a list of dependent component names for a given components

Pipes:

Properties:

Name Description
VersionLabelDevString version label

README

b'============================\nNeXuS Configuration Server\n============================\n\nAuthors: Jan Kotanski, Eugen Wintersberger, Halil Pasic\nIntroduction\n\nNeXuS Configuration Server is a Tango Server with its implementation based \non a MySQL database. It allows to store XML configuration datasources \nand components. It also gives possibility to select mandatory components \nand perform the process of component merging.\n\n\n============================\nInstallation from sources\n============================\n\nInstall the dependencies:\n\n MySQLdb, PyTango \n\nDownload the latest version of NeXuS Configuration Server from\n\n NeXuS Configuration Server \n\nand extract the sources.\n\nOne can also download the lastest version directly from the git repository by\n\ngit clone https://github.com/jkotan/nexdatas.configserver/\n\nNext, run the installation script\n\n$ python setup.py install\n\n============================\nDescription\n============================\n\nConfiguration Server is dedicated to store NXDL-like configuration needed for \nTango Data Writer runs. The server uses as a storage system a MYSQL database. \nTo create required DB tables one can use ndts.sql script from the repository.\n\nIn Configuration Server the configuration is memorized in separate elements: \ndatasources or components. \n\nDataSources describe access to input data, i.e to specific hardware \nTANGO devices or other databases as well to client data. \n\nComponents specify Nexus tree with positions of datasets for particular \npieces of hardware and writing strategy for corresponding to them data. \n\n + They can include datasources directly as well as links to datasources \n defined in the server. To this end template syntax of \n $datasources.<ds_name> type is used.\n + Moreover, they can holds links to other components which describe their \n dependences. In this case $components.<comp_name> syntax is used.\n + Finally, the components can contains variables. The variables are defined \n in XML code by $var.<var_name> syntax and can be provided to \n the Configuration Server by passing a JSON string. \n The default value for variables is an empty string. \n\nAll elements of configuration can be created by GUI tool - ComponentDesigner. \nThe tool can connect to Configuration Server and fetch or store \nthe separate elements of the XML configuration.\n\nDuring creation of the final configuration Configuration Server merges \nall required and dependent components, connected to them datasources and\nprovided values of the variables. As a result it returns a single XML string. \nThis XML string can be pass directly into the dedicated Tango Data Writer \nattribute. \n\n\n\n============================\nClient code\n============================\n\n# In this section we present an example how to communicate with \n# Configuration Server making use of PyTango.\n\nimport PyTango\n\ncnfServer = PyTango.DeviceProxy("p00/xmlconfigserver/exp.01")\n\ncnfServer.JSONSettings = \\n \'{"host":"localhost","db":"ndts_p02","read_default_file":"/etc/my.cnf","use_unicode":true}\'\n\n# opens DB connection\ncnfServer.Open()\n\n# After creating the server proxy we can set configuration for connection to \n# the MYSQL DB. \n# The JSONSettings attribute is memorized so you have to write it only when you \n# change configuration of DB connection. Next, we open connection to \n# DB specified by our JSONSettings.\n\n\n\n# stores default component\ncpxml = open("default.xml", \'r\').read()\ncnfServer.XMLString = cpxml\ncnfServer.StoreComponent(\'default\')\n\n# stores slit1 component in DB\ncpxml = open("slit1.xml", \'r\').read()\ncnfServer.XMLString = cpxml\ncnfServer.StoreComponent(\'slit1\')\n\n# stores slit2 component in DB\ncpxml = open("slit2.xml", \'r\').read()\ncnfServer.XMLString = cpxml\ncnfServer.StoreComponent(\'slit2\')\n\n# stores slit3 component in DB\ncpxml = open("slit3.xml", \'r\').read()\ncnfServer.XMLString = cpxml\ncnfServer.StoreComponent(\'slit3\')\n\n# stores pilatus300k component in DB\ncpxml = open("pilatus.xml", \'r\').read()\ncnfServer.XMLString = cpxml\ncnfServer.StoreComponent(\'pilatus300k\')\n\n\n# stores motor01 datasource in DB\ndsxml = open("motor.ds.xml", \'r\').read()\ncnfServer.XMLString = dsxml\ncnfServer.StoreDataSource(\'motor01\')\n\n# stores motor02 datasource in DB\ndsxml = open("motor.ds.xml", \'r\').read()\ncnfServer.XMLString = dsxml\ncnfServer.StoreDataSource(\'motor02\')\n\n\n\n# removes slit3 component from DB\ncnfServer.DeleteComponent(\'slit3\')\n\n# removes motor02 datasource from DB\ncnfServer.DeleteDataSource(\'motor02\')\n\n# If someone cannot use ComponentDesigner it is also an option to store \n# or delete components and datasources using directly tango interface \n# as it is shown above.\n\n\n\n# provides names of available components\ncmpNameList = cnfServer.AvailableComponents()\n# provides names of available datasources\ndsNameList = cnfServer.AvailableDataSources()\n\n# To get information about names of available components and datasources \n# in Configuration Server we use the above commands.\n\n\n\n# provides a list of required components\ncmpList = cnfServer.Components(cmpNameList)\n# provides a list of required Datasources\ndsList = cnfServer.DataSources(dsNameList)\n\n# Having names of stored elements we can get their XML code.\n\n# provides a list of Datasources from a given Component\ndsList = cnf.Server.ComponentDataSources(\'pilatus300k\')\ndsList = cnf.Server.ComponentsDataSources([\'pilatus300k\', \'slit1\'])\n\n# as well as query Configuration Server which datasource \n# are related to the particular component.\n\n# provides a dependent components\ncpList = cnf.Server.DependentComponents([\'pilatus300k\', \'slit3\'])\n\n\n# Moreover, one can also query Configuration Server for a list of \n# dependent components\n\n# provides a list of Variables from a given components\nvarList = cnf.Server.ComponentVariables(\'pilatus300k\')\nvarList = cnf.Server.ComponentsVariables([\'pilatus300k\', \'slit3\'])\n\n#or ask for a list of variables which are related to the particular components.\n\n# sets values of variables\ncnf.Server.Variables = \'{"entry_id":"123","beamtime_id":"123453535453"}\'\n\n#The variable values can be passed to the Configuration Server \n# via a JSON string. \n\n\n\n# sets given component as mandatory for the final configuration\ncnfServer.SetMandatoryComponents([\'default\',\'slit1\'])\n# un-sets given component as mandatory for the final configuration\ncnfServer.UnsetMandatoryComponents([\'slit1\'])\n\n# provides names of mandatory components\nman = cnfServer.MandatoryComponents()\n\n# Some of the component can be set as mandatory in \n# the final configuration. To define them Configuration Server provides \n# above commands.\n\n\n\n# provides the current configuration version\nversion = cnfServer.Version\n\n# Each configuration has a revision number. It can be found \n# together with Configuration Server version in Version attribute.\n\n# creates the final configuration from slit2 and pilatus300k \n# as well as all mandatory components\ncnfServer.CreateConfiguration(\'slit2\', \'pilatus300k\')\n# XML string ready to use by Tango Data Server\nfinalXML = cnfServer.XMLString \n\n# In order to create our final configuration we execute CreateConfiguration \n# command with a list of names of required components. The command merges \n# these components with mandatory ones and provides the resulting NXDL-like \n# configuration in the XMLString attribute.\n\n\n\n\n# merges given components\nmergedComp = cnfServer.Merge([\'slit2\', \'pilatus300k\'])\n\n# Similarly, the Merge command provides configuration by unresolved links \n# to datasoures and with non-assigned variable values. \n\n\n# closes connection to DB\ncnfServer.close()\n\n# Command close terminates our connection to the DB server. '

22 Feb 2018, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



22 Feb 2018, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



20 Apr 2017, Piotr Goryl
Updated:
The device class has been updated.
You are looking at this version now.



23 Feb 2017, Piotr Goryl
Created:
The device class has been added to catalogue.
Added by:pgoryl2 on:20 Apr 2017, 1:04 p.m.