How to work with Simulink project and libraries?

조회 수: 5 (최근 30일)
olivier
olivier 2012년 5월 9일
Hello,
We have a folder structure like: C:\Project1 C:\Project2 C:\CommonLib
We would like to have the CommonLib files to be part of each project, to be able to integrate those common files to SVN. So a change of a CommonLib file by a developer working on Project1 will be propagated for another developer working on Project2. When I try to add the CommonLib files to the Simulink Project1, I get the error message that the file in not in the root directory of the project.
I wonder then how to handle common libraries within project. Can someone please help me to understand that?
Thanks

답변 (2개)

C.J. Harris
C.J. Harris 2012년 5월 9일
You can handle the common libraries within SVN using the 'externals' definition for both projects, this way you could ensure they were always added to your project root directory on checkout.
If they are not within your project root directory on checkout you would have to add the folder to your MATLAB path. This could either be done temporarily by your setup scripts, or permanently by added the CommonLib folder to your MATLAB path.
  댓글 수: 1
olivier
olivier 2012년 5월 9일
Hello Chris,
Thanks for your help, but I don't want to have the ConmmonLib on checkout in my project root directory to avoid multiple copies of the common files (which is the aim of common libs, I guess).
I've added the CommonLib to the Matlab path, still I can't add the CommonLib/files to the Simulink project.
I suppose that I'm not using the product as it should be (for team development), may be you could point me to some documentation which explains how to handle team development, where each developer is responsible for a module within a larger model, and with the use of libraries shared among the developers.

댓글을 달려면 로그인하십시오.


Gavin Walker
Gavin Walker 2012년 6월 20일
There are a number of different workflows that might work here. Something that influences the choice of workflow is "how often do the libraries in CommonLib get updated?"
If the answer is that CommonLib is updated infrequently, then it might be possible to treat CommonLib like a toolbox or blockset. You can use a project start up shortcut to add the network location of CommonLib to the MATLAB path (and have a shutdown shortcut to remove it). When it is discovered as a dependent file or files of the project then it can be marked as an "external dependency" to show that it is expected for it not to be part of the current project.
CommonLib itself might well be in its own Simulink Project that is opened when development work is needed on CommonLib. If a user of Project1 has made changes to CommonLib then they can open the CommonLib Simulink Project, check for modified files, run the tests and validation procedures that are specific to the CommonLib Simulink Project and, once all changes are tested & reviewed, submit. Other users of CommonLib will get these changes the next time they update their CommonLib project.
There are a lot of variants on these workflows, such as SVN externals as described by Chris.

카테고리

Help CenterFile Exchange에서 Dependency Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by