Package de.dermoba.srcp.model.turnouts

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


        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

TOP

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

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.