Skip to content
Snippets Groups Projects
Commit 2b90054b authored by Johannes Eder's avatar Johannes Eder
Browse files

Raspberry code generation stubs

parent 602e613b
No related branches found
No related tags found
No related merge requests found
Showing
with 844 additions and 13 deletions
......@@ -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);
......
......@@ -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>
......
......@@ -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;
......
/*--------------------------------------------------------------------------+
$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
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
......@@ -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:
*/
......
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
/*--------------------------------------------------------------------------+
$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);
}
}
......@@ -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:
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment