Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Multi component dependencies compiler
Topic Summary:
Created On: 22-Jun-2006 04:28
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Jun-2006 04:28
User is offline View Users Profile Print this message


Eyal Balla

Posts: 2
Joined: 22-Jun-2006

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.
Report this to a Moderator Report this to a Moderator
 27-Jun-2006 15:36
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

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
Report this to a Moderator Report this to a Moderator
 9-Feb-2007 17:55
User is offline View Users Profile Print this message


Kevin Nguyen

Posts: 14
Joined: 13-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 12-Feb-2007 13:10
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

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
Report this to a Moderator Report this to a Moderator
 12-Feb-2007 13:47
User is offline View Users Profile Print this message


Kevin Nguyen

Posts: 14
Joined: 13-Dec-2006

Simon,
Thank you very much for the response. I guess there is no other way around the problem then.

Thanks,
Kevin
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.