This product is available via an open source license
This document describes a Python Image Viewer that monitors data from a PVRecord. Other python clients create 2d curves and issue channelPuts to the PVRecord
See index For installation instructions.
After installation you are ready the run the example, which is located in directory testPython/plot2dcurve
Run the following:
python PVAPYaddDynamicRecord.py python PVAPYgenerateCurve.py circle python PVAPY_Dynamic_Viewer.py
When the viewer is started the following appears:
When start is clicked the following appears:
Go to testPython/plot2dcurve and you will see the following files:
python PVAPY_Dynamic_Viewer.pyOne uses pvapy and the other uses p4p for communication with the IOC.
python PVAPYaddDynamicRecord.pyAgain one uses pvapy and the other uses p4p for communication with the IOC.
The following:
python PVAPY_Dynamic_Viewer.py
displays the following viewer:
The following creates the PVRecord required by this application.
python PVAPYaddDynamicRecord.pyAt this point you can click start on the viewer window. A blank image will appear until you run a curve generation program.
The following
mrk> python PVAPYgenerateCurve.py argument must be one of: ('line', 'circle', 'ellipse', 'clover', 'heart', 'lissajous', 'figureight') mrk> python PVAPYgenerateCurve.py circle name= circle xmin= -1.0 xmax= 1.0 ymin= -1.0 ymax= 1.0 putrate= 468 per second mrk>
Generates a circle. You should now see the folllowing image:
If you look at the image while PVAPYgenerateCurve is running you will see the curve being dynamically created.
Now try generarating some of the other 2d curves.
This has the following:
def getDynamicRecordName() def getAddRecordName() class DynamicRecordData(object) def computeLimits(self)
This is the code that generates the x and y arrays for an image. It is called by P4PgenerateCurve and PVAPYgenerateCurve. In order to generate a curve, it requires an argument that is the name of the curve. Note that some of the code allows additional arguments. Look at the code for details.
This is the code that provides the user interface and code that dynamically generates images.
This is code that creates a dynamicRecord.
The record has the following structure
mrk> pvinfo TPY_2dcurve TPY_2dcurve Server: 10.0.0.11:5075 Type: structure string name double[] x double[] y double xmin double xmax double ymin double ymax
This is code that:
This is code that:
The code than terminates.