Closed evalott100 closed 11 months ago
Summing up a chat I had with @Araneidae:
ProcessDeviceSupportCore
, probably called setField
. Parameters will be the field name and new valueThis should be relatively straightforward to implement. I'm no longer set up to actually run pythonIoc anymore, so try the following untested patch:
diff --git a/softioc/device.py b/softioc/device.py
index 4fcb5ad..9f5820b 100644
--- a/softioc/device.py
+++ b/softioc/device.py
@@ -83,6 +83,12 @@ class ProcessDeviceSupportCore(DeviceSupportCore, RecordLookup):
def _write_value(self, record, value):
record.write_val(value)
+ def set_field(self, field, value):
+ data = (c_char * 40)()
+ data.value = str(value).encode() + b'\0'
+ db_put_field(
+ self._record.NAME + '.' + field, fields.DBF_STRING, data, 1)
+
class ProcessDeviceSupportIn(ProcessDeviceSupportCore):
_link_ = 'INP'
In pandablocks-ioc we'd like to set the
DISP
of some PVs so that they can't be changed duringHDF5:Capture
. The only way to set this with the current pandablocks-ioc is throughcaput
. It'd be nice to be able to setDISP
from the ioc side.