15 Commits

Author SHA1 Message Date
e50115776d cafe-1.19.3 2024-02-08 14:26:03 +01:00
fdd124905b cafe-1.19.0-py38-gcc-7.5.0 2023-06-19 11:18:24 +02:00
5c7be056d6 cafe-1.16.1 2022-08-04 10:22:53 +02:00
aded1d5ed7 reset status in getCache following put with nowtaccess error 2021-10-14 19:35:20 +02:00
8cf1e68db0 encoding/decoding str/bytes for utf_8, utf_16, latin-1 2021-08-11 15:33:00 +02:00
22f3cfa655 modified cycafe callbacks 2021-06-15 16:18:13 +02:00
eaf1167a81 modified callback fns for cython 2021-05-03 14:56:24 +02:00
56fe465ee4 cafe-1.13.0 environment variables for setup scripts 2021-03-22 15:43:26 +01:00
03c8a5294e cafe-1.13.0 setup_py37_sls2.py 2021-03-22 13:14:29 +01:00
662a7257e8 cafe-1.13.0 2021-03-22 12:40:09 +01:00
39607b33e2 cafe-1.12.5 release 2021-03-16 09:33:22 +01:00
603eda7531 rm --cached ... 2018-12-20 10:44:04 +01:00
a3690b06e4 new release 2018-12-14 15:55:57 +01:00
8e1a1595e0 open methods refined 2017-11-22 14:16:25 +01:00
bc87ffe6ea Connection time optimized 2017-11-14 09:26:02 +01:00
89 changed files with 362801 additions and 10326 deletions

8038
#PyCafe.pyx# Normal file

File diff suppressed because it is too large Load Diff

60
#setup_py38_sf.py# Normal file
View File

@@ -0,0 +1,60 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_CAFE_VERSION='1.14.4'
_EPICS_VERSION='3.14.12'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.8/latest/include/python3.8',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.8/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.8/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION}
)
)

13
.gitignore vendored
View File

@@ -1,5 +1,10 @@
build
python-3.5/*.cpp
python-3.5/*.so
python-3.5/*.*~
python-3.5/SL6-x86_64
*.*~
*.*-*
python3.5
python3.5-sf
python3.7
python3.7-sf
python3.7-sls2
z_python-3.5-old
z_python-3.7-old

170175
PyCafe.cpp Normal file

File diff suppressed because it is too large Load Diff

42
PyCafe.h Normal file
View File

@@ -0,0 +1,42 @@
/* Generated by Cython 0.29.30 */
#ifndef __PYX_HAVE__PyCafe
#define __PYX_HAVE__PyCafe
#include "Python.h"
#ifndef __PYX_HAVE_API__PyCafe
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(_T) _T
#endif
__PYX_EXTERN_C void cy_monitor_handler_wrapper(void *);
__PYX_EXTERN_C void cy_data_event_handler_wrapper(void *, unsigned int, std::string, PVDataHolder);
__PYX_EXTERN_C void cy_ctrl_event_handler_wrapper(void *, unsigned int, std::string, PVCtrlHolder);
__PYX_EXTERN_C void cy_event_handler_wrapper(void *, unsigned int, std::string);
__PYX_EXTERN_C void cy_handle_handler_wrapper(void *, unsigned int);
__PYX_EXTERN_C void cy_connect_handler_wrapper(void *, unsigned int, std::string, int);
__PYX_EXTERN_C void cy_cb_handle_get_wrapper(void *, unsigned int);
__PYX_EXTERN_C void cy_cb_handle_put_wrapper(void *, unsigned int);
#endif /* !__PYX_HAVE_API__PyCafe */
/* WARNING: the interface of the module init function changed in CPython 3.5. */
/* It now returns a PyModuleDef instance instead of a PyModule instance. */
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initPyCafe(void);
#else
PyMODINIT_FUNC PyInit_PyCafe(void);
#endif
#endif /* !__PYX_HAVE__PyCafe */

59636
PyCafe.html Normal file

File diff suppressed because it is too large Load Diff

1141
PyCafe.pxd

File diff suppressed because it is too large Load Diff

1
PyCafe.pxd Symbolic link
View File

@@ -0,0 +1 @@
PyCafe_sls.pxd

Binary file not shown.

6045
PyCafe.pyx

File diff suppressed because it is too large Load Diff

1
PyCafe.pyx Symbolic link
View File

@@ -0,0 +1 @@
PyCafe_sls.pyx

18564
PyCafeDefs.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
PyCafeDefs_api.pxi
PyCafeDefs_py37.pxi

1456
PyCafeDefs.pxi++++ Normal file

File diff suppressed because it is too large Load Diff

1456
PyCafeDefs_all.pxi Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2119
PyCafeDefs_api_full.pxi Normal file

File diff suppressed because it is too large Load Diff

1292
PyCafeDefs_pub.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,848 +1,109 @@
def show():
print "cafe=PyCafe.CyCafe()"
print "cyca=PyCafe.CyCa()"
print "cafe.init()"
print "cafe.openNoWait()"
print "<handle/handleList>=cafe.open(<pv/pvList>)"
print "cafe.openNowAndWait(timeout)"
print "cafe.openNow()"
print "cafe.close(handlePV=<handle/pv>)"
print "cafe.closeChannels()"
print "cafe.allConnected()"
print "cafe.isConnected(handlePV=<handle/pv>)"
print "cafe.printDisconnected()"
print "cafe.printHandles()"
print "cafe.printHandle(handlePV=<handle/pv>)"
print "cafe.getStatus(handlePV=<handle/pv>)"
print "cafe.getAlarmStatusSeverity(handlePV=<handle/pv>)"
print "cafe.getTimeStamp(handlePV=<handle/pv>)"
print "cafe.getTimeStampDate(handlePV=<handle/pv>)"
print "cafe.checkForHandle(<pv>)"
print "cafe.checkForHandleList(<pvList>)"
print "cafe.checkForGroupHandle(<groupName>)"
print "cafe.getPVNameFromHandle(int)"
print "cafe.getHandleFromPVName(str)"
print "cafe.getChannelInfo(handlePV=<handle/pv>)"
print "cafe.setDbrBase(handlePV=<handle/pv>, unsigned int) #dbrBase.DBR_XXX"
print "cafe.getDbrBase(handlePV=<handle/pv>)"
print "cafe.getNonBlocking(handlePV=<handle/pv>)" #followed by getCache
print "cafe.get(handlePV=<handle/pv>)" # return in native type
print "cafe.get(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getInt(handlePV=<handle/pv>)"
print "cafe.getFloathandlePV=<handle/pv>)"
print "cafe.getStr(handlePV=<handle/pv>)"
print "cafe.getList(handlePV=<handle/pv>)" # return List in native type
print "cafe.getList(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getIntList(handlePV=<handle/pv>)"
print "cafe.getFloatList(handlePV=<handle/pv>)"
print "cafe.getStrList(handlePV=<handle/pv>)"
# returns Memoryview in native type, except for when dt='str' which returns a List
# returns np.array if asnumpy=True
print "cafe.getArray(handlePV=<handle/pv>)"
print "cafe.getArray(handlePV=<handle/pv>, dt=<'int','float','str','native'(default)>)"
print "cafe.getIntArray(handlePV=<handle/pv>,asnumpy=<True,False(default)>)"
print "cafe.getFloatArray(handlePV=<handle/pv>,asnumpy=<True,False(default)>)"
print "cafe.getPV(handlePV=<handle/pv>)" # return PVData in native type
print "cafe.getPV(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getPVInt(handlePV=<handle/pv>)"
print "cafe.getPVFloat(handlePV=<handle/pv>)"
print "cafe.getPVStr(handlePV=<handle/pv>)"
print "cafe.getPVList(handleList=<handleList/pvList>)" # return Array of PVData in native type
print "cafe.getPVList(handleList=<handleList/pvList>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getPVIntList(handleList=<handleList/pvList>)"
print "cafe.getPVFloatList(handleList=<handleList/pvList>)"
print "cafe.getPVStrList(handleList=<handleList/pvList>)"
print "cafe.getScalarList(handleList=<handleList/pvList>)" # return List in native type
print "cafe.getScalarList(handleList=<handleList/pvList>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getIntScalarList(handleList=<handleList/pvList>)"
print "cafe.getFloatScalarList(handleList=<handleList/pvList>)"
print "cafe.getStrScalarList(handleList=<handleList/pvList>)"
print "cafe.getPVCache(handlePV=<handle/pv>)" # return PVData in native type
print "cafe.getPVCache(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getPVIntCache(handlePV=<handle/pv>)"
print "cafe.getPVFloatCache(handlePV=<handle/pv>)"
print "cafe.getPVStrCache(handlePV=<handle/pv>)"
# returns Memoryview in native type, except for when dt='str' which returns a List
# returns np.array if asnumpy=True
print "cafe.getArrayCache(handlePV=<handle/pv>)"
print "cafe.getArrayCache(handlePV=<handle/pv>, dt=<'int','float','str','native'(default)>)"
print "cafe.getIntArrayCache(handlePV=<handle/pv>,asnumpy=<True,False(default)>)"
print "cafe.getFloatArrayCache(handlePV=<handle/pv>,asnumpy=<True,False(default)>)"
print "cafe.getCtrl(handlePV=<handle/pv>)"
print "cafe.getCtrl(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "cafe.getCtrlCache(handlePV=<handle/pv>)"
print "cafe.getCtrlCache(handlePV=<handle/pv>, dt='native' (default) else <'int','float','str'>)"
print "mpid=cafe.monitorStart(handlePV=<handle/pv>), cb=None, dbr=None, mask=DBE_VALUE|DBE_LOG|DBE_ALARM)"
print "cafe.monitorStop(handlePV=<handle/pv>, mpID=None)"
print "cafe.monitorStopAll(handlePV=<handle/pv>)"
print "cafe.getNoMonitors(handlePV=<handle/pv>)"
print "cafe.set(handlePV=<handle/pv>, valSet)"
print "cafe.setScalarList(handleList=<handleList/pvList>, valList)"
print "cafe.setAndMatch(handlePVSet=<handle/pv>, valSet=<int,float,str>, handlePVMatch=<handle/pv>, \
tolerance=<int,float,str> , timeout=<float>, printFlag=<bint>)"
#Synchronous groups
print "handleList[]=cafe.defineGroup(gname, pvList)"
print "list[]=cafe.PVGroupValuesToList(pvgroup)"
print "vectorList,status,statusList = cafe.getGroup(self, ghandleName, dt='native')"
print "pvdataList[],status = cafe.getPVGroup(self, ghandleName, dt='native')"
print "cafe.setGroup(ghandleName, vectorList)"
return
cdef int PYCAFE_PRINT_HIGH=9
cdef int PYCAFE_PRINT_MED=5
cdef int PYCAFE_PRINT_LOW=1
cdef int PYCAFE_PRINT_LEVEL=PYCAFE_PRINT_MED
ctypedef shared_ptr[vector [double]] vdouble_ptr
ctypedef shared_ptr[vector [float]] vfloat_ptr
cdef object py_cb = None
cdef object py_cb_handle = None
cdef object py_cb_ctrl = None
cdef object py_cb_handle_open = None
cdef object cbobjt = None
# ***********public or api***************
# For when with pvdata
'''
def py_cb(pvdata pv1, unsigned int handle, str pvname):
print "PV:", pvname, " Handle:", handle
pv1.showMax(10)
return
def py_cb_handle(unsigned int handle):
print " Handle:", handle
return
#Add control callback!
def py_cb_ctrl(pvctrl c1, unsigned int handle, str pvname):
print "PV:", pvname, " Handle:", handle
c1.showMax(10)
return
'''
#***********api***************
cdef public void py_cb_wrapper(PVDataHolder pvd, unsigned int handle, string pvname) with gil:
cdef pvdata pv1 = PVDataHolderToStruct(pvd)
py_cb(pv1, handle, pvname)
with nogil:
return
cdef public void py_cb_ctrl_wrapper(PVCtrlHolder pvc, unsigned int handle, string pvname) with gil:
cdef pvctrl c1 = PVCtrlHolderToStruct(pvc)
py_cb_ctrl(c1, handle, pvname)
with nogil:
return
cdef public void py_cb_handle_wrapper(unsigned int handle) with gil:
py_cb_handle(handle)
with nogil:
return
cdef public void py_cb_handle_monid_wrapper(unsigned int handle, unsigned long monid) with gil:
cbobjt=monDictGlobal[monid]
cbobjt(handle)
with nogil:
return
#***********api***************
'''
cdef object callbackHandlerMonitor = None
cdef void callbackHandlerMonitor_wrapper(event_handler_args args) with gil:
handle=<unsigned long> args.usr
py_cb_handle(handle)
with nogil:
return
'''
#Correct memory management a la KWSmith p.190
cdef class _finalizer:
cdef void *_data
def __dealloc__(self):
if self._data is not NULL:
free(self._data)
return
cdef void set_base(cnp.ndarray arr, void * carr):
cdef _finalizer fin = _finalizer()
fin._data = <void *> carr
cnp.set_array_base(arr, fin)
return
cdef class CyCa:
cpdef readonly unsigned int CY_DBE_VALUE
cpdef readonly unsigned int CY_DBE_LOG
cpdef readonly unsigned int CY_DBE_ARCHIVE
cpdef readonly unsigned int CY_DBE_ALARM
cpdef readonly unsigned int CY_DBE_PROPERTY
cpdef readonly unsigned int CY_DBR_PRIMITIVE
cpdef readonly unsigned int CY_DBR_PLAIN
cpdef readonly unsigned int CY_DBR_STS
cpdef readonly unsigned int CY_DBR_TIME
cpdef readonly unsigned int CY_DBR_GR
cpdef readonly unsigned int CY_DBR_CTRL
cpdef readonly unsigned int CY_DBR_PUT
cpdef readonly unsigned int CY_DBR_STSACK
cpdef readonly unsigned int CY_DBR_CLASS
cpdef readonly unsigned int CY_DBR_NONE
cpdef readonly unsigned int CY_DBR_STRING #returns a NULL terminated string
cpdef readonly unsigned int CY_DBR_SHORT #returns an unsigned short
cpdef readonly unsigned int CY_DBR_INT #returns an unsigned short
cpdef readonly unsigned int CY_DBR_FLOAT #returns an IEEE floating point value
cpdef readonly unsigned int CY_DBR_ENUM #returns an unsigned short which is the enum item
cpdef readonly unsigned int CY_DBR_CHAR #returns an unsigned char
cpdef readonly unsigned int CY_DBR_LONG #returns an unsigned long
cpdef readonly unsigned int CY_DBR_DOUBLE #returns a double precision floating point number
cpdef readonly unsigned int CY_DBR_STS_STRING #returns a string status structure (dbr_sts_string)
cpdef readonly unsigned int CY_DBR_STS_SHORT #returns a short status structure (dbr_sts_short)
cpdef readonly unsigned int CY_DBR_STS_INT #returns a short status structure (dbr_sts_int)
cpdef readonly unsigned int CY_DBR_STS_FLOAT #returns a float status structure (dbr_sts_float)
cpdef readonly unsigned int CY_DBR_STS_ENUM #returns an enum status structure (dbr_sts_enum)
cpdef readonly unsigned int CY_DBR_STS_CHAR #returns a char status structure (dbr_sts_char)
cpdef readonly unsigned int CY_DBR_STS_LONG #returns a long status structure (dbr_sts_long)
cpdef readonly unsigned int CY_DBR_STS_DOUBLE #returns a double status structure (dbr_sts_double)
cpdef readonly unsigned int CY_DBR_TIME_STRING #returns a string time structure (dbr_time_string)
cpdef readonly unsigned int CY_DBR_TIME_SHORT #returns a short time structure (dbr_time_short)
cpdef readonly unsigned int CY_DBR_TIME_INT #returns a short time structure (dbr_time_short)
cpdef readonly unsigned int CY_DBR_TIME_FLOAT #returns a float time structure (dbr_time_float)
cpdef readonly unsigned int CY_DBR_TIME_ENUM #returns an enum time structure (dbr_time_enum)
cpdef readonly unsigned int CY_DBR_TIME_CHAR #returns a char time structure (dbr_time_char)
cpdef readonly unsigned int CY_DBR_TIME_LONG #returns a long time structure (dbr_time_long)
cpdef readonly unsigned int CY_DBR_TIME_DOUBLE #returns a double time structure (dbr_time_double)
cpdef readonly unsigned int CY_DBR_GR_STRING #returns a graphic string structure (dbr_gr_string)
cpdef readonly unsigned int CY_DBR_GR_SHORT #returns a graphic short structure (dbr_gr_short)
cpdef readonly unsigned int CY_DBR_GR_INT #returns a graphic short structure (dbr_gr_int)
cpdef readonly unsigned int CY_DBR_GR_FLOAT #returns a graphic float structure (dbr_gr_float)
cpdef readonly unsigned int CY_DBR_GR_ENUM #returns a graphic enum structure (dbr_gr_enum)
cpdef readonly unsigned int CY_DBR_GR_CHAR #returns a graphic char structure (dbr_gr_char)
cpdef readonly unsigned int CY_DBR_GR_LONG #returns a graphic long structure (dbr_gr_long)
cpdef readonly unsigned int CY_DBR_GR_DOUBLE #returns a graphic double structure (dbr_gr_double)
cpdef readonly unsigned int CY_DBR_CTRL_STRING #returns a control string structure (dbr_ctrl_int)
cpdef readonly unsigned int CY_DBR_CTRL_SHORT #returns a control short structure (dbr_ctrl_short)
cpdef readonly unsigned int CY_DBR_CTRL_INT #returns a control short structure (dbr_ctrl_int)
cpdef readonly unsigned int CY_DBR_CTRL_FLOAT #returns a control float structure (dbr_ctrl_float)
cpdef readonly unsigned int CY_DBR_CTRL_ENUM #returns a control enum structure (dbr_ctrl_enum)
cpdef readonly unsigned int CY_DBR_CTRL_CHAR #returns a control char structure (dbr_ctrl_char)
cpdef readonly unsigned int CY_DBR_CTRL_LONG #returns a control long structure (dbr_ctrl_long)
cpdef readonly unsigned int CY_DBR_CTRL_DOUBLE #returns a control double structure (dbr_ctrl_double)
def __cinit__(self):
self.CY_DBE_VALUE =DBE_VALUE
self.CY_DBE_LOG =DBE_LOG
self.CY_DBE_ARCHIVE =DBE_ARCHIVE
self.CY_DBE_ALARM =DBE_ALARM
self.CY_DBE_PROPERTY =DBE_PROPERTY
self.CY_DBR_PRIMITIVE =DBR_PRIMITIVE
self.CY_DBR_PLAIN =DBR_PLAIN
self.CY_DBR_STS =DBR_STS
self.CY_DBR_TIME =DBR_TIME
self.CY_DBR_GR =DBR_GR
self.CY_DBR_CTRL =DBR_CTRL
self.CY_DBR_PUT =DBR_PUT # DBR_PUT_ACKT and DBR_PUT_ACKS Write only - used from global alarm acknowledge.
self.CY_DBR_STSACK =DBR_STSACK # is DBR_STSACK_STRING
self.CY_DBR_CLASS =DBR_CLASS # is DBR_CLASS_NAME,
self.CY_DBR_NONE =DBR_NONE
self.CY_DBR_STRING =DBR_STRING
self.CY_DBR_SHORT =DBR_SHORT #returns an unsigned short
self.CY_DBR_INT =DBR_INT #returns an unsigned short
self.CY_DBR_FLOAT =DBR_FLOAT #returns an IEEE floating point value
self.CY_DBR_ENUM =DBR_ENUM #returns an unsigned short which is the enum item
self.CY_DBR_CHAR =DBR_CHAR #returns an unsigned char
self.CY_DBR_LONG =DBR_LONG #returns an unsigned long
self.CY_DBR_DOUBLE =DBR_DOUBLE #returns a double precision floating point number
self.CY_DBR_STS_STRING=DBR_STS_STRING #returns a string status structure (dbr_sts_string)
self.CY_DBR_STS_SHORT =DBR_STS_SHORT #returns a short status structure (dbr_sts_short)
self.CY_DBR_STS_INT =DBR_STS_INT #returns a short status structure (dbr_sts_int)
self.CY_DBR_STS_FLOAT =DBR_STS_FLOAT #returns a float status structure (dbr_sts_float)
self.CY_DBR_STS_ENUM =DBR_STS_ENUM #returns an enum status structure (dbr_sts_enum)
self.CY_DBR_STS_CHAR =DBR_STS_CHAR #returns a char status structure (dbr_sts_char)
self.CY_DBR_STS_LONG =DBR_STS_LONG #returns a long status structure (dbr_sts_long)
self.CY_DBR_STS_DOUBLE=DBR_STS_DOUBLE #returns a double status structure (dbr_sts_double)
self.CY_DBR_TIME_STRING=DBR_TIME_STRING #returns a string time structure (dbr_time_string)
self.CY_DBR_TIME_SHORT =DBR_TIME_SHORT #returns a short time structure (dbr_time_short)
self.CY_DBR_TIME_INT =DBR_TIME_INT #returns a short time structure (dbr_time_short)
self.CY_DBR_TIME_FLOAT =DBR_TIME_FLOAT #returns a float time structure (dbr_time_float)
self.CY_DBR_TIME_ENUM =DBR_TIME_ENUM #returns an enum time structure (dbr_time_enum)
self.CY_DBR_TIME_CHAR =DBR_TIME_CHAR #returns a char time structure (dbr_time_char)
self.CY_DBR_TIME_LONG =DBR_TIME_LONG #returns a long time structure (dbr_time_long)
self.CY_DBR_TIME_DOUBLE=DBR_TIME_DOUBLE #returns a double time structure (dbr_time_double)
self.CY_DBR_GR_STRING =DBR_GR_STRING #returns a graphic string structure (dbr_gr_string)
self.CY_DBR_GR_SHORT =DBR_GR_SHORT #returns a graphic short structure (dbr_gr_short)
self.CY_DBR_GR_INT =DBR_GR_INT #returns a graphic short structure (dbr_gr_int)
self.CY_DBR_GR_FLOAT =DBR_GR_FLOAT #returns a graphic float structure (dbr_gr_float)
self.CY_DBR_GR_ENUM =DBR_GR_ENUM #returns a graphic enum structure (dbr_gr_enum)
self.CY_DBR_GR_CHAR =DBR_GR_CHAR #returns a graphic char structure (dbr_gr_char)
self.CY_DBR_GR_LONG =DBR_GR_LONG #returns a graphic long structure (dbr_gr_long)
self.CY_DBR_GR_DOUBLE =DBR_GR_DOUBLE #returns a graphic double structure (dbr_gr_double)
self.CY_DBR_CTRL_STRING=DBR_CTRL_STRING #returns a control string structure (dbr_ctrl_int)
self.CY_DBR_CTRL_SHORT =DBR_CTRL_SHORT #returns a control short structure (dbr_ctrl_short)
self.CY_DBR_CTRL_INT =DBR_CTRL_INT #returns a control short structure (dbr_ctrl_int)
self.CY_DBR_CTRL_FLOAT =DBR_CTRL_FLOAT #returns a control float structure (dbr_ctrl_float)
self.CY_DBR_CTRL_ENUM =DBR_CTRL_ENUM #returns a control enum structure (dbr_ctrl_enum)
self.CY_DBR_CTRL_CHAR =DBR_CTRL_CHAR #returns a control char structure (dbr_ctrl_char)
self.CY_DBR_CTRL_LONG =DBR_CTRL_LONG #returns a control long structure (dbr_ctrl_long)
self.CY_DBR_CTRL_DOUBLE=DBR_CTRL_DOUBLE #returns a control double structure (dbr_ctrl_double)
return
cdef class channelInfo:
cdef readonly long channelID
cdef readonly bint connectFlag
cdef readonly string hostName
cdef readonly unsigned int nelem #native
cdef readonly int dataType; #native
cdef readonly unsigned short accessRead; #0 or 1
cdef readonly unsigned short accessWrite; #0 or 1
cdef readonly string className; #dbr_class_name_t
cdef readonly int connectionState; #as given by CA_OP_
cdef readonly int cafeConnectionState; #as given by cafe_cs_state
cdef readonly string connectionStateAsString; #as given by CA_OP_
cdef readonly string cafeConnectionStateAsString; #as given by cafe_cs_state
cdef CAFEDataTypeCode cdt
cdef CAFEStatusCode csc
cdef CAOPCodes caop
def __cinit__(self):
self.channelID=0
self.connectFlag=False
self.hostName=''
self.nelem=0
self.dataType=ICAFE_TYPENOTCONN
self.accessRead=0
self.accessWrite=0
self.className=''
self.connectionState=ICAFE_CA_OP_CONN_DOWN
self.cafeConnectionState=ICAFE_CS_NEVER_CONN
self.connectionStateAsString='ICAFE_CA_OP_CONN_DOWN'
self.cafeConnectionStateAsString='ICAFE_CS_NEVER_CONN'
def show(self):
print ("channelID = %x" % self.channelID)
print ("connectFlag = %d" % self.connectFlag)
print ("hostName = %s" % self.hostName)
print ("nelem = %d" % self.nelem)
print ("dataType = %s (%d)" % (self.cdt.message(self.dataType), self.dataType))
print ("accessRead = %d" % self.accessRead)
print ("accessWrite = %d" % self.accessWrite)
print ("className = %s" % self.className)
#print ("connectionState = %s (%d)" % (self.connectionStateAsString, self.connectionState))
#print ("cafeConnectionState = %s (%d)" % (self.cafeConnectionStateAsString,self.cafeConnectionState))
print ("connectionState = %s (%d)" % (self.caop.message(self.connectionState),self.connectionState))
print ("cafeConnectionState = %s (%d)" % (self.csc.message(self.cafeConnectionState),self.cafeConnectionState))
return
##################################################################################
cdef class _epicsTimeStampAsDate:
cdef epicsTime *_time
cdef local_tm_nano_sec local
cdef list etsDate
def __cinit__(self, epicsTimeStamp ts):
self._time = new epicsTime(ts)
self.local = <local_tm_nano_sec &> (self._time)
print "ts====== ", ts.secPastEpoch, ts.nsec
print "year=== ", ( ( (&(&self.local).ansi_tm).tm_year) + 1900)
self.etsDate=[]
self.etsDate.append( (self.local.ansi_tm.tm_year + 1900))
self.etsDate.append( (self.local.ansi_tm.tm_mon + 1))
self.etsDate.append( self.local.ansi_tm.tm_mday)
self.etsDate.append( self.local.ansi_tm.tm_hour)
self.etsDate.append( self.local.ansi_tm.tm_min)
self.etsDate.append( self.local.ansi_tm.tm_sec)
self.etsDate.append( <unsigned int> ts.nsec)
self.etsDate.append( self.local.nSec)
def get(self):
return self.etsDate
##################################################################################
##################################################################################
cdef class pvctrl:
cdef readonly unsigned int nelem
cdef readonly int alarmStatus
cdef readonly int alarmSeverity
cdef readonly unsigned short precision
cdef readonly string units
cdef readonly unsigned short noEnumStrings
cdef readonly list enumStrings
cdef readonly upperDisplayLimit
cdef readonly lowerDisplayLimit
cdef readonly upperAlarmLimit
cdef readonly upperWarningLimit
cdef readonly lowerWarningLimit
cdef readonly lowerAlarmLimit
cdef readonly upperControlLimit
cdef readonly lowerControlLimit
cdef readonly list value
cdef readonly int status
def __cinit__(self):
self.nelem= 1
self.alarmStatus=-1
self.alarmSeverity=-1
self.precision=0
self.units=""
self.noEnumStrings=0
self.enumStrings=[]
self.upperDisplayLimit=0
self.lowerDisplayLimit=0
self.upperAlarmLimit=0
self.lowerAlarmLimit=0
self.upperControlLimit=0
self.lowerControlLimit=0
self.value=[]
self.status=1
def show(self):
self.showPrint(self.nelem)
return
def showMax(self, nelem):
if nelem > self.nelem:
#print "----------------------"
#print "Note: Max. Nelem =", self.nelem
#print "----------------------"
nelem=self.nelem
self.showPrint(nelem)
return
cdef showPrint(self, nelem):
cdef unsigned int i
#is self.value[0] a list
if nelem==1:
if isinstance (self.value[0], list):
print "value =", self.value[0][0],
else:
print "value =", self.value[0],
else:
print "values =",
if isinstance (self.value[0], list):
for i in range(0, nelem):
print self.value[0][i],"[%d]" %i,
else:
for i in range(0, nelem):
print self.value[i],"[%d]" %i,
print ""
print ("status = %d" % self.status)
print ("alarmStatus = %d" % self.alarmStatus)
print ("alarmSeverity = %d" % self.alarmSeverity)
print ("precision = %d" % self.precision)
print ("units = %s" % self.units)
print ("noEnumStrings = %d" % self.noEnumStrings)
if self.noEnumStrings > 0:
print "enumStrings =",
for i in range(0, self.noEnumStrings):
print self.enumStrings[i],"[%s]" %i,
print ""
print ("upperDisplayLimit = %f" % self.upperDisplayLimit)
print ("lowerDisplayLimit = %f" % self.lowerDisplayLimit)
print ("upperAlarmLimit = %f" % self.upperAlarmLimit)
print ("lowerAlarmLimit = %f" % self.lowerAlarmLimit)
print ("upperWarningLimit = %f" % self.upperWarningLimit)
print ("lowerWarningLimit = %f" % self.lowerWarningLimit)
print ("upperControlLimit = %f" % self.upperControlLimit)
print ("lowerControlLimit = %f" % self.lowerControlLimit)
return
##################################################################################
##################################################################################
cdef class pvdata:
cdef readonly unsigned int nelem
cdef readonly int alarmStatus
cdef readonly int alarmSeverity
cdef readonly list ts
cdef readonly list tsDate
cdef readonly list value
cdef readonly int status
cdef public void cy_monitor_handler_wrapper(void * callback) with gil:
cbobjt=<object> (<void *> callback)
cbobjt()
with nogil:
return
cdef public void cy_data_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
PVDataHolder pvd) with gil:
def __cinit__(self):
self.nelem= 1
self.alarmStatus=-1
self.alarmSeverity=-1
self.ts=[]
self.tsDate=[]
self.value=[]
self.status=1
global py_cb
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(1)= Handle/PVNAME :", handle, pvname)
cdef pvdata data = PVDataHolderToStruct(pvd)
#data.show()
py_cb = <object>(<void *> callback)
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(2)= Handle/PVNAME :", handle, pvname)
cdef HandleHelper hh
mpid = hh.getUsrArgsAsUInt(handle)
#print("monitorId", mpid)
#monDictGlobal[mpid](handle, pvname, data)
<object>py_cb(handle, pvname, data)
#if monDictGlobal[mpid] != <object>py_cb:
# print( monDictGlobal[mpid])
# print( <object>py_cb)
with nogil:
return
def show(self):
self.showPrint(self.nelem)
return
def showMax(self, nelem):
if nelem > self.nelem:
#print "----------------------"
#print "Note: Max. Nelem =", self.nelem
#print "----------------------"
nelem=self.nelem
self.showPrint(nelem)
return
cdef showPrint(self, nelem):
cdef unsigned int i
#is self.value[0] a list
if nelem==1:
if isinstance (self.value[0], list):
print "value =", self.value[0][0],
else:
print "value =", self.value[0],
else:
print "values =",
if isinstance (self.value[0], list):
for i in range(0, nelem):
print self.value[0][i],"[%d]" %i,
else:
for i in range(0, nelem):
print self.value[i],"[%d]" %i,
print ""
print ("status = %d" % self.status)
#if self.alarmStatus != -1:
print ("alarmStatus = %d" % self.alarmStatus)
print ("alarmSeverity = %d" % self.alarmSeverity)
#if self.ts[0] != 0:
print "ts =", self.ts[0], self.ts[1]
print "tsDate =", self.tsDate[0], self.tsDate[1], \
self.tsDate[2], self.tsDate[3],\
self.tsDate[4], self.tsDate[5], self.tsDate[6]
return
##################################################################################
cdef public void cy_ctrl_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
PVCtrlHolder pvc) with gil:
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVCTRL++++++= Handle/PVNAME :", handle, pvname)
cdef pvctrl data = PVCtrlHolderToStruct(pvc)
cbobjt=<object> (<void *> callback)
cbobjt(handle, pvname, data)
with nogil:
return
cdef public void cy_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname) with gil:
#print(" cy_event_handler_wrapper=====+++++++++++++++HANDLEPV++++++= Handle/PVNAME :", handle, pvname)
#(<object>args[0])(<int>args[1], <string>args[2])
cbobjt=<object> callback
#cbobjt=<object>args[0]
cbobjt(handle, pvname)
#cbobjt=<object>(<int>args[0], pvname)
with nogil:
return
##################################################################################
cdef class pvgroup:
cdef readonly list pvdata
cdef readonly unsigned int npv
cdef readonly string name
cdef readonly int groupStatus
cdef readonly unsigned int groupHandle
def __cinit__(self):
self.groupStatus=ICAFE_NORMAL
return
cdef public void cy_handle_handler_wrapper(void * callback,
unsigned int handle) with gil:
#print(" cy_handle_handler_wrapper=====+++++++++++++++HANDLEPV++++++= Handle:", handle)
cbobjt=<object> callback
cbobjt(handle)
with nogil:
return
def show(self):
self.showPrint(npv=self.npv, grouplist=None)
return
def showWithPV(self,glist):
if len(glist) != self.npv:
print "ERROR: GROUP MEMBER MISMATCH!!"
print glist, "has", len(glist), "members while group has", self.npv,"!!"
return
self.showPrint(self.npv, grouplist=glist)
return
cdef public void cy_connect_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
int status) with gil:
#print(" cy_connect_handler_wrapper ====+++CONNECT++++++++++= Handle/PV/Status:", handle, pvname, status)
#print(" callback is ", <object> callback)
if callback:
cbobjt=<object> callback
cbobjt(handle, pvname, status)
with nogil:
return
def showMax(self, _npv):
if _npv > self.npv:
#print "----------------------"
#print "Note: Max. Npv =", self.npv
#print "----------------------"
_npv=self.npv
self.showPrint(npv=_npv, grouplist=None)
return
cdef showPrint(self, npv, grouplist):
print "GROUP NAME = ", self.name
print "GROUP HANDLE = ", self.groupHandle
print "GROUP STATUS = ", self.groupStatus
cdef unsigned int i,j
#if nelem==1:
# print "value =", self.value[0],
#else:
cdef public void cy_cb_handle_get_wrapper(void * callback, unsigned int handle) with gil:
print(" py_cb_handle_get_wrapper+++++++++++++GET++++++++++= Handle:", handle)
cbobjt=<object> (<void *> callback)
cbobjt(handle)
with nogil:
return
for i in range(0, npv):
print "Member: ", i, "---------------------------------"
if grouplist:
print "PV =", grouplist[i]
print "values =",
for j in range(0, len(self.pvdata[i].value)):
print self.pvdata[i].value[j],"[%d]" %j,
print ""
print ("status = %d" % self.pvdata[i].status)
print ("alarmStatus = %d" % self.pvdata[i].alarmStatus)
print ("alarmSeverity = %d" % self.pvdata[i].alarmSeverity)
print "ts =", self.pvdata[i].ts[0], self.pvdata[i].tsDate[1]
print "tsDate =", self.pvdata[i].tsDate[0], self.pvdata[i].tsDate[1], \
self.pvdata[i].tsDate[2], self.pvdata[i].tsDate[3],\
self.pvdata[i].tsDate[4], self.pvdata[i].tsDate[5], self.pvdata[i].tsDate[6]
print "--------------------------------------------"
return
cdef public void cy_cb_handle_put_wrapper(void * callback, unsigned int handle) with gil:
#print(" py_cb_handle_put_wrapper+++++++++++++PUT++++++++++= Handle:", handle)
cbobjt=<object> (<void *> callback)
cbobjt(handle)
with nogil:
return
'''
cdef showPrintWithPVName(self, npv, pvlist):
print "GROUP NAME = ", self.name
print "GROUP HANDLE = ", self.groupHandle
print "GROUP STATUS = ", self.groupStatus
cdef unsigned int i,j
for i in range(0, npv):
print "pv =", pvlist[i]
for j in range(0, len(self.pvdata[i].value)):
print self.pvdata[i].value[j],"[%d]" %j,
print ""
print ("status = %d" % self.pvdata[i].status)
print ("alarmStatus = %d" % self.pvdata[i].alarmStatus)
print ("alarmSeverity = %d" % self.pvdata[i].alarmSeverity)
print "ts =", self.pvdata[i].ts[0], self.pvdata[i].tsDate[1]
print "tsDate =", self.pvdata[i].tsDate[0], self.pvdata[i].tsDate[1], \
self.pvdata[i].tsDate[2], self.pvdata[i].tsDate[3],\
self.pvdata[i].tsDate[4], self.pvdata[i].tsDate[5], self.pvdata[i].tsDate[6]
return
'''
##################################################################################
##################################################################################
cdef getMatchedDataType(dt, dtn):
#dt: input from user
#dtn: native type
#dtcheck: matching data type for pvd convert method
cdef unsigned int dtcheck=dtn;
if dt in ['int','long','short','uint','ulong','ushort','int32','int64','uint32','uint64']:
dtcheck=CAFE_LONG
elif dt=='double':
dtcheck=CAFE_DOUBLE
elif dt=='float':
dtcheck=CAFE_DOUBLE
elif dt in ['string','str']:
dtcheck=CAFE_STRING
elif dt in ['native','']:
dtcheck=dtn #need a line here
else:
print "Valid input parameters for data type are: 'int', 'float', 'str', or 'native'"
print "Data to be presented in native data type"
return dtcheck
##################################################################################
#################################################################################
#cdef pvdata p1 = pvdata()
#cdef pvctrl c1 = pvctrl()
#################################################################################
cdef pvdata PVDataHolderToStruct(PVDataHolder pvd, dt=None):
#global p1
cdef pvdata p1 = pvdata()
cdef unsigned int dtn = pvd.getDataType();
cdef unsigned int dtcheck=dtn
cdef localList=[]
if dt:
dtcheck=getMatchedDataType(dt, dtn)
if dtcheck==CAFE_STRING:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsString(i))
elif dtcheck==CAFE_SHORT:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsLong(i)) #getAsShort(i)
elif dtcheck==CAFE_FLOAT:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsDouble(i)) #getAsFloat(i)
elif dtcheck==CAFE_ENUM:
#if enum, string taken as native
#if self._c_cafe.isEnum(handle)==1:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsString(i))
#else:
# for i in range(0, pvd.getNelem()):
# localList.append(pvd.getAsLong(i)) #getAsUShort(i)
elif dtcheck==CAFE_CHAR:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsLong(i)) # <unsigned char> pvd.getAsChar(i)
elif dtcheck==CAFE_LONG:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsLong(i))
elif dtcheck==CAFE_DOUBLE:
for i in range(0, pvd.getNelem()):
localList.append(pvd.getAsDouble(i))
else:
localList.append(0)
#print "This line in PyCafe def getDataHolderToStruct should never appear!"
#print "No Data! Error. Is channel connected?"
p1.value=localList
p1.status=pvd.getStatus()
p1.nelem=pvd.getNelem()
p1.alarmStatus=pvd.getAlarmStatus()
p1.alarmSeverity=pvd.getAlarmSeverity()
pvd._etsNorm=pvd.getEpicsTimeStampAsUInt32()
cpdef ll=[]
ll.append((pvd._etsNorm).secPastEpoch)
ll.append((pvd._etsNorm).nsec)
p1.ts=ll
pvd._etsDate=pvd.getEpicsTimeStampAsDate()
cpdef ld=[]
ld.append( (pvd._etsDate).year )
ld.append( (pvd._etsDate).mon )
ld.append( (pvd._etsDate).day )
ld.append( (pvd._etsDate).hour )
ld.append( (pvd._etsDate).min )
ld.append( (pvd._etsDate).sec )
ld.append( (pvd._etsDate).nsec )
p1.tsDate=ld
return p1
##################################################################################
#################################################################################
cdef pvctrl PVCtrlHolderToStruct(PVCtrlHolder pvc, dt=None):
#global c1
cdef pvctrl c1 = pvctrl()
cdef unsigned int dtn = pvc.getDataType();
cdef unsigned int dtcheck=dtn
cdef localList=[]
if dt:
dtcheck=getMatchedDataType(dt, dtn)
if dtcheck==CAFE_STRING:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsString(i))
elif dtcheck==CAFE_SHORT:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsLong(i)) #getAsShort(i)
elif dtcheck==CAFE_FLOAT:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsDouble(i)) #getAsFloat(i)
elif dtcheck==CAFE_ENUM:
#if enum, string taken as native
#if self._c_cafe.isEnum(handle)==1:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsString(i))
#else:
# for i in range(0, pvd.getNelem()):
# localList.append(pvd.getAsLong(i)) #getAsUShort(i)
elif dtcheck==CAFE_CHAR:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsLong(i)) # <unsigned char> pvd.getAsChar(i)
elif dtcheck==CAFE_LONG:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsLong(i))
elif dtcheck==CAFE_DOUBLE:
for i in range(0, pvc.getNelem()):
localList.append(pvc.getAsDouble(i))
else:
localList.append(0)
#print "This line in PyCafe def getDataHolderToStruct should never appear!"
#print "No Data! Error. Is channel connected?"
c1.value=localList
c1.status=pvc.getStatus()
c1.nelem=pvc.getNelem()
c1.alarmStatus=pvc.getAlarmStatus()
c1.alarmSeverity=pvc.getAlarmSeverity()
c1.precision=pvc.getPrecision()
c1.noEnumStrings=pvc.getNoEnumStrings()
enumList=[]
for i in range(0, pvc.getNoEnumStrings()):
enumList.append(pvc.getEnumStrings()[i])
c1.enumStrings=enumList
c1.units=pvc.getUnitsAsString()
c1.upperDisplayLimit=pvc.getUpperDispLimit_AsDouble()
c1.lowerDisplayLimit=pvc.getLowerDispLimit_AsDouble()
c1.upperAlarmLimit =pvc.getUpperAlarmLimit_AsDouble()
c1.upperWarningLimit=pvc.getUpperWarningLimit_AsDouble()
c1.lowerWarningLimit=pvc.getLowerWarningLimit_AsDouble()
c1.lowerAlarmLimit =pvc.getLowerAlarmLimit_AsDouble()
c1.upperControlLimit=pvc.getUpperCtrlLimit_AsDouble()
c1.lowerControlLimit=pvc.getLowerCtrlLimit_AsDouble()
return c1
##################################################################################
#################################################################################
cdef channelInfo channelRegaliaToStruct(ChannelRegalia cr):
cdef channelInfo ci = channelInfo()
ci.channelID = (<long> cr.getChannelID())
ci.connectFlag=cr.getConnectFlag()
ci.hostName =cr.getHostNameAsString()
ci.dataType =cr.getDataType()
ci.className =cr.getClassNameAsString()
ci.accessRead =cr.getAccessRead()
ci.accessWrite=cr.getAccessWrite()
ci.nelem =cr.getNelem()
ci.connectionState =cr.getConnectionState()
ci.cafeConnectionState=cr.getCafeConnectionState()
ci.connectionStateAsString =cr.getConnectionStateAsString()
ci.cafeConnectionStateAsString =cr.getCafeConnectionStateAsString()
return ci
#################################################################################
# ***********public***************

110
PyCafeDefs_pub.pxi+ Normal file
View File

@@ -0,0 +1,110 @@
cdef object py_cb_handle = None
cdef object py_cb_handle_open = None
cdef object cbobjt = None
# ***********public or api***************
# For when with pvdata
cdef public void cy_monitor_handler_wrapper(void * callback) with gil:
cbobjt=<object> (<void *> callback)
print("CALLED")
cbobjt()
with nogil:
return
cdef public void cy_data_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
PVDataHolder pvd) with gil:
global py_cb
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(1)= Handle/PVNAME :", handle, pvname)
cdef pvdata data = PVDataHolderToStruct(pvd)
#data.show()
py_cb = <object>(<void *> callback)
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(2)= Handle/PVNAME :", handle, pvname)
cdef HandleHelper hh
mpid = hh.getUsrArgsAsUInt(handle)
#print("monitorId", mpid)
#monDictGlobal[mpid](handle, pvname, data)
<object>py_cb(handle, pvname, data)
#if monDictGlobal[mpid] != <object>py_cb:
# print( monDictGlobal[mpid])
# print( <object>py_cb)
with nogil:
return
cdef public void cy_ctrl_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
PVCtrlHolder pvc) with gil:
#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVCTRL++++++= Handle/PVNAME :", handle, pvname)
cdef pvctrl data = PVCtrlHolderToStruct(pvc)
cbobjt=<object> (<void *> callback)
cbobjt(handle, pvname, data)
with nogil:
return
cdef public void cy_event_handler_wrapper(void * callback,
unsigned int handle,
string pvname) with gil:
#print(" cy_event_handler_wrapper=====+++++++++++++++HANDLEPV++++++= Handle/PVNAME :", handle, pvname)
#(<object>args[0])(<int>args[1], <string>args[2])
cbobjt=<object> callback
#cbobjt=<object>args[0]
cbobjt(handle, pvname)
#cbobjt=<object>(<int>args[0], pvname)
with nogil:
return
cdef public void cy_handle_handler_wrapper(void * callback,
unsigned int handle) with gil:
#print(" cy_handle_handler_wrapper=====+++++++++++++++HANDLEPV++++++= Handle:", handle)
cbobjt=<object> callback
cbobjt(handle)
with nogil:
return
cdef public void cy_connect_handler_wrapper(void * callback,
unsigned int handle,
string pvname,
int status) with gil:
#print(" cy_connect_handler_wrapper ====+++CONNECT++++++++++= Handle/PV/Status:", handle, pvname, status)
#print(" callback is ", <object> callback)
if callback:
cbobjt=<object> callback
cbobjt(handle, pvname, status)
with nogil:
return
cdef public void cy_cb_handle_get_wrapper(void * callback, unsigned int handle) with gil:
print(" py_cb_handle_get_wrapper+++++++++++++GET++++++++++= Handle:", handle)
cbobjt=<object> (<void *> callback)
cbobjt(handle)
with nogil:
return
cdef public void cy_cb_handle_put_wrapper(void * callback, unsigned int handle) with gil:
#print(" py_cb_handle_put_wrapper+++++++++++++PUT++++++++++= Handle:", handle)
cbobjt=<object> (<void *> callback)
cbobjt(handle)
with nogil:
return
# ***********public***************

1456
PyCafeDefs_py35.pxi Normal file

File diff suppressed because it is too large Load Diff

1456
PyCafeDefs_py37.pxi Normal file

File diff suppressed because it is too large Load Diff

23379
PyCafeDefs_sf.html Normal file

File diff suppressed because it is too large Load Diff

1857
PyCafeDefs_sf.pxi Normal file

File diff suppressed because it is too large Load Diff

0
PyCafe_sf.html Normal file
View File

1455
PyCafe_sf.pxd Normal file

File diff suppressed because it is too large Load Diff

8081
PyCafe_sf.pyx Normal file

File diff suppressed because it is too large Load Diff

7708
PyCafe_sf.pyx+ Normal file

File diff suppressed because it is too large Load Diff

7679
PyCafe_sf.pyx+++ Normal file

File diff suppressed because it is too large Load Diff

1384
PyCafe_sls.pxd Normal file

File diff suppressed because it is too large Load Diff

8084
PyCafe_sls.pyx Normal file

File diff suppressed because it is too large Load Diff

8037
PyCafe_sls.pyx++++ Normal file

File diff suppressed because it is too large Load Diff

7953
PyCafe_sls.pyx++++WithPrint Normal file

File diff suppressed because it is too large Load Diff

7953
PyCafe_sls.pyx_buff Normal file

File diff suppressed because it is too large Load Diff

8044
PyCafe_sls_py35.pyx Normal file

File diff suppressed because it is too large Load Diff

22
README Normal file
View File

@@ -0,0 +1,22 @@
######
# Build for python 3.7:
# source build_py37.sh
#
# Special build for swissfel - with zmq libraries:
# source build_py37_sf.sh
#
# Special build for sls2 - links to epics7:
# source build_py37_sls2.sh
# Build for python 3.5:
# source build_py35.sh
#
# Special build for swissfel - with zmq libraries:
# source build_py35_sf.sh
#
###
### Install directory:
# ./python<version>/lib/${EPICS_HOST_ARCH}
# where <version> is 3.7, 3.7-sf, 3.7-sls2
# 3.5, 3.5-sf

12
build_py310.sh Normal file
View File

@@ -0,0 +1,12 @@
module unload gcc
module load gcc/9.3.0
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sls.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sls.pyx PyCafe.pyx
source /opt/gfa/python 3.8
/ioc/python/latest/bin/python setup_py310.py build_ext -b ./python3.10/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.10/lib/${EPICS_HOST_ARCH}

14
build_py310_sls2.sh Normal file
View File

@@ -0,0 +1,14 @@
module unload gcc
module load gcc/7.5.0
rm -f PyCafeDefs.pxi
ln -s PyCafeDefs_py37.pxi PyCafeDefs.pxi
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sls.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sls.pyx PyCafe.pyx
_EPICS_HOST_ARCH=${RHREL}-x86_64
source /opt/gfa/python 3.10
python setup_py38_sls2.py build_ext -b ./python3.10-sls2/lib/${_EPICS_HOST_ARCH}
cp examples.py ./python3.10-sls2/lib/${_EPICS_HOST_ARCH}

18
build_py34_sls2.sh Normal file
View File

@@ -0,0 +1,18 @@
module unload gcc
module load gcc/7.3.0
#rm -f PyCafe.cpp
#rm -f PyCafe.h
#rm -f PyCafe.pxd
#ln -s PyCafe_sls.pxd PyCafe.pxd
#rm -f PyCafe.pyx
#ln -s PyCafe_sls.pyx PyCafe.pyx
module unload psi-python34
module unload psi-python36
module unload Python
module load psi-python34/2.1.0
python setup_py34_sls2.py build_ext -b ./python3.4-sls2/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.4-sls2/lib/${EPICS_HOST_ARCH}
#/opt/psi/Programming/psi-python34/2.1.0/bin/python

10
build_py35.sh Normal file
View File

@@ -0,0 +1,10 @@
module unload gcc
module load gcc/7.3.0
#rm -f PyCafe.cpp
#rm -f PyCafe.h
#rm -f PyCafe.pxd
#ln -s PyCafe_sls.pxd PyCafe.pxd
source /opt/gfa/python 3.5
python setup_py35.py build_ext -b ./python3.5/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.5/lib/${EPICS_HOST_ARCH}

9
build_py35_sf.sh Normal file
View File

@@ -0,0 +1,9 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafe_sf.cpp
rm -f PyCafe_sf.h
rm -f PyCafe.pxd
ln -s PyCafe_sf.pxd PyCafe.pxd
source /opt/gfa/python 3.5
python setup_py35_sf.py build_ext -b ./python3.5-sf/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.5-sf/lib/${EPICS_HOST_ARCH}

11
build_py35_sls.sh Normal file
View File

@@ -0,0 +1,11 @@
module unload gcc
module load gcc/6.3.0
#rm -f PyCafe.cpp
#rm -f PyCafe.h
#rm -f PyCafe.pxd
#ln -s PyCafe_sls.pxd PyCafe.pxd
#rm -f PyCafe.pyx
#ln -s PyCafe_sls.pyx PyCafe.pyx
source /opt/gfa/python 3.5
python setup_py35_sls.py build_ext -b ./python3.5-sls/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.5-sls/lib/${EPICS_HOST_ARCH}

15
build_py35_sls2.sh Normal file
View File

@@ -0,0 +1,15 @@
module unload gcc
module load gcc/7.3.0
#rm -f PyCafeDefs.pxi
#ln -s PyCafeDefs_py35.pxi PyCafeDefs.pxi
#rm -f PyCafe.cpp
#rm -f PyCafe.h
#rm -f PyCafe.pxd
#ln -s PyCafe_sls.pxd PyCafe.pxd
#rm -f PyCafe.pyx
#ln -s PyCafe_sls_py35.pyx PyCafe.pyx
_EPICS_HOST_ARCH=${RHREL}-x86_64
source /opt/gfa/python 3.5
python setup_py35_sls2.py build_ext -b ./python3.5-sls2/lib/${_EPICS_HOST_ARCH}
cp examples.py ./python3.5-sls2/lib/${_EPICS_HOST_ARCH}

10
build_py37.sh Normal file
View File

@@ -0,0 +1,10 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sls.pxd PyCafe.pxd
source /opt/gfa/python 3.7
python setup_py37.py build_ext -b ./python3.7/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.7/lib/${EPICS_HOST_ARCH}

12
build_py37_sf.sh Normal file
View File

@@ -0,0 +1,12 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sf.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sf.pyx PyCafe.pyx
_EPICS_HOST_ARCH=${RHREL}-x86_64
source /opt/gfa/python 3.7
python setup_py37_sf.py build_ext -b ./python3.7-sf/lib/${_EPICS_HOST_ARCH}
cp examples.py ./python3.7-sf/lib/${_EPICS_HOST_ARCH}

9
build_py37_sf_local.sh Normal file
View File

@@ -0,0 +1,9 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafe_sf.cpp
rm -f PyCafe_sf.h
rm -f PyCafe.pxd
ln -s PyCafe_sf.pxd PyCafe.pxd
source /opt/gfa/python 3.7
python setup_py37_sf_local.py build_ext -b ./python3.7-sf/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.7-sf/lib/${EPICS_HOST_ARCH}

14
build_py37_sls2.sh Normal file
View File

@@ -0,0 +1,14 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafeDefs.pxi
ln -s PyCafeDefs_py37.pxi PyCafeDefs.pxi
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sls.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sls.pyx PyCafe.pyx
_EPICS_HOST_ARCH=${RHREL}-x86_64 #os.environ['EPICS_HOST_ARCH']
source /opt/gfa/python 3.7
python setup_py37_sls2.py build_ext -b ./python3.7-sls2/lib/${_EPICS_HOST_ARCH}
cp examples.py ./python3.7-sls2/lib/${_EPICS_HOST_ARCH}

11
build_py38_sf.sh Normal file
View File

@@ -0,0 +1,11 @@
module unload gcc
module load gcc/7.3.0
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sf.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sf.pyx PyCafe.pyx
source /opt/gfa/python 3.8
python setup_py38_sf.py build_ext -b ./python3.8-sf/lib/${EPICS_HOST_ARCH}
cp examples.py ./python3.8-sf/lib/${EPICS_HOST_ARCH}

14
build_py38_sls2.sh Normal file
View File

@@ -0,0 +1,14 @@
module unload gcc
module load gcc/7.5.0
rm -f PyCafeDefs.pxi
ln -s PyCafeDefs_py37.pxi PyCafeDefs.pxi
rm -f PyCafe.cpp
rm -f PyCafe.h
rm -f PyCafe.pxd
ln -s PyCafe_sls.pxd PyCafe.pxd
rm -f PyCafe.pyx
ln -s PyCafe_sls.pyx PyCafe.pyx
_EPICS_HOST_ARCH=${RHREL}-x86_64
source /opt/gfa/python 3.8
python setup_py38_sls2.py build_ext -b ./python3.8-sls2/lib/${_EPICS_HOST_ARCH}
cp examples.py ./python3.8-sls2/lib/${_EPICS_HOST_ARCH}

119
diff_pxd_sf_sls Normal file
View File

@@ -0,0 +1,119 @@
639d638
< void setNoCyCallbackParameters(unsigned short)
645d643
< void setPyCyHandlerHandle(void *)
686,687c684,685
< void setPyHandlerGet(void *)
< void setPyHandlerPut(void *)
---
> void setPyHandlerGet()
> void setPyHandlerPut()
956,1041d953
< cdef extern from "zbsDataHolders.h":
<
< cdef cppclass BSChannel:
< BSChannel(string) except +
< void setType()
< void setOffset()
< void setModulo()
< void setBSEnabled()
< string getName()
< string getType()
< int getModulo()
< int getOffset()
< unsigned int getNelem()
< bint isBSEnabled()
<
< cdef cppclass BSDataHolder:
< BSDataHolder() except +
< BSDataHolder(vector[string]) except +
< void init(vector[string])
< BSChannel getBSChannel(unsigned int)
< int getIdxFromName(string)
< etsNorm getGlobal_timestamp()
< unsigned long long getPulse_id()
< vector[unsigned int] getHandles()
< vector[string] getPV()
< vector[PVDataHolder] getPVDataV()
< vector[string] getAsStringV()
< vector[double] getAsDoubleV()
< vector[float] getAsFloatV()
< vector[int] getAsIntV()
< int reconnect()
< void closeBS()
< int resetBS()
< int setBS(bint)
< int setCA(bint)
< void setTimeout(int)
< void setHWM(int)
< bint getIsBS()
< void setBSModulo(string, int)
< void setBSOffset(string, int)
< void setBSModuloOffset(string, int, int)
< void printHeader()
< unsigned int getNPV()
< unsigned int getHWM()
< int getTimeout()
< unsigned int getNChannels()
< unsigned int getNNullData()
< float getPGoodData()
< void zero()
< int getStatus()
<
< cdef cppclass DBPMData:
< double getValue()
< epicsTimeStamp getEpicsTimeStamp()
< int getStatus()
<
< cdef cppclass DBPMKeeper:
< DBPMKeeper() except +
< # DBPMKeeper(vector[string], vector[unsigned int], multimap[float, string])
< DBPMKeeper(vector[string], vector[unsigned int], vector[string], vector[float]) except +
< vector[unsigned int] getHandle()
< vector[string] getPV()
< vector[string] getDevice()
<
< vector[double] getS()
< vector[DBPMData] getX()
< vector[DBPMData] getY()
< vector[DBPMData] getQ()
< vector[DBPMData] getEnergy()
<
< vector[double] getOffsetX()
< vector[double] getOffsetY()
<
< bint getIsAllXOK()
< bint getIsAllYOK()
< bint getIsAllQOK()
< bint getIsAllEnergyOK()
< bint getIsAllOK()
< bint setBS(bint)
< bint resetBS()
< void closeBS()
< int getStatus()
< PVDataHolder * pvd
< int getNPV()
<
<
1432,1433c1344,1345
< int readDBPMOffsets(DBPMKeeper &)
< int getDBPM(DBPMKeeper &) nogil
---
> #int readDBPMOffsets(DBPMKeeper &)
> #int getDBPM(DBPMKeeper &) nogil
1435c1347
< int prepareDBPM(vector[string] & , vector[unsigned int] & , vector[string] & , vector[float] & ) nogil
---
> #int prepareDBPM(vector[string] & , vector[unsigned int] & , vector[string] & , vector[float] & ) nogil
1445,1449c1357,1361
< int initBSwithCA(BSDataHolder &) nogil
< int setBS(BSDataHolder &) nogil
< int setBS2CAGroup(BSDataHolder &) nogil
< int getBS(BSDataHolder &) nogil
< int closeBS(BSDataHolder &) nogil
---
> #int initBSwithCA(BSDataHolder &) nogil
> #int setBS(BSDataHolder &) nogil
> #int setBS2CAGroup(BSDataHolder &) nogil
> #int getBS(BSDataHolder &) nogil
> #int closeBS(BSDataHolder &) nogil

717
diff_pyx_sf_sls Normal file
View File

@@ -0,0 +1,717 @@
44c44
< _pymodule = "PyCafe.pyx"
---
> _pymodule = "PyCafe.pyx" # os.path.basename(__file__)
49a50,52
> cdef object py_cb
>
> cdef dict openCallbackDictGlobal = {}
50a54,59
> cdef dict handleMonDictGlobal = {}
> cdef dict monDictGlobal = {}
> cdef dict openDictGlobal = {}
>
> cdef dict getDictGlobal = {}
> cdef dict putDictGlobal = {}
52c61,64
< include "PyCafeDefs_sf.pxi"
---
> #cdef ccafe.CAFE * _c_cafe
> #_c_cafe = new ccafe.CAFE()
>
> include "PyCafeDefs.pxi"
83a96
>
172,179c185
<
< DBPMKeeper dbpm
<
< bint dbpmInitialized
< bint BSInitialized
< bint isBSinCAOnly
< BSDataHolder bsd
<
---
>
213,216c219
< self.dbpmInitialized = False
< self.BSInitialized = False
< self.isBSinCAOnly = False
<
---
>
235,240c238
< def CAFE_version(self):
< return CAFE_VERSION
<
< def EPICS_version(self):
< return EPICS_VERSION
<
---
>
245c243,250
< pv_name = handlePV
---
> pv_name = handlePV
> #global openCallbackDictGlobal
> #openCallbackDictGlobal[cb] = handlePV
> #september 21 2021
> global openDictGlobal
> openDictGlobal[pv_name] = cb
>
> #handle = self.hh.getHandleFromPV(pv_name)
247a253,264
> #self._c_cafe.channelCreatePolicy.setPyCallbackFlag(True)
> #self._c_cafe.channelCreatePolicy.setPyConnectHandler(<void *>cb)
> #open
> #false
>
> def setPyCallbackConnect(self, pv: str = None, cb: object = None):
> if None in (pv, cb):
> return
> global openDictGlobal
> openDictGlobal[pv] = cb
>
> ##self.hh.setPyConnectCallbackFn(handle, <void *>cb)
274c291,299
< self.cs.info(ECA_ALLOCMEM)))
---
> self.cs.info(ECA_ALLOCMEM)))
> '''
> _cafeException = CafeException(
> _type='CafeError', _source=_METHOD,
> _error_code=ECA_ALLOCMEM,
> _error_text=self.cs.code(ECA_ALLOCMEM),
> _error_info=self.cs.info(ECA_ALLOCMEM))
> raise _cafeException
> '''
422,424c447,448
< ##for i in range(0, len(pvV)):
< ##self.setPyCallbackConnect(pvV[i], cb)
< #self.setPyConnectCallbackFn(pvV[i], cb)
---
> for i in range(0, len(pvV)):
> self.setPyCallbackConnect(pvV[i], cb)
473c497
< ####self.setPyCallbackConnect(pv, cb)
---
> self.setPyCallbackConnect(pv, cb)
481c505
< #print("OPEN WITH NO GIL//==>", pvStr, handle)
---
> #print("OPEN WITH NO GIL//==>", pvStr)
486c510
< except RuntimeError as e:
---
> except RuntimeError as e:
501c525
< raise Exception("{} {} \n{}".format(self._exception_text, _METHOD, e))
---
> raise Exception("{} {} \n{}".format(self._exception_text, _METHOD, e))
791c815,816
<
---
> global getDictGlobal
>
800,801c825,827
< if cb is not None:
< crp.setPyHandlerGet(<void *> cb) # forces when=WITH_CALLBACK_USER_SUPPLIED
---
> if cb is not None:
> getDictGlobal[handle] = cb
> crp.setPyHandlerGet() # forces when=WITH_CALLBACK_USER_SUPPLIED
859,861c885,888
<
< if cb is not None:
< crp.setPyHandlerGet(<void *>cb) # forces when=WITH_CALLBACK_USER_SUPPLIED
---
> global getDictGlobal
> if cb is not None:
> getDictGlobal[handle] = cb
> crp.setPyHandlerGet() # forces when=WITH_CALLBACK_USER_SUPPLIED
886,888c913,917
<
< if cb is not None:
< crp.setPyHandlerPut(<void *>cb) # forces when=WITH_CALLBACK_USER_SUPPLIED
---
>
> global putDictGlobal
> if cb is not None:
> putDictGlobal[handle] = cb
> crp.setPyHandlerPut() # forces when=WITH_CALLBACK_USER_SUPPLIED
1402c1431
< #decorator casts handlePV to int
---
> #decorator casts to handlePV to int
4021c4050
< return pvdict, statusOverall, status
---
> return pvdict
5148a5178,5180
> global monDictGlobal
> global handleMonDictGlobal
>
5158c5190
<
---
> #global py_cb
5185,5189d5216
< mp.setUserArgs(< void * > mpid)
< mp.setNoCyCallbackParameters(len(sig.parameters))
< mp.setPyCyHandler(<void *> cb)
<
<
5198c5225,5245
<
---
>
> mp[i].setUserArgs( < void*> mpid)
>
> if len(sig.parameters) == 1:
> monDictGlobal[mpid] = cb
> mp[i].setPyHandler()
>
> elif len(sig.parameters) == 2:
> mp[i].setPyCyHandler(<void *> cb)
>
> elif len(sig.parameters) == 3:
> handleMonDictGlobal[cb] = handleList[i]
> mp[i].setPyCyHandlerData(<void *> cb)
>
> else:
> _cafeException = CafeException(_type='CafeError', _source=_METHOD,
> _error_info="The signature of the monitor callback function is not supported. \
> Supported fns are: \
> 1) callback(handle) or 2) callback(pvdata, handle, pv_name) ")
> raise _cafeException
>
5236a5284,5285
> global monDictGlobal
> global handleMonDictGlobal
5251c5300,5301
<
---
> # April 2020 Legacy
> #global py_cb
5286,5290c5336
< sig = inspect.signature(cb[i])
<
< mp[i].setUserArgs(< void * > mpid) # (<unsigned long *> ptr_mpid)[0])
< mp[i].setNoCyCallbackParameters(len(sig.parameters))
< mp[i].setPyCyHandler(<void *> cb[i])
---
> sig = inspect.signature(cb[i])
5301c5347,5366
<
---
> mp[i].setUserArgs( < void * > mpid) # (<unsigned long *> ptr_mpid)[0])
>
> if len(sig.parameters) == 1:
> monDictGlobal[mpid] = cb[i]
> mp[i].setPyHandler()
>
> elif len(sig.parameters) == 2:
> mp[i].setPyCyHandler(<void *> cb[i])
>
> elif len(sig.parameters) == 3:
> handleMonDictGlobal[cb[i]] = handleList[i]
> mp[i].setPyCyHandlerData(<void *> cb[i])
>
> else:
> _cafeException = CafeException(_type='CafeError', _source=_METHOD,
> _error_info="The signature of the monitor callback function is not supported. \
> Supported fns are: \
> 1) callback(handle) or 2) callback(pvdata, handle, pv_name) ")
> raise _cafeException
>
5940a6006
>
5948c6014
<
---
>
5969c6035,6036
<
---
>
>
6044a6112,6114
> global monDictGlobal
> global handleMonDictGlobal
> global py_cb
6046c6116,6117
<
---
>
> py_cb = cb
6049,6050c6120,6121
< hmd[cb] = mpid ##otherwise cb gets ovewritten when casting to an object
<
---
> hmd[cb] = handle ##otherwise cb gets ovewritten when casting to an object
> #print(hmd)
6052c6123,6133
<
---
> '''
> print('SIGNATURE//3//:')
> print(str(sig))
> for param in sig.parameters.values():
> print('Parameter:', param, type(param))
> print('len1', len(sig.parameters.values()))
> print('len2', len(sig.parameters))
>
> print('monitorid', mpid)
> '''
>
6056,6057c6137,6165
< mp.setNoCyCallbackParameters(len(sig.parameters))
< mp.setPyCyHandler(<void *> cb)
---
>
>
> if len(sig.parameters) == 1:
> ###monDictGlobal[mpid] = cb
>
> mp.setPyHandler()
> # print (<long>mp.getUserArgs())
>
> elif len(sig.parameters) == 2:
> mp.setPyCyHandler(<void *> cb)
> #mp.setPyHandler()
> #mp.setCyCallback(<void *> cb)
>
> elif len(sig.parameters) == 3:
> #py_cb=cb
> #self.hh.addWidget(handle, <void *> cb)
>
> mp.setPyCyHandlerData(<void *> ( py_cb))
> #handleMonDictGlobal[cb] = handle
>
> #mp.setPyHandlerData()
> #mp.setCyCallback(<void *> cb)
> else:
> _cafeException = CafeException(
> _type='CafeError', _source=_METHOD,
> _error_info="The signature of the monitor callback function \
> given by the user is not supported. Valid fns are: \
> 1) callback(handle) or 2) callback(pvdata, handle, pv_name) ")
> raise _cafeException
6096c6204
< cdef unsigned int mpid_no_coercion
---
> cdef unsigned int mpidUI
6097a6206,6207
> global monDictGlobal
> #global handleMonDictGlobal
6099c6209,6210
<
---
>
>
6101d6211
< mpid_no_coercion = mpid
6103c6213
< mpid_no_coercion = mpid
---
> mpidUI = mpid
6105,6113c6215,6226
< status = self._c_cafe.monitorStopWithID(handle, mpid_no_coercion)
< time.sleep(0.001)
< l = None
< if mpid not in list(hmd.values()):
< pass #happens when is direct mode in table widget
< else:
< l = list(hmd.keys())[list(hmd.values()).index(mpid)]
< if l is not None:
< del hmd[l]
---
> status = self._c_cafe.monitorStopWithID(handle, mpidUI)
> time.sleep(0.01)
>
> if (status == ICAFE_NORMAL):
> #pass
> #print (monDictGlobal)
> # DELETE ENTRY ONLY IF IT EXISTS!
> # if monDictGlobal.has_key(mpidUI):
> # Sep 2020 - try without del for testing!
> if mpidUI in monDictGlobal.keys():
> del monDictGlobal[mpidUI]
>
6118d6230
< mids = self.hh.getMonitorIDs(handle)
6121,6129c6233,6265
< time.sleep(0.001)
<
< for monid in mids:
< if monid not in list(hmd.values()):
< continue
< l = list(hmd.keys())[list(hmd.values()).index(monid)]
< if l is not None:
< del hmd[l]
<
---
> time.sleep(0.01)
>
> _ncount = 0
> for key, value in hmd.items():
> if value == handle:
> _ncount += 1
>
> for i in range (0, _ncount):
> try:
> l = list(hmd.keys())[list(hmd.values()).index(handle)]
> #print (l)
> if l is not None:
> del hmd[l]
> except ValueError:
> print("List does not contain handle {0}".format(handle))
> #{k:v for k,v in hmd.items() if v != handle}
> ##for a, v in hmd.items():
> ##print(a, v)
> ##print ("DEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLETE")
> # Find handle with monitor ID and STOP thst one monitor!
>
> if (status == ICAFE_NORMAL):
>
> # print "size", self.hh.getNmonitor(handle)
> mpidUIV = self.hh.getMonitorIDs(handle)
> # print "size", mpidUIV.size()
>
> for i in range(0, mpidUIV.size()):
>
> # if monDictGlobal.has_key(mpidUIV[i]):
> if mpidUIV[i] in monDictGlobal.keys():
> del monDictGlobal[mpidUIV[i]]
>
6137a6274
> # 3
6143d6279
< cdef int status
6144a6281,6282
> global monDictGlobal
> global handleMonDictGlobal
6145a6284
> cdef int status
6152c6291,6292
< hmd.clear()
---
> monDictGlobal.clear()
> handleMonDictGlobal.clear()
6181a6322
>
7232,7545d7372
<
< #if HAVE_BSREAD==1:
<
< ################################################################################
<
< def prepareSFdbpm(self):
< cdef:
< vector[string] bpmList
< vector[unsigned int] bpmHandles
< vector[string] bpmDev
< vector[float] bpmPos
<
< self._c_cafe.prepareDBPM(bpmList, bpmHandles, bpmDev, bpmPos)
<
< # for i in range(0, self.bpmDev.size()):
< #print (bpmPos[i], bpmDev[i] )
<
< if not self.dbpmInitialized:
< self.dbpm = DBPMKeeper(
< bpmList, bpmHandles, bpmDev, bpmPos)
< self.dbpmInitialized = True
< return
<
< ##################################################################################
< # END def prepareSFdbpm(self)
< ##################################################################################
<
< def setSFdbpmBS(self, bint bsFlag=True):
< return self.dbpm.setBS(bsFlag)
<
< def resetSFdbpmBS(self):
< return self.dbpm.resetBS()
<
< def closeSFdbpmBS(self):
< return self.dbpm.closeBS()
<
< def readSFdbpmOffsets(self):
< return self._c_cafe.readDBPMOffsets(self.dbpm)
<
< def getSFdbpm(self):
<
< cdef str _METHOD = "getSFdbpm"
<
< cdef int status
< cdef vector[unsigned int] handleV
< with nogil:
< status = self._c_cafe.getDBPM(self.dbpm)
<
< if status >= ICAFE_ERRNO_BASE:
< self._c_cafe.printStatusMessage(status)
< elif status != ICAFE_NORMAL:
< if PYCAFE_PRINT_LEVEL >= PYCAFE_PRINT_LOW:
< # self._c_cafe.printStatusMessage(status)
<
< handleV = self.dbpm.getHandle()
< # for i in range(0, self.dbpm.getNDBPM()):
< # if x[i].getStatus !=
< #print (self.bpmPos[i], self.bpmDev[i] )
< for i in range(0, self.dbpm.getNPV()):
< if (self.dbpm.pvd[i].getStatus() != ICAFE_NORMAL):
< self._c_cafe.printStatus(handleV[i], status)
<
< return dbpmHolderToStruct(self.dbpm)
<
< ##################################################################################
< # END def getSFdbpm(self):
< ##################################################################################
<
<
< def getSFdbpmOffs_x(self):
< return self.dbpm.getOffsetX()
<
< def getSFdbpmOffs_y(self):
< return self.dbpm.getOffsetY()
<
< ################################################################################
<
< def setBS(self, list pv=None, modulo=None, offset=None, int timeoutMS=0):
<
< cdef str _METHOD = "setBS"
< cdef int status = ICAFE_NORMAL
< cdef unsigned int i
< cdef bint pFlag = False
<
< if isinstance(modulo, numbers.Number):
< if int(modulo) <= 0:
< raise ValueError("{} {} \n{}".format(
< self._exception_text, _METHOD,
< "modulo input argument must be positive!"))
< elif not TypeError(modulo, dict):
< raise Exception("{} {} \n{}".format(
< self._exception_text, _METHOD,
< ("modulo input arg, should be of type <class 'numbers.Number'>, "
< "else <class 'dict'> {pv_name : modulo}")))
<
< if isinstance(offset, (numbers.Number)):
< if int(offset) < 0:
< raise ValueError("{} {} \n{}".format(
< self._exception_text, _METHOD,
< "offset input argument cannot be negative!"))
< elif not isinstance(offset, (dict)):
< raise TypeError("{} {} \n{}".format(
< self._exception_text, _METHOD,
< ("offset input arg, should be of type <class 'numbers.Number'>, "
< "else <class 'dict'> {pv_name : offset} ")))
<
< if self.BSInitialized == True:
< print("Message from setBS: ONLY A SINGLE STREAM IS ALLOWED")
< return status
<
< cdef vector[string] v
<
< if timeoutMS > 0:
< self.bsd.setTimeout(timeoutMS)
<
< if pv is not None:
< # do this to avoid compiler warning messages
< for i in range(0, len(pv)):
< v.push_back(pv[i])
< self.bsd.init(v)
<
< if isinstance(modulo, (numbers.Number)):
< modulo = dict([(pv[i], int(modulo))
< for i in range(0, len(pv))])
<
< if isinstance(offset, (numbers.Number)):
< offset = dict([(pv[i], int(offset))
< for i in range(0, len(pv))])
<
< if modulo is not None:
< for eachKey in modulo:
< self.bsd.setBSModulo(eachKey, modulo[eachKey])
< if offset is not None:
< for eachKey in offset:
< self.bsd.setBSOffset(eachKey, offset[eachKey])
<
< # self.initBSwithCA()
< with nogil:
< self._c_cafe.initBSwithCA(self.bsd)
<
< with nogil:
< self._c_cafe.getBS(self.bsd)
<
< with nogil:
< # status=self._c_cafe.setBS_Step1(self.bsd)
< status = self._c_cafe.setBS(self.bsd)
<
< if status == ICAFE_NORMAL:
< self.BSInitialized = True
< self.isBSinCAOnly = False
<
< return status
<
< ################################################################################
<
< def initBSwithCA(self):
<
< # self.openPrepare()
< with nogil:
< self._c_cafe.initBSwithCA(self.bsd)
<
< # self.openNowAndWait(0.4)
<
<
< ################################################################################
< def setBS2CA(self, list pv=None):
<
< cdef vector[string] v
< if pv is not None:
< # do this to avoid compiler warning messages
< for i in range(0, len(pv)):
< v.push_back(pv[i])
< self.bsd.init(v)
<
< with nogil:
< self._c_cafe.setBS2CAGroup(self.bsd)
< self.isBSinCAOnly = True
<
<
< def getBSSlim(self):
< if self.BSInitialized == False:
< if self.isBSinCAOnly == False:
< print(("Message from getBS: BS stream not initialized;"
< "cafe.setBS(pvList) has first to be called."))
< return None
<
< with nogil:
< self._c_cafe.getBS(self.bsd)
<
<
< t1= time.time()
< PVDataV = self.bsd.getPVDataV()
<
< pvlist = [None] * <int>self.bsd.getNPV()
< #cdef pvdata p1
<
< for i in range (0, self.bsd.getNPV()):
< #p1 = pvdata()
< #p1 = PVDataHolderToStruct(self.bsd.pvdata[i])
< pvlist[i]=PVDataHolderToStruct(PVDataV[i])
<
<
< bs_slim = {}
<
< for data, handle in zip(pvlist, self.bsd.getHandles()): # self.bsd.getIsBS()):
< bs_slim[handle] = data
<
< t2= time.time()
< print("diff in reading BSDataHolderToStruc", t2 - t1)
<
<
< return bs_slim
<
< ################################################################################
< def getBS(self):
<
< if self.BSInitialized == False:
< if self.isBSinCAOnly == False:
< print(("Message from getBS: BS stream not initialized;"
< "cafe.setBS(pvList) has first to be called."))
<
< return None
< # CHECK STATUS!!!!
< #print("getBS in cycafe"
< #start = time.time()
<
< with nogil:
< self._c_cafe.getBS(self.bsd)
<
< _bsd = BSDataHolderToStruct(self.bsd)
< #_bsd.show()
< return _bsd #BSDataHolderToStruct(self.bsd)
<
< '''
< cdef double _pid = 0
< _handle = self._c_cafe.getHandleFromPV(str('SIN-TIMAST-EVG0:TX-PULSEID'))
< _stat = self._c_cafe.getCacheDouble(_handle, _pid)
< print("cython/cafe/diff in cython ", self.bsd.getPulse_id(), _pid, _pid - self.bsd.getPulse_id())
< t1= time.time()
< print("diff in cython", t1 - start)
< #print("pulse_id in cycafe", self.bsd.getPulse_id())
<
< BSd = BSDataHolderToStruct(self.bsd)
< t2= time.time()
< print("diff totol in reading BSDataHolderToStruc", t2 - start)
<
< return BSd
< '''
<
< ################################################################################
<
< def closeBS(self):
< with nogil:
< self._c_cafe.closeBS(self.bsd)
< self.BSInitialized = False
< self.isBSinCAOnly = False
<
<
< def getTimeoutMSBS(self):
< return self.bsd.getTimeout()
<
< def setTimeoutMSBS(self, int timeoutMS):
< self.bsd.setTimeout(timeoutMS)
<
<
< def reconnectBS(self):
< self.bsd.reconnect()
<
<
< def flushBS(self):
< self.bsd.reconnect()
<
<
< def monitorPulseID(self):
< with nogil:
< self._c_cafe.monitorPulseID()
<
<
< def monitorStopPulseID(self):
< with nogil:
< self._c_cafe.monitorStopPulseID()
<
<
< def setPulseIDBufferSize(self, handlePV, int bufferSize = 10):
< cdef str _METHOD = "setPulseIDBufferSize"
<
< cdef unsigned int handle = 0
< if isinstance(handlePV, (int, long)):
< handle = handlePV
< elif isinstance(handlePV, (str)):
< handle = self.checkForHandle(handlePV)
< else:
< raise Exception("{} {} \n{}".format(
< self._exception_text, _METHOD,
< ("First Input argument should be of type <class 'int'> if handle "
< "else <class 'str'> if PV.")))
<
< self._c_cafe.setPulseIDBufferSize(handle, bufferSize)
<
<
< def setPulseIDBufferSizeAll(self, int bufferSize = 10):
< self._c_cafe.setPulseIDBufferSizeAll(bufferSize)
<
<
< ###################################################################################
<
< def setBSInit(self, list pv):
< self.bsd.init(pv)
<
<
<
< ##################################################################################
< #END: cdef CAFE###################################################################
< ##################################################################################

File diff suppressed because it is too large Load Diff

12
julia/README Normal file
View File

@@ -0,0 +1,12 @@
source /opt/gfa/python 3.7
export PYTHONPATH=/opt/gfa/cafe/python/pycafe/cafe-1.13.0-sls2-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
using PyCall
@pyimport PyCafe
cafe=PyCafe.CyCafe()
cyca=PyCafe.CyCa() #To examine error codes
pvdata=cafe.getPV("SATCL01-MQUA120:I-SET")
pvdata.show()
pvdata.value[1] #Note the indexing in julia starts at 1, as I daresay you will already know
pvdata.status # should equal cyca.ICAFE_NORMAL

62
julia/cafe.jl Normal file
View File

@@ -0,0 +1,62 @@
module MyModule
#First execute the following commands in your console window
#export PYTHONPATH=/opt/gfa/cafe/python/pycafe/pyzcafe-1.12.2-gcc-7.3.0
#Start Julia and change the python version from the default
#to Python 3.7.5 as follows:
#ENV["PYTHON"] = "/opt/gfa/python-3.7/latest/bin/python"
#using Pkg
#Pkg.build("PyCall")
#You may need to restart Julia
using PyCall
py"""
import sys
import time
import PyCafe
cafe = PyCafe.CyCafe()
cyca = PyCafe.CyCa()
print(sys.version) #Should see 3.7.5
pvlist = ["SARFE10-PSSS059:SPECTRUM_X", "SATCL01-MQUA120:I-SET","SATCL01-MQUA120:I-READ", "PV-DOES-NOT:EXIST"]
#Quicker to open all channels with one call
cafe.openPrepare()
handle=cafe.open(pvlist)
cafe.openNowAndWait(0.4)
cafe.setNelem(handle[0], 10) #just read out 10 elements of wf
pvdata=cafe.getPV(handle[0])
print(pvlist[0])
pvdata.show() #shows struct
if pvdata.status == cyca.ICAFE_NORMAL:
print("Value =", pvdata.value)
print("TimeStamp =", pvdata.tsDate)
print(pvlist[1])
pvdata=cafe.getPV(handle[1])
pvdata.show()
pvctrl=cafe.getCtrl(handle[1])
pvctrl.show()
cafe.monitor(handle[2])
for i in range (0, 10):
val = cafe.getCache(handle[2])
print (val)
time.sleep(0.25)
value=cafe.get(handle[3])
print(pvlist[3])
if value is None:
status=cafe.getStatus(handle[3])
print("Status =", status, cafe.getStatusCodeAsText(status))
"""
end

63
makefile Normal file
View File

@@ -0,0 +1,63 @@
#
# Jan Chrin
#
#
##### CHANGE AS APPROPRIATE #################
#
_EPICS_HOST_ARCH=${RHREL}-x86_64
CAFE_CYCAFE_BASE=/opt/gfa/cafe/python/pycafe
INSTALL_PATH_PY= $(CAFE_CYCAFE_BASE)/cafe-1.19.3-gcc-7.3.0/lib/${_EPICS_HOST_ARCH}
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.19.3-sf-gcc-7.3.0/lib/${_EPICS_HOST_ARCH}
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.19.3-gcc-7.3.0/lib/${_EPICS_HOST_ARCH}
INSTALL_PATH_SLS2_PY38= $(CAFE_CYCAFE_BASE)/cafe-1.19.3-gcc-7.5.0/lib/${_EPICS_HOST_ARCH}
INSTALL_PATH_SLS2_PY310= $(CAFE_CYCAFE_BASE)/cafe-1.19.3-gcc-7.5.0/lib/${_EPICS_HOST_ARCH}
#############################################
.DEFAULT_GOAL := help
.PHONY: clean
help:
@echo "Options for make: install_py37 install_py37_sf install_py37_sls2 install_py35 install_py35_sf"
install_py37: python3.7/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.7/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
cp python3.7/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_PY)
install_py35: python3.5/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.5/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
install_py37_sf: python3.7-sf/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SF)
install_py35_sf: python3.5-sf/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.5-sf/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
install_py310_sls2: python3.10-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-310-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2_PY310)
cp python3.10-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-310-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2_PY310)
cp python3.10-sls2/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2_PY310)
install_py38_sls2: python3.8-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-38-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2_PY38)
cp python3.8-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-38-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2_PY38)
cp python3.8-sls2/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2_PY38)
install_py37_sls2: python3.7-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
install_py35_sls2: python3.5-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.5-sls2/lib/${_EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.5-sls2/lib/${_EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
clean:
rm -f *.o

47
makefile- Normal file
View File

@@ -0,0 +1,47 @@
#
# Jan Chrin
#
#
##### CHANGE AS APPROPRIATE #################
#
CAFE_CYCAFE_BASE=/opt/gfa/cafe/python/pycafe
INSTALL_PATH_PY= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-sf-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-sls2-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
#############################################
.DEFAULT_GOAL := help
.PHONY: clean
help:
@echo "Options for make: install_py37 install_py37_sf install_py37_sls2 install_py35 install_py35_sf"
install_py37: python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_PY)
install_py35: python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
install_py37_sf: python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SF)
install_py35_sf: python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
install_py37_sls2: python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
clean:
rm -f *.o

56
makefile_gcc_7.5.0 Normal file
View File

@@ -0,0 +1,56 @@
#
# Jan Chrin
#
#
##### CHANGE AS APPROPRIATE #################
#
CAFE_CYCAFE_BASE=/opt/gfa/cafe/python/pycafe
INSTALL_PATH_PY= $(CAFE_CYCAFE_BASE)/cafe-1.19.0-gcc-7.5.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.19.0-sf-gcc-7.5.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.19.0-gcc-7.5.0/lib/${EPICS_HOST_ARCH}
#############################################
.DEFAULT_GOAL := help
.PHONY: clean
help:
@echo "Options for make: install_py37 install_py37_sf install_py37_sls2 install_py35 install_py35_sf"
install_py37: python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_PY)
install_py35: python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
install_py37_sf: python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SF)
install_py35_sf: python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
install_py37_sls2: python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
install_py35_sls2: python3.5-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.5-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.5-sls2/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
install_py38_sls2: python3.8-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-38-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.8-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-38-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.8-sls2/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
clean:
rm -f *.o

47
makefile~ Normal file
View File

@@ -0,0 +1,47 @@
#
# Jan Chrin
#
#
##### CHANGE AS APPROPRIATE #################
#
CAFE_CYCAFE_BASE=/opt/gfa/cafe/python/pycafe
INSTALL_PATH_PY= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-sf-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.13.0-sls2-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
#############################################
.DEFAULT_GOAL := help
.PHONY: clean
help:
@echo "Options for make: install_py37"
install_py37: python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
cp python3.7/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_PY)
install_py35: python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_PY)
cp python3.5/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_PY)
install_py37_sf: python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
cp python3.7-sf/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SF)
install_py35_sf: python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SF)
cp python3.5-sf/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH_SF)
install_py37_sls2: python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_64-linux-gnu.so $(INSTALL_PATH_SLS2)
cp python3.7-sls2/lib/${EPICS_HOST_ARCH}/examples.py $(INSTALL_PATH_SLS2)
clean:
rm -f *.o

133
out Normal file
View File

@@ -0,0 +1,133 @@
--------------------------------------------------
PRINTING ALL HANDLES
--------------------------------------------------
--------------------------------------------------
HANDLE= 1
PV Name= ARIDI-BPM-01LE:X-AVG
Data Type = DBF_DOUBLE
Class Name= Not Supported by Gateway
cxt/chid: 0x55d069e20470/0x55d069e2d270
Timeouts put/get= 0.4/0.4 sec.
isConnected?: Yes
Monitor ID: 4096
--------------------------------------------------
--------------------------------------------------
HANDLE= 2 groupHandle= 1
PV Name= ARIDI-BPM-01LE:X-AVG
Data Type = DBF_DOUBLE
Class Name= Not Supported by Gateway
cxt/chid: 0x55d069e20470/0x55d069e2d2a8
Timeouts put/get= 0.4/0.4 sec.
Syc. Grp timeouts put/get: 5/5 sec.
isConnected?: Yes
Monitor ID: 4097 4100
--------------------------------------------------
--------------------------------------------------
HANDLE= 3 groupHandle= 1
PV Name= ARIDI-BPM-01LE:Y-AVG
Data Type = DBF_DOUBLE
Class Name= Not Supported by Gateway
cxt/chid: 0x55d069e20470/0x55d069e2d2e0
Timeouts put/get= 0.4/0.4 sec.
Syc. Grp timeouts put/get: 5/5 sec.
isConnected?: Yes
Monitor ID: 4098 4101
--------------------------------------------------
--------------------------------------------------
HANDLE= 4 groupHandle= 1
PV Name= ARIDI-BPM-01SB:X-AVG
Data Type = DBF_DOUBLE
Class Name= Not Supported by Gateway
cxt/chid: 0x55d069e20470/0x55d069e2d318
Timeouts put/get= 0.4/0.4 sec.
Syc. Grp timeouts put/get: 5/5 sec.
isConnected?: Yes
Monitor ID: 4099 4102
--------------------------------------------------
--------------------------------------------------
END PRINTING ALL HANDLES
--------------------------------------------------
PY_VERSION_HEX is 0x30707f0
USING PUBLIC PyCafe.h INTERFACE FOR CALLBACKS
1 ARIDI-BPM-01LE:X-AVG 0.002461060881614685
[None, None, None] 600 [600, 600, 600]
1 ARIDI-BPM-01LE:X-AVG 0.002461060881614685
[None, None, None] 600 [600, 600, 600]
============//1//
SIGNATURE:
(handle, pv, pvdata)
Parameter: handle
Parameter: pv
Parameter: pvdata
len1 3
len2 3
monitor id 4097
============//1//
SIGNATURE:
(handle, pv, pvdata)
Parameter: handle
Parameter: pv
Parameter: pvdata
len1 3
len2 3
monitor id 4098
============//1//
SIGNATURE:
(handle, pv, pvdata)
Parameter: handle
Parameter: pv
Parameter: pvdata
len1 3
len2 3
monitor id 4099
============
SIGNATURE//2//:
(handle, pv, pvdata)
Parameter: handle
Parameter: pv
Parameter: pvdata
len1 3
len2 3
monitorid 4101
============
SIGNATURE//2//:
(handle, pv, pvdata)
Parameter: handle
Parameter: pv
Parameter: pvdata
len1 3
len2 3
monitorid 4102
status 1 [1, 1, 1]
2 ARIDI-BPM-01LE:X-AVG 0.002461060881614685
[0.002461060881614685, 1.618129717073e-312, 5.742534967e-315] 1 [1, 1, 1]
3 ARIDI-BPM-01LE:Y-AVG 2.228589255537372e-05
[0.002461060881614685, 2.228589255537372e-05, 5.742534967e-315] 1 [1, 1, 1]
4 ARIDI-BPM-01SB:X-AVG 6.235183536773548e-05
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
3 ARIDI-BPM-01LE:Y-AVG 2.228589255537372e-05
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
4 ARIDI-BPM-01SB:X-AVG 6.235183536773548e-05
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
4 ARIDI-BPM-01SB:X-AVG 6.235183536773548e-05
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
3 ARIDI-BPM-01LE:Y-AVG 2.228589255537372e-05
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
1 ARIDI-BPM-01LE:X-AVG 0.0024666127283126116
[0.002461060881614685, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
2 ARIDI-BPM-01LE:X-AVG 0.0024666127283126116
[0.0024666127283126116, 2.228589255537372e-05, 6.235183536773548e-05] 1 [1, 1, 1]
3 ARIDI-BPM-01LE:Y-AVG 2.4304694079546607e-07
[0.0024666127283126116, 2.4304694079546607e-07, 6.235183536773548e-05] 1 [1, 1, 1]
4 ARIDI-BPM-01SB:X-AVG 3.4545060771051794e-05
[0.0024666127283126116, 2.4304694079546607e-07, 3.4545060771051794e-05] 1 [1, 1, 1]
1 ARIDI-BPM-01LE:X-AVG 0.0023842283990234137
[0.0024666127283126116, 2.4304694079546607e-07, 3.4545060771051794e-05] 1 [1, 1, 1]
2 ARIDI-BPM-01LE:X-AVG 0.0023842283990234137
[0.0023842283990234137, 2.4304694079546607e-07, 3.4545060771051794e-05] 1 [1, 1, 1]
3 ARIDI-BPM-01LE:Y-AVG 7.514108801842667e-06
[0.0023842283990234137, 7.514108801842667e-06, 3.4545060771051794e-05] 1 [1, 1, 1]
4 ARIDI-BPM-01SB:X-AVG 1.659897134231869e-05
[0.0023842283990234137, 7.514108801842667e-06, 1.659897134231869e-05] 1 [1, 1, 1]

View File

@@ -1 +0,0 @@
../PyCafe.pxd

View File

@@ -1 +0,0 @@
../PyCafe.pyx

View File

@@ -1 +0,0 @@
../PyCafeDefs.pxi

View File

@@ -1,115 +0,0 @@
/* Generated by Cython 0.23.4 */
#ifndef __PYX_HAVE_API__PyCafe
#define __PYX_HAVE_API__PyCafe
#include "Python.h"
static void (*__pyx_api_f_6PyCafe_py_cb_wrapper)(PVDataHolder, unsigned int, std::string) = 0;
#define py_cb_wrapper __pyx_api_f_6PyCafe_py_cb_wrapper
static void (*__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper)(PVCtrlHolder, unsigned int, std::string) = 0;
#define py_cb_ctrl_wrapper __pyx_api_f_6PyCafe_py_cb_ctrl_wrapper
static void (*__pyx_api_f_6PyCafe_py_cb_handle_wrapper)(unsigned int) = 0;
#define py_cb_handle_wrapper __pyx_api_f_6PyCafe_py_cb_handle_wrapper
static void (*__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper)(unsigned int, unsigned long) = 0;
#define py_cb_handle_monid_wrapper __pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper
static void (*__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper)(unsigned int) = 0;
#define py_cb_handle_get_wrapper __pyx_api_f_6PyCafe_py_cb_handle_get_wrapper
static void (*__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper)(unsigned int) = 0;
#define py_cb_handle_put_wrapper __pyx_api_f_6PyCafe_py_cb_handle_put_wrapper
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif
#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
PyObject *py_module = 0;
py_name = __Pyx_PyIdentifier_FromString(name);
if (!py_name)
goto bad;
py_module = PyImport_Import(py_name);
Py_DECREF(py_name);
return py_module;
bad:
Py_XDECREF(py_name);
return 0;
}
#endif
#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
PyObject *d = 0;
PyObject *cobj = 0;
union {
void (*fp)(void);
void *p;
} tmp;
d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
if (!d)
goto bad;
cobj = PyDict_GetItemString(d, funcname);
if (!cobj) {
PyErr_Format(PyExc_ImportError,
"%.200s does not export expected C function %.200s",
PyModule_GetName(module), funcname);
goto bad;
}
#if PY_VERSION_HEX >= 0x02070000
if (!PyCapsule_IsValid(cobj, sig)) {
PyErr_Format(PyExc_TypeError,
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
goto bad;
}
tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
{const char *desc, *s1, *s2;
desc = (const char *)PyCObject_GetDesc(cobj);
if (!desc)
goto bad;
s1 = desc; s2 = sig;
while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
if (*s1 != *s2) {
PyErr_Format(PyExc_TypeError,
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
PyModule_GetName(module), funcname, sig, desc);
goto bad;
}
tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
*f = tmp.fp;
if (!(*f))
goto bad;
Py_DECREF(d);
return 0;
bad:
Py_XDECREF(d);
return -1;
}
#endif
static int import_PyCafe(void) {
PyObject *module = 0;
module = __Pyx_ImportModule("PyCafe");
if (!module) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_handle_get_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper, "void (unsigned int)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "py_cb_handle_put_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper, "void (unsigned int)") < 0) goto bad;
Py_DECREF(module); module = 0;
return 0;
bad:
Py_XDECREF(module);
return -1;
}
#endif /* !__PYX_HAVE_API__PyCafe */

View File

@@ -1,4 +0,0 @@
source /opt/gfa/python 3.5
python setup3.5_release.py build_ext -i
export PYTHONPATH=.:/opt/gfa/cafe/python/python-3.5/pycafe-1.3.0-final-2/lib
export LD_LIBRARY_PATH=./

View File

@@ -1 +0,0 @@
../sf_ar_cNodes.xml

View File

@@ -1 +0,0 @@
../examples.py

View File

@@ -1,7 +0,0 @@
source /opt/gfa/python 3.5
export SFEL_OMC_PYTHONPATH=/afs/psi.ch/intranet/SF/Applications/on-line_model/default/PythonModule
export SFEL_LAYOUT_PYTHONPATH=/afs/psi.ch/intranet/SF/Applications/on-line_model/default/scripts/VA
export PYTHONPATH=.:$SFEL_LAYOUT_PYTHONPATH:$SFEL_OMC_PYTHONPATH:/opt/gfa/cafe/python/python-3.5/latest/lib
export LD_LIBRARY_PATH=/opt/gfa/cafe/python/python-3.5/latest/lib
python examples.py

View File

@@ -1 +0,0 @@
../examplesTest.py

View File

@@ -1 +0,0 @@
../gDBPM.xml

View File

@@ -1,36 +0,0 @@
#
# Jan Chrin
# July 2015
#
##### CHANGE AS APPROPRIATE #################
#Cython Version to install
CYCAFE_VERSION=pycafe-1.3.0-final-2
#CAFE project base
#CAFE_BASE=${EPICS_EXTENSIONS}/CAFE
CAFE_BASE=/opt/gfa/cafe/python/python-3.5
CAFE_CYCAFE_BASE=${CAFE_BASE}/${CYCAFE_VERSION}
INSTALL_PATH_AFS=/afs/psi.ch/intranet/Controls/cafe/CAFE/cycafe/$(CYCAFE_VERSION)/lib/${EPICS_HOST_ARCH}
INSTALL_PATH= $(CAFE_CYCAFE_BASE)/lib
EXAMPLES_INSTALL_PATH= $(CAFE_CYCAFE_BASE)/examples
#############################################
install_local: PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p ${EPICS_HOST_ARCH}
cp PyCafe.cpython-35m-x86_64-linux-gnu.so ${EPICS_HOST_ARCH}
mkdir -p ${INSTALL_PATH_AFS}
cp PyCafe.cpython-35m-x86_64-linux-gnu.so ${INSTALL_PATH_AFS}
install_rel: PyCafe.cpython-35m-x86_64-linux-gnu.so
mkdir -p $(INSTALL_PATH)
cp PyCafe.cpython-35m-x86_64-linux-gnu.so $(INSTALL_PATH)
mkdir -p $(EXAMPLES_INSTALL_PATH)
cp examples.py $(EXAMPLES_INSTALL_PATH)
cp examples.sh $(EXAMPLES_INSTALL_PATH)

View File

@@ -1,31 +0,0 @@
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from numpy import get_include
#runtime_library_dirs do not override LD_LIBRARY_PATH!
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
'/usr/local/epics/base/include',
'/usr/local/epics/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/python/python-3.5/pycafe-1.3.0-final-2/include',
'.', get_include()],
library_dirs=[ '/usr/local/epics/base/lib/SL6-x86_64',
'/opt/gfa/cafe/python/python-3.5/pycafe-1.3.0-final-2/lib',
'/opt/gfa/python-3.5/latest/lib'
],
runtime_library_dirs=['/usr/local/epics/base/lib/SL6-x86_64',
'/opt/gfa/cafe/python/python-3.5/pycafe-1.3.0-final-2/lib',
'/opt/gfa/python-3.5/latest/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=False,
compiler_directives={'embedsignature': False, 'language_level': 3, 'c_string_type': 'str',
'c_string_encoding' : 'ascii', 'warning_errors' : False, 'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False})
)

File diff suppressed because it is too large Load Diff

371
python35_header.html Normal file
View File

@@ -0,0 +1,371 @@
<!DOCTYPE html>
<!-- Generated by Cython 0.23.4 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cython: python35_header.pxi</title>
<style type="text/css">
body.cython { font-family: courier; font-size: 12; }
.cython.tag { }
.cython.line { margin: 0em }
.cython.code { font-size: 9; color: #444444; display: none; margin: 0px 0px 0px 8px; border-left: 8px none; }
.cython.line .run { background-color: #B0FFB0; }
.cython.line .mis { background-color: #FFB0B0; }
.cython.code.run { border-left: 8px solid #B0FFB0; }
.cython.code.mis { border-left: 8px solid #FFB0B0; }
.cython.code .py_c_api { color: red; }
.cython.code .py_macro_api { color: #FF7000; }
.cython.code .pyx_c_api { color: #FF3000; }
.cython.code .pyx_macro_api { color: #FF7000; }
.cython.code .refnanny { color: #FFA000; }
.cython.code .trace { color: #FFA000; }
.cython.code .error_goto { color: #FFA000; }
.cython.code .coerce { color: #008000; border: 1px dotted #008000 }
.cython.code .py_attr { color: #FF0000; font-weight: bold; }
.cython.code .c_attr { color: #0000FF; }
.cython.code .py_call { color: #FF0000; font-weight: bold; }
.cython.code .c_call { color: #0000FF; }
.cython.score-0 {background-color: #FFFFff;}
.cython.score-1 {background-color: #FFFFe7;}
.cython.score-2 {background-color: #FFFFd4;}
.cython.score-3 {background-color: #FFFFc4;}
.cython.score-4 {background-color: #FFFFb6;}
.cython.score-5 {background-color: #FFFFaa;}
.cython.score-6 {background-color: #FFFF9f;}
.cython.score-7 {background-color: #FFFF96;}
.cython.score-8 {background-color: #FFFF8d;}
.cython.score-9 {background-color: #FFFF86;}
.cython.score-10 {background-color: #FFFF7f;}
.cython.score-11 {background-color: #FFFF79;}
.cython.score-12 {background-color: #FFFF73;}
.cython.score-13 {background-color: #FFFF6e;}
.cython.score-14 {background-color: #FFFF6a;}
.cython.score-15 {background-color: #FFFF66;}
.cython.score-16 {background-color: #FFFF62;}
.cython.score-17 {background-color: #FFFF5e;}
.cython.score-18 {background-color: #FFFF5b;}
.cython.score-19 {background-color: #FFFF57;}
.cython.score-20 {background-color: #FFFF55;}
.cython.score-21 {background-color: #FFFF52;}
.cython.score-22 {background-color: #FFFF4f;}
.cython.score-23 {background-color: #FFFF4d;}
.cython.score-24 {background-color: #FFFF4b;}
.cython.score-25 {background-color: #FFFF48;}
.cython.score-26 {background-color: #FFFF46;}
.cython.score-27 {background-color: #FFFF44;}
.cython.score-28 {background-color: #FFFF43;}
.cython.score-29 {background-color: #FFFF41;}
.cython.score-30 {background-color: #FFFF3f;}
.cython.score-31 {background-color: #FFFF3e;}
.cython.score-32 {background-color: #FFFF3c;}
.cython.score-33 {background-color: #FFFF3b;}
.cython.score-34 {background-color: #FFFF39;}
.cython.score-35 {background-color: #FFFF38;}
.cython.score-36 {background-color: #FFFF37;}
.cython.score-37 {background-color: #FFFF36;}
.cython.score-38 {background-color: #FFFF35;}
.cython.score-39 {background-color: #FFFF34;}
.cython.score-40 {background-color: #FFFF33;}
.cython.score-41 {background-color: #FFFF32;}
.cython.score-42 {background-color: #FFFF31;}
.cython.score-43 {background-color: #FFFF30;}
.cython.score-44 {background-color: #FFFF2f;}
.cython.score-45 {background-color: #FFFF2e;}
.cython.score-46 {background-color: #FFFF2d;}
.cython.score-47 {background-color: #FFFF2c;}
.cython.score-48 {background-color: #FFFF2b;}
.cython.score-49 {background-color: #FFFF2b;}
.cython.score-50 {background-color: #FFFF2a;}
.cython.score-51 {background-color: #FFFF29;}
.cython.score-52 {background-color: #FFFF29;}
.cython.score-53 {background-color: #FFFF28;}
.cython.score-54 {background-color: #FFFF27;}
.cython.score-55 {background-color: #FFFF27;}
.cython.score-56 {background-color: #FFFF26;}
.cython.score-57 {background-color: #FFFF26;}
.cython.score-58 {background-color: #FFFF25;}
.cython.score-59 {background-color: #FFFF24;}
.cython.score-60 {background-color: #FFFF24;}
.cython.score-61 {background-color: #FFFF23;}
.cython.score-62 {background-color: #FFFF23;}
.cython.score-63 {background-color: #FFFF22;}
.cython.score-64 {background-color: #FFFF22;}
.cython.score-65 {background-color: #FFFF22;}
.cython.score-66 {background-color: #FFFF21;}
.cython.score-67 {background-color: #FFFF21;}
.cython.score-68 {background-color: #FFFF20;}
.cython.score-69 {background-color: #FFFF20;}
.cython.score-70 {background-color: #FFFF1f;}
.cython.score-71 {background-color: #FFFF1f;}
.cython.score-72 {background-color: #FFFF1f;}
.cython.score-73 {background-color: #FFFF1e;}
.cython.score-74 {background-color: #FFFF1e;}
.cython.score-75 {background-color: #FFFF1e;}
.cython.score-76 {background-color: #FFFF1d;}
.cython.score-77 {background-color: #FFFF1d;}
.cython.score-78 {background-color: #FFFF1c;}
.cython.score-79 {background-color: #FFFF1c;}
.cython.score-80 {background-color: #FFFF1c;}
.cython.score-81 {background-color: #FFFF1c;}
.cython.score-82 {background-color: #FFFF1b;}
.cython.score-83 {background-color: #FFFF1b;}
.cython.score-84 {background-color: #FFFF1b;}
.cython.score-85 {background-color: #FFFF1a;}
.cython.score-86 {background-color: #FFFF1a;}
.cython.score-87 {background-color: #FFFF1a;}
.cython.score-88 {background-color: #FFFF1a;}
.cython.score-89 {background-color: #FFFF19;}
.cython.score-90 {background-color: #FFFF19;}
.cython.score-91 {background-color: #FFFF19;}
.cython.score-92 {background-color: #FFFF19;}
.cython.score-93 {background-color: #FFFF18;}
.cython.score-94 {background-color: #FFFF18;}
.cython.score-95 {background-color: #FFFF18;}
.cython.score-96 {background-color: #FFFF18;}
.cython.score-97 {background-color: #FFFF17;}
.cython.score-98 {background-color: #FFFF17;}
.cython.score-99 {background-color: #FFFF17;}
.cython.score-100 {background-color: #FFFF17;}
.cython.score-101 {background-color: #FFFF16;}
.cython.score-102 {background-color: #FFFF16;}
.cython.score-103 {background-color: #FFFF16;}
.cython.score-104 {background-color: #FFFF16;}
.cython.score-105 {background-color: #FFFF16;}
.cython.score-106 {background-color: #FFFF15;}
.cython.score-107 {background-color: #FFFF15;}
.cython.score-108 {background-color: #FFFF15;}
.cython.score-109 {background-color: #FFFF15;}
.cython.score-110 {background-color: #FFFF15;}
.cython.score-111 {background-color: #FFFF15;}
.cython.score-112 {background-color: #FFFF14;}
.cython.score-113 {background-color: #FFFF14;}
.cython.score-114 {background-color: #FFFF14;}
.cython.score-115 {background-color: #FFFF14;}
.cython.score-116 {background-color: #FFFF14;}
.cython.score-117 {background-color: #FFFF14;}
.cython.score-118 {background-color: #FFFF13;}
.cython.score-119 {background-color: #FFFF13;}
.cython.score-120 {background-color: #FFFF13;}
.cython.score-121 {background-color: #FFFF13;}
.cython.score-122 {background-color: #FFFF13;}
.cython.score-123 {background-color: #FFFF13;}
.cython.score-124 {background-color: #FFFF13;}
.cython.score-125 {background-color: #FFFF12;}
.cython.score-126 {background-color: #FFFF12;}
.cython.score-127 {background-color: #FFFF12;}
.cython.score-128 {background-color: #FFFF12;}
.cython.score-129 {background-color: #FFFF12;}
.cython.score-130 {background-color: #FFFF12;}
.cython.score-131 {background-color: #FFFF12;}
.cython.score-132 {background-color: #FFFF11;}
.cython.score-133 {background-color: #FFFF11;}
.cython.score-134 {background-color: #FFFF11;}
.cython.score-135 {background-color: #FFFF11;}
.cython.score-136 {background-color: #FFFF11;}
.cython.score-137 {background-color: #FFFF11;}
.cython.score-138 {background-color: #FFFF11;}
.cython.score-139 {background-color: #FFFF11;}
.cython.score-140 {background-color: #FFFF11;}
.cython.score-141 {background-color: #FFFF10;}
.cython.score-142 {background-color: #FFFF10;}
.cython.score-143 {background-color: #FFFF10;}
.cython.score-144 {background-color: #FFFF10;}
.cython.score-145 {background-color: #FFFF10;}
.cython.score-146 {background-color: #FFFF10;}
.cython.score-147 {background-color: #FFFF10;}
.cython.score-148 {background-color: #FFFF10;}
.cython.score-149 {background-color: #FFFF10;}
.cython.score-150 {background-color: #FFFF0f;}
.cython.score-151 {background-color: #FFFF0f;}
.cython.score-152 {background-color: #FFFF0f;}
.cython.score-153 {background-color: #FFFF0f;}
.cython.score-154 {background-color: #FFFF0f;}
.cython.score-155 {background-color: #FFFF0f;}
.cython.score-156 {background-color: #FFFF0f;}
.cython.score-157 {background-color: #FFFF0f;}
.cython.score-158 {background-color: #FFFF0f;}
.cython.score-159 {background-color: #FFFF0f;}
.cython.score-160 {background-color: #FFFF0f;}
.cython.score-161 {background-color: #FFFF0e;}
.cython.score-162 {background-color: #FFFF0e;}
.cython.score-163 {background-color: #FFFF0e;}
.cython.score-164 {background-color: #FFFF0e;}
.cython.score-165 {background-color: #FFFF0e;}
.cython.score-166 {background-color: #FFFF0e;}
.cython.score-167 {background-color: #FFFF0e;}
.cython.score-168 {background-color: #FFFF0e;}
.cython.score-169 {background-color: #FFFF0e;}
.cython.score-170 {background-color: #FFFF0e;}
.cython.score-171 {background-color: #FFFF0e;}
.cython.score-172 {background-color: #FFFF0e;}
.cython.score-173 {background-color: #FFFF0d;}
.cython.score-174 {background-color: #FFFF0d;}
.cython.score-175 {background-color: #FFFF0d;}
.cython.score-176 {background-color: #FFFF0d;}
.cython.score-177 {background-color: #FFFF0d;}
.cython.score-178 {background-color: #FFFF0d;}
.cython.score-179 {background-color: #FFFF0d;}
.cython.score-180 {background-color: #FFFF0d;}
.cython.score-181 {background-color: #FFFF0d;}
.cython.score-182 {background-color: #FFFF0d;}
.cython.score-183 {background-color: #FFFF0d;}
.cython.score-184 {background-color: #FFFF0d;}
.cython.score-185 {background-color: #FFFF0d;}
.cython.score-186 {background-color: #FFFF0d;}
.cython.score-187 {background-color: #FFFF0c;}
.cython.score-188 {background-color: #FFFF0c;}
.cython.score-189 {background-color: #FFFF0c;}
.cython.score-190 {background-color: #FFFF0c;}
.cython.score-191 {background-color: #FFFF0c;}
.cython.score-192 {background-color: #FFFF0c;}
.cython.score-193 {background-color: #FFFF0c;}
.cython.score-194 {background-color: #FFFF0c;}
.cython.score-195 {background-color: #FFFF0c;}
.cython.score-196 {background-color: #FFFF0c;}
.cython.score-197 {background-color: #FFFF0c;}
.cython.score-198 {background-color: #FFFF0c;}
.cython.score-199 {background-color: #FFFF0c;}
.cython.score-200 {background-color: #FFFF0c;}
.cython.score-201 {background-color: #FFFF0c;}
.cython.score-202 {background-color: #FFFF0c;}
.cython.score-203 {background-color: #FFFF0b;}
.cython.score-204 {background-color: #FFFF0b;}
.cython.score-205 {background-color: #FFFF0b;}
.cython.score-206 {background-color: #FFFF0b;}
.cython.score-207 {background-color: #FFFF0b;}
.cython.score-208 {background-color: #FFFF0b;}
.cython.score-209 {background-color: #FFFF0b;}
.cython.score-210 {background-color: #FFFF0b;}
.cython.score-211 {background-color: #FFFF0b;}
.cython.score-212 {background-color: #FFFF0b;}
.cython.score-213 {background-color: #FFFF0b;}
.cython.score-214 {background-color: #FFFF0b;}
.cython.score-215 {background-color: #FFFF0b;}
.cython.score-216 {background-color: #FFFF0b;}
.cython.score-217 {background-color: #FFFF0b;}
.cython.score-218 {background-color: #FFFF0b;}
.cython.score-219 {background-color: #FFFF0b;}
.cython.score-220 {background-color: #FFFF0b;}
.cython.score-221 {background-color: #FFFF0b;}
.cython.score-222 {background-color: #FFFF0a;}
.cython.score-223 {background-color: #FFFF0a;}
.cython.score-224 {background-color: #FFFF0a;}
.cython.score-225 {background-color: #FFFF0a;}
.cython.score-226 {background-color: #FFFF0a;}
.cython.score-227 {background-color: #FFFF0a;}
.cython.score-228 {background-color: #FFFF0a;}
.cython.score-229 {background-color: #FFFF0a;}
.cython.score-230 {background-color: #FFFF0a;}
.cython.score-231 {background-color: #FFFF0a;}
.cython.score-232 {background-color: #FFFF0a;}
.cython.score-233 {background-color: #FFFF0a;}
.cython.score-234 {background-color: #FFFF0a;}
.cython.score-235 {background-color: #FFFF0a;}
.cython.score-236 {background-color: #FFFF0a;}
.cython.score-237 {background-color: #FFFF0a;}
.cython.score-238 {background-color: #FFFF0a;}
.cython.score-239 {background-color: #FFFF0a;}
.cython.score-240 {background-color: #FFFF0a;}
.cython.score-241 {background-color: #FFFF0a;}
.cython.score-242 {background-color: #FFFF0a;}
.cython.score-243 {background-color: #FFFF0a;}
.cython.score-244 {background-color: #FFFF0a;}
.cython.score-245 {background-color: #FFFF0a;}
.cython.score-246 {background-color: #FFFF09;}
.cython.score-247 {background-color: #FFFF09;}
.cython.score-248 {background-color: #FFFF09;}
.cython.score-249 {background-color: #FFFF09;}
.cython.score-250 {background-color: #FFFF09;}
.cython.score-251 {background-color: #FFFF09;}
.cython.score-252 {background-color: #FFFF09;}
.cython.score-253 {background-color: #FFFF09;}
.cython.score-254 {background-color: #FFFF09;}
.cython .hll { background-color: #ffffcc }
.cython { background: #f8f8f8; }
.cython .c { color: #408080; font-style: italic } /* Comment */
.cython .err { border: 1px solid #FF0000 } /* Error */
.cython .k { color: #008000; font-weight: bold } /* Keyword */
.cython .o { color: #666666 } /* Operator */
.cython .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cython .cp { color: #BC7A00 } /* Comment.Preproc */
.cython .c1 { color: #408080; font-style: italic } /* Comment.Single */
.cython .cs { color: #408080; font-style: italic } /* Comment.Special */
.cython .gd { color: #A00000 } /* Generic.Deleted */
.cython .ge { font-style: italic } /* Generic.Emph */
.cython .gr { color: #FF0000 } /* Generic.Error */
.cython .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.cython .gi { color: #00A000 } /* Generic.Inserted */
.cython .go { color: #888888 } /* Generic.Output */
.cython .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.cython .gs { font-weight: bold } /* Generic.Strong */
.cython .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.cython .gt { color: #0044DD } /* Generic.Traceback */
.cython .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.cython .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.cython .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.cython .kp { color: #008000 } /* Keyword.Pseudo */
.cython .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.cython .kt { color: #B00040 } /* Keyword.Type */
.cython .m { color: #666666 } /* Literal.Number */
.cython .s { color: #BA2121 } /* Literal.String */
.cython .na { color: #7D9029 } /* Name.Attribute */
.cython .nb { color: #008000 } /* Name.Builtin */
.cython .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.cython .no { color: #880000 } /* Name.Constant */
.cython .nd { color: #AA22FF } /* Name.Decorator */
.cython .ni { color: #999999; font-weight: bold } /* Name.Entity */
.cython .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.cython .nf { color: #0000FF } /* Name.Function */
.cython .nl { color: #A0A000 } /* Name.Label */
.cython .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.cython .nt { color: #008000; font-weight: bold } /* Name.Tag */
.cython .nv { color: #19177C } /* Name.Variable */
.cython .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.cython .w { color: #bbbbbb } /* Text.Whitespace */
.cython .mb { color: #666666 } /* Literal.Number.Bin */
.cython .mf { color: #666666 } /* Literal.Number.Float */
.cython .mh { color: #666666 } /* Literal.Number.Hex */
.cython .mi { color: #666666 } /* Literal.Number.Integer */
.cython .mo { color: #666666 } /* Literal.Number.Oct */
.cython .sb { color: #BA2121 } /* Literal.String.Backtick */
.cython .sc { color: #BA2121 } /* Literal.String.Char */
.cython .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.cython .s2 { color: #BA2121 } /* Literal.String.Double */
.cython .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.cython .sh { color: #BA2121 } /* Literal.String.Heredoc */
.cython .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.cython .sx { color: #008000 } /* Literal.String.Other */
.cython .sr { color: #BB6688 } /* Literal.String.Regex */
.cython .s1 { color: #BA2121 } /* Literal.String.Single */
.cython .ss { color: #19177C } /* Literal.String.Symbol */
.cython .bp { color: #008000 } /* Name.Builtin.Pseudo */
.cython .vc { color: #19177C } /* Name.Variable.Class */
.cython .vg { color: #19177C } /* Name.Variable.Global */
.cython .vi { color: #19177C } /* Name.Variable.Instance */
.cython .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
<script>
function toggleDiv(id) {
theDiv = id.nextElementSibling
if (theDiv.style.display != 'block') theDiv.style.display = 'block';
else theDiv.style.display = 'none';
}
</script>
</head>
<body class="cython">
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 0.23.4</span></p>
<p>
<span style="background-color: #FFFF00">Yellow lines</span> hint at Python interaction.<br />
Click on a line that starts with a "<code>+</code>" to see the C code that Cython generated for it.
</p>
<p>Raw output: <a href="python35_header.pxi">python35_header.pxi</a></p>
<div class="cython"><pre class="cython line score-0">&#xA0;<span class="">1</span>: <span class="k">cdef</span> <span class="kr">extern</span> <span class="k">from</span> <span class="s">&quot;Python.h&quot;</span><span class="p">:</span></pre>
<pre class="cython line score-0">&#xA0;<span class="">2</span>: <span class="k">ctypedef</span> <span class="n">extern</span> <span class="k">class</span> <span class="nc">builtins</span><span class="o">.</span><span class="n">Exception</span><span class="p">[</span><span class="nb">object</span> <span class="n">PyBaseExceptionObject</span><span class="p">]:</span></pre>
<pre class="cython line score-0">&#xA0;<span class="">3</span>: <span class="k">pass</span></pre>
</div></body></html>

3
python35_header.pxi Normal file
View File

@@ -0,0 +1,3 @@
cdef extern from "Python.h":
ctypedef extern class builtins.Exception[object PyBaseExceptionObject]:
pass

13
python3z_header.pxi Normal file
View File

@@ -0,0 +1,13 @@
cdef extern from "Python.h":
ctypedef enum PyGILState_STATE:
PyGILState_LOCKED = 0
PyGILState_UNLOCKED = 1
void PyEval_InitThreads()
void Py_Initialize()
PyGILState_STATE PyGILState_Ensure()
void PyGILState_Release(PyGILState_STATE)
char* __FILE__
int __LINE__

46
setup_py310.py Normal file
View File

@@ -0,0 +1,46 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
#runtime_library_dirs do not override LD_LIBRARY_PATH!
_CAFE_VERSION='1.14.4'
_EPICS_VERSION='3.12.8'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/ioc/python/latest/include/python3.10',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-1.14.4-py310-gcc-9.3.0/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.14.4-py310-gcc-9.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/ioc/python/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/9.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/9.3.0/lib'
],
runtime_library_dirs=[os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.14.4-py310-gcc-9.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/ioc/python/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/9.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/9.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

53
setup_py310_sls2.py Normal file
View File

@@ -0,0 +1,53 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.5.0'
_CAFE_VERSION='1.19.3-py310-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.7'
_EPICS_HOST_ARCH =os.environ['RHREL'] + '-x86_64'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.10/latest/include/python3.10',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/gfa/python-3.10/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe', 'Qt5Xml', 'Qt5Core'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

52
setup_py34_sls2.py Normal file
View File

@@ -0,0 +1,52 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.15.0-py34-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.6'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/psi/Programming/psi-python34/2.1.0/include/python3.4m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + os.environ['EPICS_HOST_ARCH'],
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/psi/Programming/psi-python34/2.1.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + os.environ['EPICS_HOST_ARCH'],
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/psi/Programming/psi-python34/2.1.0/lib'
],
libraries=['ca','Com','dl','cafe', 'xml2'])
], annotate=True,
compile_time_env={'PY_VERSION_HEX': sys.hexversion, 'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION },
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False, 'remove_unreachable': False}
)
)

42
setup_py35.py Normal file
View File

@@ -0,0 +1,42 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-1.15.0-epics3-py35-gcc-7.3.0/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.15.0-epics3-py35-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/python-3.5/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.15.0-epics3-py35-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/python-3.5/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True}
)
)

56
setup_py35_sf.py Normal file
View File

@@ -0,0 +1,56 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_CAFE_VERSION='1.14.4'
_EPICS_VERSION='3.14.12'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION + '-sf-py35-gcc-7.3.0/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION + '-sf-py35-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.5/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION + '-sf-py35-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.5/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION }
)
)

52
setup_py35_sls.py Normal file
View File

@@ -0,0 +1,52 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.16.0-epics3-py35-gcc-' + _GCC_VERSION
_EPICS_VERSION='3.14.12'
_EPICS_HOST_ARCH=os.environ['RHREL'] +'-x86_64' #os.environ['EPICS_HOST_ARCH'] #'SL6-x86_64'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/gfa/python-3.5/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

52
setup_py35_sls2.py Normal file
View File

@@ -0,0 +1,52 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.19.3-py35-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.7'
_EPICS_HOST_ARCH=os.environ['RHREL'] +'-x86_64' #os.environ['EPICS_HOST_ARCH']
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

43
setup_py37.py Normal file
View File

@@ -0,0 +1,43 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
#runtime_library_dirs do not override LD_LIBRARY_PATH!
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.7/latest/include/python3.7m',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-1.13.0-py37-gcc-7.3.0/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.13.0-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-1.13.0-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True}
)
)

65
setup_py37_sf.py Normal file
View File

@@ -0,0 +1,65 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.19.3-sf-py37-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.6'
_EPICS_HOST_ARCH =os.environ['RHREL'] + '-x86_64'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.7/latest/include/python3.7m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib',
'/opt/gfa/python-3.7/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION}
)
)

60
setup_py37_sf_epics3.py Normal file
View File

@@ -0,0 +1,60 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_CAFE_VERSION='1.14.5'
_EPICS_VERSION='3.14.12'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.7/latest/include/python3.7m',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION}
)
)

59
setup_py37_sf_local.py Normal file
View File

@@ -0,0 +1,59 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_CAFE_VERSION='1.14.1'
_EPICS_VERSION='3.14.12'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.7/latest/include/python3.7m',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py37-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.7/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['Qt5Core', 'Qt5Xml', 'ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True ,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION}
)
)

53
setup_py37_sls.py Normal file
View File

@@ -0,0 +1,53 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.15.1-py35-gcc-' + _GCC_VERSION
_EPICS_VERSION='3.14.12'
_EPICS_HOST_ARCH ='RHEL7-x86_64' #os.environ['EPICS_HOST_ARCH']
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.5/latest/include/python3.5m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/gfa/python-3.5/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/'
+ _EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

53
setup_py37_sls2.py Normal file
View File

@@ -0,0 +1,53 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.3.0'
_CAFE_VERSION='1.19.3-py37-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.6'
_EPICS_HOST_ARCH =os.environ['RHREL'] + '-x86_64' #os.environ['EPICS_HOST_ARCH']
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.7/latest/include/python3.7m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/gfa/python-3.7/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

60
setup_py38_sf.py Normal file
View File

@@ -0,0 +1,60 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_CAFE_VERSION='1.14.4'
_EPICS_VERSION='3.14.12'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.8/latest/include/python3.8',
os.environ['EPICS'] + '/base/include',
os.environ['EPICS'] + '/base/include/os/Linux',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/include',
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/include',
'/opt/gfa/zmq/curl-7.54.1/include',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.8/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'-sf-py38-gcc-7.3.0/lib/' + os.environ['EPICS_HOST_ARCH'],
'/opt/gfa/zmq/zeromq-4.2.3-gcc-6.3.0/lib',
'/opt/gfa/zmsglog/json/jsoncpp-src-0.6.0-rc2/libs/linux-gcc-6.3.0',
'/opt/gfa/zmq/curl-7.54.1/lib',
'/opt/gfa/python-3.8/latest/lib',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/7.3.0/lib'
],
libraries=['ca','Com','dl','cafe'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': True,
'CAFE_VERSION': _CAFE_VERSION,
'EPICS_VERSION': _EPICS_VERSION}
)
)

53
setup_py38_sls2.py Normal file
View File

@@ -0,0 +1,53 @@
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Compiler.Main import default_options
default_options['emit_linenums'] = True
from Cython.Build import cythonize
from numpy import get_include
_GCC_VERSION='7.5.0'
_CAFE_VERSION='1.19.3-py38-gcc-' + _GCC_VERSION
_EPICS_VERSION='7.0.7'
_EPICS_HOST_ARCH =os.environ['RHREL'] + '-x86_64'
setup(
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
language="c++",
include_dirs=[ '/opt/gfa/python-3.8/latest/include/python3.8m',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/os/Linux',
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/include/compiler/gcc',
'/opt/gfa/cafe/boost/boost_1_61_0/include',
'/opt/gfa/cafe/boost/boost_1_61_0/include/boost',
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/include',
'.', get_include()],
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib',
'/opt/gfa/python-3.8/latest/lib'
],
runtime_library_dirs=[
os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
_EPICS_HOST_ARCH,
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
'/lib/' + _EPICS_HOST_ARCH,
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib64',
os.environ['PSI_PREFIX'] + '/Programming/gcc/' + _GCC_VERSION + '/lib'
],
libraries=['ca','Com','dl','cafe', 'Qt5Xml', 'Qt5Core'])
], annotate=True,
compiler_directives={'embedsignature': False, 'language_level': 3,
'c_string_type': 'str', 'c_string_encoding' : 'ascii',
'py2_import': False, 'warn.unreachable': False,
'remove_unreachable': False},
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
'PY_EXT_C': True, 'BS_CAFE': False,
'CAFE_VERSION': _CAFE_VERSION, 'EPICS_VERSION': _EPICS_VERSION }
)
)

45
test.py Normal file
View File

@@ -0,0 +1,45 @@
import time
import PyCafe
cafe = PyCafe.CyCafe()
cyca = PyCafe.CyCa()
PV1 = "ARIDI-BPM-01LE:X-AVG"
PV2 = "ARIDI-BPM-01LE:Y-AVG"
PV3 = "ARIDI-BPM-01SB:X-AVG"
def py_cb_single(handle, pv, pvdata):
print(handle, pv, pvdata.value[0])
def py_cb_group(handle, pv, pvdata):
print(handle, pv, pvdata.value[0])
#pvdata.show()
val, s, sl = cafe.getGroupCache('grp1')
print(val, s, sl)
GROUP_MONITOR_ALL = False
#Note that in this example PV1 is connected
#twice, once outside the group and once within
#the group
h1 = cafe.open(PV1)
monid = cafe.monitorStart(h1, py_cb_single)
cafe.defineGroup('grp1', [PV1, PV2, PV3])
gh1 = cafe.groupOpen('grp1')
if GROUP_MONITOR_ALL:
cafe.groupMonitorStart('grp1', py_cb_group)
else:
#Indices match [P1, PV2, PV3]
#So cbs provided for PV2 and PV3 only
cbList = [None, py_cb_group, py_cb_group]
s, sl = cafe.groupMonitorStartWithCBList('grp1', cbList)
print("status", s, sl)
for i in range(0, 5):
time.sleep(0.2)
cafe.printHandles()
cafe.terminate()