Compare commits
1 Commits
cafe-1.14.
...
cafe-1.16.
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c7be056d6 |
60
#setup_py38_sf.py#
Normal file
60
#setup_py38_sf.py#
Normal 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}
|
||||
)
|
||||
)
|
||||
73040
PyCafe.cpp
73040
PyCafe.cpp
File diff suppressed because it is too large
Load Diff
3
PyCafe.h
3
PyCafe.h
@@ -1,8 +1,9 @@
|
||||
/* Generated by Cython 0.29.2 */
|
||||
/* Generated by Cython 0.29.24 */
|
||||
|
||||
#ifndef __PYX_HAVE__PyCafe
|
||||
#define __PYX_HAVE__PyCafe
|
||||
|
||||
#include "Python.h"
|
||||
|
||||
#ifndef __PYX_HAVE_API__PyCafe
|
||||
|
||||
|
||||
40241
PyCafe.html
40241
PyCafe.html
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
PyCafe_sf.pxd
|
||||
PyCafe_sls.pxd
|
||||
@@ -1 +1 @@
|
||||
PyCafe_sf.pyx
|
||||
PyCafe_sls.pyx
|
||||
1883
PyCafeDefs.html
1883
PyCafeDefs.html
File diff suppressed because it is too large
Load Diff
1407
PyCafeDefs.pxi
1407
PyCafeDefs.pxi
File diff suppressed because it is too large
Load Diff
1
PyCafeDefs.pxi
Symbolic link
1
PyCafeDefs.pxi
Symbolic link
@@ -0,0 +1 @@
|
||||
PyCafeDefs_py37.pxi
|
||||
1456
PyCafeDefs.pxi++++
Normal file
1456
PyCafeDefs.pxi++++
Normal file
File diff suppressed because it is too large
Load Diff
1456
PyCafeDefs_all.pxi
Normal file
1456
PyCafeDefs_all.pxi
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by Cython 0.29.2 -->
|
||||
<!-- Generated by Cython 0.29.24 -->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
@@ -286,8 +286,13 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
.cython.score-252 {background-color: #FFFF09;}
|
||||
.cython.score-253 {background-color: #FFFF09;}
|
||||
.cython.score-254 {background-color: #FFFF09;}
|
||||
pre { line-height: 125%; }
|
||||
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
.cython .hll { background-color: #ffffcc }
|
||||
.cython { background: #f8f8f8; }
|
||||
.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 */
|
||||
@@ -358,7 +363,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="cython">
|
||||
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 0.29.2</span></p>
|
||||
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 0.29.24</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.
|
||||
@@ -436,7 +441,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
}
|
||||
__pyx_t_1 = (__pyx_t_3) ? <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_2, __pyx_t_3) : <span class='pyx_c_api'>__Pyx_PyObject_CallNoArg</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(0, 13, __pyx_L1_error)</span>
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(3, 13, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
@@ -507,7 +512,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<pre class="cython line score-0"> <span class="">023</span>: <span class="k">global</span> <span class="n">py_cb</span></pre>
|
||||
<pre class="cython line score-0"> <span class="">024</span>: <span class="c">#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(1)= Handle/PVNAME :", handle, pvname) </span></pre>
|
||||
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">025</span>: <span class="k">cdef</span> <span class="kt">pvdata</span> <span class="nf">data</span> <span class="o">=</span> <span class="n">PVDataHolderToStruct</span><span class="p">(</span><span class="n">pvd</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-0 '> __pyx_t_1 = ((PyObject *)__pyx_f_6PyCafe_PVDataHolderToStruct(__pyx_v_pvd, NULL));<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-0 '> __pyx_t_1 = ((PyObject *)__pyx_f_6PyCafe_PVDataHolderToStruct(__pyx_v_pvd, NULL));<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
__pyx_v_data = ((struct __pyx_obj_6PyCafe_pvdata *)__pyx_t_1);
|
||||
__pyx_t_1 = 0;
|
||||
@@ -515,7 +520,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<pre class="cython line score-7" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">027</span>: <span class="n">py_cb</span> <span class="o">=</span> <span class="p"><</span><span class="kt">object</span><span class="p">>(</span><span class="o"><</span><span class="n">void</span> <span class="o">*></span> <span class="n">callback</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-7 '> __pyx_t_1 = ((PyObject *)((void *)__pyx_v_callback));
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_t_1);
|
||||
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_py_cb, __pyx_t_1) < 0) <span class='error_goto'>__PYX_ERR(0, 27, __pyx_L1_error)</span>
|
||||
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_py_cb, __pyx_t_1) < 0) <span class='error_goto'>__PYX_ERR(3, 27, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-0"> <span class="">028</span>: <span class="c">#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVDATA++++++(2)= Handle/PVNAME :", handle, pvname)</span></pre>
|
||||
<pre class="cython line score-0"> <span class="">029</span>: <span class="k">cdef</span> <span class="kt">HandleHelper</span> <span class="nf">hh</span></pre>
|
||||
@@ -524,11 +529,11 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
</pre><pre class="cython line score-0"> <span class="">031</span>: <span class="c">#print("monitorId", mpid)</span></pre>
|
||||
<pre class="cython line score-0"> <span class="">032</span>: <span class="c">#monDictGlobal[mpid](handle, pvname, data)</span></pre>
|
||||
<pre class="cython line score-48" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">033</span>: <span class="p"><</span><span class="kt">object</span><span class="p">></span><span class="n">py_cb</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span> <span class="n">pvname</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-48 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_2, __pyx_n_s_py_cb);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-48 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_2, __pyx_n_s_py_cb);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
||||
__pyx_t_4 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_4 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
|
||||
__pyx_t_5 = NULL;
|
||||
__pyx_t_6 = 0;
|
||||
@@ -545,7 +550,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCALL
|
||||
if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_2)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_data)};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
@@ -555,7 +560,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCCALL
|
||||
if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_2)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_data)};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
@@ -563,7 +568,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
|
||||
if (__pyx_t_5) {
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_5); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
||||
@@ -577,7 +582,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_data));
|
||||
__pyx_t_3 = 0;
|
||||
__pyx_t_4 = 0;
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_2, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 33, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
|
||||
}
|
||||
@@ -655,7 +660,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<pre class="cython line score-0"> <span class="">047</span>: </pre>
|
||||
<pre class="cython line score-0"> <span class="">048</span>: <span class="c">#print(" cy_data_event_handler_wrapper=====+++++++++++++++PVCTRL++++++= Handle/PVNAME :", handle, pvname)</span></pre>
|
||||
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">049</span>: <span class="k">cdef</span> <span class="kt">pvctrl</span> <span class="nf">data</span> <span class="o">=</span> <span class="n">PVCtrlHolderToStruct</span><span class="p">(</span><span class="n">pvc</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-0 '> __pyx_t_1 = ((PyObject *)__pyx_f_6PyCafe_PVCtrlHolderToStruct(__pyx_v_pvc, NULL));<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-0 '> __pyx_t_1 = ((PyObject *)__pyx_f_6PyCafe_PVCtrlHolderToStruct(__pyx_v_pvc, NULL));<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 49, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
__pyx_v_data = ((struct __pyx_obj_6PyCafe_pvctrl *)__pyx_t_1);
|
||||
__pyx_t_1 = 0;
|
||||
@@ -665,9 +670,9 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_v_cbobjt = __pyx_t_1;
|
||||
__pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-47" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">051</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span> <span class="n">pvname</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-47 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-47 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_4 = __pyx_v_cbobjt; __pyx_t_5 = NULL;
|
||||
@@ -685,7 +690,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCALL
|
||||
if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_data)};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
@@ -695,7 +700,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCCALL
|
||||
if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_data)};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
@@ -703,7 +708,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
|
||||
if (__pyx_t_5) {
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_5); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
||||
@@ -717,7 +722,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_data));
|
||||
__pyx_t_2 = 0;
|
||||
__pyx_t_3 = 0;
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
|
||||
}
|
||||
@@ -792,9 +797,9 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-0"> <span class="">062</span>: <span class="c">#cbobjt=<object>args[0]</span></pre>
|
||||
<pre class="cython line score-45" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">063</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span> <span class="n">pvname</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-45 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-45 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
__pyx_t_3 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_4 = __pyx_v_cbobjt; __pyx_t_5 = NULL;
|
||||
@@ -812,7 +817,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCALL
|
||||
if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_4)) {
|
||||
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
@@ -822,7 +827,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCCALL
|
||||
if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_4)) {
|
||||
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_3};
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
@@ -830,7 +835,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
__pyx_t_7 = <span class='py_c_api'>PyTuple_New</span>(2+__pyx_t_6);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
|
||||
if (__pyx_t_5) {
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_5); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
|
||||
@@ -841,7 +846,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
|
||||
__pyx_t_2 = 0;
|
||||
__pyx_t_3 = 0;
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_4, __pyx_t_7, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 63, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
|
||||
}
|
||||
@@ -913,7 +918,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_v_cbobjt = __pyx_t_1;
|
||||
__pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-19" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">074</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 74, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_3 = __pyx_v_cbobjt; __pyx_t_4 = NULL;
|
||||
@@ -929,7 +934,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(0, 74, __pyx_L1_error)</span>
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(3, 74, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
@@ -1008,11 +1013,11 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_v_cbobjt = __pyx_t_2;
|
||||
__pyx_t_2 = 0;
|
||||
</pre><pre class="cython line score-50" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">087</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">,</span> <span class="n">pvname</span><span class="p">,</span> <span class="n">status</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-50 '> __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-50 '> __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
||||
__pyx_t_4 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_4 = <span class='pyx_c_api'>__pyx_convert_PyStr_string_to_py_std__in_string</span>(__pyx_v_pvname);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
|
||||
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_status);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyInt_From_int</span>(__pyx_v_status);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_6 = __pyx_v_cbobjt; __pyx_t_7 = NULL;
|
||||
@@ -1030,7 +1035,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCALL
|
||||
if (<span class='py_c_api'>PyFunction_Check</span>(__pyx_t_6)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyFunction_FastCall</span>(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
@@ -1041,7 +1046,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#if CYTHON_FAST_PYCCALL
|
||||
if (<span class='pyx_c_api'>__Pyx_PyFastCFunction_Check</span>(__pyx_t_6)) {
|
||||
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyCFunction_FastCall</span>(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
@@ -1050,7 +1055,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
__pyx_t_9 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_9 = <span class='py_c_api'>PyTuple_New</span>(3+__pyx_t_8);<span class='error_goto'> if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_9);
|
||||
if (__pyx_t_7) {
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_7); <span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
|
||||
@@ -1064,7 +1069,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_t_3 = 0;
|
||||
__pyx_t_4 = 0;
|
||||
__pyx_t_5 = 0;
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_6, __pyx_t_9, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)</span>
|
||||
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_t_6, __pyx_t_9, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_9); __pyx_t_9 = 0;
|
||||
}
|
||||
@@ -1128,9 +1133,9 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
#endif
|
||||
}
|
||||
</pre><pre class="cython line score-14" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">094</span>: <span class="k">print</span><span class="p">(</span><span class="s">" py_cb_handle_get_wrapper+++++++++++++GET++++++++++= Handle:"</span><span class="p">,</span> <span class="n">handle</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-14 '> __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-14 '> __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 94, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
__pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(2);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)</span>
|
||||
__pyx_t_2 = <span class='py_c_api'>PyTuple_New</span>(2);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 94, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_kp_u_py_cb_handle_get_wrapper_GET_Ha);
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_kp_u_py_cb_handle_get_wrapper_GET_Ha);
|
||||
@@ -1138,7 +1143,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_t_1);
|
||||
<span class='py_macro_api'>PyTuple_SET_ITEM</span>(__pyx_t_2, 1, __pyx_t_1);
|
||||
__pyx_t_1 = 0;
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_2, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)</span>
|
||||
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_print, __pyx_t_2, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 94, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
@@ -1148,7 +1153,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_v_cbobjt = __pyx_t_1;
|
||||
__pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-19" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">096</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 96, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_3 = __pyx_v_cbobjt; __pyx_t_4 = NULL;
|
||||
@@ -1164,7 +1169,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(0, 96, __pyx_L1_error)</span>
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(3, 96, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
@@ -1231,7 +1236,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_v_cbobjt = __pyx_t_1;
|
||||
__pyx_t_1 = 0;
|
||||
</pre><pre class="cython line score-19" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">104</span>: <span class="n">cbobjt</span><span class="p">(</span><span class="n">handle</span><span class="p">)</span></pre>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)</span>
|
||||
<pre class='cython code score-19 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyInt_From_unsigned_int</span>(__pyx_v_handle);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 104, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_cbobjt);
|
||||
__pyx_t_3 = __pyx_v_cbobjt; __pyx_t_4 = NULL;
|
||||
@@ -1247,7 +1252,7 @@ body.cython { font-family: courier; font-size: 12; }
|
||||
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : <span class='pyx_c_api'>__Pyx_PyObject_CallOneArg</span>(__pyx_t_3, __pyx_t_2);
|
||||
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(0, 104, __pyx_L1_error)</span>
|
||||
if (unlikely(!__pyx_t_1)) <span class='error_goto'>__PYX_ERR(3, 104, __pyx_L1_error)</span>
|
||||
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
||||
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
||||
|
||||
1456
PyCafeDefs_py35.pxi
Normal file
1456
PyCafeDefs_py35.pxi
Normal file
File diff suppressed because it is too large
Load Diff
1456
PyCafeDefs_py37.pxi
Normal file
1456
PyCafeDefs_py37.pxi
Normal file
File diff suppressed because it is too large
Load Diff
7018
PyCafeDefs_sf.html
7018
PyCafeDefs_sf.html
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
||||
|
||||
# define threshold
|
||||
cdef int PYCAFE_PRINT_HIGH = 9
|
||||
cdef int PYCAFE_PRINT_MED = 5
|
||||
@@ -7,7 +6,6 @@ cdef int PYCAFE_PRINT_NONE = 0
|
||||
|
||||
cdef int PYCAFE_PRINT_LEVEL = PYCAFE_PRINT_NONE
|
||||
|
||||
|
||||
#ctypedef shared_ptr[vector[double]] vdouble_ptr
|
||||
#ctypedef shared_ptr[vector[float]] vfloat_ptr
|
||||
|
||||
|
||||
@@ -631,6 +631,7 @@ cdef extern from "policies.h":
|
||||
MonitorPolicy()
|
||||
unsigned int getMonitorID()
|
||||
void setMask(unsigned int)
|
||||
void setNelem(unsigned int)
|
||||
void setDataType(chtype)
|
||||
void setCafeDbrType(DBR_TYPE)
|
||||
void setHandler(pCallback)
|
||||
@@ -1203,6 +1204,9 @@ cdef extern from "cafe.h":
|
||||
|
||||
PolicyHelper getPolicyHelper()
|
||||
HandleHelper getHandleHelper()
|
||||
|
||||
string _epics_version() nogil
|
||||
string _ca_version() nogil
|
||||
|
||||
int _ca_pend_io(double) nogil
|
||||
int _ca_pend_event(double) nogil
|
||||
|
||||
103
PyCafe_sf.pyx
103
PyCafe_sf.pyx
@@ -215,6 +215,7 @@ cdef class CyCafe:
|
||||
self.isBSinCAOnly = False
|
||||
|
||||
print("PY_VERSION_HEX is ", hex(PY_VERSION_HEX))
|
||||
print("numpy version is ", np.version.version)
|
||||
|
||||
IF PY_EXT_C:
|
||||
print("USING PUBLIC PyCafe.h INTERFACE FOR CALLBACKS")
|
||||
@@ -232,6 +233,12 @@ cdef class CyCafe:
|
||||
|
||||
###########################################################################
|
||||
|
||||
def ca_version(self):
|
||||
return self._c_cafe._ca_version()
|
||||
|
||||
def epics_version_string(self):
|
||||
return self._c_cafe._epics_version()
|
||||
|
||||
def CAFE_version(self):
|
||||
return CAFE_VERSION
|
||||
|
||||
@@ -1039,16 +1046,16 @@ cdef class CyCafe:
|
||||
############################################################################
|
||||
def loadCollectionsFromXML(self, const char * fileName):
|
||||
with nogil:
|
||||
self._c_cafe.loadCollectionsFromXML(fileName)
|
||||
return
|
||||
status = self._c_cafe.loadCollectionsFromXML(fileName)
|
||||
return status
|
||||
############################################################################
|
||||
|
||||
############################################################################
|
||||
|
||||
def loadGroupsFromXML(self, const char * fileName):
|
||||
with nogil:
|
||||
self._c_cafe.loadGroupsFromXML(fileName)
|
||||
return
|
||||
status = self._c_cafe.loadGroupsFromXML(fileName)
|
||||
return status
|
||||
############################################################################
|
||||
|
||||
def devicePositionMap(self, const char * collectionName):
|
||||
@@ -2308,7 +2315,8 @@ cdef class CyCafe:
|
||||
raise _cafeException
|
||||
return [None]
|
||||
|
||||
cdef unsigned int dtcheck = dtr
|
||||
#JC Feb 2022 must be int as CAFE_TYPENOTCONN is -1
|
||||
cdef int dtcheck = dtr
|
||||
dtcheck = getMatchedDataType(dt, dtr)
|
||||
|
||||
#print ("dtcheck input/native", dtcheck, dt, dtr)
|
||||
@@ -3247,7 +3255,7 @@ cdef class CyCafe:
|
||||
cdef int status
|
||||
|
||||
if cacheFlag:
|
||||
status = self._c_cafe.getCachePVArray(v, pvd)
|
||||
status = self._c_cafe.getCachePVArray(v, pvd)
|
||||
else:
|
||||
with nogil:
|
||||
status = self._c_cafe.getPVArray(v, pvd)
|
||||
@@ -4340,30 +4348,31 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
status = self._c_cafe.getCacheVStr(v, self.vStr, vStatus)
|
||||
|
||||
#warning: __pyx_v_i may be used uninitialized in this function
|
||||
bytesVal = <bytes> (<string> self.vStr[i] )
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(v[i]):
|
||||
try:
|
||||
strVal = (bytesVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-8')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-16')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
strVal = <string> self.vStr[i]
|
||||
for i in range(0, len(v)):
|
||||
bytesVal = <bytes> (<string> self.vStr[i] )
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(v[i]):
|
||||
try:
|
||||
strVal = (bytesVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-8')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-16')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
strVal = <string> self.vStr[i]
|
||||
|
||||
localList.append(strVal)
|
||||
localList.append(strVal)
|
||||
|
||||
return localList, status, vStatus
|
||||
|
||||
@@ -4923,7 +4932,7 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(handle):
|
||||
try:
|
||||
strVal = (bVal).decode('latin-1')
|
||||
valStr = (bVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -5548,19 +5557,19 @@ First input argument, should be of type <class 'int'> if handle, else <class 'st
|
||||
sig = inspect.signature(cb)
|
||||
# a=inspect.getargspec(cb)
|
||||
|
||||
mp.setUserArgs(< void * > mpid)
|
||||
mp.setNoCyCallbackParameters(len(sig.parameters))
|
||||
mp.setPyCyHandler(<void *> cb)
|
||||
mp[i].setUserArgs(< void * > mpid)
|
||||
mp[i].setNoCyCallbackParameters(len(sig.parameters))
|
||||
mp[i].setPyCyHandler(<void *> cb)
|
||||
|
||||
|
||||
print('============//1//')
|
||||
print('SIGNATURE:')
|
||||
print(str(sig))
|
||||
for param in sig.parameters.values():
|
||||
print('Parameter:', param)
|
||||
print('len1', len(sig.parameters.values()))
|
||||
print('len2', len(sig.parameters))
|
||||
print('monitor id', mpid)
|
||||
#print('============//1//')
|
||||
#print('SIGNATURE:')
|
||||
#print(str(sig))
|
||||
#for param in sig.parameters.values():
|
||||
# print('Parameter:', param)
|
||||
#print('len1', len(sig.parameters.values()))
|
||||
#print('len2', len(sig.parameters))
|
||||
#print('monitor id', mpid)
|
||||
|
||||
mpV.push_back(mp[i])
|
||||
|
||||
@@ -6443,6 +6452,7 @@ No of group members doe not match the length of callback object list")
|
||||
def monitorStart(
|
||||
self, handlePV, cb: object = None, DBR_TYPE dbr=DBR_TIME,
|
||||
unsigned int mask=DBE_VALUE | DBE_LOG | DBE_ALARM,
|
||||
unsigned int nelem=0,
|
||||
unsigned short notify_milliseconds=0):
|
||||
|
||||
_METHOD = "monitorStart(handlePV, object cb=None, \
|
||||
@@ -6484,6 +6494,11 @@ No of group members doe not match the length of callback object list")
|
||||
|
||||
# For setUserArgs pass the address of the variable.
|
||||
|
||||
|
||||
#Default is native number
|
||||
if nelem:
|
||||
mp.setNelem(nelem)
|
||||
|
||||
mp.setMask(mask)
|
||||
mp.setNotifyDeltaMilliSeconds(notify_milliseconds)
|
||||
|
||||
@@ -6877,7 +6892,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_8')
|
||||
encoding = True
|
||||
print('utf-8')
|
||||
|
||||
vecS.push_back(temp.encode('utf_8'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -6885,7 +6900,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_16')
|
||||
encoding = True
|
||||
print('utf-16')
|
||||
|
||||
vecS.push_back(<string>temp.encode('utf_16').decode('utf_16'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -6893,7 +6908,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_32')
|
||||
encoding = True
|
||||
print('utf-32')
|
||||
|
||||
vecS.push_back(temp.encode('utf_32'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
@@ -41,6 +41,13 @@ cdef extern from "<map>" namespace "std":
|
||||
pair[iterator, bint] insert(pair[T, U]) nogil
|
||||
iterator find(T & ) nogil
|
||||
|
||||
|
||||
cdef extern from "epicsMutex.h":
|
||||
ctypedef LIBCOM_API epicsMutex
|
||||
cdef cppclass LIBCOM_API:
|
||||
pass
|
||||
|
||||
|
||||
cdef extern from "cadef.h":
|
||||
|
||||
ctypedef long chtype
|
||||
@@ -631,6 +638,7 @@ cdef extern from "policies.h":
|
||||
MonitorPolicy()
|
||||
unsigned int getMonitorID()
|
||||
void setMask(unsigned int)
|
||||
void setNelem(unsigned int)
|
||||
void setDataType(chtype)
|
||||
void setCafeDbrType(DBR_TYPE)
|
||||
void setHandler(pCallback)
|
||||
@@ -1118,6 +1126,8 @@ cdef extern from "cafe.h":
|
||||
PolicyHelper getPolicyHelper()
|
||||
HandleHelper getHandleHelper()
|
||||
|
||||
string _epics_version() nogil
|
||||
string _ca_version() nogil
|
||||
int _ca_pend_io(double) nogil
|
||||
int _ca_pend_event(double) nogil
|
||||
int _ca_flush_io() nogil
|
||||
@@ -1203,6 +1213,8 @@ cdef extern from "cafe.h":
|
||||
|
||||
string getChannelIDAsString(chid)
|
||||
|
||||
int wfExpress(const unsigned int handle, const unsigned int, dbr_char_t *)
|
||||
|
||||
int getWFAsString(unsigned int, string &) nogil
|
||||
int getWFAsStringCache(unsigned int, string &)
|
||||
|
||||
@@ -1210,6 +1222,7 @@ cdef extern from "cafe.h":
|
||||
int getCacheFloatArray(unsigned int, float *)
|
||||
int getCacheDoubleArray(unsigned int, double *)
|
||||
int getCacheShortArray(unsigned int, short * )
|
||||
int getCacheCharArray(unsigned int, dbr_char_t * )
|
||||
int getCacheLongArray(unsigned int, int * )
|
||||
int getCacheStringArray(unsigned int, string * )
|
||||
int getCacheDbrStringArray(unsigned int, dbr_string_t[])
|
||||
|
||||
488
PyCafe_sls.pyx
488
PyCafe_sls.pyx
@@ -33,6 +33,9 @@ from cython.operator cimport dereference as deref
|
||||
from cython.operator cimport preincrement as inc
|
||||
from cython.view cimport array as cvarray
|
||||
from cpython cimport array
|
||||
from cpython.object cimport PyObject
|
||||
from cpython.ref cimport Py_INCREF
|
||||
|
||||
from libc.stdlib cimport malloc, free
|
||||
|
||||
cimport numpy as cnp
|
||||
@@ -49,6 +52,37 @@ _python_version = sys.version_info #[0:4]
|
||||
|
||||
cdef dict hmd = {}
|
||||
|
||||
#needed to initialize PyArray_API in order to be able to use it
|
||||
cnp.import_array()
|
||||
|
||||
|
||||
cdef class MemoryNanny:
|
||||
cdef void* ptr # set to NULL by "constructor"
|
||||
def __dealloc__(self):
|
||||
print("freeing ptr=", <unsigned long long>(self.ptr)) #just for debugging
|
||||
free(self.ptr)
|
||||
|
||||
@staticmethod
|
||||
cdef create(void* ptr):
|
||||
cdef MemoryNanny result = MemoryNanny()
|
||||
result.ptr = ptr
|
||||
print("nanny for ptr=", <unsigned long long>(result.ptr)) #just for debugging
|
||||
return result
|
||||
|
||||
cdef extern from "numpy/arrayobject.h":
|
||||
# a little bit awkward: the reference to obj will be stolen
|
||||
# using PyObject* to signal that Cython cannot handle it automatically
|
||||
int PyArray_SetBaseObject(cnp.ndarray arr, PyObject *obj) except -1 # -1 means there was an error
|
||||
|
||||
cdef array_from_ptr(void * ptr, cnp.npy_intp N, int np_type):
|
||||
#start = time.time()
|
||||
cdef cnp.ndarray arr = cnp.PyArray_SimpleNewFromData(1, &N, np_type, ptr)
|
||||
nanny = MemoryNanny.create(ptr)
|
||||
Py_INCREF(nanny) # a reference will get stolen, so prepare nanny
|
||||
PyArray_SetBaseObject(arr, <PyObject*>nanny)
|
||||
#print("array_from_ptr", time.time() - start)
|
||||
return arr
|
||||
|
||||
include "PyCafeDefs.pxi"
|
||||
|
||||
def verify_handlepv(func):
|
||||
@@ -170,7 +204,6 @@ cdef class CyCafe:
|
||||
|
||||
ChannelRegalia channelInfo
|
||||
# PyGILState_STATE gstate
|
||||
|
||||
|
||||
###########################################################################
|
||||
def __cinit__(self):
|
||||
@@ -222,7 +255,28 @@ cdef class CyCafe:
|
||||
del self._c_cafe
|
||||
|
||||
###########################################################################
|
||||
|
||||
|
||||
@verify_handlepv
|
||||
def get_wf_express(self, handlePV, nelem):
|
||||
print("get_wf_express")
|
||||
|
||||
#'''
|
||||
valCharArray = <dbr_char_t * > malloc(nelem * sizeof(dbr_char_t))
|
||||
status = self._c_cafe.wfExpress(handlePV, nelem, valCharArray)
|
||||
#print("status", status, valCharArray[0])
|
||||
mvUInt8n = np.empty(nelem, dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelem):
|
||||
mvUInt8n[ij] = <cnp.uint8_t > valCharArray[ij]
|
||||
free(valCharArray)
|
||||
|
||||
return mvUInt8n
|
||||
#'''
|
||||
|
||||
def ca_version(self):
|
||||
return self._c_cafe._ca_version()
|
||||
|
||||
def epics_version_string(self):
|
||||
return self._c_cafe._epics_version()
|
||||
def CAFE_version(self):
|
||||
return CAFE_VERSION
|
||||
|
||||
@@ -1029,18 +1083,18 @@ cdef class CyCafe:
|
||||
|
||||
|
||||
############################################################################
|
||||
def loadCollectionsFromXML(self, const char * fileName):
|
||||
with nogil:
|
||||
self._c_cafe.loadCollectionsFromXML(fileName)
|
||||
return
|
||||
#def loadCollectionsFromXML(self, const char * fileName):
|
||||
# with nogil:
|
||||
# status = self._c_cafe.loadCollectionsFromXML(fileName)
|
||||
# return status
|
||||
############################################################################
|
||||
|
||||
############################################################################
|
||||
|
||||
def loadGroupsFromXML(self, const char * fileName):
|
||||
with nogil:
|
||||
self._c_cafe.loadGroupsFromXML(fileName)
|
||||
return
|
||||
#def loadGroupsFromXML(self, const char * fileName):
|
||||
# with nogil:
|
||||
# status = self._c_cafe.loadGroupsFromXML(fileName)
|
||||
# return status
|
||||
############################################################################
|
||||
|
||||
def devicePositionMap(self, const char * collectionName):
|
||||
@@ -1824,7 +1878,7 @@ cdef class CyCafe:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#PyCafeException = self.prepareCafeException(
|
||||
# status, _METHOD, handle=handle)
|
||||
##FOR TESTINg raise PyCafeException
|
||||
@@ -1902,12 +1956,12 @@ cdef class CyCafe:
|
||||
|
||||
############################################################################
|
||||
|
||||
def loadSFGroups(self):
|
||||
cdef str VA = 'VA'
|
||||
return self._c_cafe.loadSFGroups(<string> VA)
|
||||
#def loadSFGroups(self):
|
||||
# cdef str VA = 'VA'
|
||||
# return self._c_cafe.loadSFGroups(<string> VA)
|
||||
|
||||
def loadSFGroupsWithBase(self, str VA):
|
||||
return self._c_cafe.loadSFGroups(<string> VA)
|
||||
#def loadSFGroupsWithBase(self, str VA):
|
||||
# return self._c_cafe.loadSFGroups(<string> VA)
|
||||
|
||||
|
||||
############################################################################
|
||||
@@ -2141,7 +2195,7 @@ cdef class CyCafe:
|
||||
and dtr in [DBR_CHAR] and dt in ['str']:
|
||||
return self.getWFAsString(handle)
|
||||
|
||||
cdef unsigned int dtcheck = dtr
|
||||
cdef int dtcheck = dtr
|
||||
dtcheck = getMatchedDataType(dt, dtr)
|
||||
|
||||
cdef bytes bVal
|
||||
@@ -2298,7 +2352,8 @@ cdef class CyCafe:
|
||||
raise _cafeException
|
||||
return [None]
|
||||
|
||||
cdef unsigned int dtcheck = dtr
|
||||
#JC FEB 2022 must be int as CAFE_TYPENOTCONN is -1
|
||||
cdef int dtcheck = dtr
|
||||
dtcheck = getMatchedDataType(dt, dtr)
|
||||
|
||||
#print ("dtcheck input/native", dtcheck, dt, dtr)
|
||||
@@ -2539,6 +2594,7 @@ cdef class CyCafe:
|
||||
# the last dimension has a unitary stride, i.e., is contiguous in memory,
|
||||
# hence C contiguous.
|
||||
|
||||
##start = time.time()
|
||||
cdef str _METHOD = "getArray"
|
||||
cdef unsigned int handle = handlePV
|
||||
'''
|
||||
@@ -2555,7 +2611,8 @@ cdef class CyCafe:
|
||||
'''
|
||||
cdef:
|
||||
short * i16val
|
||||
|
||||
dbr_char_t * ui8val
|
||||
cvarray cvarr
|
||||
int * ival
|
||||
double * dval
|
||||
float * fval
|
||||
@@ -2652,7 +2709,7 @@ cdef class CyCafe:
|
||||
|
||||
#print('native', self.hh.getNelemNative(handle))
|
||||
#print('client', self.hh.getNelemClient(handle))
|
||||
# print('request',self.hh.getNelemRequest(handle))
|
||||
#print('request',self.hh.getNelemRequest(handle))
|
||||
|
||||
#print ('dtcheck', dtcheck)
|
||||
|
||||
@@ -2662,6 +2719,9 @@ cdef class CyCafe:
|
||||
|
||||
cdef bytes bVal
|
||||
|
||||
##end = time.time()
|
||||
##print ("PRE-AMBLE", end - start)
|
||||
|
||||
if dtcheck in [CAFE_STRING, CAFE_ENUM]:
|
||||
sval = < char[40]* > malloc(nelemMemory * sizeof(dbr_string_t))
|
||||
with nogil:
|
||||
@@ -2757,7 +2817,115 @@ cdef class CyCafe:
|
||||
|
||||
return mvStr
|
||||
|
||||
elif dtcheck in [CAFE_SHORT, CAFE_CHAR]:
|
||||
elif dtcheck in [CAFE_CHAR]:
|
||||
|
||||
|
||||
##start=time.time()
|
||||
ui8val = <dbr_char_t * >malloc(nelemMemory * sizeof(np.uint8))
|
||||
|
||||
with nogil:
|
||||
status = self._c_cafe.getCharArray(handle, ui8val)
|
||||
##end=time.time()
|
||||
##print ("END TIME CHAR", end - start)
|
||||
##print("length of ui8val", len(ui8val))
|
||||
|
||||
#print('native', self.hh.getNelemNative(handle))
|
||||
#print('client', self.hh.getNelemClient(handle))
|
||||
#print('request',self.hh.getNelemRequest(handle))
|
||||
|
||||
|
||||
#nelemMethod = min(len(ui8val), nelemMemory)
|
||||
if status == ICAFE_NORMAL:
|
||||
# np.empty preferred, else mvInt does not get correct value for first couple of array elements
|
||||
|
||||
if art in ['numpy', 'ndarray', 'numpy.ndarray', 'np', 'np.ndarray']:
|
||||
|
||||
if dt in ['np.short', 'np.int16', 'short', 'int16']:
|
||||
mvShort = np.empty(
|
||||
nelemMethod, dtype=np.int16, order='C')
|
||||
for ij in range(0, nelemMethod):
|
||||
mvShort[ij] = <cnp.int16_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
return np.array(mvShort)
|
||||
|
||||
elif dt in ['np.int8', 'np.bool_', 'np.byte', 'bool', 'byte', 'int8']:
|
||||
mvInt8 = np.empty(
|
||||
nelemMethod, dtype=np.int8, order='C')
|
||||
#for ij in range(0, nelemMethod):
|
||||
# mvInt8[ij] = <cnp.int8_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
return mvInt8 #np.array(mvInt8)
|
||||
|
||||
elif dt in ['uchar', 'np.uint8', 'uint8']:
|
||||
#https://stackoverflow.com/questions/21851985/difference-between-np-int-np-int-int-and-np-int-t-in-cython
|
||||
#https://stackoverflow.com/questions/25102409/c-malloc-array-pointer-return-in-cython
|
||||
#https://stackoverflow.com/questions/23872946/force-numpy-ndarray-to-take-ownership-of-its-memory-in-cython
|
||||
#Alterantive copy methods are not faster than the for loop! 0.05 seconds added to ca read time of 0.14s 1.4 million elements
|
||||
#'''
|
||||
mvUInt8n = np.empty(
|
||||
nelemMethod, dtype=np.uint8) # order='C')
|
||||
##start = time.time()
|
||||
for ij in range(0, nelemMethod):
|
||||
mvUInt8n[ij] = <cnp.uint8_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
##print("Conversion time", time.time()-start)
|
||||
return mvUInt8n ##np.array(ui8val) #mvUInt8n #ui8val #np.array(mvUInt8)
|
||||
#'''
|
||||
#cvarr = <cnp.uint8_t *> ui8val
|
||||
#cvarr.free_data = True
|
||||
#free(ui8val)
|
||||
#return np.asarray(cvarr)
|
||||
#mvUInt8 = array_from_ptr(ui8val, nelemMethod, cnp.NPY_UINT8)
|
||||
###numpy_array = np.asarray(<cnp.uint8_t *>ui8val)
|
||||
#free(ui8val)
|
||||
#return mvUInt8 #numpy_array #mvUInt8
|
||||
###return array_from_ptr(ui8val, nelemMethod, cnp.NPY_UINT8)
|
||||
|
||||
else:
|
||||
mvUInt8 = np.empty(
|
||||
nelemMethod, dtype=np.uint8, order='C')
|
||||
#mvShortNP = np.ndarray(buffer=np.array(ui8val), dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelemMethod):
|
||||
mvUInt8[ij] = <cnp.uint8_t> ui8val[ij]
|
||||
# mvShortNP=cnp.asarray(ui8val)
|
||||
|
||||
# aaa=np.full(nelemMethod,<mvShort, dtype=np.uint8, order='C')
|
||||
free(ui8val)
|
||||
return np.array(mvUInt8) # arr
|
||||
|
||||
elif art in ['memoryview', 'mv', 'memoryviewslice']:
|
||||
mvShort = np.empty(nelemMethod, dtype=np.int16, order='C')
|
||||
for ij in range(0, nelemMethod):
|
||||
mvShort[ij] = <short > ui8val[ij]
|
||||
free(ui8val)
|
||||
return memoryview(mvShort)
|
||||
|
||||
elif art in ['array', 'array.array']:
|
||||
a = array.array('h')
|
||||
for ij in range(0, nelemMethod):
|
||||
a.append( < short > ui8val[ij])
|
||||
free(ui8val)
|
||||
return a
|
||||
|
||||
elif art in ['ctypes', 'ctype']:
|
||||
ctypesArray16 = (ctypes.c_int16*nelemMethod)()
|
||||
for ij in range(0, nelemMethod):
|
||||
ctypesArray16[ij] = <short > ui8val[ij]
|
||||
free(ui8val)
|
||||
return ctypesArray16
|
||||
|
||||
else:
|
||||
print("Unknow array type in user request for art='",
|
||||
art, "'. Possible types are:")
|
||||
print("memoryview, numpy, array, ctypes")
|
||||
print("Returning memoryview")
|
||||
mvUInt8 = np.empty(nelemMethod, dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelemMethod):
|
||||
mvUInt8[ij] = <dbr_char_t> ui8val[ij]
|
||||
free(ui8val)
|
||||
return mvUInt8
|
||||
|
||||
elif dtcheck in [CAFE_SHORT]:
|
||||
|
||||
i16val = <short * >malloc(nelemMemory * sizeof(np.int16))
|
||||
# start=time.time()
|
||||
@@ -3901,15 +4069,17 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
|
||||
nelemPrevious = []
|
||||
|
||||
print("<========getScalarList=====>")
|
||||
|
||||
for i in range(0, len(handleList)):
|
||||
nelemPrevious.append(self._c_cafe.setNelemToOne(handleList[i]))
|
||||
|
||||
# c=self.hh.getNelemClient(handleList[i])
|
||||
# n=self.hh.getNelemNative(handleList[i])
|
||||
# r=self.hh.getNelemRequest(handleList[i])
|
||||
# print "c,n,r", c,n,r, "[",i,"]"
|
||||
#c=self.hh.getNelemClient(handleList[i])
|
||||
#n=self.hh.getNelemNative(handleList[i])
|
||||
#r=self.hh.getNelemRequest(handleList[i])
|
||||
#print("c,n,r", c,n,r, "[",i,"]")
|
||||
# c=self.hh.getNelemToRetrieveFromCache(handleList[i])
|
||||
# print "cache", c, "[",i,"]"
|
||||
# print("cache", c, "[",i,"]")
|
||||
|
||||
# pack into vectors
|
||||
cdef vector[unsigned int] v
|
||||
@@ -3933,9 +4103,9 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
with nogil:
|
||||
status = self._c_cafe.getV(v, vStatus)
|
||||
|
||||
#print("getScalarList")
|
||||
print("getScalarList")
|
||||
#for i in range(0, len(vStatus)):
|
||||
# print (vStatus[i])
|
||||
# print (vStatus[i])
|
||||
# print("====")
|
||||
# Check for error code 704: ICAFE_WAITING_FOR_PREV_CALLBACK
|
||||
# as this may mean we have a double handle instance.
|
||||
@@ -3966,7 +4136,7 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
cdef unsigned int dtcheck = CAFE_NOT_REQUESTED # native type not yet know
|
||||
dtcheck = getMatchedDataType(dt, dtcheck)
|
||||
|
||||
#print ("dt=", dt, "dtcheck=", dtcheck)
|
||||
print ("dt=", dt, "dtcheck=", dtcheck)
|
||||
|
||||
if dtcheck in [CAFE_STRING]:
|
||||
|
||||
@@ -4070,11 +4240,11 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
|
||||
cdef PVDataHolder * pvd = self._c_cafe.getPVData(v)
|
||||
|
||||
#for i in range (0, len(handleList)):
|
||||
# print (pvd[i].getPVName(), pvd[i].getAsString(), " [",i,"]", pvd[i].getStatus())
|
||||
for i in range (0, len(handleList)):
|
||||
print (pvd[i].getPVName(), pvd[i].getAsString(), " [",i,"]", pvd[i].getStatus())
|
||||
|
||||
|
||||
#print ("-----------------------------------------------------------------")
|
||||
print ("-----------------------------------------------------------------")
|
||||
|
||||
# cdef PVDataHolder * pvd = \
|
||||
# <PVDataHolder *>malloc( 100000000 + \
|
||||
@@ -4133,7 +4303,7 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
dtn = pvd[i].getDataType()
|
||||
dtcheck = getMatchedDataType(dt, dtn)
|
||||
|
||||
#print ("dt=", dt, "dtn=", dtn, "dtcheck=", dtcheck)
|
||||
print ("dt=", dt, "dtn=", dtn, "dtcheck=", dtcheck)
|
||||
#print (pvd[i].getAsString())
|
||||
#print (pvd[i].getAsDouble())
|
||||
|
||||
@@ -4190,7 +4360,7 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
print("Entering 0 for element", i,
|
||||
"as channel is not connected!")
|
||||
|
||||
#print (" vstatus = ", vStatus[i] , " pvd[i].status ", pvd[i].getStatus() )
|
||||
print (" vstatus = ", vStatus[i] , " pvd[i].status ", pvd[i].getStatus() )
|
||||
|
||||
# free(pvd)
|
||||
if (cacheFlag == True):
|
||||
@@ -4312,12 +4482,13 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
print("Error in def getCompoundList: ")
|
||||
self._c_cafe.printStatusMessage(statusBundle)
|
||||
|
||||
cdef unsigned int dtcheck = CAFE_NOT_REQUESTED # native type not yet know
|
||||
cdef int dtcheck = CAFE_NOT_REQUESTED # native type not yet know
|
||||
dtcheck = getMatchedDataType(dt, dtcheck)
|
||||
|
||||
cdef bytes bytesVal
|
||||
localList = []
|
||||
|
||||
|
||||
# Use Scalar
|
||||
if not flagCompound:
|
||||
|
||||
@@ -4325,38 +4496,36 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
|
||||
self.vStr.clear()
|
||||
self.vStr.reserve(len(handleList))
|
||||
#for i in range(0, len(handleList)):
|
||||
# self.vStr[i] = <str> " "
|
||||
|
||||
|
||||
|
||||
with nogil:
|
||||
status = self._c_cafe.getCacheVStr(v, self.vStr, vStatus)
|
||||
|
||||
#warning: __pyx_v_i may be used uninitialized in this function
|
||||
bytesVal = <bytes> (<string> self.vStr[i] )
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(v[i]):
|
||||
try:
|
||||
strVal = (bytesVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-8')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-16')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
strVal = <string> self.vStr[i]
|
||||
for i in range(0, len(v)):
|
||||
bytesVal = <bytes> (<string> self.vStr[i] )
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(v[i]):
|
||||
try:
|
||||
strVal = (bytesVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-8')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
strVal = (bytesVal).decode('utf-16')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
strVal = <string> self.vStr[i]
|
||||
|
||||
localList.append(strVal)
|
||||
localList.append(strVal)
|
||||
|
||||
return localList, status, vStatus
|
||||
|
||||
@@ -4380,6 +4549,7 @@ First input argument, should be a 'list' of of type <class 'int'> if handles or
|
||||
v, self.vFloat, vStatus)
|
||||
|
||||
return self.vFloat, status, vStatus
|
||||
|
||||
|
||||
# continue Can be a compound or native
|
||||
# Native
|
||||
@@ -4708,7 +4878,7 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
raise _cafeException
|
||||
return None
|
||||
|
||||
cdef unsigned int dtcheck = dtr
|
||||
cdef int dtcheck = dtr
|
||||
dtcheck = getMatchedDataType(dt, dtr)
|
||||
|
||||
cdef bytes bVal
|
||||
@@ -4828,6 +4998,7 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
"First input argument should be of type <class 'int'> if handle, else <class 'str'> if PV"))
|
||||
|
||||
cdef:
|
||||
dbr_char_t * ui8val
|
||||
short * i16val
|
||||
int * ival
|
||||
double * dval
|
||||
@@ -4916,20 +5087,20 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
encoding = False
|
||||
if '.EGU' in self._c_cafe.getPVFromHandle(handle):
|
||||
try:
|
||||
strVal = (bVal).decode('latin-1')
|
||||
valStr = (bVal).decode('latin-1')
|
||||
encoding = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
if not encoding:
|
||||
try:
|
||||
valStr = bVal.decode('utf-8')
|
||||
valStr = (bVal).decode('utf-8')
|
||||
encoded = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
if not encoding:
|
||||
try:
|
||||
valStr = bVal.decode('utf-16')
|
||||
valStr = (bVal).decode('utf-16')
|
||||
encoded = True
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -4997,7 +5168,93 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
|
||||
return mvStr
|
||||
'''
|
||||
elif dtcheck in [CAFE_SHORT, CAFE_CHAR]:
|
||||
elif dtcheck in [CAFE_CHAR]:
|
||||
|
||||
ui8val = <dbr_char_t * >malloc(nelemToRetrieveFromCache * sizeof(np.uint8))
|
||||
|
||||
status = self._c_cafe.getCacheCharArray(handle, ui8val)
|
||||
|
||||
if status == ICAFE_NORMAL:
|
||||
# np.empty preferred, else mvInt does not get correct value for first couple of array elements
|
||||
|
||||
if art in ['numpy', 'ndarray', 'numpy.ndarray', 'np', 'np.ndarray']:
|
||||
|
||||
if dt in ['np.short', 'np.int16', 'short', 'int16']:
|
||||
mvShort = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvShort[ij] = <cnp.int16_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
return np.array(mvShort)
|
||||
|
||||
elif dt in ['np.int8', 'np.bool_', 'np.byte', 'bool', 'byte', 'int8']:
|
||||
mvInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int8, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvInt8[ij] = <cnp.int8_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
return np.array(mvInt8)
|
||||
|
||||
elif dt in ['uchar', 'np.uint8', 'uint8']:
|
||||
mvUInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvUInt8[ij] = <cnp.uint8_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
return np.array(mvUInt8)
|
||||
|
||||
else:
|
||||
|
||||
mvUInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.uint8, order='C')
|
||||
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvUInt8[ij] = <cnp.uint8_t > ui8val[ij]
|
||||
|
||||
free(ui8val)
|
||||
|
||||
return np.array(mvUInt8)
|
||||
|
||||
elif art in ['memoryview', 'mv', 'memoryviewslice']:
|
||||
mvShort = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvShort[ij] = <short> ui8val[ij]
|
||||
free(ui8val)
|
||||
|
||||
return mvShort
|
||||
|
||||
elif art in ['array', 'array.array']:
|
||||
arrayArray = array.array('h')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
arrayArray.append( <dbr_char_t> ui8val[ij])
|
||||
free(ui8val)
|
||||
return arrayArray
|
||||
|
||||
elif art in ['ctypes', 'ctype']:
|
||||
ctypesArray = (ctypes.c_int16*nelemToRetrieveFromCache)()
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
ctypesArray[ij] = <short> ui8val[ij]
|
||||
free(ui8val)
|
||||
return ctypesArray
|
||||
|
||||
else:
|
||||
print("Unknow array type in user request for art='",
|
||||
art, "'. Possible types are:")
|
||||
print("memoryview, numpy, array, ctypes")
|
||||
print("Returning memoryview")
|
||||
mvUInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvUInt8[ij] = <dbr_char_t > ui8val[ij]
|
||||
free(ui8val)
|
||||
|
||||
return mvUInt8
|
||||
|
||||
|
||||
|
||||
elif dtcheck in [CAFE_SHORT]:
|
||||
|
||||
i16val = <short * >malloc(nelemToRetrieveFromCache * sizeof(np.int16))
|
||||
|
||||
@@ -5007,18 +5264,43 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
# np.empty preferred, else mvInt does not get correct value for first couple of array elements
|
||||
|
||||
if art in ['numpy', 'ndarray', 'numpy.ndarray', 'np', 'np.ndarray']:
|
||||
|
||||
if dt in ['np.short', 'np.int16', 'short', 'int16']:
|
||||
mvShort = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvShort[ij] = <cnp.int16_t > i16val[ij]
|
||||
free(i16val)
|
||||
return np.array(mvShort)
|
||||
|
||||
mvShortNP = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
elif dt in ['np.int8', 'np.bool_', 'np.byte', 'bool', 'byte', 'int8']:
|
||||
mvInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int8, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvInt8[ij] = <cnp.int8_t > i16val[ij]
|
||||
free(i16val)
|
||||
return np.array(mvInt8)
|
||||
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvShortNP[ij] = <cnp.int16_t > i16val[ij]
|
||||
# arr=np.asarray(mvShort)
|
||||
elif dt in ['uchar', 'np.uint8', 'uint8']:
|
||||
mvUInt8 = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.uint8, order='C')
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvUInt8[ij] = <cnp.uint8_t > i16val[ij]
|
||||
free(i16val)
|
||||
return np.array(mvUInt8)
|
||||
|
||||
free(i16val)
|
||||
else:
|
||||
|
||||
return mvShortNP # arr
|
||||
mvShort = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
|
||||
for ij in range(0, nelemToRetrieveFromCache):
|
||||
mvShort[ij] = <cnp.int16_t > i16val[ij]
|
||||
|
||||
free(i16val)
|
||||
|
||||
return np.array(mvShort) # arr
|
||||
|
||||
elif art in ['memoryview', 'mv', 'memoryviewslice']:
|
||||
mvShort = np.empty(
|
||||
nelemToRetrieveFromCache, dtype=np.int16, order='C')
|
||||
@@ -5056,6 +5338,9 @@ First input argument, should be of type <class 'int'> if group handle, else <cla
|
||||
|
||||
return mvShort
|
||||
|
||||
|
||||
|
||||
|
||||
elif dtcheck in [CAFE_LONG]:
|
||||
|
||||
ival = <int * >malloc(nelemToRetrieveFromCache * sizeof(np.int32))
|
||||
@@ -5531,8 +5816,10 @@ First input argument, should be of type <class 'int'> if handle, else <class 'st
|
||||
handleList = []
|
||||
handleList = self.getHandlesFromWithinGroup(ghandle)
|
||||
|
||||
#cb_list = [cb] * pvg.getNPV()
|
||||
|
||||
for i in range(0, pvg.getNPV()):
|
||||
|
||||
|
||||
mp[i].setMask(mask)
|
||||
mp[i].setCafeDbrType(dbr)
|
||||
mp[i].setNotifyDeltaMilliSeconds(notify_milliseconds)
|
||||
@@ -5542,18 +5829,18 @@ First input argument, should be of type <class 'int'> if handle, else <class 'st
|
||||
sig = inspect.signature(cb)
|
||||
# a=inspect.getargspec(cb)
|
||||
|
||||
mp.setUserArgs(< void * > mpid)
|
||||
mp.setNoCyCallbackParameters(len(sig.parameters))
|
||||
mp.setPyCyHandler(<void *> cb)
|
||||
mp[i].setUserArgs(< void * > mpid)
|
||||
mp[i].setNoCyCallbackParameters(len(sig.parameters))
|
||||
mp[i].setPyCyHandler(<void *> cb) #cb_list[i])
|
||||
|
||||
print('============//1//')
|
||||
print('SIGNATURE:')
|
||||
print(str(sig))
|
||||
for param in sig.parameters.values():
|
||||
print('Parameter:', param)
|
||||
print('len1', len(sig.parameters.values()))
|
||||
print('len2', len(sig.parameters))
|
||||
print('monitor id', mpid)
|
||||
#print('============//1//')
|
||||
#print('SIGNATURE:')
|
||||
#print(str(sig))
|
||||
#for param in sig.parameters.values():
|
||||
# print('Parameter:', param)
|
||||
#print('len1', len(sig.parameters.values()))
|
||||
#print('len2', len(sig.parameters))
|
||||
#print('monitor id', mpid)
|
||||
|
||||
mpV.push_back(mp[i])
|
||||
|
||||
@@ -5580,7 +5867,7 @@ First input argument, should be of type <class 'int'> if handle, else <class 'st
|
||||
DBE_VALUE | DBE_LOG | DBE_ALARM,
|
||||
unsigned short notify_milliseconds=0):
|
||||
############################################################################
|
||||
cdef str _METHOD = ("groupMonitorStartWithCBList(ghandleName, cb," + +
|
||||
cdef str _METHOD = ("groupMonitorStartWithCBList(ghandleName, cb," +
|
||||
"dbr, mask, notify_milliseconds)")
|
||||
|
||||
cdef unsigned int ghandle = 0
|
||||
@@ -5644,14 +5931,14 @@ No of group members doe not match the length of callback object list")
|
||||
mp[i].setNoCyCallbackParameters(len(sig.parameters))
|
||||
mp[i].setPyCyHandler(<void *> cb[i])
|
||||
|
||||
print('============')
|
||||
print('SIGNATURE//2//:')
|
||||
print(str(sig))
|
||||
for param in sig.parameters.values():
|
||||
print('Parameter:', param)
|
||||
print('len1', len(sig.parameters.values()))
|
||||
print('len2', len(sig.parameters))
|
||||
print('monitorid', mpid) # (<unsigned int *> ptr_mpid)[0])
|
||||
#print('============')
|
||||
#print('SIGNATURE//2//:')
|
||||
#print(str(sig))
|
||||
#for param in sig.parameters.values():
|
||||
# print('Parameter:', param)
|
||||
#print('len1', len(sig.parameters.values()))
|
||||
#print('len2', len(sig.parameters))
|
||||
#print('monitorid', mpid) # (<unsigned int *> ptr_mpid)[0])
|
||||
|
||||
|
||||
mpV.push_back(mp[i])
|
||||
@@ -6436,6 +6723,7 @@ No of group members doe not match the length of callback object list")
|
||||
def monitorStart(
|
||||
self, handlePV, cb: object = None, DBR_TYPE dbr=DBR_TIME,
|
||||
unsigned int mask=DBE_VALUE | DBE_LOG | DBE_ALARM,
|
||||
unsigned int nelem=0,
|
||||
unsigned short notify_milliseconds=0):
|
||||
|
||||
_METHOD = "monitorStart(handlePV, object cb=None, \
|
||||
@@ -6477,6 +6765,10 @@ No of group members doe not match the length of callback object list")
|
||||
|
||||
# For setUserArgs pass the address of the variable.
|
||||
|
||||
#Default is native number
|
||||
if nelem:
|
||||
mp.setNelem(nelem)
|
||||
|
||||
mp.setMask(mask)
|
||||
mp.setNotifyDeltaMilliSeconds(notify_milliseconds)
|
||||
|
||||
@@ -6871,7 +7163,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_8')
|
||||
encoding = True
|
||||
print('utf-8')
|
||||
|
||||
vecS.push_back(temp.encode('utf_8'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -6879,7 +7171,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_16')
|
||||
encoding = True
|
||||
print('utf-16')
|
||||
|
||||
vecS.push_back(<string>temp.encode('utf_16').decode('utf_16'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
@@ -6887,7 +7179,7 @@ No of group members doe not match the length of callback object list")
|
||||
try:
|
||||
temp = (valSet[i]).decode('utf_32')
|
||||
encoding = True
|
||||
print('utf-32')
|
||||
|
||||
vecS.push_back(temp.encode('utf_32'))
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
8037
PyCafe_sls.pyx++++
Normal file
8037
PyCafe_sls.pyx++++
Normal file
File diff suppressed because it is too large
Load Diff
7953
PyCafe_sls.pyx++++WithPrint
Normal file
7953
PyCafe_sls.pyx++++WithPrint
Normal file
File diff suppressed because it is too large
Load Diff
7953
PyCafe_sls.pyx_buff
Normal file
7953
PyCafe_sls.pyx_buff
Normal file
File diff suppressed because it is too large
Load Diff
8044
PyCafe_sls_py35.pyx
Normal file
8044
PyCafe_sls_py35.pyx
Normal file
File diff suppressed because it is too large
Load Diff
12
build_py310.sh
Normal file
12
build_py310.sh
Normal 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}
|
||||
18
build_py34_sls2.sh
Normal file
18
build_py34_sls2.sh
Normal 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
|
||||
@@ -1,9 +1,9 @@
|
||||
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.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}
|
||||
|
||||
11
build_py35_sls.sh
Normal file
11
build_py35_sls.sh
Normal 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_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}
|
||||
11
build_py35_sls2.sh
Normal file
11
build_py35_sls2.sh
Normal 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_sls.pxd PyCafe.pxd
|
||||
#rm -f PyCafe.pyx
|
||||
#ln -s PyCafe_sls.pyx PyCafe.pyx
|
||||
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}
|
||||
11
build_py38_sf.sh
Normal file
11
build_py38_sf.sh
Normal 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}
|
||||
11
build_py38_sls2.sh
Normal file
11
build_py38_sls2.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
module unload gcc
|
||||
module load gcc/7.5.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
|
||||
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}
|
||||
38
examples.py
38
examples.py
@@ -1,3 +1,4 @@
|
||||
|
||||
# python
|
||||
|
||||
import time
|
||||
@@ -124,9 +125,9 @@ def py_callback(handle: int = None, pvname: str = ""):
|
||||
print("--------")
|
||||
# alternatively:
|
||||
print("Value =", p1.value[0])
|
||||
print("status = %d" % p1.status)
|
||||
print("alarmStatus = %d" % p1.alarmStatus)
|
||||
print("alarmSeverity = %d" % p1.alarmSeverity)
|
||||
print("status = {0}".format(p1.status))
|
||||
print("alarmStatus = {0}".format(p1.alarmStatus))
|
||||
print("alarmSeverity = {0}".format(p1.alarmSeverity))
|
||||
print("ts =", p1.ts[0], p1.ts[1])
|
||||
print("tsDate =", p1.tsDate[0], p1.tsDate[1],
|
||||
p1.tsDate[2], p1.tsDate[3],
|
||||
@@ -180,9 +181,9 @@ def py_callback_pvdata(handle: int = None, pvname: str = "", pvdata: PyCafe.pvd
|
||||
print("----------")
|
||||
# alternatively:
|
||||
print("Value =", pvdata.value[0])
|
||||
print("status = %d" % pvdata.status)
|
||||
print("alarmStatus = %d" % pvdata.alarmStatus)
|
||||
print("alarmSeverity = %d" % pvdata.alarmSeverity)
|
||||
print("status = {0}".format(pvdata.status))
|
||||
print("alarmStatus = {0}".format(pvdata.alarmStatus))
|
||||
print("alarmSeverity = {0}".format(pvdata.alarmSeverity))
|
||||
print("ts =", pvdata.ts[0], pvdata.ts[1])
|
||||
print("tsDate =", pvdata.tsDate[0], pvdata.tsDate[1],
|
||||
pvdata.tsDate[2], pvdata.tsDate[3],
|
||||
@@ -274,6 +275,17 @@ def py_callback_get(handle):
|
||||
# Explicitly opening channels is good practice even if only optional
|
||||
|
||||
|
||||
print("CAFE_VERSION:", cafe.CAFE_version())
|
||||
print("EPICS_VERSION:", cafe.EPICS_version(), cafe.epics_version_string())
|
||||
print("CA_VERSION:", cafe.ca_version())
|
||||
|
||||
#cafe.monitor("ARIDI-BPM:OFB-YRMS.DESC:EGU", cb=py_callback_pvctrl)
|
||||
#time.sleep(1)
|
||||
#pvc = cafe.getCache("ARIDI-BPM:OFB-YRMS.EGU")
|
||||
#print(pvc)
|
||||
|
||||
#sys.exit(1)
|
||||
|
||||
print("INFO: pend time for open", cafe.getOpenDefaultPendTime())
|
||||
# open a single channel
|
||||
|
||||
@@ -932,7 +944,7 @@ groupHandle2 = cafe.groupOpen('gAll')
|
||||
pvg = cafe.getPVGroup(groupHandle2)
|
||||
# pvg.show()
|
||||
# or
|
||||
pvg.showWithPV(pvlistAll)
|
||||
pvg.showWithPV(pvlistAll[0:9])
|
||||
# or
|
||||
# for i in range (0, pvg.npv):
|
||||
# print(glist[i], " value=", pvg.pvdata[i].value[0],)
|
||||
@@ -963,11 +975,13 @@ print("--------------------------------------------------------")
|
||||
print("Note: getCompoundPVGroup does a collective asynchronous get on all group members")
|
||||
print("--------------------------------------------------------")
|
||||
print("Data from getCompoundPVGroup")
|
||||
pvg = cafe.getCompoundPVGroup('gAll', dt='str')
|
||||
pvg.showWithPV(pvlistAll)
|
||||
# or
|
||||
glist = cafe.groupMemberList('gAll')
|
||||
pvg.showWithPV(glist)
|
||||
print(glist)
|
||||
|
||||
pvg = cafe.getCompoundPVGroup('gAll', dt='str')
|
||||
pvg.showWithPV(pvlistAll[0:9])
|
||||
# or
|
||||
pvg.showWithPV(glist[0:9])
|
||||
|
||||
|
||||
print("Values of first element:")
|
||||
@@ -979,7 +993,7 @@ print("Data from getCompoundPVGroup by groupHandle")
|
||||
pvg = cafe.getCompoundPVGroup(groupHandle2, dt='float')
|
||||
|
||||
|
||||
pvg.showWithPV(pvlistAll)
|
||||
pvg.showWithPV(pvlistAll[0:9])
|
||||
# or
|
||||
print("Values of first element:")
|
||||
for i in range(0, pvg.npv):
|
||||
|
||||
11
makefile
11
makefile
@@ -7,9 +7,9 @@
|
||||
|
||||
|
||||
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}
|
||||
INSTALL_PATH_PY= $(CAFE_CYCAFE_BASE)/cafe-1.15.1-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
|
||||
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.15.1-sf-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
|
||||
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.15.1-gcc-7.3.0/lib/${EPICS_HOST_ARCH}
|
||||
#############################################
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
@@ -41,7 +41,10 @@ install_py37_sls2: python3.7-sls2/lib/${EPICS_HOST_ARCH}/PyCafe.cpython-37m-x86_
|
||||
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
47
makefile-
Normal 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
56
makefile_gcc_7.5.0
Normal 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.16.1-gcc-7.5.0/lib/${EPICS_HOST_ARCH}
|
||||
INSTALL_PATH_SF= $(CAFE_CYCAFE_BASE)/cafe-1.16.1-sf-gcc-7.5.0/lib/${EPICS_HOST_ARCH}
|
||||
INSTALL_PATH_SLS2= $(CAFE_CYCAFE_BASE)/cafe-1.16.1-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
|
||||
|
||||
581
out
581
out
@@ -1,448 +1,133 @@
|
||||
52c52
|
||||
< include "PyCafeDefs_sf.pxi"
|
||||
---
|
||||
> include "PyCafeDefs.pxi"
|
||||
83a84
|
||||
>
|
||||
172,179c173
|
||||
<
|
||||
< DBPMKeeper dbpm
|
||||
<
|
||||
< bint dbpmInitialized
|
||||
< bint BSInitialized
|
||||
< bint isBSinCAOnly
|
||||
< BSDataHolder bsd
|
||||
<
|
||||
---
|
||||
>
|
||||
213,216c207
|
||||
< self.dbpmInitialized = False
|
||||
< self.BSInitialized = False
|
||||
< self.isBSinCAOnly = False
|
||||
<
|
||||
---
|
||||
>
|
||||
274c265,266
|
||||
< self.cs.info(ECA_ALLOCMEM)))
|
||||
---
|
||||
> self.cs.info(ECA_ALLOCMEM)))
|
||||
>
|
||||
421c413,414
|
||||
< if cb is not None:
|
||||
---
|
||||
> if cb is not None:
|
||||
>
|
||||
470c463
|
||||
<
|
||||
---
|
||||
>
|
||||
483c476
|
||||
< except RuntimeError as e:
|
||||
---
|
||||
> except RuntimeError as e:
|
||||
498c491
|
||||
< raise Exception("{} {} \n{}".format(self._exception_text, _METHOD, e))
|
||||
---
|
||||
> raise Exception("{} {} \n{}".format(self._exception_text, _METHOD, e))
|
||||
788c781
|
||||
<
|
||||
---
|
||||
>
|
||||
797c790
|
||||
< if cb is not None:
|
||||
---
|
||||
> if cb is not None:
|
||||
856,857c849
|
||||
<
|
||||
< if cb is not None:
|
||||
---
|
||||
> if cb is not None:
|
||||
883,884c875,876
|
||||
<
|
||||
< if cb is not None:
|
||||
---
|
||||
>
|
||||
> if cb is not None:
|
||||
5154c5146
|
||||
<
|
||||
---
|
||||
>
|
||||
5184d5175
|
||||
<
|
||||
5193c5184
|
||||
<
|
||||
---
|
||||
>
|
||||
5232d5222
|
||||
<
|
||||
5279,5280c5269
|
||||
< sig = inspect.signature(cb[i])
|
||||
<
|
||||
---
|
||||
> sig = inspect.signature(cb[i])
|
||||
5294c5283
|
||||
<
|
||||
---
|
||||
>
|
||||
5933a5923
|
||||
>
|
||||
5941c5931
|
||||
<
|
||||
---
|
||||
>
|
||||
5962c5952,5953
|
||||
<
|
||||
---
|
||||
>
|
||||
>
|
||||
6039c6030
|
||||
<
|
||||
---
|
||||
>
|
||||
6043c6034
|
||||
<
|
||||
---
|
||||
>
|
||||
6045c6036
|
||||
<
|
||||
---
|
||||
>
|
||||
6091,6092c6082,6083
|
||||
< global hmd
|
||||
<
|
||||
---
|
||||
> global hmd
|
||||
>
|
||||
6106c6097
|
||||
< del hmd[l]
|
||||
---
|
||||
> del hmd[l]
|
||||
6115c6106
|
||||
<
|
||||
---
|
||||
>
|
||||
6122c6113
|
||||
<
|
||||
---
|
||||
>
|
||||
6131c6122
|
||||
<
|
||||
---
|
||||
>
|
||||
6174a6166
|
||||
>
|
||||
7225,7538d7216
|
||||
<
|
||||
< #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###################################################################
|
||||
< ##################################################################################
|
||||
|
||||
--------------------------------------------------
|
||||
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]
|
||||
|
||||
1389
python3.10/lib/RHEL7-x86_64/examples.py
Normal file
1389
python3.10/lib/RHEL7-x86_64/examples.py
Normal file
File diff suppressed because it is too large
Load Diff
46
setup_py310.py
Normal file
46
setup_py310.py
Normal 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 }
|
||||
)
|
||||
)
|
||||
52
setup_py34_sls2.py
Normal file
52
setup_py34_sls2.py
Normal 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}
|
||||
)
|
||||
)
|
||||
@@ -7,7 +7,6 @@ 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'],
|
||||
@@ -17,16 +16,16 @@ setup(
|
||||
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-py35-gcc-7.3.0/include',
|
||||
'/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.13.0-py35-gcc-7.3.0/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.13.0-py35-gcc-7.3.0/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'
|
||||
|
||||
@@ -7,6 +7,9 @@ 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++",
|
||||
@@ -15,13 +18,13 @@ setup(
|
||||
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-sf-py35-gcc-7.3.0/include',
|
||||
'/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-1.13.0-sf-py35-gcc-7.3.0/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',
|
||||
@@ -31,7 +34,7 @@ setup(
|
||||
],
|
||||
runtime_library_dirs=[
|
||||
os.environ['EPICS'] + '/base/lib/' + os.environ['EPICS_HOST_ARCH'],
|
||||
'/opt/gfa/cafe/cpp/cafe-1.13.0-sf-py35-gcc-7.3.0/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',
|
||||
@@ -46,6 +49,8 @@ setup(
|
||||
'py2_import': False, 'warn.unreachable': False,
|
||||
'remove_unreachable': False},
|
||||
compile_time_env={'PY_VERSION_HEX':sys.hexversion,
|
||||
'PY_EXT_C': True, 'BS_CAFE': True }
|
||||
'PY_EXT_C': True, 'BS_CAFE': True,
|
||||
'CAFE_VERSION': _CAFE_VERSION,
|
||||
'EPICS_VERSION': _EPICS_VERSION }
|
||||
)
|
||||
)
|
||||
|
||||
52
setup_py35_sls.py
Normal file
52
setup_py35_sls.py
Normal 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['EPICS_HOST_ARCH'] #'SL6-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',
|
||||
'/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_py35_sls2.py
Normal file
53
setup_py35_sls2.py
Normal 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.16.0-py35-gcc-' + _GCC_VERSION
|
||||
_EPICS_VERSION='7.0.6'
|
||||
_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 }
|
||||
)
|
||||
)
|
||||
@@ -8,7 +8,7 @@ from Cython.Build import cythonize
|
||||
from numpy import get_include
|
||||
|
||||
|
||||
_CAFE_VERSION='1.14.4'
|
||||
_CAFE_VERSION='1.14.5'
|
||||
_EPICS_VERSION='3.14.12'
|
||||
|
||||
setup(
|
||||
|
||||
53
setup_py37_sls.py
Normal file
53
setup_py37_sls.py
Normal 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 }
|
||||
)
|
||||
)
|
||||
@@ -7,10 +7,10 @@ default_options['emit_linenums'] = True
|
||||
from Cython.Build import cythonize
|
||||
from numpy import get_include
|
||||
|
||||
|
||||
_CAFE_VERSION='1.14.2'
|
||||
_GCC_VERSION='7.3.0'
|
||||
_CAFE_VERSION='1.16.0-py37-gcc-' + _GCC_VERSION
|
||||
_EPICS_VERSION='7.0.6'
|
||||
|
||||
_EPICS_HOST_ARCH ='RHEL7-x86_64' #os.environ['EPICS_HOST_ARCH']
|
||||
|
||||
setup(
|
||||
ext_modules = cythonize([Extension('PyCafe',['PyCafe.pyx'],
|
||||
@@ -22,24 +22,23 @@ setup(
|
||||
'/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 +
|
||||
'-sls2-py37-gcc-7.3.0/include',
|
||||
'/include',
|
||||
'.', get_include()],
|
||||
library_dirs=[ os.environ['EPICS'] + '/base-' + _EPICS_VERSION + '/lib/' +
|
||||
os.environ['EPICS_HOST_ARCH'],
|
||||
_EPICS_HOST_ARCH,
|
||||
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
|
||||
'-sls2-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'
|
||||
'/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/' +
|
||||
os.environ['EPICS_HOST_ARCH'],
|
||||
_EPICS_HOST_ARCH,
|
||||
'/opt/gfa/cafe/cpp/cafe-' + _CAFE_VERSION +
|
||||
'-sls2-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'
|
||||
'/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,
|
||||
|
||||
60
setup_py38_sf.py
Normal file
60
setup_py38_sf.py
Normal 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
53
setup_py38_sls2.py
Normal 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.16.1-py38-gcc-' + _GCC_VERSION
|
||||
_EPICS_VERSION='7.0.6'
|
||||
_EPICS_HOST_ARCH ='RHEL7-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
45
test.py
Normal 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()
|
||||
|
||||
Reference in New Issue
Block a user