This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella Studio » Generation viewpoint
Generation viewpoint [message #195] Tue, 21 April 2015 07:09 Go to next message
gabriel.thirion@areva.com is currently offline  gabriel.thirion@areva.com
Messages: 16
Registered: April 2015
Junior Member
Hi Smile ,

I did a Viewpoint for Capella 8.1 with CapellaStudio.
I followed a exemple on the KitAplha website to create a Cost Viewpoint.

There is no problem to create viewpoint, generated it, and use it ( with a copy/paste of generated viewpoint in "Dropin" folder) in Capella. So I can associate cost and information for each physical compenents .

Like the exemple i've seen on Kitalpha website, i would like to improve this viewpoint to show in red color a compenent with a cost which is higher than a maximum value. Otherwise, the compenent stay in blue color.

To do this modification, i've implemented a method in :
org.polarsys.capella.vp.cost.design / org.polarsys.capella.vp.cost.design.service.nodes / Cost_Service.java

This is the implementation :

public class Cost_Service {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param eObject : the current semantic object
* @param view : the current view
* @param container : the semantic container of the current object
* @generated
*/
public boolean WhenCostTooExpensive(EObject eObject, EObject view,
EObject container) {
Cost cost = (Cost) eObject;
return (cost.getValue() > cost.getMax());

}

This method is called in "Cost.diagram.vptext" file with a Java Condition.

My problem is :
If i generate viewpoint ( right click in "Cost.vpdesc" => "generated and package viewpoint" ) , CapellaStudio give me a folder that i have to copy/paste in the dropin folder of Capella (great!), but the method that i've implemented before is overwrite by an "Auto-generation" . The result is, the method is not take into account in the viewpoint, and, doesn't work in Capella. I don't know how erase or desactivate this auto-generation (i don't know if it's possible)

By against, if i launch Capella directly from CapellaStudio with the "Run" bouton after implemented the method "Cost_Service", Capella 8.0 is launched and the viewpoint works good ! (the method isn't overwrite)

My question is : How generate the viewpoint package for Capella and keep the implementation of the method Cost_Service ?
(I don't wanna use Capella 8.0 which is include in CapellaStudio, but Use Capella 8.1)

I don't now if my explication is understandable, but i can give more details if necessary.

Thanks


Cordially,
THIRION Gabriel
Re: Generation viewpoint [message #197 is a reply to message #195] Tue, 21 April 2015 07:57 Go to previous messageGo to next message
benoit.langlois.thalesgro is currently offline  benoit.langlois.thalesgro
Messages: 30
Registered: December 2014
Member
Hi Gabriel,

The code merger is used during the generation phase. Like the EMF Generation, add a word after the @generated directive, such as NOT.

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param eObject : the current semantic object
* @param view : the current view
* @param container : the semantic container of the current object
* @generated NOT
*/

Benoit
Re: Generation viewpoint [message #201 is a reply to message #197] Tue, 21 April 2015 10:08 Go to previous message
gabriel.thirion@areva.com is currently offline  gabriel.thirion@areva.com
Messages: 16
Registered: April 2015
Junior Member
Hi Benoit,
It's work, thank you for your quick answer
Next Topic: Capella Studio "pre-release" build is available for download
Goto Forum:
  


Current Time: Fri Jun 05 20:41:47 EST 2020

Total time taken to generate the page: 0.01582 seconds