sardanadefs
¶
This module contains the most generic sardana constants and enumerations
Constants
-
EpsilonError
= 1e-16¶ maximum difference between two floats so that they are considered equal
-
InvalidId
= 0¶ A constant representing an invalid ID
-
InvalidAxis
= 0¶ A constant representing an invalid axis
-
TYPE_ELEMENTS
= {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}¶ a set containning all “controllable” element types. Constant values belong to
ElementType
-
TYPE_GROUP_ELEMENTS
= {13, 14}¶ a set containing all group element types. Constant values belong to
ElementType
-
TYPE_MOVEABLE_ELEMENTS
= {2, 10, 13}¶ a set containing the type of elements which are moveable. Constant values belong to
ElementType
-
TYPE_PHYSICAL_ELEMENTS
= {2, 3, 4, 5, 6, 7, 8, 9}¶ a set containing the possible types of physical elements. Constant values belong to
ElementType
-
TYPE_ACQUIRABLE_ELEMENTS
= {2, 3, 4, 5, 6, 7, 8, 10, 11}¶ a set containing the possible types of acquirable elements. Constant values belong to
ElementType
-
TYPE_PSEUDO_ELEMENTS
= {10, 11}¶ a set containing the possible types of pseudo elements. Constant values belong to
ElementType
-
SardanaServer
= SardanaServer()¶ the global object containing the SardanaServer information
Enumerations
-
ServerRunMode
= Enumeration('ServerRunMode', ['SynchPure', 'SynchThread', 'SynchProcess', 'AsynchThread', 'AsynchProcess'])¶ The sardana server run mode:
SynchPure : Pure synchronous: Start the server and run the server loop until it stops
SynchThread : separate thread synchronous: start a thread running the server loop. Block until the server loop ends
SynchProcess : separate process synchronous: start a sub-process running the server loop. Block until the server loop ends
AsynchThread : separate thread asynchronous: start a thread running the server loop. Return immediately
ASynchProcess : separate process asynchronous: start a sub-process running the server loop. Return immediately
-
State
= Enumeration('State', ['On', 'Off', 'Close', 'Open', 'Insert', 'Extract', 'Moving', 'Standby', 'Fault', 'Init', 'Running', 'Alarm', 'Disable', 'Unknown', 'Invalid'])¶ sardana element state enumeration
-
DataType
= Enumeration('DataType', ['Integer', 'Double', 'String', 'Boolean', 'Encoded', 'Invalid'])¶ sardana data types (used by device pool controllers)
-
DataFormat
= Enumeration('DataFormat', ['Scalar', 'OneD', 'TwoD', 'Invalid'])¶ sardana data format enumeration (used by device pool controllers)
-
DataAccess
= Enumeration('DataAccess', ['ReadOnly', 'ReadWrite', 'Invalid'])¶ sardana data access (used by device pool controllers)
-
ElementType
= Enumeration('ElementType', ['Pool', 'Controller', 'Motor', 'CTExpChannel', 'ZeroDExpChannel', 'OneDExpChannel', 'TwoDExpChannel', 'ComChannel', 'IORegister', 'TriggerGate', 'PseudoMotor', 'PseudoCounter', 'Constraint', 'MotorGroup', 'MeasurementGroup', 'Instrument', 'ControllerClass', 'ControllerLibrary', 'RecorderClass', 'RecorderLibrary', 'MacroServer', 'Door', 'MacroClass', 'MacroLibrary', 'MacroFunction', 'External', 'Meta', 'ParameterType', 'Unknown'])¶ An enumeration describing the all possible element types in sardana
-
Interface
= Enumeration('Interface', ['Object', 'Function', 'MacroServerObject', 'MacroCode', 'MacroFunction', 'PoolObject', 'Element', 'PoolElement', 'Acquirable', 'ExpChannel', 'Countable', 'OneDExpChannel', 'Moveable', 'Pool', 'Class', 'MacroClass', 'Macro', 'PseudoCounter', 'IORegister', 'Library', 'Instrument', 'Constraint', 'MeasurementGroup', 'ZeroDExpChannel', 'CTExpChannel', 'ControllerClass', 'MacroServerElement', 'MacroServer', 'Motor', 'ControllerLibrary', 'MacroLibrary', 'Meta', 'MotorGroup', 'External', 'Controller', 'TriggerGate', 'PseudoMotor', 'TwoDExpChannel', 'Door', 'ParameterType', 'ComChannel'])¶ An enumeration describing the all possible sardana interfaces
-
Interfaces
= {1: {}, 3: {1}, 5: {1}, 13: {5}, 31: {3, 13}, 33: {1}, 65: {1}, 225: {33, 65}, 481: {225}, 993: {481}, 1249: {225}, 4065: {993, 1249}, 4321: {225}, 8417: {225}, 16385: {1}, 49165: {13, 16385}, 114719: {31, 49165}, 132065: {993}, 262625: {481}, 524289: {1}, 1048801: {225}, 2097185: {33}, 4195553: {225, 1249}, 8389601: {993}, 16779233: {993, 1249}, 33570849: {33, 16385}, 67108933: {5, 65}, 201326661: {67108933}, 268440033: {481, 4321}, 537395233: {33, 524289}, 1074266117: {5, 524289}, 2147483648: {}, 4294967521: {225}, 8589934593: {1}, 17179869409: {225}, 34359738593: {225}, 68719481313: {481, 4321}, 137438955489: {993, 1249}, 274945015877: {67108933}, 551903297536: {2147483648}, 1099511628001: {225}}¶ a dictionary containing the direct interfaces supported by each type (
dict
<sardana.sardanadefs.Interface
,set
<sardana.sardanadefs.Interface
> >)
-
InterfacesExpanded
= {1: {1}, 3: {1, 3}, 5: {1, 5}, 13: {1, 5, 13}, 31: {1, 3, 5, 13, 31}, 33: {1, 33}, 65: {1, 65}, 225: {1, 33, 65, 225}, 481: {1, 33, 65, 225, 481}, 993: {1, 33, 65, 225, 481, 993}, 1249: {1, 33, 65, 225, 1249}, 4065: {1, 33, 65, 225, 481, 993, 1249, 4065}, 4321: {1, 33, 65, 225, 4321}, 8417: {1, 33, 65, 225, 8417}, 16385: {1, 16385}, 49165: {1, 5, 13, 16385, 49165}, 114719: {1, 3, 5, 13, 31, 16385, 49165, 114719}, 132065: {1, 33, 65, 225, 481, 993, 132065}, 262625: {1, 33, 65, 225, 481, 262625}, 524289: {1, 524289}, 1048801: {1, 33, 65, 225, 1048801}, 2097185: {1, 33, 2097185}, 4195553: {1, 33, 65, 225, 1249, 4195553}, 8389601: {1, 33, 65, 225, 481, 993, 8389601}, 16779233: {1, 33, 65, 225, 481, 993, 1249, 16779233}, 33570849: {1, 33, 16385, 33570849}, 67108933: {1, 5, 65, 67108933}, 201326661: {1, 5, 65, 67108933, 201326661}, 268440033: {1, 33, 65, 225, 481, 4321, 268440033}, 537395233: {1, 33, 524289, 537395233}, 1074266117: {1, 5, 524289, 1074266117}, 2147483648: {2147483648}, 4294967521: {1, 33, 65, 225, 4294967521}, 8589934593: {1, 8589934593}, 17179869409: {1, 33, 65, 225, 17179869409}, 34359738593: {1, 33, 65, 225, 34359738593}, 68719481313: {1, 33, 65, 225, 481, 4321, 68719481313}, 137438955489: {1, 33, 65, 225, 481, 993, 1249, 137438955489}, 274945015877: {1, 5, 65, 67108933, 274945015877}, 551903297536: {2147483648, 551903297536}, 1099511628001: {1, 33, 65, 225, 1099511628001}}¶ a dictionary containing the all interfaces supported by each type. (
dict
<sardana.sardanadefs.Interface
,set
<sardana.sardanadefs.Interface
> >)
Functions
-
from_dtype_str
(dtype)[source]¶ Transforms the given dtype parameter (string/
DataType
or None) into a tuple of two elements (str,DataFormat
) where the first element is a string with a simplified data type.- Parameters
dtype (
str
or None orDataType
) – the data type to be transformed- Returns
a tuple <str,
DataFormat
> for the given dtype- Return type
tuple<str,
DataFormat
>
-
from_access_str
(access)[source]¶ Transforms the given access parameter (string or
DataAccess
) into a simplified data access string.
-
to_dtype_dformat
(data)[source]¶ Transforms the given data parameter (string/ or sequence of string or sequence of sequence of string/
DataType
) into a tuple of two elements (DataType
,DataFormat
).- Parameters
data (
str
or seq<str> or seq<seq<str>>) – the data information to be transformed- Returns
a tuple <
DataType
,DataFormat
> for the given data- Return type
tuple<
DataType
,DataFormat
>
-
to_daccess
(daccess)[source]¶ Transforms the given access parameter (string or None) into a
DataAccess
. If None is given returnsDataAccess.ReadWrite
- Parameters
dtype (
str
) – the access to be transformed- Returns
a
DataAccess
for the given access- Return type