PYME.IO.Spooler module

class PYME.IO.Spooler.Spooler(filename, frameSource, protocol=<PYME.Acquire.protocol.Protocol object>, guiUpdateCallback=None, fakeCamCycleTime=None, maxFrames=9223372036854775807, **kwargs)

Bases: object

Spooler base class

Create a new spooler.

Parameters
scopePYME.Acquire.microscope.microscope object

The microscope providing the data

filenamestring

The file into which to spool

frameSourcedispatch.Signal object

A source of frames we can subscribe to. It should implement a “connect” method allowing us to register a callback and then call the callback with the frame data in a “frameData” kwarg.

protocolPYME.Acquire.protocol.TaskListProtocol object

The acquisition protocol

guiUpdateCallbackfunction

a function to call when the spooling GUI needs updating

FlushBuffer()
OnFrame(**kwargs)

Callback which should be called on every frame

StartSpool()

Perform protocol ‘frame -1’ tasks, log start metadata, then connect to the frame source.

StopSpool()
abort()

Tidy up if something goes horribly wrong. Disconnects frame source and event logger and then calls cleanup()

cleanup()

over-ride to do any cleanup

finalise()

Over-ride in derived classes to do any spooler specific tidy up - e.g. sending events to server

finished()

over-ride in derived classes to indicate when buffers flushed

get_n_frames()
status()