Adding more methods

parent c9dd2de7
......@@ -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": {
......
......@@ -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 },
......
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment