Skip to content
Snippets Groups Projects
Commit 4c52d3d9 authored by Sebastian Ebert's avatar Sebastian Ebert
Browse files

removed communicator specification (not needed anymore)

parent cc92ca5b
Branches
No related tags found
No related merge requests found
...@@ -51,12 +51,6 @@ public final class PnmlConstants { ...@@ -51,12 +51,6 @@ public final class PnmlConstants {
public static final String INPUT_SIGNAL_INIT_VALUE_DEF = "initialvalue"; public static final String INPUT_SIGNAL_INIT_VALUE_DEF = "initialvalue";
public static final String SIGNAL_VALUE_PAGE_ID = "signalValuePage"; public static final String SIGNAL_VALUE_PAGE_ID = "signalValuePage";
// structural keys
public static final String COMMUNICATORS = "communicators";
public static final String COMMUNICATOR = "communicator";
public static final String COMMUNICATOR_TYPE = "cType";
public static final String COMMUNICATOR_SUBNET = "cSubnet";
public static final String TOPIC_PUBLISHER = "topicPub"; public static final String TOPIC_PUBLISHER = "topicPub";
public static final String TOPIC_SUBSCRIBER = "topicSub"; public static final String TOPIC_SUBSCRIBER = "topicSub";
public static final String SERVICE_CLIENT = "serviceClient"; public static final String SERVICE_CLIENT = "serviceClient";
......
...@@ -47,10 +47,6 @@ aspect PnDistribution { ...@@ -47,10 +47,6 @@ aspect PnDistribution {
return ToolSpecificsParser.getSubnetFromToolSpecifics(this.getToolspecificList()); return ToolSpecificsParser.getSubnetFromToolSpecifics(this.getToolspecificList());
} }
syn lazy CommunicatorInformation PetriNet.getCommunicatorInformation(){
return ToolSpecificsParser.getCommunicatorInformationFromToolSpecifics(this.getToolspecificList());
}
syn lazy Map<String, String> PetriNet.getInputSignalDefinition(){ syn lazy Map<String, String> PetriNet.getInputSignalDefinition(){
return ToolSpecificsParser.getInputSignalDefinitionsFromToolSpecifics(this.getToolspecificList()); return ToolSpecificsParser.getInputSignalDefinitionsFromToolSpecifics(this.getToolspecificList());
} }
...@@ -71,26 +67,6 @@ aspect PnDistribution { ...@@ -71,26 +67,6 @@ aspect PnDistribution {
return ToolSpecificsParser.getServiceClientResponsePlaceId(this.getToolspecificList(), placeId); return ToolSpecificsParser.getServiceClientResponsePlaceId(this.getToolspecificList(), placeId);
} }
syn lazy CommunicatorInformation PetriNet.getCommunicatorInformation(Set<String> ignoredParts){
CommunicatorInformation cInfo = ToolSpecificsParser.getCommunicatorInformationFromToolSpecifics(this.getToolspecificList());
if(ignoredParts.size() > 0){
CommunicatorInformation filteredInfo=new CommunicatorInformation();
for(Map.Entry<String, String> entry:cInfo.getCommunicatorMapping().entries()){
for(String part:ignoredParts){
if(!(entry.getValue().equals("serviceServer") && entry.getKey().equals(part))){
// cInfo.getCommunicatorMapping().removeMapping(part, entry.getKey());
filteredInfo.addMapping(entry.getKey(),entry.getValue());
}
}
}
return filteredInfo;
}
return cInfo;
}
syn lazy String Arc.getType() { syn lazy String Arc.getType() {
return ToolSpecificsParser.getArcTypeFromToolSpecifics(this.getToolspecificList()); return ToolSpecificsParser.getArcTypeFromToolSpecifics(this.getToolspecificList());
} }
......
...@@ -186,49 +186,6 @@ aspect ToolSpecificsParser{ ...@@ -186,49 +186,6 @@ aspect ToolSpecificsParser{
return inputSignalDefs; return inputSignalDefs;
} }
public static CommunicatorInformation getCommunicatorInformationFromToolSpecifics(JastAddList<ToolInfo> toolInfos) {
CommunicatorInformation ci = new CommunicatorInformation();
if (toolInfos.getNumChild() > 0) {
try {
Document doc = parseToolSpecifics(toolInfos);
org.w3c.dom.NodeList communicatorList = doc.getElementsByTagName(PnmlConstants.COMMUNICATOR);
for (int i = 0; i < communicatorList.getLength(); i++) {
String ct = null;
String cs = null;
for (int j = 0; j < communicatorList.item(i).getChildNodes().getLength(); j++) {
org.w3c.dom.Node n = communicatorList.item(i).getChildNodes().item(j);
String newline = System.getProperty("line.separator");
if (n.getTextContent().length() > 1 && !n.getTextContent().contains(newline)) {
if (n.getNodeName().equals(PnmlConstants.COMMUNICATOR_TYPE)) {
ct = n.getTextContent();
}
if (n.getNodeName().equals(PnmlConstants.COMMUNICATOR_SUBNET)) {
cs = n.getTextContent();
}
if (ct != null && cs != null) {
ci.addMapping(cs, ct);
ct = null;
cs = null;
}
}
}
}
} catch (ParserConfigurationException | SAXException | IOException e) {
logger.error(e.getMessage());
}
}
return ci;
}
private static String getElementByKeyFromToolSpecifics(JastAddList<ToolInfo> toolInfos, String key) { private static String getElementByKeyFromToolSpecifics(JastAddList<ToolInfo> toolInfos, String key) {
if (toolInfos.getNumChild() > 0) { if (toolInfos.getNumChild() > 0) {
...@@ -543,7 +500,6 @@ aspect ToolSpecificsParser{ ...@@ -543,7 +500,6 @@ aspect ToolSpecificsParser{
for (ToolInfo toolInfo : toolInfos) { for (ToolInfo toolInfo : toolInfos) {
if (toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.SUBNET_KEY) > 0 || if (toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.SUBNET_KEY) > 0 ||
toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.COMMUNICATOR) > 0 ||
toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.TYPE_KEY) > 0 || toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.TYPE_KEY) > 0 ||
toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.INPUT_SIGNALS_DEF) > 0 || toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.INPUT_SIGNALS_DEF) > 0 ||
toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.ARC_TYPE_KEY) > 0) { toolInfo.getFormattedXMLBuffer().indexOf(PnmlConstants.ARC_TYPE_KEY) > 0) {
......
<?xml version="1.0" encoding="UTF-8"?>
<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net id="SortingNet" type="http://www.pnml.org/version-2009/grammar/ptnet">
<name>
<text>SortingNet</text>
</name>
<page id="top">
<page id="SelectorNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
<place id="RedObjectPool">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeRed</subnet>
</toolspecific>
<name>
<text>RedObjectPool</text>
</name>
</place>
<place id="BlueObjectPool">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeBlue</subnet>
</toolspecific>
<name>
<text>BlueObjectPool</text>
</name>
</place>
<place id="GreenObjectPool">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeGreen</subnet>
</toolspecific>
<name>
<text>GreenObjectPool</text>
</name>
</place>
<place id="RedPublisher">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeRed</subnet>
</toolspecific>
<name>
<text>RedPublisher</text>
</name>
</place>
<place id="BluePublisher">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeBlue</subnet>
</toolspecific>
<name>
<text>BluePublisher</text>
</name>
</place>
<place id="GreenPublisher">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeGreen</subnet>
</toolspecific>
<name>
<text>GreenPublisher</text>
</name>
</place>
<transition id="SortRed">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeRed</subnet>
<type>discreteTransitionType</type>
<inputsignalclause>(SignalRed)</inputsignalclause>
</toolspecific>
<name>
<text>SortRed</text>
</name>
</transition>
<transition id="SortGreen">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeGreen</subnet>
<type>discreteTransitionType</type>
<inputsignalclause>(SignalGreen)</inputsignalclause>
</toolspecific>
<name>
<text>SortGreen</text>
</name>
</transition>
<transition id="SortBlue">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<node>SelectorNode</node>
<subnet>SelectorNodeBlue</subnet>
<type>discreteTransitionType</type>
<inputsignalclause>(SignalBlue)</inputsignalclause>
</toolspecific>
<name>
<text>SortBlue</text>
</name>
</transition>
<arc id="sn1" source="RedObjectPool" target="SortRed">
</arc>
<arc id="sn2" source="GreenObjectPool" target="SortGreen">
</arc>
<arc id="sn3" source="BlueObjectPool" target="SortBlue">
</arc>
<arc id="sn4" source="SortRed" target="RedPublisher">
</arc>
<arc id="sn5" source="SortGreen" target="GreenPublisher">
</arc>
<arc id="sn6" source="SortBlue" target="BluePublisher">
</arc>
</page>
<page id="ControllerLeftNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
<page id="ControllerRightNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
<page id="SynchronizerNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
<page id="ExecutorNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
<page id="SensorNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
<page id="FeedbackNodePage">
<toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1">
<type>nodePage</type>
</toolspecific>
</page>
</page>
</net>
</pnml>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment