Commit 577901ab authored by Tiziano Munaro's avatar Tiziano Munaro

GREEN

Issue-Ref: 3867
Issue-Url: https://af3-developer.fortiss.org/issues/3867Signed-off-by: Tiziano Munaro's avatarTiziano Munaro <munaro@fortiss.org>
parent 93bdc29b
LightRunnerElementsHandler.java 6d7d65aeec9f75bcc35632d3d8af9b5b2c813ec6 GREEN
LightRunnerProtoypeProvider.java 105cf1de751c39921650c1e9a9e4307dc63d542f GREEN
ProtoypeProvider.java b523a903dc04d892dba166820fcc995e7ad743ae RED
ProtoypeProvider.java 32fafd4113a5b23b1de8857eec17fe3ec11a27b3 GREEN
......@@ -233,11 +233,7 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerV2VComElements();
}
// TODO (TM): Comment missing
// TODO (TM): See comment at registerGamepadElements
/**
*
*/
/** Register V2V communication elements. */
private void registerV2VComElements() {
V2VPlatoonInput input = RaspberryModelElementFactory.createV2vPlatoonInput();
setNodePosition(input, 0, 0);
......@@ -337,7 +333,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype("V2V Leader UID Output", output11, V2V_COM);
}
// TODO (TM): See comment at registerGamepadElements
/** Register elements for control center. */
private void registerControlCenterElements() {
ControlCenterDownstreamInput input = createControlCenterDownstreamInput();
......@@ -351,7 +346,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype("CC Output", output, CONTROL_CENTER);
}
// TODO (TM): See comment at registerGamepadElements
/** Register brick actuators and sensors. */
private void registerBrickElements() {
ActuatorDigits digits = createActuatorDigits();
......@@ -413,7 +407,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype(avZ.getName(), avZ, BRICK);
}
// TODO (TM): See comment at registerGamepadElements
/** Register rumblepad elements. */
private void registerRumblepadElements() {
org.fortiss.af3.platform.raspberry.model.rumblepad.Left_StickX_Position rplsx =
......@@ -426,7 +419,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerRumblepadButtons();
}
// TODO (TM): See comment at registerGamepadElements
/** Register rumblepad buttons. */
private void registerRumblepadButtons() {
org.fortiss.af3.platform.raspberry.model.rumblepad.ButtonL1 rpl1 = createRumbleButtonL1();
......@@ -495,7 +487,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype(rmw.getName(), rmw, RUMBLEPAD);
}
// TODO (TM): See comment at registerGamepadElements
/** Register rumblepad sticks and D-pad. */
private void registerRumblepadSticks() {
org.fortiss.af3.platform.raspberry.model.rumblepad.Left_StickY_Position rplsy =
......@@ -547,7 +538,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype(rpr3.getName(), rpr3, RUMBLEPAD);
}
// TODO (TM): See comment at registerGamepadElements
/** Register motor controller elements. */
private void registerMotorControlElements() {
MotorControlInput mci = createMotorControlInput();
......@@ -561,7 +551,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype(mco.getName(), mco, MOTOR_CONTROL);
}
// TODO (TM): See comment at registerGamepadElements
/** Register camera elements. */
private void registerCameraElements() {
CameraConnected cc = createCameraConnected();
......@@ -625,16 +614,6 @@ public class ProtoypeProvider extends PrototypeProviderBase {
registerPrototype(ccr.getName(), ccr, CAMERA_SERVER);
}
// TODO (TM): All of the following classes have a common superclass or interface. Use it to
// reduce the following method to a loop over a list of types:
// types = [Button1.class, ... ]
// for (type in types) {
// GamePadElementBase element = RaspberryPiModelElementFactory.createGamePadReceiver(types)
// setNodePosition(element, 0, 0);
// setConnectorPosition(element, 0, 0);
// setConnectorPosition(element, 0, 0);
// registerPrototype(element.getName(), element, GAMEPAD);
// }
/** Register gamepad elements. */
private void registerGamepadElements() {
Button1 button1 = createButton1();
......
CanBusCompositor.java b634ad94492dc168cde6a69dce61bee7a53f8e37 GREEN
CanToRaspberryCompositor.java 927a741f55da203b96939f8620c5c9ba5cd3f046 GREEN
RaspberryPiCompositor.java 5409d9af73a9b72bb34f156854fd4c39ee60b489 RED
RaspberryPiCompositor.java ce2ba52a85a88fcba11366a08f0b426a0e866ee2 RED
RaspberryToCanCompositor.java 7180ea9d371143bdc70ca75170a58d9162289b66 GREEN
......@@ -51,7 +51,6 @@ public class RaspberryPiCompositor
/** {@inheritDoc} */
@Override
// TODO (TM): Create a marker interface for all RPi-compatible connectors.
protected boolean isCorrectElementClass(IPlatformArchitectureElement container,
EObject contained) {
// TODO (TM): Is it OK to replace the distinct classes with the respective interfaces?
......
......@@ -2,7 +2,7 @@ CanBusGeneratorExtension.java 4bed3c88e71923515d7d9dc9235bc40a49ce237f GREEN
CanConnectorGeneratorExtension.java 5680017d9ef5ec7ac81ef7c035ba0a946d0f8b15 GREEN
CanTransmissionCatalog.java 0e5d45246d1c05d8391d540053df306c3e2a0b4d GREEN
ConsoleOutputGeneratorExtension.java 49509abbd2d6e2715c2f3af074d2e46a5c0a961e GREEN
MainGenerator.java 9421a58c972935bb6660a2ba0ac663d9a79c7907 GREEN
MainGenerator.java 02e1a33db2f114a2ee5962764b3917568881a277 GREEN
MultiUnitMainGenerator.java 11c78dc068c5446b3e6b92ca688549b065f95071 RED
PWMActuatorGeneratorExtension.java 0764332c723731ae0ab19f09f65dfe8c6a571bdb GREEN
RaspberryPIGeneratorExtension.java 33d100efb28c217042d32facbcb0ae0ac9173b36 GREEN
......
......@@ -47,6 +47,9 @@ import org.fortiss.tooling.kernel.model.INamedElement;
/** 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}. */
......@@ -147,9 +150,7 @@ public abstract class MainGenerator {
for(PlatformConnectorUnit pcu : platformConnector2ExecutableBase.keySet()) {
ExecutableBase<?> exec = platformConnector2ExecutableBase.get(pcu);
if(!configurableInitDone && exec instanceof IConfigurableExtension) {
// TODO (TM): Store the path of the configuration file in a constant so that it is
// easy to spot.
sb.append("conf_init(\"/home/pi/config.xml\");\n");
sb.append("conf_init(\"" + CONFIG_PATH + "\");\n");
configurableInitDone = true;
}
if(exec instanceof ISingletonGeneratorExtension) {
......
RaspberryModelElementFactory.java a5a1b9a5bcdf4aef9484aff6f81a116d7d379abe GREEN
RaspberryModelElementFactory.java aebdb948c6bd983444afe9a7af17b69552ddc900 GREEN
......@@ -110,6 +110,10 @@ import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
/** Model Element for {@link RaspberryPi} and related model elements. */
public class RaspberryModelElementFactory {
/** Default IP address of a RaspberryPi. */
private final static String RPI_IP_ADDRESS = "192.168.21.241";
/** Creates a {@link RaspberryPi}. */
public static RaspberryPi createRaspberryPi() {
final RaspberryPi pi = RaspberryPiModelFactory.eINSTANCE.createRaspberryPi();
......@@ -117,7 +121,7 @@ public class RaspberryModelElementFactory {
pi.setName("RaspberryPI");
pi.setCanCoordinationID(255);
pi.setCycleTime(100);
pi.setIpAddress("192.168.21.241");
pi.setIpAddress(RPI_IP_ADDRESS);
pi.setCoordinatorUnit(false);
return pi;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment