Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Inter model consistency #6

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
9b38496
clean project due to changes in class generation
Andreas222 Jul 5, 2018
b57d199
some cleanups - no generated files in git
Andreas222 Jul 16, 2018
12761f4
add a reaction to a change of the ID of a plcopen routine
Andreas222 Jul 16, 2018
072a283
add project for CAEX to PLCopen transformations
Andreas222 Jul 16, 2018
ec208c9
bugfixing: adapting plugin-xml files
Andreas222 Jul 18, 2018
c91d054
Aufsetzen Testframework
Andreas222 Aug 1, 2018
3f268b3
some new reactions: CAEX2PLCopen
Andreas222 Aug 15, 2018
40ffb1e
Verbesserung der Reactions und Routinen, Liste noch fehlender Reactio…
Andreas222 Aug 16, 2018
7537ba4
Some more reactions and routines for caex -> plcopen
Andreas222 Aug 23, 2018
f017bd6
some bugfixing
Andreas222 Aug 28, 2018
0631c36
implement all reactions for internalElements and SystemUnitClasses (w…
Andreas222 Aug 30, 2018
be54f29
Refactoring Inter-Model-Consistency
Andreas222 Sep 5, 2018
dd09212
Refactoring step 2
Andreas222 Sep 5, 2018
5dcee87
Refactoring step 3
Andreas222 Sep 5, 2018
2f3cfa3
adding some checks for routines, bugfixing
Andreas222 Sep 6, 2018
2787d1d
Refactoring step 4, adding structure for reactions to AML, Collada an…
Andreas222 Sep 25, 2018
f4189f4
some adaptations because of changes in the domains and the metamodels
Andreas222 Sep 25, 2018
be8e503
some more necessary changes
Andreas222 Sep 25, 2018
b23f7a5
some more refactoring, bugfixing and cleanup
Andreas222 Sep 25, 2018
7016620
some necessary adaptations on ChangePropagationSpecifications
Andreas222 Sep 25, 2018
1168b97
change some statements from "retrieve one" to "retrieve many"
Andreas222 Sep 27, 2018
e5178b1
examples for testing
Andreas222 Sep 27, 2018
e2431e5
some more changes due to "retrieve many"
Andreas222 Sep 27, 2018
c6ac977
add implementation for utils Methods
Andreas222 Sep 27, 2018
e319d2e
add utils method to work with aggregator metamodel
Andreas222 Sep 27, 2018
7b44af7
add implementation for "path" changes
Andreas222 Sep 28, 2018
0495d3a
add and modify examples for testing
Andreas222 Sep 28, 2018
b3d489b
some bugfixing
Andreas222 Sep 28, 2018
e6a6bc5
implementing some tests
Andreas222 Sep 28, 2018
f1c59dd
add workaround for delete many
Andreas222 Oct 5, 2018
1327a9b
some bugfixing - testframework is working now
Andreas222 Oct 8, 2018
34bb1cc
some more tests and bugfixing
Andreas222 Oct 8, 2018
8197186
some more tests and bugfixing
Andreas222 Oct 9, 2018
60223db
add implementation for path changes in aml aggregator
Andreas222 Oct 15, 2018
8cef075
change implementation for "attribute replaced at" reactions
Andreas222 Oct 15, 2018
74f77b7
add reactions for add and remove changes in AML aggregator
Andreas222 Oct 15, 2018
df05d71
add some output statements for debugging
Andreas222 Oct 15, 2018
98bddad
add some reactions to keep structure of plcopen and collada valid
Andreas222 Oct 15, 2018
274238e
add reactions and routines to keep structure of PLCopen consistent
Andreas222 Oct 16, 2018
4d3a641
some more reactions and routines to keep collada and plcopen structur…
Andreas222 Oct 16, 2018
8994d92
add the right datatype for routines for collada
Andreas222 Oct 16, 2018
9fdaa8a
add implementation for structure of plcopen files and for creating re…
Andreas222 Oct 16, 2018
552a97f
some cleanups
Andreas222 Oct 16, 2018
f6690b7
Implementierung von Zurückrollen von Änderungen
Andreas222 Oct 16, 2018
485876b
add implementation for reactions and routines because of no recursion…
Andreas222 Oct 16, 2018
eca66ab
add collada example
Andreas222 Oct 18, 2018
c74c385
add user interaction to tests
Andreas222 Oct 18, 2018
53df9b0
add some tests and bugfixing
Andreas222 Oct 18, 2018
7b8df2d
change implementation for aggregator changes
Andreas222 Oct 18, 2018
d9ff532
some refactoring: Logger instead of System.out, abstraction for searc…
Andreas222 Oct 22, 2018
a990c93
change of correspondences: always use of statement for creation, add …
Andreas222 Oct 22, 2018
c84d7be
add TODO for all rollbacks
Andreas222 Oct 22, 2018
5b4e818
add implementation for creating resources
Andreas222 Oct 22, 2018
1872b07
some refactoring
Andreas222 Oct 22, 2018
f3de926
add implementation for interface libraries
Andreas222 Oct 22, 2018
bce00d2
add correspondences between InterfaceClass and ExternalInterface
Andreas222 Oct 23, 2018
430b1b7
improve tags for correspondences
Andreas222 Oct 23, 2018
d47e528
implementation of name changes
Andreas222 Oct 23, 2018
f567e63
add implementation for id changes and deletions in collada
Andreas222 Oct 23, 2018
4ac0b54
add better implementation to keep Collada consistent
Andreas222 Oct 24, 2018
547fcb3
add some outputs for debugging
Andreas222 Oct 24, 2018
9297857
add implementation to adapt inheritance during deletion
Andreas222 Oct 24, 2018
df35d1d
some small changes
Andreas222 Oct 25, 2018
f69fe94
some improvements and refactoring of tests
Andreas222 Oct 26, 2018
7b15b11
add tests for deletion of classes and class-libs
Andreas222 Oct 27, 2018
7ef745f
add tests for name changes in class lib
Andreas222 Oct 27, 2018
187ec9e
refactoring of utils
Andreas222 Oct 29, 2018
fb085c7
add structure for more tests
Andreas222 Oct 29, 2018
10a44ba
some small changes
Andreas222 Nov 7, 2018
d2a5f8c
add tests for collada and plc files
Andreas222 Nov 7, 2018
672698a
structure for CAEX Tests
Andreas222 Nov 9, 2018
8cb85f8
Merge branch 'Inter-model-consistency' of https://github.com/vitruv-t…
Andreas222 Nov 9, 2018
bd8fe38
adaptations due to changes in the metamodels
Andreas222 Nov 9, 2018
9d9d7c8
Tests refactoring
Andreas222 Nov 15, 2018
9d3b680
test models for emf compare
Andreas222 Nov 15, 2018
e7f632f
some debugging - caex models
Andreas222 Nov 26, 2018
4774e4a
some bugfixing for caex and plc models
Andreas222 Nov 26, 2018
239fbe4
some bugfixing for collada model instances
Andreas222 Nov 27, 2018
3b71908
some bugfixing for caex and aml-aggregator
Andreas222 Dec 1, 2018
6ed47f0
some refactoring of tests
Andreas222 Dec 1, 2018
ac6c8e4
add project for Evaluation
Andreas222 Dec 1, 2018
0e8683a
Eigenschaftsbasiertheit, Evaluation und Tests
Andreas222 Dec 6, 2018
ebdffc5
implementation of property-based rules for prototype/clone and rules …
Andreas222 Dec 9, 2018
5004b3f
evaluation v11
Andreas222 Dec 9, 2018
a09b30c
Evaluation v12
Andreas222 Dec 9, 2018
a211f58
evaluation v13
Andreas222 Dec 9, 2018
bdb4fcf
Evaluation v14
Andreas222 Dec 9, 2018
7ed0099
Evaluation v20
Andreas222 Dec 10, 2018
16f095e
Evaluation v27
Andreas222 Dec 10, 2018
003775b
Evaluation v30
Andreas222 Dec 10, 2018
4eedb14
Evaluation v31
Andreas222 Dec 10, 2018
7cc4ea4
some small adaptations
Andreas222 Dec 11, 2018
b9a40d1
add some models for evaluation
Andreas222 Dec 11, 2018
ec35ae5
evaluation implicit references
Andreas222 Dec 13, 2018
a86010b
kleine Konzepterweiterung
Andreas222 Dec 16, 2018
a8a1ca9
last commit at FZI
Andreas222 Jan 22, 2019
5f96b90
some last adaptations: restructuring and comments
Andreas222 Feb 3, 2019
7d7c2e3
Merge remote-tracking branch 'remotes/origin/master' into Inter-model…
Andreas222 Feb 8, 2019
f5a5e0d
Adapt to modified Reactions syntax
HeikoKlare Feb 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tools.vitruv.applications.plcopencaex.plcopen2caex</name>
<name>tools.vitruv.applications.automationml.demo</name>
<comment></comment>
<projects>
</projects>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CreateVsumTest
Bundle-SymbolicName: tools.vitruv.applications.plcopencaex.demo;singleton:=true
Bundle-SymbolicName: tools.vitruv.applications.automationml.demo;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: tools.vitruv.applications.plcopencaex.demo.Activator
Bundle-Activator: tools.vitruv.applications.automationml.caexplcopen.demo.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Require-Bundle: com.google.guava,
Expand All @@ -18,11 +18,13 @@ Require-Bundle: com.google.guava,
tools.vitruv.framework.tuid,
tools.vitruv.framework.metamodel,
tools.vitruv.framework.change.processing,
tools.vitruv.applications.plcopencaex.plcopen2caex,
tools.vitruv.framework.vsum,
tools.vitruv.framework.util,
tools.vitruv.domains.plcopen,
tools.vitruv.domains.caex,
tools.vitruv.extensions.emf;bundle-version="0.2.0",
tools.vitruv.testutils;bundle-version="0.2.0",
tools.vitruv.extensions.emf.monitorededitor;bundle-version="0.2.0"
tools.vitruv.extensions.emf.monitorededitor;bundle-version="0.2.0",
tools.vitruv.applications.automationml;bundle-version="1.0.0",
tools.vitruv.domains.collada;bundle-version="0.3.0",
tools.vitruv.domains.aml;bundle-version="0.3.0",
tools.vitruv.testutils;bundle-version="0.3.0"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension
point="org.eclipse.ui.handlers">
<handler
class="tools.vitruv.applications.plcopencaex.demo.PLCOpenCAEXProjectAndVsumGenerationHandler"
class="tools.vitruv.applications.automationml.caexplcopen.demo.PLCOpenCAEXProjectAndVsumGenerationHandler"
commandId="tools.vitruv.applications.plcopencaex.demo.PLCOpenCAEXProjectAndVsumGeneration">
</handler>
</extension>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.vitruv.applications.plcopencaex.demo;
package tools.vitruv.applications.automationml.caexplcopen.demo;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package tools.vitruv.applications.plcopencaex.demo
package tools.vitruv.applications.automationml.caexplcopen.demo

import org.eclipse.core.resources.IProject
import org.eclipse.core.runtime.CoreException
import tools.vitruv.applications.plcopencaex.plcopen2caex.PLCOpen2CAEXChangePropagationSpecification
import tools.vitruv.applications.automationml.caexchanges.CombinedCAEXChangePropagationSpecification
import tools.vitruv.domains.emf.builder.VitruviusEmfBuilder
import tools.vitruv.domains.emf.builder.VitruviusEmfBuilderApplicator
import tools.vitruv.framework.change.processing.ChangePropagationSpecification
import tools.vitruv.testutils.util.TestUtil
import tools.vitruv.framework.tuid.TuidManager
import tools.vitruv.framework.userinteraction.impl.UserInteractor
import tools.vitruv.framework.vsum.InternalVirtualModel
import tools.vitruv.domains.plcopen.PLCOpenDomainProvider
import tools.vitruv.domains.plcopen.PLCOpenDomain
Expand All @@ -18,14 +17,15 @@ import tools.vitruv.framework.domains.VitruvDomain
import tools.vitruv.framework.ui.monitorededitor.ProjectBuildUtils
import org.eclipse.core.resources.ResourcesPlugin
import static edu.kit.ipd.sdq.commons.util.org.eclipse.core.resources.IProjectUtil.*;
import tools.vitruv.framework.userinteraction.UserInteractionFactory

class PLCOpenCAEXProjectAndVsumGeneration {

public def void createProjectAndVsum() {
def void createProjectAndVsum() {
TuidManager.instance.reinitialize();
val project = createTestProject("testProject");
val virtualModel = createVirtualModel("testProjectVsum");
virtualModel.userInteractor = new UserInteractor();
virtualModel.userInteractor = UserInteractionFactory.instance.createDialogUserInteractor();
val VitruviusEmfBuilderApplicator emfBuilder = new VitruviusEmfBuilderApplicator();
emfBuilder.addToProject(project , virtualModel.folder, #[PLCOpenDomain.FILE_EXTENSION, CAEXDomain.FILE_EXTENSION]);
// build the project
Expand All @@ -38,7 +38,7 @@ class PLCOpenCAEXProjectAndVsumGeneration {
project.create(null);
project.open(null);
val virtualModel = TestUtil.createVirtualModel(project.location.toFile, false, metamodels, createChangePropagationSpecifications(),
new UserInteractor()
UserInteractionFactory.instance.createDialogUserInteractor()
);
return virtualModel;
}
Expand All @@ -48,7 +48,7 @@ class PLCOpenCAEXProjectAndVsumGeneration {
}

protected def Iterable<ChangePropagationSpecification> createChangePropagationSpecifications() {
return #[new PLCOpen2CAEXChangePropagationSpecification()];
return #[new CombinedCAEXChangePropagationSpecification];
}

protected def IProject createTestProject(String projectName) throws CoreException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.vitruv.applications.plcopencaex.demo
package tools.vitruv.applications.automationml.caexplcopen.demo

import org.eclipse.core.commands.AbstractHandler
import org.eclipse.core.commands.ExecutionEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tools.vitruv.applications.plcopencaex.demo</name>
<name>tools.vitruv.applications.automationml</name>
<comment></comment>
<projects>
</projects>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: AutomationMLReactions
Bundle-SymbolicName: tools.vitruv.applications.automationml
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.apache.log4j,
com.google.guava,
org.eclipse.emf.ecore,
org.eclipse.core.resources,
org.eclipse.xtend.lib,
org.eclipse.xtend.lib.macro,
tools.vitruv.framework.util,
tools.vitruv.framework.change,
tools.vitruv.framework.change.processing,
tools.vitruv.framework.correspondence,
tools.vitruv.framework.userinteraction,
tools.vitruv.extensions.dslsruntime.reactions,
org.plcopen.xml.tc60201,
tools.vitruv.domains.plcopen,
tools.vitruv.domains.caex,
tools.vitruv.dsls.mappings;bundle-version="0.2.0",
tools.vitruv.extensions.dslsruntime.mappings,
org.eclipse.xtext;bundle-version="2.12.0",
tools.vitruv.applications.automationml.utils;bundle-version="1.0.0",
caex.caex30;bundle-version="0.1.0",
edu.kit.sdq.aml_aggregator;bundle-version="0.1.0",
org.khronos.collada;bundle-version="1.0.0",
tools.vitruv.domains.collada;bundle-version="0.3.0",
tools.vitruv.domains.aml;bundle-version="0.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: tools.vitruv.applications.automationml.aggregatorchanges,
tools.vitruv.applications.automationml.attributechanges,
tools.vitruv.applications.automationml.caexchanges,
tools.vitruv.applications.automationml.colladachanges,
tools.vitruv.applications.automationml.plcopenchanges
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import caex.caex30.caex.ExternalInterface
import tools.vitruv.applications.automationml.utils.aml.CAEXUtils
import org.eclipse.xtext.EcoreUtil2
import org.plcopen.xml.tc60201.PouType1
import org.khronos.collada.SceneType
import tools.vitruv.applications.automationml.utils.aml.AMLTags

import "http://www.plcopen.org/xml/tc6_0201" as plcopen
import "http://www.dke.de/CAEX/300" as caex
import "http://edu.kit.ipd.sdq.aml" as aml
import "http://www.collada.org/2005/11/COLLADASchema" as collada

reactions: aggregatorPathChanges
in reaction to changes in AML
execute actions in AML

/**
* reaction for changing the path to a collada file
*/
reaction ChangePathForCollada {
after attribute replaced at aml::ColladaContainer[path]
call {
logger.debug("Reaction ChangePathForCollada")

changePathInColladaInterfaces(affectedEObject)
}
}

/**
* reaction for changing the path to a plcopen file
*/
reaction ChangePathForPlcopen {
after attribute replaced at aml::PLCopenContainer[path]
call {
logger.debug("Reaction ChangePathForPLCopen")

changePathInPlcopenInterfaces(affectedEObject)
}
}

/**
* routine to change the path to a collada file in ExternalInterfaces
*/
routine changePathInColladaInterfaces (aml::ColladaContainer container) {
match {
val colladaType = retrieve collada::COLLADAType corresponding to container tagged with AMLTags.AML_COLLADA
val externalInterfaces = retrieve many caex::ExternalInterface corresponding to EcoreUtil2.getAllContentsOfType(colladaType, SceneType).get(0) tagged with AMLTags.INTERFACE_SCENE
}
action {
execute {
for (ExternalInterface currInterface : externalInterfaces) {
val currAttribute = CAEXUtils.getAttributeInExternalInterface(currInterface, "refUri")
currAttribute.value = container.path
}
}
}
}

/**
* routine to change the path to a plcopen file in ExternalInterfaces
*/
routine changePathInPlcopenInterfaces (aml::PLCopenContainer container) {
match {
val projectType = retrieve plcopen::ProjectType corresponding to container tagged with AMLTags.AML_PLCOPEN
val externalInterfaces = retrieve many caex::ExternalInterface corresponding to EcoreUtil2.getAllContentsOfType(projectType, PouType1).get(0) tagged with AMLTags.INTERFACE_POU
}
action {
execute {
for (ExternalInterface currInterface : externalInterfaces) {
val currAttribute = CAEXUtils.getAttributeInExternalInterface(currInterface, "refUri")
currAttribute.value = container.path
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import org.eclipse.xtext.EcoreUtil2
import caex.caex30.caex.ExternalInterface
import tools.vitruv.applications.automationml.utils.aml.CAEXUtils
import org.khronos.collada.SceneType
import tools.vitruv.applications.automationml.utils.aml.AMLTags
import tools.vitruv.applications.automationml.utils.aml.AggregatorUtils

import "http://www.plcopen.org/xml/tc6_0201" as plcopen
import "http://www.dke.de/CAEX/300" as caex
import "http://edu.kit.ipd.sdq.aml" as aml
import "http://www.collada.org/2005/11/COLLADASchema" as collada

reactions: aggregatorToCollada
in reaction to changes in AML
execute actions in AML

/**
* routine to create a new collada file with its basic structure
*/
routine createColladaFile(aml::ColladaContainer container) {
action {
val visualSceneInstance = create collada::InstanceWithExtra
val scene = create collada::SceneType and initialize {
scene.instanceVisualScene = visualSceneInstance
}
val colladaType = create collada::COLLADAType and initialize {
colladaType.scene = scene
}
add correspondence between colladaType and container tagged with AMLTags.AML_COLLADA
execute {
val colladaNumber = AggregatorUtils.newNumberOfColladaFiles
persistProjectRelative(container, colladaType, "../../../../../Desktop/resources-gen/collada" + colladaNumber + ".dae")
}
}
}

/**
* routine to delete collada file and set references to deleted file to an empty string
*/
routine deleteColladaFile(aml::ColladaContainer container) {
match {
val colladaType = retrieve collada::COLLADAType corresponding to container tagged with AMLTags.AML_COLLADA
val externalInterfaces = retrieve many caex::ExternalInterface corresponding to EcoreUtil2.getAllContentsOfType(colladaType, SceneType).get(0) tagged with AMLTags.INTERFACE_SCENE
}
action {
execute {
for(ExternalInterface currInterface : externalInterfaces) {
CAEXUtils.getAttributeInExternalInterface(currInterface, "refUri").value = ""
}
}
delete colladaType
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import org.eclipse.xtext.EcoreUtil2
import org.plcopen.xml.tc60201.PouType1
import caex.caex30.caex.ExternalInterface
import tools.vitruv.applications.automationml.utils.aml.CAEXUtils
import tools.vitruv.applications.automationml.utils.aml.AMLTags
import tools.vitruv.applications.automationml.utils.aml.AggregatorUtils

import "http://www.plcopen.org/xml/tc6_0201" as plcopen
import "http://www.dke.de/CAEX/300" as caex
import "http://edu.kit.ipd.sdq.aml" as aml
import "http://www.collada.org/2005/11/COLLADASchema" as collada

reactions: aggregatorToPlcopen
in reaction to changes in AML
execute actions in AML

/**
* routine to create a new plcopen file with its basic structure
*/
routine createPLCopenFile(aml::PLCopenContainer container) {
action {
val pouType = create plcopen::PouType1
val pousType = create plcopen::PousType and initialize {
pousType.pou += pouType
}
val typesType = create plcopen::TypesType and initialize {
typesType.pous = pousType
}
val projectType = create plcopen::ProjectType and initialize {
projectType.types = typesType
}
add correspondence between projectType and container tagged with AMLTags.AML_PLCOPEN
execute {
val plcNumber = AggregatorUtils.newNumberOfPLCopenFiles
persistProjectRelative(container, projectType, "../../../../../Desktop/resources-gen/plc" + plcNumber + ".tc60201")
}
}
}

/**
* routine to delete plcopen file and set references to deleted file to an empty string
*/
routine deletePLCopenFile(aml::PLCopenContainer container) {
match {
val plcProject = retrieve plcopen::ProjectType corresponding to container tagged with AMLTags.AML_PLCOPEN
val externalInterfaces = retrieve many caex::ExternalInterface corresponding to EcoreUtil2.getAllContentsOfType(plcProject, PouType1).get(0) tagged with AMLTags.INTERFACE_POU
}
action {
execute {
for(ExternalInterface currInterface : externalInterfaces) {
CAEXUtils.getAttributeInExternalInterface(currInterface, "refUri").value = ""
}
}
delete plcProject
}
}
Loading