Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions softioc/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ class WaveformBase(ProcessDeviceSupportCore):
# NELM Length of allocated array in number of elements
# NORD Currently reported length of array (0 <= NORD <= NELM)
_fields_ = ['UDF', 'FTVL', 'BPTR', 'NELM', 'NORD']
# Allow set() to be called before init_record:
dtype = None
Comment thread
Araneidae marked this conversation as resolved.

def init_record(self, record):
self.dtype = DbfCodeToNumpy[record.FTVL]
Expand Down
2 changes: 2 additions & 0 deletions tests/sim_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def update_sin_wf(value):
sin_wf.set(numpy.sin(
numpy.linspace(0, 2*numpy.pi*sin_ph.get(), sin_len.get())))
sin_wf = Waveform('SIN', datatype = float, length = 1024)
# Check we can update its value before iocInit as per #22
sin_wf.set([1, 2, 3])
sin_len = longOut(
'SINN', 0, 1024, initial_value=1024, on_update=update_sin_wf)
sin_ph = aOut('SINP', initial_value = 0.0, on_update = update_sin_wf)
Expand Down