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


Home » Capella » Capella Studio » How to access PVMT property of selected object ?
How to access PVMT property of selected object ? [message #3480] Wed, 21 August 2019 08:07 Go to next message
MehdiBelatrous is currently offline  MehdiBelatrous
Messages: 8
Registered: July 2019
Location: Erlangen
Junior Member
Hello,

I'm developing a viewpoint and I need to get selected objects (ie a logical actor in a LAB) properties assigned with PVMT. Using eclipse Java debugger I went through
 ModelAccessor properties.getProperties() 
and
 Object[] selection 
attributes but I did not find any reference to PVMT properties.

[Updated on: Wed, 21 August 2019 08:07]

Report message to a moderator

Re: How to access PVMT property of selected object ? [message #3516 is a reply to message #3480] Mon, 09 September 2019 04:53 Go to previous message
jmorane is currently offline  jmorane
Messages: 63
Registered: May 2019
Member
Hello,

I successfully had access to a PV of a system actor in a previous VP that I developped :

///////////

import org.polarsys.capella.core.data.capellacore.AbstractPropertyV alue;
import org.polarsys.capella.core.data.capellacore.IntegerPropertyVa lue;
import org.polarsys.capella.core.data.capellacore.PropertyValueGrou p;

/*
//Some coding
*/

PropertyValueGroup PV = actor.getAppliedPropertyValueGroups().get(0);
IntegerPropertyValue IntPV = (IntegerPropertyValue) PV.getOwnedPropertyValues().get(0);
int value = (int) IntPV.getValue();

//////////

However, some problems have to be managed, for example if several PV are applied.

Hope that it helps !
Previous Topic: Sirius Widget creation issue within Capella Studio
Next Topic: Get Logical Component name from Logical Component Port
Goto Forum:
  


Current Time: Sat Mar 28 04:11:35 EST 2020

Total time taken to generate the page: 0.01576 seconds