Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
77b6dc12
Commit
77b6dc12
authored
Oct 27, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(python): Доработка интерфейса UProxyObject
(netdata-plugin): Реализовал инициализацию из файла,обновление данных
parent
575ce067
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
512 additions
and
352 deletions
+512
-352
testUC.py
python/examples/testUC.py
+4
-1
UConnector_wrap.cxx
python/lib/pyUniSet/UConnector_wrap.cxx
+65
-31
UInterface_wrap.cxx
python/lib/pyUniSet/UInterface_wrap.cxx
+126
-0
UModbus.i
python/lib/pyUniSet/UModbus.i
+0
-1
UModbus_wrap.cxx
python/lib/pyUniSet/UModbus_wrap.cxx
+3
-253
UProxyObject.cc
python/lib/pyUniSet/UProxyObject.cc
+82
-4
UProxyObject.h
python/lib/pyUniSet/UProxyObject.h
+14
-0
UTypes.h
python/lib/pyUniSet/UTypes.h
+13
-1
pyUConnector.py
python/lib/pyUniSet/pyUConnector.py
+3
-0
pyUModbus.py
python/lib/pyUniSet/pyUModbus.py
+0
-34
pyUniSet.py
python/lib/pyUniSet/pyUniSet.py
+15
-0
uniset.chart.py
python/netdata-plugin/uniset.chart.py
+95
-23
uniset.conf
python/netdata-plugin/uniset.conf
+86
-3
testUI.py
python/tests/UInterface/testUI.py
+6
-1
No files found.
python/examples/testUC.py
View file @
77b6dc12
...
@@ -3,10 +3,11 @@
...
@@ -3,10 +3,11 @@
import
sys
import
sys
from
uniset
import
*
from
uniset
2
import
*
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
prop
=
"test"
lst
=
Params_inst
()
lst
=
Params_inst
()
for
i
in
range
(
0
,
len
(
sys
.
argv
)):
for
i
in
range
(
0
,
len
(
sys
.
argv
)):
...
@@ -14,6 +15,8 @@ if __name__ == "__main__":
...
@@ -14,6 +15,8 @@ if __name__ == "__main__":
break
;
break
;
lst
.
add
(
sys
.
argv
[
i
]
)
lst
.
add
(
sys
.
argv
[
i
]
)
lst
.
add_str
(
prop
)
p
=
[]
p
=
[]
print
"lst: class: "
+
str
(
p
.
__class__
.
__name__
)
print
"lst: class: "
+
str
(
p
.
__class__
.
__name__
)
...
...
python/lib/pyUniSet/UConnector_wrap.cxx
View file @
77b6dc12
...
@@ -3256,6 +3256,37 @@ SWIGINTERNINLINE PyObject*
...
@@ -3256,6 +3256,37 @@ SWIGINTERNINLINE PyObject*
}
}
SWIGINTERN
int
SWIG_AsPtr_std_string
(
PyObject
*
obj
,
std
::
string
**
val
)
{
char
*
buf
=
0
;
size_t
size
=
0
;
int
alloc
=
SWIG_OLDOBJ
;
if
(
SWIG_IsOK
((
SWIG_AsCharPtrAndSize
(
obj
,
&
buf
,
&
size
,
&
alloc
))))
{
if
(
buf
)
{
if
(
val
)
*
val
=
new
std
::
string
(
buf
,
size
-
1
);
if
(
alloc
==
SWIG_NEWOBJ
)
delete
[]
buf
;
return
SWIG_NEWOBJ
;
}
else
{
if
(
val
)
*
val
=
0
;
return
SWIG_OLDOBJ
;
}
}
else
{
static
int
init
=
0
;
static
swig_type_info
*
descriptor
=
0
;
if
(
!
init
)
{
descriptor
=
SWIG_TypeQuery
(
"std::string"
" *"
);
init
=
1
;
}
if
(
descriptor
)
{
std
::
string
*
vptr
;
int
res
=
SWIG_ConvertPtr
(
obj
,
(
void
**
)
&
vptr
,
descriptor
,
0
);
if
(
SWIG_IsOK
(
res
)
&&
val
)
*
val
=
vptr
;
return
res
;
}
}
return
SWIG_ERROR
;
}
#include <limits.h>
#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
...
@@ -3407,37 +3438,6 @@ SWIG_AsVal_int (PyObject * obj, int *val)
...
@@ -3407,37 +3438,6 @@ SWIG_AsVal_int (PyObject * obj, int *val)
}
}
SWIGINTERN
int
SWIG_AsPtr_std_string
(
PyObject
*
obj
,
std
::
string
**
val
)
{
char
*
buf
=
0
;
size_t
size
=
0
;
int
alloc
=
SWIG_OLDOBJ
;
if
(
SWIG_IsOK
((
SWIG_AsCharPtrAndSize
(
obj
,
&
buf
,
&
size
,
&
alloc
))))
{
if
(
buf
)
{
if
(
val
)
*
val
=
new
std
::
string
(
buf
,
size
-
1
);
if
(
alloc
==
SWIG_NEWOBJ
)
delete
[]
buf
;
return
SWIG_NEWOBJ
;
}
else
{
if
(
val
)
*
val
=
0
;
return
SWIG_OLDOBJ
;
}
}
else
{
static
int
init
=
0
;
static
swig_type_info
*
descriptor
=
0
;
if
(
!
init
)
{
descriptor
=
SWIG_TypeQuery
(
"std::string"
" *"
);
init
=
1
;
}
if
(
descriptor
)
{
std
::
string
*
vptr
;
int
res
=
SWIG_ConvertPtr
(
obj
,
(
void
**
)
&
vptr
,
descriptor
,
0
);
if
(
SWIG_IsOK
(
res
)
&&
val
)
*
val
=
vptr
;
return
res
;
}
}
return
SWIG_ERROR
;
}
SWIGINTERNINLINE
PyObject
*
SWIGINTERNINLINE
PyObject
*
SWIG_FromCharPtrAndSize
(
const
char
*
carray
,
size_t
size
)
SWIG_FromCharPtrAndSize
(
const
char
*
carray
,
size_t
size
)
{
{
...
@@ -3547,6 +3547,39 @@ fail:
...
@@ -3547,6 +3547,39 @@ fail:
}
}
SWIGINTERN
PyObject
*
_wrap_Params_add_str
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
std
::
string
arg2
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
PyObject
*
obj1
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"OO:Params_add_str"
,
&
obj0
,
&
obj1
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_add_str"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
{
std
::
string
*
ptr
=
(
std
::
string
*
)
0
;
int
res
=
SWIG_AsPtr_std_string
(
obj1
,
&
ptr
);
if
(
!
SWIG_IsOK
(
res
)
||
!
ptr
)
{
SWIG_exception_fail
(
SWIG_ArgError
((
ptr
?
res
:
SWIG_TypeError
)),
"in method '"
"Params_add_str"
"', argument "
"2"" of type '"
"std::string""'"
);
}
arg2
=
*
ptr
;
if
(
SWIG_IsNewObj
(
res
))
delete
ptr
;
}
result
=
(
bool
)(
arg1
)
->
add_str
(
arg2
);
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argc_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
SWIGINTERN
PyObject
*
_wrap_Params_argc_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
...
@@ -4378,6 +4411,7 @@ static PyMethodDef SwigMethods[] = {
...
@@ -4378,6 +4411,7 @@ static PyMethodDef SwigMethods[] = {
{
(
char
*
)
"SWIG_PyInstanceMethod_New"
,
(
PyCFunction
)
SWIG_PyInstanceMethod_New
,
METH_O
,
NULL
},
{
(
char
*
)
"SWIG_PyInstanceMethod_New"
,
(
PyCFunction
)
SWIG_PyInstanceMethod_New
,
METH_O
,
NULL
},
{
(
char
*
)
"new_Params"
,
_wrap_new_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_Params"
,
_wrap_new_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add"
,
_wrap_Params_add
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add"
,
_wrap_Params_add
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add_str"
,
_wrap_Params_add_str
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_set"
,
_wrap_Params_argc_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_set"
,
_wrap_Params_argc_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_get"
,
_wrap_Params_argc_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_get"
,
_wrap_Params_argc_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_set"
,
_wrap_Params_argv_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_set"
,
_wrap_Params_argv_set
,
METH_VARARGS
,
NULL
},
...
...
python/lib/pyUniSet/UInterface_wrap.cxx
View file @
77b6dc12
...
@@ -3979,6 +3979,39 @@ fail:
...
@@ -3979,6 +3979,39 @@ fail:
}
}
SWIGINTERN
PyObject
*
_wrap_Params_add_str
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
std
::
string
arg2
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
PyObject
*
obj1
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"OO:Params_add_str"
,
&
obj0
,
&
obj1
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_add_str"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
{
std
::
string
*
ptr
=
(
std
::
string
*
)
0
;
int
res
=
SWIG_AsPtr_std_string
(
obj1
,
&
ptr
);
if
(
!
SWIG_IsOK
(
res
)
||
!
ptr
)
{
SWIG_exception_fail
(
SWIG_ArgError
((
ptr
?
res
:
SWIG_TypeError
)),
"in method '"
"Params_add_str"
"', argument "
"2"" of type '"
"std::string const""'"
);
}
arg2
=
*
ptr
;
if
(
SWIG_IsNewObj
(
res
))
delete
ptr
;
}
result
=
(
bool
)(
arg1
)
->
add_str
(
arg2
);
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argc_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
SWIGINTERN
PyObject
*
_wrap_Params_argc_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
...
@@ -4834,6 +4867,94 @@ fail:
...
@@ -4834,6 +4867,94 @@ fail:
}
}
SWIGINTERN
PyObject
*
_wrap_UProxyObject_askIsOK
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UProxyObject
*
arg1
=
(
UProxyObject
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:UProxyObject_askIsOK"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UProxyObject
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"UProxyObject_askIsOK"
"', argument "
"1"" of type '"
"UProxyObject *""'"
);
}
arg1
=
reinterpret_cast
<
UProxyObject
*
>
(
argp1
);
result
=
(
bool
)(
arg1
)
->
askIsOK
();
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_UProxyObject_reaskSensors
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UProxyObject
*
arg1
=
(
UProxyObject
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:UProxyObject_reaskSensors"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UProxyObject
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"UProxyObject_reaskSensors"
"', argument "
"1"" of type '"
"UProxyObject *""'"
);
}
arg1
=
reinterpret_cast
<
UProxyObject
*
>
(
argp1
);
result
=
(
bool
)(
arg1
)
->
reaskSensors
();
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_UProxyObject_updateValues
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UProxyObject
*
arg1
=
(
UProxyObject
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:UProxyObject_updateValues"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UProxyObject
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"UProxyObject_updateValues"
"', argument "
"1"" of type '"
"UProxyObject *""'"
);
}
arg1
=
reinterpret_cast
<
UProxyObject
*
>
(
argp1
);
result
=
(
bool
)(
arg1
)
->
updateValues
();
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_UProxyObject_smIsOK
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UProxyObject
*
arg1
=
(
UProxyObject
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:UProxyObject_smIsOK"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UProxyObject
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"UProxyObject_smIsOK"
"', argument "
"1"" of type '"
"UProxyObject *""'"
);
}
arg1
=
reinterpret_cast
<
UProxyObject
*
>
(
argp1
);
result
=
(
bool
)(
arg1
)
->
smIsOK
();
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
UProxyObject_swigregister
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
SWIGINTERN
PyObject
*
UProxyObject_swigregister
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
obj
;
PyObject
*
obj
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:swigregister"
,
&
obj
))
return
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:swigregister"
,
&
obj
))
return
NULL
;
...
@@ -4856,6 +4977,7 @@ static PyMethodDef SwigMethods[] = {
...
@@ -4856,6 +4977,7 @@ static PyMethodDef SwigMethods[] = {
{
(
char
*
)
"getConfFileName"
,
_wrap_getConfFileName
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"getConfFileName"
,
_wrap_getConfFileName
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_Params"
,
_wrap_new_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_Params"
,
_wrap_new_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add"
,
_wrap_Params_add
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add"
,
_wrap_Params_add
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add_str"
,
_wrap_Params_add_str
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_set"
,
_wrap_Params_argc_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_set"
,
_wrap_Params_argc_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_get"
,
_wrap_Params_argc_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_get"
,
_wrap_Params_argc_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_set"
,
_wrap_Params_argv_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_set"
,
_wrap_Params_argv_set
,
METH_VARARGS
,
NULL
},
...
@@ -4881,6 +5003,10 @@ static PyMethodDef SwigMethods[] = {
...
@@ -4881,6 +5003,10 @@ static PyMethodDef SwigMethods[] = {
{
(
char
*
)
"UProxyObject_getValue"
,
_wrap_UProxyObject_getValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_getValue"
,
_wrap_UProxyObject_getValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_getFloatValue"
,
_wrap_UProxyObject_getFloatValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_getFloatValue"
,
_wrap_UProxyObject_getFloatValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_setValue"
,
_wrap_UProxyObject_setValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_setValue"
,
_wrap_UProxyObject_setValue
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_askIsOK"
,
_wrap_UProxyObject_askIsOK
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_reaskSensors"
,
_wrap_UProxyObject_reaskSensors
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_updateValues"
,
_wrap_UProxyObject_updateValues
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_smIsOK"
,
_wrap_UProxyObject_smIsOK
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_swigregister"
,
UProxyObject_swigregister
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UProxyObject_swigregister"
,
UProxyObject_swigregister
,
METH_VARARGS
,
NULL
},
{
NULL
,
NULL
,
0
,
NULL
}
{
NULL
,
NULL
,
0
,
NULL
}
};
};
...
...
python/lib/pyUniSet/UModbus.i
View file @
77b6dc12
...
@@ -12,5 +12,4 @@
...
@@ -12,5 +12,4 @@
/* Для генерации классов и констант в Питоне */
/* Для генерации классов и констант в Питоне */
%include "UModbus.h"
%include "UModbus.h"
%include "UTypes.h"
%include "UExceptions.h"
%include "UExceptions.h"
python/lib/pyUniSet/UModbus_wrap.cxx
View file @
77b6dc12
...
@@ -3011,11 +3011,9 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
...
@@ -3011,11 +3011,9 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
#define SWIGTYPE_p_UModbus swig_types[1]
#define SWIGTYPE_p_UModbus swig_types[1]
#define SWIGTYPE_p_USysError swig_types[2]
#define SWIGTYPE_p_USysError swig_types[2]
#define SWIGTYPE_p_UTimeOut swig_types[3]
#define SWIGTYPE_p_UTimeOut swig_types[3]
#define SWIGTYPE_p_UTypes__Params swig_types[4]
#define SWIGTYPE_p_char swig_types[4]
#define SWIGTYPE_p_char swig_types[5]
static
swig_type_info
*
swig_types
[
6
];
#define SWIGTYPE_p_p_char swig_types[6]
static
swig_module_info
swig_module
=
{
swig_types
,
5
,
0
,
0
,
0
,
0
};
static
swig_type_info
*
swig_types
[
8
];
static
swig_module_info
swig_module
=
{
swig_types
,
7
,
0
,
0
,
0
,
0
};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
...
@@ -5179,233 +5177,6 @@ SWIGINTERN PyObject *UModbus_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
...
@@ -5179,233 +5177,6 @@ SWIGINTERN PyObject *UModbus_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
return
SWIG_Py_Void
();
return
SWIG_Py_Void
();
}
}
SWIGINTERN
int
Swig_var_DefaultID_set
(
PyObject
*
)
{
SWIG_Error
(
SWIG_AttributeError
,
"Variable DefaultID is read-only."
);
return
1
;
}
SWIGINTERN
PyObject
*
Swig_var_DefaultID_get
(
void
)
{
PyObject
*
pyobj
=
0
;
pyobj
=
SWIG_From_long
(
static_cast
<
long
>
(
UTypes
::
DefaultID
));
return
pyobj
;
}
SWIGINTERN
int
Swig_var_DefaultSupplerID_set
(
PyObject
*
)
{
SWIG_Error
(
SWIG_AttributeError
,
"Variable DefaultSupplerID is read-only."
);
return
1
;
}
SWIGINTERN
PyObject
*
Swig_var_DefaultSupplerID_get
(
void
)
{
PyObject
*
pyobj
=
0
;
pyobj
=
SWIG_From_long
(
static_cast
<
long
>
(
UTypes
::
DefaultSupplerID
));
return
pyobj
;
}
SWIGINTERN
PyObject
*
_wrap_new_Params
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
result
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
":new_Params"
))
SWIG_fail
;
result
=
(
UTypes
::
Params
*
)
new
UTypes
::
Params
();
resultobj
=
SWIG_NewPointerObj
(
SWIG_as_voidptr
(
result
),
SWIGTYPE_p_UTypes__Params
,
SWIG_POINTER_NEW
|
0
);
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_add
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
char
*
arg2
=
(
char
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
int
res2
;
char
*
buf2
=
0
;
int
alloc2
=
0
;
PyObject
*
obj0
=
0
;
PyObject
*
obj1
=
0
;
bool
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"OO:Params_add"
,
&
obj0
,
&
obj1
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_add"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
res2
=
SWIG_AsCharPtrAndSize
(
obj1
,
&
buf2
,
NULL
,
&
alloc2
);
if
(
!
SWIG_IsOK
(
res2
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res2
),
"in method '"
"Params_add"
"', argument "
"2"" of type '"
"char *""'"
);
}
arg2
=
reinterpret_cast
<
char
*
>
(
buf2
);
result
=
(
bool
)(
arg1
)
->
add
(
arg2
);
resultobj
=
SWIG_From_bool
(
static_cast
<
bool
>
(
result
));
if
(
alloc2
==
SWIG_NEWOBJ
)
delete
[]
buf2
;
return
resultobj
;
fail
:
if
(
alloc2
==
SWIG_NEWOBJ
)
delete
[]
buf2
;
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argc_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
int
arg2
;
void
*
argp1
=
0
;
int
res1
=
0
;
int
val2
;
int
ecode2
=
0
;
PyObject
*
obj0
=
0
;
PyObject
*
obj1
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"OO:Params_argc_set"
,
&
obj0
,
&
obj1
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_argc_set"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
ecode2
=
SWIG_AsVal_int
(
obj1
,
&
val2
);
if
(
!
SWIG_IsOK
(
ecode2
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
ecode2
),
"in method '"
"Params_argc_set"
"', argument "
"2"" of type '"
"int""'"
);
}
arg2
=
static_cast
<
int
>
(
val2
);
if
(
arg1
)
(
arg1
)
->
argc
=
arg2
;
resultobj
=
SWIG_Py_Void
();
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argc_get
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
int
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:Params_argc_get"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_argc_get"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
result
=
(
int
)
((
arg1
)
->
argc
);
resultobj
=
SWIG_From_int
(
static_cast
<
int
>
(
result
));
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argv_set
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
char
**
arg2
;
void
*
argp1
=
0
;
int
res1
=
0
;
void
*
argp2
=
0
;
int
res2
=
0
;
PyObject
*
obj0
=
0
;
PyObject
*
obj1
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"OO:Params_argv_set"
,
&
obj0
,
&
obj1
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_argv_set"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
res2
=
SWIG_ConvertPtr
(
obj1
,
&
argp2
,
SWIGTYPE_p_p_char
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res2
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res2
),
"in method '"
"Params_argv_set"
"', argument "
"2"" of type '"
"char *[UTypes::Params::max]""'"
);
}
arg2
=
reinterpret_cast
<
char
**
>
(
argp2
);
{
if
(
arg2
)
{
size_t
ii
=
0
;
for
(;
ii
<
(
size_t
)
UTypes
::
Params
::
max
;
++
ii
)
*
(
char
*
*
)
&
arg1
->
argv
[
ii
]
=
*
((
char
*
*
)
arg2
+
ii
);
}
else
{
SWIG_exception_fail
(
SWIG_ValueError
,
"invalid null reference "
"in variable '""argv""' of type '""char *[UTypes::Params::max]""'"
);
}
}
resultobj
=
SWIG_Py_Void
();
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_argv_get
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
char
**
result
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:Params_argv_get"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
0
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"Params_argv_get"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
result
=
(
char
**
)(
char
**
)
((
arg1
)
->
argv
);
resultobj
=
SWIG_NewPointerObj
(
SWIG_as_voidptr
(
result
),
SWIGTYPE_p_p_char
,
0
|
0
);
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_Params_inst
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
result
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
":Params_inst"
))
SWIG_fail
;
result
=
UTypes
::
Params
::
inst
();
resultobj
=
SWIG_NewPointerObj
((
new
UTypes
::
Params
(
static_cast
<
const
UTypes
::
Params
&
>
(
result
))),
SWIGTYPE_p_UTypes__Params
,
SWIG_POINTER_OWN
|
0
);
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
_wrap_delete_Params
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
UTypes
::
Params
*
arg1
=
(
UTypes
::
Params
*
)
0
;
void
*
argp1
=
0
;
int
res1
=
0
;
PyObject
*
obj0
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:delete_Params"
,
&
obj0
))
SWIG_fail
;
res1
=
SWIG_ConvertPtr
(
obj0
,
&
argp1
,
SWIGTYPE_p_UTypes__Params
,
SWIG_POINTER_DISOWN
|
0
);
if
(
!
SWIG_IsOK
(
res1
))
{
SWIG_exception_fail
(
SWIG_ArgError
(
res1
),
"in method '"
"delete_Params"
"', argument "
"1"" of type '"
"UTypes::Params *""'"
);
}
arg1
=
reinterpret_cast
<
UTypes
::
Params
*
>
(
argp1
);
delete
arg1
;
resultobj
=
SWIG_Py_Void
();
return
resultobj
;
fail
:
return
NULL
;
}
SWIGINTERN
PyObject
*
Params_swigregister
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
obj
;
if
(
!
PyArg_ParseTuple
(
args
,(
char
*
)
"O:swigregister"
,
&
obj
))
return
NULL
;
SWIG_TypeNewClientData
(
SWIGTYPE_p_UTypes__Params
,
SWIG_NewClientData
(
obj
));
return
SWIG_Py_Void
();
}
SWIGINTERN
PyObject
*
_wrap_new_UException__SWIG_0
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
SWIGINTERN
PyObject
*
_wrap_new_UException__SWIG_0
(
PyObject
*
SWIGUNUSEDPARM
(
self
),
PyObject
*
args
)
{
PyObject
*
resultobj
=
0
;
PyObject
*
resultobj
=
0
;
UException
*
result
=
0
;
UException
*
result
=
0
;
...
@@ -5848,15 +5619,6 @@ static PyMethodDef SwigMethods[] = {
...
@@ -5848,15 +5619,6 @@ static PyMethodDef SwigMethods[] = {
{
(
char
*
)
"UModbus_getBit"
,
_wrap_UModbus_getBit
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UModbus_getBit"
,
_wrap_UModbus_getBit
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UModbus_mbwrite"
,
_wrap_UModbus_mbwrite
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UModbus_mbwrite"
,
_wrap_UModbus_mbwrite
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UModbus_swigregister"
,
UModbus_swigregister
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UModbus_swigregister"
,
UModbus_swigregister
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_Params"
,
_wrap_new_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_add"
,
_wrap_Params_add
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_set"
,
_wrap_Params_argc_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argc_get"
,
_wrap_Params_argc_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_set"
,
_wrap_Params_argv_set
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_argv_get"
,
_wrap_Params_argv_get
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_inst"
,
_wrap_Params_inst
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"delete_Params"
,
_wrap_delete_Params
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"Params_swigregister"
,
Params_swigregister
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_UException"
,
_wrap_new_UException
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"new_UException"
,
_wrap_new_UException
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"delete_UException"
,
_wrap_delete_UException
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"delete_UException"
,
_wrap_delete_UException
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UException_getError"
,
_wrap_UException_getError
,
METH_VARARGS
,
NULL
},
{
(
char
*
)
"UException_getError"
,
_wrap_UException_getError
,
METH_VARARGS
,
NULL
},
...
@@ -5885,36 +5647,28 @@ static swig_type_info _swigt__p_UException = {"_p_UException", "UException *", 0
...
@@ -5885,36 +5647,28 @@ static swig_type_info _swigt__p_UException = {"_p_UException", "UException *", 0
static
swig_type_info
_swigt__p_UModbus
=
{
"_p_UModbus"
,
"UModbus *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_UModbus
=
{
"_p_UModbus"
,
"UModbus *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_USysError
=
{
"_p_USysError"
,
"USysError *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_USysError
=
{
"_p_USysError"
,
"USysError *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_UTimeOut
=
{
"_p_UTimeOut"
,
"UTimeOut *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_UTimeOut
=
{
"_p_UTimeOut"
,
"UTimeOut *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_UTypes__Params
=
{
"_p_UTypes__Params"
,
"UTypes::Params *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_char
=
{
"_p_char"
,
"char *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_char
=
{
"_p_char"
,
"char *"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
_swigt__p_p_char
=
{
"_p_p_char"
,
"char **"
,
0
,
0
,
(
void
*
)
0
,
0
};
static
swig_type_info
*
swig_type_initial
[]
=
{
static
swig_type_info
*
swig_type_initial
[]
=
{
&
_swigt__p_UException
,
&
_swigt__p_UException
,
&
_swigt__p_UModbus
,
&
_swigt__p_UModbus
,
&
_swigt__p_USysError
,
&
_swigt__p_USysError
,
&
_swigt__p_UTimeOut
,
&
_swigt__p_UTimeOut
,
&
_swigt__p_UTypes__Params
,
&
_swigt__p_char
,
&
_swigt__p_char
,
&
_swigt__p_p_char
,
};
};
static
swig_cast_info
_swigc__p_UException
[]
=
{
{
&
_swigt__p_UException
,
0
,
0
,
0
},
{
&
_swigt__p_UTimeOut
,
_p_UTimeOutTo_p_UException
,
0
,
0
},
{
&
_swigt__p_USysError
,
_p_USysErrorTo_p_UException
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UException
[]
=
{
{
&
_swigt__p_UException
,
0
,
0
,
0
},
{
&
_swigt__p_UTimeOut
,
_p_UTimeOutTo_p_UException
,
0
,
0
},
{
&
_swigt__p_USysError
,
_p_USysErrorTo_p_UException
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UModbus
[]
=
{
{
&
_swigt__p_UModbus
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UModbus
[]
=
{
{
&
_swigt__p_UModbus
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_USysError
[]
=
{
{
&
_swigt__p_USysError
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_USysError
[]
=
{
{
&
_swigt__p_USysError
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UTimeOut
[]
=
{
{
&
_swigt__p_UTimeOut
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UTimeOut
[]
=
{
{
&
_swigt__p_UTimeOut
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_UTypes__Params
[]
=
{
{
&
_swigt__p_UTypes__Params
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_char
[]
=
{
{
&
_swigt__p_char
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_char
[]
=
{
{
&
_swigt__p_char
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
_swigc__p_p_char
[]
=
{
{
&
_swigt__p_p_char
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
}};
static
swig_cast_info
*
swig_cast_initial
[]
=
{
static
swig_cast_info
*
swig_cast_initial
[]
=
{
_swigc__p_UException
,
_swigc__p_UException
,
_swigc__p_UModbus
,
_swigc__p_UModbus
,
_swigc__p_USysError
,
_swigc__p_USysError
,
_swigc__p_UTimeOut
,
_swigc__p_UTimeOut
,
_swigc__p_UTypes__Params
,
_swigc__p_char
,
_swigc__p_char
,
_swigc__p_p_char
,
};
};
...
@@ -6609,10 +6363,6 @@ SWIG_init(void) {
...
@@ -6609,10 +6363,6 @@ SWIG_init(void) {
SWIG_InstallConstants
(
d
,
swig_const_table
);
SWIG_InstallConstants
(
d
,
swig_const_table
);
PyDict_SetItemString
(
md
,(
char
*
)
"cvar"
,
SWIG_globals
());
SWIG_addvarlink
(
SWIG_globals
(),(
char
*
)
"DefaultID"
,
Swig_var_DefaultID_get
,
Swig_var_DefaultID_set
);
SWIG_addvarlink
(
SWIG_globals
(),(
char
*
)
"DefaultSupplerID"
,
Swig_var_DefaultSupplerID_get
,
Swig_var_DefaultSupplerID_set
);
SWIG_Python_SetConstant
(
d
,
"Params_max"
,
SWIG_From_int
(
static_cast
<
int
>
(
UTypes
::
Params
::
max
)));
#if PY_VERSION_HEX >= 0x03000000
#if PY_VERSION_HEX >= 0x03000000
return
m
;
return
m
;
#else
#else
...
...
python/lib/pyUniSet/UProxyObject.cc
View file @
77b6dc12
...
@@ -40,6 +40,11 @@ class UProxyObject_impl:
...
@@ -40,6 +40,11 @@ class UProxyObject_impl:
void
impl_setValue
(
long
id
,
long
val
)
throw
(
UException
);
void
impl_setValue
(
long
id
,
long
val
)
throw
(
UException
);
float
impl_getFloatValue
(
long
id
)
throw
(
UException
);
float
impl_getFloatValue
(
long
id
)
throw
(
UException
);
bool
impl_askIsOK
();
bool
impl_reaskSensors
();
bool
impl_updateValues
();
bool
impl_smIsOK
();
protected
:
protected
:
virtual
void
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
override
;
virtual
void
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
override
;
virtual
void
sensorInfo
(
const
UniSetTypes
::
SensorMessage
*
sm
)
override
;
virtual
void
sensorInfo
(
const
UniSetTypes
::
SensorMessage
*
sm
)
override
;
...
@@ -51,10 +56,12 @@ class UProxyObject_impl:
...
@@ -51,10 +56,12 @@ class UProxyObject_impl:
IOController_i
::
SensorInfo
si
;
IOController_i
::
SensorInfo
si
;
long
value
=
{
0
};
long
value
=
{
0
};
float
fvalue
=
{
0.0
};
float
fvalue
=
{
0.0
};
long
precision
=
{
0
};
};
};
std
::
mutex
mutexSMap
;
std
::
mutex
mutexSMap
;
std
::
unordered_map
<
UniSetTypes
::
ObjectId
,
SInfo
>
smap
;
std
::
unordered_map
<
UniSetTypes
::
ObjectId
,
SInfo
>
smap
;
bool
askOK
=
{
false
};
};
};
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
UProxyObject
::
UProxyObject
()
throw
(
UException
)
UProxyObject
::
UProxyObject
()
throw
(
UException
)
...
@@ -97,6 +104,26 @@ void UProxyObject::setValue( long id, long val ) throw(UException)
...
@@ -97,6 +104,26 @@ void UProxyObject::setValue( long id, long val ) throw(UException)
uobj
->
impl_setValue
(
id
,
val
);
uobj
->
impl_setValue
(
id
,
val
);
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool
UProxyObject
::
askIsOK
()
{
return
uobj
->
impl_askIsOK
();
}
// --------------------------------------------------------------------------
bool
UProxyObject
::
reaskSensors
()
{
return
uobj
->
impl_reaskSensors
();
}
// --------------------------------------------------------------------------
bool
UProxyObject
::
updateValues
()
{
return
uobj
->
impl_updateValues
();
}
// --------------------------------------------------------------------------
bool
UProxyObject
::
smIsOK
()
{
return
uobj
->
impl_smIsOK
();
}
// --------------------------------------------------------------------------
float
UProxyObject
::
getFloatValue
(
long
id
)
throw
(
UException
)
float
UProxyObject
::
getFloatValue
(
long
id
)
throw
(
UException
)
{
{
return
uobj
->
impl_getFloatValue
(
id
);
return
uobj
->
impl_getFloatValue
(
id
);
...
@@ -129,9 +156,18 @@ UProxyObject_impl::~UProxyObject_impl()
...
@@ -129,9 +156,18 @@ UProxyObject_impl::~UProxyObject_impl()
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
void
UProxyObject_impl
::
impl_addToAsk
(
ObjectId
id
)
throw
(
UException
)
void
UProxyObject_impl
::
impl_addToAsk
(
ObjectId
id
)
throw
(
UException
)
{
{
auto
conf
=
uniset_conf
();
UProxyObject_impl
::
SInfo
i
;
UProxyObject_impl
::
SInfo
i
;
i
.
si
.
id
=
id
;
i
.
si
.
id
=
id
;
i
.
si
.
node
=
uniset_conf
()
->
getLocalNode
();
i
.
si
.
node
=
conf
->
getLocalNode
();
auto
inf
=
conf
->
oind
->
getObjectInfo
(
id
);
if
(
inf
&&
inf
->
data
)
{
UniXML
::
iterator
it
(
(
xmlNode
*
)(
inf
->
data
)
);
i
.
precision
=
it
.
getIntProp
(
"precision"
);
}
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
smap
[
id
]
=
i
;
smap
[
id
]
=
i
;
...
@@ -165,6 +201,12 @@ float UProxyObject_impl::impl_getFloatValue( long id ) throw(UException)
...
@@ -165,6 +201,12 @@ float UProxyObject_impl::impl_getFloatValue( long id ) throw(UException)
return
i
->
second
.
fvalue
;
return
i
->
second
.
fvalue
;
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool
UProxyObject_impl
::
impl_askIsOK
()
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
return
askOK
;
}
// --------------------------------------------------------------------------
void
UProxyObject_impl
::
impl_setValue
(
long
id
,
long
val
)
throw
(
UException
)
void
UProxyObject_impl
::
impl_setValue
(
long
id
,
long
val
)
throw
(
UException
)
{
{
try
try
...
@@ -179,9 +221,46 @@ void UProxyObject_impl::impl_setValue( long id, long val ) throw(UException)
...
@@ -179,9 +221,46 @@ void UProxyObject_impl::impl_setValue( long id, long val ) throw(UException)
}
}
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool
UProxyObject_impl
::
impl_reaskSensors
()
{
askSensors
(
UniversalIO
::
UIONotify
);
return
impl_askIsOK
();
}
// --------------------------------------------------------------------------
bool
UProxyObject_impl
::
impl_updateValues
()
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
bool
ret
=
true
;
for
(
auto
&&
i
:
smap
)
{
try
{
i
.
second
.
value
=
ui
->
getValue
(
i
.
second
.
si
.
id
,
i
.
second
.
si
.
node
);
i
.
second
.
fvalue
=
(
float
)
i
.
second
.
value
/
pow
(
10.0
,
i
.
second
.
precision
);
}
catch
(
std
::
exception
&
ex
)
{
mycrit
<<
myname
<<
"(updateValues): "
<<
i
.
second
.
si
.
id
<<
" error: "
<<
ex
.
what
()
<<
std
::
endl
;
ret
=
false
;
}
}
return
ret
;
}
// --------------------------------------------------------------------------
bool
UProxyObject_impl
::
impl_smIsOK
()
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
// проверяем по первому датчику
auto
s
=
smap
.
begin
();
return
ui
->
isExist
(
s
->
second
.
si
.
id
,
s
->
second
.
si
.
node
);
}
// --------------------------------------------------------------------------
void
UProxyObject_impl
::
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
void
UProxyObject_impl
::
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
{
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
std
::
unique_lock
<
std
::
mutex
>
lk
(
mutexSMap
);
askOK
=
true
;
for
(
const
auto
&
i
:
smap
)
for
(
const
auto
&
i
:
smap
)
{
{
try
try
...
@@ -190,9 +269,8 @@ void UProxyObject_impl::askSensors( UniversalIO::UIOCommand cmd )
...
@@ -190,9 +269,8 @@ void UProxyObject_impl::askSensors( UniversalIO::UIOCommand cmd )
}
}
catch
(
std
::
exception
&
ex
)
catch
(
std
::
exception
&
ex
)
{
{
std
::
ostringstream
err
;
mywarn
<<
myname
<<
"(askSensors): "
<<
i
.
second
.
si
.
id
<<
" error: "
<<
ex
.
what
()
<<
std
::
endl
;
err
<<
myname
<<
"(askSensors): "
<<
i
.
second
.
si
.
id
<<
" error: "
<<
std
::
string
(
ex
.
what
());
askOK
=
false
;
throw
UException
(
err
.
str
());
}
}
}
}
}
}
...
...
python/lib/pyUniSet/UProxyObject.h
View file @
77b6dc12
...
@@ -52,6 +52,20 @@ class UProxyObject
...
@@ -52,6 +52,20 @@ class UProxyObject
/*! Сохраняемые датчики не требуют добавления при помощи addToAsk ! */
/*! Сохраняемые датчики не требуют добавления при помощи addToAsk ! */
void
setValue
(
long
id
,
long
val
)
throw
(
UException
);
void
setValue
(
long
id
,
long
val
)
throw
(
UException
);
/*! \return true если заказ датчиков прошёл успешно */
bool
askIsOK
();
/*! перезаказ датчиков */
bool
reaskSensors
();
/*! принудительное обновление значений.
* В случае если не используется заказ датчиков
*/
bool
updateValues
();
/*! Проверка работы SM */
bool
smIsOK
();
protected
:
protected
:
private
:
private
:
...
...
python/lib/pyUniSet/UTypes.h
View file @
77b6dc12
...
@@ -17,7 +17,8 @@
...
@@ -17,7 +17,8 @@
#ifndef UTypes_H_
#ifndef UTypes_H_
#define UTypes_H_
#define UTypes_H_
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#include <UniSetTypes.h>
#include <string>
#include "UniSetTypes.h"
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
namespace
UTypes
namespace
UTypes
{
{
...
@@ -44,6 +45,17 @@ namespace UTypes
...
@@ -44,6 +45,17 @@ namespace UTypes
return
false
;
return
false
;
}
}
bool
add_str
(
const
std
::
string
s
)
{
if
(
argc
<
Params
::
max
)
{
argv
[
argc
++
]
=
UniSetTypes
::
uni_strdup
(
s
);
return
true
;
}
return
false
;
}
int
argc
;
int
argc
;
char
*
argv
[
max
];
char
*
argv
[
max
];
...
...
python/lib/pyUniSet/pyUConnector.py
View file @
77b6dc12
...
@@ -90,6 +90,9 @@ class Params:
...
@@ -90,6 +90,9 @@ class Params:
def
add
(
self
,
s
):
def
add
(
self
,
s
):
return
_pyUConnector
.
Params_add
(
self
,
s
)
return
_pyUConnector
.
Params_add
(
self
,
s
)
def
add_str
(
self
,
s
):
return
_pyUConnector
.
Params_add_str
(
self
,
s
)
__swig_setmethods__
[
"argc"
]
=
_pyUConnector
.
Params_argc_set
__swig_setmethods__
[
"argc"
]
=
_pyUConnector
.
Params_argc_set
__swig_getmethods__
[
"argc"
]
=
_pyUConnector
.
Params_argc_get
__swig_getmethods__
[
"argc"
]
=
_pyUConnector
.
Params_argc_get
__swig_setmethods__
[
"argv"
]
=
_pyUConnector
.
Params_argv_set
__swig_setmethods__
[
"argv"
]
=
_pyUConnector
.
Params_argv_set
...
...
python/lib/pyUniSet/pyUModbus.py
View file @
77b6dc12
...
@@ -130,40 +130,6 @@ class UModbus:
...
@@ -130,40 +130,6 @@ class UModbus:
UModbus_swigregister
=
_pyUModbus
.
UModbus_swigregister
UModbus_swigregister
=
_pyUModbus
.
UModbus_swigregister
UModbus_swigregister
(
UModbus
)
UModbus_swigregister
(
UModbus
)
class
Params
:
__swig_setmethods__
=
{}
__setattr__
=
lambda
self
,
name
,
value
:
_swig_setattr
(
self
,
Params
,
name
,
value
)
__swig_getmethods__
=
{}
__getattr__
=
lambda
self
,
name
:
_swig_getattr
(
self
,
Params
,
name
)
__repr__
=
_swig_repr
max
=
_pyUModbus
.
Params_max
def
__init__
(
self
):
this
=
_pyUModbus
.
new_Params
()
try
:
self
.
this
.
append
(
this
)
except
Exception
:
self
.
this
=
this
def
add
(
self
,
s
):
return
_pyUModbus
.
Params_add
(
self
,
s
)
__swig_setmethods__
[
"argc"
]
=
_pyUModbus
.
Params_argc_set
__swig_getmethods__
[
"argc"
]
=
_pyUModbus
.
Params_argc_get
__swig_setmethods__
[
"argv"
]
=
_pyUModbus
.
Params_argv_set
__swig_getmethods__
[
"argv"
]
=
_pyUModbus
.
Params_argv_get
__swig_getmethods__
[
"inst"
]
=
lambda
x
:
_pyUModbus
.
Params_inst
__swig_destroy__
=
_pyUModbus
.
delete_Params
__del__
=
lambda
self
:
None
Params_swigregister
=
_pyUModbus
.
Params_swigregister
Params_swigregister
(
Params
)
cvar
=
_pyUModbus
.
cvar
DefaultID
=
cvar
.
DefaultID
DefaultSupplerID
=
cvar
.
DefaultSupplerID
def
Params_inst
():
return
_pyUModbus
.
Params_inst
()
Params_inst
=
_pyUModbus
.
Params_inst
class
UException
(
Exception
):
class
UException
(
Exception
):
__swig_setmethods__
=
{}
__swig_setmethods__
=
{}
__setattr__
=
lambda
self
,
name
,
value
:
_swig_setattr
(
self
,
UException
,
name
,
value
)
__setattr__
=
lambda
self
,
name
,
value
:
_swig_setattr
(
self
,
UException
,
name
,
value
)
...
...
python/lib/pyUniSet/pyUniSet.py
View file @
77b6dc12
...
@@ -134,6 +134,9 @@ class Params:
...
@@ -134,6 +134,9 @@ class Params:
def
add
(
self
,
s
):
def
add
(
self
,
s
):
return
_pyUniSet
.
Params_add
(
self
,
s
)
return
_pyUniSet
.
Params_add
(
self
,
s
)
def
add_str
(
self
,
s
):
return
_pyUniSet
.
Params_add_str
(
self
,
s
)
__swig_setmethods__
[
"argc"
]
=
_pyUniSet
.
Params_argc_set
__swig_setmethods__
[
"argc"
]
=
_pyUniSet
.
Params_argc_set
__swig_getmethods__
[
"argc"
]
=
_pyUniSet
.
Params_argc_get
__swig_getmethods__
[
"argc"
]
=
_pyUniSet
.
Params_argc_get
__swig_setmethods__
[
"argv"
]
=
_pyUniSet
.
Params_argv_set
__swig_setmethods__
[
"argv"
]
=
_pyUniSet
.
Params_argv_set
...
@@ -245,6 +248,18 @@ class UProxyObject:
...
@@ -245,6 +248,18 @@ class UProxyObject:
def
setValue
(
self
,
id
,
val
):
def
setValue
(
self
,
id
,
val
):
return
_pyUniSet
.
UProxyObject_setValue
(
self
,
id
,
val
)
return
_pyUniSet
.
UProxyObject_setValue
(
self
,
id
,
val
)
def
askIsOK
(
self
):
return
_pyUniSet
.
UProxyObject_askIsOK
(
self
)
def
reaskSensors
(
self
):
return
_pyUniSet
.
UProxyObject_reaskSensors
(
self
)
def
updateValues
(
self
):
return
_pyUniSet
.
UProxyObject_updateValues
(
self
)
def
smIsOK
(
self
):
return
_pyUniSet
.
UProxyObject_smIsOK
(
self
)
UProxyObject_swigregister
=
_pyUniSet
.
UProxyObject_swigregister
UProxyObject_swigregister
=
_pyUniSet
.
UProxyObject_swigregister
UProxyObject_swigregister
(
UProxyObject
)
UProxyObject_swigregister
(
UProxyObject
)
...
...
python/netdata-plugin/uniset.chart.py
View file @
77b6dc12
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
import
os
import
os
import
sys
import
sys
sys
.
path
.
append
(
"./python_modules"
)
import
random
import
random
import
uniset2
import
uniset2
from
uniset2
import
UniXML
from
uniset2
import
UniXML
from
uniset2
import
UProxyObject
sys
.
path
.
append
(
"./python_modules"
)
from
base
import
SimpleService
from
base
import
SimpleService
NAME
=
os
.
path
.
basename
(
__file__
)
.
replace
(
".chart.py"
,
""
)
NAME
=
os
.
path
.
basename
(
__file__
)
.
replace
(
".chart.py"
,
""
)
...
@@ -23,26 +23,65 @@ retries = 60
...
@@ -23,26 +23,65 @@ retries = 60
class
Service
(
SimpleService
):
class
Service
(
SimpleService
):
sensors
=
[]
sensors
=
[]
uproxy
=
None
smOK
=
False
def
__init__
(
self
,
configuration
=
None
,
name
=
None
):
def
__init__
(
self
,
configuration
=
None
,
name
=
None
):
super
(
self
.
__class__
,
self
)
.
__init__
(
configuration
=
configuration
,
name
=
name
)
super
(
self
.
__class__
,
self
)
.
__init__
(
configuration
=
configuration
,
name
=
name
)
# if 'confile' not in self.configuration:
conf
=
self
.
configuration
.
pop
# self.error("uniset plugin: Unknown confile..")
confile
=
None
# raise RuntimeError
try
:
confile
=
conf
(
'confile'
)
except
KeyError
:
self
.
error
(
"uniset plugin: Unknown uniset config file. Set 'confile: /xxx/zzz/xxxx.xml' in config"
)
raise
RuntimeError
if
not
os
.
path
.
isfile
(
confile
):
self
.
error
(
"uniset plugin: Not found confile '
%
s'"
%
confile
)
raise
RuntimeError
self
.
info
(
"uniset plugin: read from /home/pv/Projects.com/uniset-2.0/conf/test.xml"
)
self
.
name
=
self
.
get_conf_param
(
'name'
,
name
)
self
.
create_charts
(
"/home/pv/Projects.com/uniset-2.0/conf/test.xml"
)
self
.
info
(
"
%
s: uniset plugin: read from
%
s"
%
(
name
,
confile
))
self
.
create_charts
(
confile
)
self
.
init_uniset
(
confile
)
# добавляем датчики в опрос..
for
s
in
self
.
sensors
:
self
.
uproxy
.
addToAsk
(
s
[
1
])
# class Service():
def
init_uniset
(
self
,
confile
):
#
# sensors = []
lst
=
uniset2
.
Params_inst
()
#
for
i
in
range
(
0
,
len
(
sys
.
argv
)):
# def error(self,txt):
if
i
>=
uniset2
.
Params
.
max
:
# print txt
break
;
#
lst
.
add
(
sys
.
argv
[
i
])
# def __init__(self, configuration=None, name=None):
# self.create_charts("./test.xml")
port
=
self
.
get_conf_param
(
'port'
,
''
)
if
port
!=
''
:
self
.
info
(
"
%
s: uniset plugin: --uniset-port
%
s"
%
(
self
.
name
,
port
))
p
=
'--uniset-port'
lst
.
add_str
(
p
)
lst
.
add_str
(
str
(
port
)
)
uname
=
self
.
get_conf_param
(
'uname'
,
'TestProc'
)
self
.
info
(
"
%
s: uniset plugin: init ObjectID '
%
s'"
%
(
self
.
name
,
uname
))
try
:
uniset2
.
uniset_init_params
(
lst
,
confile
);
self
.
uproxy
=
UProxyObject
(
uname
)
except
uniset2
.
UException
,
e
:
self
.
error
(
"uniset plugin: error:
%
s"
%
e
.
getError
())
raise
RuntimeError
def
get_conf_param
(
self
,
propname
,
defval
):
try
:
pop
=
self
.
configuration
.
pop
return
pop
(
propname
)
except
KeyError
:
pass
return
defval
def
find_section
(
self
,
xml
,
secname
):
def
find_section
(
self
,
xml
,
secname
):
node
=
xml
.
findNode
(
xml
.
getDoc
(),
secname
)[
0
]
node
=
xml
.
findNode
(
xml
.
getDoc
(),
secname
)[
0
]
...
@@ -145,7 +184,7 @@ class Service(SimpleService):
...
@@ -145,7 +184,7 @@ class Service(SimpleService):
# params.append(self.get_param(node, 'netdata_divisor', None))
# params.append(self.get_param(node, 'netdata_divisor', None))
# params.append(self.get_param(node, 'netdata_hidden', None))
# params.append(self.get_param(node, 'netdata_hidden', None))
self
.
sensors
.
append
([
id
,
node
.
prop
(
'id'
)])
self
.
sensors
.
append
([
id
,
uniset2
.
to_int
(
node
.
prop
(
'id'
)
)])
chart
[
'lines'
]
.
append
(
params
)
chart
[
'lines'
]
.
append
(
params
)
...
@@ -175,17 +214,51 @@ class Service(SimpleService):
...
@@ -175,17 +214,51 @@ class Service(SimpleService):
return
True
return
True
def
check
(
self
):
# ret = super(self.__class__, self).check()
try
:
uniset2
.
uniset_activate_objects
()
except
uniset2
.
UException
,
e
:
self
.
error
(
"
%
s"
%
e
.
getError
())
raise
False
return
True
def
_get_data
(
self
):
def
_get_data
(
self
):
data
=
{}
data
=
{}
for
netid
,
id
in
self
.
sensors
:
for
netid
,
id
in
self
.
sensors
:
data
[
netid
]
=
random
.
randint
(
0
,
100
)
data
[
netid
]
=
self
.
uproxy
.
getValue
(
id
)
if
len
(
data
)
==
0
:
if
len
(
data
)
==
0
:
return
None
return
None
return
data
return
data
# if __name__ == "__main__":
def
update
(
self
,
interval
):
#
# serv = Service(None,"test")
if
not
self
.
uproxy
.
askIsOK
()
and
not
self
.
uproxy
.
reaskSensors
():
\ No newline at end of file
return
False
prev_smOK
=
self
.
smOK
self
.
smOK
=
self
.
uproxy
.
smIsOK
()
if
prev_smOK
!=
self
.
smOK
and
self
.
smOK
:
self
.
info
(
"SM exist OK. Reask sensors.."
)
self
.
uproxy
.
reaskSensors
()
return
super
(
self
.
__class__
,
self
)
.
update
(
interval
)
if
__name__
==
"__main__"
:
config
=
{}
config
[
'confile'
]
=
'./test.xml'
config
[
'port'
]
=
2809
config
[
'uname'
]
=
'TestProc'
config
[
'update_every'
]
=
update_every
config
[
'priority'
]
=
priority
config
[
'retries'
]
=
retries
serv
=
Service
(
config
,
"test"
)
python/netdata-plugin/uniset.conf
View file @
77b6dc12
update_every
=
5
# netdata python.d.plugin configuration for example
confile
: /
home
/
pv
/
Projects
.
com
/
uniset
-
2
.
0
/
conf
/
test
.
xml
#
\ No newline at end of file
# This file is in YaML format. Generally the format is:
#
# name: value
#
# There are 2 sections:
# - global variables
# - one or more JOBS
#
# JOBS allow you to collect values from multiple sources.
# Each source will have its own set of charts.
#
# JOB parameters have to be indented (using spaces only, example below).
# ----------------------------------------------------------------------
# Global Variables
# These variables set the defaults for all JOBs, however each JOB
# may define its own, overriding the defaults.
# update_every sets the default data collection frequency.
# If unset, the python.d.plugin default is used.
# update_every: 1
# priority controls the order of charts at the netdata dashboard.
# Lower numbers move the charts towards the top of the page.
# If unset, the default for python.d.plugin is used.
# priority: 60000
# retries sets the number of retries to be made in case of failures.
# If unset, the default for python.d.plugin is used.
# Attempts to restore the service are made once every update_every
# and only if the module has collected values in the past.
# retries: 5
# ----------------------------------------------------------------------
# JOBS (data collection sources)
#
# The default JOBS share the same *name*. JOBS with the same name
# are mutually exclusive. Only one of them will be allowed running at
# any time. This allows autodetection to try several alternatives and
# pick the one that works.
#
# Any number of jobs is supported.
#
# All python.d.plugin JOBS (for all its modules) support a set of
# predefined parameters. These are:
#
# job_name:
# name: myname # the JOB's name as it will appear at the
# # dashboard (by default is the job_name)
# # JOBs sharing a name are mutually exclusive
# update_every: 1 # the JOB's data collection frequency
# priority: 60000 # the JOB's order on the dashboard
# retries: 5 # the JOB's number of restoration attempts
#
# uniset-plugin parameters:
# confile: xxx # configure.xml for project
# uname: ObjectName # ObjectID for monitoring process (Default: 'TestProc')
# port: num # port for connect to SharedMemory. Default: get from confile.
#
# Additionally to the above, example also supports the following:
#
# - none
#
# ----------------------------------------------------------------------
# AUTO-DETECTION JOBS
# only one of them will run (they have the same name)
unet
:
confile
: /
home
/
pv
/
Projects
.
com
/
uniset
-
2
.
0
/
conf
/
test
.
xml
name
:
utest
uname
:
TestProc
port
:
53817
project2
:
confile
: /
home
/
pv
/
Projects
.
com
/
uniset
-
2
.
0
/
conf
/
test
.
xml
name
:
project2
uname
:
TestProc1
port
:
53817
project3
:
confile
: /
home
/
pv
/
Projects
.
com
/
uniset
-
2
.
0
/
conf
/
test
.
xml
name
:
project3
uname
:
TestProc2
port
:
53817
python/tests/UInterface/testUI.py
View file @
77b6dc12
...
@@ -18,12 +18,17 @@ if __name__ == "__main__":
...
@@ -18,12 +18,17 @@ if __name__ == "__main__":
break
;
break
;
lst
.
add
(
sys
.
argv
[
i
]
)
lst
.
add
(
sys
.
argv
[
i
]
)
prop
=
'Test'
lst
.
add_str
(
prop
)
try
:
try
:
uniset_init_params
(
lst
,
"test.xml"
);
uniset_init_params
(
lst
,
"test.xml"
);
obj1
=
UProxyObject
(
"TestProc"
)
obj1
=
UProxyObject
(
"TestProc"
)
uniset_activate_objects
()
;
uniset_activate_objects
()
print
"getShortName: id=
%
d name=
%
s"
%
(
1
,
getShortName
(
1
))
print
"getShortName: id=
%
d name=
%
s"
%
(
1
,
getShortName
(
1
))
print
" getName: id=
%
d name=
%
s"
%
(
1
,
getName
(
1
))
print
" getName: id=
%
d name=
%
s"
%
(
1
,
getName
(
1
))
...
...
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