Skip to content

Commit f911e9c

Browse files
committed
Allow waveform.set() to be called before iocInit()
With CGP-182 (944e072), waveform.set() was modified to use the dtype attribute, which is only created after softioc.iocInit() is called. This change adds a default for dtype, preventing this issue.
1 parent a9d7201 commit f911e9c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

softioc/device.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ class WaveformBase(ProcessDeviceSupportCore):
293293
# NELM Length of allocated array in number of elements
294294
# NORD Currently reported length of array (0 <= NORD <= NELM)
295295
_fields_ = ['UDF', 'FTVL', 'BPTR', 'NELM', 'NORD']
296+
# Allow set() to be called before init_record:
297+
dtype = None
296298

297299
def init_record(self, record):
298300
self.dtype = DbfCodeToNumpy[record.FTVL]

0 commit comments

Comments
 (0)