Search in sources :

Example 6 with LayoutBlock

use of jmri.jmrit.display.layoutEditor.LayoutBlock in project JMRI by JMRI.

the class DestinationPoints method activeBean.

synchronized void activeBean(boolean reverseDirection, boolean showMessage) {
    if (activeEntryExit) {
        // log.debug(mUserName + "  Our route is active so this would go for a clear down but we need to check that the we can clear it down" + activeEndPoint);
        if (!isEnabled()) {
            log.debug("A disabled entry exit has been called will bomb out");
            return;
        }
        log.debug(mUserName + "  We have a valid match on our end point so we can clear down");
        //setRouteTo(false);
        //src.pd.setRouteFrom(false);
        setRoute(false);
    } else {
        if (isRouteToPointSet()) {
            log.debug(mUserName + "  route to this point is set therefore can not set another to it ");
            if (showMessage && !manager.isRouteStacked(this, false)) {
                handleNoCurrentRoute(reverseDirection, "Route already set to the destination point");
            }
            src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
            point.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
            return;
        } else {
            LayoutBlock startlBlock = src.getStart();
            class BestPath {

                LayoutBlock srcProtecting = null;

                LayoutBlock srcStart = null;

                LayoutBlock destination = null;

                BestPath(LayoutBlock startPro, LayoutBlock sourceProtecting, LayoutBlock destinationBlock, ArrayList<LayoutBlock> blocks) {
                    srcStart = startPro;
                    srcProtecting = sourceProtecting;
                    destination = destinationBlock;
                    listOfBlocks = blocks;
                }

                LayoutBlock getStartBlock() {
                    return srcStart;
                }

                LayoutBlock getProtectingBlock() {
                    return srcProtecting;
                }

                LayoutBlock getDestinationBlock() {
                    return destination;
                }

                ArrayList<LayoutBlock> listOfBlocks = new ArrayList<LayoutBlock>(0);

                String errorMessage = "";

                ArrayList<LayoutBlock> getListOfBlocks() {
                    return listOfBlocks;
                }

                void setErrorMessage(String msg) {
                    errorMessage = msg;
                }

                String getErrorMessage() {
                    return errorMessage;
                }
            }
            ArrayList<BestPath> pathList = new ArrayList<BestPath>(2);
            LayoutBlock protectLBlock;
            LayoutBlock destinationLBlock;
            //Need to work out around here the best one.
            for (LayoutBlock srcProLBlock : src.getSourceProtecting()) {
                protectLBlock = srcProLBlock;
                if (!reverseDirection) {
                    //We have a problem, the destination point is already setup with a route, therefore we would need to 
                    //check some how that a route hasn't been set to it.
                    destinationLBlock = getFacing();
                    ArrayList<LayoutBlock> blocks = new ArrayList<LayoutBlock>();
                    String errorMessage = null;
                    try {
                        blocks = InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().getLayoutBlocks(startlBlock, destinationLBlock, protectLBlock, false, 0x00);
                    } catch (Exception e) {
                        errorMessage = e.getMessage();
                    //can be considered normal if no free route is found
                    }
                    BestPath toadd = new BestPath(startlBlock, protectLBlock, destinationLBlock, blocks);
                    toadd.setErrorMessage(errorMessage);
                    pathList.add(toadd);
                } else {
                    startlBlock = srcProLBlock;
                    protectLBlock = getFacing();
                    destinationLBlock = src.getStart();
                    if (log.isDebugEnabled()) {
                        log.debug("reverse set destination is set going for " + startlBlock.getDisplayName() + " " + destinationLBlock.getDisplayName() + " " + protectLBlock.getDisplayName());
                    }
                    try {
                        //Don't care what block the facing is protecting
                        LayoutBlock srcPro = src.getSourceProtecting().get(0);
                        //Need to add a check for the lengths of the returned lists, then choose the most appropriate
                        if (!InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().checkValidDest(startlBlock, protectLBlock, srcPro, src.getStart(), LayoutBlockConnectivityTools.SENSORTOSENSOR)) {
                            startlBlock = getFacing();
                            protectLBlock = srcProLBlock;
                            if (log.isDebugEnabled()) {
                                log.debug("That didn't work so try  " + startlBlock.getDisplayName() + " " + destinationLBlock.getDisplayName() + " " + protectLBlock.getDisplayName());
                            }
                            if (!InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().checkValidDest(startlBlock, protectLBlock, srcPro, src.getStart(), LayoutBlockConnectivityTools.SENSORTOSENSOR)) {
                                log.error("No route found");
                                JOptionPane.showMessageDialog(null, "No Valid path found");
                                src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                                point.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                                return;
                            } else {
                                ArrayList<LayoutBlock> blocks = new ArrayList<LayoutBlock>();
                                String errorMessage = null;
                                try {
                                    blocks = InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().getLayoutBlocks(startlBlock, destinationLBlock, protectLBlock, false, 0x00);
                                } catch (Exception e) {
                                    errorMessage = e.getMessage();
                                //can be considered normal if no free route is found
                                }
                                BestPath toadd = new BestPath(startlBlock, protectLBlock, destinationLBlock, blocks);
                                toadd.setErrorMessage(errorMessage);
                                pathList.add(toadd);
                            }
                        } else if (InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().checkValidDest(getFacing(), srcProLBlock, srcPro, src.getStart(), LayoutBlockConnectivityTools.SENSORTOSENSOR)) {
                            //Both paths are valid, so will go for setting the shortest
                            int distance = startlBlock.getBlockHopCount(destinationLBlock.getBlock(), protectLBlock.getBlock());
                            int distance2 = getFacing().getBlockHopCount(destinationLBlock.getBlock(), srcProLBlock.getBlock());
                            if (distance > distance2) {
                                //The alternative route is shorter we shall use that
                                startlBlock = getFacing();
                                protectLBlock = srcProLBlock;
                            }
                            ArrayList<LayoutBlock> blocks = new ArrayList<LayoutBlock>();
                            String errorMessage = "";
                            try {
                                blocks = InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().getLayoutBlocks(startlBlock, destinationLBlock, protectLBlock, false, jmri.jmrit.display.layoutEditor.LayoutBlockConnectivityTools.NONE);
                            } catch (Exception e) {
                                //can be considered normal if no free route is found
                                errorMessage = e.getMessage();
                            }
                            BestPath toadd = new BestPath(startlBlock, protectLBlock, destinationLBlock, blocks);
                            toadd.setErrorMessage(errorMessage);
                            pathList.add(toadd);
                        } else {
                            ArrayList<LayoutBlock> blocks = new ArrayList<LayoutBlock>();
                            String errorMessage = "";
                            try {
                                blocks = InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlockConnectivityTools().getLayoutBlocks(startlBlock, destinationLBlock, protectLBlock, false, jmri.jmrit.display.layoutEditor.LayoutBlockConnectivityTools.NONE);
                            } catch (Exception e) {
                                //can be considered normal if no free route is found
                                errorMessage = e.getMessage();
                            }
                            BestPath toadd = new BestPath(startlBlock, protectLBlock, destinationLBlock, blocks);
                            toadd.setErrorMessage(errorMessage);
                            pathList.add(toadd);
                        }
                    } catch (jmri.JmriException ex) {
                        log.error("Exception " + ex.getMessage());
                        if (showMessage) {
                            JOptionPane.showMessageDialog(null, ex.getMessage());
                        }
                        src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                        point.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                        return;
                    }
                }
            }
            if (pathList.isEmpty()) {
                log.debug("Path list empty so exiting");
                return;
            }
            BestPath pathToUse = null;
            if (pathList.size() == 1) {
                if (!pathList.get(0).getListOfBlocks().isEmpty()) {
                    pathToUse = pathList.get(0);
                }
            } else {
                /*Need to filter out the remaining routes, in theory this should only ever be two.
                     We simply pick at this stage the one with the least number of blocks as being preferred.
                     This could be expanded at some stage to look at either the length or the metric*/
                int noOfBlocks = 0;
                for (BestPath bp : pathList) {
                    if (!bp.getListOfBlocks().isEmpty()) {
                        if (noOfBlocks == 0 || bp.getListOfBlocks().size() < noOfBlocks) {
                            noOfBlocks = bp.getListOfBlocks().size();
                            pathToUse = bp;
                        }
                    }
                }
            }
            if (pathToUse == null) {
                //No valid paths found so will quit
                if (pathList.get(0).getListOfBlocks().isEmpty()) {
                    if (showMessage) {
                        log.error(mUserName + " " + pathList.get(0).getErrorMessage());
                        //Considered normal if not a valid through path
                        handleNoCurrentRoute(reverseDirection, pathList.get(0).getErrorMessage());
                        src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                        point.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
                    }
                    return;
                }
                pathToUse = pathList.get(0);
            }
            startlBlock = pathToUse.getStartBlock();
            protectLBlock = pathToUse.getProtectingBlock();
            destinationLBlock = pathToUse.getDestinationBlock();
            routeDetails = pathToUse.getListOfBlocks();
            if (log.isDebugEnabled()) {
                log.debug("Path chossen " + startlBlock.getDisplayName() + " " + destinationLBlock.getDisplayName() + " " + protectLBlock.getDisplayName());
            }
            synchronized (this) {
                destination = destinationLBlock;
            }
            if (log.isDebugEnabled()) {
                for (LayoutBlock blk : routeDetails) {
                    log.debug(blk.getDisplayName());
                }
            }
            if (getEntryExitType() == EntryExitPairs.FULLINTERLOCK) {
                setActiveEntryExit(true);
            }
            setRoute(true);
        }
    }
}
Also used : JmriException(jmri.JmriException) ArrayList(java.util.ArrayList) JmriException(jmri.JmriException) LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock)

Example 7 with LayoutBlock

use of jmri.jmrit.display.layoutEditor.LayoutBlock in project JMRI by JMRI.

the class DestinationPoints method cancelClearInterlock.

void cancelClearInterlock(int cancelClear) {
    if ((cancelClear == EntryExitPairs.EXITROUTE) || (cancelClear == EntryExitPairs.STACKROUTE)) {
        src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
        point.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
        src.getPoint().getPanel().getGlassPane().setVisible(false);
        if (cancelClear == EntryExitPairs.STACKROUTE) {
            manager.stackNXRoute(this, false);
        }
        return;
    }
    if (cancelClear == EntryExitPairs.CANCELROUTE) {
        if (manager.getDispatcherIntegration() && jmri.InstanceManager.getNullableDefault(jmri.jmrit.dispatcher.DispatcherFrame.class) != null) {
            jmri.jmrit.dispatcher.DispatcherFrame df = jmri.InstanceManager.getDefault(jmri.jmrit.dispatcher.DispatcherFrame.class);
            ActiveTrain at = null;
            for (ActiveTrain atl : df.getActiveTrainsList()) {
                if (atl.getEndBlock() == point.getFacing().getBlock()) {
                    if (atl.getLastAllocatedSection() == atl.getEndBlockSection()) {
                        at = atl;
                        break;
                    }
                }
            }
            if (at != null) {
                jmri.Section sec = null;
                synchronized (this) {
                    if (sml != null && sml.getAssociatedSection((SignalMast) getSignal()) != null) {
                        sec = sml.getAssociatedSection((SignalMast) getSignal());
                    } else {
                        sec = InstanceManager.getDefault(jmri.SectionManager.class).getSection(src.getPoint().getDisplayName() + ":" + point.getDisplayName());
                    }
                }
                if (sec != null) {
                    if (!df.removeFromActiveTrainPath(sec, at, src.getPoint().getPanel())) {
                        log.error("Unable to remove allocation from dispathcer, leave interlock in place");
                        src.pd.cancelNXButtonTimeOut();
                        point.cancelNXButtonTimeOut();
                        src.getPoint().getPanel().getGlassPane().setVisible(false);
                        return;
                    }
                    if (sec.getSectionType() == jmri.Section.DYNAMICADHOC) {
                        sec.removeAllBlocksFromSection();
                    }
                }
            }
        }
    }
    src.setMenuEnabled(false);
    if (src.sourceSignal instanceof SignalMast) {
        SignalMast mast = (SignalMast) src.sourceSignal;
        mast.setAspect(mast.getAppearanceMap().getSpecificAppearance(jmri.SignalAppearanceMap.DANGER));
        mast.setHeld(true);
    } else if (src.sourceSignal instanceof SignalHead) {
        SignalHead head = (SignalHead) src.sourceSignal;
        head.setHeld(true);
    } else {
        log.debug("No signal found");
    }
    //Get rid of the signal mast logic to the destination mast.
    synchronized (this) {
        if ((getSignal() instanceof SignalMast) && (sml != null)) {
            SignalMast mast = (SignalMast) getSignal();
            if (sml.getStoreState(mast) == jmri.SignalMastLogic.STORENONE) {
                sml.removeDestination(mast);
            }
        }
        sml = null;
    }
    if (routeDetails == null) {
        return;
    }
    for (LayoutBlock blk : routeDetails) {
        if ((getEntryExitType() == EntryExitPairs.FULLINTERLOCK)) {
            blk.setUseExtraColor(false);
        }
        // was set against occupancy sensor
        blk.getBlock().removePropertyChangeListener(propertyBlockListener);
    }
    if (cancelClear == EntryExitPairs.CLEARROUTE) {
        if (routeDetails.size() == 0) {
            if (log.isDebugEnabled()) {
                log.debug(mUserName + "  all blocks have automatically been cleared down");
            }
        } else {
            if (log.isDebugEnabled()) {
                log.debug(mUserName + "  No blocks were cleared down " + routeDetails.size());
            }
            try {
                if (log.isDebugEnabled()) {
                    log.debug(mUserName + "  set first block as active so that we can manually clear this down " + routeDetails.get(0).getBlock().getUserName());
                }
                if (routeDetails.get(0).getOccupancySensor() != null) {
                    routeDetails.get(0).getOccupancySensor().setState(Sensor.ACTIVE);
                } else {
                    routeDetails.get(0).getBlock().goingActive();
                }
                if (src.getStart().getOccupancySensor() != null) {
                    src.getStart().getOccupancySensor().setState(Sensor.INACTIVE);
                } else {
                    src.getStart().getBlock().goingInactive();
                }
            } catch (java.lang.NullPointerException e) {
                log.error("error in clear route A " + e);
            } catch (JmriException e) {
                log.error("error in clear route A " + e);
            }
            if (log.isDebugEnabled()) {
                log.debug(mUserName + "  Going to clear routeDetails down " + routeDetails.size());
                for (int i = 0; i < routeDetails.size(); i++) {
                    log.debug("Block at " + i + " " + routeDetails.get(i).getDisplayName());
                }
            }
            if (routeDetails.size() > 1) {
                //Should we just be usrc.pdating the block status and not the sensor
                for (int i = 1; i < routeDetails.size() - 1; i++) {
                    if (log.isDebugEnabled()) {
                        log.debug(mUserName + " in loop Set active " + routeDetails.get(i).getDisplayName() + " " + routeDetails.get(i).getBlock().getSystemName());
                    }
                    try {
                        if (routeDetails.get(i).getOccupancySensor() != null) {
                            routeDetails.get(i).getOccupancySensor().setState(Sensor.ACTIVE);
                        } else {
                            routeDetails.get(i).getBlock().goingActive();
                        }
                        if (log.isDebugEnabled()) {
                            log.debug(mUserName + " in loop Set inactive " + routeDetails.get(i - 1).getDisplayName() + " " + routeDetails.get(i - 1).getBlock().getSystemName());
                        }
                        if (routeDetails.get(i - 1).getOccupancySensor() != null) {
                            routeDetails.get(i - 1).getOccupancySensor().setState(Sensor.INACTIVE);
                        } else {
                            routeDetails.get(i - 1).getBlock().goingInactive();
                        }
                    } catch (java.lang.NullPointerException e) {
                        log.error("error in clear route b " + e);
                        e.printStackTrace();
                    } catch (JmriException e) {
                        log.error("error in clear route b " + e);
                    }
                }
                try {
                    if (log.isDebugEnabled()) {
                        log.debug(mUserName + " out of loop Set active " + routeDetails.get(routeDetails.size() - 1).getDisplayName() + " " + routeDetails.get(routeDetails.size() - 1).getBlock().getSystemName());
                    }
                    //Get the last block an set it active.
                    if (routeDetails.get(routeDetails.size() - 1).getOccupancySensor() != null) {
                        routeDetails.get(routeDetails.size() - 1).getOccupancySensor().setState(Sensor.ACTIVE);
                    } else {
                        routeDetails.get(routeDetails.size() - 1).getBlock().goingActive();
                    }
                    if (log.isDebugEnabled()) {
                        log.debug(mUserName + " out of loop Set inactive " + routeDetails.get(routeDetails.size() - 2).getUserName() + " " + routeDetails.get(routeDetails.size() - 2).getBlock().getSystemName());
                    }
                    if (routeDetails.get(routeDetails.size() - 2).getOccupancySensor() != null) {
                        routeDetails.get(routeDetails.size() - 2).getOccupancySensor().setState(Sensor.INACTIVE);
                    } else {
                        routeDetails.get(routeDetails.size() - 2).getBlock().goingInactive();
                    }
                } catch (java.lang.NullPointerException e) {
                    log.error("error in clear route c " + e);
                } catch (java.lang.ArrayIndexOutOfBoundsException e) {
                    log.error("error in clear route c " + e);
                } catch (JmriException e) {
                    log.error("error in clear route c " + e);
                }
            }
        }
    }
    setActiveEntryExit(false);
    setRouteFrom(false);
    setRouteTo(false);
    routeDetails = null;
    synchronized (this) {
        lastSeenActiveBlockObject = null;
    }
    src.pd.cancelNXButtonTimeOut();
    point.cancelNXButtonTimeOut();
    src.getPoint().getPanel().getGlassPane().setVisible(false);
}
Also used : ActiveTrain(jmri.jmrit.dispatcher.ActiveTrain) SignalHead(jmri.SignalHead) JmriException(jmri.JmriException) LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock) SignalMast(jmri.SignalMast)

Example 8 with LayoutBlock

use of jmri.jmrit.display.layoutEditor.LayoutBlock in project JMRI by JMRI.

the class DestinationPoints method blockStateUpdated.

protected void blockStateUpdated(PropertyChangeEvent e) {
    Block blk = (Block) e.getSource();
    if (e.getPropertyName().equals("state")) {
        if (log.isDebugEnabled()) {
            log.debug(mUserName + "  We have a change of state on the block " + blk.getDisplayName());
        }
        int now = ((Integer) e.getNewValue()).intValue();
        if (now == Block.OCCUPIED) {
            LayoutBlock lBlock = InstanceManager.getDefault(jmri.jmrit.display.layoutEditor.LayoutBlockManager.class).getLayoutBlock(blk);
            //If the block was previously active or inactive then we will 
            //reset the useExtraColor, but not if it was previously unknown or inconsistent.
            lBlock.setUseExtraColor(false);
            //was this
            blk.removePropertyChangeListener(propertyBlockListener);
            removeBlockFromRoute(lBlock);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("state was " + now + " and did not go through reset");
            }
        }
    }
}
Also used : LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock) Block(jmri.Block) LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock)

Example 9 with LayoutBlock

use of jmri.jmrit.display.layoutEditor.LayoutBlock in project JMRI by JMRI.

the class DestinationPoints method removeBlockFromRoute.

synchronized void removeBlockFromRoute(LayoutBlock lBlock) {
    if (routeDetails != null) {
        if (routeDetails.indexOf(lBlock) == -1) {
            if (src.getStart() == lBlock) {
                log.debug("Start block went active");
                lastSeenActiveBlockObject = src.getStart().getBlock().getValue();
                lBlock.getBlock().removePropertyChangeListener(propertyBlockListener);
                return;
            } else {
                log.error("Block " + lBlock.getDisplayName() + " went active but it is not part of our NX path");
            }
        }
        if (routeDetails.indexOf(lBlock) != 0) {
            log.debug("A block has been skipped will set the value of the active block to that of the original one");
            lBlock.getBlock().setValue(lastSeenActiveBlockObject);
            if (routeDetails.indexOf(lBlock) != -1) {
                while (routeDetails.indexOf(lBlock) != 0) {
                    LayoutBlock tbr = routeDetails.get(0);
                    log.debug("Block skipped " + tbr.getDisplayName() + " and removed from list");
                    tbr.getBlock().removePropertyChangeListener(propertyBlockListener);
                    tbr.setUseExtraColor(false);
                    routeDetails.remove(0);
                }
            }
        }
        if (routeDetails.contains(lBlock)) {
            routeDetails.remove(lBlock);
            setRouteFrom(false);
            src.pd.setNXButtonState(EntryExitPairs.NXBUTTONINACTIVE);
            if (sml != null && getEntryExitType() == EntryExitPairs.FULLINTERLOCK) {
                sml.getSourceMast().setHeld(true);
                SignalMast mast = (SignalMast) getSignal();
                if (sml.getStoreState(mast) == jmri.SignalMastLogic.STORENONE) {
                    sml.removeDestination(mast);
                }
            }
        } else {
            log.error("Block " + lBlock.getDisplayName() + " that went Occupied was not in the routeDetails list");
        }
        if (log.isDebugEnabled()) {
            log.debug("Route details contents " + routeDetails);
            for (int i = 0; i < routeDetails.size(); i++) {
                log.debug("      " + routeDetails.get(i).getDisplayName());
            }
        }
        if ((routeDetails.size() == 1) && (routeDetails.contains(destination))) {
            // was set against block sensor
            routeDetails.get(0).getBlock().removePropertyChangeListener(propertyBlockListener);
            routeDetails.remove(destination);
        }
    }
    lastSeenActiveBlockObject = lBlock.getBlock().getValue();
    if ((routeDetails == null) || (routeDetails.size() == 0)) {
        //At this point the route has cleared down/the last remaining block are now active.
        routeDetails = null;
        setRouteTo(false);
        setRouteFrom(false);
        setActiveEntryExit(false);
        lastSeenActiveBlockObject = null;
    }
}
Also used : LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock) SignalMast(jmri.SignalMast)

Example 10 with LayoutBlock

use of jmri.jmrit.display.layoutEditor.LayoutBlock in project JMRI by JMRI.

the class ManuallySetRoute method findDestPoint.

boolean findDestPoint(LayoutBlock pro, LayoutBlock facing) {
    depth++;
    if (//This is to prevent a loop, only look as far as 50 blocks
    depth > 50) {
        return false;
    }
    boolean looking = true;
    if (pro.getNumberOfThroughPaths() == 0) {
        destLoc = lbm.getSensorAtEndBumper(pro.getBlock(), sourcePoint.getPanel());
    } else {
        while (looking) {
            Block found = cycle(pro, facing);
            if (found != null) {
                destLoc = lbm.getFacingBean(pro.getBlock(), found, sourcePoint.getPanel(), jmri.Sensor.class);
                if (destLoc != null) {
                    looking = false;
                } else {
                    findDestPoint(lbm.getLayoutBlock(found), pro);
                    looking = false;
                }
            } else {
                looking = false;
            }
        }
    }
    if (destLoc != null) {
        return true;
    }
    return false;
}
Also used : LayoutBlock(jmri.jmrit.display.layoutEditor.LayoutBlock) Block(jmri.Block)

Aggregations

LayoutBlock (jmri.jmrit.display.layoutEditor.LayoutBlock)20 LayoutBlockManager (jmri.jmrit.display.layoutEditor.LayoutBlockManager)11 PositionablePoint (jmri.jmrit.display.layoutEditor.PositionablePoint)7 TrackNode (jmri.jmrit.display.layoutEditor.TrackNode)5 TrackSegment (jmri.jmrit.display.layoutEditor.TrackSegment)4 Block (jmri.Block)3 JmriException (jmri.JmriException)3 SignalMast (jmri.SignalMast)3 Element (org.jdom2.Element)3 Color (java.awt.Color)2 ArrayList (java.util.ArrayList)2 SignalHead (jmri.SignalHead)2 ActiveTrain (jmri.jmrit.dispatcher.ActiveTrain)2 ConnectivityUtil (jmri.jmrit.display.layoutEditor.ConnectivityUtil)2 LayoutSlip (jmri.jmrit.display.layoutEditor.LayoutSlip)2 LayoutTurnout (jmri.jmrit.display.layoutEditor.LayoutTurnout)2 PointDetails (jmri.jmrit.signalling.entryexit.PointDetails)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1