diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototype/ProtoypeProvider.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototype/ProtoypeProvider.java index e5c9620064e8085a9ebafb6993215126dbad8eca..2bb00181005efca9622dda461d9d505258d91dec 100644 --- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototype/ProtoypeProvider.java +++ b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/prototype/ProtoypeProvider.java @@ -24,12 +24,10 @@ import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodeBounds; import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodePosition; import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createRectangle; -import org.fortiss.af3.platform.raspberry.model.ActuatorConnector; import org.fortiss.af3.platform.raspberry.model.ActuatorPWM; import org.fortiss.af3.platform.raspberry.model.CanBus; import org.fortiss.af3.platform.raspberry.model.CanConnector; import org.fortiss.af3.platform.raspberry.model.RaspberryPi; -import org.fortiss.af3.platform.raspberry.model.SensorConnector; import org.fortiss.af3.platform.raspberry.model.SensorIMU; import org.fortiss.af3.platform.raspberry.model.SensorLaserRangeFinder; import org.fortiss.af3.platform.raspberry.model.SensorLaserScanner; @@ -64,10 +62,10 @@ public class ProtoypeProvider extends PrototypeProviderBase { setConnectorPosition(con, 0, 0); registerPrototype("CanConnector", con, CATEGORY_NAME); - SensorConnector sensor = RaspberryModelElementFactory.createSensorConnector(); - setNodePosition(sensor, 0, 0); - setConnectorPosition(sensor, 0, 0); - registerPrototype("GenericPI_Sensor", sensor, CATEGORY_NAME); + // SensorConnector sensor = RaspberryModelElementFactory.createSensorConnector(); + // setNodePosition(sensor, 0, 0); + // setConnectorPosition(sensor, 0, 0); + // registerPrototype("GenericPI_Sensor", sensor, CATEGORY_NAME); SensorIMU imu = RaspberryModelElementFactory.createSensorIMU(); setNodePosition(imu, 0, 0); @@ -84,10 +82,10 @@ public class ProtoypeProvider extends PrototypeProviderBase { setConnectorPosition(sls, 0, 0); registerPrototype("LaserScanner_Sensor", sls, CATEGORY_NAME); - ActuatorConnector actuator = RaspberryModelElementFactory.createActuatorConnector(); - setNodePosition(actuator, 0, 0); - setConnectorPosition(actuator, 0, 0); - registerPrototype("GenericPI_Actuator", actuator, CATEGORY_NAME); + // ActuatorConnector actuator = RaspberryModelElementFactory.createActuatorConnector(); + // setNodePosition(actuator, 0, 0); + // setConnectorPosition(actuator, 0, 0); + // registerPrototype("GenericPI_Actuator", actuator, CATEGORY_NAME); ActuatorPWM pwm = RaspberryModelElementFactory.createActuatorPWM(); setNodePosition(pwm, 0, 0); diff --git a/org.fortiss.af3.platform.raspberry/trunk/plugin.xml b/org.fortiss.af3.platform.raspberry/trunk/plugin.xml index a40d19b0d9357b3175372e124a96ccb96dbf407e..fff2d6b3ec1492065af27024a10f2bbcce030fa8 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/plugin.xml +++ b/org.fortiss.af3.platform.raspberry/trunk/plugin.xml @@ -76,6 +76,84 @@ </objectClass> </target> </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.CanConnectorTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.CanConnector"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.CanConnectorExecutable"> + </objectClass> + </target> + </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.IMUSensorTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.SensorIMU"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.IMUSensorExecutable"> + </objectClass> + </target> + </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.LaserRangeFinderSensorTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.SensorLaserRangeFinder"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.LaserRangeFinderSensorExecutable"> + </objectClass> + </target> + </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.LaserScannerSensorTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.SensorLaserScanner"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.LaserScannerSensorExecutable"> + </objectClass> + </target> + </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.PWMActuatorTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.ActuatorPWM"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.PWMActuatorExecutable"> + </objectClass> + </target> + </transformationProvider> + <transformationProvider + transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.CanBusTransformation"> + <source> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.model.CanBus"> + </objectClass> + </source> + <target> + <objectClass + objectClass="org.fortiss.af3.platform.raspberry.generator.executable.CanBusExecutable"> + </objectClass> + </target> + </transformationProvider> </extension> diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/compose/RaspberryPiCompositor.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/compose/RaspberryPiCompositor.java index fd5561a640cee977e58c8217ea58342865074108..a2e54f453d65b1751437221190ae7f775554ca93 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/compose/RaspberryPiCompositor.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/compose/RaspberryPiCompositor.java @@ -28,6 +28,7 @@ import org.fortiss.af3.platform.raspberry.model.CanConnector; import org.fortiss.af3.platform.raspberry.model.RaspberryPi; import org.fortiss.af3.platform.raspberry.model.SensorConnector; import org.fortiss.af3.platform.raspberry.model.SensorGamepad; +import org.fortiss.af3.platform.raspberry.model.SensorIMU; import org.fortiss.af3.platform.raspberry.model.SensorLaserRangeFinder; import org.fortiss.af3.platform.raspberry.model.SensorLaserScanner; @@ -48,7 +49,7 @@ public class RaspberryPiCompositor extends final boolean instanceOfAny2 = isInstanceOfAny(contained, CanConnector.class, SensorConnector.class, ActuatorConnector.class, ActuatorPWM.class, SensorLaserRangeFinder.class, - SensorGamepad.class, SensorLaserScanner.class); + SensorGamepad.class, SensorLaserScanner.class, SensorIMU.class); if(container != null) { final boolean instanceOfAny = isInstanceOfAny(container, RaspberryPi.class); return instanceOfAny && instanceOfAny2; 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 new file mode 100644 index 0000000000000000000000000000000000000000..d8f0d797b46490610742ddda93ce001773d0952c --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CanBusExecutable.java @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 java.util.List; +import java.util.Map; + +import org.fortiss.af3.component.model.Component; +import org.fortiss.af3.component.model.Port; +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.raspberry.model.CanBus; + +/** + * Executable for {@link CanBus}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class CanBusExecutable extends TransmissionUnitExecutableBase<TransmissionUnit> { + + /** Constructor. */ + public CanBusExecutable(TransmissionUnit modelElement) { + super(modelElement); + // no functionality as of now + } + + /** {@inheritDoc} */ + @Override + public void createAllFiles(SourcePackage pack, Map<ExecutionUnit, List<Port>> euPortsPair, + Map<ExecutionUnit, List<Component>> euComponentList, Component topComponent, + int deploymentID) { + // no functionality as of now + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CanConnectorExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CanConnectorExecutable.java new file mode 100644 index 0000000000000000000000000000000000000000..d6fcdcf6d622b4970cc71e72b29bdd51e93b4d5f --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/CanConnectorExecutable.java @@ -0,0 +1,77 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 org.fortiss.af3.component.model.InputPort; +import org.fortiss.af3.component.model.OutputPort; +import org.fortiss.af3.expression.model.terms.IExpressionTerm; +import org.fortiss.af3.platform.generic.generator.executable.GenericTransceiverExecutable; +import org.fortiss.af3.platform.model.generic.GenericTransceiver; +import org.fortiss.af3.platform.raspberry.model.CanConnector; + +/** + * Executable for {@link CanConnector}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class CanConnectorExecutable extends GenericTransceiverExecutable { + + /** Constructor. */ + public CanConnectorExecutable(GenericTransceiver modelElement) { + super(modelElement); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getInitialization() { + return super.getInitialization(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValGuardAccessor(InputPort logicalSignal) { + return super.getNoValGuardAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValWriteAccessor(OutputPort logicalSignal) { + return super.getNoValWriteAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getTermination() { + return super.getTermination(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { + return super.getValueReadAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) { + return super.getValueWriteAccessor(logicalSignal, value); + } +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/IMUSensorExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/IMUSensorExecutable.java new file mode 100644 index 0000000000000000000000000000000000000000..bec3e38f8def54624677b3424b3edb232f165cdb --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/IMUSensorExecutable.java @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 org.fortiss.af3.component.model.InputPort; +import org.fortiss.af3.expression.model.terms.IExpressionTerm; +import org.fortiss.af3.platform.generic.generator.executable.GenericReceiverExecutable; +import org.fortiss.af3.platform.model.generic.GenericReceiver; +import org.fortiss.af3.platform.raspberry.model.SensorIMU; + +/** + * Executable for {@link SensorIMU}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class IMUSensorExecutable extends GenericReceiverExecutable { + + /** Constructor. */ + public IMUSensorExecutable(GenericReceiver modelElement) { + super(modelElement); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getInitialization() { + return super.getInitialization(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValGuardAccessor(InputPort logicalSignal) { + return super.getNoValGuardAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getTermination() { + return super.getTermination(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { + return super.getValueReadAccessor(logicalSignal); + } +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserRangeFinderSensorExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserRangeFinderSensorExecutable.java new file mode 100644 index 0000000000000000000000000000000000000000..5e71557e9f7a4edf6111fed601bba62456a5ad36 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserRangeFinderSensorExecutable.java @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 org.fortiss.af3.component.model.InputPort; +import org.fortiss.af3.expression.model.terms.IExpressionTerm; +import org.fortiss.af3.platform.generic.generator.executable.GenericReceiverExecutable; +import org.fortiss.af3.platform.model.generic.GenericReceiver; +import org.fortiss.af3.platform.raspberry.model.SensorLaserRangeFinder; + +/** + * Executable for {@link SensorLaserRangeFinder}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class LaserRangeFinderSensorExecutable extends GenericReceiverExecutable { + + /** Constructor. */ + public LaserRangeFinderSensorExecutable(GenericReceiver modelElement) { + super(modelElement); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getInitialization() { + return super.getInitialization(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValGuardAccessor(InputPort logicalSignal) { + return super.getNoValGuardAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getTermination() { + return super.getTermination(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { + return super.getValueReadAccessor(logicalSignal); + } +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserScannerSensorExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserScannerSensorExecutable.java new file mode 100644 index 0000000000000000000000000000000000000000..5c64931b9e705d2d14f01895862a5f53b09e7f63 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/LaserScannerSensorExecutable.java @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 org.fortiss.af3.component.model.InputPort; +import org.fortiss.af3.expression.model.terms.IExpressionTerm; +import org.fortiss.af3.platform.generic.generator.executable.GenericReceiverExecutable; +import org.fortiss.af3.platform.model.generic.GenericReceiver; +import org.fortiss.af3.platform.raspberry.model.SensorLaserScanner; + +/** + * Executable for {@link SensorLaserScanner}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class LaserScannerSensorExecutable extends GenericReceiverExecutable { + + /** Constructor. */ + public LaserScannerSensorExecutable(GenericReceiver modelElement) { + super(modelElement); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getInitialization() { + return super.getInitialization(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValGuardAccessor(InputPort logicalSignal) { + return super.getNoValGuardAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getTermination() { + return super.getTermination(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { + return super.getValueReadAccessor(logicalSignal); + } +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/PWMActuatorExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/PWMActuatorExecutable.java new file mode 100644 index 0000000000000000000000000000000000000000..c442eb2e996b86140a0534a4bcc75b33e9ccf1de --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/PWMActuatorExecutable.java @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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 org.fortiss.af3.component.model.OutputPort; +import org.fortiss.af3.expression.model.terms.IExpressionTerm; +import org.fortiss.af3.platform.generic.generator.executable.GenericTransmitterExecutable; +import org.fortiss.af3.platform.model.generic.GenericTransmitter; +import org.fortiss.af3.platform.raspberry.model.ActuatorPWM; + +/** + * Executable for {@link ActuatorPWM}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class PWMActuatorExecutable extends GenericTransmitterExecutable { + + /** Constructor. */ + public PWMActuatorExecutable(GenericTransmitter modelElement) { + super(modelElement); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getInitialization() { + return super.getInitialization(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getNoValWriteAccessor(OutputPort logicalSignal) { + return super.getNoValWriteAccessor(logicalSignal); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getTermination() { + return super.getTermination(); + } + + /** {@inheritDoc} */ + @Override + public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) { + return super.getValueWriteAccessor(logicalSignal, value); + } +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/RaspberryPIExecutable.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/RaspberryPIExecutable.java index b653f55f094c4b3a3f13de52f524a85f08f7ad1c..7bcf55ce29d2e08902b9dc8b58f78a1e730f8828 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/RaspberryPIExecutable.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/executable/RaspberryPIExecutable.java @@ -33,17 +33,22 @@ import org.fortiss.af3.expression.model.terms.IExpressionTerm; import org.fortiss.af3.expression.model.terms.imperative.IStatementTerm; import org.fortiss.af3.generator.common.model.c.CSourcePackage; import org.fortiss.af3.platform.generic.generator.executable.GenericExecutionUnitExecutable; +import org.fortiss.af3.platform.language.executable.IInitializableExecutable; import org.fortiss.af3.platform.language.executable.IReadableExecutable; +import org.fortiss.af3.platform.language.executable.ITerminatableExecutable; import org.fortiss.af3.platform.language.executable.IWritableExecutable; import org.fortiss.af3.platform.model.ExecutionUnit; import org.fortiss.af3.platform.model.PlatformConnectorUnit; import org.fortiss.af3.platform.model.generic.GenericTransceiver; +import org.fortiss.af3.platform.raspberry.model.RaspberryPi; import org.fortiss.tooling.kernel.extension.data.ITransformationContext; /** + * {@link IInitializableExecutable} and {@link ITerminatableExecutable} for the {@link RaspberryPi} + * platform. * * @author eder - * @author $Author: hoelzl $ + * @author $Author: eder $ * @version $Rev: 18709 $ * @ConQAT.Rating RED Hash: */ diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanBusTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanBusTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..e486ff8a22439e51c5fe37fcc78c403cd5d119cf --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanBusTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.CanBusExecutable; +import org.fortiss.af3.platform.raspberry.model.CanBus; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link CanBus}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class CanBusTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return CanBusExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return CanBus.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof CanBus; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new CanBusExecutable((CanBus)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanConnectorTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanConnectorTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..c13843496c2884f2bdde186b05a8a072f70e8ae5 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/CanConnectorTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.CanConnectorExecutable; +import org.fortiss.af3.platform.raspberry.model.CanConnector; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link CanConnector}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class CanConnectorTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return CanConnectorExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return CanConnector.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof CanConnector; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new CanConnectorExecutable((CanConnector)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/IMUSensorTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/IMUSensorTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..6648dc620e5c317592d3429bd5417f3e1df4d801 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/IMUSensorTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.IMUSensorExecutable; +import org.fortiss.af3.platform.raspberry.model.SensorIMU; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link SensorIMU}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class IMUSensorTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return IMUSensorExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return SensorIMU.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof SensorIMU; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new IMUSensorExecutable((SensorIMU)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserRangeFinderSensorTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserRangeFinderSensorTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..68e2a36423d291c62f6048f0afcc3b8ae6353c48 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserRangeFinderSensorTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.LaserRangeFinderSensorExecutable; +import org.fortiss.af3.platform.raspberry.model.SensorLaserRangeFinder; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link SensorLaserRangeFinder}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class LaserRangeFinderSensorTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return LaserRangeFinderSensorExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return SensorLaserRangeFinder.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof SensorLaserRangeFinder; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new LaserRangeFinderSensorExecutable((SensorLaserRangeFinder)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserScannerSensorTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserScannerSensorTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..e5c80421e47d0e63ef4e8fb14426ad47d7c9de7b --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/LaserScannerSensorTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.LaserScannerSensorExecutable; +import org.fortiss.af3.platform.raspberry.model.SensorLaserScanner; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link SensorLaserScanner}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class LaserScannerSensorTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return LaserScannerSensorExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return SensorLaserScanner.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof SensorLaserScanner; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new LaserScannerSensorExecutable((SensorLaserScanner)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/PWMActuatorTransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/PWMActuatorTransformation.java new file mode 100644 index 0000000000000000000000000000000000000000..3edc3262a9f9a98f33dcedd1982095bf06df01f8 --- /dev/null +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/PWMActuatorTransformation.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2017 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.PWMActuatorExecutable; +import org.fortiss.af3.platform.raspberry.model.ActuatorPWM; +import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; + +/** + * Transformation for {@link ActuatorPWM}. + * + * @author eder + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating RED Hash: + */ +public class PWMActuatorTransformation implements ITransformationProvider { + + /** {@inheritDoc} */ + @Override + public Class<?> getTargetClass() { + return PWMActuatorExecutable.class; + } + + /** {@inheritDoc} */ + @Override + public boolean + canHandleChainTransformation(Class<?> sourceClass, ITransformationContext context) { + return ActuatorPWM.class.isAssignableFrom(sourceClass); + } + + /** {@inheritDoc} */ + @Override + public boolean canTransform(Object source, ITransformationContext context) { + return source instanceof ActuatorPWM; + } + + /** {@inheritDoc} */ + @Override + public Object transform(Object source, ITransformationContext context) { + return new PWMActuatorExecutable((ActuatorPWM)source); + } + +} diff --git a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/RaspberryPITransformation.java b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/RaspberryPITransformation.java index eb320f64324e86d9bdda2d867751d1981fe51b62..dabce8392532fc04a899859b34ba514d26a04673 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/RaspberryPITransformation.java +++ b/org.fortiss.af3.platform.raspberry/trunk/src/org/fortiss/af3/platform/raspberry/generator/transform/RaspberryPITransformation.java @@ -23,9 +23,10 @@ import org.fortiss.tooling.kernel.extension.ITransformationProvider; import org.fortiss.tooling.kernel.extension.data.ITransformationContext; /** + * Transformation from {@link RaspberryPi} to {@link RaspberryPIExecutable}. * * @author eder - * @author $Author: hoelzl $ + * @author $Author: eder $ * @version $Rev: 18709 $ * @ConQAT.Rating RED Hash: */