dragonfly.implementations.spime_endpoints module¶
Some template vars¶
Members: ADS1115CalcSpime ADS1115Spime DiopsidSpime ErrorQueueSpime FormatSpime GPIOPUDSpime GPIOSpime IonGaugeSpime LeakValveSpime LockinGetSpime LockinSpime Max31856Spime MuxerGetSpime OmegaSpime ProviderAttributeSpime RelaySpime SimpleSCPIGetSpime SimpleSCPISetSpime SimpleSCPISpime exception_map Functions: Classes:
A Spime is an enhanced implementation of a Dripline Endpoint with simple logging capabilities. The spimes defined here are more broad-ranging than a single service, obviating the need to define new spimes for each new service or provider.
When implementing a spime, please remember: - All communication must be configured to return a response. If no useful get is possible, consider a *OPC? - set_and_check is a generally desirable functionality
Generic spime catalog (in order of ease-of-use): - SimpleSCPISpime: quick and simple minimal spime -* SimpleSCPIGetSpime/SimpleSCPISetSpime: limited instance of above with disabled Get/Set - FormatSpime: utility spime with expanded functionality
Custom spime catalog (alphabetical): - ADS1115Spime: spime to read ADS1115 16-bit ADC - ADS1115CalcSpime: spime to perform complex logic on multiple ADS1115 readings - DiopsidSpime: spime for reading available space of a drive - ErrorQueueSpime: spime for iterating through error queue to clear it and return all erros - GPIOSpime: spime to handle GPIO pin control on RPi - GPIOPUDSpime: spime to handle pull_up_down on RPi GPIO pins - IonGaugeSpime: spime to handle communication with Lesker/B-RAX pressure gauges - LeakValveSpime: spime to handle VAT leak valve get responses - LockinSpime: spime to handle antiquated lockin IEEE 488 formatting -* LockinGetSpime: limited instance of above with disabled Set - Max31856Spime: spime to handle thermocouple reading through GPIO on RPi - MuxerGetSpime: spime to handle glenlivet muxer formatting - OmegaSpime: spime to handle custom echo on Omega PID controllers - ProviderAttributeSpime: spime for provider @property - RelaySpime: spime to preload dictionaries for glenlivet relays
Summary¶
-
class
dragonfly.implementations.spime_endpoints.ADS1115CalcSpime(measurements, logic, **kwargs)¶ Bases:
dripline.core.spime.SpimeSpime for performing calculation from multiple ADS1115 readings on Raspberry Pi Consult ADS1115Spime docstring for information on ADS1115 settings
measurements (list): list of measurements, each a dict with read_option, gain, and measurement type defined logic (str): calculation applied to results of measurements
-
on_get(*args, **kwargs)¶
-
-
class
dragonfly.implementations.spime_endpoints.ADS1115Spime(gain, read_option, gain_conversion, measurement='differential', **kwargs)¶ Bases:
dripline.core.spime.SpimeSpime for measuring the voltage difference across two channels of the ADS1115 Adafruit ADC on Raspberry Pi
gain (int): Use the table in the on_get to choose the gain applied to the measurements. pair (int): Use the table immediately below to choose which channels you wish to measure the difference between. gain_conversion (float): Gives a bit to mV conversion for the chosen gain.
-
on_get(*args, **kwargs)¶
-
-
class
dragonfly.implementations.spime_endpoints.DiopsidSpime(drive_to_check, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.DiopsidSpimeSpime for measuring the available space on a drive
Keyword Arguments: - drive_to_check (str) – drive of which we wish to measure available space
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
drive_to_check (str): drive of which we wish to measure available space
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get()¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.ErrorQueueSpime(get_str, empty_str, **kwargs)¶ Bases:
dripline.core.spime.SpimeSpime for polling error queue until empty.
get_str (str): channel number for endpoint empty_key (str): modify get string to return float instead of int
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
-
class
dragonfly.implementations.spime_endpoints.FormatSpime(get_str=None, get_reply_float=False, set_str=None, set_value_lowercase=True, set_value_map=None, extract_raw_regex=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.FormatSpimeUtility spime allowing arbitrary set and query syntax and formatting for more complicated usage cases No assumption about SCPI communication syntax.
Keyword Arguments: - get_str (str) – sent verbatim in the event of on_get; if None, getting of endpoint is disabled
- get_reply_float (bool) – apply special formatting to get return
- set_str (str) – sent as set_str.format(value) in the event of on_set; if None, setting of endpoint is disabled
- set_value_lowercase (bool) – default option to map all string set value to .lower() **WARNING: never set to False if using a set_value_map dict
- set_value_map (str||dict) – inverse of calibration to map raw set value to value sent; either a dictionary or an asteval-interpretable string
- extract_raw_regex (str) – regular expression search pattern applied to get return. Must be constructed with an extraction group keyed with the name “value_raw” (ie r’(?P<value_raw>)’ )
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
get_str (str): sent verbatim in the event of on_get; if None, getting of endpoint is disabled get_reply_float (bool): apply special formatting to get return set_str (str): sent as set_str.format(value) in the event of on_set; if None, setting of endpoint is disabled set_value_lowercase (bool): default option to map all string set value to .lower()
**WARNING: never set to False if using a set_value_map dictset_value_map (str||dict): inverse of calibration to map raw set value to value sent; either a dictionary or an asteval-interpretable string extract_raw_regex (str): regular expression search pattern applied to get return. Must be constructed with an extraction group keyed with the name “value_raw” (ie r’(?P<value_raw>)’ )
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.GPIOPUDSpime(pin, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.GPIOPUDSpimeSpime for reading pull_up_down sensor on GPIO pins on Raspberry Pi
Keyword Arguments: - pin (int) – pin on which to count crossings
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
pin (int): pin on which to count crossings
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.GPIOSpime(inpin=None, outpin=None, set_value_map=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.GPIOSpimeSpime for interacting with GPIO pins on Raspberry Pi
Keyword Arguments: - inpin (int||list) – pin(s) to read for get
- outpin (int||list) – pin(s) to program for set
- set_value_map (dict) – dictionary of mappings for values to on_set; note that the result of set_value_map[value] will be used as the input to set_str.format(value) if this dict is present
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
inpin (int||list): pin(s) to read for get outpin (int||list): pin(s) to program for set set_value_map (dict): dictionary of mappings for values to on_set; note that the result of set_value_map[value] will be used as the input to set_str.format(value) if this dict is present
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.IonGaugeSpime(get_str=None, set_str=None, set_value_map=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.IonGaugeSpimeSpime for interacting with ion gauges over RS485
Keyword Arguments: - get_str (str) – sent verbatim in the event of on_get
- set_str (str) – sent as set_str.format(value) in the event of on_set; if None, setting of endpoint is disabled
- set_value_map (dict) – dictionary of mappings for values to on_set; no error if not value not present in dictionary keys
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
get_str (str): sent verbatim in the event of on_get set_str (str): sent as set_str.format(value) in the event of on_set; if None, setting of endpoint is disabled set_value_map (dict): dictionary of mappings for values to on_set; no error if not value not present in dictionary keys
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.LeakValveSpime(**kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.LeakValveSpimeSpecial implementation of FormatSpime for T2 VAT leak valve on_get has specific formatting rules, otherwise just a FormatSpime
Keyword Arguments: - get_str (str) – sent verbatim in the event of on_get; if None, getting of endpoint is disabled
- get_reply_float (bool) – apply special formatting to get return
- set_str (str) – sent as set_str.format(value) in the event of on_set; if None, setting of endpoint is disabled
- set_value_lowercase (bool) – default option to map all string set value to .lower() **WARNING: never set to False if using a set_value_map dict
- set_value_map (str||dict) – inverse of calibration to map raw set value to value sent; either a dictionary or an asteval-interpretable string
- extract_raw_regex (str) – regular expression search pattern applied to get return. Must be constructed with an extraction group keyed with the name “value_raw” (ie r’(?P<value_raw>)’ )
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.LockinGetSpime(**kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.LockinSpimeIdentical to LockinSpime, but with an explicit exception if on_set attempted
-
on_set(value)¶
-
-
class
dragonfly.implementations.spime_endpoints.LockinSpime(property_key, get_float=False, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.FormatSpimeSpime for communication with lockin endpoints. Uses antiquated IEEE 488 standard.
property_key (str): channel number for endpoint get_float (bool): modify get string to return float instead of int
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
-
class
dragonfly.implementations.spime_endpoints.Max31856Spime(min_value=None, max_value=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.Max31856SpimeSpime for interacting with Max31856 temperature sensor via GPIO pins on Raspberry Pi
Keyword Arguments: - GPIO pins on RPi must be configured via setup_calls with configure_max31856 method (SPI) –
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
SPI GPIO pins on RPi must be configured via setup_calls with configure_max31856 method
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.MuxerGetSpime(ch_number, conf_str=None, **kwargs)¶ Bases:
dripline.core.spime.SpimeSpime for communication with muxer endpoints. No set functionality.
ch_number (int): channel number for endpoint conf_str (str): used by MuxerProvider to configure endpoint scan
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
-
class
dragonfly.implementations.spime_endpoints.OmegaSpime(start_character='*', **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.FormatSpimeSpime allowing communication with Omega PID controllers. Serial communication protocol is not IEEE488 compliant, so sets don’t return
a response as required by EthernetProvider unless echo is used. Custom echo is not properly stripped by provider.-
on_get(*args, **kwargs)¶
-
-
class
dragonfly.implementations.spime_endpoints.ProviderAttributeSpime(attribute_name, disable_set=False, **kwargs)¶ Bases:
dripline.core.spime.SpimeSpime allowing communication with provider property.
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
-
class
dragonfly.implementations.spime_endpoints.RelaySpime(ch_number, relay_type=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.FormatSpimeConvenience spime for communication with relay endpoints.
ch_number (int): channel number for endpoint relay_type (None,’relay’,’polarity’,’switch’): automatically configure set_value_map and calibration dictionaries (overwriteable)
-
class
dragonfly.implementations.spime_endpoints.SimpleSCPIGetSpime(**kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.SimpleSCPIGetSpimeIdentical to SimpleSCPISpime, but with an explicit exception if on_set is attempted
Keyword Arguments: - base_str (str) – string used to generate SCPI commands; get will be of the form “base_str?”; set will be of the form “base_str <value>;base_str?”
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.SimpleSCPISetSpime(**kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.SimpleSCPISetSpimeModelled on SimpleSCPISpime, but with an explicit exception if on_get is attempted, and on_set return query is *OPC? instead of base_str?
Keyword Arguments: - base_str (str) – string used to generate SCPI commands; get will be of the form “base_str?”; set will be of the form “base_str <value>;base_str?”
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get()¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
-
class
dragonfly.implementations.spime_endpoints.SimpleSCPISpime(base_str=None, **kwargs)¶ Bases:
dragonfly.implementations.spime_endpoints.SimpleSCPISpimeConvenience spime for interacting with SCPI endpoints that support basic set and query syntax.
Keyword Arguments: - base_str (str) – string used to generate SCPI commands; get will be of the form “base_str?”; set will be of the form “base_str <value>;base_str?”
- log_on_set (bool) – flag to enable logging the new value whenever a new one is set
- max_interval (float) – If > 0, any log event exceding this number of seconds since the last broadcast will trigger a broadcast.
- max_fractional_change (float) – If > 0, any log event which produces a value which differs from the previous value by more than this amount (expressed as a fraction, ie 10% change is 0.1) will trigger a broadcast
- alert_routing_key (str) – routing key for the alert message send when broadcasting a logging event result. The default value of ‘sensor_value’ is valid for DataLoggers which represent physical quantities being stored to the slow controls database tables
- name (str) – unique identifier across all dripline services (used to determine routing key)
- calibration (str||dict) – string use to process raw get result (with .format(raw)) or a dict to use for the same purpose where raw must be a key
- get_on_set (bool) – flag to toggle running ‘on_get’ after each ‘on_set’
- schedule_interval (float) – time in seconds between scheduled events
base_str (str): string used to generate SCPI commands; get will be of the form “base_str?”; set will be of the form “base_str <value>;base_str?”
-
handle_request(channel, method, properties, request)¶
-
is_locked¶
-
lock(lockout_key=None, *args, **kwargs)¶
-
lockout_key¶
-
log_interval¶
-
log_on_set¶
-
logging_status¶
-
max_fractional_change¶
-
max_interval¶
-
on_cmd(*args, **kwargs)¶ WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_config(attribute, value=None)¶ configure a property again
WARNING! if you override this method, you must ensure you deal with lockout properly
-
on_get(*args, **kwargs)¶
-
on_set(value)¶
-
ping(*args, **kwargs)¶ ignore all details and respond with an empty message
-
schedule_interval¶
-
schedule_status¶
-
scheduled_action()¶ Override Scheduler method with Spime-specific get and log
-
set_condition(*args, **kwargs)¶ To actually do something inside a class, the set_condition should be implemented in the class itself.
-
single_schedule(delay)¶
-
store_value(severity)¶ This method automatically overridden in Spimescape add_endpoint
-
unlock(*args, **kwargs)¶
End of modules condition
Data:
End of data condition