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

channel annotation for pwm actuator

parent cb838e70
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,12 @@ Bundle-Vendor: fortiss GmbH
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.fortiss.af3.platform.raspberry.model,
org.fortiss.af3.platform.raspberry.model.annotation,
org.fortiss.af3.platform.raspberry.model.annotation.impl,
org.fortiss.af3.platform.raspberry.model.annotation.util,
org.fortiss.af3.platform.raspberry.model.gamepad,
org.fortiss.af3.platform.raspberry.model.gamepad.impl,
org.fortiss.af3.platform.raspberry.model.gamepad.util,
org.fortiss.af3.platform.raspberry.model.impl,
org.fortiss.af3.platform.raspberry.model.util,
org.fortiss.af3.platform.raspberry.util
......
......@@ -29,4 +29,10 @@
<eClassifiers xsi:type="ecore:EClass" name="Right_StickX_Position" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//generic/GenericReceiver"/>
<eClassifiers xsi:type="ecore:EClass" name="Right_StickY_Position" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//generic/GenericReceiver"/>
</eSubpackages>
<eSubpackages name="annotation" nsURI="http://www.fortiss.org/af3/platform/raspberry/annotation"
nsPrefix="org-fortiss-af3-platform-raspberry-annotation">
<eClassifiers xsi:type="ecore:EClass" name="Channel" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IAnnotatedSpecification platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHiddenSpecification">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="channel" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
modelDirectory="/org.fortiss.af3.platform.raspberry/generated-src"
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.fortiss.af3.platform.raspberry/generated-src"
modelPluginID="org.fortiss.af3.platform.raspberry" modelName="Raspberry" importerID="org.eclipse.emf.importer.ecore"
containmentProxies="true" arrayAccessors="true" complianceLevel="7.0" copyrightFields="false"
usedGenPackages="platform:/resource/org.fortiss.tooling.base/model/base.genmodel#//model platform:/resource/org.fortiss.af3.platform/model/platform.genmodel#//model platform:/resource/org.fortiss.tooling.kernel/model/kernel.genmodel#//model">
......@@ -34,5 +34,11 @@
<genClasses ecoreClass="raspberry.ecore#//gamepad/Right_StickX_Position"/>
<genClasses ecoreClass="raspberry.ecore#//gamepad/Right_StickY_Position"/>
</nestedGenPackages>
<nestedGenPackages prefix="Annotation" basePackage="org.fortiss.af3.platform.raspberry.model"
disposableProviderFactory="true" ecorePackage="raspberry.ecore#//annotation">
<genClasses ecoreClass="raspberry.ecore#//annotation/Channel">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute raspberry.ecore#//annotation/Channel/channel"/>
</genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
......@@ -17,6 +17,22 @@
class="org.fortiss.af3.platform.raspberry.model.ModelPackage"
genModel="model/raspberry.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated raspberry -->
<package
uri="http://www.fortiss.org/af3/platform/raspberry/gamepad"
class="org.fortiss.af3.platform.raspberry.model.gamepad.GamepadPackage"
genModel="model/raspberry.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated raspberry -->
<package
uri="http://www.fortiss.org/af3/platform/raspberry/annotation"
class="org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage"
genModel="model/raspberry.genmodel"/>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
......@@ -390,6 +406,12 @@
modelElementClass="org.fortiss.af3.platform.raspberry.model.GPO">
</modelElementClass>
</annotation>
<annotation
binding="org.fortiss.af3.platform.raspberry.annotation.PWMChannelNumberValueProvider">
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.ActuatorPWM">
</modelElementClass>
</annotation>
</extension>
......
/*--------------------------------------------------------------------------+
$Id: GPIOPinNumberValueProvider.java 15846 2016-02-02 09:14:08Z zverlov $
| |
| Copyright 2015 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.annotation;
import org.fortiss.af3.platform.model.Transceiver;
import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage;
import org.fortiss.af3.platform.raspberry.model.annotation.Channel;
import org.fortiss.tooling.base.annotation.valueprovider.EStructuralFeatureValueProviderBase;
import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvider;
/**
* {@link IAnnotationValueProvider} that allows to annotate a Pin Number of a GPIO
* {@link Transceiver} used in PikeOS Platform.
*
* @author chaudhary
* @author $Author: zverlov $
* @version $Rev: 15846 $
* @ConQAT.Rating GREEN Hash: C69EECC82FF9912335C19FC6A5CD6996
*/
public class PWMChannelNumberValueProvider extends EStructuralFeatureValueProviderBase<Channel> {
/** Constructor. */
public PWMChannelNumberValueProvider() {
super(AnnotationPackage.Literals.CHANNEL, AnnotationPackage.Literals.CHANNEL__CHANNEL);
}
/** {@inheritDoc} */
@Override
public String getAnnotationName(Channel specification) {
return "PWM Channel";
}
}
......@@ -20,8 +20,11 @@ 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.GenericReceiver;
import org.fortiss.af3.platform.model.generic.GenericTransmitter;
import org.fortiss.af3.platform.raspberry.model.ActuatorPWM;
import org.fortiss.af3.platform.raspberry.model.annotation.Channel;
import org.fortiss.tooling.base.utils.AnnotationUtils;
/**
* Executable for {@link ActuatorPWM}.
......@@ -61,4 +64,8 @@ public class PWMActuatorExecutable extends GenericTransmitterExecutable {
public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) {
return super.getValueWriteAccessor(logicalSignal, value);
}
private int getPWMChannelFromModelElement(GenericReceiver modelElement) {
return AnnotationUtils.getAnnotation(modelElement, Channel.class).getChannel();
}
}
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