testPython

2020.09.04

Author:
Marty Kraimer
WARNING
This is a work in progress.

This product is available via an open source license

Table of Contents

Introduction

This describes four Python examples that use pvDatabase records.

The first is: PY_NTNDA_Viewer

The second is: qtimage

The third is: mandelbrot

The last is: plot2dcurve

Each example uses numpyImage. This has python documentation. To see it go to directory testPython/numpyImage and then enter:

ipython
import sys                                                              
sys.path.append('./numpyImage/')                                        
from numpyImage import NumpyImage                                       
help(NumpyImage)                                                        

The database used by the last three examples is: database

Goals

The examples are designed with the following goals:

numpyImage
Given a numpy array this code creates and displays a QImage.
database
This provides example PVRecords that are used by Python clients. Each PVRecord performs calculations for the Python client. Thus Python can have much better performance by unloading computations to the PVRecord.

numpy documentation is available at: scipy

QImage documentation is available at: QImage

Installation

Python

Python3 is required as well as using pip to install the following:

numpy
PyQt5
PyQt5-sip
QtPy
p4p
pvapy

EPICS7

An EPICS7 release is required. See: EPICS7

testPython

After EPICS7 has been built then in any directory you choose execute the following

git clone https://github.com/mrkraimer/testPython.git
cd testPython/database
cp  ExampleRELEASE.local RELEASE.local
EDIT RELEASE.local SEE BELOW
make
cd iocBoot/testPython
../../bin/linux-x86_64/testPython st.cmd 

You are now ready to run the examples

RELEASE.local must be changed so that the definition of EPICS7_DIR is the location where You built EPICS7.

Run examples

Assuming you have sucessfully completed installation You are ready to run the examples.

Enjoy!!