Package de.dermoba.srcp.model.turnouts

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


        turnoutControl.setInterface6051Connected(Preferences.getInstance()
                .getBooleanValue(PreferencesKeys.INTERFACE_6051));
        //turnoutControl.setActivationTime(Preferences.getInstance().getIntValue(
        //        PreferencesKeys.ACTIVATION_TIME));
        for (Turnout turnout : persistence.getAllTurnouts()) {
            SRCPTurnout sTurnout = createSRCPTurnout(turnout);

            turnoutsSRCPTurnoutsMap.put(turnout, sTurnout);
            SRCPTurnoutsTurnoutsMap.put(sTurnout, turnout);

        }
View Full Code Here


        turnoutControl.update(SRCPTurnoutsTurnoutsMap.keySet());
        // turnoutControl.setSession(session)
    }

    SRCPTurnout createSRCPTurnout(Turnout turnout) {
        SRCPTurnout sTurnout = new MMTurnout();
        sTurnout.setBus1(turnout.getBus1());
        sTurnout.setBus2(turnout.getBus2());

        sTurnout.setAddress1(turnout.getAddress1());
        sTurnout.setAddress2(turnout.getAddress2());

        sTurnout.setAddress1Switched(turnout.isAddress1Switched());
        sTurnout.setAddress2Switched(turnout.isAddress2Switched());

        switch (turnout.getDefaultStateEnum()) {
        case STRAIGHT:
            sTurnout.setDefaultState(SRCPTurnoutState.STRAIGHT);
            break;
        case LEFT:
            sTurnout.setDefaultState(SRCPTurnoutState.LEFT);
            break;
        case RIGHT:
            sTurnout.setDefaultState(SRCPTurnoutState.RIGHT);
            break;
        case UNDEF:
            sTurnout.setDefaultState(SRCPTurnoutState.UNDEF);
            break;
        }

        switch (turnout.getTurnoutType().getTurnoutTypeEnum()) {
        case DEFAULT:
            sTurnout.setTurnoutType(SRCPTurnoutTypes.DEFAULT);
            break;
        case DOUBLECROSS:
            sTurnout.setTurnoutType(SRCPTurnoutTypes.DOUBLECROSS);
            break;
        case THREEWAY:
            sTurnout.setTurnoutType(SRCPTurnoutTypes.THREEWAY);
            break;
        }
        return sTurnout;
    }
View Full Code Here

        return sTurnout;
    }

    public void addTurnoutChangeListener(Turnout turnout,
            TurnoutChangeListener listener) {
        SRCPTurnout sTurnout = turnoutsSRCPTurnoutsMap.get(turnout);
        // if (listeners.get(sTurnout) == null) {
        // listeners.put(sTurnout, new ArrayList<TurnoutChangeListener>());
        // }
        // listeners.get(sTurnout).add(listener);
        listeners.add(listener);
View Full Code Here

        for (Route route : persistence.getAllRoutes()) {
            SRCPRoute sRoute = new SRCPRoute();
            for (RouteItem routeItem : route.getRouteItems()) {

                SRCPRouteItem sRouteItem = new SRCPRouteItem();
                SRCPTurnout sTurnout = turnoutControl.getSRCPTurnout(routeItem
                        .getTurnout());
                sRouteItem.setTurnout(sTurnout);
                if (routeItem.getRoutedState().toUpperCase().equals("LEFT")) {
                    sRouteItem.setRoutedState(SRCPTurnoutState.LEFT);
                } else if (routeItem.getRoutedState().toUpperCase()
View Full Code Here

TOP

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

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.