AFL.automation.APIServer#

Classes

APIServer(name[, data, experiment, contact, ...])

CAStatusPublisher(queue_daemon[, prefix, ...])

Thread running a caproto server to publish queue status PVs.

class AFL.automation.APIServer.APIServer(name, data=None, experiment='Development', contact='tbm@nist.gov', index_template='index.html', new_index_template='index-new.html', plot_template='simple-bokeh.html')[source]#
__init__(name, data=None, experiment='Development', contact='tbm@nist.gov', index_template='index.html', new_index_template='index-new.html', plot_template='simple-bokeh.html')[source]#
create_queue(driver, add_unqueued=True, start_ca=False, ca_prefix=None, ca_port=5064)[source]#
reset_queue_daemon(driver=None)[source]#
advertise_zeroconf(**kwargs)[source]#
run(use_waitress=None, **kwargs)[source]#
run_threaded(start_thread=True, use_waitress=None, **kwargs)[source]#
add_standard_routes()[source]#
get_info()[source]#

Live, status page of the robot

get_quickbar()[source]#

Return the functions, params, and defaults to be shown in this server’s quickbar

is_server_live()[source]#
get_unqueued_commands()[source]#
get_queued_commands()[source]#
add_unqueued_routes()[source]#
query_driver()[source]#
init_logging(toaddrs=None)[source]#
index()[source]#

Render the legacy status board

index_new()[source]#

Render the new driver UI

webapp()[source]#

Render the jquery webapp

render_unqueued(func, kwargs_add, **kwargs)[source]#

Convert an unqueued return item into web-suitable output

send_1d_plot(result, multi=False, **kwargs)[source]#
send_array_as_jpg(array, log_image=False, max_val=None, fillna=0.0, **kwargs)[source]#
queue_state()[source]#
driver_status()[source]#
get_queue()[source]#
get_queue_iteration()[source]#
deposit_obj()[source]#

Store an object named obj in the driver’s dropbox If a uuid is provided, the object will be stored with that uuid Otherwise, a new uuid will be generated. In either case, the uuid will be returned to the client.

retrieve_obj()[source]#

Retrieve an object from the driver’s dropbox uuid specifies the object to retrieve delete specifies whether to delete the object after retrieval

set_driver_object()[source]#
get_driver_object()[source]#
enqueue()[source]#
reorder_queue()[source]#
remove_items()[source]#
remove_item()[source]#
move_item()[source]#
clear_queue()[source]#
clear_history()[source]#
debug()[source]#
pause()[source]#
halt()[source]#
init()[source]#
login()[source]#
get_server_time()[source]#
login_test()[source]#
class AFL.automation.APIServer.CAStatusPublisher(queue_daemon, prefix='AFL:', port=5064, interfaces=None)[source]#

Thread running a caproto server to publish queue status PVs.

__init__(queue_daemon, prefix='AFL:', port=5064, interfaces=None)[source]#

This constructor should always be called with keyword arguments. Arguments are:

group should be None; reserved for future extension when a ThreadGroup class is implemented.

target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.

args is a list or tuple of arguments for the target invocation. Defaults to ().

kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

run()[source]#

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

Modules