Hello @Thierry_Poupon ,
Concerning EIE type, you can use something like this :
For EIE in all_EIE:
EIE_Type = EIE.get_type()
EIE_Type_elem = EIE_Type[0].get_name()
Best regards,
Sophie
Hello @Thierry_Poupon ,
Concerning EIE type, you can use something like this :
For EIE in all_EIE:
EIE_Type = EIE.get_type()
EIE_Type_elem = EIE_Type[0].get_name()
Best regards,
Sophie
@Sophie_Plazant
Thanks Sophie
Hi Sophie
Iâm trying to get the list of SCE: System Component exchanges:
I managed to get those outgoing from system actors⊠but now I need to append the ones outgoing from system⊠(Some CE are crossing from one actor to the next, so O canât really take the inputs without having doublons)
Then for system: I tried to reuse same as for actors, but it does not workâŠ
Currently this script has already 3 loops and 3 browses because I had to use component ports
The âget_outgoing component_exchange()â donât run: issue in capella.py
Thanks for any helpâŠ
May be Iâll try to save a loop and run with connected componenent from CEâŠ
Last try with this kind of script:
for elem_SAC in all_SAC:
Acteur = elem_SAC
#print(Acteur)
#SACOGCE = elem_SAC.get_outgoing_component_exchanges()
#print('found sourced CE')
ACPort = elem_SAC.get_contained_component_ports()
for elem_CP in ACPort:
SACPO=elem_CP.get_orientation()
if SACPO == "OUT" or SACPO == "INOUT":
SACOGCE=elem_CP.get_component_exchanges()
for elem_CE in SACOGCE:
i = i + 1
worksheet.cell(row = i, column = 1).value = elem_CE.get_name()
All_SYS=[System]
for elem_SYS in All_SYS:
SYSCPort = elem_SYS.get_contained_component_ports()
print(elem_SYS)
for elem_CP in SYSCPort:
SYCPO=elem_CP.get_orientation()
print(SYCPO)
âââ
for elem_CE in SYSOGCE:
i = i + 1
worksheet.cell(row = i, column = 1).value = elem_CE.get_name()
âââ
Python wants a âselfâ as argument in get_contained_component_ports(self), but this generates another one, I tried as well the string âselfâ but the string doesnât fit either.
So now I try yours for EIEâŠ
Regards
Thierry
Here is the result:
py4j.Py4JException: An exception was raised by the Python Proxy. Return Message: Traceback (most recent call last):
File âC:\c520x\capella\plugins\org.eclipse.ease.lang.python.py4j_0.7.0.I201907020902\pysrc\ease_py4j_main.pyâ, line 186, in runcode
exec(compiled, self.locals)
File âL/Python4Capella/Scripts for MAEVA/Export_MAEVA_EI-EIE.pyâ, line 117, in
return _pyease_ListConverter().convert([
File âL/Python4Capella/simplified_api/capella.pyâ, line 202, in get_element_type
AttributeError: TODO
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File âC:\c520x\capella\plugins\py4j-python_0.10.9.3-bnd-2odeag\src\py4j\clientserver.pyâ, line 581, in _call_proxy
return_value = getattr(self.pool[obj_id], method)(*params)
File âC:\c520x\capella\plugins\org.eclipse.ease.lang.python.py4j_0.7.0.I201907020902\pysrc\ease_py4j_main.pyâ, line 335, in executeScript
return self.executeCommon(code_text, self.interp.runcode, filename)
File âC:\c520x\capella\plugins\org.eclipse.ease.lang.python.py4j_0.7.0.I201907020902\pysrc\ease_py4j_main.pyâ, line 313, in executeCommon
execution_result = code_exec(code_text, filename)
File âC:\c520x\capella\plugins\org.eclipse.ease.lang.python.py4j_0.7.0.I201907020902\pysrc\ease_py4j_main.pyâ, line 213, in runcode
except Exception:
TypeError: catching classes that do not inherit from BaseException is not allowed
at py4j.Protocol.getReturnValue(Protocol.java:476)
at py4j.reflection.PythonProxyHandler.invoke(PythonProxyHandler.java:108)
at com.sun.proxy.$Proxy25.executeScript(Unknown Source)
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.internalExecute(Py4jScriptEngine.java:236)
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.execute(Py4jScriptEngine.java:226)
at org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:245)
at org.eclipse.ease.AbstractScriptEngine.run(AbstractScriptEngine.java:309)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Have a good WE
Regards
Thierry
Hello @Thierry_Poupon ,
you can use as an alternative to get outgoing component exchanges : capella_query_by_name(e_object,âOutgoing Component Exchangesâ).
To see the available query, you can use available_query_names(e_object).
For âget_contained_components_ports()â, do you have an error with elem_SYS.get_contained_components_ports()?
Best regards
Sophie
Hello@Sophie
I understood that system is not an item but a singleton where a system element isâŠ
This is causing me an additional browse and loop while getting modes and states.
For SCE, what I did is pretend I wanted all CE, then add them on list when connected component was system actor. Doing this, SCE between system actors are seen twice. I solve it in the excel part by removing duplicates while reading export. The constraint there is not to have several with the same name.
I consider this point as solved.
Thanks anyway
I tried to continue exchange items checksâŠ
Iâm still missing a solution that alerts untyped EIE, and for untyped properties should be OK, butâŠ
Reference value seems to be a project alone: each kind has to be separate (boolean; enumeration; string and numerical). On the other hand I couldnât get the list of literals for each detail kind (some donât have like physical quantities, they use numerics which have unitsâŠ)
Class operation parameter is toot complicated for the moment, and needs imbricated loops⊠parameter have no accessible attribute.
As you can see, itâs not finished!
To come back to state machines: in my project I have a governed (modes driven by system of interest) way bigger than system of interest (which is âsystemâ), so under system I have one state machine for the governed system lifecycle (with 2 main regions), one mode machine for its modes (with 2 main regions), then the mode machine for my system⊠each time I have imbricated mode or states.
The target is to lists all modes or states for each machine, and then check the traces linking governed system phase; governed system mode and system of interest modes.
Next step is to check that system functions involved in required capacity during a phase are woken up by the relevant system of interest mode⊠(then Iâm speaking only about system, not actors)âŠ
In this part I just beginâŠ
Many thanks again for your support and your time
Best regards
Thierry
Hi there,
As mentionned in preceding answer to Sophie Plazanet, Iâm looking for a way to find incoming traces to states (and modes which seems to be same class).
There is no get_traces in states, and Iâm lacking B-planâŠ
Thanks for any help.
Thierry
Hello @Thierry_Poupon ,
You can use capella_query_by_name(e_object,âOutgoing Generic Tracesâ) et capella_query_by_name(e_object,âIncoming Generic Tracesâ).
Best regards
Sophie
Thanks Sophie
Can you tell me more about exact syntax?
Regards
Thierry
Edit1: Could this work for EI mechanism or data type?
Edit2: Found the syntax, incoming works, not outgoing but thatâs enough for me.