Commit b5ea7b64 authored by Olivier Lantsoght's avatar Olivier Lantsoght
Browse files

[Ctypes] fixing last reference to MDS structures

parent 89eb7b68
......@@ -24,7 +24,7 @@ from .forward_decl import MbsEquil_c
from .forward_decl import UserIoInfo_c
from .forward_decl import UserIO_c
from .forward_decl import UserModel_c
from .forward_decl import MDS_gen_strct_c
from .forward_decl import MbsInfos_c
from .forward_decl import MbsSensor_c
......@@ -60,8 +60,8 @@ mbs_new_user_IO_wrap = ctypes.CFUNCTYPE(ctypes.POINTER(UserIO_c), ctypes.POINTER
mbs_new_user_model_wrap = ctypes.CFUNCTYPE(ctypes.POINTER(UserModel_c))
mbs_delete_user_model_wrap = ctypes.CFUNCTYPE(None, ctypes.POINTER(UserModel_c))
mbs_delete_user_IO_wrap = ctypes.CFUNCTYPE(None, ctypes.POINTER(UserIO_c))
mbs_load_user_model_xml_wrap= ctypes.CFUNCTYPE(None, ctypes.POINTER(MDS_gen_strct_c), ctypes.POINTER(UserModel_c))
mbs_bind_user_model_wrap = ctypes.CFUNCTYPE(None, ctypes.POINTER(MDS_gen_strct_c), ctypes.POINTER(UserModel_c))
mbs_load_user_model_xml_wrap= ctypes.CFUNCTYPE(None, ctypes.POINTER(MbsInfos_c), ctypes.POINTER(UserModel_c))
mbs_bind_user_model_wrap = ctypes.CFUNCTYPE(None, ctypes.POINTER(MbsInfos_c), ctypes.POINTER(UserModel_c))
mbs_print_user_model_wrap = ctypes.CFUNCTYPE(None, ctypes.POINTER(UserModel_c))
# Symbolic
......
......@@ -27,7 +27,7 @@ __DEBUG__ = True
#==============================================================================
# forward declaration of structures (C) as class
#==============================================================================
class MDS_gen_strct_c(ctypes.Structure):
class MbsInfos_c(ctypes.Structure):
pass
class MbsLoadOptions_c(ctypes.Structure):
pass
......
......@@ -24,7 +24,7 @@ from .loadlibs import libmodules
# importing MBsysC related classes
from .forward_decl import MbsData_c
from .forward_decl import MDS_gen_strct_c
from .forward_decl import MbsInfos_c
from .forward_decl import MbsLoader_c
from .forward_decl import MbsPart_c
from .forward_decl import MbsDirdyn_c
......@@ -66,8 +66,8 @@ libutilities.mbs_unset_qa.argtypes =[ctypes.POINTER(MbsData_c), ctypes.c_int]
libutilities.mbs_unset_qa.restype = None
# LoadXML
libloadXML.MDS_mbs_reader.argtypes =[ctypes.c_char_p]
libloadXML.MDS_mbs_reader.restype = ctypes.POINTER(MDS_gen_strct_c)
libloadXML.mbs_info_reader.argtypes =[ctypes.c_char_p]
libloadXML.mbs_info_reader.restype = ctypes.POINTER(MbsInfos_c)
libloadXML.mbs_new_loader.argtypes = None
libloadXML.mbs_new_loader.restype = ctypes.POINTER(MbsLoader_c)
......
......@@ -20,7 +20,7 @@ import ctypes
# importing MBsysC related classes
from .forward_decl import MbsLoadOptions_c
from .forward_decl import MbsLoader_c
from .forward_decl import MDS_gen_strct_c
from .forward_decl import MbsInfos_c
#==============================================================================
......@@ -45,4 +45,4 @@ MbsLoadOptions_c._fields_ =[
#==============================================================================
MbsLoader_c._fields_ =[
("opts", ctypes.POINTER(MbsLoadOptions_c)),
("mds", ctypes.POINTER(MDS_gen_strct_c))]
("mbs_infos", ctypes.POINTER(MbsInfos_c))]
......@@ -241,10 +241,10 @@ class MbsData(object):
"""
# Create a byte object from the string
name_c = name.encode('utf-8')
# Load the MDS_gen_strct and keep a copy
# Load the MbsInfos and keep a copy
if __DEBUG__ : print( "DEBUG>> Loading: '"+name+"' from:'"+os.getcwd()+"'.")
self.mds_gen_strct_ptr = libloadXML.MDS_mbs_reader(name_c)
if __DEBUG__ : print( "DEBUG>> MDS structure loaded")
self.MbsInfos_ptr = libloadXML.mbs_info_reader(name_c)
if __DEBUG__ : print( "DEBUG>> mbs_infos structure loaded")
# Preparing loader and its options for loading
loader = libloadXML.mbs_new_loader()
......@@ -253,8 +253,8 @@ class MbsData(object):
loader.contents.opts.contents.no_project_fct = 1
if __DEBUG__ : print( "DEBUG>> flag ignoring project function set")
loader.contents.mds = self.mds_gen_strct_ptr
if __DEBUG__ : print( "DEBUG>> MDS assigned to loader")
loader.contents.mbs_infos = self.MbsInfos_ptr
if __DEBUG__ : print( "DEBUG>> mbs_infos assigned to loader")
# Load and retrieve MbsData structure
self.mbs_data_ptr = libloadXML.mbs_load_with_loader(name_c, None, loader)
......
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