Aufgrund einer Wartung wird GitLab am 18.01. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.01. between 8:00 and 9:00 am.

Commit 83a0c459 authored by Frederik's avatar Frederik
Browse files

created README and docs directory

parent 999bb38a
......@@ -106,11 +106,8 @@ public class EEVehicle {
public void executeLoopIteration(Instant time) {
if(time.isAfter(this.eeSimulator.getSimulationTime())) {
System.out.println("Notify sensors");
this.notifySensors(time);
System.out.println("SimulateNextTick");
this.eeSimulator.simulateNextTick(time);
System.out.println("Notify Actuator");
this.notifyActuator(time);
}
}
......
......@@ -88,9 +88,6 @@ public class EEVehicleBuilder {
try {
busStructure = loadFromFile(data);
for (ParsableBusStructureProperties.Tupel comp : busStructure.getActuators()) {
System.out.println("comp type: " + comp.eeComponent);
}
//create buses
for (ParsableBusStructureProperties.Tupel component : busStructure.getBuses()) {
if (component.eeComponent.equals("flexRay")) {
......@@ -109,47 +106,36 @@ public class EEVehicleBuilder {
//create sensors, actuator and bridges
for (ParsableBusStructureProperties.Tupel sensor : busStructure.getSensors()) {
try {
System.out.println("create sensor");
System.out.println(sensor.busIds[0]);
System.out.println(busList.get(sensor.busIds[0]));
Class<? extends AbstractSensor> sensorClass = (Class<? extends AbstractSensor>) Class.forName(sensor.eeComponent);
AbstractSensor newSensor = SensorFactory.createSensor(sensorClass, vehicle.getPhysicalVehicle(), busList.get(sensor.busIds[0])).get();
components.add(newSensor);
// busList.get(sensor.busIds[0]).registerComponent(newSensor);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Can not create EEVehicle. File contains non-existent sensor: " + sensor.eeComponent);
}
}
for (ParsableBusStructureProperties.Tupel actuator : busStructure.getActuators()) {
System.out.println("create actuator");
VehicleActuator newActuator = VehicleActuator.createVehicleActuator(VehicleActuatorType.valueOf(actuator.eeComponent), Double.parseDouble(actuator.parameter[0]), Double.parseDouble(actuator.parameter[1]), Double.parseDouble(actuator.parameter[2]), busList.get(actuator.busIds[0]));
components.add(newActuator);
// busList.get(actuator.busIds[0]).registerComponent(newActuator);
}
for (ParsableBusStructureProperties.Tupel bridge : busStructure.getBridges()) {
System.out.println("create bridge");
Bridge newBridge = new Bridge(Pair.of(busList.get((bridge.busIds[0])), busList.get(Integer.parseInt(bridge.parameter[0]))), Duration.ofMillis(Long.parseLong(bridge.parameter[1])));
components.add(newBridge);
}
if (busStructure.getNavigation() != null && busStructure.getNavigation().busIds != null) {
System.out.println("create navigation");
NavigationBlockAsEEComponent navigation;
navigation = NavigationBlockAsEEComponent.createNavigationBlockAsEEComponent(busList.get(busStructure.getNavigation().busIds[0]));
vehicle.initNavigation(navigation);
components.add(navigation);
// busList.get(busStructure.getNavigation().busIds[0]).registerComponent(navigation);
}
if (!busStructure.getController().isEmpty()) {
System.out.println("create controller");
for (ParsableBusStructureProperties.Tupel controller : busStructure.getController()) {
DirectModelAsEEComponent newController = DirectModelAsEEComponent.createDirectModelAsEEComponent(busList.get(controller.busIds[0]));
newController.setCycleTime(Duration.parse(controller.parameter[0]));
components.add(newController);
// busList.get(controller.busIds[0]).registerComponent(newController);
}
}
......@@ -158,12 +144,6 @@ public class EEVehicleBuilder {
throw new IllegalArgumentException("Can not create EEVehicle. Failed to read file: " + data);
}
for (EEComponent comp : components) {
System.out.println("comp type in list: " + comp.getComponentType());
if (comp.getComponentType() == EEComponentType.ACTUATOR) {
System.out.println("actuator comp type in list: " + ((VehicleActuator) comp).getActuatorType());
}
}
return new EEVehicle(vehicle, eeSimulator, new HashSet<>(busList), components);
}
......
......@@ -268,7 +268,6 @@ public class VehicleActuator extends ImmutableEEComponent {
*/
protected void update(Instant actualTime) {
this.updateValue(actualTime);
System.out.println(this.actuatorType + " send message: " + this.sendMsgId + "; with value: " + this.actuatorValueCurrent);
this.sendMessage(this.actuatorValueCurrent, 8, this.sendMsgId, actualTime);
}
......@@ -403,7 +402,6 @@ public class VehicleActuator extends ImmutableEEComponent {
//update actuator with old target
this.updateValue(event.getEventTime());
//send message
System.out.println(actuatorType.toString() + " received message: " + msg.getMessageID() + "; with value: " + msg.getMessage());
setActuatorValueTarget((double) msg.getMessage());
}
else{
......
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