Package jmri.jmrit.operations.trains
Class TrainBuilderEngines
- java.lang.Object
-
- jmri.jmrit.operations.trains.TrainCommon
-
- jmri.jmrit.operations.trains.TrainBuilderBase
-
- jmri.jmrit.operations.trains.TrainBuilderEngines
-
- Direct Known Subclasses:
TrainBuilderCars
public class TrainBuilderEngines extends TrainBuilderBase
Contains methods for engines when building a train.
-
-
Field Summary
-
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 TrainBuilderEngines()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addEnginesToTrain()
Adds engines to the train starting at the first location in the train's route.protected void
checkEngineHP()
Checks to see if the engine or consist assigned to the train has the appropriate HP.protected void
checkNumnberOfEnginesNeededHPT()
Checks to see if additional engines are needed for the train based on the train's calculated tonnage.protected void
getAndRemoveEnginesFromList()
Builds a list of possible engines for this train.-
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
-
-
-
-
Constructor Detail
-
TrainBuilderEngines
public TrainBuilderEngines()
-
-
Method Detail
-
getAndRemoveEnginesFromList
protected void getAndRemoveEnginesFromList()
Builds a list of possible engines for this train.
-
addEnginesToTrain
protected void addEnginesToTrain() throws BuildFailedException
Adds engines to the train starting at the first location in the train's route. Note that engines from staging are already part of the train. There can be up to two engine swaps in a train's route.- Throws:
BuildFailedException
- if required engines can't be added to train.
-
checkEngineHP
protected void checkEngineHP() throws BuildFailedException
Checks to see if the engine or consist assigned to the train has the appropriate HP. If the train's HP requirements are significantly higher or lower than the engine that was assigned, the program will search for a more appropriate engine or consist, and assign that engine or consist to the train. The HP calculation is based on a minimum train speed of 36 MPH. The formula HPT x 12 / % Grade = Speed, is used to determine the horsepower required. Speed is fixed at 36 MPH. For example a 1% grade requires a minimum of 3 HPT. Disabled for trains departing staging.- Throws:
BuildFailedException
- if coding error.
-
checkNumnberOfEnginesNeededHPT
protected void checkNumnberOfEnginesNeededHPT() throws BuildFailedException
Checks to see if additional engines are needed for the train based on the train's calculated tonnage. Minimum speed for the train is fixed at 36 MPH. The formula HPT x 12 / % Grade = Speed, is used to determine the horsepower needed. For example a 1% grade requires a minimum of 3 HPT. Ignored when departing staging- Throws:
BuildFailedException
- if build failure
-
-