Skip to content
Snippets Groups Projects
Commit 24cf7be1 authored by Sergey Zverlov's avatar Sergey Zverlov
Browse files

refs 1337
parent 549d0629
No related branches found
No related tags found
No related merge requests found
Showing
with 172 additions and 5 deletions
...@@ -32,4 +32,13 @@ ...@@ -32,4 +32,13 @@
<eClassifiers xsi:type="ecore:EClass" name="BusMasterPort" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IIpCorePlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IProcessorDomain"/> <eClassifiers xsi:type="ecore:EClass" name="BusMasterPort" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IIpCorePlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IProcessorDomain"/>
<eClassifiers xsi:type="ecore:EClass" name="CANBusMasterPort" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain"/> <eClassifiers xsi:type="ecore:EClass" name="CANBusMasterPort" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformPort platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain"/>
<eClassifiers xsi:type="ecore:EClass" name="CANBusMasterInterface" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformInterface platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain"/> <eClassifiers xsi:type="ecore:EClass" name="CANBusMasterInterface" eSuperTypes="platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//Transceiver platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IBoardPlatformArchitectureElement platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//IPlatformInterface platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//ICommunicationMaster #//IBoardDomain"/>
<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="CoreAddress" 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="coreAddress" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PinNumber" 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="pinNumber" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
</eSubpackages>
</ecore:EPackage> </ecore:EPackage>
<?xml version="1.0" encoding="UTF-8"?> <?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" <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
modelDirectory="/org.fortiss.af3.platform.raspberry/generated-src" 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" modelPluginID="org.fortiss.af3.platform.raspberry" modelName="Raspberry" importerID="org.eclipse.emf.importer.ecore"
containmentProxies="true" arrayAccessors="true" complianceLevel="7.0" copyrightFields="false" 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"> 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">
...@@ -27,5 +27,14 @@ ...@@ -27,5 +27,14 @@
<genClasses ecoreClass="raspberry.ecore#//BusMasterPort"/> <genClasses ecoreClass="raspberry.ecore#//BusMasterPort"/>
<genClasses ecoreClass="raspberry.ecore#//CANBusMasterPort"/> <genClasses ecoreClass="raspberry.ecore#//CANBusMasterPort"/>
<genClasses ecoreClass="raspberry.ecore#//CANBusMasterInterface"/> <genClasses ecoreClass="raspberry.ecore#//CANBusMasterInterface"/>
<nestedGenPackages prefix="Annotation" basePackage="org.fortiss.af3.platform.raspberry.model"
disposableProviderFactory="true" ecorePackage="raspberry.ecore#//annotation">
<genClasses ecoreClass="raspberry.ecore#//annotation/CoreAddress">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute raspberry.ecore#//annotation/CoreAddress/coreAddress"/>
</genClasses>
<genClasses ecoreClass="raspberry.ecore#//annotation/PinNumber">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute raspberry.ecore#//annotation/PinNumber/pinNumber"/>
</genClasses>
</nestedGenPackages>
</genPackages> </genPackages>
</genmodel:GenModel> </genmodel:GenModel>
...@@ -332,5 +332,29 @@ ...@@ -332,5 +332,29 @@
</target> </target>
</transformationProvider> </transformationProvider>
</extension> </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
modelElementClass="org.fortiss.af3.platform.raspberry.model.Sensor">
</modelElementClass>
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.Actuator">
</modelElementClass>
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.SensorIn">
</modelElementClass>
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.ActuatorOut">
</modelElementClass>
</annotation>
</extension>
</plugin> </plugin>
/*--------------------------------------------------------------------------+
$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.annotation.valueprovider;
import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage;
import org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress;
import org.fortiss.tooling.base.annotation.valueprovider.EStructuralFeatureValueProviderBase;
/**
*
* @author zverlov
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class CoreAddressValueProvider extends EStructuralFeatureValueProviderBase<CoreAddress> {
/**
* @param annotatedSpecificationEClass
*/
public CoreAddressValueProvider() {
super(AnnotationPackage.Literals.CORE_ADDRESS,
AnnotationPackage.Literals.CORE_ADDRESS__CORE_ADDRESS);
// TODO Auto-generated constructor stub
}
/** {@inheritDoc} */
@Override
public String getAnnotationName(CoreAddress specification) {
// TODO Auto-generated method stub
return "Core Address";
}
}
/*--------------------------------------------------------------------------+
$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.annotation.valueprovider;
import org.fortiss.af3.platform.raspberry.model.annotation.AnnotationPackage;
import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber;
import org.fortiss.tooling.base.annotation.valueprovider.EStructuralFeatureValueProviderBase;
/**
*
* @author zverlov
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class PinNumberValueProvider extends EStructuralFeatureValueProviderBase<PinNumber> {
/**
* @param annotatedSpecificationEClass
*/
public PinNumberValueProvider() {
super(AnnotationPackage.Literals.PIN_NUMBER,
AnnotationPackage.Literals.PIN_NUMBER__PIN_NUMBER);
}
/** {@inheritDoc} */
@Override
public String getAnnotationName(PinNumber specification) {
return "Pin Number";
}
}
...@@ -18,14 +18,17 @@ $Id$ ...@@ -18,14 +18,17 @@ $Id$
package org.fortiss.af3.platform.raspberry.generator.executable; package org.fortiss.af3.platform.raspberry.generator.executable;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall;
import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation;
import org.fortiss.af3.component.model.OutputPort; import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.expression.model.terms.IExpressionTerm; import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.utils.ExpressionModelElementFactory;
import org.fortiss.af3.platform.language.executable.IInitializableExecutable; import org.fortiss.af3.platform.language.executable.IInitializableExecutable;
import org.fortiss.af3.platform.language.executable.ITerminatableExecutable; import org.fortiss.af3.platform.language.executable.ITerminatableExecutable;
import org.fortiss.af3.platform.language.executable.IWritableExecutableWithNoValSupport; import org.fortiss.af3.platform.language.executable.IWritableExecutableWithNoValSupport;
import org.fortiss.af3.platform.language.executable.TransmitterExecutableBase; import org.fortiss.af3.platform.language.executable.TransmitterExecutableBase;
import org.fortiss.af3.platform.raspberry.model.ActuatorOut; import org.fortiss.af3.platform.raspberry.model.ActuatorOut;
import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber;
/** /**
* *
...@@ -60,7 +63,11 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut ...@@ -60,7 +63,11 @@ public class ActuatorOutExecutable extends TransmitterExecutableBase<ActuatorOut
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) { public IExpressionTerm getValueWriteAccessor(OutputPort logicalSignal, IExpressionTerm value) {
return funcCall("write_" + modelElement.getName(), value); PinNumber ias = getAnnotation(modelElement, PinNumber.class);
int pinNr = ias.getPinNumber();
return funcCall("write_" + modelElement.getName(),
ExpressionModelElementFactory.createVar(pinNr + ""));
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
......
...@@ -22,12 +22,14 @@ import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.fun ...@@ -22,12 +22,14 @@ import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.fun
import org.fortiss.af3.component.model.InputPort; import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort; import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.expression.model.terms.IExpressionTerm; import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.utils.ExpressionModelElementFactory;
import org.fortiss.af3.platform.language.executable.IInitializableExecutable; import org.fortiss.af3.platform.language.executable.IInitializableExecutable;
import org.fortiss.af3.platform.language.executable.IReadableExecutableWithNoValSupport; import org.fortiss.af3.platform.language.executable.IReadableExecutableWithNoValSupport;
import org.fortiss.af3.platform.language.executable.ITerminatableExecutable; import org.fortiss.af3.platform.language.executable.ITerminatableExecutable;
import org.fortiss.af3.platform.language.executable.IWritableExecutableWithNoValSupport; import org.fortiss.af3.platform.language.executable.IWritableExecutableWithNoValSupport;
import org.fortiss.af3.platform.language.executable.TransceiverExecutableBase; import org.fortiss.af3.platform.language.executable.TransceiverExecutableBase;
import org.fortiss.af3.platform.raspberry.model.BusMasterPort; import org.fortiss.af3.platform.raspberry.model.BusMasterPort;
import org.fortiss.af3.platform.raspberry.model.annotation.CoreAddress;
/** /**
* *
...@@ -69,7 +71,15 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster ...@@ -69,7 +71,15 @@ public class BusMasterPortExecutable extends TransceiverExecutableBase<BusMaster
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) {
return funcCall("read_" + modelElement.getName() + "_" + logicalSignal.getName()); CoreAddress ias =
org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation(
modelElement.getPlatformElement(), CoreAddress.class);
int coreAddress = ias.getCoreAddress();
// return funcCall("read_" + modelElement.getName() + "_" + logicalSignal.getName());
return funcCall("read_" + modelElement.getName(),
ExpressionModelElementFactory.createVar(coreAddress + ""));
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
......
...@@ -18,14 +18,17 @@ $Id$ ...@@ -18,14 +18,17 @@ $Id$
package org.fortiss.af3.platform.raspberry.generator.executable; package org.fortiss.af3.platform.raspberry.generator.executable;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall; import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.funcCall;
import static org.fortiss.tooling.base.utils.AnnotationUtils.getAnnotation;
import org.fortiss.af3.component.model.InputPort; import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.expression.model.terms.IExpressionTerm; import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.utils.ExpressionModelElementFactory;
import org.fortiss.af3.platform.language.executable.IInitializableExecutable; import org.fortiss.af3.platform.language.executable.IInitializableExecutable;
import org.fortiss.af3.platform.language.executable.IReadableExecutableWithNoValSupport; import org.fortiss.af3.platform.language.executable.IReadableExecutableWithNoValSupport;
import org.fortiss.af3.platform.language.executable.ITerminatableExecutable; import org.fortiss.af3.platform.language.executable.ITerminatableExecutable;
import org.fortiss.af3.platform.language.executable.ReceiverExecutableBase; import org.fortiss.af3.platform.language.executable.ReceiverExecutableBase;
import org.fortiss.af3.platform.raspberry.model.SensorIn; import org.fortiss.af3.platform.raspberry.model.SensorIn;
import org.fortiss.af3.platform.raspberry.model.annotation.PinNumber;
/** /**
* *
...@@ -45,6 +48,11 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme ...@@ -45,6 +48,11 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
// @Override
// public IExpressionTerm getValueReadAccessor(IExpressionTerm signal, IExpressionTerm buffer) {
// return funcCall("read_gpio", signal, buffer);
// }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public IExpressionTerm getInitialization() { public IExpressionTerm getInitialization() {
...@@ -60,7 +68,11 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme ...@@ -60,7 +68,11 @@ public class SensorInExecutable extends ReceiverExecutableBase<SensorIn> impleme
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) { public IExpressionTerm getValueReadAccessor(InputPort logicalSignal) {
return funcCall("read_" + modelElement.getName()); PinNumber ias = getAnnotation(modelElement, PinNumber.class);
int pinNr = ias.getPinNumber();
return funcCall("read_" + modelElement.getName(),
ExpressionModelElementFactory.createVar(pinNr + ""));
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
......
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