Commit 72f516c9 authored by Olivier Lantsoght's avatar Olivier Lantsoght 🏁
Browse files

[MBsysPy][MbsInvDyn] fix pointer name to c structure.

parent ec663896
...@@ -220,20 +220,20 @@ class MbsInvdyn(object): ...@@ -220,20 +220,20 @@ class MbsInvdyn(object):
# If failed to load from buffer, save the user output (and vector) name # If failed to load from buffer, save the user output (and vector) name
if not results_loaded: if not results_loaded:
results_filename = bytes_to_str(ctypes.string_at(self.mbs_dirdyn_ptr.contents.buffers[0].contents.filename)) results_filename = bytes_to_str(ctypes.string_at(self.mbs_invdyn_ptr.contents.buffers[0].contents.filename))
# Check if user vector output have been defined # Check if user vector output have been defined
user_output_vector_filenames = [] user_output_vector_filenames = []
nb_user_output_vector = libutilities.get_output_vector_nb() nb_user_output_vector = libutilities.get_output_vector_nb()
first_buffer_id = self.buffer_nb - nb_user_output_vector first_buffer_id = self.buffer_nb - nb_user_output_vector
for i in range(nb_user_output_vector): for i in range(nb_user_output_vector):
vector_name = bytes_to_str(self.mbs_dirdyn_ptr.contents.buffers[first_buffer_id + i].contents.filename) vector_name = bytes_to_str(self.mbs_invdyn_ptr.contents.buffers[first_buffer_id + i].contents.filename)
user_output_vector_filenames.append(os.path.basename(vector_name)) user_output_vector_filenames.append(os.path.basename(vector_name))
# Check if user auto output have been used # Check if user auto output have been used
user_output_filenames = [] user_output_filenames = []
nbOutput = self.mbs_dirdyn_ptr.contents.user_buffer.contents.nx nbOutput = self.mbs_invdyn_ptr.contents.user_buffer.contents.nx
for i in range(nbOutput): for i in range(nbOutput):
name = bytes_to_str(self.mbs_dirdyn_ptr.contents.user_buffer.contents.names[i]) name = bytes_to_str(self.mbs_invdyn_ptr.contents.user_buffer.contents.names[i])
user_output_filenames.append(self.get_options("resfilename") + '_' + name + '.res') user_output_filenames.append(self.get_options("resfilename") + '_' + name + '.res')
# finish function is required to close the module and write the results to disk. # finish function is required to close the module and write the results to disk.
...@@ -529,3 +529,11 @@ class MbsInvdyn(object): ...@@ -529,3 +529,11 @@ class MbsInvdyn(object):
return options[0] return options[0]
return tuple(options) return tuple(options)
# =========================================================================
# Defining properties
# =========================================================================
@property
def buffer_nb(self):
"""Access to `bufferNb` attribute (read-only)."""
return self.mbs_invdyn_ptr.contents.bufferNb
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