Commit 83b7dc24 authored by Alexander Diewald's avatar Alexander Diewald

Merge branch '3867' into 'master'

[3867] Refurbish raspberry pi platform and integrate it into the main product

See merge request !293
parents 640686cb 7bca8087
/*/bin/
/*/build/
/*/generated-src/
/*/target/
/target/
*.rej
.DS_Store
._.DS_Store
/*/bin/
/*/build/
/*/generated-src/
/*/target/
/target/
*.rej
.DS_Store
._.DS_Store
......@@ -162,3 +162,9 @@
path = org.fortiss.af3.timing.ui/.settings
url = https://git.fortiss.org/af3/plugin-settings.git
branch = master
[submodule "org.fortiss.af3.platform.raspberry/.settings"]
path = org.fortiss.af3.platform.raspberry/.settings
url = https://git.fortiss.org/af3/plugin-settings.git
[submodule "org.fortiss.af3.platform.raspberry.ui/.settings"]
path = org.fortiss.af3.platform.raspberry.ui/.settings
url = https://git.fortiss.org/af3/plugin-settings.git
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="build"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.fortiss.af3.platform.raspberry.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.systemfocus.tooling.codereview.builder.CodeReviewBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.systemfocus.tooling.codereview.builder.RemoveWarningsBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.systemfocus.tooling.codereview.builder.GuidelinesCheckBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.systemfocus.tooling.codereview.nature.CodeReviewNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//html/external_tools.html=UTF-8
encoding//model/conti.ecorediag=UTF-8
encoding//uml/exploration.ecorediag=UTF-8
encoding/<project>=US-ASCII
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Fortiss AF3 Platform Raspberry UI
Bundle-SymbolicName: org.fortiss.af3.platform.raspberry.ui;singleton:=true
Bundle-Version: 2.13.0.qualifier
Bundle-Activator: org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator
Require-Bundle: org.eclipse.ui.ide;bundle-version="3.7.0";visibility:=reexport,
org.fortiss.af3.project.ui;bundle-version="1.0.0";visibility:=reexport,
org.fortiss.tooling.base.ui;bundle-version="2.13.0";visibility:=reexport,
org.fortiss.af3.platform.ui;bundle-version="2.13.0";visibility:=reexport,
org.fortiss.af3.platform.raspberry;bundle-version="2.13.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.af3.platform.raspberry.ui,
org.fortiss.af3.platform.raspberry.ui.handler
Automatic-Module-Name: org.fortiss.af3.platform.raspberry.ui
# <copyright>
# </copyright>
#
# | |
bin.includes = .,\
META-INF/,\
icons/,\
plugin.xml
source.. = src/
output.. = build/
\ No newline at end of file
# <copyright>
# </copyright>
#
# | |
pluginName = Fortiss AF3 Base Project UI
providerName = fortiss GmbH
This diff is collapsed.
AF3PlatformRaspberryUIActivator.java a3d12b6e170661f0eb5edb09c087f9a95ddfcc1d GREEN
/*-------------------------------------------------------------------------+
| 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;
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;
/** The activator class controls the plug-in life cycle. */
public class AF3PlatformRaspberryUIActivator extends AbstractUIPlugin {
/** The plug-in ID. */
public static final String PLUGIN_ID =
AF3PlatformRaspberryUIActivator.class.getPackage().getName(); // $NON-NLS-1$
/** The shared instance. */
private static AF3PlatformRaspberryUIActivator plugin;
/** Constructor. */
public AF3PlatformRaspberryUIActivator() {
// do nothing
}
/** {@inheritDoc} */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/** {@inheritDoc} */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/** Returns the shared instance. */
public static AF3PlatformRaspberryUIActivator getDefault() {
return plugin;
}
/** Returns the image descriptor for the given icon file. */
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromBundle(PLUGIN_ID, path).orElse(null);
}
}
LightRunnerEditPartFactory.java 043bc9dffad794d8cedcaade890a0baf44d43294 GREEN
RaspberryPiEditPartFactory.java 5f30ffa740b2553b511e657fddb533d9f8810485 GREEN
/*-------------------------------------------------------------------------+
| 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.editpart;
import org.eclipse.gef.EditPart;
import org.fortiss.af3.platform.model.PlatformConnectorUnit;
import org.fortiss.af3.platform.raspberry.model.lightrunner.Button;
import org.fortiss.af3.platform.raspberry.model.lightrunner.LCD;
import org.fortiss.af3.platform.raspberry.model.lightrunner.LED;
import org.fortiss.af3.platform.raspberry.model.lightrunner.Poti;
import org.fortiss.af3.platform.ui.editpart.generic.StickyPlatformConnectorUnitEditPart;
import org.fortiss.tooling.kernel.ui.extension.IEditPartFactory;
/** {@link IEditPartFactory} for the light runner boards. */
public class LightRunnerEditPartFactory implements IEditPartFactory {
/** {@inheritDoc} */
@Override
public EditPart createEditPart(EditPart context, Object model) {
if(model instanceof Button || model instanceof LCD || model instanceof LED ||
model instanceof Poti) {
return new StickyPlatformConnectorUnitEditPart((PlatformConnectorUnit)model);
}
return null;
}
}
/*-------------------------------------------------------------------------+
| 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.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.CanBus;
import org.fortiss.af3.platform.raspberry.model.CanConnector;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
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.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.ui.DefaultStyle;
import org.fortiss.af3.platform.ui.editpart.generic.ExecutionUnitEditPart;
import org.fortiss.af3.platform.ui.editpart.generic.StickyPlatformConnectorUnitEditPart;
import org.fortiss.af3.platform.ui.editpart.generic.TransmissionUnitDefaultEditPart;
import org.fortiss.tooling.kernel.ui.extension.IEditPartFactory;
/** {@link IEditPartFactory} for {@link RaspberryPi} model elements. */
public class RaspberryPiEditPartFactory implements IEditPartFactory {
/** {@inheritDoc} */
@Override
public EditPart createEditPart(EditPart context, Object model) {
if(model instanceof RaspberryPi) {
return new ExecutionUnitEditPart((RaspberryPi)model) {
/** {@inheritDoc} */
@Override
protected Color getBackgroundColor() {
return DefaultStyle.EU_BACKGROUND;
}
/** {@inheritDoc} */
@Override
protected Color getForegroundColor() {
return DefaultStyle.EU_FOREGROUND;
}
};
} else if(model instanceof CanBus) {
return new TransmissionUnitDefaultEditPart((CanBus)model);
} 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 GREEN
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
/*-------------------------------------------------------------------------+
| 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.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> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| 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.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 camera model elements. */
public class CameraInputHandler extends NamedCommentedModelElementHandlerBase<UIDUnit> {
/** {@inheritDoc} */
@Override
public final ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| 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.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.resource.ImageDescriptor;
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}es. */
@SuppressWarnings({"unchecked", "rawtypes"})
public class CanBusHandler extends ModelElementHandlerBase<CanBus> {
/** {@inheritDoc} */
@Override
public String getName(CanBus element) {
String name = element.getName();
return name != null ? name : "CanBus";
}
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/can-logo.jpeg");
}
/** {@inheritDoc} */
@Override
public List<EObject> getConnectors(CanBus element) {
return (List)element.getConnectors();
}
}
/*-------------------------------------------------------------------------+
| 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, |