function printTrolleyPath()

in use-cases/order-picking/src/main/resources/META-INF/resources/app.js [419:444]


function printTrolleyPath(trolley, trolleyIndex, trolleyCount, writeText) {
    const trolleySteps = extractTrolleySteps(trolley);
    const trolleyPath = [];
    const trolleyLocation = trolley.location;

    trolleyPath.push(new WarehouseLocation(trolleyLocation.shelvingId, trolleyLocation.side, trolleyLocation.row));
    for (const trolleyStep of trolleySteps) {
        const location = trolleyStep.location;
        trolleyPath.push(new WarehouseLocation(location.shelvingId, location.side, location.row));
    }
    trolleyPath.push(new WarehouseLocation(trolleyLocation.shelvingId, trolleyLocation.side, trolleyLocation.row));
    TROLLEY_PATHS.set(trolley.id, trolleyPath);

    const color = trolleyColor(trolley.id);
    let trolleyCheckboxEnabled = false;
    if (trolleyPath.length > 2) {
        if (writeText) {
            drawTrolleyText(color, trolleyPath, trolleyIndex, trolleyCount);
        } else {
            drawTrolleyPath(color, trolleyPath, trolleyIndex, trolleyCount);
            trolleyCheckboxEnabled = true;
            const travelDistance = TROLLEY_TRAVEL_DISTANCE.get(trolley.id);
            printTrolleyCheckbox(trolley, trolleySteps.length, travelDistance, color, trolleyCheckboxEnabled);
        }
    }
}