diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logo.jpeg b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logo.jpeg index c2be90bc4a910a5e6b459905286c5fcbe4edbd4c..204934bddfafd5893e71673c16251929914a6045 100644 Binary files a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logo.jpeg and b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logo.jpeg differ diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logoBIG.jpeg b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logoBIG.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..c2be90bc4a910a5e6b459905286c5fcbe4edbd4c Binary files /dev/null and b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/can-logoBIG.jpeg differ diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logo.png b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logo.png index faa554e617fb40bb60ab411dbcb13a9db8f88d0b..ca054922c08baf0bb3235fb02d1baafcc9722419 100644 Binary files a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logo.png and b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logo.png differ diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logoBIG.png b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logoBIG.png new file mode 100644 index 0000000000000000000000000000000000000000..faa554e617fb40bb60ab411dbcb13a9db8f88d0b Binary files /dev/null and b/org.fortiss.af3.platform.raspberry.ui/trunk/icons/raspberry-pi-logoBIG.png differ diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/plugin.xml b/org.fortiss.af3.platform.raspberry.ui/trunk/plugin.xml index a61736f6f88e5c4d47106d89f138d25fce3c96a9..cb6d00740e9570d21e60d292bf398b88ad0fbb58 100644 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/plugin.xml +++ b/org.fortiss.af3.platform.raspberry.ui/trunk/plugin.xml @@ -22,18 +22,6 @@ modelElementClass="org.fortiss.af3.platform.raspberry.model.RaspberryPi3"> </modelElementClass> </modelElementCompositor> - <modelElementCompositor - compositor="org.fortiss.af3.platform.raspberry.ui.compose.elements.BusCompositor"> - <modelElementClass - modelElementClass="org.fortiss.af3.platform.raspberry.model.Bus"> - </modelElementClass> - </modelElementCompositor> - <modelElementCompositor - compositor="org.fortiss.af3.platform.raspberry.ui.compose.elements.CoreCompositor"> - <modelElementClass - modelElementClass="org.fortiss.af3.platform.raspberry.model.Core"> - </modelElementClass> - </modelElementCompositor> <modelElementCompositor compositor="org.fortiss.af3.platform.raspberry.ui.compose.elements.CANBusCompositor"> <modelElementClass @@ -49,19 +37,6 @@ </extension> <extension point="org.fortiss.tooling.kernel.modelConnectionCompositor"> - <modelConnectionCompositor - modelConnectionCompositor="org.fortiss.af3.platform.raspberry.ui.compose.connections.CoreToBusConnectionCompositor"> - <source> - <modelElementClass - modelElementClass="org.fortiss.af3.platform.raspberry.model.Core"> - </modelElementClass> - </source> - <target> - <modelElementClass - modelElementClass="org.fortiss.af3.platform.raspberry.model.Bus"> - </modelElementClass> - </target> - </modelConnectionCompositor> <modelConnectionCompositor modelConnectionCompositor="org.fortiss.af3.platform.raspberry.ui.compose.connections.RaspberryPi3ToCANBusConnectionCompositor"> <source> diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/BusCompositor.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/BusCompositor.java deleted file mode 100644 index a3b52a4a8c9028e192078689d00c61a6e43ab6ad..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/BusCompositor.java +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.ui.compose.elements; - -import org.fortiss.af3.platform.compose.IPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.compose.base.hierarchical.elements.TransmissionUnitComponentCompositorBase; -import org.fortiss.af3.platform.model.IArchitectureDomain; -import org.fortiss.af3.platform.raspberry.compositor.RaspberryPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.raspberry.model.Bus; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class BusCompositor extends TransmissionUnitComponentCompositorBase<Bus> { - - /** {@inheritDoc} */ - @Override - public IPlatformHierarchicalCompositionRules getPlatformCompositionRules() { - return RaspberryPlatformHierarchicalCompositionRules.INSTANCE; - } - - /** {@inheritDoc} */ - @Override - protected Class<? extends IArchitectureDomain> getEditedObjectClass() { - return Bus.class; - } - -} diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/CoreCompositor.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/CoreCompositor.java deleted file mode 100644 index 91ed7e7b5728593a22c93188c91e24b67e214b80..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/compose/elements/CoreCompositor.java +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.ui.compose.elements; - -import org.fortiss.af3.platform.compose.IPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.compose.base.hierarchical.elements.ExecutionUnitComponentCompositorBase; -import org.fortiss.af3.platform.model.IArchitectureDomain; -import org.fortiss.af3.platform.raspberry.compositor.RaspberryPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.raspberry.model.Core; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class CoreCompositor extends ExecutionUnitComponentCompositorBase<Core> { - - /** {@inheritDoc} */ - @Override - public IPlatformHierarchicalCompositionRules getPlatformCompositionRules() { - return RaspberryPlatformHierarchicalCompositionRules.INSTANCE; - } - - /** {@inheritDoc} */ - @Override - protected Class<? extends IArchitectureDomain> getEditedObjectClass() { - return Core.class; - } - -} diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/CoreStructureEditor.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/CoreStructureEditor.java deleted file mode 100644 index fcfd4841bddc379caac73c62ad86797841160990..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/CoreStructureEditor.java +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.ui.editor; - -import org.fortiss.af3.platform.compose.IPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.model.IArchitectureDomain; -import org.fortiss.af3.platform.raspberry.compositor.RaspberryPlatformHierarchicalCompositionRules; -import org.fortiss.af3.platform.raspberry.model.Core; -import org.fortiss.af3.platform.ui.editor.PlatformComponentStructureEditorBase; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class CoreStructureEditor extends PlatformComponentStructureEditorBase<Core> { - - /** {@inheritDoc} */ - @Override - public IPlatformHierarchicalCompositionRules getPlatformCompositionRules() { - return RaspberryPlatformHierarchicalCompositionRules.INSTANCE; - } - - /** {@inheritDoc} */ - @Override - protected Class<? extends IArchitectureDomain> getEditedObjectClass() { - return Core.class; - } - -} diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/binding/CoreStructureEditorBinding.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/binding/CoreStructureEditorBinding.java deleted file mode 100644 index ba8fe6f9c48c4a821a520b2efbc64fc443912fb9..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/editor/binding/CoreStructureEditorBinding.java +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.ui.editor.binding; - -import org.eclipse.ui.IEditorPart; -import org.fortiss.af3.platform.raspberry.model.Core; -import org.fortiss.af3.platform.raspberry.ui.editor.CoreStructureEditor; -import org.fortiss.af3.platform.ui.editor.PlatformComponentStructureEditorBindingBase; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class CoreStructureEditorBinding extends PlatformComponentStructureEditorBindingBase<Core> { - - /** {@inheritDoc} */ - @Override - public Class<? extends IEditorPart> getEditorClass(Core core) { - return CoreStructureEditor.class; - } - - /** {@inheritDoc} */ - @Override - public String getLabel(Core core) { - return "Core Structure"; - } - -} diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototypes/PrototypeProvider.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototypes/PrototypeProvider.java index ecc02d5959d7543582229c8008956051fa27874a..84836fa5ae4af7eb159c51a760d29fba524c5913 100644 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototypes/PrototypeProvider.java +++ b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototypes/PrototypeProvider.java @@ -19,13 +19,11 @@ package org.fortiss.af3.platform.raspberry.ui.prototypes; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createActuator; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createActuatorOut; -import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createBus; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createBusMasterInterface; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createBusMasterPort; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createCANBus; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createCANBusMasterInterface; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createCANBusMasterPort; -import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createCore; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createRaspberryPi3; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createSensor; import static org.fortiss.af3.platform.raspberry.utils.RaspberryModelElementFactory.createSensorIn; @@ -34,13 +32,11 @@ import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodePosition; import org.fortiss.af3.platform.raspberry.model.Actuator; import org.fortiss.af3.platform.raspberry.model.ActuatorOut; -import org.fortiss.af3.platform.raspberry.model.Bus; import org.fortiss.af3.platform.raspberry.model.BusMasterInterface; import org.fortiss.af3.platform.raspberry.model.BusMasterPort; import org.fortiss.af3.platform.raspberry.model.CANBus; import org.fortiss.af3.platform.raspberry.model.CANBusMasterInterface; import org.fortiss.af3.platform.raspberry.model.CANBusMasterPort; -import org.fortiss.af3.platform.raspberry.model.Core; import org.fortiss.af3.platform.raspberry.model.RaspberryPi3; import org.fortiss.af3.platform.raspberry.model.Sensor; import org.fortiss.af3.platform.raspberry.model.SensorIn; @@ -78,11 +74,6 @@ public class PrototypeProvider extends PrototypeProviderBase { setConnectorPosition(actuator, 0, 0); registerPrototype("ActuatorOut", actuatorOut, CATEGORY_NAME); - Bus bus = createBus("Bus"); - setNodePosition(bus, 0, 0); - setConnectorPosition(bus, 0, 0); - registerPrototype("Bus", bus, CATEGORY_NAME); - BusMasterInterface busMasterInterface = createBusMasterInterface("BusMasterInterface"); setNodePosition(busMasterInterface, 0, 0); setConnectorPosition(busMasterInterface, 0, 0); @@ -109,11 +100,6 @@ public class PrototypeProvider extends PrototypeProviderBase { setConnectorPosition(canBusMasterPort, 0, 0); registerPrototype("CANBusMasterPort", canBusMasterPort, CATEGORY_NAME); - Core core = createCore("Core"); - setNodePosition(core, 0, 0); - setConnectorPosition(core, 0, 0); - registerPrototype("Core", core, CATEGORY_NAME); - RaspberryPi3 raspberryPi3 = createRaspberryPi3("RaspberryPi3"); setNodePosition(raspberryPi3, 0, 0); setConnectorPosition(raspberryPi3, 0, 0); diff --git a/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.ecore b/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.ecore index 62a5eb05acf4e2767f7609c4b9e94938c663a386..317682960317ed2fc41387b1d55ef0d28cf33e49 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.ecore +++ b/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.ecore @@ -20,8 +20,6 @@ </eOperations> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="RaspberryPi3" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//GenericPlatformUnit platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement #//IBoardDomain"/> - <eClassifiers xsi:type="ecore:EClass" name="Core" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ExecutionUnit platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IIpCorePlatformArchitectureElement #//IProcessorDomain"/> - <eClassifiers xsi:type="ecore:EClass" name="Bus" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//TransmissionUnit platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IIpCorePlatformArchitectureElement #//IProcessorDomain"/> <eClassifiers xsi:type="ecore:EClass" name="Sensor" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Receiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformIOResource"/> <eClassifiers xsi:type="ecore:EClass" name="Actuator" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transmitter platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformIOResource"/> <eClassifiers xsi:type="ecore:EClass" name="SensorIn" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Receiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IIpCorePlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IProcessorDomain platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformIOResource"/> diff --git a/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.genmodel b/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.genmodel index 32ba92e0a13fe73ff96b00a1a3193d7833fe3245..dc24d886c6402aac7b6a608dded57a2ff5675219 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.genmodel +++ b/org.fortiss.af3.platform.raspberry/trunk/model/raspberry.genmodel @@ -15,8 +15,6 @@ <genOperations ecoreOperation="raspberry.ecore#//IBoardDomain/getArchitectureDomainName"/> </genClasses> <genClasses ecoreClass="raspberry.ecore#//RaspberryPi3"/> - <genClasses ecoreClass="raspberry.ecore#//Core"/> - <genClasses ecoreClass="raspberry.ecore#//Bus"/> <genClasses ecoreClass="raspberry.ecore#//Sensor"/> <genClasses ecoreClass="raspberry.ecore#//Actuator"/> <genClasses ecoreClass="raspberry.ecore#//SensorIn"/> diff --git a/org.fortiss.af3.platform.raspberry/trunk/plugin.xml b/org.fortiss.af3.platform.raspberry/trunk/plugin.xml index 74e367dff44d1e812233cc38c5986c581af3d8b4..ac16f745165febdb3f96b1b59b4bd0a0e30e3013 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/plugin.xml +++ b/org.fortiss.af3.platform.raspberry/trunk/plugin.xml @@ -28,32 +28,6 @@ <extension point="org.fortiss.tooling.kernel.transformationProvider"> - <transformationProvider - transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.RaspberryPi1ExecutableTransformation"> - <source> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.model.RaspberryPi1"> - </objectClass> - </source> - <target> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.generator.executable.RaspberryPi1Executable"> - </objectClass> - </target> - </transformationProvider> - <transformationProvider - transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.RaspberryPi2ExecutableTransformation"> - <source> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.model.RaspberryPi2"> - </objectClass> - </source> - <target> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.generator.executable.RaspberryPi2Executable"> - </objectClass> - </target> - </transformationProvider> <transformationProvider transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.RaspberryPi3ExecutableTransformation"> <source> @@ -67,19 +41,6 @@ </objectClass> </target> </transformationProvider> - <transformationProvider - transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.CoreExecutableTransformation"> - <source> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.model.Core"> - </objectClass> - </source> - <target> - <objectClass - objectClass="org.fortiss.af3.platform.raspberry.generator.executable.CoreExecutable"> - </objectClass> - </target> - </transformationProvider> <transformationProvider transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.BusExecutableTransformation"> <source> @@ -342,12 +303,6 @@ </extension> <extension point="org.fortiss.tooling.base.annotation"> - <annotation - binding="org.fortiss.af3.platform.raspberry.annotation.valueprovider.CoreAddressValueProvider"> - <modelElementClass - modelElementClass="org.fortiss.af3.platform.raspberry.model.Core"> - </modelElementClass> - </annotation> <annotation binding="org.fortiss.af3.platform.raspberry.annotation.valueprovider.PinNumberValueProvider"> <modelElementClass diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusExecutable.java deleted file mode 100644 index 20eec60c2a0d81fd570f77529ef80d59329bd716..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/BusExecutable.java +++ /dev/null @@ -1,219 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.generator.executable; - -import static org.fortiss.af3.generator.common.utils.SourceModelElementFactory.createStaticContentSourceUnit; -import static org.fortiss.af3.platform.raspberry.utils.RaspberryUtils.getEcuForComponent; -import static org.fortiss.af3.platform.raspberry.utils.RaspberryUtils.getTargetComponent; -import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.findElementById; - -import java.util.List; -import java.util.Map; - -import org.eclipse.emf.common.util.EList; -import org.fortiss.af3.component.model.Component; -import org.fortiss.af3.component.model.OutputPort; -import org.fortiss.af3.component.model.Port; -import org.fortiss.af3.component.model.PortSpecification; -import org.fortiss.af3.deployment.model.ComponentAllocation; -import org.fortiss.af3.deployment.model.Deployment; -import org.fortiss.af3.generator.common.model.source.SourcePackage; -import org.fortiss.af3.platform.language.executable.TransmissionUnitExecutableBase; -import org.fortiss.af3.platform.model.ExecutionUnit; -import org.fortiss.af3.platform.model.TransmissionUnit; -import org.fortiss.af3.platform.model.impl.PlatformConnectorUnitImpl; -import org.fortiss.af3.platform.raspberry.generated.files.RaspberryFileGeneration; -import org.fortiss.af3.platform.raspberry.model.annotation.PeripheralAddress; -import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber; -import org.fortiss.af3.platform.raspberry.model.impl.ActuatorOutImpl; -import org.fortiss.af3.platform.raspberry.model.impl.SensorInImpl; -import org.fortiss.tooling.base.model.element.IConnector; -import org.fortiss.tooling.base.model.element.IHierarchicElement; -import org.fortiss.tooling.base.model.element.IModelElementSpecification; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class BusExecutable extends TransmissionUnitExecutableBase<TransmissionUnit> { - - /** - * @param modelElement - */ - public BusExecutable(TransmissionUnit modelElement) { - super(modelElement); - // TODO Auto-generated constructor stub - } - - /** {@inheritDoc} */ - @Override - public void createAllFiles(SourcePackage pack, Map<ExecutionUnit, List<Port>> euPortsPair, - Map<ExecutionUnit, List<Component>> euComponentList, Component topComponent, - int deploymentID) { - findBusSignals(deploymentID, topComponent, pack); - } - - /** - * Finds Information about Signals that are transmitted over the Bus and form fields of the - * message. - */ - public void findBusSignals(int deploymentID, Component topComponent, SourcePackage pack) { - createProtoFile(deploymentID, topComponent, pack); - - createHeaderFile(pack, "sensors"); - createHeaderFile(pack, "actuators"); - - createFilesPeripheralDetails(pack); - } - - /** - * Finds Information about Signals that are transmitted over the Bus and form fields of the - * message. - */ - private void createProtoFile(int deploymentID, Component topComponent, SourcePackage pack) { - String messageString = "message msg { \n"; - int counter = 0; - Deployment currentDeployment = - (Deployment)findElementById(deploymentID, topComponent.eContainer().eContainer()); - for(ComponentAllocation allocation : currentDeployment.getComponentAllocations()) { - Component c1 = allocation.getComponent(); - Object lastPort = null; - for(Object port : c1.getConnectors()) { - if(port instanceof OutputPort) { - for(Component c2 : getTargetComponent((OutputPort)port)) { - if(getEcuForComponent(c1, currentDeployment) != getEcuForComponent(c2, - currentDeployment) && - getEcuForComponent(c2, currentDeployment) != null) { - for(Object specs : ((OutputPort)port).getSpecifications()) { - if(specs instanceof PortSpecification && port != lastPort) { - lastPort = port; - counter = counter + 1; - PortSpecification portSpec = (PortSpecification)specs; - String prtType; - switch(portSpec.getType().toString()) { - case "int": - prtType = "int32"; - break; - case "boolean": - prtType = "bool"; - break; - default: - prtType = portSpec.getType().toString(); - break; - } - messageString += - "\t optional " + prtType + " " + - ((OutputPort)port).getName().toLowerCase() + - "= " + counter + ";\n"; - } - } - } - } - } - } - } - messageString += "}"; - createFile(pack, messageString, "message.proto"); - } - - /** Determine Sensors, Actuators their IDs and PinNumbers. */ - private void createFilesPeripheralDetails(SourcePackage pack) { - String sensorList = "#include \"sensors.h\" \n\n"; - sensorList += "sensors sen[] = \n{ \n"; - String actuatorList = "#include \"actuators.h\" \n\n"; - actuatorList += "actuators act[] = \n{\n"; - - String componentsList = "#ifndef __COMPONENTS_H\n"; - componentsList += "#define __COMPONENTS_H\n\n"; - - EList<IHierarchicElement> el = modelElement.getContainer().getContainedElements(); - for(IHierarchicElement ce : el) { - EList<IConnector> conList = ce.getConnectors(); - for(IConnector conn : conList) { - if(conn instanceof SensorInImpl) { - sensorList += addSensorSpecsToList((SensorInImpl)conn); - componentsList += - componentDefine("SensorIn", ((PlatformConnectorUnitImpl)conn).getId()); - } - if(conn instanceof ActuatorOutImpl) { - actuatorList += addSensorSpecsToList((ActuatorOutImpl)conn); - componentsList += - componentDefine("ActuatorOut", - ((PlatformConnectorUnitImpl)conn).getId()); - } - } - } - - sensorList = fixEnding(sensorList); - actuatorList = fixEnding(actuatorList); - - componentsList += "\n#endif"; - - createFile(pack, sensorList, "sensors.c"); - createFile(pack, actuatorList, "actuators.c"); - createFile(pack, componentsList, "components.h"); - } - - private String fixEnding(String s) { - return s.substring(0, s.length() - ",\n".length()) + "\n};"; - - } - - private String componentDefine(String s, int value) { - return "#define " + s + "_ID_" + value + " " + value + "\n"; - } - - /** Add specification of peripheral to the respective list of Sensors. */ - private String addSensorSpecsToList(PlatformConnectorUnitImpl conn) { - int id = conn.getId(); - int pinNr = 0; - int address = 0; - EList<IModelElementSpecification> specs = conn.getSpecifications(); - for(IModelElementSpecification spec : specs) { - if(spec instanceof PinNumber) { - pinNr = ((PinNumber)spec).getPinNumber(); - } - if(spec instanceof PeripheralAddress) { - address = ((PeripheralAddress)spec).getPeripheralAddress(); - } - } - return "\t{" + id + ", " + pinNr + ", " + address + "},\n"; - } - - /** Create Header Files defining structure for actuator. */ - private void createHeaderFile(SourcePackage pack, String type) { - String content = "#ifndef __" + type.toUpperCase() + "_H \n"; - content += "#define __" + type.toUpperCase() + "_H \n\n"; - content += "struct " + type + "\n{ \n"; - content += "\tint Id;\n\tint pinNr;\n\tint address; \n};\n\n"; - content += "typedef struct " + type + " " + type + ";\n\n"; - content += "extern " + type + " " + type.substring(0, 3) + "[];\n\n"; - content += "#endif \n \n"; - createFile(pack, content, type + ".h"); - } - - /** Create file with a given Name and given text. */ - private void createFile(SourcePackage pack, String text, String name) { - RaspberryFileGeneration file = new RaspberryFileGeneration(text); - file.createInfofile(); - pack.addUnit(createStaticContentSourceUnit(name, file.getContent(), false)); - } -} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CANBusExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CANBusExecutable.java index 3bc23323b8fb72971ab47117d72467816517d220..ef1016d564b4c2ecc2e824d8bec645bb179591a9 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CANBusExecutable.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CANBusExecutable.java @@ -50,5 +50,4 @@ public class CANBusExecutable extends TransmissionUnitExecutableBase<Transmissio Map<ExecutionUnit, List<Component>> euComponentList, Component topComponent, int deploymentID) { } - } diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CoreExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CoreExecutable.java deleted file mode 100644 index 2080b2fe97ef26c3f73bed08a258b9d5030571ce..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CoreExecutable.java +++ /dev/null @@ -1,515 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.generator.executable; - -import static org.fortiss.af3.component.generator.component.ComponentFunctionIdentifierUtils.getInitializeFunctionName; -import static org.fortiss.af3.component.generator.component.ComponentFunctionIdentifierUtils.getPerformStepFunctionName; -import static org.fortiss.af3.component.generator.component.PortVariableUtils.getPortNoValAssignment; -import static org.fortiss.af3.component.generator.component.PortVariableUtils.getPortPortValueAssignment; -import static org.fortiss.af3.component.generator.component.PortVariableUtils.getPortValue; -import static org.fortiss.af3.component.generator.component.PortVariableUtils.getPortValueAssignment; -import static org.fortiss.af3.component.generator.component.PortVariableUtils.testPortVariableForNoVal; -import static org.fortiss.af3.component.utils.GeneratorModelElementFactory.createComponentFunction; -import static org.fortiss.af3.component.utils.GeneratorModelElementFactory.createComponentProgram; -import static org.fortiss.af3.component.utils.GeneratorModelElementFactory.createLocalFunction; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.assignment; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.createDataDictionary; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.definedConst; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.ifthenelse; -import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.sequence; -import static org.fortiss.af3.generator.common.utils.CLanguageModelElementFacade.addUserHeaderInclude; -import static org.fortiss.af3.generator.common.utils.CLanguageModelElementFactory.createCSourcePackage; -import static org.fortiss.af3.generator.common.utils.CLanguageModelElementFactory.createConfigureFile; -import static org.fortiss.af3.generator.common.utils.CLanguageModelElementFactory.createInclude; -import static org.fortiss.af3.generator.common.utils.CLanguageModelElementFactory.createMakedefsFile; -import static org.fortiss.af3.generator.common.utils.SourceModelElementFactory.createStaticContentSourceUnit; -import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getRootElement; -import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; -import static org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.conqat.lib.commons.collections.Pair; -import org.fortiss.af3.component.model.Channel; -import org.fortiss.af3.component.model.Component; -import org.fortiss.af3.component.model.InputPort; -import org.fortiss.af3.component.model.OutputPort; -import org.fortiss.af3.component.model.Port; -import org.fortiss.af3.component.model.generator.ComponentFunction; -import org.fortiss.af3.component.model.generator.ComponentProgram; -import org.fortiss.af3.component.model.generator.LocalFunction; -import org.fortiss.af3.deployment.generator.DeploymentExecutableTransformationContext; -import org.fortiss.af3.deployment.model.Deployment; -import org.fortiss.af3.expression.model.DataDictionary; -import org.fortiss.af3.expression.model.terms.IExpressionTerm; -import org.fortiss.af3.expression.model.terms.imperative.Assignment; -import org.fortiss.af3.expression.model.terms.imperative.IStatementTerm; -import org.fortiss.af3.expression.model.terms.imperative.StatementSequence; -import org.fortiss.af3.expression.model.types.TInt; -import org.fortiss.af3.expression.model.types.TypesFactory; -import org.fortiss.af3.expression.utils.ExpressionModelElementFactory; -import org.fortiss.af3.generator.common.model.c.CImplementationFile; -import org.fortiss.af3.generator.common.model.c.CSourcePackage; -import org.fortiss.af3.generator.common.model.source.SourcePackage; -import org.fortiss.af3.generator.common.model.source.StaticContentSourceUnit; -import org.fortiss.af3.platform.AF3PlatformActivator; -import org.fortiss.af3.platform.language.executable.ExecutableBase; -import org.fortiss.af3.platform.language.executable.ExecutionUnitExecutableBase; -import org.fortiss.af3.platform.model.ExecutionUnit; -import org.fortiss.af3.platform.model.GenericPlatformUnit; -import org.fortiss.af3.platform.model.PlatformConnectorUnit; -import org.fortiss.af3.platform.model.generic.GenericReceiver; -import org.fortiss.af3.platform.model.generic.GenericTransceiver; -import org.fortiss.af3.platform.model.generic.GenericTransmitter; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IReadExecutable; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IReadExecutableWithNoValSupport; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.ITermExecutable; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IWriteExecutable; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.IWriteExecutableWithNoValSupport; -import org.fortiss.af3.platform.raspberry.generator.executable.interfaces.InitExecutable; -import org.fortiss.af3.platform.raspberry.model.Core; -import org.fortiss.af3.platform.raspberry.templates.RaspberryTemplateLoader; -import org.fortiss.tooling.kernel.extension.data.ITransformationContext; -import org.fortiss.tooling.kernel.extension.exception.TransformationFailedException; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class CoreExecutable extends ExecutionUnitExecutableBase<Core, CSourcePackage> { - - /** - * @param modelElement - */ - public CoreExecutable(Core modelElement) { - super(modelElement); - } - - /** {@inheritDoc} */ - @Override - public IExpressionTerm getInitialization() { - return funcCall("init_generic_ecu"); - } - - /** {@inheritDoc} */ - @Override - public IExpressionTerm getTermination() { - return funcCall("term_generic_ecu"); - } - - /** {@inheritDoc} */ - @Override - protected CSourcePackage createExecutionUnitSourcePackage(String name, - List<Pair<ExecutionUnit, Component>> deployedComponents, - List<Pair<PlatformConnectorUnit, Port>> deployedPorts, ITransformationContext context) { - - /* need to check if all annotations are set */ - - CSourcePackage sourcePackage = createCSourcePackage(); - String dirName = ((GenericPlatformUnit)modelElement.eContainer()).getName(); - sourcePackage.setBaseLocation(dirName + "/" + name); - - // Fill the the two helper sets. Sets are used to ensure uniqueness of platform connectors. - Set<PlatformConnectorUnit> usedUnits = new HashSet<PlatformConnectorUnit>(); - Set<GenericTransceiver> usedTransceivers = new HashSet<GenericTransceiver>(); - for(Pair<PlatformConnectorUnit, Port> p : deployedPorts) { - usedUnits.add(p.getFirst()); - if(p.getFirst() instanceof GenericTransceiver) { - usedTransceivers.add((GenericTransceiver)p.getFirst()); - } - } - - // Create the system functions. - // ComponentFunction init = - // createInitializeFunction(deployedComponents, usedUnits, deployedPorts); - // ComponentFunction step = - // createStepFunction(deployedComponents, deployedPorts, usedTransceivers); - // ComponentProgram program = createComponentProgram("system", init, step); - // program.getLocalFunctions().add( - // createTerminationFunction(deployedPorts, deployedComponents)); - // program.getLocalFunctions().add( - // createReadInputFunction(deployedPorts, usedTransceivers, deployedComponents)); - - // Create the system functions. - DeploymentExecutableTransformationContext depctx = - (DeploymentExecutableTransformationContext)context; - Deployment depl = depctx.getDeploymentExecutable().getDeployment(); - - ComponentFunction init = createInitializeFunction(deployedComponents, usedUnits, depl); - ComponentFunction step = - createStepFunction(deployedComponents, deployedPorts, usedTransceivers, depl); - ComponentProgram program = createComponentProgram("system", init, step); - program.getLocalFunctions().add(createTerminationFunction(usedUnits, depl)); - program.getLocalFunctions().add( - createReadInputFunction(deployedPorts, usedTransceivers, depl)); - program.getLocalFunctions().add(createMainFunction()); - // Fill the system program with the component sub-programs - try { - // deployed components - for(Pair<ExecutionUnit, Component> pair : deployedComponents) { - program.getSubPrograms().add( - createTransformedObjectFor(pair.getSecond(), ComponentProgram.class, - context)); - } - - // convert the program to C code - CSourcePackage cPack = - createTransformedObjectFor(program, CSourcePackage.class, context); - cPack.mergeInto(sourcePackage); - - if(!deployedComponents.isEmpty()) { - DataDictionary dataDict = - getRootElement(deployedComponents.get(0).getSecond(), DataDictionary.class); - if(dataDict == null) { - dataDict = createDataDictionary(); - } - CSourcePackage dataDictionaryPackage = - createTransformedObjectFor(dataDict, CSourcePackage.class, context); - dataDictionaryPackage.mergeInto(sourcePackage); - } - } catch(TransformationFailedException e) { - error(AF3PlatformActivator.getDefault(), e.getMessage(), e); - } - - fixSystemCImports((CImplementationFile)sourcePackage.getSrcGenPackage() - .findSourceUnitByName("system.c"), usedUnits, usedTransceivers); - - sourcePackage.getUnits().add(createConfigureFile(modelElement.getName())); - sourcePackage.getUnits().add(createMakedefsFile()); - sourcePackage.getUnits().add(createMakeFileUsingTemplate(sourcePackage, "testName")); - sourcePackage.getSrcGenPackage().getUnits().add(createMakeMKUsingTemplate(sourcePackage)); - sourcePackage.getSrcPackage().getUnits().add(createMakeMKUsingTemplate(sourcePackage)); - sourcePackage.getIncPackage().getUnits().add(createMakeMKUsingTemplate(sourcePackage)); - sourcePackage.getIncGenPackage().getUnits().add(createMakeMKUsingTemplate(sourcePackage)); - sourcePackage.getUnits().add(createMakeMKUsingTemplate(sourcePackage)); - return sourcePackage; - } - - /** Creates Makefile using available template. */ - private StaticContentSourceUnit createMakeFileUsingTemplate(SourcePackage pack, String exName) { - String content = RaspberryTemplateLoader.getMakeFileTemplate(exName).toString(); - return createStaticContentSourceUnit("Makefile", content, false); - } - - /** Creates make.mk using available template. */ - private StaticContentSourceUnit createMakeMKUsingTemplate(SourcePackage pack) { - String content = RaspberryTemplateLoader.getMakeMkFileTemplate().toString(); - return createStaticContentSourceUnit("make.mk", content, false); - } - - /** Adds the platform connectors includes. */ - private void fixSystemCImports(CImplementationFile system, - Set<PlatformConnectorUnit> usedUnits, Set<GenericTransceiver> usedTransceivers) { - // Add includes for user code of generic HAL implementation - // String dirName = ((GenericPlatformUnit)modelElement.eContainer()).getName(); - system.getImports().add(createInclude("message.pb-c", false)); - system.getImports().add(createInclude("pi", false)); - system.getImports().add(createInclude("components", false)); - system.getImports().add(createInclude("stdio", true)); - system.getImports().add(createInclude("unistd", true)); - // addStandardHeaderInclude(system, dirName + "/message"); - for(GenericTransceiver gt : usedTransceivers) { - addUserHeaderInclude(system, gt.getName()); - } - for(PlatformConnectorUnit unit : usedUnits) { - if(unit instanceof GenericTransmitter || unit instanceof GenericReceiver) { - addUserHeaderInclude(system, "io"); - break; - } - } - } - - /** Creates the initialize function. */ - protected ComponentFunction createInitializeFunction( - List<Pair<ExecutionUnit, Component>> deployedComponents, - Set<PlatformConnectorUnit> usedUnits, Deployment depl) { - List<IStatementTerm> body = new ArrayList<IStatementTerm>(); - for(Pair<ExecutionUnit, Component> p : deployedComponents) { - body.add(assignment(funcCall(getInitializeFunctionName(p.getSecond())))); - } - - for(PlatformConnectorUnit pu : usedUnits) { - ExecutableBase<? extends PlatformConnectorUnit> exec = - getPlatformArchitectureExecutable().getExecutable(pu); - if(exec instanceof InitExecutable) { - body.add(assignment(((InitExecutable)exec).getInitialization(depl))); - } - } - return createComponentFunction("initialize_system", null, sequence(body)); - } - - /** Creates the termination function. */ - protected LocalFunction createTerminationFunction(Set<PlatformConnectorUnit> usedUnits, - Deployment depl) { - List<IStatementTerm> body = new ArrayList<IStatementTerm>(); - for(PlatformConnectorUnit pu : usedUnits) { - ExecutableBase<? extends PlatformConnectorUnit> exec = - getPlatformArchitectureExecutable().getExecutable(pu); - if(exec instanceof ITermExecutable) { - body.add(assignment(((ITermExecutable)exec).getTermination(depl))); - } - } - return createLocalFunction("terminate_system", null, sequence(body)); - } - - /** Creates the step function. */ - protected ComponentFunction createStepFunction( - List<Pair<ExecutionUnit, Component>> deployedComponents, - List<Pair<PlatformConnectorUnit, Port>> deployedPorts, - Set<GenericTransceiver> usedTransceivers, Deployment depl) { - List<IStatementTerm> body = new ArrayList<IStatementTerm>(); - - // Assignment msgDec = assignment(definedConst("Msg msg")); - boolean writeMsgFlag = modifyBusMsg(deployedPorts); - if(writeMsgFlag == true) { - body.add(assignment(definedConst("Msg msg"))); - body.add(assignment(definedConst("msg__init(&msg)"))); - } - // Search for local channels, i.e. channels that begin and end at components deployed to - // this generic execution unit. - // If such channels are found, we have to place the corresponding assignments here, since - // there is no super component that would do that for us. - for(Pair<ExecutionUnit, Component> p : deployedComponents) { - Component comp = p.getSecond(); - for(InputPort conn : comp.getInputPorts()) { - for(Channel ch : conn.getIncomingChannels()) { - if(ch.getSource().eContainer().equals(comp)) { - // We found a local channel; create the assignments - body.add(getPortPortValueAssignment(ch.getSource(), ch.getTarget())); - } - } - } - } - body.add(assignment(funcCall("read_input"))); - // Notify transceivers about start of output writing. - for(GenericTransceiver gt : usedTransceivers) { - body.add(assignment(funcCall("prepare_output_" + gt.getName()))); - } - // Perform component step - for(Pair<ExecutionUnit, Component> p : deployedComponents) { - Component comp = p.getSecond(); - if(comp.getSubComponents().isEmpty() && comp.isStronglyCausal()) { - writeOutputsForComponent(comp, deployedPorts, body, depl); - } - body.add(assignment(funcCall(getPerformStepFunctionName(p.getSecond())))); - if(!comp.getSubComponents().isEmpty() || !comp.isStronglyCausal()) { - writeOutputsForComponent(comp, deployedPorts, body, depl); - } - } - // Messages only written to Bus for cores that modifies the messages - if(writeMsgFlag == true) { - body.add(assignment(definedConst("write_BusMasterPort(msg)"))); - } - // createBusWriteCall(deployedPorts, body); - - // Notify transceivers about end of output writing. - for(GenericTransceiver gt : usedTransceivers) { - body.add(assignment(funcCall("finish_output_" + gt.getName()))); - } - return createComponentFunction("run_system", null, sequence(body)); - } - - /** - * @param deployedPorts - * @param body - */ - private void writeOutputsForComponent(Component comp, - List<Pair<PlatformConnectorUnit, Port>> deployedPorts, List<IStatementTerm> body, - Deployment depl) { - // Write outputs to transmitter and transceivers. - for(Pair<PlatformConnectorUnit, Port> p : deployedPorts) { - if(p.getSecond().getComponent() != comp) { - continue; - } - ExecutableBase<? extends PlatformConnectorUnit> exec = - getPlatformArchitectureExecutable().getExecutable(p.getFirst()); - if(exec instanceof IWriteExecutable && p.getSecond() instanceof OutputPort) { - createWriteAccess((IWriteExecutable)exec, (OutputPort)p.getSecond(), body, depl); - } - } - } - - /** Creates the main function. */ - protected LocalFunction createMainFunction() { - List<IStatementTerm> body = new ArrayList<IStatementTerm>(); - String content = "while(1) \n"; - content += "{\n"; - content += "printf(\"Loop\\n\"); \n"; - content += "run_system(); \n"; - content += "sleep(1); \n"; - content += "} \n"; - - Assignment customAssignment = - assignment(ExpressionModelElementFactory.definedConst(content)); - body.add(assignment(funcCall("initialize_system"))); - body.add(customAssignment); - body.add(assignment(funcCall("terminate_system"))); - - return createLocalFunction("main", createTInt(), sequence(body)); - } - - /** - * Creates the read input function for IOs. - */ - protected LocalFunction createReadInputFunction( - List<Pair<PlatformConnectorUnit, Port>> deployedPorts, - Set<GenericTransceiver> usedTransceivers, Deployment depl) { - List<IStatementTerm> body = new ArrayList<IStatementTerm>(); - - boolean readMsgFlag = false; - for(Pair<PlatformConnectorUnit, Port> prt : deployedPorts) { - ExecutableBase<? extends PlatformConnectorUnit> exc = - getPlatformArchitectureExecutable().getExecutable(prt.getFirst()); - if(exc instanceof BusMasterPortExecutable && prt.getSecond() instanceof InputPort) { - readMsgFlag = true; - } - } - - if(readMsgFlag == true) { - body.add(assignment(definedConst("message msg;\n read_BusMasterPort(&msg)"))); - } - // Notify transceivers about start input reading. - for(GenericTransceiver gt : usedTransceivers) { - body.add(assignment(funcCall("prepare_input_" + gt.getName()))); - } - // Read input from transceivers and receivers. - for(Pair<PlatformConnectorUnit, Port> p : deployedPorts) { - ExecutableBase<? extends PlatformConnectorUnit> exec = - getPlatformArchitectureExecutable().getExecutable(p.getFirst()); - if(exec instanceof IReadExecutable && p.getSecond() instanceof InputPort) { - createReadAccess((IReadExecutable)exec, (InputPort)p.getSecond(), body, depl); - } - } - // Notify transceivers about end of input reading. - for(GenericTransceiver gt : usedTransceivers) { - body.add(assignment(funcCall("finish_input_" + gt.getName()))); - } - return createLocalFunction("read_input", null, sequence(body)); - } - - /** Creates the read code for the given executable and port. */ - protected void createReadAccess(IReadExecutable exec, InputPort p, List<IStatementTerm> body, - Deployment depl) { - if(exec instanceof BusMasterPortExecutable) { - readMessageFromBus(exec, p, body); - } else { - IStatementTerm valueAssign = - getPortValueAssignment(p, exec.getValueReadAccessor(p, depl)); - if(exec instanceof IReadExecutableWithNoValSupport) { - IExpressionTerm guard = - ((IReadExecutableWithNoValSupport)exec).getNoValGuardAccessor(p); - StatementSequence thenBlock = sequence(getPortNoValAssignment(p)); - StatementSequence elseBlock = sequence(valueAssign); - body.add(ifthenelse(guard, thenBlock, elseBlock)); - } else { - body.add(valueAssign); - } - - } - } - - /** Creates the write code for the given executable and port. */ - protected void createWriteAccess(IWriteExecutable exec, OutputPort p, - List<IStatementTerm> body, Deployment depl) { - if(exec instanceof BusMasterPortExecutable) { - writeMessageToBus(exec, p, body); - - } else { - Assignment valueAssign = - assignment(exec.getValueWriteAccessor(p, getPortValue(p), depl)); - if(exec instanceof IWriteExecutableWithNoValSupport) { - IExpressionTerm guard = testPortVariableForNoVal(p); - Assignment thenBlock = - assignment(((IWriteExecutableWithNoValSupport)exec) - .getNoValWriteAccessor(p)); - body.add(ifthenelse(guard, sequence(thenBlock), sequence(valueAssign))); - } else { - body.add(valueAssign); - } - } - } - - /** Creates a {@link TInt} Type. */ - private static TInt createTInt() { - return TypesFactory.eINSTANCE.createTInt(); - } - - /** Create read code for the given {@link BusMasterPortExecutable} and analyze message fields. */ - private void readMessageFromBus(IReadExecutable exec, InputPort p, List<IStatementTerm> body) { - Port sourcePort = p.getIncomingChannels().get(0).getSource(); - String noValGuard = " if (msg.has_" + sourcePort.getName().toLowerCase() + " == false) {\n"; - String thenBlock = "noval_" + p.getName() + "_ID_" + p.getId() + " = true;\n}\n"; - String elseBlock = "else { \n noval_" + p.getName() + "_ID_" + p.getId() + " = false;\n"; - String valueAssignRHS = " msg." + sourcePort.getName().toLowerCase(); - String valueAssign = p.getName() + "_ID_" + p.getId() + "=" + valueAssignRHS + "; \n} \n"; - String content = noValGuard + thenBlock + elseBlock + valueAssign; - if(exec instanceof IReadExecutableWithNoValSupport) { - Assignment sampleProto = - assignment(ExpressionModelElementFactory.definedConst(content)); - body.add(sampleProto); - } else { - Assignment sampleProto = - assignment(ExpressionModelElementFactory.definedConst(valueAssign)); - body.add(sampleProto); - } - } - - /** Create write code for the given {@link BusMasterPortExecutable}, update message fields. */ - private void writeMessageToBus(IWriteExecutable exec, OutputPort p, List<IStatementTerm> body) { - String noValGuard = " if (noval_" + p.getName() + "_ID_" + p.getId() + " == true) {\n"; - String thenBlock = "msg.has_" + p.getName().toLowerCase() + "= 0;\n}\n"; - String elseBlock = "else { \n msg.has_" + p.getName().toLowerCase() + " = true;\n"; - String valueAssign = - " msg." + p.getName().toLowerCase() + " = " + p.getName() + "_ID_" + p.getId() + - "; \n} \n"; - String content = noValGuard + thenBlock + elseBlock + valueAssign; - if(exec instanceof IWriteExecutableWithNoValSupport) { - Assignment sampleProto = - assignment(ExpressionModelElementFactory.definedConst(content)); - body.add(sampleProto); - } else { - Assignment sampleProto = - assignment(ExpressionModelElementFactory.definedConst(valueAssign)); - body.add(sampleProto); - } - } - - /** - * Determine whether or not the message has been modified so that call for updated message write - * should be made. - */ - private boolean modifyBusMsg(List<Pair<PlatformConnectorUnit, Port>> deployedPorts) { - boolean writeMsgFlag = false; - for(Pair<PlatformConnectorUnit, Port> prt : deployedPorts) { - ExecutableBase<? extends PlatformConnectorUnit> exec = - getPlatformArchitectureExecutable().getExecutable(prt.getFirst()); - if(exec instanceof BusMasterPortExecutable && prt.getSecond() instanceof OutputPort) { - writeMsgFlag = true; - } - } - return writeMsgFlag; - } - -} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusExecutableTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusExecutableTransformation.java deleted file mode 100644 index a05049ac21d74d52592b7613b4411aa8603bc7a7..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusExecutableTransformation.java +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.generator.transform; - -import org.fortiss.af3.platform.raspberry.generator.executable.BusExecutable; -import org.fortiss.af3.platform.raspberry.model.Bus; -import org.fortiss.tooling.kernel.extension.ITransformationProvider; -import org.fortiss.tooling.kernel.extension.data.ITransformationContext; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class BusExecutableTransformation implements ITransformationProvider { - - /** {@inheritDoc} */ - @Override - public Class<?> getTargetClass() { - return BusExecutable.class; - } - - /** {@inheritDoc} */ - @Override - public boolean - canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { - return Bus.class.isAssignableFrom(sourceClass); - } - - /** {@inheritDoc} */ - @Override - public boolean canTransform(Object source, ITransformationContext context) { - return source instanceof Bus; - } - - /** {@inheritDoc} */ - @Override - public Object transform(Object source, ITransformationContext context) { - return new BusExecutable((Bus)source); - } - -} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusTransmissionCatalogTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusTransmissionCatalogTransformation.java deleted file mode 100644 index fa9a981fcf47b9fa1c11fc4e8f68560c45e2df9d..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/BusTransmissionCatalogTransformation.java +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.generator.transform; - -import org.fortiss.af3.deployment.generator.TransmissionCatalog; -import org.fortiss.af3.platform.raspberry.model.Bus; -import org.fortiss.tooling.kernel.extension.ITransformationProvider; -import org.fortiss.tooling.kernel.extension.data.ITransformationContext; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class BusTransmissionCatalogTransformation implements ITransformationProvider { - - /** {@inheritDoc} */ - @Override - public Class<?> getTargetClass() { - return TransmissionCatalog.class; - } - - /** {@inheritDoc} */ - @Override - public boolean - canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { - return Bus.class.isAssignableFrom(sourceClass); - } - - /** {@inheritDoc} */ - @Override - public boolean canTransform(Object source, ITransformationContext context) { - return source instanceof Bus; - } - - /** {@inheritDoc} */ - @Override - public Object transform(Object source, ITransformationContext context) { - return new TransmissionCatalog(); - } - -} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CoreExecutableTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CoreExecutableTransformation.java deleted file mode 100644 index d74be532ef7b1b113ab0a703e995b2b8c3589cee..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CoreExecutableTransformation.java +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------------------------------------------------+ -$Id$ -| | -| Copyright 2016 ForTISS GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.platform.raspberry.generator.transform; - -import org.fortiss.af3.platform.raspberry.generator.executable.CoreExecutable; -import org.fortiss.af3.platform.raspberry.model.Core; -import org.fortiss.tooling.kernel.extension.ITransformationProvider; -import org.fortiss.tooling.kernel.extension.data.ITransformationContext; - -/** - * - * @author chaudhary - * @author $Author$ - * @version $Rev$ - * @ConQAT.Rating RED Hash: - */ -public class CoreExecutableTransformation implements ITransformationProvider { - - /** {@inheritDoc} */ - @Override - public Class<?> getTargetClass() { - return CoreExecutable.class; - } - - /** {@inheritDoc} */ - @Override - public boolean - canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { - return Core.class.isAssignableFrom(sourceClass); - } - - /** {@inheritDoc} */ - @Override - public boolean canTransform(Object source, ITransformationContext context) { - return source instanceof Core; - } - - /** {@inheritDoc} */ - @Override - public Object transform(Object source, ITransformationContext context) { - return new CoreExecutable((Core)source); - } - -} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/utils/RaspberryModelElementFactory.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/utils/RaspberryModelElementFactory.java index 35eb2429152203a6e2cec65be87404d4d0d60de8..6cbf4c7954f4bcd6ce26743f5e7ac8590cb17353 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/utils/RaspberryModelElementFactory.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/utils/RaspberryModelElementFactory.java @@ -19,13 +19,11 @@ package org.fortiss.af3.platform.raspberry.utils; import org.fortiss.af3.platform.raspberry.model.Actuator; import org.fortiss.af3.platform.raspberry.model.ActuatorOut; -import org.fortiss.af3.platform.raspberry.model.Bus; import org.fortiss.af3.platform.raspberry.model.BusMasterInterface; import org.fortiss.af3.platform.raspberry.model.BusMasterPort; import org.fortiss.af3.platform.raspberry.model.CANBus; import org.fortiss.af3.platform.raspberry.model.CANBusMasterInterface; import org.fortiss.af3.platform.raspberry.model.CANBusMasterPort; -import org.fortiss.af3.platform.raspberry.model.Core; import org.fortiss.af3.platform.raspberry.model.ModelFactory; import org.fortiss.af3.platform.raspberry.model.RaspberryPi3; import org.fortiss.af3.platform.raspberry.model.Sensor; @@ -78,22 +76,6 @@ public class RaspberryModelElementFactory { return raspberryPi3; } - /** Creates a Core with a given name. */ - public static Core createCore(String name) { - Core core = ModelFactory.eINSTANCE.createCore(); - core.setName(name); - LayoutModelElementFactory.createNodeElementLayout(core); - return core; - } - - /** Creates a Bus with a given name. */ - public static Bus createBus(String name) { - Bus bus = ModelFactory.eINSTANCE.createBus(); - bus.setName(name); - LayoutModelElementFactory.createConnectionLayout(bus); - return bus; - } - /** Creates a Bus with a given name. */ public static CANBus createCANBus(String name) { CANBus canBus = ModelFactory.eINSTANCE.createCANBus();