Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
c7a336ef
Commit
c7a336ef
authored
Nov 11, 2019
by
Claes Sjofors
Committed by
Claes Sjöfors
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pwrrt init() function attaching rtdb added
parent
dfe9d9fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
2 deletions
+64
-2
sev/exp/py/src/sev_analyse.py
sev/exp/py/src/sev_analyse.py
+12
-0
sev/exp/py/src/sev_eva.py
sev/exp/py/src/sev_eva.py
+13
-0
src/exp/pwrrt/src/pwrrtmodule.c
src/exp/pwrrt/src/pwrrtmodule.c
+39
-2
No files found.
sev/exp/py/src/sev_analyse.py
View file @
c7a336ef
...
...
@@ -1864,6 +1864,12 @@ class FetchSev:
filtervalue
=
self
.
filterentry
.
get
()
self
.
server
=
self
.
serverentry
.
get
()
try
:
pwrrt
.
init
(
'sev_analyse'
)
except
RuntimeError
as
e
:
tkMessageBox
.
showerror
(
"Error"
,
str
(
e
))
return
# Store server to file
try
:
fp
=
open
(
pwrp_tmp
+
"/sevserver.dat"
,
"w"
)
...
...
@@ -1999,6 +2005,12 @@ class FetchSev:
intervalvalue
=
float
(
self
.
intervalentry
.
get
())
maxvalue
=
int
(
self
.
maxentry
.
get
())
try
:
pwrrt
.
init
(
'sev_analyse'
)
except
RuntimeError
as
e
:
tkMessageBox
.
showerror
(
"Error"
,
str
(
e
))
return
try
:
result
=
pwrrt
.
getSevItemsDataFrame
(
self
.
server
,
dataoid
,
dataattr
,
isobject
,
fromvalue
,
tovalue
,
intervalvalue
,
maxvalue
)
...
...
sev/exp/py/src/sev_eva.py
View file @
c7a336ef
...
...
@@ -1827,6 +1827,12 @@ class FetchSev:
except
IOError
:
pass
try
:
pwrrt
.
init
(
'sev_eva'
)
except
RuntimeError
as
e
:
tkMessageBox
.
showerror
(
"Error"
,
str
(
e
))
return
try
:
self
.
items
=
pwrrt
.
getSevItemList
(
self
.
server
,
filtervalue
)
except
RuntimeError
as
e
:
...
...
@@ -2083,6 +2089,13 @@ class FetchSev:
m
=
m
<<
1
maxvalue
=
int
(
self
.
maxentry
.
get
())
print
fromvalue
,
tovalue
try
:
pwrrt
.
init
(
'sev_eva'
)
except
RuntimeError
as
e
:
tkMessageBox
.
showerror
(
"Error"
,
str
(
e
))
return
try
:
result
=
pwrrt
.
getSevEventsDataFrame
(
self
.
server
,
oid
,
fromvalue
,
tovalue
,
eventtypevalue
,
...
...
src/exp/pwrrt/src/pwrrtmodule.c
View file @
c7a336ef
...
...
@@ -20,6 +20,7 @@
#include "rt_pwr_msg.h"
#include "co_user_msg.h"
static
int
pwrrt_initialized
=
0
;
static
unsigned
int
pwrrt_priv
=
pwr_mPrv_RtRead
;
static
char
pwrrt_user
[
80
]
=
""
;
static
sevcli_tCtx
pwrrt_scctx
=
0
;
...
...
@@ -628,6 +629,17 @@ quit()\n\
/*
* Doc for static methods
*/
PyDoc_STRVAR
(
pwrrt_init_doc
,
"\
init(name)
\n
--
\n\n
\
Attach ProviewR runtime.
\n\n
\
Arguments
\n
\
---------
\n
\
name String
\n
\
Name of application.
\n\n
\
Example
\n
\
-------
\n
\
pwrrt.init('my_py')
\n
"
);
PyDoc_STRVAR
(
pwrrt_volume_doc
,
"\
volume(volumeName)
\n
--
\n\n
\
Get volume
\n\n
\
...
...
@@ -2927,6 +2939,14 @@ Appl_init(ApplObject *self, PyObject *args, PyObject *kwds)
return
-
1
;
}
if
(
!
pwrrt_initialized
)
{
sts
=
gdh_Init
(
name
);
if
(
EVEN
(
sts
))
{
set_error
(
sts
);
return
-
1
;
}
}
sts
=
gdh_NameToObjid
(
applobj
,
&
self
->
apploid
);
if
(
EVEN
(
sts
))
{
set_error
(
sts
);
...
...
@@ -3145,6 +3165,24 @@ Appl_log(ApplObject *self, PyObject *args)
*/
static
PyObject
*
pwrrt_init
(
PyObject
*
self
,
PyObject
*
args
)
{
const
char
*
name
;
pwr_tStatus
sts
;
if
(
pwrrt_initialized
)
Py_RETURN_NONE
;
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
name
))
return
NULL
;
sts
=
gdh_Init
(
name
);
if
(
EVEN
(
sts
))
return
set_error
(
sts
);
pwrrt_initialized
=
1
;
Py_RETURN_NONE
;
}
static
PyObject
*
pwrrt_volume
(
PyObject
*
self
,
PyObject
*
args
)
{
pwr_tOid
oid
;
...
...
@@ -4470,6 +4508,7 @@ static PyObject *pwrrt_getSevEventsDataFrame(PyObject *self, PyObject *args)
}
static
PyMethodDef
PwrrtMethods
[]
=
{
{
"init"
,
pwrrt_init
,
METH_VARARGS
,
pwrrt_init_doc
},
{
"volume"
,
pwrrt_volume
,
METH_VARARGS
,
pwrrt_volume_doc
},
{
"volumes"
,
pwrrt_volumes
,
METH_NOARGS
,
pwrrt_volumes_doc
},
{
"object"
,
pwrrt_object
,
METH_VARARGS
,
pwrrt_object_doc
},
...
...
@@ -4524,6 +4563,4 @@ PyMODINIT_FUNC initpwrrt(void)
PyModule_AddIntConstant
(
m
,
"FRAME_OPTIONS_CONDITION"
,
1
);
PyDateTime_IMPORT
;
gdh_Init
(
"Python"
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment