Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) The openTCS Authors.
*
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
*/
package org.opentcs.operationsdesk.exchange;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import jakarta.inject.Inject;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.opentcs.access.Kernel;
import org.opentcs.access.KernelRuntimeException;
import org.opentcs.access.SharedKernelServicePortal;
import org.opentcs.access.SharedKernelServicePortalProvider;
import org.opentcs.access.to.order.DestinationCreationTO;
import org.opentcs.access.to.order.TransportOrderCreationTO;
import org.opentcs.components.kernel.services.TransportOrderService;
import org.opentcs.data.model.Location;
import org.opentcs.data.model.Point;
import org.opentcs.data.order.DriveOrder;
import org.opentcs.data.order.TransportOrder;
import org.opentcs.guing.base.model.AbstractConnectableModelComponent;
import org.opentcs.guing.base.model.elements.LocationModel;
import org.opentcs.guing.base.model.elements.PointModel;
import org.opentcs.guing.base.model.elements.VehicleModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A helper class for creating transport orders with the kernel.
*/
public class TransportOrderUtil {
/**
* This class's logger.
*/
private static final Logger LOG = LoggerFactory.getLogger(TransportOrderUtil.class);
/**
* Provides access to a portal.
*/
private final SharedKernelServicePortalProvider portalProvider;
/**
* Creates a new instance.
*
* @param portalProvider Provides a access to a portal.
*/
@Inject
public TransportOrderUtil(SharedKernelServicePortalProvider portalProvider) {
this.portalProvider = requireNonNull(portalProvider, "portalProvider");
}
/**
* Creates a new transport order.
*
* @param destModels The locations or points to visit.
* @param actions The actions to execute.
* @param deadline The deadline.
* @param vModel The vehicle that shall execute this order. Pass null to let the
* kernel determine one.
* @param category The category.
*/
public void createTransportOrder(
List destModels,
List actions,
long deadline,
VehicleModel vModel,
String category
) {
createTransportOrder(destModels, actions, new ArrayList<>(), deadline, vModel, category);
}
/**
* Creates a new transport order.
*
* @param destModels The locations or points to visit.
* @param actions The actions to execute.
* @param propertiesList The properties for each destination.
* @param deadline The deadline.
* @param vModel The vehicle that shall execute this order. Pass null to let the
* kernel determine one.
* @param type The type.
*/
public void createTransportOrder(
List destModels,
List actions,
List