From 5f977e6774a35658c83ec56bbb9f3b5feb4bbfc2 Mon Sep 17 00:00:00 2001
From: pauls
" + "Arrivée : " + pickupTime.format(timeFormat) + "
" + - "Départ : " + pickupTime.plusSeconds((long) (shipment.getPickupServiceTime()/1000)).format(timeFormat); + "Départ : " + pickupTime.plusSeconds((long) (shipment.getPickupServiceTime() / 1000)).format(timeFormat); LocalTime deliveryTime = departureTime.plusSeconds((long) activityTime(route.tourActivities.get(0), shipment.getDeliveryLocation().getId())); int deliveryOrder = activityOrder(route.tourActivities.get(0), shipment.getDeliveryLocation().getId()); @@ -172,14 +172,14 @@ private void initMapView(RouteInfo route) { shipment.getDeliveryLocation().getCoordinate().getX() + ", " + shipment.getDeliveryLocation().getCoordinate().getY() + "
" + "Arrivée : " + deliveryTime.format(timeFormat) + "
" + - "Départ : " + deliveryTime.plusSeconds((long) (shipment.getDeliveryServiceTime()/1000)).format(timeFormat); + "Départ : " + deliveryTime.plusSeconds((long) (shipment.getDeliveryServiceTime() / 1000)).format(timeFormat); mapView.addMarker(from(shipment.getPickupLocation()), "Pickup", new PickupMarker(hex, pickupOrder), 1, pickupLabel, "pickup" + idMarker); mapView.addMarker(from(shipment.getDeliveryLocation()), "Delivery", new DeliveryMarker(hex, deliveryOrder), 1, deliveryLabel, "delivery" + idMarker); k++; } double lastRouteTime = 0.0; - for (Instruction instruction : route.instructionLists.get(route.instructionLists.size()-1)){ - lastRouteTime += instruction.getTime()/1000.0; + for (Instruction instruction : route.instructionLists.get(route.instructionLists.size() - 1)) { + lastRouteTime += instruction.getTime() / 1000.0; } TourActivity lastTourActivity = route.tourActivities.get(0).getActivities().get(route.tourActivities.get(0).getActivities().size() - 1); double timeAtLastPoint = lastTourActivity.getArrTime(); @@ -191,17 +191,18 @@ private void initMapView(RouteInfo route) { } } System.out.println(lastRouteTime); - String depotLabel = "Dépôt
Départ "+ - departureTime.format(timeFormat)+ - "
Arrivée "+ - departureTime.plusSeconds((long) timeAtLastPoint / 1000).plusSeconds((long) (lastDeliveryTime/1000)).plusSeconds((long) lastRouteTime).format(timeFormat); + String depotLabel = "Dépôt
Départ " + + departureTime.format(timeFormat) + + "
Arrivée " + + departureTime.plusSeconds((long) timeAtLastPoint / 1000).plusSeconds((long) (lastDeliveryTime / 1000)).plusSeconds((long) lastRouteTime).format(timeFormat); mapView.addMarker(from(vehicle.getStartLocation()), "Start/Arrival", new DepotMarker("#000000"), 1, depotLabel, "0"); } private void initRightPane() { rightPane = new VBox(); rightPane.getStyleClass().add("vbox"); - if (!buttonHandler) this.collapseRightPanelButton.addEventHandler(MouseEvent.MOUSE_RELEASED, collapseRightPanel()); + if (!buttonHandler) + this.collapseRightPanelButton.addEventHandler(MouseEvent.MOUSE_RELEASED, collapseRightPanel()); } private void initInstructionBlocPane() { @@ -451,19 +452,19 @@ private LatLong from(Location location) { return new LatLong(location.getCoordinate().getX(), location.getCoordinate().getY()); } - private double activityTime(TourActivities tourActivity, String id){ - for (TourActivity a : tourActivity.getActivities()){ - if (a.getLocation().getId().equals(id)){ - return a.getArrTime()/1000; + private double activityTime(TourActivities tourActivity, String id) { + for (TourActivity a : tourActivity.getActivities()) { + if (a.getLocation().getId().equals(id)) { + return a.getArrTime() / 1000; } } return 0.0; } - private int activityOrder(TourActivities tourActivity, String id){ + private int activityOrder(TourActivities tourActivity, String id) { int i = 1; - for (TourActivity a : tourActivity.getActivities()){ - if (a.getLocation().getId().equals(id)){ + for (TourActivity a : tourActivity.getActivities()) { + if (a.getLocation().getId().equals(id)) { return i; } i++; diff --git a/src/main/kotlin/com/insa/coliffimo/leaflet/markers/DeliveryMarker.kt b/src/main/kotlin/com/insa/coliffimo/leaflet/markers/DeliveryMarker.kt index 4d3d821..84c8ef7 100644 --- a/src/main/kotlin/com/insa/coliffimo/leaflet/markers/DeliveryMarker.kt +++ b/src/main/kotlin/com/insa/coliffimo/leaflet/markers/DeliveryMarker.kt @@ -1,6 +1,6 @@ package com.insa.coliffimo.leaflet.markers -class DeliveryMarker(color: String) : CustomMarker() { +class DeliveryMarker(color: String, positionNumber: Int) : CustomMarker() { override val iconName: String = divIcon( """ """.trimIndent() ) diff --git a/src/main/kotlin/com/insa/coliffimo/leaflet/markers/PickupMarker.kt b/src/main/kotlin/com/insa/coliffimo/leaflet/markers/PickupMarker.kt index 95cbc07..4a6c424 100644 --- a/src/main/kotlin/com/insa/coliffimo/leaflet/markers/PickupMarker.kt +++ b/src/main/kotlin/com/insa/coliffimo/leaflet/markers/PickupMarker.kt @@ -1,6 +1,6 @@ package com.insa.coliffimo.leaflet.markers -class PickupMarker(color: String) : CustomMarker() { +class PickupMarker(color: String, positionNumber: Int) : CustomMarker() { override val iconName: String = divIcon( """ """.trimIndent() )