Started clean re-implementation of
- reserving route
- preparing route
- locking route
New implementation now properly handles stop event from user.
Next things to implement:
- tracing train upon contact activation, taking care of:
- causing contact
- train's last position
- route
- plan.freeBehindTrain
- finish event, keeping brake processor in mind
This commit is contained in:
@@ -81,12 +81,11 @@ public class ActionList extends Action implements Iterable<Action>{
|
||||
}
|
||||
|
||||
public boolean fire(Context context,Object cause) {
|
||||
if (context.invalidated()) {
|
||||
LOG.debug("Context has been invalidated, aborting {}",this);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Action action : actions) {
|
||||
if (context.invalidated()) {
|
||||
LOG.debug("Context has been invalidated, aborting {}",this);
|
||||
return false;
|
||||
}
|
||||
LOG.debug("firing \"{}\"",action);
|
||||
if (!action.fire(context,cause)) {
|
||||
LOG.warn("{} failed",action);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class CoupleTrain extends Action {
|
||||
if (isNull(train)) return false;
|
||||
Block block = train.currentBlock();
|
||||
if (isNull(block)) return false;
|
||||
Train parkingTrain = block.parkedTrain(last);
|
||||
Train parkingTrain = block.lastTrain();
|
||||
if (isNull(parkingTrain)) return false;
|
||||
train.coupleWith(parkingTrain,swap);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user