Package jmri.jmrit.operations.trains
Class TrainBuilderCars
- java.lang.Object
-
- jmri.jmrit.operations.trains.TrainCommon
-
- jmri.jmrit.operations.trains.TrainBuilderBase
-
- jmri.jmrit.operations.trains.TrainBuilderEngines
-
- jmri.jmrit.operations.trains.TrainBuilderCars
-
- Direct Known Subclasses:
TrainBuilder
public class TrainBuilderCars extends TrainBuilderEngines
Contains methods for cars when building a train.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
_routeToTrackFound
-
Fields inherited from class jmri.jmrit.operations.trains.TrainBuilderBase
_buildReport, _carIndex, _carList, _completedMoves, _departLocation, _departStageTrack, _engineList, _lastEngine, _modifiedLocations, _notRoutable, _numberCars, _numOfBlocks, _reqNumOfMoves, _routeList, _secondLeadEngine, _startTime, _terminateLocation, _terminateStageTrack, _thirdLeadEngine, _train, _warnings, carLoads, DISPLAY_CAR_LIMIT_100, DISPLAY_CAR_LIMIT_20, DISPLAY_CAR_LIMIT_50, FIVE, ONE, router, routeToTrackFound, SEVEN, THREE, trainManager, trainScheduleManager, USE_BUNIT
-
Fields inherited from class jmri.jmrit.operations.trains.TrainCommon
_dropCars, _pickupCars, _printLocalMoveHeader, _printPickupHeader, _printSetoutHeader, BLANK_LINE, BUILD_REPORT_CHAR, carManager, doneCars, ENGINE, engineManager, HORIZONTAL_LINE_CHAR, HYPHEN, index, IS_MANIFEST, IS_TWO_COLUMN_TRACK, LOCAL, locationManager, NEW_LINE, PAPER_MARGINS, PICKUP, SPACE, TAB, TEXT_COLOR_DONE, TEXT_COLOR_END, TEXT_COLOR_START, utilityCarTypes, VERTICAL_LINE_CHAR
-
-
Constructor Summary
Constructors Constructor Description TrainBuilderCars()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
blockCarsFromStaging()
Optionally block cars departing staging.protected void
findDestinationsForCarsFromLocation(RouteLocation rl, boolean isSecondPass)
Attempts to find a destinations for cars departing a specific route location.protected void
getCaboose(java.lang.String roadCaboose, Engine leadEngine, RouteLocation rl, RouteLocation rld, boolean requiresCaboose)
Find a caboose if needed at the correct location and add it to the train.protected void
getCarWithFred(java.lang.String road, RouteLocation rl, RouteLocation rld)
Find a car with FRED if needed at the correct location and adds the car to the train.-
Methods inherited from class jmri.jmrit.operations.trains.TrainBuilderEngines
addEnginesToTrain, checkEngineHP, checkNumnberOfEnginesNeededHPT, getAndRemoveEnginesFromList
-
Methods inherited from class jmri.jmrit.operations.trains.TrainBuilderBase
addCarToTrain, addEnginesBasedHPT, adjustCarsInStaging, checkBasicMoves, checkDepartureStagingTrack, checkDropTrainDirection, checkDropTrainDirection, checkForEarlierDrop, checkForLaterPickUp, checkPickUpTrainDirection, checkPickUpTrainDirection, checkStuckCarsInStaging, checkTerminateStagingTrack, checkThroughCarsAllowed, checkTrainCanDrop, checkTrainLength, countRollingStockAt, createBuildReportFile, finishAddRsToTrain, generateLoadCarDepartingAndTerminatingIntoStaging, getCarList, getConsist, getEngines, getEngines, getLargestBlock, getLocationWithMaximumMoves, getNewEngine, getNumberEngines, getScheduleItem, getTracksAtDestination, isCarStuckStaging, makeAdjustmentsIfDepartingStaging, promptFromStagingDialog, promptToStagingDialog, redirectCarsFromAlternateTrack, removeCaboosesAndCarsWithFred, removeCarsFromStaging, removeEngineFromTrain, removeRollingStockFromTrain, restoreCarsIfDepartingStaging, saveCarFinalDestinations, setDepartureTrack, setEngineDestination, setUpRoute, showAndInitializeTrainRoute, showBuildReportInfo, showCarsByLocation, showCarServiceOrder, showCarsNotMoved, showCarsNotRoutable, showEnginesByLocation, showIfLocalSwitcher, showLoadGenerationOptionsStaging, showSpecificTrainBuildOptions, showTrainBuildOptions, showTrainCabooseRoads, showTrainCarRoads, showTrainCarTypes, showTrainLoadNames, showTrainRequirements, showTrainServices, sortCarsOnFifoLifoTracks, tryStaging
-
Methods inherited from class jmri.jmrit.operations.trains.TrainCommon
addCarsLocationUnknown, addLine, addLine, blockCarsByTrack, blockCarsByTrackNameTwoColumn, blockCarsTwoColumn, blockLocosTwoColumn, clearUtilityCarTypes, convertStringToDate, countPickupUtilityCars, countSetoutUtilityCars, countUtilityCars, createTabIfNeeded, dropCar, dropCar, dropEngine, dropEngines, formatColorString, formatStringToCommaSeparated, getDate, getDate, getDropCarHeader, getDropEngineHeader, getISO8601Date, getLineLength, getLocalMoveHeader, getManifestHeaderLineLength, getPageSize, getPickupCarHeader, getPickupEngineHeader, getTextColor, getTextColorName, getTextColorString, isNextCar, isNextCar, isThereWorkAtLocation, isThereWorkAtLocation, localMoveCar, newLine, newLine, padAndTruncate, padAndTruncateIfNeeded, padString, pickupCar, pickUpCar, pickUpCarTruncated, pickupEngine, pickupEngines, pickupUtilityCars, pickupUtilityCars, printCarHeader, printDropCarHeader, printDropEngineHeader, printEngineHeader, printHorizontalLine, printHorizontalLine, printLocalCarMoveHeader, printPickupCarHeader, printPickupEngineHeader, printTrackComments, printTrackNameHeader, setoutUtilityCars, setoutUtilityCars, setoutUtilityCars, splitString, tabString, truncatedDropCar
-
-
-
-
Field Detail
-
_routeToTrackFound
boolean _routeToTrackFound
-
-
Constructor Detail
-
TrainBuilderCars
public TrainBuilderCars()
-
-
Method Detail
-
getCaboose
protected void getCaboose(java.lang.String roadCaboose, Engine leadEngine, RouteLocation rl, RouteLocation rld, boolean requiresCaboose) throws BuildFailedException
Find a caboose if needed at the correct location and add it to the train. If departing staging, all cabooses are added to the train. If there isn't a road name required for the caboose, tries to find a caboose with the same road name as the lead engine.- Parameters:
roadCaboose
- Optional road name for this car.leadEngine
- The lead engine for this train. Used to find a caboose with the same road name as the engine.rl
- Where in the route to pick up this car.rld
- Where in the route to set out this car.requiresCaboose
- When true, the train requires a caboose.- Throws:
BuildFailedException
- If car not found.
-
getCarWithFred
protected void getCarWithFred(java.lang.String road, RouteLocation rl, RouteLocation rld) throws BuildFailedException
Find a car with FRED if needed at the correct location and adds the car to the train. If departing staging, will make sure all cars with FRED are added to the train.- Parameters:
road
- Optional road name for this car.rl
- Where in the route to pick up this car.rld
- Where in the route to set out this car.- Throws:
BuildFailedException
- If car not found.
-
blockCarsFromStaging
protected void blockCarsFromStaging() throws BuildFailedException
Optionally block cars departing staging. No guarantee that cars departing staging can be blocked by destination. By using the pick up location id, this routine tries to find destinations that are willing to accepts all of the cars that were "blocked" together when they were picked up. Rules: The route must allow set outs at the destination. The route must allow the correct number of set outs. The destination must accept all cars in the pick up block.- Throws:
BuildFailedException
- if blocking fails
-
findDestinationsForCarsFromLocation
protected void findDestinationsForCarsFromLocation(RouteLocation rl, boolean isSecondPass) throws BuildFailedException
Attempts to find a destinations for cars departing a specific route location.- Parameters:
rl
- The route location where cars need destinations.isSecondPass
- When true this is the second time we've looked at these cars. Used to perform local moves.- Throws:
BuildFailedException
- if failure
-
-