DataWriter Device Class
DataWriter is a base device for writing received stream
frames to files. It defines the normal tree-facing control surface for a file
writer, but it does not implement the actual file format or stream endpoint by
itself. For application use,
StreamWriter is the concrete subclass you
should typically instantiate. In the current implementation it provides:
DataFilefor the selected output pathOpen,Close, andAutoNamecommandsStatus variables such as
IsOpen,CurrentSize,TotalSize,Bandwidth, andFrameCountWriter controls such as
BufferSizeandMaxFileSize
That makes DataWriter the reusable base class for file-writer devices that
should look like ordinary PyRogue nodes in the tree.
When To Use DataWriter
Use DataWriter when you are implementing a custom file-writing device and
want to reuse the standard PyRogue control/status Variables and commands.
If you only want to record stream traffic to file, use
StreamWriter, documented in
Writing Frames To A File, which is the concrete
built-in subclass most applications actually instantiate.
What You Usually Set
Most DataWriter subclasses care about only a few constructor parameters:
hiddenwhen the writer should stay out of the main user treebufferSizefor filesystem bufferingmaxFileSizefor rolling to a new file after a size limit
How Subclassing Works
DataWriter is intentionally a base class. The core file operations are
empty or stub implementations until a subclass supplies the real writer
backend.
The main override points are:
_open()_close()_isOpen()_setBufferSize()_setMaxFileSize()_getCurrentSize()_getTotalSize()_getBandwidth()_getFrameCount()
That split is what lets StreamWriter reuse the same tree-facing controls
while delegating the actual writing behavior to the Rogue file-I/O utility.
The base class always creates the same operator-facing controls:
DataFileholds the path thatOpenwill use.OpenandClosecontrol the underlying writer.AutoNamecreates a timestamped filename using the currentDataFiledirectory, if any.BufferSizeandMaxFileSizeare writable control points.IsOpen,CurrentSize,TotalSize,Bandwidth, andFrameCountare read-only status/monitoring fields.
This common interface is useful because scripts and GUIs can treat custom writers and built-in writers the same way at the tree level.
API Reference
See DataWriter for generated API details.