add support to initialise NTEnum like NTScalar
When initialising an NTEnum with a python dict, it is assumed that the dict is meant for the Value.value and contains index and choices keys for the value. This PR adds ability to initialise value and any other fields of the NTEnum, similar to initialising an NTScalar.
pv = SharedPV(
nt=NTEnum(display=True),
initial={
'value.index': 0,
'value.choices': ['STOP', 'START', 'STANDBY'],
'display.description': "Pump on/off control word."
}
)
Just wondering if this has been resolved yet? Let me know if there is anything I can do to help. Two issues (this one and #153) can then be closed for the price of one!
@kurup I'm happy with this PR as it is now, just needs review and approval on your end.
I've done a couple of tests of this code with our customised wrapper for p4p and it seems to work fine. So I'm happy for you to merge it into master. Thanks!
Hello, is this in a state to be merged yet @mdavidsaver ? we've been looking at using p4p to instantiate NTEnum types and having this in the main repo would massively simplify our set up!
@m2es3h, would it be possible to merge or rebase from main and push your changes again, to trigger the CI/CD tests again?
@Monarda I've sync'd this PR with epics-base:master, now just waiting for a maintainer to approve the CI/CD workflow. I'm not a maintainer and cannot trigger CI/CD or merge.
I've run the CI and it all looks good. Awaiting approval from @mdavidsaver before merging.
Thank you for your patience.