malcolm.modules.ca.parts
- class malcolm.modules.ca.parts.CAActionPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', status_pv: Anno(name='AStatusPv', typ=<class 'str'>, description='Status pv to see if successful') = '', good_status: Anno(name='AGoodStatus', typ=<class 'str'>, description='Good value for status pv') = '', status_timeout: Anno(name='AStatusTimeout', typ=<class 'int'>, description='How long to wait for status_pv == good_status before returning') = 1, message_pv: Anno(name='AMessagePv', typ=<class 'str'>, description='PV containing error message if unsuccessful') = '', value: Anno(name='AValue', typ=<class 'int'>, description='Value to write to pv when method called') = 1, wait: Anno(name='AWait', typ=<class 'bool'>, description='Wait for caput callback?') = True, throw: Anno(name='AThrow', typ=<class 'bool'>, description='throw error if PV not found') = True)[source]
Group a number of PVs together that represent a method like acquire()
Commonly a group of pvs are used to represent a method call like this:
caput(pv, wait=True) assert caget(status_pv) == good_status, ( "Action failed with message: %s" % caget(message_pv) )
This
Part
wraps up this design pattern as a MalcolmMethod
- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
status_pv (str) – Status pv to see if successful
good_status (str) – Good value for status pv
status_timeout (int) – How long to wait for status_pv == good_status before returning
message_pv (str) – PV containing error message if unsuccessful
value (int) – Value to write to pv when method called
wait (bool) – Wait for caput callback?
throw (bool) – throw error if PV not found
- class malcolm.modules.ca.parts.CABooleanPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, throw: Anno(name='AThrow', typ=<class 'bool'>, description='throw error if PV not found') = True)[source]
Defines a boolean
Attribute
that talks to a DBR_LONG longout PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
throw (bool) – throw error if PV not found
- class malcolm.modules.ca.parts.CACharArrayPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True)[source]
Defines a string
Attribute
that talks to a DBR_CHAR_STR waveform PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
- class malcolm.modules.ca.parts.CAChoicePart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True)[source]
Defines a choice
Attribute
that talks to a DBR_ENUM mbbo PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
- class malcolm.modules.ca.parts.CADoubleArrayPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, display_from_pv: Anno(name='AGetLimits', typ=<class 'bool'>, description='Get limits from PV (HOPR & LOPR)') = True)[source]
Defines a float64[]
Attribute
that talks to a DBR_DOUBLE waveform PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
display_from_pv (bool) – Get limits from PV (HOPR & LOPR)
- class malcolm.modules.ca.parts.CADoublePart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, display_from_pv: Anno(name='AGetLimits', typ=<class 'bool'>, description='Get limits from PV (HOPR & LOPR)') = True, throw: Anno(name='AThrow', typ=<class 'bool'>, description='throw error if PV not found') = True)[source]
Defines a float64
Attribute
that talks to a DBR_DOUBLE ao PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
display_from_pv (bool) – Get limits from PV (HOPR & LOPR)
throw (bool) – throw error if PV not found
- class malcolm.modules.ca.parts.CALongArrayPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True)[source]
Defines an int32[]
Attribute
that talks to a DBR_LONG waveform PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
- class malcolm.modules.ca.parts.CALongPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, throw: Anno(name='AThrow', typ=<class 'bool'>, description='throw error if PV not found') = True)[source]
Defines an int32
Attribute
that talks to a DBR_LONG longout PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
throw (bool) – throw error if PV not found
- class malcolm.modules.ca.parts.CAStringPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv: Anno(name='APv', typ=<class 'str'>, description='Full pv of demand and default for rbv') = '', rbv: Anno(name='ARbv', typ=<class 'str'>, description='Override for rbv') = '', rbv_suffix: Anno(name='ARbvSuffix', typ=<class 'str'>, description='Set rbv to pv + rbv_suffix') = '', min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, sink_port: Optional[Anno(name='ASinkPort', typ=<enum 'Port'>, description='If given, mark this as a Sink Port of the given type')] = None, widget: Optional[Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default')] = None, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, throw: Anno(name='AThrow', typ=<class 'bool'>, description='throw error if PV not found') = True, port_badge_mri: Optional[Anno(name='AMri', typ=<class 'str'>, description='The Malcolm Resource Identifier for the Block produced')] = None, port_badge_attr: Optional[Anno(name='ABadgeAttr', typ=<class 'str'>, description='name of attribute for badge value')] = None, port_badge_display: Optional[Anno(name='ABadgeDisplay', typ=<class 'str'>, description='display type for port badge')] = None)[source]
Defines a string
Attribute
that talks to a DBR_STRING stringout PV- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv (str) – Full pv of demand and default for rbv
rbv (str) – Override for rbv
rbv_suffix (str) – Set rbv to pv + rbv_suffix
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
sink_port (Port) – If given, mark this as a Sink Port of the given type
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
throw (bool) – throw error if PV not found
port_badge_mri (str) – The Malcolm Resource Identifier for the Block produced
port_badge_attr (str) – name of attribute for badge value
port_badge_display (str) – display type for port badge
- class malcolm.modules.ca.parts.CAWaveformTablePart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), description: Anno(name='AMetaDescription', typ=<class 'str'>, description='Description of what this element represents'), pv_list: Anno(name='APvList', typ=<class 'str'>, description='List of PVs to monitor') = (), name_list: Anno(name='ANameList', typ=<class 'str'>, description='List of names to give to monitored PVs') = (), min_delta: Anno(name='AMinDelta', typ=<class 'float'>, description='Minimum time between attribute updates in seconds') = 0.05, timeout: Anno(name='ATimeout', typ=<class 'float'>, description='Max time to wait for puts to complete, <0 is forever') = 10.0, widget: Anno(name='AWidget', typ=<enum 'Widget'>, description='If given, use this widget instead of the default') = Widget.PLOT, group: Optional[Anno(name='AGroup', typ=<class 'str'>, description='If given, which GUI group should we attach to')] = None, config: Anno(name='AConfig', typ=<class 'int'>, description='If writeable, which iteration should this field be loaded/saved in? 0 means do not restore') = True, display_from_pv: Anno(name='AGetLimits', typ=<class 'bool'>, description='Get limits from PV (HOPR & LOPR)') = True)[source]
Defines a float64[]
Attribute
that talks to multiple DBR_DOUBLE waveform PV, plus checks HOPR & LOPR on these PVs to determine axis limits- Parameters
name (str) – The name of the Part within the Controller
description (str) – Description of what this element represents
pv_list (str) – List of PVs to monitor
name_list (str) – List of names to give to monitored PVs
min_delta (float) – Minimum time between attribute updates in seconds
timeout (float) – Max time to wait for puts to complete, <0 is forever
widget (Widget) – If given, use this widget instead of the default
group (str) – If given, which GUI group should we attach to
config (int) – If writeable, which iteration should this field be loaded/saved in? 0 means do not restore
display_from_pv (bool) – Get limits from PV (HOPR & LOPR)