project8 / dragonfly

a dripline-based slow-control implementation
Other
0 stars 0 forks source link

SCPI Spime code cleanup #29

Closed laroque closed 7 years ago

laroque commented 8 years ago

There is code in many places (dripline and dragonfly) and things that should inherit don't seem to do so in all cases.

Solution:

  1. Move all SCPI code out of dripline and into dragonfly, since that is where it goes
  2. Pull all SCPI code into a single module (some is in the Prologix module, some is in SCPI, etc.)
  3. FormatSCPISpime should support format/regex-parsing of responses from instruments when doing a get, as well as constructing complex commands
  4. There should be a base class (possibly FormatSCPISpime, which may need to be renamed) which is most generic
  5. There should then be a "SIMPLE" version of that for cases of a basic command which supports reading (add ?) or writing (add VALUE); there should be either inherited classes or options in SIMPLE that only support read or only support write
wcpettus commented 7 years ago

Related issues are now associated. Here is my general philosophy:

Anything can (probably) be done with these forms, but for convenience there are a couple other Spime's:

Also of note, all the calibrations have been pulled together into a new file for order's sake.

Now to the checklist:

  1. The code now is gone from dragonfly
  2. The Spime implementations are all together in spime_endpoints.py
  3. FormatSpime does this parsing (I didn't touch this, Mathieu solved this a while ago)
  4. FormatSpime is the new incarnation of FormatSCPISpime
  5. SimpleSCPISpime still exists and does this

Aside - Since most endpoints allow sending multiple commands together, I've rewritten the SimpleSCPISpime set to both set and check the same endpoint. This ideally will obviate the need to "get_on_set", with the caveat that get goes through @calibrate and set does not, which results in different response formatting (values vs value_raw/value_cal). This is really a different problem though and beyond the scope of this issue.

Testing ahead, but so far looking good.

wcpettus commented 7 years ago

resolved in release v1.3.3