From 5aa8fa22bd75089b0022c1a58e4c00d427dc2345 Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Thu, 7 Mar 2024 14:43:09 +0100 Subject: [PATCH 1/7] First implementation of the PlantUML generator --- README.md | 1 + docu/PlantUML.md | 8 ++ .../generator/PlantUMLCompiler.xtend | 86 +++++++++++++++++++ .../generator/RosSystemGenerator.xtend | 5 ++ 4 files changed, 100 insertions(+) create mode 100644 docu/PlantUML.md create mode 100644 plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend diff --git a/README.md b/README.md index c57ba793..ae23c7d5 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Publications: - Combine components to form a ROS System - [Create manually a new RosSystem description](docu/RosSystemModelDescription.md) + - [Visualize a system using PlantUML](docu/PlantUML.md) - Examples: - [Simple publisher-subscriber](docu/Example_PubSub.md) diff --git a/docu/PlantUML.md b/docu/PlantUML.md new file mode 100644 index 00000000..1e2f0034 --- /dev/null +++ b/docu/PlantUML.md @@ -0,0 +1,8 @@ +## System Models visualization + +The visualization of the models is built on top of the [PlantUML](https://plantuml.com/eclipse) viewer for Eclipse. To install this plugin the Eclipse Marketplace can be used. This tool can be easily opened under the menu Help->Eclipse Marketplace. Then Search the "PlantUML plugin" and install it. + +The RosTooling will generate for every rossystem file a new PlaUML textual model compatible with the viewer. By default, the RosSystem compiler creates for every valid system model a file under src-gen/**SystemName**/resources/ called **SystemName**.puml. + +The file can be opened with a standard textual editor and the corresponding model can be visualized by opening the visualizer, under "Window"->"Show View"->"Other" and searching for "PlantUML". +:bangbang the file with the extension *.puml must be open, otherwise, the visualizer will not detect it. diff --git a/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend new file mode 100644 index 00000000..31f121c6 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend @@ -0,0 +1,86 @@ +package de.fraunhofer.ipa.rossystem.generator + +import system.System +import com.google.inject.Inject +import system.RosNode +import system.impl.RosInterfaceImpl +import system.RosInterface +import system.impl.RosSystemConnectionImpl + +class PlantUMLCompiler{ + + @Inject extension GeneratorHelpers + + def compile_plantuml(System system) '''«init_pkg()» +@startuml + +/'SUBSYSTEMS'/ +«FOR subsystem:system.subsystems» +component «subsystem.name» { +«FOR component:getNodes(subsystem)» +«compile_ports(component)» +«ENDFOR» +«ENDFOR» } + +«FOR component:getNodes(system)» +«compile_ports(component)» +«ENDFOR» +«FOR connection:system.connections» «get_connection_port((connection as RosSystemConnectionImpl).from)» --> «get_connection_port((connection as RosSystemConnectionImpl).to)» +«ENDFOR» + +@enduml''' + + + def compile_ports(RosNode component)''' + component «(component as RosNode).name» { + + /' PORTS DEFINED AS AVAILABLE IN THE ROSSYSTEM FILE '/ + «FOR port:(component as RosNode).rosinterfaces» + «IF port_type(port)=="INPUT"» portin «get_valid_name(component.name, port.name)» as "«port.name»"« + IF (port as RosInterfaceImpl).reference.toString.contains("RosSubscriberReference")» #blue«ENDIF»« + IF (port as RosInterfaceImpl).reference.toString.contains("RosServiceServerReference")» #orange«ENDIF»« + IF (port as RosInterfaceImpl).reference.toString.contains("RosActionServerReference")» #green«ENDIF»«ENDIF» + «IF port_type(port)=="OUTPUT"» portout «get_valid_name(component.name, port.name)» as "«port.name»"« + IF (port as RosInterfaceImpl).reference.toString.contains("RosPublisherReference")» #blue«ENDIF»« + IF (port as RosInterfaceImpl).reference.toString.contains("RosServiceClientReference")» #orange«ENDIF»« + IF (port as RosInterfaceImpl).reference.toString.contains("RosActionClientReference")» #green«ENDIF»«ENDIF» + «ENDFOR» + + /' PORTS FROM THE ORIGINAL NODE '/ + «FOR sub:(component as RosNode).from.subscriber» portin «get_valid_name(component.name, sub.name)» as "«sub.name»" #line:blue + «ENDFOR» + «FOR ss:(component as RosNode).from.serviceserver» portin «get_valid_name(component.name, ss.name)» as "«ss.name»" #line:orange + «ENDFOR» + «FOR acts:(component as RosNode).from.actionserver» portin «get_valid_name(component.name, acts.name)» as "«acts.name»" #line:green + «ENDFOR» + «FOR pub:(component as RosNode).from.publisher» portout «get_valid_name(component.name, pub.name)» as "«pub.name»" #line:blue + «ENDFOR» + «FOR sc:(component as RosNode).from.serviceclient» portout «get_valid_name(component.name, sc.name)» as "«sc.name»" #line:orange + «ENDFOR» + «FOR actc:(component as RosNode).from.actionclient» portout «get_valid_name(component.name, actc.name)» as "«actc.name»" #line:green«ENDFOR» + } + + ''' + + def String port_type (RosInterface rosinterface){ + if ((rosinterface as RosInterfaceImpl).reference.toString.matches + (".*RosSubscriberReferenceImpl.*|.*RosServiceServerReference.*|.*RosActionServerReference.*")){ + return "INPUT" + }else { + return "OUTPUT" + } + } + + def get_valid_name (String componentName, String PortName){ + val identifier = (componentName+"."+PortName).replace("/","_").replace("~","_") + return identifier + } + + def get_connection_port (RosInterface port){ + val componentName=(port.eContainer as RosNode).name + return get_valid_name (componentName, port.name) + } +} + + + diff --git a/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/RosSystemGenerator.xtend b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/RosSystemGenerator.xtend index 7d813213..44a26039 100644 --- a/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/RosSystemGenerator.xtend +++ b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/RosSystemGenerator.xtend @@ -23,6 +23,7 @@ class RosSystemGenerator extends AbstractGenerator { @Inject extension PackageXmlCompiler @Inject extension CMakeListsCompiler @Inject extension READMECompiler + @Inject extension PlantUMLCompiler override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { var yaml_gen = false @@ -31,6 +32,10 @@ class RosSystemGenerator extends AbstractGenerator { system.getName().toLowerCase+"/README.md", compile_toREADME(system).toString().replace("\t"," ") ) + fsa.generateFile( + system.getName().toLowerCase+"/resource/" + system.getName().toLowerCase + ".puml", + compile_plantuml(system) + ) if (system.fromFile.isNullOrEmpty) { fsa.generateFile( system.getName().toLowerCase+"/launch/"+system.getName()+".launch.py", From 4481fb92a384cc866972ea8e4da2a6e830ecbc59 Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Fri, 12 Apr 2024 09:03:08 +0200 Subject: [PATCH 2/7] Minimal version implementation of the Sirius plugin for the visualization of system --- .../de.fraunhofer.ipa.ros.sirius/.classpath | 7 + plugins/de.fraunhofer.ipa.ros.sirius/.project | 28 ++++ .../META-INF/MANIFEST.MF | 23 +++ .../build.properties | 8 + .../description/ros.odesign | 51 +++++++ .../icons/action_icon.png | Bin 0 -> 141 bytes .../icons/component.gif | Bin 0 -> 90 bytes .../icons/component.svg | 85 +++++++++++ .../icons/parameters.png | Bin 0 -> 750 bytes .../icons/parameters_scale.png | Bin 0 -> 810 bytes .../icons/ros_logo.png | Bin 0 -> 605 bytes .../icons/service_icon.png | Bin 0 -> 1863 bytes .../icons/tools.png | Bin 0 -> 517 bytes .../icons/topic_icon.png | Bin 0 -> 1783 bytes .../plugin.properties | 3 + .../de.fraunhofer.ipa.ros.sirius/plugin.xml | 54 +++++++ plugins/de.fraunhofer.ipa.ros.sirius/pom.xml | 12 ++ .../fraunhofer/ipa/ros/sirius/Activator.java | 66 ++++++++ .../ipa/ros/sirius/AutoConnect.java | 138 +++++++++++++++++ .../ipa/ros/sirius/ConnectionsCheckUtils.java | 123 +++++++++++++++ .../ExternalJavaActionNewComponents.java | 55 +++++++ .../ExternalJavaActionNewParameter.java | 87 +++++++++++ .../ipa/ros/sirius/RemoveAllConnections.java | 64 ++++++++ .../RemoveComponentsWithConnections.java | 118 +++++++++++++++ .../fraunhofer/ipa/ros/sirius/Services.java | 17 +++ .../sirius/SimulateRuntimeConnections.java | 141 ++++++++++++++++++ 26 files changed, 1080 insertions(+) create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/.classpath create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/.project create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/build.properties create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/action_icon.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/component.gif create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/component.svg create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters_scale.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/ros_logo.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/service_icon.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/tools.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/icons/topic_icon.png create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/plugin.properties create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/pom.xml create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Activator.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Services.java create mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/.classpath b/plugins/de.fraunhofer.ipa.ros.sirius/.classpath new file mode 100644 index 00000000..39810b7d --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/.project b/plugins/de.fraunhofer.ipa.ros.sirius/.project new file mode 100644 index 00000000..1cb0d20a --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/.project @@ -0,0 +1,28 @@ + + + de.fraunhofer.ipa.ros.sirius + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF b/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF new file mode 100644 index 00000000..226549ae --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: de.fraunhofer.ipa.ros.sirius;singleton:=true +Bundle-Version: 2.0.0.qualifier +Bundle-Activator: de.fraunhofer.ipa.ros.sirius.Activator +Bundle-Localization: plugin +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.sirius, + org.eclipse.sirius.common.acceleo.aql, + de.fraunhofer.ipa.ros, + org.eclipse.ui.workbench, + org.eclipse.ui.ide, + org.eclipse.sirius.common, + org.eclipse.sirius.diagram.ui, + de.fraunhofer.ipa.rossystem +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-Vendor: %providerName +Automatic-Module-Name: de.fraunhofer.ipa.ros.sirius +Export-Package: de.fraunhofer.ipa.ros.sirius diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/build.properties b/plugins/de.fraunhofer.ipa.ros.sirius/build.properties new file mode 100644 index 00000000..ec79d6f8 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + description/,\ + icons/,\ + plugin.properties,\ + plugin.xml diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign new file mode 100644 index 00000000..dddd007f --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/action_icon.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/action_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9c55be3719d20f3b6ba3d9a09515bbc01327f7cf GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6M!2~3ih)e(pFc&*{hH!9j+33vY2hJ9^H|M*2j7#OSpwJ#!0 literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/component.svg b/plugins/de.fraunhofer.ipa.ros.sirius/icons/component.svg new file mode 100644 index 00000000..a0833a9f --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/icons/component.svg @@ -0,0 +1,85 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters.png new file mode 100644 index 0000000000000000000000000000000000000000..d416b063918634d3abc327f5c93320ebb4bbd1dd GIT binary patch literal 750 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAv7|ftIx;Y9?C1WI$O_~uBzpw; zGB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpv3$DpAc6d&8<3tOSPX% zt)E9_5|>IJmr6gEN-s!6wVy$|0V2hvI)OoYh7ML)4D(HBG`@^66|L?v@>M*>q?BxBo z-rLP|1$lW=g=VMTo)#7?$-LItLiy;cs>d6j7cFq(Yg;4ilWv#YVBm6~(SCN)A*n>U z=F&!1Yxa)k9TC$Ly!R3`N$>&1mzlT!Zhld?|7%0l zD@mKH|9h^_=lRILaaEoCql}}e0@t4No^;iRdP`(kYX@0 zFtpG$Fw-?M2r)FYGBUI>FxNIPvNA9ba{ecTq9HdwB{QuOw}xanw{<`bk{}y`^V3So o6N^$A%FE03GV`*FlM@S4_413-XTP(N0xDwgboFyt=akR{09hvY6aWAK literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters_scale.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/parameters_scale.png new file mode 100644 index 0000000000000000000000000000000000000000..dc7f646e42c7861052c8ea7914c1d807de1c6843 GIT binary patch literal 810 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!SkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP$ECTC&U#N%K}A%7dcjgEz1%=HSUrz& zFHn$2WfGSfSPHBFXwxMou38|aToU9L%)pqs`I*%I!)ABB)VDeR`@7gfg8BY?bMHSE z%NJg9{2=Oi?bDJ{HW{FD#w2fd7lsa2Sq~tGv%n*=7#JkiL734=V|E2lkiEpy*OmPd zn+Ug*^357YPM{utPZ!6Kh{JcM-xO*x;Bn=4Wi3A%E4cOl|9-a^2j97O(rOg>x9lu_ z&NF4(Oo?Duk=rU83sdentt;ELt}9R7r&msDW#9y<-Qh>nT((a6dTEP$v#Da1Q)HHp zmvfTSmD|5f+#_;16<&Wg)_idKwUi=bO%=Ou;RophmF@3z+x9ceDK}YmGsSB5`Si=2 zzQ>jA8$Lhdo~09BemKkXq|$fBi1)MF&VKvZb(?o-wtU0acQ1CX7q9exd5%3{FME~P z)`)J?cm3cyz;yMNnhLvJ#I$}zIcq)bbRUOwVD6dPvUr7J~1fw zATYF5OI#yLQW8s2t&)pUffR$0fuV)2ftjw6L5QKDm64g1v8lF!k(GhL%l^*`Q8eV{ zr(~v8;?^+ZlD8~SgCxj?;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1STJYD@< J);T3K0RS^_Ad&z8 literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/ros_logo.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/ros_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..3362fc8c849dadd2ada1f8a66afc51d9e1b2b8ec GIT binary patch literal 605 zcmV-j0;2tiP)!3?T)FhNz%H2mghrAi|o8 zGn%9bTS5qbL0i=I!*D1NPE1M?9sB`@ci!jydbPH-MbGK^2RwlPJv)1OxKf5PfFz_c z%#sj`5u!+j3IPT{0E!8?2gFqd!~(+X_{h$g{^8h&Dl-VeZk%p9c@KsXfSUjav#WsS z0c#cT1cqJ!0{|A>A&cy>0fPWeryAQP4c1}6Gc)u6U{rRFh2Zn<91G4lcRrte`Ebpp z15VD&j*oP?`-HpK3Aj&Zc4mB}o#c|JUQy@V!`-dzoeO1gA`;n8>Xwo->e-HaN%Tg_4&i>WC00000NkvXXu0mjf7QPL% literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/service_icon.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/service_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f125792372610eb22d85e3b75fd5d72fa3a3f1a3 GIT binary patch literal 1863 zcmeAS@N?(olHy`uVBq!ia0vp^qChOd!3HFgyvvM%6kC$Fy9>jA5L~c#`DCC7XMsm# zF#`j)FbFd;%$g$s6l5>)^mS!_#KpyDCUs`(+Lu5f$r9Iy66gHf+|;}h2Ir#G#FEq$ zh4Rdj3pfi@Lo5Utm#{_uWOPhw{QvCL2cTZ!z<)*t2FCx`)q;d) zH>EMKFfuR#9Zv!PDkh|!i3H<_R!SQ~|NSTA8KNBsSIEQ&40vh-+IXMZt^}FKL<8S5 z0KHFrV~0?f(j=lr4W)Vr&?HH*fa({b(?7UC17#L`CEI@n7FHG(oYe!iZ~+;IoCjfi bgf)x|p1Klq47Scc0MhU2>gTe~DWM4f{|`cj literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/tools.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/tools.png new file mode 100644 index 0000000000000000000000000000000000000000..eedac5f3e74d8c0aee35ccfb6517b476607e17b7 GIT binary patch literal 517 zcmV+g0{Z=lP)7W?ZU0F;h|ehah@(kAj_3G}yMsV80jXmN2SVG2tyq7Gp;i#?B}l>T zhJLHj>Ciu0jigQjEaOV*b|JK1&H3OgUcw%%CeZslY`kjd*D;E7_=XoS8DbZY@iPw_ z`|+V=>vdd$hxm<76piCYBrM_#UiSfXFgtuG!PV?_?imu;7eLtz~O$* z?&#g2X2G@4##*}E=CvAfLC>+x#G9$xQEaB1rq@j1PfC~>a0nYIcM-?n4W=<4!u|ie zL#MEwV9)4XxH+ug5voC;fSpM8Sca2vGM9G(NiXRvKH=hD2FDEo4(Ey=00000NkvXX Hu0mjf6+Yx# literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/icons/topic_icon.png b/plugins/de.fraunhofer.ipa.ros.sirius/icons/topic_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f46018756f80f6061f0393f0a48d45426ce1941b GIT binary patch literal 1783 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|U1(2s1Lwnj--eWH0gbb!C6V#l@#5vQkW9J5Wfn#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-J9B6vHr;B5Vg&<=H+v=Z;Ku!OFm}-EDY9>Jq8a0se5FHJ}(J&+< j1V)n$8G(kTWdw%dxp$1}N*N3GfkML5)z4*}Q$iB}bxA34 literal 0 HcmV?d00001 diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/plugin.properties b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.properties new file mode 100644 index 00000000..3d2dd03b --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.properties @@ -0,0 +1,3 @@ +pluginName = de.fraunhofer.ipa.ros.sirius +providerName = Fraunhofer IPA +viewpointName = MyViewpoint diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml new file mode 100644 index 00000000..1a9158a3 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/pom.xml b/plugins/de.fraunhofer.ipa.ros.sirius/pom.xml new file mode 100644 index 00000000..a32cf146 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + de.fraunhofer.ipa.ros + de.fraunhofer.ipa.ros.parent + 2.0.0-SNAPSHOT + ../de.fraunhofer.ipa.ros.parent/pom.xml + + de.fraunhofer.ipa.ros.sirius + eclipse-plugin + diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Activator.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Activator.java new file mode 100644 index 00000000..34c32047 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Activator.java @@ -0,0 +1,66 @@ +package de.fraunhofer.ipa.ros.sirius; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.sirius.business.api.componentization.ViewpointRegistry; +import org.eclipse.sirius.viewpoint.description.Viewpoint; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + // The plug-in ID + public static final String PLUGIN_ID = "de.fraunhofer.ipa.ros.sirius"; + + // The shared instance + private static Activator plugin; + + private static Set viewpoints; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + viewpoints = new HashSet(); + viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/ros.odesign")); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + if (viewpoints != null) { + for (final Viewpoint viewpoint: viewpoints) { + ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint); + } + viewpoints.clear(); + viewpoints = null; + } + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java new file mode 100644 index 00000000..a804d13e --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java @@ -0,0 +1,138 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.Collection; +//import java.util.List; +//import java.util.Map; +// +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.sirius.viewpoint.DView; +//import org.eclipse.ui.IWorkbench; +//import componentInterface.ComponentInterface; +//import componentInterface.RosActionClient; +//import componentInterface.RosActionServer; +//import componentInterface.RosPublisher; +//import componentInterface.RosServiceClient; +//import componentInterface.RosServiceServer; +//import componentInterface.RosSubscriber; +//import rossystem.ActionConnection; +//import rossystem.RosSystem; +//import rossystem.ServiceConnection; +//import rossystem.TopicConnection; +//import rossystem.impl.ActionConnectionImpl; +//import rossystem.impl.RosSystemImpl; +//import rossystem.impl.ServiceConnectionImpl; +//import rossystem.impl.TopicConnectionImpl; +// +//public class AutoConnect implements IExternalJavaAction { +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// // public static final List FILE_EXTENSIONS = +// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public AutoConnect() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// boolean duplicated = false; +// for (EObject diagram : arg0) { +// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); +// for (DView view : owned_views) { +// for (EObject rossystemEObj : view.getModels()) { +// RosSystemImpl rossystem = ((RosSystemImpl)rossystemEObj); +// for (ComponentInterface component : rossystem.getRosComponent()) { +// for (RosPublisher rospub : component.getRospublisher()) { +// for (ComponentInterface component2 : rossystem.getRosComponent()) { +// for (RosSubscriber rossub : component2.getRossubscriber()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rospub.getPublisher().getMessage(), rossub.getSubscriber().getMessage())) { +// if (rospub.eContainer() != rossub.eContainer()) { +// duplicated = false; +// System.out.println("Possible Topic Connection found [" + rospub.eContainer() +// + "]" + rospub.getName() + "->[" + rossub.eContainer() + "]" +// + rossub.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils +// .isDuplicatedTopicConnection(rossystem, rospub, rossub); +// if (!duplicated) { +// TopicConnection topic_connection = new TopicConnectionImpl(); +// topic_connection.setTopicName(rospub.getName()); +// topic_connection.getFrom().add(rospub); +// topic_connection.getTo().add(rossub); +// rossystem.getTopicConnections().add(topic_connection); +// } +// } +// } +// } +// } +// } +// for (RosServiceClient rosscl : component.getRosserviceclient()) { +// for (ComponentInterface component2 : ((RosSystem) rossystem).getRosComponent()) { +// for (RosServiceServer rosss : component2.getRosserviceserver()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rosscl.getSrvclient().getService(), rosss.getSrvserver().getService())) { +// if (rosscl.eContainer() != rosss.eContainer()) { +// duplicated = false; +// System.out.println("Possible Service Connection found [" +// + rosscl.eContainer() + "]" + rosscl.getName() + "->[" +// + rosss.eContainer() + "]" + rosss.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils.isDuplicatedServiceConnection( +// rossystem, rosss, rosscl); +// if (!duplicated) { +// ServiceConnection srv_connection = new ServiceConnectionImpl(); +// srv_connection.setServiceName(rosscl.getName()); +// srv_connection.setTo(rosscl); +// srv_connection.getFrom().add(rosss); +// rossystem.getServiceConnections().add(srv_connection); +// } +// } +// } +// } +// } +// } +// for (RosActionClient rosac : component.getRosactionclient()) { +// for (ComponentInterface component2 : rossystem.getRosComponent()) { +// for (RosActionServer rosas : component2.getRosactionserver()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rosac.getActclient().getAction(), rosas.getActserver().getAction())) { +// if (rosac.eContainer() != rosas.eContainer()) { +// +// System.out.println("Possible Action Connection found [" + rosac.eContainer() +// + "]" + rosac.getName() + "->[" + rosas.eContainer() + "]" +// + rosas.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils +// .isDuplicatedActionConnection(rossystem, rosac, rosas); +// if (!duplicated) { +// ActionConnection action_connection = new ActionConnectionImpl(); +// action_connection.setActionName(rosac.getName()); +// action_connection.setFrom(rosas); +// action_connection.setTo(rosac); +// rossystem.getActionConnections().add(action_connection); +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// +//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java new file mode 100644 index 00000000..7ab42a3b --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java @@ -0,0 +1,123 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +// +//import java.util.List; +//import java.util.Optional; +//import java.util.stream.Collectors; +// +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.emf.ecore.util.EcoreUtil; +//import org.eclipse.emf.common.util.EList; +//import org.eclipse.sirius.business.api.session.Session; +//import org.eclipse.sirius.business.api.session.SessionManager; +//import org.eclipse.sirius.diagram.impl.DSemanticDiagramImpl; +//import org.eclipse.sirius.viewpoint.DAnalysis; +//import org.eclipse.sirius.viewpoint.DView; +// +//import componentInterface.RosActionClient; +//import componentInterface.RosActionServer; +//import componentInterface.RosPublisher; +//import componentInterface.RosServiceClient; +//import componentInterface.RosServiceServer; +//import componentInterface.RosSubscriber; +//import ros.SpecBase; +//import rossystem.ActionConnection; +//import rossystem.RosSystem; +//import rossystem.ServiceConnection; +//import rossystem.TopicConnection; +// +///* +// * Class with utility functions used by AutoConnect and SimulateRuntimeConnections +// */ +// +//public final class ConnectionsCheckUtils { +// +// private ConnectionsCheckUtils() { +// +// } +// +// static List getDiagramViews(EObject diagram) { +// +// EObject target = ((DSemanticDiagramImpl) diagram).getTarget(); +// Session session = SessionManager.INSTANCE.getSession(target); +// DAnalysis slaveAnalysis = (DAnalysis) session.getSessionResource().getContents().get(0); +// String name = ((DSemanticDiagramImpl) diagram).getName(); +// EList owned_views = slaveAnalysis.getOwnedViews(); +// +// List current_views = owned_views.stream() +// .filter(view -> view.getOwnedRepresentationDescriptors().toString().contains(name)) +// .collect(Collectors.toList()); +// +// return current_views; +// } +// +// static boolean containEqualCommunicationObjects(SpecBase message1, SpecBase message2) { +// if (message1==null | message2==null) { +// return false; +// } +// boolean haveEqualName = false; +// if (message1.isSetFullname() && message2.isSetFullname()) { +// if (message1.getFullname().equals(message2.getFullname())) { +// haveEqualName = true; +// } +// } else { +// if (message1.getName().equals(message2.getName())) { +// haveEqualName = true; +// } +// } +// +// boolean haveEqualContent = true; +// if (message1.eContents().size() != message2.eContents().size()) { +// haveEqualContent = false; +// } else { +// for (EObject communicationObject1 : message1.eContents()) { +// Optional optional = message2.eContents().stream() +// .filter(obj -> EcoreUtil.equals(obj, communicationObject1)).findFirst(); +// if (!optional.isPresent()) { +// haveEqualContent = false; +// } +// } +// } +// return haveEqualName && haveEqualContent; +// } +// +// static boolean isDuplicatedTopicConnection(RosSystem rossystem, RosPublisher rospub, RosSubscriber rossub) { +// for (TopicConnection topic_con : rossystem.getTopicConnections()) { +// for (RosPublisher pub_con : topic_con.getFrom()) { +// for (RosSubscriber sub_con : topic_con.getTo()) { +// if (pub_con == rospub && sub_con == rossub) { +// System.out.println("Connection already exits"); +// return true; +// } +// } +// } +// } +// +// return false; +// } +// +// static boolean isDuplicatedServiceConnection(RosSystem rossystem, RosServiceServer rosss, RosServiceClient rosscl) { +// for (ServiceConnection srv_con : ((RosSystem) rossystem).getServiceConnections()) { +// for (RosServiceServer srvs_con : srv_con.getFrom()) { +// if (srvs_con == rosss && EcoreUtil.equals(srv_con.getTo(), rosscl)) { +// System.out.println("Connection already exits"); +// return true; +// } +// } +// } +// +// return false; +// } +// +// static boolean isDuplicatedActionConnection(RosSystem rossystem, RosActionClient rosac, RosActionServer rosas) { +// for (ActionConnection act_con : rossystem.getActionConnections()) { +// if (EcoreUtil.equals(act_con.getTo(), rosac) && EcoreUtil.equals(act_con.getFrom(), rosas)) { +// System.out.println("Connection already exits"); +// return true; +// } +// } +// +// return false; +// } +// +//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java new file mode 100644 index 00000000..fc4933e1 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java @@ -0,0 +1,55 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.Arrays; +//import java.util.Collection; +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +// +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.jface.viewers.StructuredSelection; +//import org.eclipse.jface.wizard.WizardDialog; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.swt.widgets.Display; +//import org.eclipse.swt.widgets.Shell; +//import org.eclipse.ui.IWorkbench; +//import org.eclipse.ui.PlatformUI; +// +//import componentInterface.presentation.ComponentInterfaceEditorPlugin; +//import componentInterface.presentation.ComponentInterfaceModelWizardOnlyRosInputModel; +// +// +//public class ExternalJavaActionNewComponents implements IExternalJavaAction { +// +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public ExternalJavaActionNewComponents() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// Display display = Display.getDefault(); +// Shell activeShell = display.getActiveShell(); +// ComponentInterfaceModelWizardOnlyRosInputModel wizard = new ComponentInterfaceModelWizardOnlyRosInputModel(); +// wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(), arg0, arg1); +// WizardDialog dialog = new WizardDialog(activeShell,wizard); +// dialog.create(); +// dialog.getShell().setText(wizard.getWindowTitle()); +// dialog.open(); +// } +//} +// diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java new file mode 100644 index 00000000..edef3d5d --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java @@ -0,0 +1,87 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.Collection; +//import java.util.Map; +// +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.common.util.URI; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.emf.ecore.resource.Resource; +//import org.eclipse.emf.ecore.resource.ResourceSet; +//import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.jface.viewers.LabelProvider; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.swt.widgets.Display; +//import org.eclipse.swt.widgets.Shell; +//import org.eclipse.ui.IWorkbench; +//import org.eclipse.ui.dialogs.ElementListSelectionDialog; +//import ros.Parameter; +//import ros.ParameterBoolean; +//import ros.ParameterStringType; +//import ros.ParameterType; +//import ros.impl.ParameterBooleanImpl; +//import ros.impl.ParameterBooleanTypeImpl; +//import ros.impl.ParameterDateTypeImpl; +//import ros.impl.ParameterDoubleTypeImpl; +//import ros.impl.ParameterImpl; +//import ros.impl.ParameterIntegerTypeImpl; +//import ros.impl.ParameterStringImpl; +//import ros.impl.ParameterStringTypeImpl; +//import ros.impl.ParameterTypeImpl; +// +// +//public class ExternalJavaActionNewParameter implements IExternalJavaAction { +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// //public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public ExternalJavaActionNewParameter() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// Display display = Display.getDefault(); +// Shell activeShell = display.getActiveShell(); +// ElementListSelectionDialog dlg = new ElementListSelectionDialog(activeShell, new LabelProvider()); +// dlg.setTitle("ParameterType"); +// dlg.setMessage("Select a type for your parameter (* = any string, ? = any char):"); +// Collection param_collection = (Collection) arg0; +// Parameter param = param_collection.iterator().next(); +// ParameterType type = null; +// +// dlg.setElements( new Object[] {"Boolean","String","Integer","Date","Double"}); +// dlg.open(); +// +// Object selected_type = dlg.getFirstResult(); +// if (selected_type.toString() == "Boolean") { +// type = new ParameterBooleanTypeImpl(); +// } +// if (selected_type.toString() == "String") { +// type = new ParameterStringTypeImpl(); +// } +// if (selected_type.toString() == "Integer") { +// type = new ParameterIntegerTypeImpl(); +// } +// if (selected_type.toString() == "Date") { +// type = new ParameterDateTypeImpl(); +// } +// if (selected_type.toString() == "Double") { +// type = new ParameterDoubleTypeImpl(); +// } +// param.setType(type); +// +// +//} +//} +// diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java new file mode 100644 index 00000000..f0070920 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java @@ -0,0 +1,64 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.Collection; +//import java.util.Iterator; +//import java.util.List; +//import java.util.Map; +// +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.sirius.viewpoint.DView; +//import org.eclipse.ui.IWorkbench; +// +//import rossystem.ActionConnection; +//import rossystem.ServiceConnection; +//import rossystem.TopicConnection; +//import rossystem.impl.RosSystemImpl; +// +//public class RemoveAllConnections implements IExternalJavaAction { +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// // public static final List FILE_EXTENSIONS = +// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public RemoveAllConnections() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// for (EObject diagram : arg0) { +// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); +// for (DView view : owned_views) { +// for (EObject rossystem : view.getModels()) { +// Iterator it = ((RosSystemImpl) rossystem).getTopicConnections().iterator(); +// while (it.hasNext()) { +// it.next(); +// it.remove(); +// } +// Iterator is = ((RosSystemImpl) rossystem).getServiceConnections().iterator(); +// while (is.hasNext()) { +// is.next(); +// is.remove(); +// } +// Iterator ia = ((RosSystemImpl) rossystem).getActionConnections().iterator(); +// while (ia.hasNext()) { +// ia.next(); +// ia.remove(); +// } +// } +// } +// } +// } +//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java new file mode 100644 index 00000000..9856089d --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java @@ -0,0 +1,118 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.ArrayList; +//import java.util.Collection; +//import java.util.Map; +// +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.ui.IWorkbench; +// +//import componentInterface.RosActionClient; +//import componentInterface.RosActionServer; +//import componentInterface.RosPublisher; +//import componentInterface.RosServiceClient; +//import componentInterface.RosServiceServer; +//import componentInterface.RosSubscriber; +//import componentInterface.impl.ComponentInterfaceImpl; +//import rossystem.ActionConnection; +//import rossystem.ServiceConnection; +//import rossystem.TopicConnection; +//import rossystem.impl.RosSystemImpl; +// +//public class RemoveComponentsWithConnections implements IExternalJavaAction { +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// // public static final List FILE_EXTENSIONS = +// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public RemoveComponentsWithConnections() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// +// for (EObject component:arg0) { +// ComponentInterfaceImpl selected_component = (ComponentInterfaceImpl) component; +// RosSystemImpl system = (RosSystemImpl) component.eContainer(); +// System.out.println(system.eContents()); +// System.out.println(selected_component); +// System.out.println(system.getTopicConnections()); +// ArrayList TopicConnectionsToRemove = new ArrayList(); +// ArrayList ServiceConnectionsToRemove = new ArrayList(); +// ArrayList ActionConnectionsToRemove = new ArrayList(); +// +// for (TopicConnection topic_connection: system.getTopicConnections()) { +// for (RosPublisher rospub:selected_component.getRospublisher()) { +// for (RosPublisher from: topic_connection.getFrom()) { +// if (rospub.equals(from)){ +// if (topic_connection.getFrom().size()>1){ +// topic_connection.getFrom().remove(rospub); +// }else { +// TopicConnectionsToRemove.add(topic_connection); +// } +// } +// } +// for (RosSubscriber rossub:selected_component.getRossubscriber()) { +// for (RosSubscriber to: topic_connection.getTo()) { +// if (rossub.equals(to)){ +// if (topic_connection.getTo().size()>1){ +// topic_connection.getTo().remove(rossub); +// }else { +// TopicConnectionsToRemove.add(topic_connection); +// } +// } +// } +// } +// } +// for (ServiceConnection service_connection: system.getServiceConnections()) { +// for (RosServiceServer rossrv:selected_component.getRosserviceserver()) { +// for (RosServiceServer from: service_connection.getFrom()) { +// if (rossrv.equals(from)){ +// if (service_connection.getFrom().size()>1){ +// service_connection.getFrom().remove(rossrv); +// }else { +// ServiceConnectionsToRemove.add(service_connection); +// } +// } +// } +// for (RosServiceClient rossrvcli:selected_component.getRosserviceclient()) { +// if (rossrvcli.equals(service_connection.getTo())){ +// ServiceConnectionsToRemove.add(service_connection); +// } +// } +// } +// } +// for (ActionConnection action_connection: system.getActionConnections()) { +// for (RosActionServer rosact:selected_component.getRosactionserver()) { +// if (rosact.equals(action_connection.getFrom())){ +// ActionConnectionsToRemove.add(action_connection); +// } +// } +// for (RosActionClient rosactcli:selected_component.getRosactionclient()) { +// if (rosactcli.equals(action_connection.getTo())){ +// ActionConnectionsToRemove.add(action_connection); +// } +// } +// } +// } +// for( TopicConnection connection:TopicConnectionsToRemove) { system.getTopicConnections().remove(connection);} +// for( ServiceConnection connection:ServiceConnectionsToRemove) { system.getServiceConnections().remove(connection);} +// for( ActionConnection connection:ActionConnectionsToRemove) { system.getActionConnections().remove(connection);} +// +// system.getRosComponent().remove(selected_component); +// } +// } +//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Services.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Services.java new file mode 100644 index 00000000..b66fddb9 --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/Services.java @@ -0,0 +1,17 @@ +package de.fraunhofer.ipa.ros.sirius; + +import org.eclipse.emf.ecore.EObject; + +/** + * The services class used by VSM. + */ +public class Services { + + /** + * See http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.sirius.doc%2Fdoc%2Findex.html&cp=24 for documentation on how to write service methods. + */ + public EObject myService(EObject self, String arg) { + // TODO Auto-generated code + return self; + } +} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java new file mode 100644 index 00000000..5a4001ed --- /dev/null +++ b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java @@ -0,0 +1,141 @@ +//package de.fraunhofer.ipa.ros.sirius; +// +//import java.util.Collection; +//import java.util.List; +//import java.util.Map; +//import org.eclipse.core.commands.ExecutionEvent; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.emf.ecore.EObject; +//import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +//import org.eclipse.sirius.viewpoint.DView; +//import org.eclipse.ui.IWorkbench; +//import componentInterface.ComponentInterface; +//import componentInterface.RosActionClient; +//import componentInterface.RosActionServer; +//import componentInterface.RosPublisher; +//import componentInterface.RosServiceClient; +//import componentInterface.RosServiceServer; +//import componentInterface.RosSubscriber; +//import rossystem.ActionConnection; +//import rossystem.ServiceConnection; +//import rossystem.TopicConnection; +//import rossystem.impl.ActionConnectionImpl; +//import rossystem.impl.ServiceConnectionImpl; +//import rossystem.impl.TopicConnectionImpl; +//import rossystem.impl.RosSystemImpl; +// +//public class SimulateRuntimeConnections implements IExternalJavaAction { +// public IFile modelFile; +// protected IWorkbench workbench; +// protected IStructuredSelection selection; +// // public static final List FILE_EXTENSIONS = +// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); +// protected ExecutionEvent event; +// +// public SimulateRuntimeConnections() { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean canExecute(Collection arg0) { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public void execute(Collection arg0, Map arg1) { +// boolean duplicated = false; +// for (EObject diagram : arg0) { +// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); +// for (DView view : owned_views) { +// for (EObject rossystemEObj : view.getModels()) { +// RosSystemImpl rossystem = ((RosSystemImpl)rossystemEObj); +// for (ComponentInterface component : rossystem.getRosComponent()) { +// for (RosPublisher rospub : component.getRospublisher()) { +// for (ComponentInterface component2 : rossystem.getRosComponent()) { +// for (RosSubscriber rossub : component2.getRossubscriber()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rospub.getPublisher().getMessage(), rossub.getSubscriber().getMessage()) +// && rospub.getName().equals(rossub.getName())) { +// if (rospub.eContainer() != rossub.eContainer()) { +// duplicated = false; +// System.out.println("Topic Connection found [" + rospub.eContainer() + "]" +// + rospub.getName() + "->[" + rossub.eContainer() + "]" +// + rossub.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils +// .isDuplicatedTopicConnection(rossystem, rospub, rossub); +// if (!duplicated) { +// TopicConnection topic_connection = new TopicConnectionImpl(); +// topic_connection.setTopicName(rospub.getName()); +// topic_connection.getFrom().add(rospub); +// topic_connection.getTo().add(rossub); +// rossystem.getTopicConnections().add(topic_connection); +// } +// } +// } +// } +// } +// } +// for (RosServiceClient rosscl : component.getRosserviceclient()) { +// for (ComponentInterface component2 : rossystem.getRosComponent()) { +// for (RosServiceServer rosss : component2.getRosserviceserver()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rosscl.getSrvclient().getService(), rosscl.getSrvclient().getService()) +// && rosscl.getName().equals(rosss.getName())) { +// if (rosscl.getSrvclient().eContainer() != rosss.getSrvserver().eContainer()) { +// duplicated = false; +// System.out.println("Service Connection found [" + rosscl.eContainer() + "]" +// + rosscl.getName() + "->[" + rosss.eContainer() + "]" +// + rosss.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils.isDuplicatedServiceConnection( +// rossystem, rosss, rosscl); +// +// if (!duplicated) { +// ServiceConnection srv_connection = new ServiceConnectionImpl(); +// srv_connection.setServiceName(rosscl.getName()); +// srv_connection.setTo(rosscl); +// srv_connection.getFrom().add(rosss); +// rossystem.getServiceConnections().add(srv_connection); +// +// } +// } +// } +// +// } +// } +// } +// for (RosActionClient rosac : component.getRosactionclient()) { +// for (ComponentInterface component2 : rossystem.getRosComponent()) { +// for (RosActionServer rosas : component2.getRosactionserver()) { +// if (ConnectionsCheckUtils.containEqualCommunicationObjects( +// rosac.getActclient().getAction(), rosas.getActserver().getAction()) +// && rosac.getName().equals(rosas.getName())) { +// if (rosac.eContainer() != rosas.eContainer()) { +// System.out.println("Action Connection found [" + rosac.eContainer() + "]" +// + rosac.getName() + "->[" + rosas.eContainer() + "]" +// + rosas.getName()); +// // Check if connection already exists +// duplicated = ConnectionsCheckUtils +// .isDuplicatedActionConnection(rossystem, rosac, rosas); +// if (!duplicated) { +// ActionConnection action_connection = new ActionConnectionImpl(); +// action_connection.setActionName(rosac.getName()); +// action_connection.setFrom(rosas); +// action_connection.setTo(rosac); +// rossystem.getActionConnections().add(action_connection); +// } +// } +// } +// } +// } +// } +// } +// } +// } +// } +// +// } +//} From cc20e14f668bc73265541280d87ee0a6addffa57 Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Fri, 12 Apr 2024 10:33:15 +0200 Subject: [PATCH 3/7] Review PlantUML compiler --- .../generator/PlantUMLCompiler.xtend | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend index 31f121c6..8562d882 100644 --- a/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend +++ b/plugins/de.fraunhofer.ipa.rossystem.xtext/src/de/fraunhofer/ipa/rossystem/generator/PlantUMLCompiler.xtend @@ -19,8 +19,8 @@ class PlantUMLCompiler{ component «subsystem.name» { «FOR component:getNodes(subsystem)» «compile_ports(component)» -«ENDFOR» «ENDFOR» } +«ENDFOR» «FOR component:getNodes(system)» «compile_ports(component)» @@ -47,17 +47,17 @@ component «subsystem.name» { «ENDFOR» /' PORTS FROM THE ORIGINAL NODE '/ - «FOR sub:(component as RosNode).from.subscriber» portin «get_valid_name(component.name, sub.name)» as "«sub.name»" #line:blue - «ENDFOR» - «FOR ss:(component as RosNode).from.serviceserver» portin «get_valid_name(component.name, ss.name)» as "«ss.name»" #line:orange - «ENDFOR» - «FOR acts:(component as RosNode).from.actionserver» portin «get_valid_name(component.name, acts.name)» as "«acts.name»" #line:green - «ENDFOR» - «FOR pub:(component as RosNode).from.publisher» portout «get_valid_name(component.name, pub.name)» as "«pub.name»" #line:blue - «ENDFOR» - «FOR sc:(component as RosNode).from.serviceclient» portout «get_valid_name(component.name, sc.name)» as "«sc.name»" #line:orange - «ENDFOR» - «FOR actc:(component as RosNode).from.actionclient» portout «get_valid_name(component.name, actc.name)» as "«actc.name»" #line:green«ENDFOR» +««« «FOR sub:(component as RosNode).from.subscriber» portin «get_valid_name(component.name, sub.name)» as "«sub.name»" #line:blue +««« «ENDFOR» +««« «FOR ss:(component as RosNode).from.serviceserver» portin «get_valid_name(component.name, ss.name)» as "«ss.name»" #line:orange +««« «ENDFOR» +««« «FOR acts:(component as RosNode).from.actionserver» portin «get_valid_name(component.name, acts.name)» as "«acts.name»" #line:green +««« «ENDFOR» +««« «FOR pub:(component as RosNode).from.publisher» portout «get_valid_name(component.name, pub.name)» as "«pub.name»" #line:blue +««« «ENDFOR» +««« «FOR sc:(component as RosNode).from.serviceclient» portout «get_valid_name(component.name, sc.name)» as "«sc.name»" #line:orange +««« «ENDFOR» +««« «FOR actc:(component as RosNode).from.actionclient» portout «get_valid_name(component.name, actc.name)» as "«actc.name»" #line:green«ENDFOR» } ''' From 81254309ee86efe5d4b704a6be9491dbd10f702f Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Mon, 15 Apr 2024 18:20:23 +0200 Subject: [PATCH 4/7] Complete Sirius plugin for the visualization of the components of the system, the interfaces and their connections --- .../description/ros.odesign | 69 +++++++++++++++++-- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign index dddd007f..444cc312 100644 --- a/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign +++ b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign @@ -5,17 +5,73 @@ - - + + + + + + - + + + + + + + + + + + + + - + + + + + + + + + + + From 92839af2661d3015387516c4e403b4c29a3c0415 Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Wed, 17 Apr 2024 10:02:46 +0200 Subject: [PATCH 6/7] Clean Sirius implementation plugin for release --- .../META-INF/MANIFEST.MF | 6 +- .../description/ros.odesign | 20 +-- .../de.fraunhofer.ipa.ros.sirius/plugin.xml | 41 ----- .../ipa/ros/sirius/AutoConnect.java | 138 ----------------- .../ipa/ros/sirius/ConnectionsCheckUtils.java | 123 --------------- .../ExternalJavaActionNewComponents.java | 55 ------- .../ExternalJavaActionNewParameter.java | 87 ----------- .../ipa/ros/sirius/RemoveAllConnections.java | 64 -------- .../RemoveComponentsWithConnections.java | 118 --------------- .../sirius/SimulateRuntimeConnections.java | 141 ------------------ 10 files changed, 9 insertions(+), 784 deletions(-) delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java delete mode 100644 plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF b/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF index 226549ae..e7b9c2df 100644 --- a/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF +++ b/plugins/de.fraunhofer.ipa.ros.sirius/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.fraunhofer.ipa.ros.sirius;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 3.0.0.qualifier Bundle-Activator: de.fraunhofer.ipa.ros.sirius.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, @@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.sirius.diagram.ui, de.fraunhofer.ipa.rossystem Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Vendor: %providerName +Bundle-RequiredExecutionEnvironment: JavaSE-19 +Bundle-Vendor: Fraunhofer IPA Automatic-Module-Name: de.fraunhofer.ipa.ros.sirius Export-Package: de.fraunhofer.ipa.ros.sirius diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign index 1e74b91d..3284da90 100644 --- a/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign +++ b/plugins/de.fraunhofer.ipa.ros.sirius/description/ros.odesign @@ -71,7 +71,7 @@ - - - - - diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml index 1a9158a3..d0f3d827 100644 --- a/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml +++ b/plugins/de.fraunhofer.ipa.ros.sirius/plugin.xml @@ -1,19 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java deleted file mode 100644 index a804d13e..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/AutoConnect.java +++ /dev/null @@ -1,138 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.Collection; -//import java.util.List; -//import java.util.Map; -// -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.sirius.viewpoint.DView; -//import org.eclipse.ui.IWorkbench; -//import componentInterface.ComponentInterface; -//import componentInterface.RosActionClient; -//import componentInterface.RosActionServer; -//import componentInterface.RosPublisher; -//import componentInterface.RosServiceClient; -//import componentInterface.RosServiceServer; -//import componentInterface.RosSubscriber; -//import rossystem.ActionConnection; -//import rossystem.RosSystem; -//import rossystem.ServiceConnection; -//import rossystem.TopicConnection; -//import rossystem.impl.ActionConnectionImpl; -//import rossystem.impl.RosSystemImpl; -//import rossystem.impl.ServiceConnectionImpl; -//import rossystem.impl.TopicConnectionImpl; -// -//public class AutoConnect implements IExternalJavaAction { -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// // public static final List FILE_EXTENSIONS = -// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public AutoConnect() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// boolean duplicated = false; -// for (EObject diagram : arg0) { -// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); -// for (DView view : owned_views) { -// for (EObject rossystemEObj : view.getModels()) { -// RosSystemImpl rossystem = ((RosSystemImpl)rossystemEObj); -// for (ComponentInterface component : rossystem.getRosComponent()) { -// for (RosPublisher rospub : component.getRospublisher()) { -// for (ComponentInterface component2 : rossystem.getRosComponent()) { -// for (RosSubscriber rossub : component2.getRossubscriber()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rospub.getPublisher().getMessage(), rossub.getSubscriber().getMessage())) { -// if (rospub.eContainer() != rossub.eContainer()) { -// duplicated = false; -// System.out.println("Possible Topic Connection found [" + rospub.eContainer() -// + "]" + rospub.getName() + "->[" + rossub.eContainer() + "]" -// + rossub.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils -// .isDuplicatedTopicConnection(rossystem, rospub, rossub); -// if (!duplicated) { -// TopicConnection topic_connection = new TopicConnectionImpl(); -// topic_connection.setTopicName(rospub.getName()); -// topic_connection.getFrom().add(rospub); -// topic_connection.getTo().add(rossub); -// rossystem.getTopicConnections().add(topic_connection); -// } -// } -// } -// } -// } -// } -// for (RosServiceClient rosscl : component.getRosserviceclient()) { -// for (ComponentInterface component2 : ((RosSystem) rossystem).getRosComponent()) { -// for (RosServiceServer rosss : component2.getRosserviceserver()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rosscl.getSrvclient().getService(), rosss.getSrvserver().getService())) { -// if (rosscl.eContainer() != rosss.eContainer()) { -// duplicated = false; -// System.out.println("Possible Service Connection found [" -// + rosscl.eContainer() + "]" + rosscl.getName() + "->[" -// + rosss.eContainer() + "]" + rosss.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils.isDuplicatedServiceConnection( -// rossystem, rosss, rosscl); -// if (!duplicated) { -// ServiceConnection srv_connection = new ServiceConnectionImpl(); -// srv_connection.setServiceName(rosscl.getName()); -// srv_connection.setTo(rosscl); -// srv_connection.getFrom().add(rosss); -// rossystem.getServiceConnections().add(srv_connection); -// } -// } -// } -// } -// } -// } -// for (RosActionClient rosac : component.getRosactionclient()) { -// for (ComponentInterface component2 : rossystem.getRosComponent()) { -// for (RosActionServer rosas : component2.getRosactionserver()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rosac.getActclient().getAction(), rosas.getActserver().getAction())) { -// if (rosac.eContainer() != rosas.eContainer()) { -// -// System.out.println("Possible Action Connection found [" + rosac.eContainer() -// + "]" + rosac.getName() + "->[" + rosas.eContainer() + "]" -// + rosas.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils -// .isDuplicatedActionConnection(rossystem, rosac, rosas); -// if (!duplicated) { -// ActionConnection action_connection = new ActionConnectionImpl(); -// action_connection.setActionName(rosac.getName()); -// action_connection.setFrom(rosas); -// action_connection.setTo(rosac); -// rossystem.getActionConnections().add(action_connection); -// } -// } -// } -// } -// } -// } -// } -// } -// } -// } -// } -// -//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java deleted file mode 100644 index 7ab42a3b..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ConnectionsCheckUtils.java +++ /dev/null @@ -1,123 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -// -//import java.util.List; -//import java.util.Optional; -//import java.util.stream.Collectors; -// -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.emf.ecore.util.EcoreUtil; -//import org.eclipse.emf.common.util.EList; -//import org.eclipse.sirius.business.api.session.Session; -//import org.eclipse.sirius.business.api.session.SessionManager; -//import org.eclipse.sirius.diagram.impl.DSemanticDiagramImpl; -//import org.eclipse.sirius.viewpoint.DAnalysis; -//import org.eclipse.sirius.viewpoint.DView; -// -//import componentInterface.RosActionClient; -//import componentInterface.RosActionServer; -//import componentInterface.RosPublisher; -//import componentInterface.RosServiceClient; -//import componentInterface.RosServiceServer; -//import componentInterface.RosSubscriber; -//import ros.SpecBase; -//import rossystem.ActionConnection; -//import rossystem.RosSystem; -//import rossystem.ServiceConnection; -//import rossystem.TopicConnection; -// -///* -// * Class with utility functions used by AutoConnect and SimulateRuntimeConnections -// */ -// -//public final class ConnectionsCheckUtils { -// -// private ConnectionsCheckUtils() { -// -// } -// -// static List getDiagramViews(EObject diagram) { -// -// EObject target = ((DSemanticDiagramImpl) diagram).getTarget(); -// Session session = SessionManager.INSTANCE.getSession(target); -// DAnalysis slaveAnalysis = (DAnalysis) session.getSessionResource().getContents().get(0); -// String name = ((DSemanticDiagramImpl) diagram).getName(); -// EList owned_views = slaveAnalysis.getOwnedViews(); -// -// List current_views = owned_views.stream() -// .filter(view -> view.getOwnedRepresentationDescriptors().toString().contains(name)) -// .collect(Collectors.toList()); -// -// return current_views; -// } -// -// static boolean containEqualCommunicationObjects(SpecBase message1, SpecBase message2) { -// if (message1==null | message2==null) { -// return false; -// } -// boolean haveEqualName = false; -// if (message1.isSetFullname() && message2.isSetFullname()) { -// if (message1.getFullname().equals(message2.getFullname())) { -// haveEqualName = true; -// } -// } else { -// if (message1.getName().equals(message2.getName())) { -// haveEqualName = true; -// } -// } -// -// boolean haveEqualContent = true; -// if (message1.eContents().size() != message2.eContents().size()) { -// haveEqualContent = false; -// } else { -// for (EObject communicationObject1 : message1.eContents()) { -// Optional optional = message2.eContents().stream() -// .filter(obj -> EcoreUtil.equals(obj, communicationObject1)).findFirst(); -// if (!optional.isPresent()) { -// haveEqualContent = false; -// } -// } -// } -// return haveEqualName && haveEqualContent; -// } -// -// static boolean isDuplicatedTopicConnection(RosSystem rossystem, RosPublisher rospub, RosSubscriber rossub) { -// for (TopicConnection topic_con : rossystem.getTopicConnections()) { -// for (RosPublisher pub_con : topic_con.getFrom()) { -// for (RosSubscriber sub_con : topic_con.getTo()) { -// if (pub_con == rospub && sub_con == rossub) { -// System.out.println("Connection already exits"); -// return true; -// } -// } -// } -// } -// -// return false; -// } -// -// static boolean isDuplicatedServiceConnection(RosSystem rossystem, RosServiceServer rosss, RosServiceClient rosscl) { -// for (ServiceConnection srv_con : ((RosSystem) rossystem).getServiceConnections()) { -// for (RosServiceServer srvs_con : srv_con.getFrom()) { -// if (srvs_con == rosss && EcoreUtil.equals(srv_con.getTo(), rosscl)) { -// System.out.println("Connection already exits"); -// return true; -// } -// } -// } -// -// return false; -// } -// -// static boolean isDuplicatedActionConnection(RosSystem rossystem, RosActionClient rosac, RosActionServer rosas) { -// for (ActionConnection act_con : rossystem.getActionConnections()) { -// if (EcoreUtil.equals(act_con.getTo(), rosac) && EcoreUtil.equals(act_con.getFrom(), rosas)) { -// System.out.println("Connection already exits"); -// return true; -// } -// } -// -// return false; -// } -// -//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java deleted file mode 100644 index fc4933e1..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewComponents.java +++ /dev/null @@ -1,55 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.Arrays; -//import java.util.Collection; -//import java.util.Collections; -//import java.util.List; -//import java.util.Map; -// -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.jface.viewers.StructuredSelection; -//import org.eclipse.jface.wizard.WizardDialog; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.swt.widgets.Display; -//import org.eclipse.swt.widgets.Shell; -//import org.eclipse.ui.IWorkbench; -//import org.eclipse.ui.PlatformUI; -// -//import componentInterface.presentation.ComponentInterfaceEditorPlugin; -//import componentInterface.presentation.ComponentInterfaceModelWizardOnlyRosInputModel; -// -// -//public class ExternalJavaActionNewComponents implements IExternalJavaAction { -// -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public ExternalJavaActionNewComponents() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// Display display = Display.getDefault(); -// Shell activeShell = display.getActiveShell(); -// ComponentInterfaceModelWizardOnlyRosInputModel wizard = new ComponentInterfaceModelWizardOnlyRosInputModel(); -// wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(), arg0, arg1); -// WizardDialog dialog = new WizardDialog(activeShell,wizard); -// dialog.create(); -// dialog.getShell().setText(wizard.getWindowTitle()); -// dialog.open(); -// } -//} -// diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java deleted file mode 100644 index edef3d5d..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/ExternalJavaActionNewParameter.java +++ /dev/null @@ -1,87 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.Collection; -//import java.util.Map; -// -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.common.util.URI; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.emf.ecore.resource.Resource; -//import org.eclipse.emf.ecore.resource.ResourceSet; -//import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.jface.viewers.LabelProvider; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.swt.widgets.Display; -//import org.eclipse.swt.widgets.Shell; -//import org.eclipse.ui.IWorkbench; -//import org.eclipse.ui.dialogs.ElementListSelectionDialog; -//import ros.Parameter; -//import ros.ParameterBoolean; -//import ros.ParameterStringType; -//import ros.ParameterType; -//import ros.impl.ParameterBooleanImpl; -//import ros.impl.ParameterBooleanTypeImpl; -//import ros.impl.ParameterDateTypeImpl; -//import ros.impl.ParameterDoubleTypeImpl; -//import ros.impl.ParameterImpl; -//import ros.impl.ParameterIntegerTypeImpl; -//import ros.impl.ParameterStringImpl; -//import ros.impl.ParameterStringTypeImpl; -//import ros.impl.ParameterTypeImpl; -// -// -//public class ExternalJavaActionNewParameter implements IExternalJavaAction { -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// //public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public ExternalJavaActionNewParameter() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// Display display = Display.getDefault(); -// Shell activeShell = display.getActiveShell(); -// ElementListSelectionDialog dlg = new ElementListSelectionDialog(activeShell, new LabelProvider()); -// dlg.setTitle("ParameterType"); -// dlg.setMessage("Select a type for your parameter (* = any string, ? = any char):"); -// Collection param_collection = (Collection) arg0; -// Parameter param = param_collection.iterator().next(); -// ParameterType type = null; -// -// dlg.setElements( new Object[] {"Boolean","String","Integer","Date","Double"}); -// dlg.open(); -// -// Object selected_type = dlg.getFirstResult(); -// if (selected_type.toString() == "Boolean") { -// type = new ParameterBooleanTypeImpl(); -// } -// if (selected_type.toString() == "String") { -// type = new ParameterStringTypeImpl(); -// } -// if (selected_type.toString() == "Integer") { -// type = new ParameterIntegerTypeImpl(); -// } -// if (selected_type.toString() == "Date") { -// type = new ParameterDateTypeImpl(); -// } -// if (selected_type.toString() == "Double") { -// type = new ParameterDoubleTypeImpl(); -// } -// param.setType(type); -// -// -//} -//} -// diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java deleted file mode 100644 index f0070920..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveAllConnections.java +++ /dev/null @@ -1,64 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.Collection; -//import java.util.Iterator; -//import java.util.List; -//import java.util.Map; -// -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.sirius.viewpoint.DView; -//import org.eclipse.ui.IWorkbench; -// -//import rossystem.ActionConnection; -//import rossystem.ServiceConnection; -//import rossystem.TopicConnection; -//import rossystem.impl.RosSystemImpl; -// -//public class RemoveAllConnections implements IExternalJavaAction { -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// // public static final List FILE_EXTENSIONS = -// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public RemoveAllConnections() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// for (EObject diagram : arg0) { -// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); -// for (DView view : owned_views) { -// for (EObject rossystem : view.getModels()) { -// Iterator it = ((RosSystemImpl) rossystem).getTopicConnections().iterator(); -// while (it.hasNext()) { -// it.next(); -// it.remove(); -// } -// Iterator is = ((RosSystemImpl) rossystem).getServiceConnections().iterator(); -// while (is.hasNext()) { -// is.next(); -// is.remove(); -// } -// Iterator ia = ((RosSystemImpl) rossystem).getActionConnections().iterator(); -// while (ia.hasNext()) { -// ia.next(); -// ia.remove(); -// } -// } -// } -// } -// } -//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java deleted file mode 100644 index 9856089d..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/RemoveComponentsWithConnections.java +++ /dev/null @@ -1,118 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.ArrayList; -//import java.util.Collection; -//import java.util.Map; -// -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.ui.IWorkbench; -// -//import componentInterface.RosActionClient; -//import componentInterface.RosActionServer; -//import componentInterface.RosPublisher; -//import componentInterface.RosServiceClient; -//import componentInterface.RosServiceServer; -//import componentInterface.RosSubscriber; -//import componentInterface.impl.ComponentInterfaceImpl; -//import rossystem.ActionConnection; -//import rossystem.ServiceConnection; -//import rossystem.TopicConnection; -//import rossystem.impl.RosSystemImpl; -// -//public class RemoveComponentsWithConnections implements IExternalJavaAction { -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// // public static final List FILE_EXTENSIONS = -// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public RemoveComponentsWithConnections() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// -// for (EObject component:arg0) { -// ComponentInterfaceImpl selected_component = (ComponentInterfaceImpl) component; -// RosSystemImpl system = (RosSystemImpl) component.eContainer(); -// System.out.println(system.eContents()); -// System.out.println(selected_component); -// System.out.println(system.getTopicConnections()); -// ArrayList TopicConnectionsToRemove = new ArrayList(); -// ArrayList ServiceConnectionsToRemove = new ArrayList(); -// ArrayList ActionConnectionsToRemove = new ArrayList(); -// -// for (TopicConnection topic_connection: system.getTopicConnections()) { -// for (RosPublisher rospub:selected_component.getRospublisher()) { -// for (RosPublisher from: topic_connection.getFrom()) { -// if (rospub.equals(from)){ -// if (topic_connection.getFrom().size()>1){ -// topic_connection.getFrom().remove(rospub); -// }else { -// TopicConnectionsToRemove.add(topic_connection); -// } -// } -// } -// for (RosSubscriber rossub:selected_component.getRossubscriber()) { -// for (RosSubscriber to: topic_connection.getTo()) { -// if (rossub.equals(to)){ -// if (topic_connection.getTo().size()>1){ -// topic_connection.getTo().remove(rossub); -// }else { -// TopicConnectionsToRemove.add(topic_connection); -// } -// } -// } -// } -// } -// for (ServiceConnection service_connection: system.getServiceConnections()) { -// for (RosServiceServer rossrv:selected_component.getRosserviceserver()) { -// for (RosServiceServer from: service_connection.getFrom()) { -// if (rossrv.equals(from)){ -// if (service_connection.getFrom().size()>1){ -// service_connection.getFrom().remove(rossrv); -// }else { -// ServiceConnectionsToRemove.add(service_connection); -// } -// } -// } -// for (RosServiceClient rossrvcli:selected_component.getRosserviceclient()) { -// if (rossrvcli.equals(service_connection.getTo())){ -// ServiceConnectionsToRemove.add(service_connection); -// } -// } -// } -// } -// for (ActionConnection action_connection: system.getActionConnections()) { -// for (RosActionServer rosact:selected_component.getRosactionserver()) { -// if (rosact.equals(action_connection.getFrom())){ -// ActionConnectionsToRemove.add(action_connection); -// } -// } -// for (RosActionClient rosactcli:selected_component.getRosactionclient()) { -// if (rosactcli.equals(action_connection.getTo())){ -// ActionConnectionsToRemove.add(action_connection); -// } -// } -// } -// } -// for( TopicConnection connection:TopicConnectionsToRemove) { system.getTopicConnections().remove(connection);} -// for( ServiceConnection connection:ServiceConnectionsToRemove) { system.getServiceConnections().remove(connection);} -// for( ActionConnection connection:ActionConnectionsToRemove) { system.getActionConnections().remove(connection);} -// -// system.getRosComponent().remove(selected_component); -// } -// } -//} diff --git a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java b/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java deleted file mode 100644 index 5a4001ed..00000000 --- a/plugins/de.fraunhofer.ipa.ros.sirius/src/de/fraunhofer/ipa/ros/sirius/SimulateRuntimeConnections.java +++ /dev/null @@ -1,141 +0,0 @@ -//package de.fraunhofer.ipa.ros.sirius; -// -//import java.util.Collection; -//import java.util.List; -//import java.util.Map; -//import org.eclipse.core.commands.ExecutionEvent; -//import org.eclipse.core.resources.IFile; -//import org.eclipse.emf.ecore.EObject; -//import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; -//import org.eclipse.sirius.viewpoint.DView; -//import org.eclipse.ui.IWorkbench; -//import componentInterface.ComponentInterface; -//import componentInterface.RosActionClient; -//import componentInterface.RosActionServer; -//import componentInterface.RosPublisher; -//import componentInterface.RosServiceClient; -//import componentInterface.RosServiceServer; -//import componentInterface.RosSubscriber; -//import rossystem.ActionConnection; -//import rossystem.ServiceConnection; -//import rossystem.TopicConnection; -//import rossystem.impl.ActionConnectionImpl; -//import rossystem.impl.ServiceConnectionImpl; -//import rossystem.impl.TopicConnectionImpl; -//import rossystem.impl.RosSystemImpl; -// -//public class SimulateRuntimeConnections implements IExternalJavaAction { -// public IFile modelFile; -// protected IWorkbench workbench; -// protected IStructuredSelection selection; -// // public static final List FILE_EXTENSIONS = -// // Collections.unmodifiableList(Arrays.asList(ComponentInterfaceEditorPlugin.INSTANCE.getString("_UI_ComponentInterfaceEditorFilenameExtensions").split("\\s*,\\s*"))); -// protected ExecutionEvent event; -// -// public SimulateRuntimeConnections() { -// // TODO Auto-generated constructor stub -// } -// -// @Override -// public boolean canExecute(Collection arg0) { -// // TODO Auto-generated method stub -// return true; -// } -// -// @Override -// public void execute(Collection arg0, Map arg1) { -// boolean duplicated = false; -// for (EObject diagram : arg0) { -// List owned_views = ConnectionsCheckUtils.getDiagramViews(diagram); -// for (DView view : owned_views) { -// for (EObject rossystemEObj : view.getModels()) { -// RosSystemImpl rossystem = ((RosSystemImpl)rossystemEObj); -// for (ComponentInterface component : rossystem.getRosComponent()) { -// for (RosPublisher rospub : component.getRospublisher()) { -// for (ComponentInterface component2 : rossystem.getRosComponent()) { -// for (RosSubscriber rossub : component2.getRossubscriber()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rospub.getPublisher().getMessage(), rossub.getSubscriber().getMessage()) -// && rospub.getName().equals(rossub.getName())) { -// if (rospub.eContainer() != rossub.eContainer()) { -// duplicated = false; -// System.out.println("Topic Connection found [" + rospub.eContainer() + "]" -// + rospub.getName() + "->[" + rossub.eContainer() + "]" -// + rossub.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils -// .isDuplicatedTopicConnection(rossystem, rospub, rossub); -// if (!duplicated) { -// TopicConnection topic_connection = new TopicConnectionImpl(); -// topic_connection.setTopicName(rospub.getName()); -// topic_connection.getFrom().add(rospub); -// topic_connection.getTo().add(rossub); -// rossystem.getTopicConnections().add(topic_connection); -// } -// } -// } -// } -// } -// } -// for (RosServiceClient rosscl : component.getRosserviceclient()) { -// for (ComponentInterface component2 : rossystem.getRosComponent()) { -// for (RosServiceServer rosss : component2.getRosserviceserver()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rosscl.getSrvclient().getService(), rosscl.getSrvclient().getService()) -// && rosscl.getName().equals(rosss.getName())) { -// if (rosscl.getSrvclient().eContainer() != rosss.getSrvserver().eContainer()) { -// duplicated = false; -// System.out.println("Service Connection found [" + rosscl.eContainer() + "]" -// + rosscl.getName() + "->[" + rosss.eContainer() + "]" -// + rosss.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils.isDuplicatedServiceConnection( -// rossystem, rosss, rosscl); -// -// if (!duplicated) { -// ServiceConnection srv_connection = new ServiceConnectionImpl(); -// srv_connection.setServiceName(rosscl.getName()); -// srv_connection.setTo(rosscl); -// srv_connection.getFrom().add(rosss); -// rossystem.getServiceConnections().add(srv_connection); -// -// } -// } -// } -// -// } -// } -// } -// for (RosActionClient rosac : component.getRosactionclient()) { -// for (ComponentInterface component2 : rossystem.getRosComponent()) { -// for (RosActionServer rosas : component2.getRosactionserver()) { -// if (ConnectionsCheckUtils.containEqualCommunicationObjects( -// rosac.getActclient().getAction(), rosas.getActserver().getAction()) -// && rosac.getName().equals(rosas.getName())) { -// if (rosac.eContainer() != rosas.eContainer()) { -// System.out.println("Action Connection found [" + rosac.eContainer() + "]" -// + rosac.getName() + "->[" + rosas.eContainer() + "]" -// + rosas.getName()); -// // Check if connection already exists -// duplicated = ConnectionsCheckUtils -// .isDuplicatedActionConnection(rossystem, rosac, rosas); -// if (!duplicated) { -// ActionConnection action_connection = new ActionConnectionImpl(); -// action_connection.setActionName(rosac.getName()); -// action_connection.setFrom(rosas); -// action_connection.setTo(rosac); -// rossystem.getActionConnections().add(action_connection); -// } -// } -// } -// } -// } -// } -// } -// } -// } -// } -// -// } -//} From d50c7b28c9f789aa1d713da6b0c46d4d5d904a9d Mon Sep 17 00:00:00 2001 From: ipa-nhg Date: Wed, 17 Apr 2024 10:03:44 +0200 Subject: [PATCH 7/7] Add Sirius implmentation plugin to the feature for Release --- .../de.fraunhofer.ipa.ros.feature/feature.xml | 99 +++++-------------- 1 file changed, 23 insertions(+), 76 deletions(-) diff --git a/plugins/de.fraunhofer.ipa.ros.feature/feature.xml b/plugins/de.fraunhofer.ipa.ros.feature/feature.xml index 8d90d570..3c88c1a7 100644 --- a/plugins/de.fraunhofer.ipa.ros.feature/feature.xml +++ b/plugins/de.fraunhofer.ipa.ros.feature/feature.xml @@ -66,135 +66,82 @@ POSSIBILITY OF SUCH DAMAGE. + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + version="3.0.0.qualifier"/> + +