dls-controls / pythonSoftIOC

Embed an EPICS IOC in a Python process
Apache License 2.0
32 stars 7 forks source link

Inconsistencies around defaults for Analog and Long records #81

Closed AlexanderWells-diamond closed 2 years ago

AlexanderWells-diamond commented 2 years ago

The fields which are defaulted for analogIn/Out and longIn/Out records in builder.py are inconsistent in various ways:

The documentation also reflects these same inconsistencies and should be adjusted to whatever fix is made.

Araneidae commented 2 years ago

I think it would be best if the fields matched the field definitions used in https://github.com/dls-controls/epics_device, specifically the following definitions:

def aIn(name, LOPR=None, HOPR=None, EGU=None, PREC=None, **fields):
def aOut(name, DRVL=None, DRVH=None, EGU=None, PREC=None, **fields):
def longIn(name, LOPR=None, HOPR=None, EGU=None, **fields):
def longOut(name, DRVL=None, DRVH=None, EGU=None, **fields):

with LOPR and HOPR automatically derived from DRVL and DRVH respectively if not already specified.

We can safely add the EGU and PREC fields where not already present without backwards compatibility issues, but there will be a potentially incompatible change affecting aOut if called in the following way:

builder.aIn('NAME', -1, 1, DRVL=-1, DRVH=1)

(This will fail to run if the code is changed as suggested above.)

I'm inclined to accept this as a minor issue.