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

SCPI endpoint based on a "menu" of inputs #111

Closed laroque closed 9 years ago

laroque commented 9 years ago

For some commands you "set" not a float, but a string from a set of valid states (which may or may not be intuitively named). Further, sometimes there is more than one base SCPI command for dealing with states (relays in the mux support ROUTE:OPEN and ROUTE:CLOSE, each with a query).

I propose a FormatMapSCPI endpoint which sends a command using substitutions based on a dict provided in the kwargs.

ex: 'ROUT:{state} (@101)' with `relay_state = {'on':'CLOSE', 'close': 'CLOSE', 'open':'OPEN', 'off':'OPEN',...} would let us do.format(state=relay_state[value])...

laroque commented 9 years ago

I changed the implementation from the above and added this to the FormatSCPISpime class. I also adapted the endpoint module's calibration method to support 'calibration' of raw values based on dictionary lookup, in addition to an eval() cal. The name will remain cal_str for backward compatibility of older config files (at least until dripline 2.0) I'll create an issue there for making this change.

Completed in 757e390