...
 
Commits (7)
......@@ -14,7 +14,7 @@
provider="org.fortiss.af3.platform.raspberry.ui.prototype.ProtoypeProvider">
</modelPrototypeProvider>
<modelPrototypeProvider
provider="org.fortiss.af3.platform.raspberry.ui.prototype.MCBProtoypeProvider">
provider="org.fortiss.af3.platform.raspberry.ui.prototype.LightRunnerProtoypeProvider">
</modelPrototypeProvider>
</extension>
<extension
......@@ -400,7 +400,7 @@
modelElementClass="org.fortiss.af3.platform.raspberry.model.camera.CameraRoverID"/>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.platform.raspberry.ui.prototype.MCBElementsHandler">
handler="org.fortiss.af3.platform.raspberry.ui.prototype.LightRunnerElementsHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.platform.raspberry.model.modelsconference.Button"/>
<modelElementClass
......@@ -462,14 +462,5 @@
<contextMenuContribution
contributor="org.fortiss.af3.platform.raspberry.ui.export.ComponentArchitectureExporter">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.platform.raspberry.ui.generator.SSHBareMetalGeneratorEasyStartMenu">
</contextMenuContribution>
</extension>
<extension
point="org.fortiss.af3.project.executionTarget">
<executionTarget
target="org.fortiss.af3.platform.raspberry.ui.generator.SSHBareMetalGeneratorExecutionTarget">
</executionTarget>
</extension>
</plugin>
AF3PlatformModelsConferencUIActivator.java 77e93104f1c3886112d8dab3738198349c6a5dbf YELLOW
AF3PlatformRaspberryUIActivator.java 8aca38b5286c51301a00a73074c54b380af33ffa YELLOW
MCBElementsHandler.java b1da771643a13a8e163f4f6325711813a84bda3b YELLOW
MCBProtoypeProvider.java 2b12f6d036bf8c9e8edac187b5540212a3a3aac8 YELLOW
ModelsConferenceBoardEditPartFactory.java 95b8408cd3ab33d5ab2e266278bd683e73732c7f YELLOW
AF3PlatformRaspberryUIActivator.java a3d12b6e170661f0eb5edb09c087f9a95ddfcc1d GREEN
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui;
import static org.eclipse.jface.resource.ResourceLocator.imageDescriptorFromBundle;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
......@@ -54,6 +56,6 @@ public class AF3PlatformRaspberryUIActivator extends AbstractUIPlugin {
/** Returns the image descriptor for the given icon file. */
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
return imageDescriptorFromBundle(PLUGIN_ID, path).orElse(null);
}
}
ModelsConferenceBoardEditPartFactory.java bb702737e6bbfc046a0cf1c08b63cd5ef56a1762 YELLOW
RaspberryPiEditPartFactory.java 2a32df869a8f793dd49e42bc74007b7890f31ce6 YELLOW
LightRunnerEditPartFactory.java 002983253defbb00c16ae9652d5767869afa567b GREEN
RaspberryPiEditPartFactory.java 5f30ffa740b2553b511e657fddb533d9f8810485 GREEN
......@@ -24,8 +24,8 @@ import org.fortiss.af3.platform.raspberry.model.modelsconference.Poti;
import org.fortiss.af3.platform.ui.editpart.generic.StickyPlatformConnectorUnitEditPart;
import org.fortiss.tooling.kernel.ui.extension.IEditPartFactory;
/** {@link IEditPartFactory} for models conference. */
public class ModelsConferenceBoardEditPartFactory implements IEditPartFactory {
/** {@link IEditPartFactory} for the light runner boards. */
public class LightRunnerEditPartFactory implements IEditPartFactory {
/** {@inheritDoc} */
@Override
public EditPart createEditPart(EditPart context, Object model) {
......@@ -33,6 +33,7 @@ public class ModelsConferenceBoardEditPartFactory implements IEditPartFactory {
model instanceof Poti) {
return new StickyPlatformConnectorUnitEditPart((PlatformConnectorUnit)model);
}
return null;
}
}
......@@ -15,37 +15,22 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.editpart;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import org.eclipse.gef.EditPart;
import org.eclipse.swt.graphics.Color;
import org.fortiss.af3.platform.model.PlatformConnectorUnit;
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.ConsoleOutput;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.camera.CameraConnected;
import org.fortiss.af3.platform.raspberry.model.camera.CameraCurveDetected;
import org.fortiss.af3.platform.raspberry.model.camera.CameraCurveRadius;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDetectionStateLeft;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDetectionStateRight;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDistanceLeft;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDistanceRight;
import org.fortiss.af3.platform.raspberry.model.camera.CameraLastUpdate;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverDistance;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverID;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverRecognized;
import org.fortiss.af3.platform.raspberry.model.camera.CameraYawAngle;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterDownstreamInput;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterUpstreamOutput;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiReceiverBase;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiTransmitterBase;
import org.fortiss.af3.platform.raspberry.model.brick.UIDReceiver;
import org.fortiss.af3.platform.raspberry.model.brick.UIDTtransmitter;
import org.fortiss.af3.platform.raspberry.model.gamepad.GamepadReceiverBase;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlInput;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlOutput;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumbleMagnitudeStrong;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumbleMagnitudeWeak;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumblepadReceiverBase;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VInput;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VOuput;
import org.fortiss.af3.platform.ui.DefaultStyle;
import org.fortiss.af3.platform.ui.editpart.generic.ExecutionUnitEditPart;
import org.fortiss.af3.platform.ui.editpart.generic.StickyPlatformConnectorUnitEditPart;
......@@ -73,21 +58,10 @@ public class RaspberryPiEditPartFactory implements IEditPartFactory {
};
} else if(model instanceof CanBus) {
return new TransmissionUnitDefaultEditPart((CanBus)model);
} else if(model instanceof CanConnector || model instanceof ActuatorPWM ||
model instanceof ConsoleOutput || model instanceof GamepadReceiverBase ||
model instanceof RumblepadReceiverBase || model instanceof RumbleMagnitudeWeak ||
model instanceof RumbleMagnitudeStrong || model instanceof UIDUnit ||
model instanceof MotorControlInput || model instanceof MotorControlOutput ||
model instanceof CameraConnected || model instanceof CameraLastUpdate ||
model instanceof CameraDistanceLeft || model instanceof CameraDistanceRight ||
model instanceof CameraYawAngle || model instanceof CameraDetectionStateLeft ||
model instanceof CameraDetectionStateRight ||
model instanceof CameraRoverRecognized || model instanceof CameraRoverID ||
model instanceof CameraRoverDistance || model instanceof CameraCurveDetected ||
model instanceof CameraCurveRadius ||
model instanceof ControlCenterUpstreamOutput ||
model instanceof ControlCenterDownstreamInput || model instanceof V2VInput ||
model instanceof V2VOuput) {
} else if(isInstanceOfAny(model, CanConnector.class, RaspberryPiTransmitterBase.class,
GamepadReceiverBase.class, UIDReceiver.class, UIDTtransmitter.class,
RumblepadReceiverBase.class, RumbleMagnitudeStrong.class, RumbleMagnitudeWeak.class,
RaspberryPiReceiverBase.class)) {
return new StickyPlatformConnectorUnitEditPart((PlatformConnectorUnit)model);
}
return null;
......
ComponentArchitectureExporter.java 0688b39fe192422a6f7a7d8a271e70096f0a6880 YELLOW
ComponentArchitectureExporter.java 0688b39fe192422a6f7a7d8a271e70096f0a6880 GREEN
SSHBareMetalGeneratorEasyStartMenu.java c4dbb4c29d6695359a75b424c417b4972656c5b9 YELLOW
SSHBareMetalGeneratorExecutionTarget.java 7f04bfa6c620ae47856f7d056b5a1c23c02cd187 YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.generator;
import static org.fortiss.af3.project.ui.AF3ProjectUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.model.allocation.ComponentToExecutionUnitAllocationTable;
import org.fortiss.af3.project.extension.IExecutionTarget;
import org.fortiss.af3.project.services.IExecutionService;
import org.fortiss.af3.project.ui.execution.EasyStartMenuBase;
import org.fortiss.tooling.kernel.model.INamedElement;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
import org.fortiss.tooling.kernel.ui.service.INavigatorService;
/**
* {@link EasyStartMenuBase} for the {@link SSHBareMetalGeneratorExecutionTarget}.
*
* @author hoelzl
* @author bayha
*/
public class SSHBareMetalGeneratorEasyStartMenu extends EasyStartMenuBase {
/** Constructor. */
public SSHBareMetalGeneratorEasyStartMenu() {
super(getDeploymentGeneratorTargetFromExecutionService());
}
/** Returns the simulator execution target. */
private static IExecutionTarget getDeploymentGeneratorTargetFromExecutionService() {
return IExecutionService.INSTANCE
.getSpecificExecutionTarget(SSHBareMetalGeneratorExecutionTarget.class);
}
/** {@inheritDoc} */
@Override
public String getMenuSectionID() {
return IContextMenuService.BOTTOM_MOST_MENU_SECTION_ID;
}
/** {@inheritDoc} */
@Override
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return (selection instanceof ComponentToExecutionUnitAllocationTable) &&
INavigatorService.getInstance().isNavigatorView(contextProvider);
}
/** {@inheritDoc} */
@Override
protected String getActionName() {
return "Run DeploymentGenerator and deploy";
}
/** {@inheritDoc} */
@Override
protected ImageDescriptor getActionIcon() {
return getImageDescriptor("icons/execution_configuration.gif");
}
/** {@inheritDoc} */
@Override
protected String getStartupFailureMessage(Exception e) {
return "Starting the code generator failed. Please check if your model is free of error markers and every component has a defined behavior. Please consult the error log for detailed error information.";
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.generator;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getDefault;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import java.io.IOException;
import java.util.Optional;
import org.eclipse.emf.common.util.EList;
import org.eclipse.swt.widgets.Display;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.allocation.ComponentToExecutionUnitAllocationTable;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.af3.platform.raspberry.model.modelsconference.Poti;
import org.fortiss.af3.platform.ui.generator.BareMetalGeneratorExecutionTarget;
import org.fortiss.af3.project.extension.data.Executable;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
/**
* ExecutionTarget for deployment generator extended with a call of a deploy script.
*
* @author bayha
*/
public class SSHBareMetalGeneratorExecutionTarget extends BareMetalGeneratorExecutionTarget {
/** {@inheritDoc} */
@Override
protected void doExecute(Executable executable) {
super.doExecute(executable);
Runtime r = Runtime.getRuntime();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
int retCode = -1;
try {
Object source = executable.getSource();
ComponentToExecutionUnitAllocationTable ca2ta =
(ComponentToExecutionUnitAllocationTable)source;
PlatformArchitecture platform = ca2ta.getPlatformArchitecture();
EList<IHierarchicElement> containedElements = platform.getContainedElements();
if(containedElements.isEmpty()) {
return;
}
// check if it is the board or the ff1, if the architecture contains a poti.
// contained elements cannot be empty at this point. checked above.
if(containedElements.get(0).getConnectors().stream()
.anyMatch(o -> o instanceof Poti)) {
r.exec("deploy");
} else {
Optional<IHierarchicElement> findFirst = containedElements.stream()
.filter(e -> e instanceof RaspberryPi).findFirst();
RaspberryPi pi = (RaspberryPi)findFirst.get();
r.exec("deploy_ff1 " + pi.getIpAddress());
}
// retCode = p.waitFor();
} catch(IOException e) {
error(getDefault(), "IOException when deploying:\n" + e);
}
if(retCode != 0) {
error(getDefault(), "Generated code could not be deployed.");
}
}
});
}
}
BrickletHandler.java b3154bd30ccad9ab5aceb6ed3e60feeff911fe89 YELLOW
CameraInputHandler.java fd5eb60cc1b56cb8f3662c2207dc0ba37e20cb5f YELLOW
CanBusHandler.java 5d4dbf229daec81e5eecc4ebfb8f8bc2680f2992 YELLOW
CanConnectorHandler.java 3eb2adf8ec6336269d66395025b7ac2050876a79 YELLOW
ConsoleOutputHandler.java 364124b954ab0429425e9de71dbe0f7a99e499f9 YELLOW
ControlCenterDownstreamInputHandler.java 7f303923b702a79a4b74b41e639c07a2d2faa47e YELLOW
ControlCenterUpstreamOutputHandler.java c474ce456c8fbb92513269b598a5fe1b8221c429 YELLOW
GamepadReceiverHandler.java ff81c9f3e941ba8a2b880b3982f63f71f698569b YELLOW
IconModelElementHandlerBase.java aebefe9688e284fa1ac7fe4e098a75eac3966fbd YELLOW
MotorControlInputHandler.java b5d0f0627c7c14c1ed4cc1e36a761e938a5a4c9e YELLOW
MotorControlOutputHandler.java e837a92a595a90adb375f2fe906eb8531c71c4d8 YELLOW
PWMActuatorHandler.java e1bc705e0a57ec11109d309be50ec5ac7ab6cad1 YELLOW
RaspberryPiHandler.java d503b2bd802ff3ff4ced8391e83fb39452546d86 YELLOW
RumblepadReceiverHandler.java 337e65150193a7d66bd69669c7dd5977010259d3 YELLOW
RumblepadSimpleRumbleFeatureHandler.java de79f4f4fea01d8ba3683cbb6dfd91948621c6af YELLOW
V2VInputHandler.java 3fd16a688ccc97cd75aa78381f6419488f44a31d YELLOW
V2VOuputHandler.java b319a3de5cd75a81008bd43ea92db76225205478 YELLOW
BrickletHandler.java b6cde359fada87574eb13c36f25156d9462666fd GREEN
CameraInputHandler.java 67475aca10a7a6667cb2f6c060dfa4a0586f441a GREEN
CanBusHandler.java 8e6d767ed74a05fd40fe775890d28cf42c8c261a GREEN
CanConnectorHandler.java 569e9dd0ebd79ba9e71662c3a262c397e849d1e3 GREEN
ConsoleOutputHandler.java b0d1619021f53b8e0cd3889e274680765d6ce4b2 GREEN
ControlCenterDownstreamInputHandler.java baf54e50519afa93082490a0c96c6ced27b563f4 GREEN
ControlCenterUpstreamOutputHandler.java 163d378db0d5323104818578751e8de338613a81 GREEN
GamepadReceiverHandler.java 3b9b89e4dfbc4e27c9d2bfdc6eb90829f1473d93 GREEN
MotorControlInputHandler.java 198071db6a97e0742916d4f8bcd64cfcc2223187 GREEN
MotorControlOutputHandler.java bb944bce67761d2e89c5865a75d652dc790a7da3 GREEN
PWMActuatorHandler.java a1b0d87122b846b97b73007926eb940e949aea0d GREEN
RaspberryPiHandler.java d503b2bd802ff3ff4ced8391e83fb39452546d86 GREEN
RumblepadReceiverHandler.java 699bb9f21d32201e829f7e8ab07634e7bbca834f GREEN
V2VInputHandler.java 2ec71691162b5bdf57a52352e29da125e1e8cde9 GREEN
V2VOuputHandler.java 6abaecef646fc535d47a32f52350b1c0c4e2558f GREEN
......@@ -15,12 +15,19 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link UIDUnit}s. */
public class BrickletHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** Handler for {@link UIDUnit}s. */
public class BrickletHandler extends IconModelElementHandlerBase<UIDUnit> {
/** Constructor. */
public BrickletHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,19 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiReceiverBase;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
/** Model element handler for camera model elements. */
public class CameraInputHandler extends IconModelElementHandlerBase<RaspberryPiReceiverBase> {
/** Constructor. */
public CameraInputHandler() {
super("icons/unknown.png");
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for camera model elements. */
public class CameraInputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -25,7 +25,7 @@ import org.fortiss.af3.platform.raspberry.model.CanBus;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link CanBus}. */
/** {@link IModelElementHandler} for {@link CanBus}es. */
@SuppressWarnings({"unchecked", "rawtypes"})
public class CanBusHandler extends ModelElementHandlerBase<CanBus> {
/** {@inheritDoc} */
......
......@@ -24,11 +24,6 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link CanConnector}. */
public class CanConnectorHandler extends ModelElementHandlerBase<CanConnector> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
/** {@inheritDoc} */
@Override
......@@ -36,4 +31,10 @@ public class CanConnectorHandler extends ModelElementHandlerBase<CanConnector> {
String name = element.getName();
return name != null ? name : "CanConnector";
}
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,13 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.ConsoleOutput;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link ConsoleOutput}s. */
public class ConsoleOutputHandler extends IconModelElementHandlerBase<ConsoleOutput> {
/** Constructor. */
public ConsoleOutputHandler() {
super("icons/console.png");
public class ConsoleOutputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,13 +15,21 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterDownstreamInput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IconModelElementHandlerBase} for {@link ControlCenterDownstreamInput}s. */
/** {@link IModelElementHandler} for {@link ControlCenterDownstreamInput}s. */
public class ControlCenterDownstreamInputHandler
extends IconModelElementHandlerBase<ControlCenterDownstreamInput> {
/** Constructor. */
public ControlCenterDownstreamInputHandler() {
super("icons/unknown.png");
extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,13 +15,21 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterUpstreamOutput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IconModelElementHandlerBase} for {@link ControlCenterUpstreamOutput}s. */
/** {@link IModelElementHandler} for {@link ControlCenterUpstreamOutput}s. */
public class ControlCenterUpstreamOutputHandler
extends IconModelElementHandlerBase<ControlCenterUpstreamOutput> {
/** Constructor. */
public ControlCenterUpstreamOutputHandler() {
super("icons/unknown.png");
extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.gamepad.GamepadReceiverBase;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link GamepadReceiverBase}s. */
public class GamepadReceiverHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** Handler for {@link GamepadReceiverBase}s. */
public class GamepadReceiverHandler extends IconModelElementHandlerBase<GamepadReceiverBase> {
/** Constructor. */
public GamepadReceiverHandler() {
super("icons/gamepad.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlInput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link MotorControlInput}s. */
public class MotorControlInputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@link IconModelElementHandlerBase} for {@link MotorControlInput}s. */
public class MotorControlInputHandler extends IconModelElementHandlerBase<MotorControlInput> {
/** Constructor. */
public MotorControlInputHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlOutput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link MotorControlOutput}s. */
public class MotorControlOutputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@link IconModelElementHandlerBase} for {@link MotorControlOutput}s. */
public class MotorControlOutputHandler extends IconModelElementHandlerBase<MotorControlOutput> {
/** Constructor. */
public MotorControlOutputHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.ActuatorPWM;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link ActuatorPWM}s. */
public class PWMActuatorHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@link IconModelElementHandlerBase} for {@link ActuatorPWM}s. */
public class PWMActuatorHandler extends IconModelElementHandlerBase<ActuatorPWM> {
/** Constructor. */
public PWMActuatorHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,12 +15,20 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumblepadReceiverBase;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** {@link IModelElementHandler} for {@link RumblepadReceiverBase}s. */
public class RumblepadReceiverHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@link IconModelElementHandlerBase} for {@link RumblepadReceiverBase}s. */
public class RumblepadReceiverHandler extends IconModelElementHandlerBase<RumblepadReceiverBase> {
/** Constructor. */
public RumblepadReceiverHandler() {
super("icons/gamepad.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/gamepad.png");
}
}
......@@ -15,17 +15,24 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VInput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* V2V Input Connector Handler
* {@link IModelElementHandler} for {@link V2VInput}s.
*
* @author eder
*/
public class V2VInputHandler extends IconModelElementHandlerBase<V2VInput> {
public class V2VInputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** Constructor. */
public V2VInputHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,17 +15,24 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VOuput;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* V2V Output Connector Handler
* {@link IModelElementHandler} for {@link V2VOuput}s.
*
* @author eder
*/
public class V2VOuputHandler extends IconModelElementHandlerBase<V2VOuput> {
public class V2VOuputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** Constructor. */
public V2VOuputHandler() {
super("icons/unknown.png");
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
ActuatorDigitsPropertySection.java 18d84e5ece3041249375724dde447fb9f2fd3039 YELLOW
ActuatorPWMPropertySection.java 786e51c40d053b505d1f8aaab7beac70012d5ea9 YELLOW
BoundedIntPositiveZeroValidator.java dfde0d07d2c3465c9bf6f626b0000c2d049e52b1 YELLOW
RaspberryPiExecutionUnitPropertySection.java b1e7339762c7b8b829c13f189d34f5fa81833c67 YELLOW
UIDUnitPropertySection.java e519bb40db20022a7eb11de861eed90f0b41438c YELLOW
ActuatorDigitsPropertySection.java 75be0be45a1bc462e1f6fe2d84f63c60b95360a0 GREEN
ActuatorPWMPropertySection.java f4c1c8285a9c1f234a2bdaad4e91d4487887c4a6 GREEN
BoundedIntPositiveZeroValidator.java dfde0d07d2c3465c9bf6f626b0000c2d049e52b1 GREEN
RaspberryPiExecutionUnitPropertySection.java f384f091a1681d8e2d352e0b5ad2ed38ab087897 GREEN
UIDUnitPropertySection.java d2f64193f25734f8955f2b3d1d1a681390d0acf3 GREEN
......@@ -15,11 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.properties;
import static org.eclipse.swt.SWT.CHECK;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeSelection;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
......@@ -38,8 +38,8 @@ public class ActuatorDigitsPropertySection extends PropertySectionBase {
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
hexOutputFlagButton = getWidgetFactory().createButton(composite, "", SWT.CHECK);
createFormEntry(hexOutputFlagButton, "Coordinator Unit");
hexOutputFlagButton = getWidgetFactory().createButton(composite, "", CHECK);
createFormEntry(hexOutputFlagButton, "Show Hexadecimal Output");
hexOutputFlagButton.setSelection(false);
}
......@@ -51,6 +51,7 @@ public class ActuatorDigitsPropertySection extends PropertySectionBase {
/** {@inheritDoc} */
@Override
@SuppressWarnings("unchecked")
public void refresh() {
super.refresh();
IObservableValue<?> modelObservable =
......
......@@ -40,7 +40,9 @@ public class ActuatorPWMPropertySection extends PropertySectionBase {
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
pwmChannelText = createDecoratedText("PWM Channel (0, 1)");
String pwmChannelLabel = "PWM Channel (0, 1)";
pwmChannelText = createDecoratedText(pwmChannelLabel);
createFormEntry(pwmChannelText, pwmChannelLabel);
}
/** {@inheritDoc} */
......
......@@ -58,16 +58,34 @@ public class RaspberryPiExecutionUnitPropertySection extends PropertySectionBase
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
canCoordinationIDText = createDecoratedText("CAN Unit ID");
cycleTimeText = createDecoratedText("Cycle Time (ms)");
String canCoordinationIDLabel = "CAN Unit ID";
String cycleTimeLabel = "Cycle Time (ms)";
String coordinatorFlagLabel = "Coordinator Unit";
String ipAddressLabel = "Unit IP Address";
String cameraServerAddressLabel = "Camera Server IP Address";
String cameraServerPortLabel = "Camera Server IP Port";
String ccAddressLabel = "Control Center IP Address";
String ccPortTextLabel = "Control Center IP Port";
canCoordinationIDText = createDecoratedText(canCoordinationIDLabel);
cycleTimeText = createDecoratedText(cycleTimeLabel);
ipAddressText = createDecoratedText(ipAddressLabel);
cameraServerAddressText = createDecoratedText(cameraServerAddressLabel);
cameraServerPortText = createDecoratedText(cameraServerPortLabel);
ccAddressText = createDecoratedText(ccAddressLabel);
ccPortText = createDecoratedText(ccPortTextLabel);
coordinatorFlagButton = getWidgetFactory().createButton(composite, "", SWT.CHECK);
createFormEntry(coordinatorFlagButton, "Coordinator Unit");
coordinatorFlagButton.setSelection(false);
ipAddressText = createDecoratedText("Unit IP Address");
cameraServerAddressText = createDecoratedText("Camera Server IP Address");
cameraServerPortText = createDecoratedText("Camera Server IP Port");
ccAddressText = createDecoratedText("Control Center IP Address");
ccPortText = createDecoratedText("Control Center IP Port");
createFormEntry(canCoordinationIDText, canCoordinationIDLabel);
createFormEntry(cycleTimeText, cycleTimeLabel);
createFormEntry(coordinatorFlagButton, coordinatorFlagLabel);
createFormEntry(ipAddressText, ipAddressLabel);
createFormEntry(cameraServerAddressText, cameraServerAddressLabel);
createFormEntry(cameraServerPortText, cameraServerPortLabel);
createFormEntry(ccAddressText, ccAddressLabel);
createFormEntry(ccPortText, ccPortTextLabel);
}
/** {@inheritDoc} */
......@@ -77,6 +95,7 @@ public class RaspberryPiExecutionUnitPropertySection extends PropertySectionBase
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public void refresh() {
super.refresh();
......
......@@ -38,7 +38,9 @@ public class UIDUnitPropertySection extends PropertySectionBase {
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
uidText = createDecoratedText("UID");
String uidLabel = "UID";
uidText = createDecoratedText(uidLabel);
createFormEntry(uidText, uidLabel);
}
/** {@inheritDoc} */
......@@ -48,6 +50,7 @@ public class UIDUnitPropertySection extends PropertySectionBase {
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public void refresh() {
super.refresh();
......
MCBElementsHandler.java 4db9f4c0f41111b1faf7f1573a2b7510435e6d3a YELLOW
MCBProtoypeProvider.java b7a36acb49af9b2f256d538256e2128d7217f31f YELLOW
ProtoypeProvider.java 0e3f99fdfc06b4573c0a96fcddc38623770a2f72 YELLOW
LightRunnerElementsHandler.java 6d7d65aeec9f75bcc35632d3d8af9b5b2c813ec6 GREEN
LightRunnerProtoypeProvider.java 105cf1de751c39921650c1e9a9e4307dc63d542f GREEN
ProtoypeProvider.java 32fafd4113a5b23b1de8857eec17fe3ec11a27b3 GREEN
......@@ -13,28 +13,21 @@
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
package org.fortiss.af3.platform.raspberry.ui.prototype;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.af3.platform.raspberry.model.brick.UIDUnit;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/** Base class for {@link NamedCommentedModelElementHandlerBase}s . */
public abstract class IconModelElementHandlerBase<T extends INamedCommentedElement>
extends NamedCommentedModelElementHandlerBase<T> {
/** Static icon image descriptor. */
private final ImageDescriptor iconDescriptor;
/** Constructor. */
public IconModelElementHandlerBase(String icon) {
iconDescriptor = getImageDescriptor(icon);
}
/** {@link IModelElementHandler} for light runner board elements. */
public class LightRunnerElementsHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return iconDescriptor;
return getImageDescriptor("icons/unknown.png");
}
}
......@@ -15,21 +15,21 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.prototype;
import static org.fortiss.af3.platform.raspberry.modelsconference.ModelsConferencePlatformElementFactory.createDemonstratorBoard;
import static org.fortiss.af3.platform.raspberry.lightrunner.LightRunnerPlatformElementFactory.createDemonstratorBoard;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
/** {@link PrototypeProviderBase} for models conference board elements. */
public class MCBProtoypeProvider extends PrototypeProviderBase {
public class LightRunnerProtoypeProvider extends PrototypeProviderBase {
/** Stores the category to display for these prototypes. */
protected final static String CATEGORY_NAME = "Models Conference";
protected final static String CATEGORY_NAME = "Light Runner";
/** {@inheritDoc} */
@Override
protected void registerPrototypes() {
RaspberryPi pi = createDemonstratorBoard();
registerPrototypeCategory(CATEGORY_NAME);
registerPrimaryPrototype("Models Conference Demo Board", pi, CATEGORY_NAME);
registerPrimaryPrototype("Light Runner Board", pi, CATEGORY_NAME);
}
}
......@@ -52,6 +52,7 @@ import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFacto
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createLeftStickY;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createMotorControlInput;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createMotorControlOutput;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createRaspberryPi;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createRightStickX;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createRightStickY;
import static org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory.createRumbleButtonA;
......@@ -192,7 +193,7 @@ public class ProtoypeProvider extends PrototypeProviderBase {
/** {@inheritDoc} */
@Override
protected void registerPrototypes() {
RaspberryPi pi = RaspberryModelElementFactory.createRaspberryPi();
RaspberryPi pi = createRaspberryPi();
registerPrimaryPrototype("RaspberryPi", pi, CATEGORY_NAME);
PrototypeCategory prototypeCategory = registerPrototypeCategory(CATEGORY_NAME);
registerPrototypeCategory(prototypeCategory, GAMEPAD);
......@@ -232,9 +233,7 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerV2VComElements();
}
/**
*
*/
/** Register V2V communication elements. */
private void registerV2VComElements() {
V2VPlatoonInput input = RaspberryModelElementFactory.createV2vPlatoonInput();
setNodePosition(input, 0, 0);
......
eclipse.preferences.version=1
encoding//html/external_tools.html=UTF-8
encoding//model/conti.ecorediag=UTF-8
encoding//src/org/fortiss/af3/platform/raspberry/modelsconference/AF3PlatformModelsConferenceActivator.java=UTF-8
encoding//src/org/fortiss/af3/platform/raspberry/modelsconference/ModelsConferencePlatformElementFactory.java=UTF-8
encoding//uml/exploration.ecorediag=UTF-8
encoding/<project>=US-ASCII
......@@ -8,6 +8,7 @@ Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.fortiss.af3.platform.raspberry.generator.framework,
org.fortiss.af3.platform.raspberry.lightrunner,
org.fortiss.af3.platform.raspberry.model,
org.fortiss.af3.platform.raspberry.model.brick,
org.fortiss.af3.platform.raspberry.model.brick.impl,
......@@ -35,7 +36,6 @@ Export-Package: org.fortiss.af3.platform.raspberry.generator.framework,
org.fortiss.af3.platform.raspberry.model.v2v,
org.fortiss.af3.platform.raspberry.model.v2v.impl,
org.fortiss.af3.platform.raspberry.model.v2v.util,
org.fortiss.af3.platform.raspberry.modelsconference,
org.fortiss.af3.platform.raspberry.util
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.fortiss.af3.platform.raspberry.AF3PlatformRaspberryActivator
......
raspberry.ecore 57652dd3e1897a56d62b5e095712540a23a94b02 YELLOW
raspberry.ecore 709c09faa8a8673031eeafbb2b96d590ac8412a3 GREEN
......@@ -140,8 +140,8 @@
<eClassifiers xsi:type="ecore:EClass" name="V2VLeaderUIDOutput" eSuperTypes="#//v2v/V2VOuput"/>
<eClassifiers xsi:type="ecore:EClass" name="V2VHandshakeInput" eSuperTypes="#//v2v/V2VInput"/>
</eSubpackages>
<eSubpackages name="modelsconference" nsURI="http://www.fortiss.org/af3/platform/raspberry/modelsconference"
nsPrefix="org-fortiss-af3-platform-raspberry-modelconference">
<eSubpackages name="lightrunner" nsURI="http://www.fortiss.org/af3/platform/raspberry/lightrunner"
nsPrefix="org-fortiss-af3-platform-raspberry-lightrunner">
<eClassifiers xsi:type="ecore:EClass" name="LCD" eSuperTypes="#//RaspberryPiTransmitterBase #//brick/UIDUnit"/>
<eClassifiers xsi:type="ecore:EClass" name="Button" eSuperTypes="#//RaspberryPiReceiverBase #//brick/UIDUnit"/>
<eClassifiers xsi:type="ecore:EClass" name="LED" eSuperTypes="#//RaspberryPiTransmitterBase #//brick/UIDUnit"/>
......
......@@ -138,12 +138,12 @@
<genClasses ecoreClass="raspberry.ecore#//v2v/V2VLeaderUIDOutput"/>
<genClasses ecoreClass="raspberry.ecore#//v2v/V2VHandshakeInput"/>
</nestedGenPackages>
<nestedGenPackages prefix="Modelsconference" basePackage="org.fortiss.af3.platform.raspberry.model"
disposableProviderFactory="true" ecorePackage="raspberry.ecore#//modelsconference">
<genClasses ecoreClass="raspberry.ecore#//modelsconference/LCD"/>
<genClasses ecoreClass="raspberry.ecore#//modelsconference/Button"/>
<genClasses ecoreClass="raspberry.ecore#//modelsconference/LED"/>
<genClasses ecoreClass="raspberry.ecore#//modelsconference/Poti"/>
<nestedGenPackages prefix="Lightrunner" basePackage="org.fortiss.af3.platform.raspberry.model"
disposableProviderFactory="true" ecorePackage="raspberry.ecore#//lightrunner">
<genClasses ecoreClass="raspberry.ecore#//lightrunner/LCD"/>
<genClasses ecoreClass="raspberry.ecore#//lightrunner/Button"/>
<genClasses ecoreClass="raspberry.ecore#//lightrunner/LED"/>
<genClasses ecoreClass="raspberry.ecore#//lightrunner/Poti"/>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
AF3PlatformRaspberryActivator.java 47c249340f86426257bb868bdc7b30c77086745c YELLOW
AF3PlatformRaspberryActivator.java 47c249340f86426257bb868bdc7b30c77086745c GREEN
CanBusCompositor.java fe2eabdab375daec6ccb47cb3fb8452112717854 YELLOW
CanToRaspberryCompositor.java 927a741f55da203b96939f8620c5c9ba5cd3f046 YELLOW
RaspberryPiCompositor.java 52c4a6dbc673bbb548aff89b870b60ad4b51fd6e YELLOW
RaspberryToCanCompositor.java 7180ea9d371143bdc70ca75170a58d9162289b66 YELLOW
CanBusCompositor.java b634ad94492dc168cde6a69dce61bee7a53f8e37 GREEN
CanToRaspberryCompositor.java 927a741f55da203b96939f8620c5c9ba5cd3f046 GREEN
RaspberryPiCompositor.java abe58f512a93fc7fc6d9a112423fb9091ea6fe9b GREEN
RaspberryToCanCompositor.java 7180ea9d371143bdc70ca75170a58d9162289b66 GREEN
......@@ -23,7 +23,7 @@ import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.raspberry.model.CanBus;
import org.fortiss.af3.platform.raspberry.model.CanConnector;
/** Compositor for {@link CanConnector} on {@link CanBus}. */
/** Compositor for a {@link CanConnector} on a {@link CanBus}. */
public class CanBusCompositor
extends PlatformArchitectureElementCompositorBase<IPlatformArchitectureElement> {
......@@ -31,11 +31,11 @@ public class CanBusCompositor
@Override
protected boolean isCorrectElementClass(IPlatformArchitectureElement container,
EObject contained) {
final boolean instanceOfAny = isInstanceOfAny(contained, CanConnector.class);
final boolean isCanConnector = isInstanceOfAny(contained, CanConnector.class);
if(container != null) {
final boolean instanceOfAny2 = isInstanceOfAny(container, CanBus.class);
return instanceOfAny2 && instanceOfAny;
final boolean isCanBus = isInstanceOfAny(container, CanBus.class);
return isCanBus && isCanConnector;
}
return instanceOfAny;
return isCanConnector;
}
}
......@@ -20,44 +20,16 @@ import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.platform.compose.PlatformArchitectureElementCompositorBase;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.raspberry.model.ActuatorPWM;
import org.fortiss.af3.platform.raspberry.model.CanConnector;
import org.fortiss.af3.platform.raspberry.model.ConsoleOutput;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.af3.platform.raspberry.model.brick.AccelerationXSensor;
import org.fortiss.af3.platform.raspberry.model.brick.AccelerationYSensor;
import org.fortiss.af3.platform.raspberry.model.brick.AccelerationZSensor;
import org.fortiss.af3.platform.raspberry.model.brick.ActuatorDigits;
import org.fortiss.af3.platform.raspberry.model.brick.AngularVelocityXSensor;
import org.fortiss.af3.platform.raspberry.model.brick.AngularVelocityYSensor;
import org.fortiss.af3.platform.raspberry.model.brick.AngularVelocityZSensor;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonBActuator;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonGActuator;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonRActuator;
import org.fortiss.af3.platform.raspberry.model.brick.LaserRangeSensor;
import org.fortiss.af3.platform.raspberry.model.brick.UltraSonicSensor;
import org.fortiss.af3.platform.raspberry.model.camera.CameraConnected;
import org.fortiss.af3.platform.raspberry.model.camera.CameraCurveDetected;
import org.fortiss.af3.platform.raspberry.model.camera.CameraCurveRadius;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDetectionStateLeft;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDetectionStateRight;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDistanceLeft;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDistanceRight;
import org.fortiss.af3.platform.raspberry.model.camera.CameraLastUpdate;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverDistance;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverID;
import org.fortiss.af3.platform.raspberry.model.camera.CameraRoverRecognized;
import org.fortiss.af3.platform.raspberry.model.camera.CameraYawAngle;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterDownstreamInput;
import org.fortiss.af3.platform.raspberry.model.controlcenter.ControlCenterUpstreamOutput;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiReceiverBase;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiTransmitterBase;
import org.fortiss.af3.platform.raspberry.model.brick.UIDReceiver;
import org.fortiss.af3.platform.raspberry.model.brick.UIDTtransmitter;
import org.fortiss.af3.platform.raspberry.model.gamepad.GamepadReceiverBase;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlInput;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlOutput;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumbleMagnitudeStrong;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumbleMagnitudeWeak;
import org.fortiss.af3.platform.raspberry.model.rumblepad.RumblepadReceiverBase;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VInput;
import org.fortiss.af3.platform.raspberry.model.v2v.V2VOuput;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
......@@ -81,24 +53,14 @@ public class RaspberryPiCompositor
@Override
protected boolean isCorrectElementClass(IPlatformArchitectureElement container,
EObject contained) {
final boolean instanceOfAny2 = isInstanceOfAny(contained, CanConnector.class,
ActuatorPWM.class, ConsoleOutput.class, GamepadReceiverBase.class,
UltraSonicSensor.class, LaserRangeSensor.class, AccelerationXSensor.class,
AccelerationYSensor.class, AccelerationZSensor.class, AngularVelocityXSensor.class,
AngularVelocityYSensor.class, AngularVelocityZSensor.class, ActuatorDigits.class,
LEDButtonRActuator.class, LEDButtonGActuator.class, LEDButtonBActuator.class,
RumblepadReceiverBase.class, RumbleMagnitudeStrong.class, RumbleMagnitudeWeak.class,
MotorControlInput.class, MotorControlOutput.class, CameraConnected.class,
CameraLastUpdate.class, CameraDistanceLeft.class, CameraDistanceRight.class,
CameraYawAngle.class, CameraDetectionStateLeft.class,
CameraDetectionStateRight.class, CameraRoverRecognized.class, CameraRoverID.class,
CameraRoverDistance.class, CameraCurveDetected.class, CameraCurveRadius.class,
ControlCenterDownstreamInput.class, ControlCenterUpstreamOutput.class,
V2VInput.class, V2VOuput.class);
final boolean isConnector = isInstanceOfAny(contained, CanConnector.class,
RaspberryPiTransmitterBase.class, GamepadReceiverBase.class, UIDReceiver.class,
UIDTtransmitter.class, RumblepadReceiverBase.class, RumbleMagnitudeStrong.class,
RumbleMagnitudeWeak.class, RaspberryPiReceiverBase.class);
if(container != null) {
final boolean instanceOfAny = isInstanceOfAny(container, RaspberryPi.class);
return instanceOfAny && instanceOfAny2;
final boolean isRaspberryPi = isInstanceOfAny(container, RaspberryPi.class);
return isRaspberryPi && isConnector;
}
return instanceOfAny2;
return isConnector;
}
}
CanBusGeneratorExtension.java 4bed3c88e71923515d7d9dc9235bc40a49ce237f YELLOW
CanConnectorGeneratorExtension.java 900c836414d63ccf2cba904b396e4d5b2efe51a5 YELLOW
CanTransmissionCatalog.java f678cb0f16d4ba46a0f5ae5dd35b569c1211f499 YELLOW
ConsoleOutputGeneratorExtension.java 1246aa81a2865a798207f13e66bfeebc8fbf0cb8 YELLOW
MainGenerator.java f241e63e8ebb6a3ecc955fe503369dde1d4b89c3 YELLOW
MultiUnitMainGenerator.java b72c221bd1c45e18e8be9e63d42e92b86aef51ac YELLOW
PWMActuatorGeneratorExtension.java a4925aac8b6b7d650ef60fca32b18bba894c3b03 YELLOW
RaspberryPIGeneratorExtension.java e47fb8e892354505fce0e388fd362d789f686fb6 YELLOW
SingleUnitMainGenerator.java 772c368ade02ebc703a8fc8f329b6748bcce72be YELLOW
CanBusGeneratorExtension.java 4bed3c88e71923515d7d9dc9235bc40a49ce237f GREEN
CanConnectorGeneratorExtension.java 5680017d9ef5ec7ac81ef7c035ba0a946d0f8b15 GREEN
CanTransmissionCatalog.java 0e5d45246d1c05d8391d540053df306c3e2a0b4d GREEN
ConsoleOutputGeneratorExtension.java 49509abbd2d6e2715c2f3af074d2e46a5c0a961e GREEN
MainGenerator.java 15c330788dc48d1ff930363ffe104fc5b6f17e5f GREEN
MultiUnitMainGenerator.java b72c221bd1c45e18e8be9e63d42e92b86aef51ac GREEN
PWMActuatorGeneratorExtension.java 0764332c723731ae0ab19f09f65dfe8c6a571bdb GREEN
RaspberryPIGeneratorExtension.java 33d100efb28c217042d32facbcb0ae0ac9173b36 GREEN
SingleUnitMainGenerator.java 25750238d45816d706021d2ceb1b493a4d3c0417 GREEN
......@@ -88,9 +88,7 @@ public class CanConnectorGeneratorExtension extends TransceiverExecutableBase<Ca
}
}
/**
* builds a constant literal C string including double quotes
*/
/** Builds a constant literal C string including double quotes. */
private RawString literalString(String str) {
return rawString("\"" + str + "\"");
}
......
......@@ -35,6 +35,7 @@ import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
* are used by the {@link RaspberryPIGeneratorExtension}.
*/
public class CanTransmissionCatalog extends TransmissionCatalog {
/** Mapping from atomic component to the execution unit it is allocated on. */
private HashMap<Component, RaspberryPi> componentToRaspberry = new HashMap<>();
/** Mapping from execution unit to generated CAN IDs starting from {@code canIdCounter}. */
......@@ -72,7 +73,7 @@ public class CanTransmissionCatalog extends TransmissionCatalog {
}
}
/** Returns whether this input port is connected to a remote source. */
/** Returns whether this {@link InputPort} is connected to a remote source. */
public boolean hasRemoteSource(InputPort inport) {
OutputPort outport = atomicInputToOutput.get(inport);
if(outport == null) {
......@@ -83,27 +84,27 @@ public class CanTransmissionCatalog extends TransmissionCatalog {
return inPi != outPi;
}
/** Returns whether the given output port is needed remotely. */
/** Returns whether the given {@link OutputPort} is needed remotely. */
public boolean isOutputNeededRemotely(OutputPort outport) {
return atomicInputToOutput.containsValue(outport);
}
/** Returns the atomic (remote) source port for this input port. */
/** Returns the atomic (remote) source port for this {@link InputPort} */
public OutputPort getSourcePort(InputPort inport) {
return atomicInputToOutput.get(inport);
}
/** Returns the {@link RaspberryPi} for the given port. */
/** Returns the {@link RaspberryPi} for the given {@link Port}. */
public RaspberryPi getRaspberryPi(Port port) {
return getRaspberryPi(port.getComponent());
}
/** Returns the {@link RaspberryPi} for the given component. */
/** Returns the {@link RaspberryPi} for the given {@link Component}. */
public RaspberryPi getRaspberryPi(Component component) {
return componentToRaspberry.get(component);
}
/** Returns the CAN id for the given {@link RaspberryPi}. */
/** Returns the CAN ID for the given {@link RaspberryPi}. */
public int getCanId(RaspberryPi raspi) {
return raspberryCanId.get(raspi);
}
......
......@@ -25,6 +25,7 @@ import org.fortiss.af3.project.model.typesystem.IType;
/** Executable for {@link ConsoleOutput}. */
public class ConsoleOutputGeneratorExtension extends ExecutableBase<ConsoleOutput>
implements IWriteableGeneratorExtension {
/** Constructor. */
public ConsoleOutputGeneratorExtension(ConsoleOutput modelElement) {
super(modelElement);
......@@ -38,7 +39,7 @@ public class ConsoleOutputGeneratorExtension extends ExecutableBase<ConsoleOutpu
return "printf(\"" + name + " = " + typeFormat + "\\n\", " + value + ");\n";
}
/** Returns the C format string for the given type. */
/** Returns the C format string for the given {@link IType}. */
private String getTypeFormat(IType type) {
if(type instanceof TDouble) {
return "%f";
......
......@@ -44,12 +44,12 @@ import org.fortiss.af3.platform.raspberry.generator.framework.IWriteableGenerato
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.tooling.kernel.model.INamedElement;
/**
* Class containing the code-generation of the main.c file that is shared between single- and
* multi-unit deployment.
*/
/** Base class for generators for the main.c file to be deployed to {@link RaspberryPi}s. */
public abstract class MainGenerator {
/** Location of the RasberryPi-specific configuration file. */
private final String CONFIG_PATH = "/home/pi/config.xml";
/** The current execution unit. */
protected RaspberryPi executionUnit;
/** Pairs of deployed {@link Component}s and their respective {@link ExecutionUnit}. */
......@@ -150,7 +150,7 @@ public abstract class MainGenerator {
for(PlatformConnectorUnit pcu : platformConnector2ExecutableBase.keySet()) {
ExecutableBase<?> exec = platformConnector2ExecutableBase.get(pcu);
if(!configurableInitDone && exec instanceof IConfigurableExtension) {
sb.append("conf_init(\"/home/pi/config.xml\");\n");
sb.append("conf_init(\"" + CONFIG_PATH + "\");\n");
configurableInitDone = true;
}
if(exec instanceof ISingletonGeneratorExtension) {
......@@ -190,39 +190,36 @@ public abstract class MainGenerator {
/** Creates the read code for the given receiver and port. */
protected String createReadCode(Receiver receiver, InputPort inport) {
ExecutableBase<?> exec = platformConnector2ExecutableBase.get(receiver);
if(exec instanceof IReadableGeneratorExtension) {
IReadableGeneratorExtension rexec = (IReadableGeneratorExtension)exec;
String targetVariable = getPortIdentifier(inport);
String readCode = rexec.getReadCode(inport, targetVariable);
String novalCode = rexec.getNoValReadCode(inport);
String pnvVar = getPortNoValIdentifier(targetVariable);
if(novalCode != null) {
return "if (!(" + novalCode + ")) {\n" + pnvVar + " = false;\n" + readCode +
"} else {\n" + pnvVar + " = true;\n}\n";
}
return pnvVar + " = false;\n" + readCode;
IReadableGeneratorExtension rexec = (IReadableGeneratorExtension)exec;
String targetVariable = getPortIdentifier(inport);
String readCode = rexec.getReadCode(inport, targetVariable);
String novalCode = rexec.getNoValReadCode(inport);
String pnvVar = getPortNoValIdentifier(targetVariable);
if(novalCode != null) {
return "if (!(" + novalCode + ")) {\n" + pnvVar + " = false;\n" + readCode +
"} else {\n" + pnvVar + " = true;\n}\n";
}
return "FIXME(\"No generator extension available to read " + inport.getName() + " from " +
receiver.getName() + "\");\n";
return pnvVar + " = false;\n" + readCode;
}
/** Creates the read code for the given receiver and port. */
protected String createWriteCode(Transmitter transmitter, OutputPort outport) {
ExecutableBase<?> exec = platformConnector2ExecutableBase.get(transmitter);
if(exec instanceof IWriteableGeneratorExtension) {
IWriteableGeneratorExtension wexec = (IWriteableGeneratorExtension)exec;
String sourceVariable = getPortIdentifier(outport);
String writeCode = wexec.getWriteCode(outport, sourceVariable);
String novalCode = wexec.getNoValWriteCode(outport);
if(novalCode != null) {
String novalVariable = getPortNoValIdentifier(sourceVariable);
return "if (" + novalVariable + ") {\n" + novalCode + "} else {\n" + writeCode +
"}\n";
}
return writeCode;
IWriteableGeneratorExtension wexec = (IWriteableGeneratorExtension)exec;
String sourceVariable = getPortIdentifier(outport);