Skip to content
Snippets Groups Projects
Commit db054c9f authored by Alberto Debiasi's avatar Alberto Debiasi
Browse files

Merge remote-tracking branch 'Polarsys/devel' into...

Merge remote-tracking branch 'Polarsys/devel' into 123-Interact-with-Kratos-for-formal-verification-of-state-machines
parents a20992aa 77ecbe73
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,6 @@
This guide provides all necessary information to enable [contributors and committers](https://www.eclipse.org/projects/dev_process/#2_3_1_Contributors_and_Committers) to contribute to Eclipse CHESS.
## Eclipse CHESS
CHESS implements the CHESS UML/SysML profile, a specialization of the Modeling and Analysis of Real-Time and Embedded Systems (MARTE) profile, by producing extensions to Papyrus that provide component-based engineering methodology and tool support for the development of high-integrity embedded systems in different domains like satellite on board systems.
## Developer resources
* [CHESS Website](https://www.eclipse.org/chess/start.html)
* [CHESS devel Website](https://projects.eclipse.org/projects/polarsys.chess)
* [Forum](https://www.eclipse.org/forums/index.php/f/529/)
* Mailing list: Join our [developer list](https://accounts.eclipse.org/mailing-list/chess-dev)
* Bugs? [GitLab] (https://gitlab.eclipse.org/eclipse/chess/chess/-/issues)(previous bug traking system was [BugZilla](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Chess)) is where to report them
## Eclipse Contributor Agreement
Before your contribution can be accepted by the project team, contributors must
......@@ -29,12 +18,6 @@ Contributor Agreement (ECA) on file.
For more information, please see the Eclipse Committer Handbook:
https://www.eclipse.org/projects/handbook/#resources-commit
## Contact
Contact the project developers via the project's "dev" list.
* chess-dev@eclipse.org
## How to contribute
The CHESS source code can be found [here](gitlab.eclipse.org:eclipse/chess/chess.git).
......
# Eclipse CHESS
CHESS implements the CHESS UML/SysML profile, a specialization of the Modeling and Analysis of Real-Time and Embedded Systems (MARTE) profile, by producing extensions to Papyrus that provide component-based engineering methodology and tool support for the development of high-integrity embedded systems in different domains like satellite on board systems.
## Developer resources
* [CHESS Website](https://www.eclipse.org/chess/start.html)
* [CHESS devel Website](https://projects.eclipse.org/projects/polarsys.chess)
* [Forum](https://www.eclipse.org/forums/index.php/f/529/)
* Mailing list: Join our [developer list](https://accounts.eclipse.org/mailing-list/chess-dev)
* Bugs? [GitLab] (https://gitlab.eclipse.org/eclipse/chess/chess/-/issues)(previous bug traking system was [BugZilla](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Chess)) is where to report them
## Contact
Contact the project developers via the project's "dev" list.
* chess-dev@eclipse.org
## How to contribute
The contributor guide can be found [here](https://gitlab.eclipse.org/eclipse/chess/chess/-/blob/devel/CONTRIBUTING.md).
......@@ -145,7 +145,8 @@ public class EntityUtil {
public static final String BOUNDED_TYPE = "MARTE::MARTE_Annexes::VSL::DataTypes::BoundedSubtype";
private static final String COMP_TYPE = "CHESS::ComponentModel::ComponentType";
private static final String COMP_IMPL = "CHESS::ComponentModel::ComponentImplementation";
private static final String SYSVIEW = "CHESS::Core::CHESSViews::SystemView";
private static final String SYSTEM_VIEW = "CHESS::Core::CHESSViews::SystemView";
private static final String ANALYSIS_VIEW = "CHESS::Core::CHESSViews::AnalysisView";
public static final String INSTANTIATED_ARCHITECTURE_CONFIGURATION = "CHESS::ParameterizedArchitecture::InstantiatedArchitectureConfiguration";
......@@ -589,7 +590,7 @@ public class EntityUtil {
UMLPackage.eINSTANCE.getPackage());
for (Package p : packages) {
if (p.getAppliedStereotype(SYSVIEW) != null) {
if (p.getAppliedStereotype(SYSTEM_VIEW) != null) {
logger.debug("Found systemView!");
return p;
}
......@@ -599,10 +600,46 @@ public class EntityUtil {
return null;
}
/**
* Returns the Analysis View package that is found in the given UML model.
*
* @param umlModel
* the model to use
* @return the package
*/
public Package getAnalysisView(UmlModel umlModel) {
if (umlModel == null) {
logger.error("No Models are open");
return null;
}
logger.debug("UML Model name = " + umlModel.getIdentifier());
TreeIterator<EObject> allElements = umlModel.getResource().getAllContents();
if (allElements != null) {
Collection<Package> packages = EcoreUtil.getObjectsByType(iterator2Collection(allElements),
UMLPackage.eINSTANCE.getPackage());
for (Package p : packages) {
if (p.getAppliedStereotype(ANALYSIS_VIEW) != null) {
logger.debug("Found analysisView!");
return (Package) p;
}
}
}
logger.error("AnalysisView not found!");
return null;
}
public Package getCurrentSystemView() {
return getSystemView(UmlUtils.getUmlModel());
}
public Package getCurrentAnalysisView() {
return getAnalysisView(UmlUtils.getUmlModel());
}
public Package createPackage(Package owner, final String elementName) {
return owner.createNestedPackage(elementName);
}
......@@ -1063,6 +1100,25 @@ public class EntityUtil {
throw new Exception("Element does not exist.");
}
public Package getAnalysisViewPackage(Model model) throws Exception {
if (model != null) {
TreeIterator<EObject> allElements = model.eResource().getAllContents();
if (allElements != null) {
Collection<org.eclipse.uml2.uml.Package> packages = EcoreUtil
.getObjectsByType(iterator2Collection(allElements), UMLPackage.eINSTANCE.getPackage());
for (Package p : packages) {
//FIXME stereotype
if (isAnalysisView(p)) {
return p;
}
}
}
}
throw new Exception("Element does not exist.");
}
public EObject getElement(String projectName, String umlFileModelName, String elementID) throws Exception {
Model model = loadModel(projectName, umlFileModelName);
......@@ -2335,13 +2391,38 @@ public class EntityUtil {
public boolean isSystemViewPackage(Element obj) {
if (obj instanceof Package) {
final Package pkg = (Package) obj;
if (pkg.getAppliedStereotype(SYSVIEW) != null) {
if (pkg.getAppliedStereotype(SYSTEM_VIEW) != null) {
return true;
} else {
EList<Package> owningPackages = pkg.allOwningPackages();
for (Package owningPackage : owningPackages) {
//FIXME stereotype
if (owningPackage.getAppliedStereotype(SYSTEM_VIEW) != null) {
return true;
}
}
}
}
return false;
}
/**
* Checks if the selected object is a package in the &lt&ltAnalysisView&gt&gt branch.
*
* @param pkg
* the selected element
* @return true if the package is valid
*/
public boolean isAnalysisView(Element obj) {
if (obj instanceof Package) {
final Package pkg = (Package) obj;
if (pkg.getAppliedStereotype(ANALYSIS_VIEW) != null) {
return true;
} else {
EList<Package> owningPackages = pkg.allOwningPackages();
for (Package owningPackage : owningPackages) {
//FIXME stereotype
if (owningPackage.getAppliedStereotype(SYSVIEW) != null) {
if (owningPackage.getAppliedStereotype(ANALYSIS_VIEW) != null) {
return true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment