From 9eb7fcd7b441e111be4df3f1accccf7b9f33e073 Mon Sep 17 00:00:00 2001 From: Nuno Guedelha Date: Tue, 20 Apr 2021 03:58:42 +0200 Subject: [PATCH] Moved PostLoadFcn to a script and there, add path of `RobotDynamicsWithContacts` only if required --- init.m => initFcn.m | 0 postLoadFcn.m | 6 ++++++ test_matlab_system_2020b.mdl | 37 ++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 19 deletions(-) rename init.m => initFcn.m (100%) create mode 100644 postLoadFcn.m diff --git a/init.m b/initFcn.m similarity index 100% rename from init.m rename to initFcn.m diff --git a/postLoadFcn.m b/postLoadFcn.m new file mode 100644 index 0000000..fe6eec5 --- /dev/null +++ b/postLoadFcn.m @@ -0,0 +1,6 @@ +% Set path to the utility functions and to WBC library +import wbc.* +addpath(genpath('./src')); +if ~contains(path,'RobotDynamicsWithContacts') + addpath('./lib/+mwbs/RobotDynamicsWithContacts'); +end diff --git a/test_matlab_system_2020b.mdl b/test_matlab_system_2020b.mdl index 5122ae1..ad8a4c1 100644 --- a/test_matlab_system_2020b.mdl +++ b/test_matlab_system_2020b.mdl @@ -7,7 +7,7 @@ Model { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" - ComputedModelVersion "1.115" + ComputedModelVersion "1.117" NumModelReferences 0 NumTestPointedSignals 0 NumProvidedFunctions 0 @@ -53,8 +53,7 @@ Model { PropName "mdlProps" } } - PostLoadFcn "% Set path to the utility functions and to WBC library\nimport wbc.*\naddpath(genpath('./src'));\nad" - "dpath('./lib/+mwbs/RobotDynamicsWithContacts');" + PostLoadFcn "postLoadFcn" EnableAccessToBaseWorkspace on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on @@ -65,7 +64,7 @@ Model { MinMaxOverflowArchiveMode "Overwrite" FPTRunName "Run 1" MaxMDLFileLineLength 120 - InitFcn "init" + InitFcn "initFcn" LastSavedArchitecture "maci64" Object { $PropName "BdWindowsInfo" @@ -214,29 +213,29 @@ Model { Dimension 2 Object { $ObjectID 16 - Type "GLUE2:PropertyInspector" - ID "Property Inspector" - Visible [1] + Type "Simulink:Editor:ReferencedFiles" + ID "Referenced Files" + Visible [0] CreateCallback "" - UserData "" + UserData "{\"filterShowRefModels\":\"true\",\"filterShowRefSubs\":\"true\",\"filterShowOnlyDirtyFiles\":\"false\"}\n" Floating [0] - DockPosition "Right" + DockPosition "Left" Width [640] Height [480] - Minimized "On" + Minimized "Unset" } Object { $ObjectID 17 - Type "Simulink:Editor:ReferencedFiles" - ID "Referenced Files" - Visible [0] + Type "GLUE2:PropertyInspector" + ID "Property Inspector" + Visible [1] CreateCallback "" - UserData "{\"filterShowRefModels\":\"true\",\"filterShowRefSubs\":\"true\",\"filterShowOnlyDirtyFiles\":\"false\"}\n" + UserData "" Floating [0] - DockPosition "Left" + DockPosition "Right" Width [640] Height [480] - Minimized "Unset" + Minimized "On" } PropName "DockComponentsInfo" } @@ -268,9 +267,9 @@ Model { ModifiedByFormat "%" LastModifiedBy "nunoguedelha" ModifiedDateFormat "%" - LastModifiedDate "Tue Apr 20 03:39:00 2021" - RTWModifiedTimeStamp 540789033 - ModelVersionFormat "%" + LastModifiedDate "Tue Apr 20 03:54:18 2021" + RTWModifiedTimeStamp 540791560 + ModelVersionFormat "%" SampleTimeColors off SampleTimeAnnotations off LibraryLinkDisplay "disabled"