Package de.dermoba.srcp.model.turnouts

Examples of de.dermoba.srcp.model.turnouts.SRCPTurnoutControl


    }

    private void disableRoute() throws SRCPTurnoutException,
            SRCPModelException, InterruptedException {
        List<SRCPRouteItem> routeItems = sRoute.getRouteItems();
        SRCPTurnoutControl sc = SRCPTurnoutControl.getInstance();
        for (SRCPRouteItem ri : routeItems) {
            SRCPTurnout turnoutToRoute = ri.getTurnout();

            sc.setDefaultState(turnoutToRoute);

            Thread.sleep(waitTime);
        }
        sRoute.setRouteState(SRCPRouteState.DISABLED);
        for (SRCPRouteChangeListener l : listener) {
View Full Code Here


    }

    private void enableRoute() throws SRCPTurnoutException, SRCPModelException,
            InterruptedException {
        List<SRCPRouteItem> routeItems = sRoute.getRouteItems();
        SRCPTurnoutControl sc = SRCPTurnoutControl.getInstance();
        for (SRCPRouteItem ri : routeItems) {
            SRCPTurnout turnoutToRoute = ri.getTurnout();
            switch (ri.getRoutedState()) {
            case STRAIGHT:
                sc.setStraight(turnoutToRoute);
                break;
            case LEFT:
                sc.setCurvedLeft(turnoutToRoute);
                break;
            case RIGHT:
                sc.setCurvedRight(turnoutToRoute);
                break;
            }
            Thread.sleep(waitTime);
        }
        sRoute.setRouteState(SRCPRouteState.ENABLED);
View Full Code Here

    public void run() {
        try {
            sRoute.setRouteState(SRCPRouteState.ROUTING);

            SRCPTurnoutControl sc = SRCPTurnoutControl.getInstance();
            sc.addTurnoutChangeListener(this);
            if (enableRoute) {
                enableRoute();
            } else {
                disableRoute();
            }
            sc.removeTurnoutChangeListener(this);
        } catch (SRCPModelException e) {
            this.switchException = e;
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of de.dermoba.srcp.model.turnouts.SRCPTurnoutControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.