![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Multi component dependencies compiler Topic Summary: Created On: 22-Jun-2006 04:28 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
hi,
I my product i have many components. I would like to have a VB script that would check that all the components are complied to the current updated model. does any body know of such a script? thanks, Eyal Balla MLM IAI Israel. |
|
![]() |
|
![]() |
|
Hi Eyal
Let's separate the two steps to this: [list=1] [*]generate all the component code [*]build all the components [/list] Step 1 can be addressed via VBA; the following script generates all configurations in a model: [CODE]Public Sub generateAllConfigurations() 'Get current project Dim rpy As RPProject Set rpy = getProject 'Save the current active component/configuration Dim cmpSaved As RPComponent Dim cfgSaved As RPConfiguration Set cmpSaved = rpy.activeComponent Set cfgSaved = rpy.activeConfiguration 'Iterate through each configuration in the project Dim cfg As RPConfiguration Dim elt As RPModelElement For Each elt In rpy.getNestedElementsRecursive If TypeOf elt Is RPConfiguration Then Set cfg = elt rpy.setActiveComponent elt.owner.name rpy.setActiveConfiguration elt.name generate End If Next 'Restore the active component/configuration rpy.setActiveComponent cmpSaved.name rpy.setActiveConfiguration cfgSaved.name End Sub[/CODE] This could be fairly easily refined to generate only the code for dependent components. (In fact, such a macro is in my short-term plan!) For step 2, I recommend customising your makefile template to make use of the $OMModelLibs keyword. This keyword evaluates to a list of all the library components that the current component depends upon; it doesn't support executable to executable dependencies ![]() (Incidentally it's not easy to build dependent components via VBA, since the COM API make command seems to run asynchronously, so all your components end up building in parallel.) So, not a direct solution, I'm afraid, but some hopefully useful pointers. best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|
![]() |
|
![]() |
|
Simon,
I am very glad that I found your script which helps to generate code for every component in a project. I have tried to build every component as well by adding "make" after "generate" step. Unfortunately, the script only builds one component and then it stops. Do you how can I fix the scripts so that it builds every single component in a project? Thanks, Kevin |
|
![]() |
|
![]() |
|
Hi Kevin
In the past, I've found a couple of snags with getting this working. Firstly, if you have inter-component dependencies, you'll find you need to generate all components before you build any. This could be easily resolved by repeating the iteration in the macro, this time replacing "generate" with "make". Unfortunately, the second problem is not so easy to solve; the "make" command runs asynchronously; Rhapsody doesn't wait for the first component to build before starting to build the second. This can appear as though only one component is being built, which is I think what you're observing. There may be some way around this, but I recommend creating a top-level make file to manage the build of your multiple components; just start this single make off after you've done your code generation. Let me know how you get on! regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|
![]() |
|
![]() |
|
Simon,
Thank you very much for the response. I guess there is no other way around the problem then. Thanks, Kevin |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Multi component dependencies compiler
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.