Skip to content

Commit

Permalink
Some minor improvements to GUI and train builder
Browse files Browse the repository at this point in the history
  • Loading branch information
danielboudreau authored and danielboudreau committed Dec 15, 2020
1 parent 8cafcb6 commit 5ef7a16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion java/src/jmri/jmrit/operations/locations/Track.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,13 @@ public boolean isSpaceAvailable(Car car) {
carLength = car.getKernel().getTotalLength();
}
int trackLength = getLength();

// is the car or kernel too long for the track?
if (trackLength < carLength) {
if (trackLength < carLength && getPool() == null) {
return false;
}
// is track part of a pool?
if (getPool() != null && getPool().getTotalLengthTracks() < carLength) {
return false;
}
// ignore reservation factor unless car is departing staging
Expand Down
3 changes: 2 additions & 1 deletion java/src/jmri/jmrit/operations/trains/TrainEditFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,8 @@ public void propertyChange(java.beans.PropertyChangeEvent e) {
|| e.getPropertyName().equals(Location.NAME_CHANGED_PROPERTY)
|| e.getPropertyName().equals(Location.TRAINDIRECTION_CHANGED_PROPERTY)) {
updateLocationCheckboxes();
packFrame();
pack();
repaint();
}
if (e.getPropertyName().equals(CarRoads.CARROADS_CHANGED_PROPERTY)) {
updateRoadComboBoxes();
Expand Down

0 comments on commit 5ef7a16

Please sign in to comment.