Examples of SRCPAddress


Examples of de.dermoba.srcp.model.SRCPAddress

    public void LOCKset(double timestamp, int bus, int address,
            String deviceGroup, int duration, int sessionID) {
        logger.debug("LOCKset( " + bus + " , " + address + " , " + deviceGroup
                + " , " + duration + " , " + sessionID + " )");
        SRCPAddress addr = new SRCPAddress(bus, address);

        Object object = addressToControlObject.get(deviceGroup).get(addr);
        if (object != null) {
            SRCPLock sLock = locks.get(object);
            sLock.setLocked(true);
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

    public void LOCKterm(double timestamp, int bus, int address,
            String deviceGroup) {
        logger.debug("LOCKterm( " + bus + " , " + address + " , " + deviceGroup
                + " )");
        SRCPAddress addr = new SRCPAddress(bus, address);

        Object object = addressToControlObject.get(deviceGroup).get(addr);
        if (object != null) {
            SRCPLock sLock = locks.get(object);
            sLock.setLocked(false);
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

     * @see ch.fork.AdHocRailway.domain.locomotives.LocomotivePersistenceIface#
     * getLocomotiveByAddress(int)
     */
    @SuppressWarnings("unchecked")
    public Locomotive getLocomotiveByBusAddress(int bus, int address) {
        Locomotive locomotive = addressLocomotiveCache.get(new SRCPAddress(bus,
                address, 0, 0));
        if (locomotive != null)
            return locomotive;
        throw new LocomotivePersistenceException("Locomotive with bus " + bus
                + " and address " + address + " not found");
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

     *
     * @see ch.fork.AdHocRailway.domain.locomotives.LocomotivePersistenceIface#
     * addLocomotive(ch.fork.AdHocRailway.domain.locomotives.Locomotive)
     */
    public void addLocomotive(Locomotive locomotive) {
        addressLocomotiveCache.put(new SRCPAddress(locomotive.getBus(),
                locomotive.getAddress(), 0, 0), locomotive);
        locomotiveCache.add(locomotive);
    }
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

     * @see ch.fork.AdHocRailway.domain.turnouts.TurnoutPersistenceIface#
     * getTurnoutByAddressBus(int, int)
     */
    public Turnout getTurnoutByAddressBus(int bus, int address) {
        logger.debug("getTurnoutByAddressBus()");
        SRCPAddress key1 = new SRCPAddress(bus, address, 0, 0);
        Turnout lookup1 = addressTurnoutCache.get(key1);
        if (lookup1 != null)
            return lookup1;
        SRCPAddress key2 = new SRCPAddress(0, 0, bus, address);
        Turnout lookup2 = addressTurnoutCache.get(key2);
        if (lookup2 != null)
            return lookup2;
        Turnout threewayLookup1 = addressThreewayCache.get(key1);
        if (threewayLookup1 != null)
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

                    "Turnout has no associated Group");
        }
        turnout.getTurnoutGroup().getTurnouts().add(turnout);

        addressTurnoutCache.put(
                new SRCPAddress(turnout.getBus1(), turnout.getAddress1(),
                        turnout.getBus2(), turnout.getAddress2()), turnout);
        turnoutCache.add(turnout);
        if (turnout.isThreeWay()) {
            addressThreewayCache.put(
                    new SRCPAddress(turnout.getBus1(), turnout.getAddress1(),
                            0, 0), turnout);
            addressThreewayCache.put(new SRCPAddress(0, 0, turnout.getBus2(),
                    turnout.getAddress2()), turnout);
        }
        numberToTurnoutCache.put(turnout.getNumber(), turnout);
    }
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

    public void update(Set<SRCPLocomotive> locomotives) {
        srcpLocomotives.clear();
        addressLocomotiveCache.clear();
        for (SRCPLocomotive l : locomotives) {
            SRCPAddress addr = new SRCPAddress(l.getBus(), l.getAddress());
            addressLocomotiveCache.put(addr, l);
            srcpLocomotives.add(l);
            l.setSession(session);
        }
    }
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

    public void GLinit(double timestamp, int bus, int address, String protocol,
            String[] params) {
        logger.debug("GLinit( " + bus + " , " + address + " , " + protocol
                + " , " + Arrays.toString(params) + " )");
        SRCPLocomotive locomotive = addressLocomotiveCache.get(new SRCPAddress(
                bus, address));
        if (locomotive == null)
            // ignore unknown locomotive
            return;
        try {
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

            int v, int vMax, boolean[] functions) {

        logger.debug("GLset( " + bus + " , " + address + " , " + drivemode
                + " , " + v + " , " + vMax + " , " + Arrays.toString(functions)
                + " )");
        SRCPLocomotive locomotive = addressLocomotiveCache.get(new SRCPAddress(
                bus, address));
        try {
            checkLocomotive(locomotive);
        } catch (SRCPModelException e1) {
            // ignore unknown locomotive
View Full Code Here

Examples of de.dermoba.srcp.model.SRCPAddress

    }

    public void GLterm(double timestamp, int bus, int address) {
        logger.debug("GLterm( " + bus + " , " + address + " )");

        SRCPLocomotive locomotive = addressLocomotiveCache.get(new SRCPAddress(
                bus, address));
        try {
            checkLocomotive(locomotive);
        } catch (SRCPModelException e1) {
            // ignore unknown locomotive
        }
        if (locomotive != null) {
            locomotive.setGL(null);
            lockControl.unregisterControlObject("GL", new SRCPAddress(bus,
                    address));
            locomotive.setInitialized(false);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.