summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-17 11:01:22 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-17 11:01:22 +0100
commit3269dce32883e14b45cc490a0cc0037b4c808a68 (patch)
treead4a551ac5ccfb8ed74d01095c7dad00c532c84c /views
parented9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590 (diff)
downloadpcitool-3269dce32883e14b45cc490a0cc0037b4c808a68.tar.gz
pcitool-3269dce32883e14b45cc490a0cc0037b4c808a68.tar.bz2
pcitool-3269dce32883e14b45cc490a0cc0037b4c808a68.tar.xz
pcitool-3269dce32883e14b45cc490a0cc0037b4c808a68.zip
1. Add cmake BUILD_PYTHON_MODULES option.
2. Rename log options getting functions. 3. py: - pcilib_init_py() - extract pcilib_py_add_script_dir() - pcilib_py_init_script() - extract view-specialized code to pcilib_py_get_transform_script_properties() 3. pcilib_open(): - move pcilib_init_py() to previous position. - add extract pcilib_py_add_script_dir() 4. pcilib_script_s - change hash key. Now it is (const char*) and contains script file name with extension 5. pcipywrap: - Add pcipywrap.h to remove swig generated file complile warnings - remove -includeall swig flag to prevent crash in multi-thread scripts - change set python expetion mechanic
Diffstat (limited to 'views')
-rw-r--r--views/transform.c17
-rw-r--r--views/transform.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/views/transform.c b/views/transform.c
index 24434e3..eb3572a 100644
--- a/views/transform.c
+++ b/views/transform.c
@@ -68,12 +68,21 @@ pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, const pcilib_v
{
pcilib_access_mode_t mode = 0;
- int err = pcilib_py_init_script(ctx, v_desc->module, &mode);
+ int err = pcilib_py_init_script(ctx, v_desc->module);
if(err)
{
- pcilib_error("Failed init script module (%s) - error %i", v_desc->module, err);
+ pcilib_error("Failed init script module (%s) - error %i",
+ v_desc->module, err);
return NULL;
- }
+ }
+ err = pcilib_py_get_transform_script_properties(ctx, v_desc->module,
+ &mode);
+ if(err)
+ {
+ pcilib_error("Failed get transform script properties (%s) - error %i",
+ v_desc->module, err);
+ return NULL;
+ }
v_desc->base.mode |= PCILIB_REGISTER_RW;
mode |= PCILIB_REGISTER_INCONSISTENT;
@@ -87,7 +96,5 @@ pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, const pcilib_v
return view_ctx;
}
-
-
const pcilib_view_api_description_t pcilib_transform_view_api =
{ PCILIB_VERSION, sizeof(pcilib_transform_view_description_t), pcilib_transform_view_init, NULL, pcilib_transform_view_free_description, pcilib_transform_view_read, pcilib_transform_view_write };
diff --git a/views/transform.h b/views/transform.h
index c2f0a98..8c9321d 100644
--- a/views/transform.h
+++ b/views/transform.h
@@ -9,7 +9,7 @@ typedef struct {
pcilib_view_description_t base;
const char *read_from_reg; /**< Formula explaining how to convert the register value to the view value */
const char *write_to_reg; /**< Formula explaining how to convert from the view value to the register value */
- char *module; /**< Python script module name (without extension) */
+ const char *module; /**< Python script module name (without extension) */
} pcilib_transform_view_description_t;
#ifndef _PCILIB_VIEW_TRANSFORM_C