Online display class

class OnlineDisplay(dataReceiver: DataReceiver, data: Optional[list[list[float]]] = None, displayConfiguration: Optional[Union[str, dict]] = None)

Online display class, which allows to display live the measurement data while the measurement is taking place.

This class sends the data to the plotting process, which is then displayed by the other process.

This class is passed the DataReceiver object of the measuring device, then after calling the constructor all data from the measuring device are displayed live.

The other possibility is to pass the data with the variable data. Then the data must be passed as you can read in the documentation of addData().

By default, the X axis is time and current and voltage are each displayed on a Y axis.

The variable displayConfiguration can be used to change the display format. With this variable either two default settings can be selected, or everything can be set individually.

displayConfiguration=”UI”: X-axis voltage, Y-axis current. displayConfiguration=”UlogI”: X-axis voltage, Y-axis magnitude of current logarithmically scaled.

Instead of the default diagram presets, the axis labeling and the data type can also be changed individually by passing a dictionary. All parameters from the two following examples must be passed. With x/yTrackName the name of the data track is passed, which is to be displayed on the axis.

displayConfiguration = {
    "figureTitle":"My Custom Online Display",
    "xAxisLabel":"Time",
    "xAxisUnit":"s",
    "xTrackName":TrackTypes.TIME.toString(),
    "yAxis":[
    {"label": "Cell Potential", "unit": "V", "trackName":TrackTypes.VOLTAGE.toString()},
    {"label": "Cell Current", "unit": "A", "trackName":TrackTypes.CURRENT.toString()}
    ]}

or

displayConfiguration = {
    "figureTitle":"Online Display",
    "xAxisLabel":"Potential",
    "xAxisUnit":"V",
    "xTrackName":TrackTypes.VOLTAGE.toString(),
    "yAxis":[
    {"label": "Current", "unit": "A", "name": "Current", "log": True, "trackName":TrackTypes.CURRENT.toString()}
    ]}
Parameters
  • dataReceiver (DataReceiver) – Receiver object.

  • data – Packed into an array: [xData, yDatas]

  • displayConfiguration – Default value None for TIU diagrams. A dict or string as explained in the previous text for other representations.

stopProcessingLoop() None

This function must be called by another thread which tells the processing loop to stop the loop to process online data. Because of the Matplotlib syntax, the plot window will then also be closed, but then the complete data can be displayed.

setMinimumSendInterval(interval: float) None

Set the minimum interval for sending data.

Only after this time is it checked again whether data can be sent to the online display.

Parameters

interval – Time in s.

processingLoop() None

Measurement data processing thread.

This thread reads from the DataReceiver object. If there is new data, all points are sent to the PlottingProcess, which then plots the data.

_sendDataToProcess(job: OnlineDisplayJob, data: Optional[list[list[float]]] = None) None

Sending data to the process via the pipe.

This method reads the data from the DataReceiver object and assembles it so that it can be sent to the PlottingProcess.

Parameters

data – The data to plot. data = [xData, yDatas]. Like addData().

close() None

Close the online display.

class PlottingProcess

Auxiliary class for displaying the plotting window.

By default, the program waits until the plotting window is closed. As long as they are not closed, they have computing time and can be interacted with.

However, if the plotting window is called as an online display, then it only gets computing time when the display pause is called. Also the plotting must always take place in the main thread.

Therefore this class comes in a new process, in which only plotting is done, so you can always interact with the live display and it doesn’t freeze.

terminate() None

Close

processingLoop() None

Main process loop.

This is the main loop and will continue until None is sent to the process or the display is closed. The data is sent to the process with a process pipeline.