project8 / dripline

Slow controls for medium scale physics experiments based on AMQP centralized messaging
http://www.project8.org/dripline
1 stars 0 forks source link

Add an interface class that wraps Service with an easier API #107

Closed laroque closed 9 years ago

laroque commented 9 years ago

That is, Service already does the things that are needed, but it isn't easy for a user to script. In particular, the user has to construct message objects to pass to send_request, send_alert, etc. and then deal with a returned message object after.

The wrapping scrip interface should support the following (basically be an API to dripline_agent, which could be modified to be based on this class).

def get(channel_name) def set(channel_name, value) def config(channel_name, property, value=None) def cmd(channel_name, method_name, _args, _kwargs) def send(channel_name, list_of_commands) # I'm not certain about this one

This may not provide the nicest run scripting interface (it would maybe be nicer to have a standard config file and an executable?), but it is a much better start than one what have now (nothing) as bash scripts.

laroque commented 9 years ago

Okay, the Interface and _InternalInterface classes now exist for this. The abstract the creation of Message instances away from the user somewhat, more still needs to be done.

laroque commented 9 years ago

Okay, the methods return things.... I'm very confident that this implementation isn't going to do everything we want. But I don't feel like predicting what real scripts will look like or forcing scripts into a model for now... So I'm just going to release it and see.