Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAPython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAPython
Commits
9beb3033
Commit
9beb3033
authored
Oct 09, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding more methods
parent
c9dd2de7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
40 deletions
+73
-40
examples/jupyter/va_notebook_example.ipynb
examples/jupyter/va_notebook_example.ipynb
+26
-40
src/vasingleton.cpp
src/vasingleton.cpp
+3
-0
src/vasingletonmethods.hpp
src/vasingletonmethods.hpp
+44
-0
No files found.
examples/jupyter/va_notebook_example.ipynb
View file @
9beb3033
...
...
@@ -14,9 +14,8 @@
},
{
"cell_type": "code",
"execution_count":
2
,
"execution_count":
null
,
"metadata": {
"collapsed": true,
"scrolled": false
},
"outputs": [],
...
...
@@ -37,21 +36,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"ename": "ImportError",
"evalue": "DLL load failed: Das angegebene Modul wurde nicht gefunden.",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-3-9508d0d3eded>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mva\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mImportError\u001b[0m: DLL load failed: Das angegebene Modul wurde nicht gefunden."
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import va"
]
...
...
@@ -73,9 +60,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"connection_status = va.connect()"
...
...
@@ -91,9 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"connected = va.is_connected()\n",
...
...
@@ -113,9 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"if not connected :\n",
...
...
@@ -125,9 +106,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import os\n",
...
...
@@ -145,9 +124,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"va.add_search_path( current_working_dir )"
...
...
@@ -156,23 +133,32 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"vamods = va.
enumerate
_modules()\n",
"vamods = va.
get
_modules()\n",
"print( vamods )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
"source": [
"hw = va.get_hardware_configuration()\n",
"print( hw )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"core_conf = va.get_core_configuration()\n",
"print( core_conf )"
]
}
],
"metadata": {
...
...
src/vasingleton.cpp
View file @
9beb3033
...
...
@@ -147,6 +147,9 @@ static struct PyMethodDef va_methods[] =
{
"set_core_clock"
,
(
PyCFunction
)
set_core_clock
,
METH_FASTCALL
,
no_doc
},
{
"substitute_macro"
,
(
PyCFunction
)
substitute_macro
,
METH_FASTCALL
,
no_doc
},
{
"find_file_path"
,
(
PyCFunction
)
find_file_path
,
METH_FASTCALL
,
no_doc
},
{
"get_core_configuration"
,
(
PyCFunction
)
get_core_configuration
,
METH_FASTCALL
,
no_doc
},
{
"get_hardware_configuration"
,
(
PyCFunction
)
get_hardware_configuration
,
METH_FASTCALL
,
no_doc
},
{
"get_file_list"
,
(
PyCFunction
)
get_file_list
,
METH_FASTCALL
,
no_doc
},
{
"get_log_level_str"
,
(
PyCFunction
)
get_log_level_str
,
METH_FASTCALL
,
no_doc
},
{
"parse_auralization_mode_str"
,
(
PyCFunction
)
parse_auralization_mode_str
,
METH_FASTCALL
,
no_doc
},
{
"get_auralization_mode_str"
,
(
PyCFunction
)
get_auralization_mode_str
,
METH_FASTCALL
,
no_doc
},
...
...
src/vasingletonmethods.hpp
View file @
9beb3033
...
...
@@ -2153,6 +2153,50 @@ static PyObject* find_file_path( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs,
VAPY_CATCH_RETURN
;
};
static
PyObject
*
get_core_configuration
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"filter_enabled"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|b:get_core_configuration"
,
_keywords
,
0
};
bool
bFilterEnabled
=
true
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
bFilterEnabled
)
)
return
NULL
;
CVAStruct
oCoreConfig
=
g_pVANetClient
->
GetCoreInstance
()
->
GetCoreConfiguration
(
bFilterEnabled
);
return
ConvertVAStructToPythonDict
(
oCoreConfig
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
get_hardware_configuration
(
PyObject
*
,
PyObject
**
,
Py_ssize_t
,
PyObject
*
)
{
VAPY_REQUIRE_CONN_TRY
;
CVAStruct
oHWConfig
=
g_pVANetClient
->
GetCoreInstance
()
->
GetHardwareConfiguration
();
return
ConvertVAStructToPythonDict
(
oHWConfig
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
get_file_list
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"recursive"
,
"filter_suffix_mask"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|bs:get_file_list"
,
_keywords
,
0
};
bool
bFilterEnabled
=
true
;
char
*
pcFilterSuffixMask
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
bFilterEnabled
,
&
pcFilterSuffixMask
)
)
return
NULL
;
std
::
string
sFilterSuffixMask
=
pcFilterSuffixMask
?
std
::
string
(
pcFilterSuffixMask
)
:
"*"
;
CVAStruct
oFileList
=
g_pVANetClient
->
GetCoreInstance
()
->
GetFileList
(
bFilterEnabled
,
sFilterSuffixMask
);
return
ConvertVAStructToPythonDict
(
oFileList
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
get_log_level_str
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
...
...
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